@nivaro/react 0.3.56 → 0.3.58
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 +9 -2
- package/dist/shared/components/CollectionBrowserView.js +2827 -2750
- package/dist/shared/components/DataTable.js +247 -236
- package/dist/shared/components/ItemEditForm.js +1693 -1668
- package/dist/shared/components/ProfileView.js +716 -715
- package/dist/shared/components/RecordReadView.js +367 -364
- package/dist/shared/components/ReportView.js +64 -39
- package/dist/shared/components/alerts/AlertManagerView.js +284 -271
- package/dist/shared/components/cbv/row-focus.js +19 -0
- package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
- package/dist/shared/components/integrations/console/SignalCard.js +59 -59
- package/dist/shared/components/integrations/console/tone.js +52 -30
- package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
- package/dist/shared/components/item-edit/FieldRow.js +175 -173
- package/dist/shared/components/item-edit/InlineTableField.js +407 -402
- package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
- package/dist/shared/components/item-edit/PlanGrid.js +826 -803
- package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
- package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
- package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
- package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
- package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
- package/dist/shared/components/item-edit/related-missing.js +45 -0
- package/dist/shared/components/item-edit/save-outcome.js +5 -5
- package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
- package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
- package/dist/shared/components/panels/ItemLockBanner.js +2 -3
- package/dist/shared/components/panels/PipelinePanel.js +1027 -978
- package/dist/shared/components/panels/RevisionsPanel.js +4 -1
- package/dist/shared/components/panels/TaskPanel.js +265 -249
- package/dist/shared/components/panels/landing-state.js +27 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
- package/dist/shared/components/profile/AiMemoryCard.js +12 -10
- package/dist/shared/components/queue/OwnerAvatars.js +80 -41
- package/dist/shared/components/queue/QueueItemSheet.js +111 -111
- package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
- package/dist/shared/components/queue/QueueWorklist.js +975 -964
- package/dist/shared/components/queue/group-sums.js +27 -0
- package/dist/shared/components/queue/live-state-aspect.js +7 -3
- package/dist/shared/components/queue/path-label.js +14 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
- package/dist/shared/lib/back-closes.js +25 -0
- package/dist/shared/lib/cbv-page-warm.js +36 -0
- package/dist/shared/lib/form-usage-beacon.js +7 -7
- package/dist/shared/lib/list-page-memory.js +41 -0
- package/dist/shared/lib/live.js +44 -44
- package/dist/shared/lib/own-writes.js +76 -28
- package/dist/shared/lib/record-ref.js +78 -53
- package/dist/shared/lib/request-gate.js +110 -109
- package/dist/shared/lib/validation-rules.js +34 -19
- package/package.json +1 -1
|
@@ -1,86 +1,89 @@
|
|
|
1
|
-
import { jsx as e, jsxs 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
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation as y, useQuery as k } from "@tanstack/react-query";
|
|
3
|
+
import { Lock as N, Check as v, Send as w, ArrowLeft as q } from "lucide-react";
|
|
4
|
+
import { useState as $ } from "react";
|
|
5
|
+
import { toast as b } from "sonner";
|
|
6
|
+
import { useNivaroClient as C } from "../../context.js";
|
|
7
|
+
import { post as A, get as S } from "../../lib/commands.js";
|
|
8
8
|
const j = {
|
|
9
9
|
access: !1,
|
|
10
10
|
reasons: [{ type: "not_found", message: "There is no record with this id." }]
|
|
11
11
|
};
|
|
12
|
-
function
|
|
13
|
-
var
|
|
12
|
+
function F(a) {
|
|
13
|
+
var s;
|
|
14
14
|
const t = a;
|
|
15
|
-
return ((t == null ? void 0 : t.status) ?? ((
|
|
15
|
+
return ((t == null ? void 0 : t.status) ?? ((s = t == null ? void 0 : t.response) == null ? void 0 : s.status)) === 404;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function L(a, t) {
|
|
18
|
+
const d = t == null ? void 0 : t.trim();
|
|
19
|
+
if (d) return d.toLowerCase();
|
|
20
|
+
const s = a.replace(/_/g, " ").trim();
|
|
21
|
+
return /ies$/i.test(s) ? s.replace(/ies$/i, "y") : /[^su]s$/i.test(s) ? s.slice(0, -1) : s || "record";
|
|
22
|
+
}
|
|
23
|
+
function E({
|
|
18
24
|
collection: a,
|
|
19
25
|
itemId: t,
|
|
20
|
-
|
|
26
|
+
noun: d,
|
|
27
|
+
onBack: s
|
|
21
28
|
}) {
|
|
22
|
-
const
|
|
23
|
-
mutationFn: () =>
|
|
29
|
+
const l = L(a, d), h = C(), [x, g] = $(!1), c = y({
|
|
30
|
+
mutationFn: () => h.request(A("/access-requests", { collection: a, item: String(t) })),
|
|
24
31
|
onSuccess: () => {
|
|
25
|
-
|
|
32
|
+
g(!0), b.success("Access request sent — an administrator has been notified");
|
|
26
33
|
},
|
|
27
|
-
onError: () =>
|
|
28
|
-
}), { data:
|
|
34
|
+
onError: () => b.error("Could not send the request")
|
|
35
|
+
}), { data: u, isLoading: m } = k({
|
|
29
36
|
queryKey: ["access-explain", a, String(t)],
|
|
30
|
-
queryFn: () =>
|
|
37
|
+
queryFn: () => h.request(
|
|
31
38
|
S(`/access-explain/${a}/${encodeURIComponent(t)}`)
|
|
32
|
-
).then((
|
|
39
|
+
).then((r) => r.data ?? null).catch((r) => F(r) ? j : null),
|
|
33
40
|
staleTime: 3e4
|
|
34
|
-
}),
|
|
35
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-1 items-start justify-center px-6 py-16", children: /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */ e("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ e(
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */ e("h2", { className: "text-[15px] font-semibold text-slate-800 dark:text-slate-100", children:
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
a.replace(/_/g, " "),
|
|
42
|
-
" · #",
|
|
43
|
-
t
|
|
44
|
-
] })
|
|
41
|
+
}), o = (u == null ? void 0 : u.reasons) ?? [], i = o.some((r) => r.type === "not_found");
|
|
42
|
+
return /* @__PURE__ */ e("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
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
44
|
+
/* @__PURE__ */ e("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ e(N, { className: "h-[18px] w-[18px] text-slate-500 dark:text-slate-400" }) }),
|
|
45
|
+
/* @__PURE__ */ n("div", { children: [
|
|
46
|
+
/* @__PURE__ */ e("h2", { className: "text-[15px] font-semibold text-slate-800 dark:text-slate-100", children: i ? `${l.charAt(0).toUpperCase()}${l.slice(1)} not found` : `You can't view this ${l}` }),
|
|
47
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: i ? "The link may be wrong, or it was removed." : "It is outside what your access lets you see." })
|
|
45
48
|
] })
|
|
46
49
|
] }),
|
|
47
|
-
/* @__PURE__ */ e("div", { className: "mt-5 space-y-2.5", children:
|
|
50
|
+
/* @__PURE__ */ e("div", { className: "mt-5 space-y-2.5", children: m ? /* @__PURE__ */ n(p, { children: [
|
|
48
51
|
/* @__PURE__ */ e("div", { className: "animate-pulse h-4 w-3/4 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
49
52
|
/* @__PURE__ */ e("div", { className: "animate-pulse h-4 w-1/2 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
50
|
-
] }) :
|
|
53
|
+
] }) : o.length > 0 ? o.map((r, f) => /* @__PURE__ */ e(
|
|
51
54
|
"div",
|
|
52
55
|
{
|
|
53
56
|
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",
|
|
54
|
-
children:
|
|
57
|
+
children: r.message
|
|
55
58
|
},
|
|
56
|
-
`${
|
|
59
|
+
`${r.type}-${r.dimension ?? f}`
|
|
57
60
|
)) : /* @__PURE__ */ e("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." }) }),
|
|
58
|
-
!
|
|
59
|
-
!
|
|
61
|
+
!i && !m && o.length > 0 && /* @__PURE__ */ e("p", { className: "mt-4 text-[12px] text-slate-500 dark:text-slate-400", children: "If you need access, request it below — an administrator gets the record and the reason attached, and can adjust your role's permissions or access filters." }),
|
|
62
|
+
!i && !m && /* @__PURE__ */ e(
|
|
60
63
|
"button",
|
|
61
64
|
{
|
|
62
65
|
type: "button",
|
|
63
|
-
disabled:
|
|
64
|
-
onClick: () =>
|
|
66
|
+
disabled: x || c.isPending,
|
|
67
|
+
onClick: () => c.mutate(),
|
|
65
68
|
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",
|
|
66
69
|
"data-request-access": !0,
|
|
67
|
-
children:
|
|
68
|
-
/* @__PURE__ */ e(
|
|
70
|
+
children: x ? /* @__PURE__ */ n(p, { children: [
|
|
71
|
+
/* @__PURE__ */ e(v, { className: "h-3.5 w-3.5" }),
|
|
69
72
|
" Request sent"
|
|
70
|
-
] }) : /* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */ e(
|
|
72
|
-
|
|
73
|
+
] }) : /* @__PURE__ */ n(p, { children: [
|
|
74
|
+
/* @__PURE__ */ e(w, { className: "h-3.5 w-3.5" }),
|
|
75
|
+
c.isPending ? "Sending…" : "Request access"
|
|
73
76
|
] })
|
|
74
77
|
}
|
|
75
78
|
),
|
|
76
|
-
|
|
79
|
+
s && /* @__PURE__ */ n(
|
|
77
80
|
"button",
|
|
78
81
|
{
|
|
79
82
|
type: "button",
|
|
80
|
-
onClick:
|
|
83
|
+
onClick: s,
|
|
81
84
|
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]",
|
|
82
85
|
children: [
|
|
83
|
-
/* @__PURE__ */ e(
|
|
86
|
+
/* @__PURE__ */ e(q, { className: "h-3.5 w-3.5" }),
|
|
84
87
|
"Go back"
|
|
85
88
|
]
|
|
86
89
|
}
|
|
@@ -88,6 +91,7 @@ function D({
|
|
|
88
91
|
] }) });
|
|
89
92
|
}
|
|
90
93
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
E as AccessDeniedPanel,
|
|
95
|
+
F as explainMissing,
|
|
96
|
+
L as recordNoun
|
|
93
97
|
};
|
|
@@ -11,7 +11,7 @@ import { announceRecordTabs as Z, useRecordTabsSignal as He } from "../../lib/re
|
|
|
11
11
|
import { noteTakeOverHold as ie } from "../item-edit/FieldAffordances.js";
|
|
12
12
|
import { Button as O } from "../ui/button.js";
|
|
13
13
|
import { Popover as ge, PopoverTrigger as we, PopoverContent as xe } from "../ui/popover.js";
|
|
14
|
-
const ee = 1e4, _e = 1500, Je = 2e3, Ge = 5 * 6e4, Xe = 3e4, Ze = 6e4, et = 15e3, pe = 1500, tt =
|
|
14
|
+
const ee = 1e4, _e = 1500, Je = 2e3, Ge = 5 * 6e4, Xe = 3e4, Ze = 6e4, et = 15e3, pe = 1500, tt = 1e4;
|
|
15
15
|
function Le(e, t) {
|
|
16
16
|
return e ? `${t ?? "Someone else"} took over editing — your changes are still here, but can’t be saved until they release it` : "Someone else started editing while you were away — your changes are still here, but can’t be saved until they release it";
|
|
17
17
|
}
|
|
@@ -569,6 +569,7 @@ function gt({
|
|
|
569
569
|
c,
|
|
570
570
|
" — ",
|
|
571
571
|
y,
|
|
572
|
+
" until the lock is released.",
|
|
572
573
|
e.idle_minutes != null && e.idle_minutes >= 2 && /* @__PURE__ */ x(
|
|
573
574
|
"span",
|
|
574
575
|
{
|
|
@@ -582,8 +583,6 @@ function gt({
|
|
|
582
583
|
]
|
|
583
584
|
}
|
|
584
585
|
),
|
|
585
|
-
" ",
|
|
586
|
-
"until the lock is released.",
|
|
587
586
|
e.note && /* @__PURE__ */ x("span", { className: "mt-0.5 block text-[12.5px] text-amber-800/90 dark:text-amber-200/90", children: [
|
|
588
587
|
"“",
|
|
589
588
|
e.note,
|