@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,11 +4,12 @@ import { Loader2 as ie, X as H, ChevronRight as le } from "lucide-react";
|
|
|
4
4
|
import { memo as de, useState as k, useMemo as U } from "react";
|
|
5
5
|
import { useNivaroClient as oe } from "../../context.js";
|
|
6
6
|
import { getActiveLayout as ce, get as W, patch as pe, del as ue, post as me } from "../../lib/commands.js";
|
|
7
|
-
import {
|
|
7
|
+
import { queryKeys as xe } from "../../lib/query-keys.js";
|
|
8
|
+
import { titleCase as Y, cn as he, toLocalDateString as fe } from "../../lib/utils.js";
|
|
8
9
|
import { NumberDraftInput as be } from "../ui/number-draft-input.js";
|
|
9
|
-
import { useAddendumO2M as
|
|
10
|
-
import { useO2MStaging as
|
|
11
|
-
const
|
|
10
|
+
import { useAddendumO2M as ye, useAddendumView as ge } from "./AddendumFieldContext.js";
|
|
11
|
+
import { useO2MStaging as Ne } from "./O2MStagingContext.js";
|
|
12
|
+
const we = /* @__PURE__ */ new Set([
|
|
12
13
|
"alias",
|
|
13
14
|
"o2m",
|
|
14
15
|
"m2m",
|
|
@@ -16,38 +17,38 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
16
17
|
"presentation",
|
|
17
18
|
"group",
|
|
18
19
|
"divider"
|
|
19
|
-
]),
|
|
20
|
+
]), je = de(function({
|
|
20
21
|
relatedCollection: l,
|
|
21
22
|
manyField: c,
|
|
22
23
|
parentId: m,
|
|
23
|
-
layoutSlug:
|
|
24
|
+
layoutSlug: f,
|
|
24
25
|
parentFieldKey: Z,
|
|
25
26
|
emptyLabel: q
|
|
26
27
|
}) {
|
|
27
28
|
var z;
|
|
28
|
-
const
|
|
29
|
-
queryKey: ["active-layout", l,
|
|
30
|
-
queryFn: () =>
|
|
29
|
+
const b = oe(), P = ae(), x = Ne(), d = m === "new", B = ye()[Z ?? ""] ?? [], [S, C] = k(null), [Q, _] = k({}), [E, w] = k(!1), [R, y] = k({}), [g, $] = k(!1), N = ge(), { data: u } = V({
|
|
30
|
+
queryKey: ["active-layout", l, f ?? null],
|
|
31
|
+
queryFn: () => b.request(
|
|
31
32
|
ce({
|
|
32
33
|
collection: l,
|
|
33
|
-
...
|
|
34
|
+
...f ? { slug: f } : {}
|
|
34
35
|
})
|
|
35
36
|
).then((e) => e.data).catch(() => null),
|
|
36
37
|
staleTime: 6e4,
|
|
37
|
-
enabled: !!
|
|
38
|
-
}), T =
|
|
39
|
-
queryKey:
|
|
40
|
-
queryFn: () =>
|
|
38
|
+
enabled: !!f
|
|
39
|
+
}), T = f ? ((z = u == null ? void 0 : u.layout) == null ? void 0 : z.id) ?? null : null, { data: ee = [] } = V({
|
|
40
|
+
queryKey: xe.fieldConfig(l, T),
|
|
41
|
+
queryFn: () => b.request(
|
|
41
42
|
W(
|
|
42
43
|
`/field-config/${l}`,
|
|
43
44
|
T ? { layout_id: String(T) } : void 0
|
|
44
45
|
)
|
|
45
46
|
).then((e) => e.data ?? []),
|
|
46
47
|
staleTime: 6e4,
|
|
47
|
-
enabled: !
|
|
48
|
+
enabled: !f || u !== void 0
|
|
48
49
|
}), { data: v = [], isLoading: te } = V({
|
|
49
50
|
queryKey: ["o2m-rows", l, c, m],
|
|
50
|
-
queryFn: () =>
|
|
51
|
+
queryFn: () => b.request(
|
|
51
52
|
W(`/items/${l}`, {
|
|
52
53
|
filter: JSON.stringify({ [c]: { _eq: m } }),
|
|
53
54
|
limit: 200
|
|
@@ -56,7 +57,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
56
57
|
enabled: !d,
|
|
57
58
|
staleTime: 3e4
|
|
58
59
|
}), G = d && x ? x.getPendingRows(l, c) : [], o = ee.filter(
|
|
59
|
-
(e) => !e.hidden && !
|
|
60
|
+
(e) => !e.hidden && !we.has(e.type) && e.field !== c && e.field !== "id"
|
|
60
61
|
), A = U(
|
|
61
62
|
() => ((u == null ? void 0 : u.groups) ?? []).filter((e) => e.type === "section").sort((e, r) => e.sort - r.sort),
|
|
62
63
|
[u]
|
|
@@ -72,7 +73,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
72
73
|
async function J(e) {
|
|
73
74
|
$(!0);
|
|
74
75
|
try {
|
|
75
|
-
await
|
|
76
|
+
await b.request(pe(`/items/${l}/${e}`, Q)), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), C(null);
|
|
76
77
|
} catch {
|
|
77
78
|
} finally {
|
|
78
79
|
$(!1);
|
|
@@ -85,7 +86,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
85
86
|
}
|
|
86
87
|
$(!0);
|
|
87
88
|
try {
|
|
88
|
-
await
|
|
89
|
+
await b.request(
|
|
89
90
|
me(`/items/${l}`, { ...R, [c]: m })
|
|
90
91
|
), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), w(!1), y({});
|
|
91
92
|
} catch {
|
|
@@ -95,22 +96,22 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
95
96
|
}
|
|
96
97
|
async function re(e) {
|
|
97
98
|
try {
|
|
98
|
-
await
|
|
99
|
+
await b.request(ue(`/items/${l}/${e}`)), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] });
|
|
99
100
|
} catch {
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
+
function K(e, r) {
|
|
103
104
|
if (r == null) return /* @__PURE__ */ t("span", { className: "text-slate-300", children: "—" });
|
|
104
105
|
if (e.type === "boolean")
|
|
105
106
|
return /* @__PURE__ */ t("span", { className: r ? "text-emerald-600" : "text-slate-400", children: r ? "Yes" : "No" });
|
|
106
107
|
if (e.type === "datetime" || e.type === "date")
|
|
107
108
|
try {
|
|
108
|
-
return /* @__PURE__ */ t("span", { children:
|
|
109
|
+
return /* @__PURE__ */ t("span", { children: fe(r) });
|
|
109
110
|
} catch {
|
|
110
111
|
}
|
|
111
112
|
return /* @__PURE__ */ t("span", { className: "truncate", children: String(r) });
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
+
function I(e, r, n) {
|
|
114
115
|
const s = r[e.field] ?? "";
|
|
115
116
|
return e.type === "boolean" ? /* @__PURE__ */ t(
|
|
116
117
|
"input",
|
|
@@ -185,7 +186,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
185
186
|
/* @__PURE__ */ a("div", { className: "p-3 space-y-4", children: [
|
|
186
187
|
j.length > 0 && /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2", children: j.map((p) => /* @__PURE__ */ a("div", { children: [
|
|
187
188
|
/* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: p.label ?? Y(p.field) }),
|
|
188
|
-
|
|
189
|
+
I(p, e, r)
|
|
189
190
|
] }, p.field)) }),
|
|
190
191
|
A.map((p) => {
|
|
191
192
|
const D = (h == null ? void 0 : h.get(p.key)) ?? [];
|
|
@@ -193,7 +194,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
193
194
|
/* @__PURE__ */ t("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-slate-400 mb-2 pb-1 border-b border-slate-100", children: p.label }),
|
|
194
195
|
/* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2", children: D.map((M) => /* @__PURE__ */ a("div", { children: [
|
|
195
196
|
/* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: M.label ?? Y(M.field) }),
|
|
196
|
-
|
|
197
|
+
I(M, e, r)
|
|
197
198
|
] }, M.field)) })
|
|
198
199
|
] }, p.key) : null;
|
|
199
200
|
})
|
|
@@ -201,7 +202,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
201
202
|
] });
|
|
202
203
|
}
|
|
203
204
|
function ne(e, r) {
|
|
204
|
-
return o.map((n) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children:
|
|
205
|
+
return o.map((n) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: I(n, e, r) }, n.field));
|
|
205
206
|
}
|
|
206
207
|
if (!d && te)
|
|
207
208
|
return /* @__PURE__ */ t("div", { className: "py-3 text-center text-[12px] text-slate-400", children: /* @__PURE__ */ t(ie, { className: "h-4 w-4 animate-spin inline" }) });
|
|
@@ -227,7 +228,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
227
228
|
/* @__PURE__ */ a("tbody", { children: [
|
|
228
229
|
d && G.map((e, r) => /* @__PURE__ */ a("tr", { className: "border-b border-slate-100 bg-amber-50/40", children: [
|
|
229
230
|
/* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: /* @__PURE__ */ t("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Pending" }) }),
|
|
230
|
-
o.map((n) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600", children:
|
|
231
|
+
o.map((n) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600", children: K(n, e[n.field]) }, n.field)),
|
|
231
232
|
/* @__PURE__ */ t("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ t(
|
|
232
233
|
"button",
|
|
233
234
|
{
|
|
@@ -243,16 +244,16 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
243
244
|
return /* @__PURE__ */ a(
|
|
244
245
|
"tr",
|
|
245
246
|
{
|
|
246
|
-
className:
|
|
247
|
+
className: he(
|
|
247
248
|
"border-b border-slate-100",
|
|
248
249
|
r % 2 === 0 ? "bg-white" : "bg-slate-50/50"
|
|
249
250
|
),
|
|
250
251
|
children: [
|
|
251
|
-
o.map((i) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: s ?
|
|
252
|
+
o.map((i) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: s ? I(
|
|
252
253
|
i,
|
|
253
254
|
Q,
|
|
254
255
|
(j, p) => _((D) => ({ ...D, [j]: p }))
|
|
255
|
-
) :
|
|
256
|
+
) : K(i, e[i.field]) }, i.field)),
|
|
256
257
|
/* @__PURE__ */ t("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-1 justify-end", children: s ? /* @__PURE__ */ a(F, { children: [
|
|
257
258
|
/* @__PURE__ */ t(
|
|
258
259
|
"button",
|
|
@@ -310,7 +311,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
310
311
|
children: "No proposed rows in this addendum"
|
|
311
312
|
}
|
|
312
313
|
) }) : e.rows.map((r, n) => /* @__PURE__ */ a("tr", { className: "border-b border-amber-100 bg-amber-50/60", children: [
|
|
313
|
-
o.map((s) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-[11px] text-amber-900", children:
|
|
314
|
+
o.map((s) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-[11px] text-amber-900", children: K(s, r[s.field]) }, s.field)),
|
|
314
315
|
/* @__PURE__ */ t("td", { className: "px-2 py-1.5 text-right", children: /* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-wide text-amber-400", children: "Proposed" }) })
|
|
315
316
|
] }, n)) : v.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
|
|
316
317
|
"td",
|
|
@@ -320,7 +321,7 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
320
321
|
children: q ? `No ${q.toLowerCase()} yet` : "No rows"
|
|
321
322
|
}
|
|
322
323
|
) }) : v.map((r, n) => /* @__PURE__ */ a("tr", { className: "border-b border-slate-100", children: [
|
|
323
|
-
o.map((s) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-[11px] text-slate-700", children:
|
|
324
|
+
o.map((s) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-[11px] text-slate-700", children: K(s, r[s.field]) }, s.field)),
|
|
324
325
|
/* @__PURE__ */ t("td", { className: "px-2 py-1.5" })
|
|
325
326
|
] }, n));
|
|
326
327
|
})(),
|
|
@@ -390,5 +391,5 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
390
391
|
);
|
|
391
392
|
});
|
|
392
393
|
export {
|
|
393
|
-
|
|
394
|
+
je as InlineGridField
|
|
394
395
|
};
|