@nivaro/react 0.3.64 → 0.3.66
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 +62 -8
- package/dist/shared/components/CollectionBrowserView.js +3127 -3204
- package/dist/shared/components/ConformanceView.js +235 -221
- package/dist/shared/components/DataTable.js +478 -459
- package/dist/shared/components/ItemEditForm.js +4842 -4500
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/PageRenderer.js +146 -138
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordDrilldownSheet.js +73 -65
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/bulk/bulk-field-options.js +29 -23
- package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
- package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
- package/dist/shared/components/integrations/SendCurrentData.js +126 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +1535 -1440
- package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
- package/dist/shared/components/item-edit/FieldRow.js +413 -403
- package/dist/shared/components/item-edit/GroupSection.js +555 -538
- package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
- package/dist/shared/components/item-edit/M2MCombobox.js +407 -338
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +367 -116
- package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
- package/dist/shared/components/item-edit/PlanGrid.js +783 -724
- package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
- package/dist/shared/components/item-edit/RecordInsights.js +113 -111
- package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +398 -364
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +56 -0
- package/dist/shared/components/item-edit/collision-format.js +37 -0
- package/dist/shared/components/item-edit/field-a11y.js +25 -0
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +84 -0
- package/dist/shared/components/item-edit/line-midair.js +94 -87
- package/dist/shared/components/item-edit/move-guard.js +17 -0
- package/dist/shared/components/item-edit/picker-search.js +27 -16
- package/dist/shared/components/item-edit/rail-width.js +8 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
- package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
- package/dist/shared/components/panels/CommentPanel.js +142 -136
- package/dist/shared/components/panels/ItemLockBanner.js +246 -240
- package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
- package/dist/shared/components/panels/RevisionsPanel.js +106 -102
- package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
- package/dist/shared/components/panels/SlaClock.js +90 -68
- package/dist/shared/components/queue/QueueItemSheet.js +94 -87
- package/dist/shared/components/queue/QueueWorklist.js +1522 -1347
- package/dist/shared/components/queue/worklist-csv.js +75 -0
- package/dist/shared/components/queue/worklist-helpers.js +20 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
- package/dist/shared/lib/bulk-copy.js +17 -0
- package/dist/shared/lib/cbv-export.js +122 -0
- package/dist/shared/lib/delete-offer.js +13 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/leave-guard.js +41 -26
- package/dist/shared/lib/list-link.js +72 -56
- package/dist/shared/lib/live-queries.js +32 -30
- package/dist/shared/lib/moved-notice.js +25 -0
- package/dist/shared/lib/notification-target.js +56 -54
- package/dist/shared/lib/obligation-banner.js +11 -8
- package/dist/shared/lib/obligation-reason-text.js +6 -6
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/sort-cycle.js +6 -0
- package/dist/shared/lib/summary-mode.js +59 -41
- package/package.json +1 -1
|
@@ -1,78 +1,119 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMutation as
|
|
3
|
-
import { Lock as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { post as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as t, jsxs as n, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation as w, useQuery as q } from "@tanstack/react-query";
|
|
3
|
+
import { Lock as $, Check as C, Send as A, ArrowLeft as S } from "lucide-react";
|
|
4
|
+
import { useState as f } from "react";
|
|
5
|
+
import { toast as y } from "sonner";
|
|
6
|
+
import { useNivaroClient as F } from "../../context.js";
|
|
7
|
+
import { post as L, get as T } from "../../lib/commands.js";
|
|
8
|
+
const _ = {
|
|
9
9
|
access: !1,
|
|
10
10
|
reasons: [{ type: "not_found", message: "There is no record with this id." }]
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function j(a) {
|
|
13
13
|
var s;
|
|
14
|
-
const
|
|
15
|
-
return ((
|
|
14
|
+
const e = a;
|
|
15
|
+
return ((e == null ? void 0 : e.status) ?? ((s = e == null ? void 0 : e.response) == null ? void 0 : s.status)) === 404;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
17
|
+
function E(a, e) {
|
|
18
|
+
const o = e == null ? void 0 : e.trim();
|
|
19
|
+
if (o) return o.toLowerCase();
|
|
20
20
|
const s = a.replace(/_/g, " ").trim();
|
|
21
21
|
return /ies$/i.test(s) ? s.replace(/ies$/i, "y") : /[^su]s$/i.test(s) ? s.slice(0, -1) : s || "record";
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
const b = 300;
|
|
24
|
+
function z({
|
|
24
25
|
collection: a,
|
|
25
|
-
itemId:
|
|
26
|
-
noun:
|
|
26
|
+
itemId: e,
|
|
27
|
+
noun: o,
|
|
27
28
|
onBack: s
|
|
28
29
|
}) {
|
|
29
|
-
const
|
|
30
|
-
mutationFn: () =>
|
|
30
|
+
const d = E(a, o), g = F(), [i, k] = f(!1), [c, N] = f(""), u = w({
|
|
31
|
+
mutationFn: () => g.request(
|
|
32
|
+
L("/access-requests", {
|
|
33
|
+
collection: a,
|
|
34
|
+
item: String(e),
|
|
35
|
+
...c.trim() ? { note: c.trim().slice(0, b) } : {}
|
|
36
|
+
})
|
|
37
|
+
),
|
|
31
38
|
onSuccess: () => {
|
|
32
|
-
|
|
39
|
+
k(!0), y.success("Access request sent — an administrator has been notified");
|
|
33
40
|
},
|
|
34
|
-
onError: () =>
|
|
35
|
-
}), { data:
|
|
36
|
-
queryKey: ["access-explain", a, String(
|
|
37
|
-
queryFn: () =>
|
|
38
|
-
|
|
39
|
-
).then((r) => r.data ?? null).catch((r) =>
|
|
41
|
+
onError: () => y.error("Could not send the request")
|
|
42
|
+
}), { data: m, isLoading: x } = q({
|
|
43
|
+
queryKey: ["access-explain", a, String(e)],
|
|
44
|
+
queryFn: () => g.request(
|
|
45
|
+
T(`/access-explain/${a}/${encodeURIComponent(e)}`)
|
|
46
|
+
).then((r) => r.data ?? null).catch((r) => j(r) ? _ : null),
|
|
40
47
|
staleTime: 3e4
|
|
41
|
-
}),
|
|
42
|
-
return /* @__PURE__ */
|
|
48
|
+
}), p = (m == null ? void 0 : m.reasons) ?? [], l = p.some((r) => r.type === "not_found");
|
|
49
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-1 items-start justify-center px-6 py-16", children: /* @__PURE__ */ n("div", { className: "w-full max-w-[560px] rounded-xl border border-slate-200 bg-white p-8 dark:border-border dark:bg-card", children: [
|
|
43
50
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
44
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ t("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ t($, { className: "h-[18px] w-[18px] text-slate-500 dark:text-slate-400" }) }),
|
|
45
52
|
/* @__PURE__ */ n("div", { children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ t("h2", { className: "text-[15px] font-semibold text-slate-800 dark:text-slate-100", children: l ? `${d.charAt(0).toUpperCase()}${d.slice(1)} not found` : `You can't view this ${d}` }),
|
|
54
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: l ? "The link may be wrong, or it was removed." : "It is outside what your access lets you see." })
|
|
48
55
|
] })
|
|
49
56
|
] }),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
] }) :
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
/* @__PURE__ */ t("div", { className: "mt-5 space-y-2.5", children: x ? /* @__PURE__ */ n(h, { children: [
|
|
58
|
+
/* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-3/4 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
59
|
+
/* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-1/2 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
60
|
+
] }) : l ? null : p.length > 0 ? (
|
|
61
|
+
// A missing record is said once, in the heading (army11 f3: the
|
|
62
|
+
// page gave two different reasons for the same thing).
|
|
63
|
+
p.map((r, v) => /* @__PURE__ */ t(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: "rounded-lg border border-slate-200 bg-slate-50 px-3.5 py-2.5 text-[13px] leading-relaxed text-slate-700 dark:border-border dark:bg-muted/40 dark:text-slate-300",
|
|
67
|
+
children: r.message
|
|
68
|
+
},
|
|
69
|
+
`${r.type}-${r.dimension ?? v}`
|
|
70
|
+
))
|
|
71
|
+
) : /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-slate-50 px-3.5 py-2.5 text-[13px] leading-relaxed text-slate-700 dark:border-border dark:bg-muted/40 dark:text-slate-300", children: "This record could not be loaded. It may have been deleted, or an access rule may be hiding it." }) }),
|
|
72
|
+
!l && !x && !i && /* @__PURE__ */ n("div", { className: "mt-4", children: [
|
|
73
|
+
/* @__PURE__ */ n(
|
|
74
|
+
"label",
|
|
75
|
+
{
|
|
76
|
+
htmlFor: `access-note-${a}-${e}`,
|
|
77
|
+
className: "block text-[12px] font-medium text-slate-700 dark:text-slate-300",
|
|
78
|
+
children: [
|
|
79
|
+
"Need it? Say what for ",
|
|
80
|
+
/* @__PURE__ */ t("span", { className: "font-normal text-slate-500", children: "(optional)" })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ t(
|
|
85
|
+
"textarea",
|
|
86
|
+
{
|
|
87
|
+
id: `access-note-${a}-${e}`,
|
|
88
|
+
value: c,
|
|
89
|
+
onChange: (r) => N(r.target.value.slice(0, b)),
|
|
90
|
+
rows: 2,
|
|
91
|
+
maxLength: b,
|
|
92
|
+
placeholder: `e.g. I approve this ${d} for my team`,
|
|
93
|
+
className: "mt-1.5 w-full resize-y rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[13px] text-slate-800 placeholder:text-slate-400 focus:border-nvr-cyan focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30 dark:border-border dark:bg-background dark:text-slate-100",
|
|
94
|
+
"data-request-access-note": !0
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
|
|
98
|
+
"Every administrator gets your request with this ",
|
|
99
|
+
d,
|
|
100
|
+
" and your note."
|
|
101
|
+
] })
|
|
102
|
+
] }),
|
|
103
|
+
!l && !x && /* @__PURE__ */ t(
|
|
63
104
|
"button",
|
|
64
105
|
{
|
|
65
106
|
type: "button",
|
|
66
|
-
disabled:
|
|
67
|
-
onClick: () =>
|
|
107
|
+
disabled: i || u.isPending,
|
|
108
|
+
onClick: () => u.mutate(),
|
|
68
109
|
className: "mt-3 inline-flex items-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:brightness-110 disabled:opacity-50",
|
|
69
110
|
"data-request-access": !0,
|
|
70
|
-
children:
|
|
71
|
-
/* @__PURE__ */
|
|
111
|
+
children: i ? /* @__PURE__ */ n(h, { children: [
|
|
112
|
+
/* @__PURE__ */ t(C, { className: "h-3.5 w-3.5" }),
|
|
72
113
|
" Request sent"
|
|
73
|
-
] }) : /* @__PURE__ */ n(
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
114
|
+
] }) : /* @__PURE__ */ n(h, { children: [
|
|
115
|
+
/* @__PURE__ */ t(A, { className: "h-3.5 w-3.5" }),
|
|
116
|
+
u.isPending ? "Sending…" : "Request access"
|
|
76
117
|
] })
|
|
77
118
|
}
|
|
78
119
|
),
|
|
@@ -83,7 +124,7 @@ function E({
|
|
|
83
124
|
onClick: s,
|
|
84
125
|
className: "mt-5 inline-flex items-center gap-1.5 rounded-md border border-slate-200 px-3 py-1.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-border dark:text-slate-300 dark:hover:bg-white/[0.03]",
|
|
85
126
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ t(S, { className: "h-3.5 w-3.5" }),
|
|
87
128
|
"Go back"
|
|
88
129
|
]
|
|
89
130
|
}
|
|
@@ -91,7 +132,7 @@ function E({
|
|
|
91
132
|
] }) });
|
|
92
133
|
}
|
|
93
134
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
135
|
+
z as AccessDeniedPanel,
|
|
136
|
+
j as explainMissing,
|
|
137
|
+
E as recordNoun
|
|
97
138
|
};
|