@nivaro/react 0.3.111 → 0.3.113
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +207 -3
- package/dist/index.js +745 -728
- package/dist/shared/components/CollectionBrowserView.js +3133 -2954
- package/dist/shared/components/CollectionImportBanner.js +135 -0
- package/dist/shared/components/ItemEditForm.js +2235 -2218
- package/dist/shared/components/JobsTray.js +54 -47
- package/dist/shared/components/ViewAsPersonButton.js +109 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
- package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
- package/dist/shared/components/bulk/bulk-field-options.js +20 -19
- package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
- package/dist/shared/components/cbv/ColumnHeaderMenu.js +130 -0
- package/dist/shared/components/cbv/column-totals.js +163 -0
- package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
- package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
- package/dist/shared/components/collections-directory/directory-data.js +70 -58
- package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
- package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
- package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
- package/dist/shared/components/item-edit/FieldRow.js +248 -246
- package/dist/shared/components/item-edit/InlineGridField.js +34 -33
- package/dist/shared/components/item-edit/InlineTableField.js +3002 -2825
- package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
- package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
- package/dist/shared/components/item-edit/PlanGrid.js +2 -1
- package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
- package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
- package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
- package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
- package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
- package/dist/shared/components/item-edit/UserChip.js +262 -239
- package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
- package/dist/shared/components/item-edit/grid-search.js +375 -0
- package/dist/shared/components/item-edit/render-stability.js +61 -54
- package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
- package/dist/shared/components/ops-report/DigestSections.js +163 -144
- package/dist/shared/components/ops-report/drill.js +97 -97
- package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
- package/dist/shared/components/panels/AddendumPanel.js +92 -91
- package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
- package/dist/shared/components/panels/CommentPanel.js +265 -252
- package/dist/shared/components/panels/OwnersSlot.js +47 -35
- package/dist/shared/components/panels/PipelineInsight.js +186 -0
- package/dist/shared/components/panels/PipelinePanel.js +1440 -1397
- package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
- package/dist/shared/components/panels/RevisionsPanel.js +261 -260
- package/dist/shared/components/panels/StandInReason.js +69 -0
- package/dist/shared/components/pipeline/FieldPicker.js +41 -40
- package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
- package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
- package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
- package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
- package/dist/shared/components/profile/PersonHeader.js +29 -29
- package/dist/shared/components/profile/PersonProfile.js +30 -28
- package/dist/shared/components/profile/SlowScreensCard.js +286 -0
- package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
- package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
- package/dist/shared/components/support/TicketDetailSheet.js +25 -16
- package/dist/shared/components/support/TicketSlowScreens.js +32 -0
- package/dist/shared/lib/activity-sentence.js +224 -178
- package/dist/shared/lib/collection-import-banner.js +27 -0
- package/dist/shared/lib/crash-report.js +112 -0
- package/dist/shared/lib/export-runs.js +99 -0
- package/dist/shared/lib/jobs-tray.js +89 -67
- package/dist/shared/lib/list-link.js +76 -69
- package/dist/shared/lib/nav-trail.js +180 -76
- package/dist/shared/lib/query-keys.js +26 -0
- package/dist/shared/lib/view-as.js +16 -11
- package/package.json +1 -1
|
@@ -4,10 +4,11 @@ import { useState as f, useMemo as J, useEffect as ee } from "react";
|
|
|
4
4
|
import { useNivaroClient as W } from "../../context.js";
|
|
5
5
|
import { get as G, post as q } from "../../lib/commands.js";
|
|
6
6
|
import { useAfterIdle as te } from "../../lib/defer.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { queryKeys as re } from "../../lib/query-keys.js";
|
|
8
|
+
import { hasRecordExtras as ne } from "../../lib/system-collections.js";
|
|
9
|
+
import { formatRelative as ae, formatDateTime as ie, cn as K, titleCase as de } from "../../lib/utils.js";
|
|
10
|
+
function oe(t, r, a = !0) {
|
|
11
|
+
const u = W(), i = a && ne(t), { data: p } = S({
|
|
11
12
|
queryKey: ["record-integrity", t, r],
|
|
12
13
|
enabled: i,
|
|
13
14
|
queryFn: () => u.request(
|
|
@@ -25,9 +26,9 @@ function de(t, r, a = !0) {
|
|
|
25
26
|
// mount / invalidation is the contract.
|
|
26
27
|
refetchOnWindowFocus: !1
|
|
27
28
|
});
|
|
28
|
-
return { data: m ??
|
|
29
|
+
return { data: m ?? p, checking: k };
|
|
29
30
|
}
|
|
30
|
-
const
|
|
31
|
+
const se = "nvr:own-record-writes";
|
|
31
32
|
function H(t) {
|
|
32
33
|
var a;
|
|
33
34
|
const r = [];
|
|
@@ -39,15 +40,15 @@ function H(t) {
|
|
|
39
40
|
}
|
|
40
41
|
function Y(t) {
|
|
41
42
|
t.length === 0 || typeof window > "u" || window.dispatchEvent(
|
|
42
|
-
new CustomEvent(
|
|
43
|
+
new CustomEvent(se, { detail: { writes: t } })
|
|
43
44
|
);
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function le(t, r) {
|
|
46
47
|
var u;
|
|
47
48
|
const a = r == null ? void 0 : r.find((i) => i.field === t);
|
|
48
|
-
return ((u = a == null ? void 0 : a.label) == null ? void 0 : u.trim()) ||
|
|
49
|
+
return ((u = a == null ? void 0 : a.label) == null ? void 0 : u.trim()) || de(t);
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function ye(t) {
|
|
51
52
|
const r = /* @__PURE__ */ new Map();
|
|
52
53
|
for (const a of t ?? []) {
|
|
53
54
|
const u = r.get(a.field) ?? [];
|
|
@@ -60,14 +61,14 @@ const z = {
|
|
|
60
61
|
medium: { dot: "bg-amber-500", text: "Likely" },
|
|
61
62
|
low: { dot: "bg-slate-400", text: "Manual" }
|
|
62
63
|
};
|
|
63
|
-
function
|
|
64
|
+
function ve({
|
|
64
65
|
collection: t,
|
|
65
66
|
itemId: r,
|
|
66
67
|
onJumpToField: a
|
|
67
68
|
}) {
|
|
68
69
|
var R;
|
|
69
|
-
const u = W(), i = Z(), [
|
|
70
|
-
queryKey:
|
|
70
|
+
const u = W(), i = Z(), [p, h] = f(!1), [m, k] = f(null), { data: d, checking: E } = oe(t, r), { data: y } = S({
|
|
71
|
+
queryKey: re.fieldConfig(t, null),
|
|
71
72
|
queryFn: () => u.request(G(`/field-config/${t}`)).then((l) => l.data ?? []),
|
|
72
73
|
enabled: !!((R = d == null ? void 0 : d.findings) != null && R.length),
|
|
73
74
|
staleTime: 6e4
|
|
@@ -108,10 +109,10 @@ function ke({
|
|
|
108
109
|
{
|
|
109
110
|
className: "text-[11px] text-amber-600/80 dark:text-amber-400/70",
|
|
110
111
|
"data-integrity-checked": "stored",
|
|
111
|
-
title:
|
|
112
|
+
title: ie(d.checked_at),
|
|
112
113
|
children: [
|
|
113
114
|
"checked ",
|
|
114
|
-
|
|
115
|
+
ae(d.checked_at)
|
|
115
116
|
]
|
|
116
117
|
}
|
|
117
118
|
) : null,
|
|
@@ -121,11 +122,11 @@ function ke({
|
|
|
121
122
|
type: "button",
|
|
122
123
|
onClick: () => h((l) => !l),
|
|
123
124
|
className: "ml-auto text-[11.5px] font-medium text-amber-700 underline decoration-dotted underline-offset-2 dark:text-amber-300",
|
|
124
|
-
children:
|
|
125
|
+
children: p ? "Hide" : "View"
|
|
125
126
|
}
|
|
126
127
|
)
|
|
127
128
|
] }),
|
|
128
|
-
|
|
129
|
+
p && /* @__PURE__ */ n("div", { className: "mt-1.5 space-y-1", children: d.findings.map((l, b) => /* @__PURE__ */ o("div", { children: [
|
|
129
130
|
/* @__PURE__ */ o("div", { className: "flex items-baseline gap-2 text-[12px]", children: [
|
|
130
131
|
/* @__PURE__ */ n(
|
|
131
132
|
"button",
|
|
@@ -134,7 +135,7 @@ function ke({
|
|
|
134
135
|
onClick: () => a == null ? void 0 : a(l.field),
|
|
135
136
|
"data-integrity-field": l.field,
|
|
136
137
|
className: "shrink-0 text-[11.5px] font-medium text-amber-700 underline decoration-dotted underline-offset-2 dark:text-amber-300",
|
|
137
|
-
children:
|
|
138
|
+
children: le(l.field, y)
|
|
138
139
|
}
|
|
139
140
|
),
|
|
140
141
|
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 text-amber-800 dark:text-amber-200/90", children: l.message }),
|
|
@@ -142,7 +143,7 @@ function ke({
|
|
|
142
143
|
"button",
|
|
143
144
|
{
|
|
144
145
|
type: "button",
|
|
145
|
-
onClick: () => k((
|
|
146
|
+
onClick: () => k((g) => g === b ? null : b),
|
|
146
147
|
className: K(
|
|
147
148
|
"shrink-0 rounded px-2 py-0.5 text-[10.5px] font-semibold transition-colors",
|
|
148
149
|
m === b ? "bg-amber-200 text-amber-900 dark:bg-amber-400/30 dark:text-amber-100" : "bg-amber-600 text-white hover:bg-amber-700"
|
|
@@ -152,7 +153,7 @@ function ke({
|
|
|
152
153
|
)
|
|
153
154
|
] }),
|
|
154
155
|
m === b && /* @__PURE__ */ n(
|
|
155
|
-
|
|
156
|
+
ce,
|
|
156
157
|
{
|
|
157
158
|
collection: t,
|
|
158
159
|
itemId: r,
|
|
@@ -166,26 +167,26 @@ function ke({
|
|
|
166
167
|
}
|
|
167
168
|
);
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
+
function ce({
|
|
170
171
|
collection: t,
|
|
171
172
|
itemId: r,
|
|
172
173
|
finding: a,
|
|
173
174
|
onApplied: u,
|
|
174
175
|
onClose: i
|
|
175
176
|
}) {
|
|
176
|
-
const
|
|
177
|
+
const p = W(), h = `/config-conformance/record/${t}/${encodeURIComponent(r)}`, m = { field: a.field, rule: a.rule, message: a.message }, { data: k, isLoading: d, error: E } = S({
|
|
177
178
|
queryKey: ["integrity-proposals", t, r, a.field, a.rule],
|
|
178
|
-
queryFn: () =>
|
|
179
|
+
queryFn: () => p.request(q(`${h}/proposals`, m)).then((e) => e.data.proposals),
|
|
179
180
|
staleTime: 6e4
|
|
180
|
-
}), [y, L] = f([]), [v, R] = f({}), [l, b] = f(""), [
|
|
181
|
+
}), [y, L] = f([]), [v, R] = f({}), [l, b] = f(""), [g, M] = f(null), [j, D] = f(0), [T, N] = f(null), [B, X] = f(null), [_, O] = f(null), V = J(() => [...k ?? [], ...y], [k, y]);
|
|
181
182
|
ee(() => {
|
|
182
|
-
if (!
|
|
183
|
+
if (!g || g.undo.length === 0) return;
|
|
183
184
|
D(30);
|
|
184
185
|
const e = setInterval(() => D((c) => c <= 1 ? 0 : c - 1), 1e3);
|
|
185
186
|
return () => clearInterval(e);
|
|
186
|
-
}, [
|
|
187
|
+
}, [g]);
|
|
187
188
|
const A = I({
|
|
188
|
-
mutationFn: (e) =>
|
|
189
|
+
mutationFn: (e) => p.request(
|
|
189
190
|
q(`${h}/fix`, {
|
|
190
191
|
...m,
|
|
191
192
|
proposal_id: e.id,
|
|
@@ -203,13 +204,13 @@ function le({
|
|
|
203
204
|
},
|
|
204
205
|
onError: (e) => N(F(e))
|
|
205
206
|
}), P = I({
|
|
206
|
-
mutationFn: (e) =>
|
|
207
|
+
mutationFn: (e) => p.request(q(`${h}/fix`, { ...m, undo: e })),
|
|
207
208
|
onSuccess: () => {
|
|
208
209
|
B && Y(H(B)), M({ text: "Undone.", undo: [] }), u();
|
|
209
210
|
},
|
|
210
211
|
onError: (e) => N(F(e))
|
|
211
212
|
}), Q = I({
|
|
212
|
-
mutationFn: () =>
|
|
213
|
+
mutationFn: () => p.request(q(`${h}/proposals/ai`, m)).then((e) => e.data.proposal),
|
|
213
214
|
onSuccess: (e) => {
|
|
214
215
|
N(null), L((c) => c.some((x) => x.id === e.id) ? c : [...c, e]);
|
|
215
216
|
},
|
|
@@ -223,14 +224,14 @@ function le({
|
|
|
223
224
|
children: [
|
|
224
225
|
d && /* @__PURE__ */ n("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Working out what would fix this…" }),
|
|
225
226
|
E && /* @__PURE__ */ n("p", { className: "text-[11.5px] text-red-600 dark:text-red-400", children: F(E) }),
|
|
226
|
-
|
|
227
|
-
/* @__PURE__ */ n("span", { className: "font-medium text-emerald-700 dark:text-emerald-400", children:
|
|
228
|
-
|
|
227
|
+
g ? /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-2 text-[11.5px]", children: [
|
|
228
|
+
/* @__PURE__ */ n("span", { className: "font-medium text-emerald-700 dark:text-emerald-400", children: g.text }),
|
|
229
|
+
g.undo.length > 0 && j > 0 && /* @__PURE__ */ n(
|
|
229
230
|
"button",
|
|
230
231
|
{
|
|
231
232
|
type: "button",
|
|
232
233
|
disabled: P.isPending,
|
|
233
|
-
onClick: () => P.mutate(
|
|
234
|
+
onClick: () => P.mutate(g.undo),
|
|
234
235
|
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",
|
|
235
236
|
children: P.isPending ? "Undoing…" : `Undo (${j}s)`
|
|
236
237
|
}
|
|
@@ -399,10 +400,10 @@ function F(t) {
|
|
|
399
400
|
return String(((a = r == null ? void 0 : r.response) == null ? void 0 : a.error) ?? (r == null ? void 0 : r.message) ?? "Request failed");
|
|
400
401
|
}
|
|
401
402
|
export {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
403
|
+
se as OWN_RECORD_WRITES_EVENT,
|
|
404
|
+
ve as RecordIntegrityBanner,
|
|
405
|
+
le as findingFieldLabel,
|
|
406
|
+
ye as integrityByField,
|
|
406
407
|
H as ownWritesOf,
|
|
407
|
-
|
|
408
|
+
oe as useRecordIntegrity
|
|
408
409
|
};
|