@nivaro/react 0.3.58 → 0.3.60
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/dist/components/fields/RelationField.js +110 -80
- package/dist/full.css +1 -1
- package/dist/hooks/useRelationOptions.js +1 -0
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +523 -520
- package/dist/shared/components/CollectionBrowserView.js +2083 -2052
- package/dist/shared/components/DataTable.js +497 -465
- package/dist/shared/components/ItemEditForm.js +4430 -4282
- package/dist/shared/components/PageRenderer.js +537 -508
- package/dist/shared/components/QueryTable.js +74 -74
- package/dist/shared/components/WidgetSlot.js +543 -520
- package/dist/shared/components/alerts/AlertManagerView.js +269 -275
- package/dist/shared/components/alerts/types.js +37 -14
- package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
- package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
- package/dist/shared/components/item-edit/InlineTableField.js +2461 -2421
- package/dist/shared/components/item-edit/M2MCombobox.js +141 -137
- package/dist/shared/components/item-edit/PlanGrid.js +876 -820
- package/dist/shared/components/item-edit/QuickCreateButton.js +323 -130
- package/dist/shared/components/item-edit/RelationCombobox.js +408 -375
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +255 -156
- package/dist/shared/components/item-edit/SummaryPanel.js +356 -343
- package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
- package/dist/shared/components/item-edit/line-midair.js +82 -75
- package/dist/shared/components/item-edit/save-outcome.js +6 -4
- package/dist/shared/components/panels/ItemLockBanner.js +212 -209
- package/dist/shared/components/panels/PipelinePanel.js +775 -737
- package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
- package/dist/shared/components/panels/RevisionsPanel.js +313 -299
- package/dist/shared/components/pipeline/PipelineEditorView.js +26 -16
- package/dist/shared/components/queue/QueueQuickFilters.js +13 -13
- package/dist/shared/components/queue/QueueWorklist.js +978 -953
- package/dist/shared/components/queue/live-state-aspect.js +9 -5
- package/dist/shared/components/widgets/ReviewListWidget.js +152 -149
- package/dist/shared/lib/display-prefs.js +60 -52
- package/dist/shared/lib/draft-store.js +71 -48
- package/dist/shared/lib/expression.js +53 -53
- package/dist/shared/lib/list-page-memory.js +42 -20
- package/dist/shared/lib/money-input.js +45 -0
- package/dist/shared/lib/sanitize-html.js +10 -6
- package/dist/shared/lib/staged-row-labels.js +18 -0
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { get as
|
|
6
|
-
import { useAfterIdle as
|
|
7
|
-
import { formatRelative as
|
|
8
|
-
function
|
|
9
|
-
const u =
|
|
2
|
+
import { useQuery as K, useQueryClient as Z, useMutation as I } from "@tanstack/react-query";
|
|
3
|
+
import { useState as f, useMemo as J, useEffect as ee } from "react";
|
|
4
|
+
import { useNivaroClient as W } from "../../context.js";
|
|
5
|
+
import { get as G, post as q } from "../../lib/commands.js";
|
|
6
|
+
import { useAfterIdle as te } from "../../lib/defer.js";
|
|
7
|
+
import { formatRelative as ne, cn as S, titleCase as re } from "../../lib/utils.js";
|
|
8
|
+
function ae(n, t, a = !0) {
|
|
9
|
+
const u = W(), { data: i } = K({
|
|
10
10
|
queryKey: ["record-integrity", n, t],
|
|
11
11
|
enabled: a,
|
|
12
12
|
queryFn: () => u.request(
|
|
13
|
-
|
|
14
|
-
).then((
|
|
13
|
+
G(`/config-conformance/record/${n}/${encodeURIComponent(t)}`)
|
|
14
|
+
).then((p) => p.data).catch(() => ({ enabled: !1, findings: [] })),
|
|
15
15
|
staleTime: 5 * 6e4
|
|
16
|
-
}),
|
|
16
|
+
}), g = te(2e3), { data: b, isFetching: m } = K({
|
|
17
17
|
queryKey: ["record-integrity", n, t, "live"],
|
|
18
|
-
enabled: a &&
|
|
18
|
+
enabled: a && g,
|
|
19
19
|
queryFn: () => u.request(
|
|
20
20
|
q(`/config-conformance/record/${n}/${encodeURIComponent(t)}/check`, {})
|
|
21
|
-
).then((
|
|
21
|
+
).then((p) => p.data).catch(() => null),
|
|
22
22
|
staleTime: 6e4,
|
|
23
23
|
// Never spin the banner on a background refetch storm — one live check per
|
|
24
24
|
// mount / invalidation is the contract.
|
|
25
25
|
refetchOnWindowFocus: !1
|
|
26
26
|
});
|
|
27
|
-
return { data:
|
|
27
|
+
return { data: b ?? i, checking: m };
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
29
|
+
const ie = "nvr:own-record-writes";
|
|
30
|
+
function H(n) {
|
|
31
31
|
var a;
|
|
32
32
|
const t = [];
|
|
33
33
|
for (const u of n.writes ?? []) {
|
|
@@ -36,17 +36,17 @@ function T(n) {
|
|
|
36
36
|
}
|
|
37
37
|
return (a = n.pick) != null && a.collection && n.pick.item_id && t.push({ collection: n.pick.collection, id: String(n.pick.item_id) }), t;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Y(n) {
|
|
40
40
|
n.length === 0 || typeof window > "u" || window.dispatchEvent(
|
|
41
|
-
new CustomEvent(
|
|
41
|
+
new CustomEvent(ie, { detail: { writes: n } })
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function de(n, t) {
|
|
45
45
|
var u;
|
|
46
46
|
const a = t == null ? void 0 : t.find((i) => i.field === n);
|
|
47
|
-
return ((u = a == null ? void 0 : a.label) == null ? void 0 : u.trim()) ||
|
|
47
|
+
return ((u = a == null ? void 0 : a.label) == null ? void 0 : u.trim()) || re(n);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function ge(n) {
|
|
50
50
|
const t = /* @__PURE__ */ new Map();
|
|
51
51
|
for (const a of n ?? []) {
|
|
52
52
|
const u = t.get(a.field) ?? [];
|
|
@@ -54,7 +54,7 @@ function xe(n) {
|
|
|
54
54
|
}
|
|
55
55
|
return t;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const z = {
|
|
58
58
|
high: { dot: "bg-emerald-500", text: "Confident" },
|
|
59
59
|
medium: { dot: "bg-amber-500", text: "Likely" },
|
|
60
60
|
low: { dot: "bg-slate-400", text: "Manual" }
|
|
@@ -64,13 +64,13 @@ function pe({
|
|
|
64
64
|
itemId: t,
|
|
65
65
|
onJumpToField: a
|
|
66
66
|
}) {
|
|
67
|
-
var
|
|
68
|
-
const u =
|
|
67
|
+
var R;
|
|
68
|
+
const u = W(), i = Z(), [g, b] = f(!1), [m, p] = f(null), { data: s, checking: E } = ae(n, t), { data: y } = K({
|
|
69
69
|
queryKey: ["field-config", n, null],
|
|
70
|
-
queryFn: () => u.request(
|
|
71
|
-
enabled: !!((
|
|
70
|
+
queryFn: () => u.request(G(`/field-config/${n}`)).then((l) => l.data ?? []),
|
|
71
|
+
enabled: !!((R = s == null ? void 0 : s.findings) != null && R.length),
|
|
72
72
|
staleTime: 6e4
|
|
73
|
-
}),
|
|
73
|
+
}), L = () => {
|
|
74
74
|
i.invalidateQueries({ queryKey: ["record-integrity", n, t] }), i.invalidateQueries({ queryKey: ["item", n, t] }), i.invalidateQueries({ queryKey: [n, t] }), i.invalidateQueries({ queryKey: ["o2m-rows"] }), i.invalidateQueries({ queryKey: ["revisions"] });
|
|
75
75
|
};
|
|
76
76
|
if (!(s != null && s.enabled) || s.findings.length === 0) return null;
|
|
@@ -110,7 +110,7 @@ function pe({
|
|
|
110
110
|
title: new Date(s.checked_at).toLocaleString(),
|
|
111
111
|
children: [
|
|
112
112
|
"checked ",
|
|
113
|
-
|
|
113
|
+
ne(s.checked_at)
|
|
114
114
|
]
|
|
115
115
|
}
|
|
116
116
|
) : null,
|
|
@@ -118,13 +118,13 @@ function pe({
|
|
|
118
118
|
"button",
|
|
119
119
|
{
|
|
120
120
|
type: "button",
|
|
121
|
-
onClick: () =>
|
|
121
|
+
onClick: () => b((l) => !l),
|
|
122
122
|
className: "ml-auto text-[11.5px] font-medium text-amber-700 underline decoration-dotted underline-offset-2 dark:text-amber-300",
|
|
123
|
-
children:
|
|
123
|
+
children: g ? "Hide" : "View"
|
|
124
124
|
}
|
|
125
125
|
)
|
|
126
126
|
] }),
|
|
127
|
-
|
|
127
|
+
g && /* @__PURE__ */ r("div", { className: "mt-1.5 space-y-1", children: s.findings.map((l, k) => /* @__PURE__ */ d("div", { children: [
|
|
128
128
|
/* @__PURE__ */ d("div", { className: "flex items-baseline gap-2 text-[12px]", children: [
|
|
129
129
|
/* @__PURE__ */ r(
|
|
130
130
|
"button",
|
|
@@ -133,7 +133,7 @@ function pe({
|
|
|
133
133
|
onClick: () => a == null ? void 0 : a(l.field),
|
|
134
134
|
"data-integrity-field": l.field,
|
|
135
135
|
className: "shrink-0 text-[11.5px] font-medium text-amber-700 underline decoration-dotted underline-offset-2 dark:text-amber-300",
|
|
136
|
-
children:
|
|
136
|
+
children: de(l.field, y)
|
|
137
137
|
}
|
|
138
138
|
),
|
|
139
139
|
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 text-amber-800 dark:text-amber-200/90", children: l.message }),
|
|
@@ -141,8 +141,8 @@ function pe({
|
|
|
141
141
|
"button",
|
|
142
142
|
{
|
|
143
143
|
type: "button",
|
|
144
|
-
onClick: () =>
|
|
145
|
-
className:
|
|
144
|
+
onClick: () => p((h) => h === k ? null : k),
|
|
145
|
+
className: S(
|
|
146
146
|
"shrink-0 rounded px-2 py-0.5 text-[10.5px] font-semibold transition-colors",
|
|
147
147
|
m === k ? "bg-amber-200 text-amber-900 dark:bg-amber-400/30 dark:text-amber-100" : "bg-amber-600 text-white hover:bg-amber-700"
|
|
148
148
|
),
|
|
@@ -151,13 +151,13 @@ function pe({
|
|
|
151
151
|
)
|
|
152
152
|
] }),
|
|
153
153
|
m === k && /* @__PURE__ */ r(
|
|
154
|
-
|
|
154
|
+
oe,
|
|
155
155
|
{
|
|
156
156
|
collection: n,
|
|
157
157
|
itemId: t,
|
|
158
158
|
finding: l,
|
|
159
|
-
onApplied:
|
|
160
|
-
onClose: () =>
|
|
159
|
+
onApplied: L,
|
|
160
|
+
onClose: () => p(null)
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
] }, `${l.field}|${l.rule}|${k}`)) })
|
|
@@ -165,27 +165,27 @@ function pe({
|
|
|
165
165
|
}
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function oe({
|
|
169
169
|
collection: n,
|
|
170
170
|
itemId: t,
|
|
171
171
|
finding: a,
|
|
172
172
|
onApplied: u,
|
|
173
173
|
onClose: i
|
|
174
174
|
}) {
|
|
175
|
-
const
|
|
175
|
+
const g = W(), b = `/config-conformance/record/${n}/${encodeURIComponent(t)}`, m = { field: a.field, rule: a.rule, message: a.message }, { data: p, isLoading: s, error: E } = K({
|
|
176
176
|
queryKey: ["integrity-proposals", n, t, a.field, a.rule],
|
|
177
|
-
queryFn: () =>
|
|
177
|
+
queryFn: () => g.request(q(`${b}/proposals`, m)).then((e) => e.data.proposals),
|
|
178
178
|
staleTime: 6e4
|
|
179
|
-
}), [y,
|
|
180
|
-
|
|
179
|
+
}), [y, L] = f([]), [v, R] = f({}), [l, k] = f(""), [h, M] = f(null), [j, D] = f(0), [B, N] = f(null), [T, X] = f(null), [_, O] = f(null), V = J(() => [...p ?? [], ...y], [p, y]);
|
|
180
|
+
ee(() => {
|
|
181
181
|
if (!h || h.undo.length === 0) return;
|
|
182
|
-
|
|
183
|
-
const e = setInterval(() =>
|
|
182
|
+
D(30);
|
|
183
|
+
const e = setInterval(() => D((c) => c <= 1 ? 0 : c - 1), 1e3);
|
|
184
184
|
return () => clearInterval(e);
|
|
185
185
|
}, [h]);
|
|
186
|
-
const
|
|
187
|
-
mutationFn: (e) =>
|
|
188
|
-
q(`${
|
|
186
|
+
const A = I({
|
|
187
|
+
mutationFn: (e) => g.request(
|
|
188
|
+
q(`${b}/fix`, {
|
|
189
189
|
...m,
|
|
190
190
|
proposal_id: e.id,
|
|
191
191
|
choice: e.kind === "pick" ? v[e.id] : void 0
|
|
@@ -193,26 +193,26 @@ function ie({
|
|
|
193
193
|
),
|
|
194
194
|
onSuccess: (e, c) => {
|
|
195
195
|
var C, $, o;
|
|
196
|
-
N(null),
|
|
196
|
+
N(null), Y(H(c)), X(c);
|
|
197
197
|
const x = e.data, w = ((C = x.failed) == null ? void 0 : C.length) ?? 0;
|
|
198
|
-
|
|
198
|
+
M({
|
|
199
199
|
text: c.kind === "notify" ? `Sent to ${(($ = c.notify) == null ? void 0 : $.name) ?? "the owner"} as a task.` : `${x.applied} write${x.applied === 1 ? "" : "s"} applied${w ? ` — ${w} failed: ${((o = x.failed[0]) == null ? void 0 : o.error) ?? ""}` : ""}.`,
|
|
200
200
|
undo: x.undo ?? []
|
|
201
201
|
}), u();
|
|
202
202
|
},
|
|
203
|
-
onError: (e) => N(
|
|
204
|
-
}),
|
|
205
|
-
mutationFn: (e) =>
|
|
203
|
+
onError: (e) => N(F(e))
|
|
204
|
+
}), P = I({
|
|
205
|
+
mutationFn: (e) => g.request(q(`${b}/fix`, { ...m, undo: e })),
|
|
206
206
|
onSuccess: () => {
|
|
207
|
-
|
|
207
|
+
T && Y(H(T)), M({ text: "Undone.", undo: [] }), u();
|
|
208
208
|
},
|
|
209
|
-
onError: (e) => N(
|
|
210
|
-
}),
|
|
211
|
-
mutationFn: () =>
|
|
209
|
+
onError: (e) => N(F(e))
|
|
210
|
+
}), Q = I({
|
|
211
|
+
mutationFn: () => g.request(q(`${b}/proposals/ai`, m)).then((e) => e.data.proposal),
|
|
212
212
|
onSuccess: (e) => {
|
|
213
|
-
N(null),
|
|
213
|
+
N(null), L((c) => c.some((x) => x.id === e.id) ? c : [...c, e]);
|
|
214
214
|
},
|
|
215
|
-
onError: (e) => N(
|
|
215
|
+
onError: (e) => N(F(e))
|
|
216
216
|
});
|
|
217
217
|
return /* @__PURE__ */ d(
|
|
218
218
|
"div",
|
|
@@ -221,17 +221,17 @@ function ie({
|
|
|
221
221
|
className: "mt-1.5 rounded-md border border-amber-200/80 bg-white/70 px-3 py-2 dark:border-amber-500/20 dark:bg-black/20",
|
|
222
222
|
children: [
|
|
223
223
|
s && /* @__PURE__ */ r("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Working out what would fix this…" }),
|
|
224
|
-
E && /* @__PURE__ */ r("p", { className: "text-[11.5px] text-red-600 dark:text-red-400", children:
|
|
224
|
+
E && /* @__PURE__ */ r("p", { className: "text-[11.5px] text-red-600 dark:text-red-400", children: F(E) }),
|
|
225
225
|
h ? /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2 text-[11.5px]", children: [
|
|
226
226
|
/* @__PURE__ */ r("span", { className: "font-medium text-emerald-700 dark:text-emerald-400", children: h.text }),
|
|
227
|
-
h.undo.length > 0 &&
|
|
227
|
+
h.undo.length > 0 && j > 0 && /* @__PURE__ */ r(
|
|
228
228
|
"button",
|
|
229
229
|
{
|
|
230
230
|
type: "button",
|
|
231
|
-
disabled:
|
|
232
|
-
onClick: () =>
|
|
231
|
+
disabled: P.isPending,
|
|
232
|
+
onClick: () => P.mutate(h.undo),
|
|
233
233
|
className: "rounded border border-slate-300 px-2 py-0.5 text-[11px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
234
|
-
children:
|
|
234
|
+
children: P.isPending ? "Undoing…" : `Undo (${j}s)`
|
|
235
235
|
}
|
|
236
236
|
),
|
|
237
237
|
/* @__PURE__ */ r(
|
|
@@ -244,10 +244,10 @@ function ie({
|
|
|
244
244
|
}
|
|
245
245
|
)
|
|
246
246
|
] }) : !s && /* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
V.length === 0 && /* @__PURE__ */ r("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing on this record can derive a value — fix it by hand on the form." }),
|
|
248
|
+
V.map((e) => {
|
|
249
249
|
var C, $;
|
|
250
|
-
const c =
|
|
250
|
+
const c = z[e.confidence] ?? z.low, x = v[e.id], w = (e.choices ?? []).filter(
|
|
251
251
|
(o) => !l || o.label.toLowerCase().includes(l.toLowerCase())
|
|
252
252
|
);
|
|
253
253
|
return /* @__PURE__ */ r(
|
|
@@ -258,7 +258,7 @@ function ie({
|
|
|
258
258
|
/* @__PURE__ */ r(
|
|
259
259
|
"span",
|
|
260
260
|
{
|
|
261
|
-
className:
|
|
261
|
+
className: S("mt-1.5 h-2 w-2 shrink-0 rounded-full", c.dot),
|
|
262
262
|
title: c.text,
|
|
263
263
|
"data-tip": c.text
|
|
264
264
|
}
|
|
@@ -269,8 +269,29 @@ function ie({
|
|
|
269
269
|
/* @__PURE__ */ r("span", { className: "ml-1.5 text-[10px] font-normal uppercase tracking-wide text-slate-400", children: e.kind === "ai" ? "AI" : c.text })
|
|
270
270
|
] }),
|
|
271
271
|
/* @__PURE__ */ r("p", { className: "text-[11px] leading-snug text-slate-500 dark:text-muted-foreground", children: e.basis }),
|
|
272
|
+
e.confirm && _ === e.id && /* @__PURE__ */ d(
|
|
273
|
+
"p",
|
|
274
|
+
{
|
|
275
|
+
role: "alert",
|
|
276
|
+
"data-integrity-confirm": !0,
|
|
277
|
+
className: "mt-1 text-[11px] font-medium leading-snug text-red-700 dark:text-red-300",
|
|
278
|
+
children: [
|
|
279
|
+
e.confirm,
|
|
280
|
+
" ",
|
|
281
|
+
/* @__PURE__ */ r(
|
|
282
|
+
"button",
|
|
283
|
+
{
|
|
284
|
+
type: "button",
|
|
285
|
+
onClick: () => O(null),
|
|
286
|
+
className: "font-normal text-slate-600 underline underline-offset-2 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",
|
|
287
|
+
children: "Keep it"
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
),
|
|
272
293
|
e.preview.length > 0 && /* @__PURE__ */ d("div", { className: "mt-1 flex flex-wrap gap-1", children: [
|
|
273
|
-
e.preview.slice(0, 8).map((o,
|
|
294
|
+
e.preview.slice(0, 8).map((o, U) => /* @__PURE__ */ d(
|
|
274
295
|
"span",
|
|
275
296
|
{
|
|
276
297
|
className: "rounded bg-slate-100 px-1.5 py-0.5 text-[10.5px] text-slate-700 dark:bg-muted dark:text-foreground",
|
|
@@ -283,7 +304,7 @@ function ie({
|
|
|
283
304
|
/* @__PURE__ */ r("span", { className: "font-medium", children: o.to })
|
|
284
305
|
]
|
|
285
306
|
},
|
|
286
|
-
`${o.item_id}|${o.field}|${
|
|
307
|
+
`${o.item_id}|${o.field}|${U}`
|
|
287
308
|
)),
|
|
288
309
|
e.preview.length > 8 && /* @__PURE__ */ d("span", { className: "text-[10.5px] text-slate-400", children: [
|
|
289
310
|
"+",
|
|
@@ -306,8 +327,8 @@ function ie({
|
|
|
306
327
|
"button",
|
|
307
328
|
{
|
|
308
329
|
type: "button",
|
|
309
|
-
onClick: () =>
|
|
310
|
-
className:
|
|
330
|
+
onClick: () => R((U) => ({ ...U, [e.id]: o.id })),
|
|
331
|
+
className: S(
|
|
311
332
|
"rounded border px-1.5 py-0.5 text-[11px] transition-colors",
|
|
312
333
|
x === o.id ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-900 dark:text-foreground" : "border-slate-200 text-slate-700 hover:bg-muted dark:border-border dark:text-foreground"
|
|
313
334
|
),
|
|
@@ -323,13 +344,20 @@ function ie({
|
|
|
323
344
|
"button",
|
|
324
345
|
{
|
|
325
346
|
type: "button",
|
|
326
|
-
disabled:
|
|
327
|
-
|
|
328
|
-
|
|
347
|
+
disabled: A.isPending || e.kind === "pick" && !x,
|
|
348
|
+
"data-integrity-apply": e.id,
|
|
349
|
+
onClick: () => {
|
|
350
|
+
if (e.confirm && _ !== e.id) {
|
|
351
|
+
O(e.id);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
O(null), A.mutate(e);
|
|
355
|
+
},
|
|
356
|
+
className: S(
|
|
329
357
|
"shrink-0 rounded px-2 py-0.5 text-[10.5px] font-semibold text-white transition-colors disabled:opacity-50",
|
|
330
|
-
e.kind === "notify" ? "bg-slate-600 hover:bg-slate-700" : "bg-nvr-cyan hover:bg-nvr-cyan-dark"
|
|
358
|
+
e.confirm && _ === e.id ? "bg-red-600 hover:bg-red-700" : e.kind === "notify" ? "bg-slate-600 hover:bg-slate-700" : "bg-nvr-cyan hover:bg-nvr-cyan-dark"
|
|
331
359
|
),
|
|
332
|
-
children:
|
|
360
|
+
children: A.isPending && (($ = A.variables) == null ? void 0 : $.id) === e.id ? "Applying…" : e.confirm && _ === e.id ? "Yes, remove" : e.kind === "notify" ? "Send" : e.confirm ? "Remove" : "Apply"
|
|
333
361
|
}
|
|
334
362
|
)
|
|
335
363
|
] })
|
|
@@ -342,10 +370,10 @@ function ie({
|
|
|
342
370
|
"button",
|
|
343
371
|
{
|
|
344
372
|
type: "button",
|
|
345
|
-
disabled:
|
|
346
|
-
onClick: () =>
|
|
373
|
+
disabled: Q.isPending,
|
|
374
|
+
onClick: () => Q.mutate(),
|
|
347
375
|
className: "text-[11px] font-medium text-slate-600 underline decoration-dotted underline-offset-2 hover:text-slate-900 disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground",
|
|
348
|
-
children:
|
|
376
|
+
children: Q.isPending ? "Asking AI…" : "Ask AI for a suggestion"
|
|
349
377
|
}
|
|
350
378
|
),
|
|
351
379
|
/* @__PURE__ */ r(
|
|
@@ -358,22 +386,22 @@ function ie({
|
|
|
358
386
|
}
|
|
359
387
|
)
|
|
360
388
|
] }),
|
|
361
|
-
|
|
389
|
+
B && /* @__PURE__ */ r("p", { className: "text-[11px] text-red-600 dark:text-red-400", children: B })
|
|
362
390
|
] })
|
|
363
391
|
]
|
|
364
392
|
}
|
|
365
393
|
);
|
|
366
394
|
}
|
|
367
|
-
function
|
|
395
|
+
function F(n) {
|
|
368
396
|
var a;
|
|
369
397
|
const t = n;
|
|
370
398
|
return String(((a = t == null ? void 0 : t.response) == null ? void 0 : a.error) ?? (t == null ? void 0 : t.message) ?? "Request failed");
|
|
371
399
|
}
|
|
372
400
|
export {
|
|
373
|
-
|
|
401
|
+
ie as OWN_RECORD_WRITES_EVENT,
|
|
374
402
|
pe as RecordIntegrityBanner,
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
403
|
+
de as findingFieldLabel,
|
|
404
|
+
ge as integrityByField,
|
|
405
|
+
H as ownWritesOf,
|
|
406
|
+
ae as useRecordIntegrity
|
|
379
407
|
};
|