@nivaro/react 0.3.114 → 0.3.115
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/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1717 -21
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +1 -0
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +1927 -1635
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -1,98 +1,105 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { readUnreadNotificationCount as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { Bell as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { useNivaroClient as
|
|
8
|
-
import { get as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as Re } from "react/jsx-runtime";
|
|
2
|
+
import { readUnreadNotificationCount as Me, markNotificationRead as Se, markNotificationsRead as qe, markAllNotificationsRead as Le } from "@nivaro/sdk";
|
|
3
|
+
import { useQueryClient as Ae, useQuery as de, useMutation as A } from "@tanstack/react-query";
|
|
4
|
+
import { Bell as Ee, CheckCheck as Fe, ExternalLink as ce, Check as E, History as Ie, ShieldCheck as Te, ChevronDown as De } from "lucide-react";
|
|
5
|
+
import { useState as R, useRef as z, useEffect as Q, useMemo as ue, Fragment as pe } from "react";
|
|
6
|
+
import { createPortal as Be } from "react-dom";
|
|
7
|
+
import { useNivaroClient as Ke } from "../context.js";
|
|
8
|
+
import { get as Oe, post as Pe } from "../lib/commands.js";
|
|
9
|
+
import { createCoalescer as je } from "../lib/live-counts.js";
|
|
10
|
+
import { useLiveRefetchInterval as ze } from "../lib/live-queries.js";
|
|
11
|
+
import { resolveNotificationTargetFor as M, runNotificationTarget as F } from "../lib/notification-target.js";
|
|
12
|
+
import { useRecordPeek as Qe, notificationPeekTarget as He, isNewTabClick as Ge } from "../lib/record-peek.js";
|
|
13
|
+
import { cn as Ue, formatRelative as Ye } from "../lib/utils.js";
|
|
14
|
+
import { AgentBadge as Ve } from "./AgentBadge.js";
|
|
15
|
+
import { LiveCount as me } from "./LiveCount.js";
|
|
16
|
+
import { AsItWasSheet as We } from "./notifications/AsItWasSheet.js";
|
|
17
|
+
import { bundleLocally as Je, laneTone as Xe, bundleAsNotification as Ze, bundleHeadline as et, categoryChipLabel as tt } from "./notifications/bundles.js";
|
|
18
|
+
import { DeliveryChips as at } from "./notifications/DeliveryChips.js";
|
|
19
|
+
import { NotificationActions as rt } from "./notifications/NotificationActions.js";
|
|
20
|
+
import { ResolvedLine as nt, NotificationDetailBits as ot } from "./notifications/NotificationDetailBits.js";
|
|
21
|
+
import { RelativeTime as lt } from "./RelativeTime.js";
|
|
22
|
+
function it(r) {
|
|
23
|
+
var m, k;
|
|
24
|
+
if (!r) return null;
|
|
25
|
+
if (r.target_label && r.kind !== "record") return r.target_label;
|
|
26
|
+
if (String(r.collection ?? "") === "__chat__") return "Chat";
|
|
27
|
+
if (!r.collection) return null;
|
|
28
|
+
const c = ((m = r.record_collection_label) == null ? void 0 : m.trim()) || (() => {
|
|
29
|
+
const h = String(r.collection).replace(/_/g, " ").trim();
|
|
26
30
|
return h ? h.charAt(0).toUpperCase() + h.slice(1) : null;
|
|
27
|
-
})(), u = (k =
|
|
28
|
-
return
|
|
31
|
+
})(), u = (k = r.record_label) == null ? void 0 : k.trim();
|
|
32
|
+
return c && u ? `${c} ${u}` : u || c || null;
|
|
29
33
|
}
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
return
|
|
34
|
+
function st(r) {
|
|
35
|
+
var c, u;
|
|
36
|
+
return fe(r) ? r.revision_id != null || (((u = (c = r.detail) == null ? void 0 : c.changes) == null ? void 0 : u.length) ?? 0) > 0 || r.category === "watch" || r.category === "workflow" : !1;
|
|
33
37
|
}
|
|
34
|
-
function
|
|
35
|
-
var k, h,
|
|
36
|
-
if ((((k =
|
|
37
|
-
const u = ((h =
|
|
38
|
-
return !!u &&
|
|
38
|
+
function fe(r) {
|
|
39
|
+
var k, h, S;
|
|
40
|
+
if ((((k = r.target) == null ? void 0 : k.kind) ?? r.kind ?? (r.collection && r.item ? "record" : null)) !== "record") return !1;
|
|
41
|
+
const u = ((h = r.target) == null ? void 0 : h.collection) ?? r.collection, m = ((S = r.target) == null ? void 0 : S.id) ?? r.item;
|
|
42
|
+
return !!u && m != null && m !== "" && !/^(nivaro|directus)_|^__/i.test(u);
|
|
39
43
|
}
|
|
40
|
-
function
|
|
41
|
-
routes:
|
|
42
|
-
onNavigate:
|
|
44
|
+
function qt({
|
|
45
|
+
routes: r,
|
|
46
|
+
onNavigate: c,
|
|
43
47
|
app: u,
|
|
44
|
-
subscribe:
|
|
48
|
+
subscribe: m,
|
|
45
49
|
buttonClassName: k,
|
|
46
50
|
panelClassName: h,
|
|
47
|
-
beforeList:
|
|
48
|
-
extraBadge:
|
|
49
|
-
mailLogUrl:
|
|
51
|
+
beforeList: S,
|
|
52
|
+
extraBadge: xe = 0,
|
|
53
|
+
mailLogUrl: he,
|
|
50
54
|
renderTrigger: H,
|
|
51
55
|
allPath: G,
|
|
52
|
-
subscriptionsPath:
|
|
53
|
-
rulesPath:
|
|
54
|
-
onActionError:
|
|
55
|
-
panelPlacement:
|
|
56
|
-
tabBadge: xe = !0
|
|
56
|
+
subscriptionsPath: be,
|
|
57
|
+
rulesPath: ke,
|
|
58
|
+
onActionError: ge,
|
|
59
|
+
panelPlacement: _ = "below"
|
|
57
60
|
}) {
|
|
58
|
-
const y =
|
|
61
|
+
const y = Ke(), I = Qe(), [g, p] = R(!1), [v, U] = R("attention"), T = z(null), Y = z(null), [D, ve] = R(null), V = Ae(), N = () => {
|
|
59
62
|
V.invalidateQueries({ queryKey: ["notification-count"] }), V.invalidateQueries({ queryKey: ["notifications"] });
|
|
60
|
-
},
|
|
63
|
+
}, we = ze(6e4, { enabled: !!m, safetyMs: 12e4 }), { data: f } = de({
|
|
61
64
|
queryKey: ["notification-count"],
|
|
62
|
-
queryFn: () => y.request(
|
|
63
|
-
refetchInterval:
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
const { data: x } = re({
|
|
67
|
-
queryKey: ["notifications", "bell", u ?? null, w],
|
|
65
|
+
queryFn: () => y.request(Me()),
|
|
66
|
+
refetchInterval: we
|
|
67
|
+
}), B = (f == null ? void 0 : f.unread) ?? 0, W = (f == null ? void 0 : f.attention) ?? B, q = (f == null ? void 0 : f.lanes) ?? { critical: 0, fyi: 0 }, C = B + xe, { data: x } = de({
|
|
68
|
+
queryKey: ["notifications", "bell", u ?? null, v],
|
|
68
69
|
queryFn: () => y.request(
|
|
69
|
-
|
|
70
|
+
Oe("/notifications", {
|
|
70
71
|
limit: 60,
|
|
71
72
|
app: u,
|
|
72
73
|
bundle: "record",
|
|
73
|
-
...
|
|
74
|
-
...
|
|
74
|
+
...v === "attention" ? { lane: "attention", status: "inbox" } : {},
|
|
75
|
+
...v === "fyi" ? { lane: "fyi", status: "inbox" } : {}
|
|
75
76
|
})
|
|
76
77
|
).then((e) => {
|
|
77
78
|
const a = e.pinned ?? [], o = new Set(a.map((s) => s.id)), i = (e.data ?? []).filter((s) => !o.has(s.id));
|
|
78
|
-
return e.bundles ? { rows: i, bundles: e.bundles, pinned: a } : { ...
|
|
79
|
+
return e.bundles ? { rows: i, bundles: e.bundles, pinned: a } : { ...Je(i), pinned: a };
|
|
79
80
|
}),
|
|
80
81
|
enabled: g
|
|
81
|
-
}),
|
|
82
|
-
|
|
82
|
+
}), J = (x == null ? void 0 : x.rows) ?? [], K = (x == null ? void 0 : x.pinned) ?? [], X = (x == null ? void 0 : x.bundles) ?? [], [ye, Z] = R(() => /* @__PURE__ */ new Set()), [$, O] = R(null), ee = z(N);
|
|
83
|
+
ee.current = N, Q(() => {
|
|
84
|
+
if (!m) return;
|
|
85
|
+
const e = je(() => ee.current()), a = m(() => e.poke());
|
|
86
|
+
return () => {
|
|
87
|
+
a(), e.cancel();
|
|
88
|
+
};
|
|
89
|
+
}, [m]), Q(() => {
|
|
83
90
|
if (!g) return;
|
|
84
91
|
const e = (a) => {
|
|
85
92
|
var i, s;
|
|
86
93
|
const o = a.target;
|
|
87
|
-
(i =
|
|
94
|
+
(i = T.current) != null && i.contains(o) || (s = Y.current) != null && s.contains(o) || p(!1);
|
|
88
95
|
};
|
|
89
96
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
90
|
-
}, [g]),
|
|
91
|
-
if (!g ||
|
|
97
|
+
}, [g]), Q(() => {
|
|
98
|
+
if (!g || _ !== "right") return;
|
|
92
99
|
const e = () => {
|
|
93
100
|
var o;
|
|
94
|
-
const a = (o =
|
|
95
|
-
a &&
|
|
101
|
+
const a = (o = T.current) == null ? void 0 : o.getBoundingClientRect();
|
|
102
|
+
a && ve({
|
|
96
103
|
left: Math.round(a.right + 12),
|
|
97
104
|
bottom: Math.max(8, Math.round(window.innerHeight - a.bottom))
|
|
98
105
|
});
|
|
@@ -100,22 +107,22 @@ function xt({
|
|
|
100
107
|
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
101
108
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
102
109
|
};
|
|
103
|
-
}, [g,
|
|
104
|
-
const
|
|
105
|
-
mutationFn: (e) => y.request(
|
|
106
|
-
onSuccess:
|
|
107
|
-
}),
|
|
108
|
-
mutationFn: (e) => y.request(
|
|
109
|
-
onSuccess:
|
|
110
|
-
}),
|
|
111
|
-
mutationFn: (e) => y.request(
|
|
112
|
-
onSuccess:
|
|
113
|
-
}),
|
|
114
|
-
mutationFn: () => y.request(
|
|
115
|
-
onSuccess:
|
|
116
|
-
}),
|
|
110
|
+
}, [g, _]);
|
|
111
|
+
const te = A({
|
|
112
|
+
mutationFn: (e) => y.request(Pe(`/notifications/${e}/acknowledge`)),
|
|
113
|
+
onSuccess: N
|
|
114
|
+
}), L = A({
|
|
115
|
+
mutationFn: (e) => y.request(Se(e)),
|
|
116
|
+
onSuccess: N
|
|
117
|
+
}), P = A({
|
|
118
|
+
mutationFn: (e) => y.request(qe(e)),
|
|
119
|
+
onSuccess: N
|
|
120
|
+
}), Ne = A({
|
|
121
|
+
mutationFn: () => y.request(Le()),
|
|
122
|
+
onSuccess: N
|
|
123
|
+
}), ae = ue(() => J.slice(0, 40), [J]), re = ue(() => {
|
|
117
124
|
const e = /* @__PURE__ */ new Map();
|
|
118
|
-
for (const a of
|
|
125
|
+
for (const a of ae) {
|
|
119
126
|
const o = a.collection && a.item ? `${a.collection}:${a.item}` : `single:${a.id}`, i = e.get(o) ?? {
|
|
120
127
|
key: o,
|
|
121
128
|
collection: a.collection ?? null,
|
|
@@ -125,22 +132,27 @@ function xt({
|
|
|
125
132
|
i.rows.push(a), e.set(o, i);
|
|
126
133
|
}
|
|
127
134
|
return [...e.values()];
|
|
128
|
-
}, [
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
}, [ae]), Ce = (e, a) => {
|
|
136
|
+
const o = I ? He(e) : null;
|
|
137
|
+
if (o && I && !Ge(a)) {
|
|
138
|
+
p(!1), I.open(o);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const i = M(e, r);
|
|
142
|
+
i && (p(!1), F(i, c));
|
|
143
|
+
}, ne = (e) => {
|
|
144
|
+
p(!1), c(e);
|
|
145
|
+
}, j = (e, a, o = !1) => {
|
|
146
|
+
var w, le, ie, se;
|
|
147
|
+
const i = M(e, r) != null, s = `py-2 pr-3 ${o ? "pl-7" : "pl-3"}`, b = /* @__PURE__ */ n(Re, { children: [
|
|
136
148
|
/* @__PURE__ */ t(
|
|
137
149
|
"span",
|
|
138
150
|
{
|
|
139
151
|
className: `mt-1.5 h-2 w-2 shrink-0 rounded-full ${e.read ? "bg-transparent" : e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan"}`
|
|
140
152
|
}
|
|
141
153
|
),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
|
|
155
|
+
/* @__PURE__ */ n(
|
|
144
156
|
"span",
|
|
145
157
|
{
|
|
146
158
|
className: `block truncate text-[12.5px] ${e.read ? "font-normal text-slate-600 dark:text-slate-400" : "font-medium text-slate-900 dark:text-slate-100"}`,
|
|
@@ -150,34 +162,36 @@ function xt({
|
|
|
150
162
|
]
|
|
151
163
|
}
|
|
152
164
|
),
|
|
153
|
-
e.message && /* @__PURE__ */ t("span", { className: "mt-0.5 line-clamp-2 text-[11px] leading-snug text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
|
|
165
|
+
e.message && /* @__PURE__ */ t("span", { className: "mt-0.5 line-clamp-2 whitespace-pre-line text-[11px] leading-snug text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
166
|
+
/* @__PURE__ */ t(nt, { resolved: (w = e.detail) == null ? void 0 : w.resolved }),
|
|
167
|
+
/* @__PURE__ */ n("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10.5px] text-slate-400", children: [
|
|
168
|
+
/* @__PURE__ */ t(lt, { value: e.created_at }),
|
|
169
|
+
/* @__PURE__ */ t(Ve, { label: (le = e.detail) == null ? void 0 : le.via_agent }),
|
|
156
170
|
/* @__PURE__ */ t(
|
|
157
|
-
|
|
171
|
+
at,
|
|
158
172
|
{
|
|
159
173
|
delivery: e.delivery,
|
|
160
|
-
mailLogUrl:
|
|
161
|
-
onNavigate:
|
|
174
|
+
mailLogUrl: he,
|
|
175
|
+
onNavigate: ne
|
|
162
176
|
}
|
|
163
177
|
),
|
|
164
|
-
|
|
165
|
-
/* @__PURE__ */
|
|
178
|
+
fe(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
|
|
179
|
+
/* @__PURE__ */ n(
|
|
166
180
|
"span",
|
|
167
181
|
{
|
|
168
182
|
role: "button",
|
|
169
183
|
tabIndex: -1,
|
|
170
184
|
"data-notification-as-it-was": e.id,
|
|
171
185
|
"data-tip": "The record as it was when you were told",
|
|
172
|
-
onClick: (
|
|
173
|
-
|
|
186
|
+
onClick: (d) => {
|
|
187
|
+
d.stopPropagation(), p(!1), O(e);
|
|
174
188
|
},
|
|
175
|
-
onKeyDown: (
|
|
176
|
-
(
|
|
189
|
+
onKeyDown: (d) => {
|
|
190
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), d.stopPropagation(), p(!1), O(e));
|
|
177
191
|
},
|
|
178
192
|
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",
|
|
179
193
|
children: [
|
|
180
|
-
/* @__PURE__ */ t(
|
|
194
|
+
/* @__PURE__ */ t(Ie, { className: "h-3 w-3" }),
|
|
181
195
|
"as it was"
|
|
182
196
|
]
|
|
183
197
|
}
|
|
@@ -185,13 +199,13 @@ function xt({
|
|
|
185
199
|
] })
|
|
186
200
|
] })
|
|
187
201
|
] }), l = "mt-0.5 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200";
|
|
188
|
-
return /* @__PURE__ */
|
|
189
|
-
i ? /* @__PURE__ */
|
|
202
|
+
return /* @__PURE__ */ n(pe, { children: [
|
|
203
|
+
i ? /* @__PURE__ */ n(
|
|
190
204
|
"button",
|
|
191
205
|
{
|
|
192
206
|
type: "button",
|
|
193
|
-
onClick: () => {
|
|
194
|
-
e.read ||
|
|
207
|
+
onClick: (d) => {
|
|
208
|
+
e.read || L.mutate(e.id), Ce(e, d);
|
|
195
209
|
},
|
|
196
210
|
className: `flex w-full items-start gap-2.5 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted ${s}`,
|
|
197
211
|
"data-notification-row": e.id,
|
|
@@ -205,19 +219,19 @@ function xt({
|
|
|
205
219
|
tabIndex: -1,
|
|
206
220
|
"aria-label": "Mark read",
|
|
207
221
|
"data-tip": "Mark read",
|
|
208
|
-
onClick: (
|
|
209
|
-
|
|
222
|
+
onClick: (d) => {
|
|
223
|
+
d.stopPropagation(), L.mutate(e.id);
|
|
210
224
|
},
|
|
211
|
-
onKeyDown: (
|
|
212
|
-
(
|
|
225
|
+
onKeyDown: (d) => {
|
|
226
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), d.stopPropagation(), L.mutate(e.id));
|
|
213
227
|
},
|
|
214
228
|
className: l,
|
|
215
|
-
children: /* @__PURE__ */ t(
|
|
229
|
+
children: /* @__PURE__ */ t(E, { className: "h-3 w-3" })
|
|
216
230
|
}
|
|
217
231
|
)
|
|
218
232
|
]
|
|
219
233
|
}
|
|
220
|
-
) : /* @__PURE__ */
|
|
234
|
+
) : /* @__PURE__ */ n(
|
|
221
235
|
"div",
|
|
222
236
|
{
|
|
223
237
|
className: `flex w-full items-start gap-2.5 text-left ${s}`,
|
|
@@ -232,55 +246,55 @@ function xt({
|
|
|
232
246
|
"aria-label": "Mark read",
|
|
233
247
|
"data-tip": "Mark read",
|
|
234
248
|
tabIndex: e.read ? -1 : void 0,
|
|
235
|
-
onClick: () =>
|
|
236
|
-
className:
|
|
237
|
-
children: /* @__PURE__ */ t(
|
|
249
|
+
onClick: () => L.mutate(e.id),
|
|
250
|
+
className: Ue(l, "shrink-0", e.read && "invisible"),
|
|
251
|
+
children: /* @__PURE__ */ t(E, { className: "h-3 w-3" })
|
|
238
252
|
}
|
|
239
253
|
)
|
|
240
254
|
]
|
|
241
255
|
}
|
|
242
256
|
),
|
|
243
|
-
((
|
|
257
|
+
((ie = e.ack) == null ? void 0 : ie.required) && !e.ack.at && /* @__PURE__ */ t("div", { className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`, children: /* @__PURE__ */ n(
|
|
244
258
|
"button",
|
|
245
259
|
{
|
|
246
260
|
type: "button",
|
|
247
|
-
disabled:
|
|
248
|
-
onClick: () =>
|
|
261
|
+
disabled: te.isPending,
|
|
262
|
+
onClick: () => te.mutate(e.id),
|
|
249
263
|
"data-notification-acknowledge": e.id,
|
|
250
264
|
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",
|
|
251
265
|
children: [
|
|
252
|
-
/* @__PURE__ */ t(
|
|
266
|
+
/* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
|
|
253
267
|
"Acknowledge"
|
|
254
268
|
]
|
|
255
269
|
}
|
|
256
270
|
) }),
|
|
257
|
-
e.actions && e.actions.length > 0 && !e.read && /* @__PURE__ */ t(
|
|
258
|
-
|
|
271
|
+
e.actions && e.actions.length > 0 && !e.read && !((se = e.detail) != null && se.resolved) && /* @__PURE__ */ t(
|
|
272
|
+
rt,
|
|
259
273
|
{
|
|
260
274
|
actions: e.actions,
|
|
261
275
|
notificationId: e.id,
|
|
262
|
-
onError:
|
|
276
|
+
onError: ge,
|
|
263
277
|
className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
|
|
264
278
|
}
|
|
265
279
|
),
|
|
266
280
|
/* @__PURE__ */ t(
|
|
267
|
-
|
|
281
|
+
ot,
|
|
268
282
|
{
|
|
269
283
|
detail: e.detail,
|
|
270
284
|
why: e.why,
|
|
271
285
|
delivery: e.delivery,
|
|
272
286
|
notificationId: e.id,
|
|
273
|
-
recordChanges:
|
|
274
|
-
subscriptionsPath:
|
|
275
|
-
rulesPath:
|
|
276
|
-
onNavigate:
|
|
287
|
+
recordChanges: st(e),
|
|
288
|
+
subscriptionsPath: be,
|
|
289
|
+
rulesPath: ke,
|
|
290
|
+
onNavigate: ne,
|
|
277
291
|
className: `pb-3 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
|
|
278
292
|
}
|
|
279
293
|
)
|
|
280
294
|
] }, e.id);
|
|
281
|
-
},
|
|
282
|
-
const a = `${e.collection}:${e.item}`, o =
|
|
283
|
-
return /* @__PURE__ */
|
|
295
|
+
}, $e = (e) => {
|
|
296
|
+
const a = `${e.collection}:${e.item}`, o = ye.has(a), i = Xe(e.lane), s = e.deleted ? null : M(Ze(e), r), b = e.rows.filter((l) => !l.read).map((l) => l.id);
|
|
297
|
+
return /* @__PURE__ */ n(
|
|
284
298
|
"div",
|
|
285
299
|
{
|
|
286
300
|
className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
|
|
@@ -289,7 +303,7 @@ function xt({
|
|
|
289
303
|
"data-notification-bundle-count": e.count,
|
|
290
304
|
"data-notification-bundle-lane": e.lane,
|
|
291
305
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ n("div", { className: "flex items-start gap-2 px-3 py-2", children: [
|
|
293
307
|
/* @__PURE__ */ t(
|
|
294
308
|
"button",
|
|
295
309
|
{
|
|
@@ -297,29 +311,29 @@ function xt({
|
|
|
297
311
|
"aria-expanded": o,
|
|
298
312
|
"aria-label": o ? "Collapse" : "Expand",
|
|
299
313
|
"data-notification-bundle-expand": a,
|
|
300
|
-
onClick: () =>
|
|
301
|
-
const
|
|
302
|
-
return
|
|
314
|
+
onClick: () => Z((l) => {
|
|
315
|
+
const w = new Set(l);
|
|
316
|
+
return w.has(a) ? w.delete(a) : w.add(a), w;
|
|
303
317
|
}),
|
|
304
318
|
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",
|
|
305
319
|
children: /* @__PURE__ */ t(
|
|
306
|
-
|
|
320
|
+
De,
|
|
307
321
|
{
|
|
308
322
|
className: `h-3.5 w-3.5 transition-transform ${o ? "" : "-rotate-90"}`
|
|
309
323
|
}
|
|
310
324
|
)
|
|
311
325
|
}
|
|
312
326
|
),
|
|
313
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ n(
|
|
314
328
|
"button",
|
|
315
329
|
{
|
|
316
330
|
type: "button",
|
|
317
331
|
onClick: () => {
|
|
318
|
-
s ? (
|
|
332
|
+
s ? (p(!1), F(s, c)) : Z((l) => new Set(l).add(a));
|
|
319
333
|
},
|
|
320
334
|
className: "min-w-0 flex-1 text-left",
|
|
321
335
|
children: [
|
|
322
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ n("span", { className: "flex items-center gap-1.5", children: [
|
|
323
337
|
/* @__PURE__ */ t(
|
|
324
338
|
"span",
|
|
325
339
|
{
|
|
@@ -330,11 +344,11 @@ function xt({
|
|
|
330
344
|
"span",
|
|
331
345
|
{
|
|
332
346
|
className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${i.text}` : "font-normal text-slate-600 dark:text-slate-400"}`,
|
|
333
|
-
children:
|
|
347
|
+
children: et(e)
|
|
334
348
|
}
|
|
335
349
|
)
|
|
336
350
|
] }),
|
|
337
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ n("span", { className: "mt-1 flex flex-wrap items-center gap-1 pl-3.5 text-[10.5px] text-slate-400", children: [
|
|
338
352
|
e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ t(
|
|
339
353
|
"span",
|
|
340
354
|
{
|
|
@@ -364,12 +378,12 @@ function xt({
|
|
|
364
378
|
{
|
|
365
379
|
className: "rounded bg-slate-100 px-1 py-px text-[9.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
366
380
|
"data-notification-bundle-category": l,
|
|
367
|
-
children:
|
|
381
|
+
children: tt(l)
|
|
368
382
|
},
|
|
369
383
|
l
|
|
370
384
|
)),
|
|
371
|
-
/* @__PURE__ */ t("span", { children: e.newest ?
|
|
372
|
-
e.unread > 0 && e.unread < e.count && /* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ t("span", { children: e.newest ? Ye(e.newest) : "" }),
|
|
386
|
+
e.unread > 0 && e.unread < e.count && /* @__PURE__ */ n("span", { children: [
|
|
373
387
|
"· ",
|
|
374
388
|
e.unread,
|
|
375
389
|
" unread"
|
|
@@ -378,7 +392,7 @@ function xt({
|
|
|
378
392
|
]
|
|
379
393
|
}
|
|
380
394
|
),
|
|
381
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ n("span", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
382
396
|
s && /* @__PURE__ */ t(
|
|
383
397
|
"button",
|
|
384
398
|
{
|
|
@@ -387,10 +401,10 @@ function xt({
|
|
|
387
401
|
"data-tip": "Open record",
|
|
388
402
|
"data-notification-open-record": !0,
|
|
389
403
|
onClick: () => {
|
|
390
|
-
|
|
404
|
+
p(!1), F(s, c);
|
|
391
405
|
},
|
|
392
406
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
393
|
-
children: /* @__PURE__ */ t(
|
|
407
|
+
children: /* @__PURE__ */ t(ce, { className: "h-3 w-3" })
|
|
394
408
|
}
|
|
395
409
|
),
|
|
396
410
|
b.length > 0 && /* @__PURE__ */ t(
|
|
@@ -400,9 +414,9 @@ function xt({
|
|
|
400
414
|
"aria-label": "Mark read",
|
|
401
415
|
"data-tip": "Mark read",
|
|
402
416
|
"data-notification-bundle-read": a,
|
|
403
|
-
onClick: () =>
|
|
417
|
+
onClick: () => P.mutate(b),
|
|
404
418
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
405
|
-
children: /* @__PURE__ */ t(
|
|
419
|
+
children: /* @__PURE__ */ t(E, { className: "h-3 w-3" })
|
|
406
420
|
}
|
|
407
421
|
)
|
|
408
422
|
] })
|
|
@@ -412,103 +426,103 @@ function xt({
|
|
|
412
426
|
{
|
|
413
427
|
className: "border-t border-slate-50 bg-slate-50/50 dark:border-border/50 dark:bg-muted/30",
|
|
414
428
|
"data-notification-bundle-rows": a,
|
|
415
|
-
children: e.rows.map((l) =>
|
|
429
|
+
children: e.rows.map((l) => j(l, !0, !0))
|
|
416
430
|
}
|
|
417
431
|
)
|
|
418
432
|
]
|
|
419
433
|
},
|
|
420
434
|
`bundle:${a}`
|
|
421
435
|
);
|
|
422
|
-
},
|
|
423
|
-
{ key: "attention", label: "Needs you", count:
|
|
424
|
-
{ key: "fyi", label: "FYI", count:
|
|
436
|
+
}, _e = [
|
|
437
|
+
{ key: "attention", label: "Needs you", count: W },
|
|
438
|
+
{ key: "fyi", label: "FYI", count: q.fyi },
|
|
425
439
|
{ key: "all", label: "All", count: null }
|
|
426
|
-
],
|
|
427
|
-
return /* @__PURE__ */
|
|
428
|
-
H ? H({ open: g, badge:
|
|
440
|
+
], oe = () => p((e) => (!e && v === "attention" && W === 0 && q.fyi > 0 && U("fyi"), !e));
|
|
441
|
+
return /* @__PURE__ */ n("div", { ref: T, className: "relative", "data-nvr-notification-bell": !0, children: [
|
|
442
|
+
H ? H({ open: g, badge: C, toggle: oe }) : /* @__PURE__ */ n(
|
|
429
443
|
"button",
|
|
430
444
|
{
|
|
431
445
|
type: "button",
|
|
432
|
-
onClick:
|
|
446
|
+
onClick: oe,
|
|
433
447
|
className: k ?? "relative rounded-md p-1.5 text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-muted",
|
|
434
|
-
"aria-label":
|
|
448
|
+
"aria-label": C ? `Notifications (${C} unread)` : "Notifications",
|
|
435
449
|
children: [
|
|
436
|
-
/* @__PURE__ */ t(
|
|
437
|
-
|
|
450
|
+
/* @__PURE__ */ t(Ee, { className: "h-4 w-4", strokeWidth: 1.8 }),
|
|
451
|
+
C > 0 && /* @__PURE__ */ t(
|
|
438
452
|
"span",
|
|
439
453
|
{
|
|
440
454
|
"data-nvr-recording-hide": !0,
|
|
441
|
-
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 ${
|
|
442
|
-
children:
|
|
455
|
+
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"}`,
|
|
456
|
+
children: /* @__PURE__ */ t(me, { value: C > 99 ? "99+" : C })
|
|
443
457
|
}
|
|
444
458
|
)
|
|
445
459
|
]
|
|
446
460
|
}
|
|
447
461
|
),
|
|
448
|
-
g && (
|
|
449
|
-
/* @__PURE__ */
|
|
462
|
+
g && (_ === "right" ? Be : (e) => e)(
|
|
463
|
+
/* @__PURE__ */ n(
|
|
450
464
|
"div",
|
|
451
465
|
{
|
|
452
466
|
ref: Y,
|
|
453
|
-
className: `${
|
|
454
|
-
style:
|
|
467
|
+
className: `${_ === "right" ? "fixed z-[110]" : "absolute right-0 top-10 z-40"} w-[360px] overflow-hidden rounded-xl border border-slate-200 bg-white shadow-xl dark:border-border dark:bg-card ${h ?? ""}`,
|
|
468
|
+
style: _ === "right" && D ? { left: D.left, bottom: D.bottom } : void 0,
|
|
455
469
|
"data-nvr-notification-panel": !0,
|
|
456
470
|
children: [
|
|
457
|
-
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children:
|
|
471
|
+
S,
|
|
472
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 dark:border-border/60", children: [
|
|
473
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: _e.map((e) => /* @__PURE__ */ n(
|
|
460
474
|
"button",
|
|
461
475
|
{
|
|
462
476
|
type: "button",
|
|
463
477
|
onClick: () => U(e.key),
|
|
464
478
|
"data-nvr-lane-tab": e.key,
|
|
465
|
-
className:
|
|
479
|
+
className: v === 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",
|
|
466
480
|
children: [
|
|
467
481
|
e.label,
|
|
468
482
|
e.count != null && e.count > 0 && /* @__PURE__ */ t(
|
|
469
483
|
"span",
|
|
470
484
|
{
|
|
471
|
-
className: `ml-1 rounded-full px-1 text-[9.5px] font-bold ${e.key === "attention" &&
|
|
472
|
-
children: e.count
|
|
485
|
+
className: `ml-1 rounded-full px-1 text-[9.5px] font-bold ${e.key === "attention" && q.critical > 0 ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-slate-200 text-slate-600 dark:bg-slate-700 dark:text-slate-300"}`,
|
|
486
|
+
children: /* @__PURE__ */ t(me, { value: e.count })
|
|
473
487
|
}
|
|
474
488
|
)
|
|
475
489
|
]
|
|
476
490
|
},
|
|
477
491
|
e.key
|
|
478
492
|
)) }),
|
|
479
|
-
|
|
493
|
+
B > 0 && /* @__PURE__ */ n(
|
|
480
494
|
"button",
|
|
481
495
|
{
|
|
482
496
|
type: "button",
|
|
483
|
-
onClick: () =>
|
|
497
|
+
onClick: () => Ne.mutate(),
|
|
484
498
|
className: "inline-flex items-center gap-1 text-[11px] font-medium text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
485
499
|
children: [
|
|
486
|
-
/* @__PURE__ */ t(
|
|
500
|
+
/* @__PURE__ */ t(Fe, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
487
501
|
"Mark all read"
|
|
488
502
|
]
|
|
489
503
|
}
|
|
490
504
|
)
|
|
491
505
|
] }),
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
|
|
506
|
+
/* @__PURE__ */ n("div", { className: "max-h-96 overflow-y-auto", children: [
|
|
507
|
+
K.length > 0 && /* @__PURE__ */ n("div", { "data-notification-pinned": !0, children: [
|
|
494
508
|
/* @__PURE__ */ t("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" }),
|
|
495
|
-
|
|
509
|
+
K.map((e) => /* @__PURE__ */ t(pe, { children: j(e, !!M(e, r)) }, e.id))
|
|
496
510
|
] }),
|
|
497
|
-
|
|
498
|
-
...
|
|
499
|
-
...
|
|
500
|
-
const a = e.rows.filter((l) => !l.read).map((l) => l.id), o =
|
|
501
|
-
return /* @__PURE__ */
|
|
511
|
+
re.length === 0 && X.length === 0 && K.length === 0 ? /* @__PURE__ */ t("p", { className: "px-3 py-6 text-center text-[12px] text-slate-400", children: v === "attention" ? "Nothing needs you right now." : v === "fyi" ? "No FYI notifications." : "No notifications" }) : [
|
|
512
|
+
...X.map($e),
|
|
513
|
+
...re.map((e) => {
|
|
514
|
+
const a = e.rows.filter((l) => !l.read).map((l) => l.id), o = M(e.rows[0], r), i = !!o, s = e.rows.find((l) => l.record_label) ?? e.rows[0], b = it(s);
|
|
515
|
+
return /* @__PURE__ */ n(
|
|
502
516
|
"div",
|
|
503
517
|
{
|
|
504
518
|
className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
|
|
505
519
|
children: [
|
|
506
|
-
i && b && /* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
520
|
+
i && b && /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 px-3 pt-2", children: [
|
|
521
|
+
/* @__PURE__ */ n("span", { className: "truncate text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
508
522
|
b,
|
|
509
523
|
e.rows.length > 1 ? ` · ${e.rows.length}` : ""
|
|
510
524
|
] }),
|
|
511
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ n("span", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
512
526
|
/* @__PURE__ */ t(
|
|
513
527
|
"button",
|
|
514
528
|
{
|
|
@@ -517,10 +531,10 @@ function xt({
|
|
|
517
531
|
"data-tip": "Open record",
|
|
518
532
|
"data-notification-open-record": !0,
|
|
519
533
|
onClick: () => {
|
|
520
|
-
a.length &&
|
|
534
|
+
a.length && P.mutate(a), p(!1), F(o, c);
|
|
521
535
|
},
|
|
522
536
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
523
|
-
children: /* @__PURE__ */ t(
|
|
537
|
+
children: /* @__PURE__ */ t(ce, { className: "h-3 w-3" })
|
|
524
538
|
}
|
|
525
539
|
),
|
|
526
540
|
a.length > 0 && /* @__PURE__ */ t(
|
|
@@ -529,14 +543,14 @@ function xt({
|
|
|
529
543
|
type: "button",
|
|
530
544
|
"aria-label": "Mark read",
|
|
531
545
|
"data-tip": "Mark read",
|
|
532
|
-
onClick: () =>
|
|
546
|
+
onClick: () => P.mutate(a),
|
|
533
547
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
534
|
-
children: /* @__PURE__ */ t(
|
|
548
|
+
children: /* @__PURE__ */ t(E, { className: "h-3 w-3" })
|
|
535
549
|
}
|
|
536
550
|
)
|
|
537
551
|
] })
|
|
538
552
|
] }),
|
|
539
|
-
e.rows.map((l) =>
|
|
553
|
+
e.rows.map((l) => j(l, i))
|
|
540
554
|
]
|
|
541
555
|
},
|
|
542
556
|
e.key
|
|
@@ -549,7 +563,7 @@ function xt({
|
|
|
549
563
|
{
|
|
550
564
|
type: "button",
|
|
551
565
|
onClick: () => {
|
|
552
|
-
|
|
566
|
+
p(!1), c(G);
|
|
553
567
|
},
|
|
554
568
|
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",
|
|
555
569
|
children: "See all notifications"
|
|
@@ -561,18 +575,18 @@ function xt({
|
|
|
561
575
|
document.body
|
|
562
576
|
),
|
|
563
577
|
/* @__PURE__ */ t(
|
|
564
|
-
|
|
578
|
+
We,
|
|
565
579
|
{
|
|
566
|
-
notificationId: (
|
|
567
|
-
title: (
|
|
568
|
-
onClose: () =>
|
|
580
|
+
notificationId: ($ == null ? void 0 : $.id) ?? null,
|
|
581
|
+
title: ($ == null ? void 0 : $.title) ?? null,
|
|
582
|
+
onClose: () => O(null)
|
|
569
583
|
}
|
|
570
584
|
)
|
|
571
585
|
] });
|
|
572
586
|
}
|
|
573
587
|
export {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
588
|
+
qt as NotificationBell,
|
|
589
|
+
it as bellGroupLabel,
|
|
590
|
+
fe as hasSnapshotView,
|
|
591
|
+
st as offersChanges
|
|
578
592
|
};
|