@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,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Archive as
|
|
4
|
-
import { useState as s, useEffect as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as j, post as A, patch as
|
|
7
|
-
import { resolveNotificationTargetFor as Q, runNotificationTarget as
|
|
8
|
-
import { openInTabsMessage as
|
|
2
|
+
import { useQueryClient as tt, useQuery as I, keepPreviousData as at, useMutation as y } from "@tanstack/react-query";
|
|
3
|
+
import { Archive as ve, CheckCheck as nt, Search as lt, Check as we, AlarmClock as de, ExternalLink as Ne, Bell as Ce, ShieldCheck as ie, ChevronLeft as rt, ChevronRight as dt, History as it, Trash2 as st, ChevronDown as ot } from "lucide-react";
|
|
4
|
+
import { useState as s, useEffect as Se, Fragment as se } from "react";
|
|
5
|
+
import { useNivaroClient as ct } from "../../context.js";
|
|
6
|
+
import { get as j, post as A, patch as ut, del as mt } from "../../lib/commands.js";
|
|
7
|
+
import { resolveNotificationTargetFor as Q, runNotificationTarget as oe } from "../../lib/notification-target.js";
|
|
8
|
+
import { openInTabsMessage as pt, openInTabs as bt } from "../../lib/open-in-tabs.js";
|
|
9
9
|
import { cn as m, formatRelative as G } from "../../lib/utils.js";
|
|
10
|
-
import { hasSnapshotView as
|
|
11
|
-
import { SimpleSelect as
|
|
12
|
-
import { AsItWasSheet as
|
|
13
|
-
import { bundleLocally as
|
|
14
|
-
import { DeliveryChips as
|
|
15
|
-
import { NotificationActions as
|
|
16
|
-
import { NotificationDetailBits as
|
|
17
|
-
const
|
|
10
|
+
import { hasSnapshotView as ht, offersChanges as xt } from "../NotificationBell.js";
|
|
11
|
+
import { SimpleSelect as ce } from "../ui/SimpleSelect.js";
|
|
12
|
+
import { AsItWasSheet as gt } from "./AsItWasSheet.js";
|
|
13
|
+
import { bundleLocally as ft, laneTone as kt, bundleAsNotification as yt, bundleHeadline as vt, categoryChipLabel as wt } from "./bundles.js";
|
|
14
|
+
import { DeliveryChips as Nt } from "./DeliveryChips.js";
|
|
15
|
+
import { NotificationActions as Ct } from "./NotificationActions.js";
|
|
16
|
+
import { NotificationChangesList as St, NotificationDetailBits as _t } from "./NotificationDetailBits.js";
|
|
17
|
+
const ue = 25, Dt = [
|
|
18
18
|
{ key: "all", label: "All" },
|
|
19
19
|
{ key: "inbox", label: "Unread" },
|
|
20
20
|
{ key: "read", label: "Read" },
|
|
21
21
|
{ key: "snoozed", label: "Snoozed" },
|
|
22
22
|
{ key: "archived", label: "Archived" },
|
|
23
23
|
{ key: "sent", label: "Sent" }
|
|
24
|
-
],
|
|
24
|
+
], zt = [
|
|
25
25
|
{ key: "all", label: "Every lane" },
|
|
26
26
|
{ key: "critical", label: "Critical" },
|
|
27
27
|
{ key: "needs_you", label: "Needs you" },
|
|
28
28
|
{ key: "fyi", label: "FYI" }
|
|
29
29
|
];
|
|
30
|
-
function
|
|
30
|
+
function _e() {
|
|
31
31
|
const g = /* @__PURE__ */ new Date(), v = new Date(g.getTime() + 3600 * 1e3), w = new Date(g);
|
|
32
32
|
w.setDate(w.getDate() + 1), w.setHours(8, 0, 0, 0);
|
|
33
33
|
const N = new Date(g);
|
|
@@ -37,67 +37,74 @@ function Ce() {
|
|
|
37
37
|
{ label: "Until next week", until: N }
|
|
38
38
|
];
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Qt({
|
|
41
41
|
routes: g,
|
|
42
42
|
onNavigate: v,
|
|
43
43
|
app: w,
|
|
44
44
|
mailLogUrl: N,
|
|
45
|
-
subscriptionsPath:
|
|
45
|
+
subscriptionsPath: De,
|
|
46
|
+
rulesPath: ze,
|
|
47
|
+
changesId: me,
|
|
46
48
|
onNotice: r,
|
|
47
49
|
onError: d,
|
|
48
|
-
className:
|
|
50
|
+
className: Ae
|
|
49
51
|
}) {
|
|
50
|
-
const c =
|
|
51
|
-
|
|
52
|
+
const c = ct(), Y = tt(), [V, qe] = s(() => {
|
|
53
|
+
if (me !== void 0) return me;
|
|
54
|
+
if (typeof window > "u") return null;
|
|
55
|
+
const e = new URLSearchParams(window.location.search).get("changes"), a = Number(e);
|
|
56
|
+
return e && Number.isInteger(a) && a > 0 ? a : null;
|
|
57
|
+
}), [i, Fe] = s("all"), [C, $e] = s("all"), [R, Me] = s(!0), { data: pe = [], isLoading: Te } = I({
|
|
58
|
+
queryKey: ["notifications", "sent", R],
|
|
52
59
|
queryFn: () => c.request(
|
|
53
|
-
j("/notifications/sent", { lane:
|
|
60
|
+
j("/notifications/sent", { lane: R ? "critical" : "all" })
|
|
54
61
|
).then((e) => e.data ?? []),
|
|
55
62
|
enabled: i === "sent",
|
|
56
63
|
refetchInterval: i === "sent" ? 3e4 : !1
|
|
57
|
-
}), [S, q] = s(1), [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, [i, C, S,
|
|
64
|
+
}), [S, q] = s(1), [Le, Z] = s(null), [be, he] = s(null), [J, Oe] = s(""), [B, Pe] = s(""), [M, Ie] = s(""), [U, je] = s(!0), [Re, Be] = s(() => /* @__PURE__ */ new Set()), [b, xe] = s(null), [F, K] = s(() => /* @__PURE__ */ new Set()), [W, T] = s(!1), [Ue, X] = s(!1), [ge, Ke] = s(!1), [fe, He] = s("30");
|
|
65
|
+
Se(() => {
|
|
66
|
+
K(/* @__PURE__ */ new Set()), T(!1), X(!1);
|
|
67
|
+
}, [i, C, S, B, M]), Se(() => {
|
|
61
68
|
const e = setTimeout(() => {
|
|
62
|
-
|
|
69
|
+
Pe(J.trim()), q(1);
|
|
63
70
|
}, 350);
|
|
64
71
|
return () => clearTimeout(e);
|
|
65
|
-
}, [
|
|
66
|
-
const { data:
|
|
72
|
+
}, [J]);
|
|
73
|
+
const { data: h } = I({
|
|
67
74
|
queryKey: ["notification-count"],
|
|
68
75
|
queryFn: () => c.request(j("/notifications/unread-count"))
|
|
69
|
-
}), { data: p, isLoading:
|
|
76
|
+
}), { data: p, isLoading: Qe } = I({
|
|
70
77
|
queryKey: [
|
|
71
78
|
"notifications",
|
|
72
79
|
"center",
|
|
73
80
|
i,
|
|
74
81
|
C,
|
|
75
82
|
S,
|
|
76
|
-
|
|
83
|
+
B,
|
|
77
84
|
M,
|
|
78
85
|
w ?? null,
|
|
79
|
-
|
|
86
|
+
U
|
|
80
87
|
],
|
|
81
88
|
queryFn: () => c.request(
|
|
82
89
|
j("/notifications", {
|
|
83
90
|
page: S,
|
|
84
|
-
limit:
|
|
91
|
+
limit: ue,
|
|
85
92
|
status: i === "snoozed" || i === "sent" ? "all" : i,
|
|
86
93
|
snoozed: i === "snoozed" ? "true" : void 0,
|
|
87
94
|
lane: C === "all" ? void 0 : C,
|
|
88
|
-
search:
|
|
95
|
+
search: B || void 0,
|
|
89
96
|
collection: M || void 0,
|
|
90
97
|
app: w,
|
|
91
|
-
bundle:
|
|
98
|
+
bundle: U ? "record" : void 0
|
|
92
99
|
})
|
|
93
100
|
).then((e) => {
|
|
94
|
-
if (!
|
|
95
|
-
const a =
|
|
101
|
+
if (!U || e.bundles) return e;
|
|
102
|
+
const a = ft(e.data ?? []);
|
|
96
103
|
return { ...e, data: a.rows, bundles: a.bundles };
|
|
97
104
|
}),
|
|
98
|
-
placeholderData:
|
|
105
|
+
placeholderData: at,
|
|
99
106
|
enabled: i !== "sent"
|
|
100
|
-
}), { data:
|
|
107
|
+
}), { data: Ge = [] } = I({
|
|
101
108
|
queryKey: ["notifications", "center", "collections"],
|
|
102
109
|
queryFn: () => c.request(
|
|
103
110
|
j("/collections")
|
|
@@ -106,19 +113,19 @@ function jt({
|
|
|
106
113
|
return [...new Set(a.map((l) => l.collection))].sort();
|
|
107
114
|
}),
|
|
108
115
|
staleTime: 3e5
|
|
109
|
-
}), _ = i === "archived" || S > 1 ? [] : (p == null ? void 0 : p.pinned) ?? [],
|
|
116
|
+
}), _ = i === "archived" || S > 1 ? [] : (p == null ? void 0 : p.pinned) ?? [], Ye = new Set(_.map((e) => e.id)), L = ((p == null ? void 0 : p.data) ?? []).filter((e) => !Ye.has(e.id)), H = (p == null ? void 0 : p.bundles) ?? [], D = (p == null ? void 0 : p.total) ?? 0, E = Math.max(1, Math.ceil(D / ue)), f = () => {
|
|
110
117
|
Y.invalidateQueries({ queryKey: ["notifications"] }), Y.invalidateQueries({ queryKey: ["notification-count"] });
|
|
111
|
-
},
|
|
118
|
+
}, Ve = y({
|
|
112
119
|
mutationFn: (e) => c.request(A("/notifications/mark-read", { ids: e })),
|
|
113
120
|
onSuccess: f,
|
|
114
121
|
onError: () => d == null ? void 0 : d("Failed to mark the bundle read")
|
|
115
|
-
}),
|
|
122
|
+
}), ee = y({
|
|
116
123
|
mutationFn: () => c.request(A("/notifications/mark-all-read")),
|
|
117
124
|
onSuccess: () => {
|
|
118
125
|
f(), r == null || r("All notifications marked as read");
|
|
119
126
|
},
|
|
120
127
|
onError: () => d == null ? void 0 : d("Failed to mark all read")
|
|
121
|
-
}),
|
|
128
|
+
}), O = y({
|
|
122
129
|
mutationFn: ({
|
|
123
130
|
id: e,
|
|
124
131
|
until: a,
|
|
@@ -130,75 +137,75 @@ function jt({
|
|
|
130
137
|
)
|
|
131
138
|
),
|
|
132
139
|
onSuccess: (e, a) => {
|
|
133
|
-
f(),
|
|
140
|
+
f(), he(null), r == null || r(
|
|
134
141
|
a.untilChange ? "Snoozed — it comes back when someone changes the record" : a.until ? "Snoozed — it will return unread" : "Snooze cleared"
|
|
135
142
|
);
|
|
136
143
|
},
|
|
137
144
|
onError: () => d == null ? void 0 : d("Failed to snooze")
|
|
138
|
-
}),
|
|
145
|
+
}), ke = y({
|
|
139
146
|
mutationFn: (e) => c.request(A(`/notifications/${e}/acknowledge`)),
|
|
140
147
|
onSuccess: () => {
|
|
141
148
|
f(), r == null || r("Acknowledged");
|
|
142
149
|
},
|
|
143
150
|
onError: () => d == null ? void 0 : d("Failed to acknowledge")
|
|
144
|
-
}),
|
|
151
|
+
}), Ze = () => ({
|
|
145
152
|
status: i === "snoozed" || i === "sent" ? "all" : i,
|
|
146
153
|
snoozed: i === "snoozed" ? "true" : void 0,
|
|
147
154
|
lane: C === "all" ? void 0 : C,
|
|
148
|
-
search:
|
|
155
|
+
search: B || void 0,
|
|
149
156
|
collection: M || void 0
|
|
150
157
|
}), $ = y({
|
|
151
158
|
mutationFn: (e) => c.request(
|
|
152
159
|
A("/notifications/bulk-action", {
|
|
153
160
|
action: e.action,
|
|
154
161
|
until: e.until ? e.until.toISOString() : void 0,
|
|
155
|
-
...
|
|
162
|
+
...W ? { filter: Ze() } : { ids: [...F] }
|
|
156
163
|
})
|
|
157
164
|
),
|
|
158
165
|
onSuccess: (e, a) => {
|
|
159
166
|
var u;
|
|
160
|
-
f(),
|
|
167
|
+
f(), K(/* @__PURE__ */ new Set()), T(!1), X(!1);
|
|
161
168
|
const l = ((u = e.data) == null ? void 0 : u.updated) ?? 0;
|
|
162
169
|
r == null || r(
|
|
163
170
|
`${l} notification${l === 1 ? "" : "s"} ${a.action === "read" ? "marked read" : a.action === "archive" ? "archived" : "snoozed"}`
|
|
164
171
|
);
|
|
165
172
|
},
|
|
166
173
|
onError: () => d == null ? void 0 : d("That bulk action failed")
|
|
167
|
-
}),
|
|
174
|
+
}), te = y({
|
|
168
175
|
mutationFn: (e) => c.request(A("/notifications/archive-read", { days: e })),
|
|
169
176
|
onSuccess: (e) => {
|
|
170
177
|
var a;
|
|
171
178
|
f(), r == null || r(`${((a = e.data) == null ? void 0 : a.updated) ?? 0} archived — find them under Archived`);
|
|
172
179
|
},
|
|
173
180
|
onError: () => d == null ? void 0 : d("Clean-up failed")
|
|
174
|
-
}), { data:
|
|
181
|
+
}), { data: ae } = I({
|
|
175
182
|
queryKey: ["nvr-profile-prefs"],
|
|
176
183
|
queryFn: () => c.request(j("/users/me")).then((e) => {
|
|
177
184
|
var a;
|
|
178
185
|
return ((a = e.data) == null ? void 0 : a.preferences) ?? {};
|
|
179
186
|
}),
|
|
180
|
-
enabled:
|
|
181
|
-
}),
|
|
182
|
-
mutationFn: (e) => c.request(
|
|
187
|
+
enabled: ge
|
|
188
|
+
}), Je = y({
|
|
189
|
+
mutationFn: (e) => c.request(ut("/users/me/preferences", { notification_cleanup_days: e })),
|
|
183
190
|
onSuccess: () => {
|
|
184
191
|
Y.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), r == null || r("Automatic clean-up saved");
|
|
185
192
|
},
|
|
186
193
|
onError: () => d == null ? void 0 : d("Could not save the clean-up setting")
|
|
187
|
-
}),
|
|
188
|
-
mutationFn: (e) => c.request(
|
|
194
|
+
}), ne = y({
|
|
195
|
+
mutationFn: (e) => c.request(mt(`/notifications/${e}`)),
|
|
189
196
|
onSuccess: () => {
|
|
190
|
-
f(),
|
|
197
|
+
f(), Z(null), r == null || r("Notification deleted");
|
|
191
198
|
},
|
|
192
199
|
onError: () => d == null ? void 0 : d("Failed to delete notification")
|
|
193
|
-
}),
|
|
200
|
+
}), We = async (e) => {
|
|
194
201
|
e.read || (await c.request(A(`/notifications/${e.id}/read`)).catch(() => {
|
|
195
|
-
}), f()),
|
|
196
|
-
},
|
|
197
|
-
T(!1),
|
|
202
|
+
}), f()), oe(Q(e, g), v);
|
|
203
|
+
}, Xe = (e) => {
|
|
204
|
+
T(!1), K((a) => {
|
|
198
205
|
const l = new Set(a);
|
|
199
206
|
return l.has(e) ? l.delete(e) : l.add(e), l;
|
|
200
207
|
});
|
|
201
|
-
},
|
|
208
|
+
}, le = (e, a = !1) => {
|
|
202
209
|
var z;
|
|
203
210
|
const l = !e.read, u = Q(e, g);
|
|
204
211
|
return /* @__PURE__ */ n(
|
|
@@ -216,7 +223,7 @@ function jt({
|
|
|
216
223
|
{
|
|
217
224
|
type: "checkbox",
|
|
218
225
|
checked: F.has(e.id),
|
|
219
|
-
onChange: () =>
|
|
226
|
+
onChange: () => Xe(e.id),
|
|
220
227
|
"aria-label": "Select notification",
|
|
221
228
|
"data-notification-select": e.id,
|
|
222
229
|
className: "mt-1.5 h-3.5 w-3.5 shrink-0"
|
|
@@ -236,7 +243,7 @@ function jt({
|
|
|
236
243
|
"button",
|
|
237
244
|
{
|
|
238
245
|
type: "button",
|
|
239
|
-
onClick: () => void
|
|
246
|
+
onClick: () => void We(e),
|
|
240
247
|
className: "block w-full text-left",
|
|
241
248
|
children: [
|
|
242
249
|
/* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
|
|
@@ -267,60 +274,63 @@ function jt({
|
|
|
267
274
|
"button",
|
|
268
275
|
{
|
|
269
276
|
type: "button",
|
|
270
|
-
onClick: () =>
|
|
277
|
+
onClick: () => oe(u, v),
|
|
271
278
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
272
279
|
children: u.type === "chat" ? "Open chat" : u.type === "external" ? "Open in app ↗" : e.target_label && e.kind !== "record" ? `${e.target_label}${e.item ? ` #${e.item}` : ""}` : e.collection === "__chat__" ? "Chat" : e.collection ? `${e.collection}${e.item ? ` #${e.item}` : ""}` : "Open"
|
|
273
280
|
}
|
|
274
281
|
),
|
|
275
|
-
/* @__PURE__ */ t(
|
|
276
|
-
|
|
282
|
+
/* @__PURE__ */ t(Nt, { delivery: e.delivery, mailLogUrl: N, onNavigate: v }),
|
|
283
|
+
ht(e) && /* @__PURE__ */ n(
|
|
277
284
|
"button",
|
|
278
285
|
{
|
|
279
286
|
type: "button",
|
|
280
287
|
"data-notification-as-it-was": e.id,
|
|
281
288
|
"data-tip": "The record as it was when you were told",
|
|
282
|
-
onClick: () =>
|
|
289
|
+
onClick: () => xe(e),
|
|
283
290
|
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
284
291
|
children: [
|
|
285
|
-
/* @__PURE__ */ t(
|
|
292
|
+
/* @__PURE__ */ t(it, { className: "h-3 w-3" }),
|
|
286
293
|
"as it was"
|
|
287
294
|
]
|
|
288
295
|
}
|
|
289
296
|
)
|
|
290
297
|
] }),
|
|
291
298
|
/* @__PURE__ */ t(
|
|
292
|
-
|
|
299
|
+
_t,
|
|
293
300
|
{
|
|
294
301
|
detail: e.detail,
|
|
295
302
|
why: e.why,
|
|
296
303
|
delivery: e.delivery,
|
|
297
|
-
|
|
304
|
+
notificationId: e.id,
|
|
305
|
+
recordChanges: xt(e),
|
|
306
|
+
subscriptionsPath: De,
|
|
307
|
+
rulesPath: ze,
|
|
298
308
|
onNavigate: v,
|
|
299
309
|
className: "mt-1"
|
|
300
310
|
}
|
|
301
311
|
),
|
|
302
312
|
((z = e.ack) == null ? void 0 : z.required) && /* @__PURE__ */ t("div", { className: "mt-1.5", "data-notification-ack": e.ack.at ? "acked" : "pending", children: e.ack.at ? /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400", children: [
|
|
303
|
-
/* @__PURE__ */ t(
|
|
313
|
+
/* @__PURE__ */ t(ie, { className: "h-3 w-3" }),
|
|
304
314
|
"Acknowledged ",
|
|
305
315
|
G(e.ack.at)
|
|
306
316
|
] }) : /* @__PURE__ */ n(
|
|
307
317
|
"button",
|
|
308
318
|
{
|
|
309
319
|
type: "button",
|
|
310
|
-
disabled:
|
|
311
|
-
onClick: () =>
|
|
320
|
+
disabled: ke.isPending,
|
|
321
|
+
onClick: () => ke.mutate(e.id),
|
|
312
322
|
"data-notification-acknowledge": e.id,
|
|
313
323
|
className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2.5 py-1 text-[11.5px] font-medium text-white hover:opacity-90 disabled:opacity-50",
|
|
314
324
|
children: [
|
|
315
|
-
/* @__PURE__ */ t(
|
|
325
|
+
/* @__PURE__ */ t(ie, { className: "h-3.5 w-3.5" }),
|
|
316
326
|
"Acknowledge"
|
|
317
327
|
]
|
|
318
328
|
}
|
|
319
329
|
) }),
|
|
320
330
|
e.actions && e.actions.length > 0 && /* @__PURE__ */ t(
|
|
321
|
-
|
|
331
|
+
Ct,
|
|
322
332
|
{
|
|
323
|
-
actions: l ? e.actions : e.actions.filter((
|
|
333
|
+
actions: l ? e.actions : e.actions.filter((x) => !!x.input),
|
|
324
334
|
notificationId: e.id,
|
|
325
335
|
size: "sm",
|
|
326
336
|
onError: d,
|
|
@@ -334,11 +344,11 @@ function jt({
|
|
|
334
344
|
"button",
|
|
335
345
|
{
|
|
336
346
|
type: "button",
|
|
337
|
-
onClick: () =>
|
|
347
|
+
onClick: () => O.mutate({ id: e.id, until: null }),
|
|
338
348
|
className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[10.5px] font-medium text-amber-700 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300",
|
|
339
349
|
"data-tip": "Click to wake now",
|
|
340
350
|
children: [
|
|
341
|
-
/* @__PURE__ */ t(
|
|
351
|
+
/* @__PURE__ */ t(de, { className: "h-3 w-3" }),
|
|
342
352
|
e.snooze_until_change ? "Until it changes" : `Until ${new Date(e.snoozed_until).toLocaleString([], {
|
|
343
353
|
month: "short",
|
|
344
354
|
day: "numeric",
|
|
@@ -351,30 +361,30 @@ function jt({
|
|
|
351
361
|
"button",
|
|
352
362
|
{
|
|
353
363
|
type: "button",
|
|
354
|
-
onClick: () =>
|
|
364
|
+
onClick: () => he(be === e.id ? null : e.id),
|
|
355
365
|
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-amber-50 hover:text-amber-500 group-hover:opacity-100 dark:hover:bg-amber-400/10",
|
|
356
366
|
"aria-label": "Snooze notification",
|
|
357
|
-
children: /* @__PURE__ */ t(
|
|
367
|
+
children: /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5" })
|
|
358
368
|
}
|
|
359
369
|
),
|
|
360
|
-
|
|
361
|
-
|
|
370
|
+
be === e.id && /* @__PURE__ */ n("div", { className: "absolute right-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: [
|
|
371
|
+
_e().map((x) => /* @__PURE__ */ t(
|
|
362
372
|
"button",
|
|
363
373
|
{
|
|
364
374
|
type: "button",
|
|
365
|
-
disabled:
|
|
366
|
-
onClick: () =>
|
|
375
|
+
disabled: O.isPending,
|
|
376
|
+
onClick: () => O.mutate({ id: e.id, until: x.until }),
|
|
367
377
|
className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
368
|
-
children:
|
|
378
|
+
children: x.label
|
|
369
379
|
},
|
|
370
|
-
|
|
380
|
+
x.label
|
|
371
381
|
)),
|
|
372
382
|
e.collection && e.item != null && /* @__PURE__ */ t(
|
|
373
383
|
"button",
|
|
374
384
|
{
|
|
375
385
|
type: "button",
|
|
376
|
-
disabled:
|
|
377
|
-
onClick: () =>
|
|
386
|
+
disabled: O.isPending,
|
|
387
|
+
onClick: () => O.mutate({ id: e.id, until: null, untilChange: !0 }),
|
|
378
388
|
className: "block w-full border-t border-slate-100 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:border-border dark:text-foreground",
|
|
379
389
|
"data-snooze-until-change": !0,
|
|
380
390
|
children: "Until the record changes"
|
|
@@ -382,12 +392,12 @@ function jt({
|
|
|
382
392
|
)
|
|
383
393
|
] })
|
|
384
394
|
] }),
|
|
385
|
-
/* @__PURE__ */ t("div", { className: "shrink-0", children:
|
|
395
|
+
/* @__PURE__ */ t("div", { className: "shrink-0", children: Le === e.id ? /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
386
396
|
/* @__PURE__ */ t(
|
|
387
397
|
"button",
|
|
388
398
|
{
|
|
389
399
|
type: "button",
|
|
390
|
-
onClick: () =>
|
|
400
|
+
onClick: () => Z(null),
|
|
391
401
|
className: "h-6 rounded-md border border-slate-200 px-2 text-[11px] dark:border-border",
|
|
392
402
|
children: "Cancel"
|
|
393
403
|
}
|
|
@@ -396,27 +406,27 @@ function jt({
|
|
|
396
406
|
"button",
|
|
397
407
|
{
|
|
398
408
|
type: "button",
|
|
399
|
-
disabled:
|
|
400
|
-
onClick: () =>
|
|
409
|
+
disabled: ne.isPending,
|
|
410
|
+
onClick: () => ne.mutate(e.id),
|
|
401
411
|
className: "h-6 rounded-md bg-red-500 px-2 text-[11px] text-white hover:bg-red-600",
|
|
402
|
-
children:
|
|
412
|
+
children: ne.isPending ? "Deleting…" : "Delete"
|
|
403
413
|
}
|
|
404
414
|
)
|
|
405
415
|
] }) : /* @__PURE__ */ t(
|
|
406
416
|
"button",
|
|
407
417
|
{
|
|
408
418
|
type: "button",
|
|
409
|
-
onClick: () =>
|
|
419
|
+
onClick: () => Z(e.id),
|
|
410
420
|
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-red-50 hover:text-red-400 group-hover:opacity-100",
|
|
411
421
|
"aria-label": "Delete notification",
|
|
412
|
-
children: /* @__PURE__ */ t(
|
|
422
|
+
children: /* @__PURE__ */ t(st, { className: "h-3.5 w-3.5" })
|
|
413
423
|
}
|
|
414
424
|
) })
|
|
415
425
|
]
|
|
416
426
|
}
|
|
417
427
|
);
|
|
418
|
-
},
|
|
419
|
-
const a = `${e.collection}:${e.item}`, l =
|
|
428
|
+
}, Ee = (e) => {
|
|
429
|
+
const a = `${e.collection}:${e.item}`, l = Re.has(a), u = kt(e.lane), z = e.deleted ? null : Q(yt(e), g), x = e.rows.filter((o) => !o.read).map((o) => o.id), P = () => Be((o) => {
|
|
420
430
|
const k = new Set(o);
|
|
421
431
|
return k.has(a) ? k.delete(a) : k.add(a), k;
|
|
422
432
|
});
|
|
@@ -436,10 +446,10 @@ function jt({
|
|
|
436
446
|
"aria-expanded": l,
|
|
437
447
|
"aria-label": l ? "Collapse" : "Expand",
|
|
438
448
|
"data-notification-bundle-expand": a,
|
|
439
|
-
onClick:
|
|
449
|
+
onClick: P,
|
|
440
450
|
className: "mt-1 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
441
451
|
children: /* @__PURE__ */ t(
|
|
442
|
-
|
|
452
|
+
ot,
|
|
443
453
|
{
|
|
444
454
|
className: m("h-3.5 w-3.5 transition-transform", !l && "-rotate-90")
|
|
445
455
|
}
|
|
@@ -456,7 +466,7 @@ function jt({
|
|
|
456
466
|
}
|
|
457
467
|
),
|
|
458
468
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
459
|
-
/* @__PURE__ */ t("button", { type: "button", onClick:
|
|
469
|
+
/* @__PURE__ */ t("button", { type: "button", onClick: P, className: "block w-full text-left", children: /* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
|
|
460
470
|
e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ t(
|
|
461
471
|
"span",
|
|
462
472
|
{
|
|
@@ -474,7 +484,7 @@ function jt({
|
|
|
474
484
|
"truncate text-[13px]",
|
|
475
485
|
e.unread > 0 ? m("font-medium", u.text) : "font-normal text-slate-600 dark:text-slate-400"
|
|
476
486
|
),
|
|
477
|
-
children:
|
|
487
|
+
children: vt(e)
|
|
478
488
|
}
|
|
479
489
|
),
|
|
480
490
|
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ? G(e.newest) : "" })
|
|
@@ -501,7 +511,7 @@ function jt({
|
|
|
501
511
|
{
|
|
502
512
|
className: "rounded bg-slate-100 px-1.5 py-px text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
503
513
|
"data-notification-bundle-category": o,
|
|
504
|
-
children:
|
|
514
|
+
children: wt(o)
|
|
505
515
|
},
|
|
506
516
|
o
|
|
507
517
|
)),
|
|
@@ -509,10 +519,10 @@ function jt({
|
|
|
509
519
|
"button",
|
|
510
520
|
{
|
|
511
521
|
type: "button",
|
|
512
|
-
onClick: () =>
|
|
522
|
+
onClick: () => oe(z, v),
|
|
513
523
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
514
524
|
children: [
|
|
515
|
-
/* @__PURE__ */ t(
|
|
525
|
+
/* @__PURE__ */ t(Ne, { className: "h-3 w-3" }),
|
|
516
526
|
"Open ",
|
|
517
527
|
e.label
|
|
518
528
|
]
|
|
@@ -524,15 +534,15 @@ function jt({
|
|
|
524
534
|
] })
|
|
525
535
|
] })
|
|
526
536
|
] }),
|
|
527
|
-
|
|
537
|
+
x.length > 0 && /* @__PURE__ */ n(
|
|
528
538
|
"button",
|
|
529
539
|
{
|
|
530
540
|
type: "button",
|
|
531
541
|
"data-notification-bundle-read": a,
|
|
532
|
-
onClick: () =>
|
|
542
|
+
onClick: () => Ve.mutate(x),
|
|
533
543
|
className: "inline-flex items-center gap-1 rounded-md border border-slate-200 px-2 py-1 text-[11px] font-medium text-slate-600 hover:bg-slate-50 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
|
|
534
544
|
children: [
|
|
535
|
-
/* @__PURE__ */ t(
|
|
545
|
+
/* @__PURE__ */ t(we, { className: "h-3 w-3" }),
|
|
536
546
|
"Mark read"
|
|
537
547
|
]
|
|
538
548
|
}
|
|
@@ -543,18 +553,18 @@ function jt({
|
|
|
543
553
|
{
|
|
544
554
|
className: "divide-y divide-slate-100 border-t border-slate-100 dark:divide-border dark:border-border",
|
|
545
555
|
"data-notification-bundle-rows": a,
|
|
546
|
-
children: e.rows.map((o) => /* @__PURE__ */ t(
|
|
556
|
+
children: e.rows.map((o) => /* @__PURE__ */ t(se, { children: le(o, !0) }, o.id))
|
|
547
557
|
}
|
|
548
558
|
)
|
|
549
559
|
]
|
|
550
560
|
},
|
|
551
561
|
`bundle:${a}`
|
|
552
562
|
);
|
|
553
|
-
},
|
|
563
|
+
}, ye = _.length + L.length + H.reduce((e, a) => e + a.rows.length, 0), et = (e) => {
|
|
554
564
|
var a;
|
|
555
|
-
return e === "all" ? null : ((a =
|
|
565
|
+
return e === "all" ? null : ((a = h == null ? void 0 : h.lanes) == null ? void 0 : a[e]) ?? null;
|
|
556
566
|
};
|
|
557
|
-
return /* @__PURE__ */ n("div", { className: m("flex flex-1 min-h-0 flex-col",
|
|
567
|
+
return /* @__PURE__ */ n("div", { className: m("flex flex-1 min-h-0 flex-col", Ae), "data-nvr-notification-center": !0, children: [
|
|
558
568
|
/* @__PURE__ */ n("header", { className: "shrink-0 border-b border-slate-200 bg-white px-8 py-5 dark:border-border dark:bg-background", children: [
|
|
559
569
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
560
570
|
/* @__PURE__ */ n("div", { children: [
|
|
@@ -563,7 +573,7 @@ function jt({
|
|
|
563
573
|
D,
|
|
564
574
|
" notification",
|
|
565
575
|
D === 1 ? "" : "s",
|
|
566
|
-
(
|
|
576
|
+
(h == null ? void 0 : h.attention) != null && h.attention > 0 ? ` · ${h.attention} need${h.attention === 1 ? "s" : ""} you` : ""
|
|
567
577
|
] })
|
|
568
578
|
] }),
|
|
569
579
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
@@ -571,11 +581,11 @@ function jt({
|
|
|
571
581
|
"button",
|
|
572
582
|
{
|
|
573
583
|
type: "button",
|
|
574
|
-
onClick: () =>
|
|
584
|
+
onClick: () => Ke((e) => !e),
|
|
575
585
|
"data-notification-cleanup-toggle": !0,
|
|
576
586
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
577
587
|
children: [
|
|
578
|
-
/* @__PURE__ */ t(
|
|
588
|
+
/* @__PURE__ */ t(ve, { className: "h-3.5 w-3.5" }),
|
|
579
589
|
"Clean up"
|
|
580
590
|
]
|
|
581
591
|
}
|
|
@@ -584,18 +594,18 @@ function jt({
|
|
|
584
594
|
"button",
|
|
585
595
|
{
|
|
586
596
|
type: "button",
|
|
587
|
-
onClick: () =>
|
|
588
|
-
disabled:
|
|
597
|
+
onClick: () => ee.mutate(),
|
|
598
|
+
disabled: ee.isPending,
|
|
589
599
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
590
600
|
children: [
|
|
591
|
-
/* @__PURE__ */ t(
|
|
592
|
-
|
|
601
|
+
/* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
|
|
602
|
+
ee.isPending ? "Marking…" : "Mark all read"
|
|
593
603
|
]
|
|
594
604
|
}
|
|
595
605
|
)
|
|
596
606
|
] })
|
|
597
607
|
] }),
|
|
598
|
-
|
|
608
|
+
ge && /* @__PURE__ */ n(
|
|
599
609
|
"div",
|
|
600
610
|
{
|
|
601
611
|
className: "mt-3 space-y-2 rounded-md border border-slate-200 bg-slate-50 px-3 py-2.5 text-[12px] text-slate-600 dark:border-border dark:bg-muted/40 dark:text-muted-foreground",
|
|
@@ -604,10 +614,10 @@ function jt({
|
|
|
604
614
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
605
615
|
"Archive everything read and older than",
|
|
606
616
|
/* @__PURE__ */ t(
|
|
607
|
-
|
|
617
|
+
ce,
|
|
608
618
|
{
|
|
609
|
-
value:
|
|
610
|
-
onChange:
|
|
619
|
+
value: fe,
|
|
620
|
+
onChange: He,
|
|
611
621
|
ariaLabel: "Older than",
|
|
612
622
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
613
623
|
options: [
|
|
@@ -622,21 +632,21 @@ function jt({
|
|
|
622
632
|
"button",
|
|
623
633
|
{
|
|
624
634
|
type: "button",
|
|
625
|
-
disabled:
|
|
626
|
-
onClick: () =>
|
|
635
|
+
disabled: te.isPending,
|
|
636
|
+
onClick: () => te.mutate(Number(fe)),
|
|
627
637
|
"data-notification-archive-read": !0,
|
|
628
638
|
className: "h-7 rounded-md bg-slate-900 px-2.5 text-[11.5px] font-medium text-white hover:bg-slate-700 disabled:opacity-50 dark:bg-slate-100 dark:text-slate-900",
|
|
629
|
-
children:
|
|
639
|
+
children: te.isPending ? "Archiving…" : "Archive now"
|
|
630
640
|
}
|
|
631
641
|
)
|
|
632
642
|
] }),
|
|
633
643
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
634
644
|
"Or do it automatically — archive read notifications after",
|
|
635
645
|
/* @__PURE__ */ t(
|
|
636
|
-
|
|
646
|
+
ce,
|
|
637
647
|
{
|
|
638
|
-
value: String((
|
|
639
|
-
onChange: (e) =>
|
|
648
|
+
value: String((ae == null ? void 0 : ae.notification_cleanup_days) ?? ""),
|
|
649
|
+
onChange: (e) => Je.mutate(e ? Number(e) : null),
|
|
640
650
|
ariaLabel: "Automatic clean-up",
|
|
641
651
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
642
652
|
options: [
|
|
@@ -653,14 +663,14 @@ function jt({
|
|
|
653
663
|
}
|
|
654
664
|
),
|
|
655
665
|
/* @__PURE__ */ n("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
656
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
657
|
-
const a =
|
|
666
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: zt.map((e) => {
|
|
667
|
+
const a = et(e.key);
|
|
658
668
|
return /* @__PURE__ */ n(
|
|
659
669
|
"button",
|
|
660
670
|
{
|
|
661
671
|
type: "button",
|
|
662
672
|
onClick: () => {
|
|
663
|
-
|
|
673
|
+
$e(e.key), q(1);
|
|
664
674
|
},
|
|
665
675
|
"data-nvr-lane": e.key,
|
|
666
676
|
className: m(
|
|
@@ -676,12 +686,12 @@ function jt({
|
|
|
676
686
|
);
|
|
677
687
|
}) }),
|
|
678
688
|
/* @__PURE__ */ t("span", { className: "mx-1 h-5 w-px bg-slate-200 dark:bg-border" }),
|
|
679
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
689
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: Dt.map((e) => /* @__PURE__ */ t(
|
|
680
690
|
"button",
|
|
681
691
|
{
|
|
682
692
|
type: "button",
|
|
683
693
|
onClick: () => {
|
|
684
|
-
|
|
694
|
+
Fe(e.key), q(1);
|
|
685
695
|
},
|
|
686
696
|
className: m(
|
|
687
697
|
"rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
@@ -692,29 +702,29 @@ function jt({
|
|
|
692
702
|
e.key
|
|
693
703
|
)) }),
|
|
694
704
|
/* @__PURE__ */ n("div", { className: "relative ml-auto", children: [
|
|
695
|
-
/* @__PURE__ */ t(
|
|
705
|
+
/* @__PURE__ */ t(lt, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
696
706
|
/* @__PURE__ */ t(
|
|
697
707
|
"input",
|
|
698
708
|
{
|
|
699
|
-
value:
|
|
700
|
-
onChange: (e) =>
|
|
709
|
+
value: J,
|
|
710
|
+
onChange: (e) => Oe(e.target.value),
|
|
701
711
|
placeholder: "Search notifications…",
|
|
702
712
|
className: "h-8 w-[240px] rounded-md border border-slate-200 bg-background pl-8 pr-2.5 text-[12.5px] dark:border-border"
|
|
703
713
|
}
|
|
704
714
|
)
|
|
705
715
|
] }),
|
|
706
716
|
/* @__PURE__ */ t(
|
|
707
|
-
|
|
717
|
+
ce,
|
|
708
718
|
{
|
|
709
719
|
value: M,
|
|
710
720
|
onChange: (e) => {
|
|
711
|
-
|
|
721
|
+
Ie(e), q(1);
|
|
712
722
|
},
|
|
713
723
|
ariaLabel: "Collection",
|
|
714
724
|
className: "h-8 w-auto rounded-md border-slate-200 bg-background px-2 text-[12.5px] dark:border-border",
|
|
715
725
|
options: [
|
|
716
726
|
{ value: "", label: "All collections" },
|
|
717
|
-
...
|
|
727
|
+
...Ge.map((e) => ({ value: e, label: e }))
|
|
718
728
|
]
|
|
719
729
|
}
|
|
720
730
|
),
|
|
@@ -728,8 +738,8 @@ function jt({
|
|
|
728
738
|
"input",
|
|
729
739
|
{
|
|
730
740
|
type: "checkbox",
|
|
731
|
-
checked:
|
|
732
|
-
onChange: (e) =>
|
|
741
|
+
checked: U,
|
|
742
|
+
onChange: (e) => je(e.target.checked),
|
|
733
743
|
className: "h-3.5 w-3.5",
|
|
734
744
|
"data-notification-group-by-record": !0
|
|
735
745
|
}
|
|
@@ -740,14 +750,36 @@ function jt({
|
|
|
740
750
|
)
|
|
741
751
|
] })
|
|
742
752
|
] }),
|
|
753
|
+
V != null && /* @__PURE__ */ n(
|
|
754
|
+
"div",
|
|
755
|
+
{
|
|
756
|
+
className: "shrink-0 border-b border-slate-200 bg-white px-8 py-3 dark:border-border dark:bg-background",
|
|
757
|
+
"data-notification-changes-landing": V,
|
|
758
|
+
children: [
|
|
759
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2", children: [
|
|
760
|
+
/* @__PURE__ */ t("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "What changed" }),
|
|
761
|
+
/* @__PURE__ */ t(
|
|
762
|
+
"button",
|
|
763
|
+
{
|
|
764
|
+
type: "button",
|
|
765
|
+
onClick: () => qe(null),
|
|
766
|
+
className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2 hover:text-slate-600 dark:hover:text-slate-200",
|
|
767
|
+
children: "Dismiss"
|
|
768
|
+
}
|
|
769
|
+
)
|
|
770
|
+
] }),
|
|
771
|
+
/* @__PURE__ */ t(St, { notificationId: V, className: "max-w-3xl" })
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
),
|
|
743
775
|
i !== "sent" && F.size > 0 && /* @__PURE__ */ n(
|
|
744
776
|
"div",
|
|
745
777
|
{
|
|
746
778
|
className: "flex shrink-0 flex-wrap items-center gap-2 border-b border-nvr-cyan/30 bg-nvr-cyan/5 px-8 py-2 text-[12px] text-slate-700 dark:text-slate-200",
|
|
747
779
|
"data-notification-bulkbar": !0,
|
|
748
780
|
children: [
|
|
749
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
750
|
-
!
|
|
781
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: W ? `All ${D} matching` : `${F.size} selected` }),
|
|
782
|
+
!W && F.size >= ye && D > ye && /* @__PURE__ */ n(
|
|
751
783
|
"button",
|
|
752
784
|
{
|
|
753
785
|
type: "button",
|
|
@@ -771,7 +803,7 @@ function jt({
|
|
|
771
803
|
"data-notification-bulk": "read",
|
|
772
804
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
773
805
|
children: [
|
|
774
|
-
/* @__PURE__ */ t(
|
|
806
|
+
/* @__PURE__ */ t(we, { className: "h-3 w-3" }),
|
|
775
807
|
" Mark read"
|
|
776
808
|
]
|
|
777
809
|
}
|
|
@@ -786,12 +818,12 @@ function jt({
|
|
|
786
818
|
"data-notification-bulk": "snooze",
|
|
787
819
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
788
820
|
children: [
|
|
789
|
-
/* @__PURE__ */ t(
|
|
821
|
+
/* @__PURE__ */ t(de, { className: "h-3 w-3" }),
|
|
790
822
|
" Snooze"
|
|
791
823
|
]
|
|
792
824
|
}
|
|
793
825
|
),
|
|
794
|
-
|
|
826
|
+
Ue && /* @__PURE__ */ t("div", { className: "absolute left-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: _e().map((e) => /* @__PURE__ */ t(
|
|
795
827
|
"button",
|
|
796
828
|
{
|
|
797
829
|
type: "button",
|
|
@@ -811,7 +843,7 @@ function jt({
|
|
|
811
843
|
"data-notification-bulk": "archive",
|
|
812
844
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
813
845
|
children: [
|
|
814
|
-
/* @__PURE__ */ t(
|
|
846
|
+
/* @__PURE__ */ t(ve, { className: "h-3 w-3" }),
|
|
815
847
|
" Archive"
|
|
816
848
|
]
|
|
817
849
|
}
|
|
@@ -822,17 +854,17 @@ function jt({
|
|
|
822
854
|
type: "button",
|
|
823
855
|
onClick: () => {
|
|
824
856
|
const e = [];
|
|
825
|
-
for (const a of [..._, ...
|
|
857
|
+
for (const a of [..._, ...L, ...H.flatMap((l) => l.rows)]) {
|
|
826
858
|
if (!F.has(a.id)) continue;
|
|
827
859
|
const l = Q(a, g);
|
|
828
860
|
l && (l.type === "external" ? e.push(l.url) : l.type === "path" && typeof window < "u" && e.push(`${window.location.origin}${l.path}`));
|
|
829
861
|
}
|
|
830
|
-
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(
|
|
862
|
+
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(pt(bt(e)));
|
|
831
863
|
},
|
|
832
864
|
"data-notification-bulk": "tabs",
|
|
833
865
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
834
866
|
children: [
|
|
835
|
-
/* @__PURE__ */ t(
|
|
867
|
+
/* @__PURE__ */ t(Ne, { className: "h-3 w-3" }),
|
|
836
868
|
" Open in tabs"
|
|
837
869
|
]
|
|
838
870
|
}
|
|
@@ -842,7 +874,7 @@ function jt({
|
|
|
842
874
|
{
|
|
843
875
|
type: "button",
|
|
844
876
|
onClick: () => {
|
|
845
|
-
|
|
877
|
+
K(/* @__PURE__ */ new Set()), T(!1);
|
|
846
878
|
},
|
|
847
879
|
className: "ml-auto text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2",
|
|
848
880
|
children: "Clear selection"
|
|
@@ -860,8 +892,8 @@ function jt({
|
|
|
860
892
|
"input",
|
|
861
893
|
{
|
|
862
894
|
type: "checkbox",
|
|
863
|
-
checked:
|
|
864
|
-
onChange: (e) =>
|
|
895
|
+
checked: R,
|
|
896
|
+
onChange: (e) => Me(e.target.checked),
|
|
865
897
|
className: "h-3.5 w-3.5",
|
|
866
898
|
"data-nvr-sent-critical": !0
|
|
867
899
|
}
|
|
@@ -869,11 +901,11 @@ function jt({
|
|
|
869
901
|
"Critical only"
|
|
870
902
|
] })
|
|
871
903
|
] }),
|
|
872
|
-
|
|
873
|
-
/* @__PURE__ */ t(
|
|
904
|
+
Te ? /* @__PURE__ */ t("p", { className: "py-10 text-[13px] text-slate-400", children: "Loading…" }) : pe.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
|
|
905
|
+
/* @__PURE__ */ t(Ce, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
874
906
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "Nothing sent yet" }),
|
|
875
|
-
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children:
|
|
876
|
-
] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children:
|
|
907
|
+
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: R ? 'No critical sends. Untick "Critical only" to see everything you sent.' : "Messages you send to stakeholders or colleagues appear here." })
|
|
908
|
+
] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: pe.map((e) => /* @__PURE__ */ n("div", { className: "px-4 py-3", "data-nvr-sent-row": !0, children: [
|
|
877
909
|
/* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
|
|
878
910
|
e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
879
911
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: e.subject.replace(/^critical:\s*/i, "") }),
|
|
@@ -930,14 +962,14 @@ function jt({
|
|
|
930
962
|
}
|
|
931
963
|
),
|
|
932
964
|
a.name,
|
|
933
|
-
a.ack === "acked" && /* @__PURE__ */ t(
|
|
965
|
+
a.ack === "acked" && /* @__PURE__ */ t(ie, { className: "h-3 w-3" })
|
|
934
966
|
]
|
|
935
967
|
},
|
|
936
968
|
a.id
|
|
937
969
|
)) })
|
|
938
970
|
] }, e.key)) })
|
|
939
|
-
] }) :
|
|
940
|
-
/* @__PURE__ */ t(
|
|
971
|
+
] }) : Qe ? /* @__PURE__ */ t("p", { className: "px-8 py-10 text-[13px] text-slate-400", children: "Loading…" }) : L.length === 0 && H.length === 0 && _.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
|
|
972
|
+
/* @__PURE__ */ t(Ce, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
941
973
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "You're all caught up" }),
|
|
942
974
|
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: i === "inbox" ? "No unread notifications." : "No notifications here." })
|
|
943
975
|
] }) : /* @__PURE__ */ n("div", { className: "mx-8 my-6 divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: [
|
|
@@ -946,27 +978,27 @@ function jt({
|
|
|
946
978
|
"Needs your acknowledgement · ",
|
|
947
979
|
_.length
|
|
948
980
|
] }),
|
|
949
|
-
_.map((e) => /* @__PURE__ */ t(
|
|
981
|
+
_.map((e) => /* @__PURE__ */ t(se, { children: le(e) }, `pin:${e.id}`))
|
|
950
982
|
] }),
|
|
951
|
-
H.map(
|
|
952
|
-
|
|
953
|
-
const l = (
|
|
954
|
-
if (!
|
|
955
|
-
const o = new Date(
|
|
956
|
-
return o >=
|
|
957
|
-
}, u = l(e.created_at), z = a > 0 ? l(
|
|
958
|
-
return /* @__PURE__ */ n(
|
|
983
|
+
H.map(Ee),
|
|
984
|
+
L.map((e, a) => {
|
|
985
|
+
const l = (P) => {
|
|
986
|
+
if (!P) return "Older";
|
|
987
|
+
const o = new Date(P), k = /* @__PURE__ */ new Date(), re = new Date(k.getFullYear(), k.getMonth(), k.getDate());
|
|
988
|
+
return o >= re ? "Today" : o >= new Date(re.getTime() - 864e5) ? "Yesterday" : o >= new Date(re.getTime() - 5184e5) ? "This week" : "Older";
|
|
989
|
+
}, u = l(e.created_at), z = a > 0 ? l(L[a - 1].created_at) : null;
|
|
990
|
+
return /* @__PURE__ */ n(se, { children: [
|
|
959
991
|
u !== z ? /* @__PURE__ */ t("div", { className: "bg-slate-50/80 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:bg-muted/40", children: u }) : null,
|
|
960
|
-
|
|
992
|
+
le(e)
|
|
961
993
|
] }, e.id);
|
|
962
994
|
})
|
|
963
995
|
] }),
|
|
964
|
-
i !== "sent" && D >
|
|
996
|
+
i !== "sent" && D > ue && /* @__PURE__ */ n("div", { className: "mx-8 mb-6 flex items-center justify-between", children: [
|
|
965
997
|
/* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: [
|
|
966
998
|
"Page ",
|
|
967
999
|
S,
|
|
968
1000
|
" of ",
|
|
969
|
-
|
|
1001
|
+
E
|
|
970
1002
|
] }),
|
|
971
1003
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
972
1004
|
/* @__PURE__ */ n(
|
|
@@ -977,7 +1009,7 @@ function jt({
|
|
|
977
1009
|
onClick: () => q((e) => Math.max(1, e - 1)),
|
|
978
1010
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
979
1011
|
children: [
|
|
980
|
-
/* @__PURE__ */ t(
|
|
1012
|
+
/* @__PURE__ */ t(rt, { className: "mr-1 h-3.5 w-3.5" }),
|
|
981
1013
|
"Previous"
|
|
982
1014
|
]
|
|
983
1015
|
}
|
|
@@ -986,12 +1018,12 @@ function jt({
|
|
|
986
1018
|
"button",
|
|
987
1019
|
{
|
|
988
1020
|
type: "button",
|
|
989
|
-
disabled: S >=
|
|
990
|
-
onClick: () => q((e) => Math.min(
|
|
1021
|
+
disabled: S >= E,
|
|
1022
|
+
onClick: () => q((e) => Math.min(E, e + 1)),
|
|
991
1023
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
992
1024
|
children: [
|
|
993
1025
|
"Next",
|
|
994
|
-
/* @__PURE__ */ t(
|
|
1026
|
+
/* @__PURE__ */ t(dt, { className: "ml-1 h-3.5 w-3.5" })
|
|
995
1027
|
]
|
|
996
1028
|
}
|
|
997
1029
|
)
|
|
@@ -999,15 +1031,15 @@ function jt({
|
|
|
999
1031
|
] })
|
|
1000
1032
|
] }),
|
|
1001
1033
|
/* @__PURE__ */ t(
|
|
1002
|
-
|
|
1034
|
+
gt,
|
|
1003
1035
|
{
|
|
1004
1036
|
notificationId: (b == null ? void 0 : b.id) ?? null,
|
|
1005
1037
|
title: (b == null ? void 0 : b.subject) ?? (b == null ? void 0 : b.title) ?? null,
|
|
1006
|
-
onClose: () =>
|
|
1038
|
+
onClose: () => xe(null)
|
|
1007
1039
|
}
|
|
1008
1040
|
)
|
|
1009
1041
|
] });
|
|
1010
1042
|
}
|
|
1011
1043
|
export {
|
|
1012
|
-
|
|
1044
|
+
Qt as NotificationCenterView
|
|
1013
1045
|
};
|