@nivaro/react 0.3.41 → 0.3.43
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/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +733 -15
- package/dist/index.js +820 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/nav-trail.js +107 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,81 +1,86 @@
|
|
|
1
1
|
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { readUnreadNotificationCount as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { Bell as
|
|
2
|
+
import { readUnreadNotificationCount as ye, markNotificationRead as Ne, markNotificationsRead as Ce, markAllNotificationsRead as $e } from "@nivaro/sdk";
|
|
3
|
+
import { useQueryClient as Se, useQuery as ne, useMutation as E } from "@tanstack/react-query";
|
|
4
|
+
import { Bell as qe, CheckCheck as _e, ExternalLink as re, Check as z, History as Ee, ShieldCheck as Re, ChevronDown as Ae } from "lucide-react";
|
|
5
5
|
import { useState as N, useRef as oe, useEffect as O, useMemo as le, Fragment as ie } from "react";
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { useNivaroClient as
|
|
8
|
-
import { get as
|
|
9
|
-
import { useLiveRefetchInterval as
|
|
6
|
+
import { createPortal as Fe } from "react-dom";
|
|
7
|
+
import { useNivaroClient as Le } from "../context.js";
|
|
8
|
+
import { get as Me, post as Ie } from "../lib/commands.js";
|
|
9
|
+
import { useLiveRefetchInterval as De } from "../lib/live-queries.js";
|
|
10
10
|
import { resolveNotificationTargetFor as R, runNotificationTarget as A } from "../lib/notification-target.js";
|
|
11
|
-
import { useTabAttention as
|
|
11
|
+
import { useTabAttention as Te } from "../lib/tab-attention.js";
|
|
12
12
|
import { formatRelative as se } from "../lib/utils.js";
|
|
13
|
-
import { AsItWasSheet as
|
|
14
|
-
import { bundleLocally as
|
|
15
|
-
import { DeliveryChips as
|
|
16
|
-
import { NotificationActions as
|
|
17
|
-
import { NotificationDetailBits as
|
|
18
|
-
function
|
|
13
|
+
import { AsItWasSheet as Ke } from "./notifications/AsItWasSheet.js";
|
|
14
|
+
import { bundleLocally as Be, laneTone as je, bundleAsNotification as ze, bundleHeadline as Oe, categoryChipLabel as Pe } from "./notifications/bundles.js";
|
|
15
|
+
import { DeliveryChips as Qe } from "./notifications/DeliveryChips.js";
|
|
16
|
+
import { NotificationActions as He } from "./notifications/NotificationActions.js";
|
|
17
|
+
import { NotificationDetailBits as Ye } from "./notifications/NotificationDetailBits.js";
|
|
18
|
+
function Ge(l) {
|
|
19
|
+
var d, p;
|
|
20
|
+
return de(l) ? l.revision_id != null || (((p = (d = l.detail) == null ? void 0 : d.changes) == null ? void 0 : p.length) ?? 0) > 0 || l.category === "watch" || l.category === "workflow" : !1;
|
|
21
|
+
}
|
|
22
|
+
function de(l) {
|
|
19
23
|
var C, $, S;
|
|
20
|
-
if ((((C =
|
|
21
|
-
const
|
|
22
|
-
return !!
|
|
24
|
+
if ((((C = l.target) == null ? void 0 : C.kind) ?? l.kind ?? (l.collection && l.item ? "record" : null)) !== "record") return !1;
|
|
25
|
+
const p = (($ = l.target) == null ? void 0 : $.collection) ?? l.collection, x = ((S = l.target) == null ? void 0 : S.id) ?? l.item;
|
|
26
|
+
return !!p && x != null && x !== "" && !/^(nivaro|directus)_|^__/i.test(p);
|
|
23
27
|
}
|
|
24
|
-
function
|
|
25
|
-
routes:
|
|
26
|
-
onNavigate:
|
|
27
|
-
app:
|
|
28
|
-
subscribe:
|
|
28
|
+
function ut({
|
|
29
|
+
routes: l,
|
|
30
|
+
onNavigate: d,
|
|
31
|
+
app: p,
|
|
32
|
+
subscribe: x,
|
|
29
33
|
buttonClassName: C,
|
|
30
34
|
panelClassName: $,
|
|
31
35
|
beforeList: S,
|
|
32
36
|
extraBadge: P = 0,
|
|
33
|
-
mailLogUrl:
|
|
37
|
+
mailLogUrl: ce,
|
|
34
38
|
renderTrigger: Q,
|
|
35
39
|
allPath: H,
|
|
36
|
-
subscriptionsPath:
|
|
37
|
-
|
|
40
|
+
subscriptionsPath: ue,
|
|
41
|
+
rulesPath: me,
|
|
42
|
+
onActionError: pe,
|
|
38
43
|
panelPlacement: v = "below",
|
|
39
|
-
tabBadge:
|
|
44
|
+
tabBadge: xe = !0
|
|
40
45
|
}) {
|
|
41
|
-
const
|
|
46
|
+
const b = Le(), [f, c] = N(!1), [h, Y] = N("attention"), F = oe(null), G = oe(null), [L, fe] = N(null), U = Se(), w = () => {
|
|
42
47
|
U.invalidateQueries({ queryKey: ["notification-count"] }), U.invalidateQueries({ queryKey: ["notifications"] });
|
|
43
|
-
},
|
|
48
|
+
}, he = De(6e4, { enabled: !!x, safetyMs: 12e4 }), { data: u } = ne({
|
|
44
49
|
queryKey: ["notification-count"],
|
|
45
|
-
queryFn: () =>
|
|
46
|
-
refetchInterval:
|
|
47
|
-
}), M = (
|
|
48
|
-
|
|
49
|
-
const { data:
|
|
50
|
-
queryKey: ["notifications", "bell",
|
|
51
|
-
queryFn: () =>
|
|
52
|
-
|
|
50
|
+
queryFn: () => b.request(ye()),
|
|
51
|
+
refetchInterval: he
|
|
52
|
+
}), M = (u == null ? void 0 : u.unread) ?? 0, I = (u == null ? void 0 : u.attention) ?? M, q = (u == null ? void 0 : u.lanes) ?? { critical: 0, fyi: 0 }, k = M + P;
|
|
53
|
+
Te(I + P, { enabled: xe });
|
|
54
|
+
const { data: m } = ne({
|
|
55
|
+
queryKey: ["notifications", "bell", p ?? null, h],
|
|
56
|
+
queryFn: () => b.request(
|
|
57
|
+
Me("/notifications", {
|
|
53
58
|
limit: 60,
|
|
54
|
-
app:
|
|
59
|
+
app: p,
|
|
55
60
|
bundle: "record",
|
|
56
|
-
...
|
|
57
|
-
...
|
|
61
|
+
...h === "attention" ? { lane: "attention", status: "inbox" } : {},
|
|
62
|
+
...h === "fyi" ? { lane: "fyi", status: "inbox" } : {}
|
|
58
63
|
})
|
|
59
64
|
).then((e) => {
|
|
60
|
-
const t = e.pinned ?? [], o = new Set(t.map((n) => n.id)),
|
|
61
|
-
return e.bundles ? { rows:
|
|
65
|
+
const t = e.pinned ?? [], o = new Set(t.map((n) => n.id)), s = (e.data ?? []).filter((n) => !o.has(n.id));
|
|
66
|
+
return e.bundles ? { rows: s, bundles: e.bundles, pinned: t } : { ...Be(s), pinned: t };
|
|
62
67
|
}),
|
|
63
|
-
enabled:
|
|
64
|
-
}), V = (
|
|
65
|
-
O(() =>
|
|
66
|
-
if (!
|
|
68
|
+
enabled: f
|
|
69
|
+
}), V = (m == null ? void 0 : m.rows) ?? [], D = (m == null ? void 0 : m.pinned) ?? [], W = (m == null ? void 0 : m.bundles) ?? [], [be, J] = N(() => /* @__PURE__ */ new Set()), [g, T] = N(null);
|
|
70
|
+
O(() => x == null ? void 0 : x(w), [x]), O(() => {
|
|
71
|
+
if (!f) return;
|
|
67
72
|
const e = (t) => {
|
|
68
|
-
var
|
|
73
|
+
var s, n;
|
|
69
74
|
const o = t.target;
|
|
70
|
-
(
|
|
75
|
+
(s = F.current) != null && s.contains(o) || (n = G.current) != null && n.contains(o) || c(!1);
|
|
71
76
|
};
|
|
72
77
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
73
|
-
}, [
|
|
74
|
-
if (!
|
|
78
|
+
}, [f]), O(() => {
|
|
79
|
+
if (!f || v !== "right") return;
|
|
75
80
|
const e = () => {
|
|
76
81
|
var o;
|
|
77
82
|
const t = (o = F.current) == null ? void 0 : o.getBoundingClientRect();
|
|
78
|
-
t &&
|
|
83
|
+
t && fe({
|
|
79
84
|
left: Math.round(t.right + 12),
|
|
80
85
|
bottom: Math.max(8, Math.round(window.innerHeight - t.bottom))
|
|
81
86
|
});
|
|
@@ -83,45 +88,45 @@ function dt({
|
|
|
83
88
|
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
84
89
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
85
90
|
};
|
|
86
|
-
}, [
|
|
87
|
-
const X =
|
|
88
|
-
mutationFn: (e) =>
|
|
91
|
+
}, [f, v]);
|
|
92
|
+
const X = E({
|
|
93
|
+
mutationFn: (e) => b.request(Ie(`/notifications/${e}/acknowledge`)),
|
|
89
94
|
onSuccess: w
|
|
90
|
-
}), K =
|
|
91
|
-
mutationFn: (e) =>
|
|
95
|
+
}), K = E({
|
|
96
|
+
mutationFn: (e) => b.request(Ne(e)),
|
|
92
97
|
onSuccess: w
|
|
93
|
-
}), B =
|
|
94
|
-
mutationFn: (e) =>
|
|
98
|
+
}), B = E({
|
|
99
|
+
mutationFn: (e) => b.request(Ce(e)),
|
|
95
100
|
onSuccess: w
|
|
96
|
-
}),
|
|
97
|
-
mutationFn: () =>
|
|
101
|
+
}), ke = E({
|
|
102
|
+
mutationFn: () => b.request($e()),
|
|
98
103
|
onSuccess: w
|
|
99
104
|
}), Z = le(() => V.slice(0, 40), [V]), ee = le(() => {
|
|
100
105
|
const e = /* @__PURE__ */ new Map();
|
|
101
106
|
for (const t of Z) {
|
|
102
|
-
const o = t.collection && t.item ? `${t.collection}:${t.item}` : `single:${t.id}`,
|
|
107
|
+
const o = t.collection && t.item ? `${t.collection}:${t.item}` : `single:${t.id}`, s = e.get(o) ?? {
|
|
103
108
|
key: o,
|
|
104
109
|
collection: t.collection ?? null,
|
|
105
110
|
item: t.item ?? null,
|
|
106
111
|
rows: []
|
|
107
112
|
};
|
|
108
|
-
|
|
113
|
+
s.rows.push(t), e.set(o, s);
|
|
109
114
|
}
|
|
110
115
|
return [...e.values()];
|
|
111
|
-
}, [Z]),
|
|
112
|
-
const t = R(e,
|
|
113
|
-
t && (
|
|
116
|
+
}, [Z]), ge = (e) => {
|
|
117
|
+
const t = R(e, l);
|
|
118
|
+
t && (c(!1), A(t, d));
|
|
114
119
|
}, te = (e) => {
|
|
115
|
-
|
|
120
|
+
c(!1), d(e);
|
|
116
121
|
}, j = (e, t, o = !1) => {
|
|
117
|
-
var
|
|
122
|
+
var s;
|
|
118
123
|
return /* @__PURE__ */ r(ie, { children: [
|
|
119
124
|
/* @__PURE__ */ r(
|
|
120
125
|
"button",
|
|
121
126
|
{
|
|
122
127
|
type: "button",
|
|
123
128
|
onClick: () => {
|
|
124
|
-
e.read || K.mutate(e.id),
|
|
129
|
+
e.read || K.mutate(e.id), ge(e);
|
|
125
130
|
},
|
|
126
131
|
className: `flex w-full items-start gap-2.5 py-2 pr-3 text-left transition-colors ${o ? "pl-7" : "pl-3"} ${t ? "hover:bg-slate-50 dark:hover:bg-muted" : "cursor-default"}`,
|
|
127
132
|
"data-notification-row": e.id,
|
|
@@ -147,14 +152,14 @@ function dt({
|
|
|
147
152
|
/* @__PURE__ */ r("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10.5px] text-slate-400", children: [
|
|
148
153
|
se(e.created_at),
|
|
149
154
|
/* @__PURE__ */ a(
|
|
150
|
-
|
|
155
|
+
Qe,
|
|
151
156
|
{
|
|
152
157
|
delivery: e.delivery,
|
|
153
|
-
mailLogUrl:
|
|
158
|
+
mailLogUrl: ce,
|
|
154
159
|
onNavigate: te
|
|
155
160
|
}
|
|
156
161
|
),
|
|
157
|
-
|
|
162
|
+
de(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
|
|
158
163
|
/* @__PURE__ */ r(
|
|
159
164
|
"span",
|
|
160
165
|
{
|
|
@@ -163,14 +168,14 @@ function dt({
|
|
|
163
168
|
"data-notification-as-it-was": e.id,
|
|
164
169
|
"data-tip": "The record as it was when you were told",
|
|
165
170
|
onClick: (n) => {
|
|
166
|
-
n.stopPropagation(),
|
|
171
|
+
n.stopPropagation(), c(!1), T(e);
|
|
167
172
|
},
|
|
168
173
|
onKeyDown: (n) => {
|
|
169
|
-
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), n.stopPropagation(),
|
|
174
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), n.stopPropagation(), c(!1), T(e));
|
|
170
175
|
},
|
|
171
176
|
className: "inline-flex items-center gap-0.5 rounded px-1 text-[10.5px] text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
172
177
|
children: [
|
|
173
|
-
/* @__PURE__ */ a(
|
|
178
|
+
/* @__PURE__ */ a(Ee, { className: "h-3 w-3" }),
|
|
174
179
|
"as it was"
|
|
175
180
|
]
|
|
176
181
|
}
|
|
@@ -197,7 +202,7 @@ function dt({
|
|
|
197
202
|
]
|
|
198
203
|
}
|
|
199
204
|
),
|
|
200
|
-
((
|
|
205
|
+
((s = e.ack) == null ? void 0 : s.required) && !e.ack.at && /* @__PURE__ */ a("div", { className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`, children: /* @__PURE__ */ r(
|
|
201
206
|
"button",
|
|
202
207
|
{
|
|
203
208
|
type: "button",
|
|
@@ -206,34 +211,37 @@ function dt({
|
|
|
206
211
|
"data-notification-acknowledge": e.id,
|
|
207
212
|
className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2 py-1 text-[11px] font-medium text-white hover:opacity-90 disabled:opacity-50",
|
|
208
213
|
children: [
|
|
209
|
-
/* @__PURE__ */ a(
|
|
214
|
+
/* @__PURE__ */ a(Re, { className: "h-3 w-3" }),
|
|
210
215
|
"Acknowledge"
|
|
211
216
|
]
|
|
212
217
|
}
|
|
213
218
|
) }),
|
|
214
219
|
e.actions && e.actions.length > 0 && !e.read && /* @__PURE__ */ a(
|
|
215
|
-
|
|
220
|
+
He,
|
|
216
221
|
{
|
|
217
222
|
actions: e.actions,
|
|
218
223
|
notificationId: e.id,
|
|
219
|
-
onError:
|
|
224
|
+
onError: pe,
|
|
220
225
|
className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
|
|
221
226
|
}
|
|
222
227
|
),
|
|
223
228
|
/* @__PURE__ */ a(
|
|
224
|
-
|
|
229
|
+
Ye,
|
|
225
230
|
{
|
|
226
231
|
detail: e.detail,
|
|
227
232
|
why: e.why,
|
|
228
233
|
delivery: e.delivery,
|
|
229
|
-
|
|
234
|
+
notificationId: e.id,
|
|
235
|
+
recordChanges: Ge(e),
|
|
236
|
+
subscriptionsPath: ue,
|
|
237
|
+
rulesPath: me,
|
|
230
238
|
onNavigate: te,
|
|
231
239
|
className: `-mt-1 pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
|
|
232
240
|
}
|
|
233
241
|
)
|
|
234
242
|
] }, e.id);
|
|
235
|
-
},
|
|
236
|
-
const t = `${e.collection}:${e.item}`, o =
|
|
243
|
+
}, ve = (e) => {
|
|
244
|
+
const t = `${e.collection}:${e.item}`, o = be.has(t), s = je(e.lane), n = e.deleted ? null : R(ze(e), l), y = e.rows.filter((i) => !i.read).map((i) => i.id);
|
|
237
245
|
return /* @__PURE__ */ r(
|
|
238
246
|
"div",
|
|
239
247
|
{
|
|
@@ -251,13 +259,13 @@ function dt({
|
|
|
251
259
|
"aria-expanded": o,
|
|
252
260
|
"aria-label": o ? "Collapse" : "Expand",
|
|
253
261
|
"data-notification-bundle-expand": t,
|
|
254
|
-
onClick: () => J((
|
|
255
|
-
const
|
|
256
|
-
return
|
|
262
|
+
onClick: () => J((i) => {
|
|
263
|
+
const _ = new Set(i);
|
|
264
|
+
return _.has(t) ? _.delete(t) : _.add(t), _;
|
|
257
265
|
}),
|
|
258
266
|
className: "mt-0.5 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
259
267
|
children: /* @__PURE__ */ a(
|
|
260
|
-
|
|
268
|
+
Ae,
|
|
261
269
|
{
|
|
262
270
|
className: `h-3.5 w-3.5 transition-transform ${o ? "" : "-rotate-90"}`
|
|
263
271
|
}
|
|
@@ -269,7 +277,7 @@ function dt({
|
|
|
269
277
|
{
|
|
270
278
|
type: "button",
|
|
271
279
|
onClick: () => {
|
|
272
|
-
n ? (
|
|
280
|
+
n ? (c(!1), A(n, d)) : J((i) => new Set(i).add(t));
|
|
273
281
|
},
|
|
274
282
|
className: "min-w-0 flex-1 text-left",
|
|
275
283
|
children: [
|
|
@@ -277,14 +285,14 @@ function dt({
|
|
|
277
285
|
/* @__PURE__ */ a(
|
|
278
286
|
"span",
|
|
279
287
|
{
|
|
280
|
-
className: `h-2 w-2 shrink-0 rounded-full ${e.unread > 0 ?
|
|
288
|
+
className: `h-2 w-2 shrink-0 rounded-full ${e.unread > 0 ? s.dot : "bg-transparent"}`
|
|
281
289
|
}
|
|
282
290
|
),
|
|
283
291
|
/* @__PURE__ */ a(
|
|
284
292
|
"span",
|
|
285
293
|
{
|
|
286
|
-
className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${
|
|
287
|
-
children:
|
|
294
|
+
className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${s.text}` : "font-normal text-slate-600 dark:text-slate-400"}`,
|
|
295
|
+
children: Oe(e)
|
|
288
296
|
}
|
|
289
297
|
)
|
|
290
298
|
] }),
|
|
@@ -292,7 +300,7 @@ function dt({
|
|
|
292
300
|
e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ a(
|
|
293
301
|
"span",
|
|
294
302
|
{
|
|
295
|
-
className: `rounded px-1 text-[9.5px] font-bold uppercase tracking-wide ${
|
|
303
|
+
className: `rounded px-1 text-[9.5px] font-bold uppercase tracking-wide ${s.chip}`,
|
|
296
304
|
children: "Critical"
|
|
297
305
|
}
|
|
298
306
|
),
|
|
@@ -312,14 +320,14 @@ function dt({
|
|
|
312
320
|
children: "deleted"
|
|
313
321
|
}
|
|
314
322
|
),
|
|
315
|
-
e.categories.map((
|
|
323
|
+
e.categories.map((i) => /* @__PURE__ */ a(
|
|
316
324
|
"span",
|
|
317
325
|
{
|
|
318
326
|
className: "rounded bg-slate-100 px-1 py-px text-[9.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
319
|
-
"data-notification-bundle-category":
|
|
320
|
-
children:
|
|
327
|
+
"data-notification-bundle-category": i,
|
|
328
|
+
children: Pe(i)
|
|
321
329
|
},
|
|
322
|
-
|
|
330
|
+
i
|
|
323
331
|
)),
|
|
324
332
|
/* @__PURE__ */ a("span", { children: e.newest ? se(e.newest) : "" }),
|
|
325
333
|
e.unread > 0 && e.unread < e.count && /* @__PURE__ */ r("span", { children: [
|
|
@@ -338,7 +346,7 @@ function dt({
|
|
|
338
346
|
type: "button",
|
|
339
347
|
title: "Open record",
|
|
340
348
|
onClick: () => {
|
|
341
|
-
|
|
349
|
+
c(!1), A(n, d);
|
|
342
350
|
},
|
|
343
351
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
344
352
|
children: /* @__PURE__ */ a(re, { className: "h-3 w-3" })
|
|
@@ -362,40 +370,40 @@ function dt({
|
|
|
362
370
|
{
|
|
363
371
|
className: "border-t border-slate-50 bg-slate-50/50 dark:border-border/50 dark:bg-muted/30",
|
|
364
372
|
"data-notification-bundle-rows": t,
|
|
365
|
-
children: e.rows.map((
|
|
373
|
+
children: e.rows.map((i) => j(i, !0, !0))
|
|
366
374
|
}
|
|
367
375
|
)
|
|
368
376
|
]
|
|
369
377
|
},
|
|
370
378
|
`bundle:${t}`
|
|
371
379
|
);
|
|
372
|
-
},
|
|
380
|
+
}, we = [
|
|
373
381
|
{ key: "attention", label: "Needs you", count: I },
|
|
374
382
|
{ key: "fyi", label: "FYI", count: q.fyi },
|
|
375
383
|
{ key: "all", label: "All", count: null }
|
|
376
|
-
], ae = () =>
|
|
384
|
+
], ae = () => c((e) => (!e && h === "attention" && I === 0 && q.fyi > 0 && Y("fyi"), !e));
|
|
377
385
|
return /* @__PURE__ */ r("div", { ref: F, className: "relative", "data-nvr-notification-bell": !0, children: [
|
|
378
|
-
Q ? Q({ open:
|
|
386
|
+
Q ? Q({ open: f, badge: k, toggle: ae }) : /* @__PURE__ */ r(
|
|
379
387
|
"button",
|
|
380
388
|
{
|
|
381
389
|
type: "button",
|
|
382
390
|
onClick: ae,
|
|
383
391
|
className: C ?? "relative rounded-md p-1.5 text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-muted",
|
|
384
|
-
"aria-label":
|
|
392
|
+
"aria-label": k ? `Notifications (${k} unread)` : "Notifications",
|
|
385
393
|
children: [
|
|
386
|
-
/* @__PURE__ */ a(
|
|
387
|
-
|
|
394
|
+
/* @__PURE__ */ a(qe, { className: "h-4 w-4", strokeWidth: 1.8 }),
|
|
395
|
+
k > 0 && /* @__PURE__ */ a(
|
|
388
396
|
"span",
|
|
389
397
|
{
|
|
390
398
|
"data-nvr-recording-hide": !0,
|
|
391
399
|
className: `absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold ${q.critical > 0 ? "bg-red-500 text-white" : "bg-nvr-cyan text-nvr-navy"}`,
|
|
392
|
-
children:
|
|
400
|
+
children: k > 99 ? "99+" : k
|
|
393
401
|
}
|
|
394
402
|
)
|
|
395
403
|
]
|
|
396
404
|
}
|
|
397
405
|
),
|
|
398
|
-
|
|
406
|
+
f && (v === "right" ? Fe : (e) => e)(
|
|
399
407
|
/* @__PURE__ */ r(
|
|
400
408
|
"div",
|
|
401
409
|
{
|
|
@@ -406,13 +414,13 @@ function dt({
|
|
|
406
414
|
children: [
|
|
407
415
|
S,
|
|
408
416
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 dark:border-border/60", children: [
|
|
409
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children:
|
|
417
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: we.map((e) => /* @__PURE__ */ r(
|
|
410
418
|
"button",
|
|
411
419
|
{
|
|
412
420
|
type: "button",
|
|
413
421
|
onClick: () => Y(e.key),
|
|
414
422
|
"data-nvr-lane-tab": e.key,
|
|
415
|
-
className:
|
|
423
|
+
className: h === e.key ? "rounded bg-white px-2 py-0.5 text-[11px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-slate-100" : "rounded px-2 py-0.5 text-[11px] font-medium text-slate-500 hover:text-slate-700 dark:text-slate-400",
|
|
416
424
|
children: [
|
|
417
425
|
e.label,
|
|
418
426
|
e.count != null && e.count > 0 && /* @__PURE__ */ a(
|
|
@@ -430,10 +438,10 @@ function dt({
|
|
|
430
438
|
"button",
|
|
431
439
|
{
|
|
432
440
|
type: "button",
|
|
433
|
-
onClick: () =>
|
|
441
|
+
onClick: () => ke.mutate(),
|
|
434
442
|
className: "inline-flex items-center gap-1 text-[11px] font-medium text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
435
443
|
children: [
|
|
436
|
-
/* @__PURE__ */ a(
|
|
444
|
+
/* @__PURE__ */ a(_e, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
437
445
|
"Mark all read"
|
|
438
446
|
]
|
|
439
447
|
}
|
|
@@ -442,18 +450,18 @@ function dt({
|
|
|
442
450
|
/* @__PURE__ */ r("div", { className: "max-h-96 overflow-y-auto", children: [
|
|
443
451
|
D.length > 0 && /* @__PURE__ */ r("div", { "data-notification-pinned": !0, children: [
|
|
444
452
|
/* @__PURE__ */ a("div", { className: "bg-amber-50 px-3 py-1 text-[10px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: "Needs your acknowledgement" }),
|
|
445
|
-
D.map((e) => /* @__PURE__ */ a(ie, { children: j(e, !!R(e,
|
|
453
|
+
D.map((e) => /* @__PURE__ */ a(ie, { children: j(e, !!R(e, l)) }, e.id))
|
|
446
454
|
] }),
|
|
447
|
-
ee.length === 0 && W.length === 0 && D.length === 0 ? /* @__PURE__ */ a("p", { className: "px-3 py-6 text-center text-[12px] text-slate-400", children:
|
|
448
|
-
...W.map(
|
|
455
|
+
ee.length === 0 && W.length === 0 && D.length === 0 ? /* @__PURE__ */ a("p", { className: "px-3 py-6 text-center text-[12px] text-slate-400", children: h === "attention" ? "Nothing needs you right now." : h === "fyi" ? "No FYI notifications." : "No notifications" }) : [
|
|
456
|
+
...W.map(ve),
|
|
449
457
|
...ee.map((e) => {
|
|
450
|
-
const t = e.rows.filter((
|
|
458
|
+
const t = e.rows.filter((i) => !i.read).map((i) => i.id), o = R(e.rows[0], l), s = !!o, n = e.rows[0], y = n != null && n.target_label && (n == null ? void 0 : n.kind) !== "record" ? `${n.target_label}${e.item ? ` · ${e.item}` : ""}` : String(e.collection) === "__chat__" ? "Chat" : e.collection ? `${String(e.collection).replace(/_/g, " ")}${e.item ? ` · ${e.item}` : ""}` : null;
|
|
451
459
|
return /* @__PURE__ */ r(
|
|
452
460
|
"div",
|
|
453
461
|
{
|
|
454
462
|
className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
|
|
455
463
|
children: [
|
|
456
|
-
|
|
464
|
+
s && y && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 px-3 pt-2", children: [
|
|
457
465
|
/* @__PURE__ */ r("span", { className: "truncate text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
458
466
|
y,
|
|
459
467
|
e.rows.length > 1 ? ` · ${e.rows.length}` : ""
|
|
@@ -465,7 +473,7 @@ function dt({
|
|
|
465
473
|
type: "button",
|
|
466
474
|
title: "Open record",
|
|
467
475
|
onClick: () => {
|
|
468
|
-
t.length && B.mutate(t),
|
|
476
|
+
t.length && B.mutate(t), c(!1), A(o, d);
|
|
469
477
|
},
|
|
470
478
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
471
479
|
children: /* @__PURE__ */ a(re, { className: "h-3 w-3" })
|
|
@@ -483,7 +491,7 @@ function dt({
|
|
|
483
491
|
)
|
|
484
492
|
] })
|
|
485
493
|
] }),
|
|
486
|
-
e.rows.map((
|
|
494
|
+
e.rows.map((i) => j(i, s))
|
|
487
495
|
]
|
|
488
496
|
},
|
|
489
497
|
e.key
|
|
@@ -496,7 +504,7 @@ function dt({
|
|
|
496
504
|
{
|
|
497
505
|
type: "button",
|
|
498
506
|
onClick: () => {
|
|
499
|
-
|
|
507
|
+
c(!1), d(H);
|
|
500
508
|
},
|
|
501
509
|
className: "block w-full border-t border-slate-100 px-3 py-1.5 text-center text-[11px] font-medium text-slate-500 hover:text-nvr-cyan dark:border-border/60",
|
|
502
510
|
children: "See all notifications"
|
|
@@ -508,16 +516,17 @@ function dt({
|
|
|
508
516
|
document.body
|
|
509
517
|
),
|
|
510
518
|
/* @__PURE__ */ a(
|
|
511
|
-
|
|
519
|
+
Ke,
|
|
512
520
|
{
|
|
513
|
-
notificationId: (
|
|
514
|
-
title: (
|
|
521
|
+
notificationId: (g == null ? void 0 : g.id) ?? null,
|
|
522
|
+
title: (g == null ? void 0 : g.title) ?? null,
|
|
515
523
|
onClose: () => T(null)
|
|
516
524
|
}
|
|
517
525
|
)
|
|
518
526
|
] });
|
|
519
527
|
}
|
|
520
528
|
export {
|
|
521
|
-
|
|
522
|
-
|
|
529
|
+
ut as NotificationBell,
|
|
530
|
+
de as hasSnapshotView,
|
|
531
|
+
Ge as offersChanges
|
|
523
532
|
};
|