@nivaro/react 0.2.54 → 0.2.55
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 +99 -98
- package/dist/index.d.ts +339 -2
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,79 +1,80 @@
|
|
|
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 ve, markNotificationRead as we, markNotificationsRead as ye, markAllNotificationsRead as Ne } from "@nivaro/sdk";
|
|
3
|
+
import { useQueryClient as Ce, useQuery as ne, useMutation as _ } from "@tanstack/react-query";
|
|
4
|
+
import { Bell as $e, CheckCheck as Se, ExternalLink as re, Check as z, History as qe, ShieldCheck as Ee, ChevronDown as _e } 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
|
|
6
|
+
import { createPortal as Re } from "react-dom";
|
|
7
7
|
import { useNivaroClient as Ae } from "../context.js";
|
|
8
|
-
import { get as Fe, post as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { get as Fe, post as Le } from "../lib/commands.js";
|
|
9
|
+
import { useLiveRefetchInterval as Me } from "../lib/live-queries.js";
|
|
10
|
+
import { resolveNotificationTargetFor as R, runNotificationTarget as A } from "../lib/notification-target.js";
|
|
11
|
+
import { useTabAttention as Ie } from "../lib/tab-attention.js";
|
|
11
12
|
import { formatRelative as se } from "../lib/utils.js";
|
|
12
|
-
import { AsItWasSheet as
|
|
13
|
-
import { bundleLocally as
|
|
14
|
-
import { DeliveryChips as
|
|
15
|
-
import { NotificationActions as
|
|
16
|
-
import { NotificationDetailBits as
|
|
17
|
-
function
|
|
13
|
+
import { AsItWasSheet as De } from "./notifications/AsItWasSheet.js";
|
|
14
|
+
import { bundleLocally as Te, laneTone as Ke, bundleAsNotification as Be, bundleHeadline as je, categoryChipLabel as ze } from "./notifications/bundles.js";
|
|
15
|
+
import { DeliveryChips as Oe } from "./notifications/DeliveryChips.js";
|
|
16
|
+
import { NotificationActions as Pe } from "./notifications/NotificationActions.js";
|
|
17
|
+
import { NotificationDetailBits as Qe } from "./notifications/NotificationDetailBits.js";
|
|
18
|
+
function He(s) {
|
|
18
19
|
var C, $, S;
|
|
19
20
|
if ((((C = s.target) == null ? void 0 : C.kind) ?? s.kind ?? (s.collection && s.item ? "record" : null)) !== "record") return !1;
|
|
20
|
-
const g = (($ = s.target) == null ? void 0 : $.collection) ?? s.collection,
|
|
21
|
-
return !!g &&
|
|
21
|
+
const g = (($ = s.target) == null ? void 0 : $.collection) ?? s.collection, m = ((S = s.target) == null ? void 0 : S.id) ?? s.item;
|
|
22
|
+
return !!g && m != null && m !== "" && !/^(nivaro|directus)_|^__/i.test(g);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function dt({
|
|
24
25
|
routes: s,
|
|
25
|
-
onNavigate:
|
|
26
|
+
onNavigate: p,
|
|
26
27
|
app: g,
|
|
27
|
-
subscribe:
|
|
28
|
+
subscribe: m,
|
|
28
29
|
buttonClassName: C,
|
|
29
30
|
panelClassName: $,
|
|
30
31
|
beforeList: S,
|
|
31
|
-
extraBadge:
|
|
32
|
+
extraBadge: P = 0,
|
|
32
33
|
mailLogUrl: de,
|
|
33
|
-
renderTrigger:
|
|
34
|
-
allPath:
|
|
34
|
+
renderTrigger: Q,
|
|
35
|
+
allPath: H,
|
|
35
36
|
subscriptionsPath: ce,
|
|
36
37
|
onActionError: ue,
|
|
37
38
|
panelPlacement: v = "below",
|
|
38
39
|
tabBadge: me = !0
|
|
39
40
|
}) {
|
|
40
|
-
const
|
|
41
|
+
const h = Ae(), [x, d] = N(!1), [f, Y] = N("attention"), F = oe(null), G = oe(null), [L, pe] = N(null), U = Ce(), w = () => {
|
|
41
42
|
U.invalidateQueries({ queryKey: ["notification-count"] }), U.invalidateQueries({ queryKey: ["notifications"] });
|
|
42
|
-
}, { data: c } = ne({
|
|
43
|
+
}, xe = Me(6e4, { enabled: !!m, safetyMs: 12e4 }), { data: c } = ne({
|
|
43
44
|
queryKey: ["notification-count"],
|
|
44
|
-
queryFn: () =>
|
|
45
|
-
refetchInterval:
|
|
46
|
-
}), M = (c == null ? void 0 : c.unread) ?? 0,
|
|
47
|
-
|
|
45
|
+
queryFn: () => h.request(ve()),
|
|
46
|
+
refetchInterval: xe
|
|
47
|
+
}), M = (c == null ? void 0 : c.unread) ?? 0, I = (c == null ? void 0 : c.attention) ?? M, q = (c == null ? void 0 : c.lanes) ?? { critical: 0, fyi: 0 }, b = M + P;
|
|
48
|
+
Ie(I + P, { enabled: me });
|
|
48
49
|
const { data: u } = ne({
|
|
49
|
-
queryKey: ["notifications", "bell", g ?? null,
|
|
50
|
-
queryFn: () =>
|
|
50
|
+
queryKey: ["notifications", "bell", g ?? null, f],
|
|
51
|
+
queryFn: () => h.request(
|
|
51
52
|
Fe("/notifications", {
|
|
52
53
|
limit: 60,
|
|
53
54
|
app: g,
|
|
54
55
|
bundle: "record",
|
|
55
|
-
...
|
|
56
|
-
...
|
|
56
|
+
...f === "attention" ? { lane: "attention", status: "inbox" } : {},
|
|
57
|
+
...f === "fyi" ? { lane: "fyi", status: "inbox" } : {}
|
|
57
58
|
})
|
|
58
59
|
).then((e) => {
|
|
59
60
|
const t = e.pinned ?? [], o = new Set(t.map((n) => n.id)), i = (e.data ?? []).filter((n) => !o.has(n.id));
|
|
60
|
-
return e.bundles ? { rows: i, bundles: e.bundles, pinned: t } : { ...
|
|
61
|
+
return e.bundles ? { rows: i, bundles: e.bundles, pinned: t } : { ...Te(i), pinned: t };
|
|
61
62
|
}),
|
|
62
63
|
enabled: x
|
|
63
|
-
}), V = (u == null ? void 0 : u.rows) ?? [],
|
|
64
|
-
O(() =>
|
|
64
|
+
}), V = (u == null ? void 0 : u.rows) ?? [], D = (u == null ? void 0 : u.pinned) ?? [], W = (u == null ? void 0 : u.bundles) ?? [], [fe, J] = N(() => /* @__PURE__ */ new Set()), [k, T] = N(null);
|
|
65
|
+
O(() => m == null ? void 0 : m(w), [m]), O(() => {
|
|
65
66
|
if (!x) return;
|
|
66
67
|
const e = (t) => {
|
|
67
68
|
var i, n;
|
|
68
69
|
const o = t.target;
|
|
69
|
-
(i =
|
|
70
|
+
(i = F.current) != null && i.contains(o) || (n = G.current) != null && n.contains(o) || d(!1);
|
|
70
71
|
};
|
|
71
72
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
72
73
|
}, [x]), O(() => {
|
|
73
74
|
if (!x || v !== "right") return;
|
|
74
75
|
const e = () => {
|
|
75
76
|
var o;
|
|
76
|
-
const t = (o =
|
|
77
|
+
const t = (o = F.current) == null ? void 0 : o.getBoundingClientRect();
|
|
77
78
|
t && pe({
|
|
78
79
|
left: Math.round(t.right + 12),
|
|
79
80
|
bottom: Math.max(8, Math.round(window.innerHeight - t.bottom))
|
|
@@ -84,16 +85,16 @@ function lt({
|
|
|
84
85
|
};
|
|
85
86
|
}, [x, v]);
|
|
86
87
|
const X = _({
|
|
87
|
-
mutationFn: (e) =>
|
|
88
|
+
mutationFn: (e) => h.request(Le(`/notifications/${e}/acknowledge`)),
|
|
88
89
|
onSuccess: w
|
|
89
90
|
}), K = _({
|
|
90
|
-
mutationFn: (e) =>
|
|
91
|
+
mutationFn: (e) => h.request(we(e)),
|
|
91
92
|
onSuccess: w
|
|
92
93
|
}), B = _({
|
|
93
|
-
mutationFn: (e) =>
|
|
94
|
+
mutationFn: (e) => h.request(ye(e)),
|
|
94
95
|
onSuccess: w
|
|
95
96
|
}), he = _({
|
|
96
|
-
mutationFn: () =>
|
|
97
|
+
mutationFn: () => h.request(Ne()),
|
|
97
98
|
onSuccess: w
|
|
98
99
|
}), Z = le(() => V.slice(0, 40), [V]), ee = le(() => {
|
|
99
100
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -107,11 +108,11 @@ function lt({
|
|
|
107
108
|
i.rows.push(t), e.set(o, i);
|
|
108
109
|
}
|
|
109
110
|
return [...e.values()];
|
|
110
|
-
}, [Z]),
|
|
111
|
-
const t =
|
|
112
|
-
t && (d(!1),
|
|
111
|
+
}, [Z]), be = (e) => {
|
|
112
|
+
const t = R(e, s);
|
|
113
|
+
t && (d(!1), A(t, p));
|
|
113
114
|
}, te = (e) => {
|
|
114
|
-
d(!1),
|
|
115
|
+
d(!1), p(e);
|
|
115
116
|
}, j = (e, t, o = !1) => {
|
|
116
117
|
var i;
|
|
117
118
|
return /* @__PURE__ */ r(ie, { children: [
|
|
@@ -120,7 +121,7 @@ function lt({
|
|
|
120
121
|
{
|
|
121
122
|
type: "button",
|
|
122
123
|
onClick: () => {
|
|
123
|
-
e.read || K.mutate(e.id),
|
|
124
|
+
e.read || K.mutate(e.id), be(e);
|
|
124
125
|
},
|
|
125
126
|
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"}`,
|
|
126
127
|
"data-notification-row": e.id,
|
|
@@ -146,14 +147,14 @@ function lt({
|
|
|
146
147
|
/* @__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: [
|
|
147
148
|
se(e.created_at),
|
|
148
149
|
/* @__PURE__ */ a(
|
|
149
|
-
|
|
150
|
+
Oe,
|
|
150
151
|
{
|
|
151
152
|
delivery: e.delivery,
|
|
152
153
|
mailLogUrl: de,
|
|
153
154
|
onNavigate: te
|
|
154
155
|
}
|
|
155
156
|
),
|
|
156
|
-
|
|
157
|
+
He(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
|
|
157
158
|
/* @__PURE__ */ r(
|
|
158
159
|
"span",
|
|
159
160
|
{
|
|
@@ -169,7 +170,7 @@ function lt({
|
|
|
169
170
|
},
|
|
170
171
|
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",
|
|
171
172
|
children: [
|
|
172
|
-
/* @__PURE__ */ a(
|
|
173
|
+
/* @__PURE__ */ a(qe, { className: "h-3 w-3" }),
|
|
173
174
|
"as it was"
|
|
174
175
|
]
|
|
175
176
|
}
|
|
@@ -205,13 +206,13 @@ function lt({
|
|
|
205
206
|
"data-notification-acknowledge": e.id,
|
|
206
207
|
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",
|
|
207
208
|
children: [
|
|
208
|
-
/* @__PURE__ */ a(
|
|
209
|
+
/* @__PURE__ */ a(Ee, { className: "h-3 w-3" }),
|
|
209
210
|
"Acknowledge"
|
|
210
211
|
]
|
|
211
212
|
}
|
|
212
213
|
) }),
|
|
213
214
|
e.actions && e.actions.length > 0 && !e.read && /* @__PURE__ */ a(
|
|
214
|
-
|
|
215
|
+
Pe,
|
|
215
216
|
{
|
|
216
217
|
actions: e.actions,
|
|
217
218
|
notificationId: e.id,
|
|
@@ -220,7 +221,7 @@ function lt({
|
|
|
220
221
|
}
|
|
221
222
|
),
|
|
222
223
|
/* @__PURE__ */ a(
|
|
223
|
-
|
|
224
|
+
Qe,
|
|
224
225
|
{
|
|
225
226
|
detail: e.detail,
|
|
226
227
|
why: e.why,
|
|
@@ -231,8 +232,8 @@ function lt({
|
|
|
231
232
|
}
|
|
232
233
|
)
|
|
233
234
|
] }, e.id);
|
|
234
|
-
},
|
|
235
|
-
const t = `${e.collection}:${e.item}`, o =
|
|
235
|
+
}, ke = (e) => {
|
|
236
|
+
const t = `${e.collection}:${e.item}`, o = fe.has(t), i = Ke(e.lane), n = e.deleted ? null : R(Be(e), s), y = e.rows.filter((l) => !l.read).map((l) => l.id);
|
|
236
237
|
return /* @__PURE__ */ r(
|
|
237
238
|
"div",
|
|
238
239
|
{
|
|
@@ -256,7 +257,7 @@ function lt({
|
|
|
256
257
|
}),
|
|
257
258
|
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",
|
|
258
259
|
children: /* @__PURE__ */ a(
|
|
259
|
-
|
|
260
|
+
_e,
|
|
260
261
|
{
|
|
261
262
|
className: `h-3.5 w-3.5 transition-transform ${o ? "" : "-rotate-90"}`
|
|
262
263
|
}
|
|
@@ -268,7 +269,7 @@ function lt({
|
|
|
268
269
|
{
|
|
269
270
|
type: "button",
|
|
270
271
|
onClick: () => {
|
|
271
|
-
n ? (d(!1),
|
|
272
|
+
n ? (d(!1), A(n, p)) : J((l) => new Set(l).add(t));
|
|
272
273
|
},
|
|
273
274
|
className: "min-w-0 flex-1 text-left",
|
|
274
275
|
children: [
|
|
@@ -283,7 +284,7 @@ function lt({
|
|
|
283
284
|
"span",
|
|
284
285
|
{
|
|
285
286
|
className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${i.text}` : "font-normal text-slate-600 dark:text-slate-400"}`,
|
|
286
|
-
children:
|
|
287
|
+
children: je(e)
|
|
287
288
|
}
|
|
288
289
|
)
|
|
289
290
|
] }),
|
|
@@ -316,7 +317,7 @@ function lt({
|
|
|
316
317
|
{
|
|
317
318
|
className: "rounded bg-slate-100 px-1 py-px text-[9.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
318
319
|
"data-notification-bundle-category": l,
|
|
319
|
-
children:
|
|
320
|
+
children: ze(l)
|
|
320
321
|
},
|
|
321
322
|
l
|
|
322
323
|
)),
|
|
@@ -337,7 +338,7 @@ function lt({
|
|
|
337
338
|
type: "button",
|
|
338
339
|
title: "Open record",
|
|
339
340
|
onClick: () => {
|
|
340
|
-
d(!1),
|
|
341
|
+
d(!1), A(n, p);
|
|
341
342
|
},
|
|
342
343
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
343
344
|
children: /* @__PURE__ */ a(re, { className: "h-3 w-3" })
|
|
@@ -368,13 +369,13 @@ function lt({
|
|
|
368
369
|
},
|
|
369
370
|
`bundle:${t}`
|
|
370
371
|
);
|
|
371
|
-
},
|
|
372
|
-
{ key: "attention", label: "Needs you", count:
|
|
372
|
+
}, ge = [
|
|
373
|
+
{ key: "attention", label: "Needs you", count: I },
|
|
373
374
|
{ key: "fyi", label: "FYI", count: q.fyi },
|
|
374
375
|
{ key: "all", label: "All", count: null }
|
|
375
|
-
], ae = () => d((e) => (!e &&
|
|
376
|
-
return /* @__PURE__ */ r("div", { ref:
|
|
377
|
-
|
|
376
|
+
], ae = () => d((e) => (!e && f === "attention" && I === 0 && q.fyi > 0 && Y("fyi"), !e));
|
|
377
|
+
return /* @__PURE__ */ r("div", { ref: F, className: "relative", "data-nvr-notification-bell": !0, children: [
|
|
378
|
+
Q ? Q({ open: x, badge: b, toggle: ae }) : /* @__PURE__ */ r(
|
|
378
379
|
"button",
|
|
379
380
|
{
|
|
380
381
|
type: "button",
|
|
@@ -382,7 +383,7 @@ function lt({
|
|
|
382
383
|
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",
|
|
383
384
|
"aria-label": b ? `Notifications (${b} unread)` : "Notifications",
|
|
384
385
|
children: [
|
|
385
|
-
/* @__PURE__ */ a(
|
|
386
|
+
/* @__PURE__ */ a($e, { className: "h-4 w-4", strokeWidth: 1.8 }),
|
|
386
387
|
b > 0 && /* @__PURE__ */ a(
|
|
387
388
|
"span",
|
|
388
389
|
{
|
|
@@ -394,7 +395,7 @@ function lt({
|
|
|
394
395
|
]
|
|
395
396
|
}
|
|
396
397
|
),
|
|
397
|
-
x && (v === "right" ?
|
|
398
|
+
x && (v === "right" ? Re : (e) => e)(
|
|
398
399
|
/* @__PURE__ */ r(
|
|
399
400
|
"div",
|
|
400
401
|
{
|
|
@@ -405,13 +406,13 @@ function lt({
|
|
|
405
406
|
children: [
|
|
406
407
|
S,
|
|
407
408
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 dark:border-border/60", children: [
|
|
408
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children:
|
|
409
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: ge.map((e) => /* @__PURE__ */ r(
|
|
409
410
|
"button",
|
|
410
411
|
{
|
|
411
412
|
type: "button",
|
|
412
413
|
onClick: () => Y(e.key),
|
|
413
414
|
"data-nvr-lane-tab": e.key,
|
|
414
|
-
className:
|
|
415
|
+
className: f === 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",
|
|
415
416
|
children: [
|
|
416
417
|
e.label,
|
|
417
418
|
e.count != null && e.count > 0 && /* @__PURE__ */ a(
|
|
@@ -432,21 +433,21 @@ function lt({
|
|
|
432
433
|
onClick: () => he.mutate(),
|
|
433
434
|
className: "inline-flex items-center gap-1 text-[11px] font-medium text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
434
435
|
children: [
|
|
435
|
-
/* @__PURE__ */ a(
|
|
436
|
+
/* @__PURE__ */ a(Se, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
436
437
|
"Mark all read"
|
|
437
438
|
]
|
|
438
439
|
}
|
|
439
440
|
)
|
|
440
441
|
] }),
|
|
441
442
|
/* @__PURE__ */ r("div", { className: "max-h-96 overflow-y-auto", children: [
|
|
442
|
-
|
|
443
|
+
D.length > 0 && /* @__PURE__ */ r("div", { "data-notification-pinned": !0, children: [
|
|
443
444
|
/* @__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" }),
|
|
444
|
-
|
|
445
|
+
D.map((e) => /* @__PURE__ */ a(ie, { children: j(e, !!R(e, s)) }, e.id))
|
|
445
446
|
] }),
|
|
446
|
-
ee.length === 0 && W.length === 0 &&
|
|
447
|
-
...W.map(
|
|
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: f === "attention" ? "Nothing needs you right now." : f === "fyi" ? "No FYI notifications." : "No notifications" }) : [
|
|
448
|
+
...W.map(ke),
|
|
448
449
|
...ee.map((e) => {
|
|
449
|
-
const t = e.rows.filter((l) => !l.read).map((l) => l.id), o =
|
|
450
|
+
const t = e.rows.filter((l) => !l.read).map((l) => l.id), o = R(e.rows[0], s), i = !!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;
|
|
450
451
|
return /* @__PURE__ */ r(
|
|
451
452
|
"div",
|
|
452
453
|
{
|
|
@@ -464,7 +465,7 @@ function lt({
|
|
|
464
465
|
type: "button",
|
|
465
466
|
title: "Open record",
|
|
466
467
|
onClick: () => {
|
|
467
|
-
t.length && B.mutate(t), d(!1),
|
|
468
|
+
t.length && B.mutate(t), d(!1), A(o, p);
|
|
468
469
|
},
|
|
469
470
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
470
471
|
children: /* @__PURE__ */ a(re, { className: "h-3 w-3" })
|
|
@@ -490,12 +491,12 @@ function lt({
|
|
|
490
491
|
})
|
|
491
492
|
]
|
|
492
493
|
] }),
|
|
493
|
-
|
|
494
|
+
H && /* @__PURE__ */ a(
|
|
494
495
|
"button",
|
|
495
496
|
{
|
|
496
497
|
type: "button",
|
|
497
498
|
onClick: () => {
|
|
498
|
-
d(!1),
|
|
499
|
+
d(!1), p(H);
|
|
499
500
|
},
|
|
500
501
|
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",
|
|
501
502
|
children: "See all notifications"
|
|
@@ -507,7 +508,7 @@ function lt({
|
|
|
507
508
|
document.body
|
|
508
509
|
),
|
|
509
510
|
/* @__PURE__ */ a(
|
|
510
|
-
|
|
511
|
+
De,
|
|
511
512
|
{
|
|
512
513
|
notificationId: (k == null ? void 0 : k.id) ?? null,
|
|
513
514
|
title: (k == null ? void 0 : k.title) ?? null,
|
|
@@ -517,6 +518,6 @@ function lt({
|
|
|
517
518
|
] });
|
|
518
519
|
}
|
|
519
520
|
export {
|
|
520
|
-
|
|
521
|
-
|
|
521
|
+
dt as NotificationBell,
|
|
522
|
+
He as hasSnapshotView
|
|
522
523
|
};
|