@nivaro/react 0.2.53 → 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 +452 -4
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +252 -2
- 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/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3968 -3618
- 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 +598 -543
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/TipLayer.js +27 -27
- 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 +80 -67
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- 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 +9 -8
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +382 -320
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +786 -639
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- 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 +94 -0
- 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 +65 -0
- package/dist/shared/components/layout-editor/AddPanel.js +226 -151
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +147 -0
- package/dist/shared/components/layout-editor/CollabParts.js +175 -0
- package/dist/shared/components/layout-editor/DesignNode.js +311 -116
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
- package/dist/shared/components/layout-editor/EditorTopBar.js +463 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +250 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +464 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +388 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +80 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +181 -164
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +131 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- 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/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
- package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- 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/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -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 +125 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
- package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +403 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +406 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
- 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/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -306
- 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/SuggestFormChange.js +143 -0
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/ai-fill.js +37 -0
- 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 +133 -0
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +116 -110
- 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/screenshot.js +54 -28
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/visible-when.js +34 -0
- 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
|
};
|