@nivaro/react 0.3.113 → 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 +1727 -19
- 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 +544 -504
- 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/cbv/column-totals.js +75 -67
- 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 +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- 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-link.js +56 -50
- 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,213 +1,256 @@
|
|
|
1
|
-
import { jsxs as s, jsx as t, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { MessageSquare as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { toast as
|
|
7
|
-
import { useNivaroClient as
|
|
8
|
-
import { useDebounced as
|
|
9
|
-
import { get as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as Ee, useQuery as W, useMutation as A } from "@tanstack/react-query";
|
|
3
|
+
import { MessageSquare as Qe, ChevronDown as Ue, ClipboardPlus as ze, Pencil as We, Trash2 as He, Check as $e, X as Ge, SmilePlus as Te, BellOff as Je } from "lucide-react";
|
|
4
|
+
import { useState as C, useRef as ee, useEffect as qe, useMemo as z } from "react";
|
|
5
|
+
import { createPortal as Xe } from "react-dom";
|
|
6
|
+
import { toast as M } from "sonner";
|
|
7
|
+
import { useNivaroClient as le, useItemEditAuth as Ve, useDrilldown as Ze } from "../../context.js";
|
|
8
|
+
import { useDebounced as Ye } from "../../hooks/useDebounced.js";
|
|
9
|
+
import { get as H, post as K, patch as et, del as tt } from "../../lib/commands.js";
|
|
10
|
+
import { useRepliesWhileTyping as at, mentionReceiptLine as nt, mentionReceiptSummary as rt } from "../../lib/comment-awareness.js";
|
|
11
|
+
import { stripCommentImages as st } from "../../lib/comment-images.js";
|
|
12
|
+
import { useLivePreference as ot } from "../../lib/live-preference.js";
|
|
13
|
+
import { usePresenceOnlinePoll as lt } from "../../lib/presence-live.js";
|
|
14
|
+
import { useMyUserId as it, useNoteTypists as dt, useDraftTypingSignal as ct, signalSentence as mt } from "../../lib/presence-signals.js";
|
|
15
|
+
import { invalidateRecordTasks as pt } from "../../lib/record-tasks.js";
|
|
16
|
+
import { useNewSince as ut } from "../../lib/seen-since.js";
|
|
17
|
+
import { useStartsOpen as xt } from "../../lib/use-starts-open.js";
|
|
18
|
+
import { titleCase as ye, formatDateTime as ie, cn as ve, formatRelative as ht } from "../../lib/utils.js";
|
|
19
|
+
import { AgentBadge as bt } from "../AgentBadge.js";
|
|
20
|
+
import { AutolinkedText as De } from "../AutolinkedText.js";
|
|
21
|
+
import { InboundRequestPopover as ft } from "../integrations/InboundRequest.js";
|
|
22
|
+
import { useFieldComments as gt } from "../item-edit/field-comments-context.js";
|
|
23
|
+
import { RelativeTime as Ie } from "../RelativeTime.js";
|
|
24
|
+
import { UserAvatar as yt } from "../UserAvatar.js";
|
|
25
|
+
import { Avatar as vt, AvatarFallback as kt } from "../ui/avatar.js";
|
|
26
|
+
import { Button as Z } from "../ui/button.js";
|
|
27
|
+
import { Separator as ke } from "../ui/separator.js";
|
|
28
|
+
import { Textarea as Nt } from "../ui/textarea.js";
|
|
29
|
+
import { useHoldInPlace as wt, RepliesWhileTyping as _t, jumpToComment as Ct, SeenByLine as St, MentionDeliveryButton as Et } from "./CommentAwareness.js";
|
|
30
|
+
import { useCommentImages as $t, CommentImageStrip as Tt, CommentBody as qt, imageDropProps as Dt } from "./CommentImages.js";
|
|
31
|
+
import { RecordEventPathSheet as It } from "./IntegrationActivitySection.js";
|
|
32
|
+
import { NewSinceChip as Rt } from "./NewSinceChip.js";
|
|
33
|
+
const Re = ["👍", "✅", "👀", "🎉", "❤️", "😂"];
|
|
34
|
+
function Pt(e) {
|
|
35
|
+
var x, b, f, c;
|
|
36
|
+
return [(x = e.first_name) == null ? void 0 : x[0], (b = e.last_name) == null ? void 0 : b[0]].filter(Boolean).join("").toUpperCase() || ((c = (f = e.email) == null ? void 0 : f[0]) == null ? void 0 : c.toUpperCase()) || "?";
|
|
29
37
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
const Ne = {
|
|
39
|
+
ok: "text-emerald-700 dark:text-emerald-400",
|
|
40
|
+
neutral: "text-slate-500 dark:text-slate-400",
|
|
41
|
+
warn: "text-amber-700 dark:text-amber-400"
|
|
42
|
+
};
|
|
43
|
+
function we({ tone: e }) {
|
|
44
|
+
return e === "ok" ? /* @__PURE__ */ t($e, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : e === "warn" ? /* @__PURE__ */ t(Je, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : null;
|
|
45
|
+
}
|
|
46
|
+
function oe(e) {
|
|
47
|
+
return (e.mentions ?? []).filter(
|
|
48
|
+
(l) => {
|
|
49
|
+
var x;
|
|
50
|
+
return l.id && String(l.id).toUpperCase() !== String(((x = e.user) == null ? void 0 : x.id) ?? "").toUpperCase();
|
|
35
51
|
}
|
|
36
52
|
);
|
|
37
|
-
|
|
53
|
+
}
|
|
54
|
+
function Ft({
|
|
55
|
+
comment: e,
|
|
56
|
+
collection: l,
|
|
57
|
+
item: x
|
|
58
|
+
}) {
|
|
59
|
+
const b = ot(), f = oe(e);
|
|
60
|
+
if (f.length === 0) return null;
|
|
61
|
+
const c = f.map((d) => ({ m: d, ...nt(d, ht) })), m = rt(f);
|
|
62
|
+
return /* @__PURE__ */ s(
|
|
38
63
|
"p",
|
|
39
64
|
{
|
|
40
65
|
className: "mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px]",
|
|
41
66
|
"data-mention-receipts": !0,
|
|
42
|
-
children:
|
|
43
|
-
|
|
44
|
-
|
|
67
|
+
children: [
|
|
68
|
+
b.quiet ? (
|
|
69
|
+
// Calm / Off: one summary; the per-person sentences are one hover away.
|
|
70
|
+
/* @__PURE__ */ s(
|
|
71
|
+
"button",
|
|
72
|
+
{
|
|
73
|
+
type: "button",
|
|
74
|
+
"data-mention-receipts-summary": !0,
|
|
75
|
+
"data-tip": c.map((d) => d.text).join(" · "),
|
|
76
|
+
"aria-label": c.map((d) => d.text).join(". "),
|
|
77
|
+
className: ve("inline-flex items-center gap-1 rounded", Ne[m.tone]),
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ t(we, { tone: m.tone }),
|
|
80
|
+
m.text
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
) : c.map(({ m: d, text: k, tone: N }) => /* @__PURE__ */ s(
|
|
45
85
|
"span",
|
|
46
86
|
{
|
|
47
|
-
"data-mention-seen":
|
|
48
|
-
|
|
49
|
-
|
|
87
|
+
"data-mention-seen": N === "ok" ? "seen" : "unseen",
|
|
88
|
+
"data-mention-status": d.status ?? void 0,
|
|
89
|
+
"data-tip": d.seen_at ? `Seen ${ie(d.seen_at)}` : void 0,
|
|
90
|
+
className: ve("inline-flex items-center gap-1", Ne[N]),
|
|
50
91
|
children: [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
d.seen_at ? ` saw this ${oe(d.seen_at)}` : " has not seen this yet"
|
|
92
|
+
/* @__PURE__ */ t(we, { tone: N }),
|
|
93
|
+
k
|
|
54
94
|
]
|
|
55
95
|
},
|
|
56
96
|
d.id
|
|
57
|
-
)
|
|
58
|
-
|
|
97
|
+
)),
|
|
98
|
+
e.delivery_visible && /* @__PURE__ */ t(Et, { collection: l, item: x, commentId: e.id })
|
|
99
|
+
]
|
|
59
100
|
}
|
|
60
101
|
);
|
|
61
102
|
}
|
|
62
|
-
function
|
|
103
|
+
function Pe(e) {
|
|
63
104
|
return [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email;
|
|
64
105
|
}
|
|
65
|
-
function
|
|
66
|
-
var
|
|
67
|
-
const l =
|
|
68
|
-
return (
|
|
106
|
+
function re(e) {
|
|
107
|
+
var x;
|
|
108
|
+
const l = Pe(e.user);
|
|
109
|
+
return (x = e.acting_admin) != null && x.name ? `${e.acting_admin.name} as ${l}` : l;
|
|
69
110
|
}
|
|
70
|
-
function
|
|
111
|
+
function Mt({
|
|
71
112
|
field: e,
|
|
72
113
|
label: l,
|
|
73
|
-
resolved:
|
|
74
|
-
onJump:
|
|
114
|
+
resolved: x,
|
|
115
|
+
onJump: b
|
|
75
116
|
}) {
|
|
76
|
-
const
|
|
117
|
+
const f = /* @__PURE__ */ s(Y, { children: [
|
|
77
118
|
"on ",
|
|
78
119
|
/* @__PURE__ */ t("span", { className: "font-medium", children: l }),
|
|
79
|
-
|
|
80
|
-
] }),
|
|
81
|
-
return
|
|
120
|
+
x && /* @__PURE__ */ t("span", { className: "text-slate-400 dark:text-slate-500", children: " · resolved" })
|
|
121
|
+
] }), c = "inline-flex min-w-0 max-w-[220px] items-center gap-1 truncate rounded-full border border-slate-200 bg-slate-50 px-1.5 py-px text-[10.5px] text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300";
|
|
122
|
+
return b ? /* @__PURE__ */ t(
|
|
82
123
|
"button",
|
|
83
124
|
{
|
|
84
125
|
type: "button",
|
|
85
126
|
"data-comment-field": e,
|
|
86
|
-
onClick:
|
|
127
|
+
onClick: b,
|
|
87
128
|
"data-tip": `Go to ${l}`,
|
|
88
|
-
className: `${
|
|
89
|
-
children:
|
|
129
|
+
className: `${c} transition-colors hover:border-nvr-cyan/50 hover:text-[#0e7490] dark:hover:text-nvr-cyan`,
|
|
130
|
+
children: f
|
|
90
131
|
}
|
|
91
|
-
) : /* @__PURE__ */ t("span", { "data-comment-field": e, className:
|
|
132
|
+
) : /* @__PURE__ */ t("span", { "data-comment-field": e, className: c, children: f });
|
|
92
133
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
return
|
|
134
|
+
function Ot(e, l) {
|
|
135
|
+
const b = e.slice(0, l).match(/(^|\s)@([a-zA-Z0-9._-]{2,})$/);
|
|
136
|
+
return b ? { start: l - b[2].length - 1, query: b[2] } : null;
|
|
96
137
|
}
|
|
97
|
-
function
|
|
138
|
+
function _e(e) {
|
|
98
139
|
return e.email.split("@")[0];
|
|
99
140
|
}
|
|
100
|
-
function
|
|
141
|
+
function se({
|
|
101
142
|
value: e,
|
|
102
143
|
onChange: l,
|
|
103
|
-
|
|
144
|
+
onImages: x,
|
|
145
|
+
...b
|
|
104
146
|
}) {
|
|
105
|
-
const
|
|
106
|
-
queryKey: ["users", "mention-search",
|
|
107
|
-
queryFn: () =>
|
|
108
|
-
|
|
109
|
-
).then((
|
|
110
|
-
enabled: !!m &&
|
|
147
|
+
const f = le(), c = ee(null), [m, d] = C(null), [k, N] = C(0), y = Ye((m == null ? void 0 : m.query) ?? "", 200), { data: S = [] } = W({
|
|
148
|
+
queryKey: ["users", "mention-search", y],
|
|
149
|
+
queryFn: () => f.request(
|
|
150
|
+
H("/users", { limit: 8, sort: "first_name", search: y })
|
|
151
|
+
).then((r) => r.data),
|
|
152
|
+
enabled: !!m && y.length >= 2,
|
|
111
153
|
staleTime: 3e4
|
|
112
|
-
}), q =
|
|
154
|
+
}), q = lt(15e3, !!m), { data: I } = W({
|
|
113
155
|
queryKey: ["presence-online"],
|
|
114
|
-
queryFn: () =>
|
|
115
|
-
|
|
156
|
+
queryFn: () => f.request(
|
|
157
|
+
H("/presence/online")
|
|
116
158
|
),
|
|
117
159
|
enabled: !!m,
|
|
118
160
|
refetchInterval: q,
|
|
119
161
|
staleTime: 5e3
|
|
120
|
-
}),
|
|
121
|
-
var
|
|
122
|
-
const i = (
|
|
162
|
+
}), p = (r) => {
|
|
163
|
+
var u;
|
|
164
|
+
const i = (u = I == null ? void 0 : I.data) == null ? void 0 : u.find((g) => String(g.user_id).toUpperCase() === r.toUpperCase());
|
|
123
165
|
return i ? i.is_idle || i.away ? 1 : 0 : 2;
|
|
124
|
-
},
|
|
166
|
+
}, w = S, { data: T = [] } = W({
|
|
125
167
|
queryKey: ["mention-roles"],
|
|
126
|
-
queryFn: () =>
|
|
168
|
+
queryFn: () => f.request(H("/chat/roles")).then((r) => r.data).catch(() => []),
|
|
127
169
|
enabled: !!m,
|
|
128
170
|
staleTime: 5 * 6e4
|
|
129
|
-
}),
|
|
130
|
-
(
|
|
131
|
-
).slice(0, 3) : [],
|
|
132
|
-
|
|
133
|
-
if (!
|
|
134
|
-
|
|
171
|
+
}), E = m ? T.filter(
|
|
172
|
+
(r) => r.name.toLowerCase().replace(/\s+/g, "-").startsWith(y.toLowerCase())
|
|
173
|
+
).slice(0, 3) : [], _ = !!m && y.length >= 2 && "owners".startsWith(y.toLowerCase()), o = !!m && y.length >= 2 && (w.length > 0 || _ || E.length > 0), v = w.length + (_ ? 1 : 0) + E.length, [P, G] = C(null), B = ee(null);
|
|
174
|
+
qe(() => {
|
|
175
|
+
if (!o || !c.current) {
|
|
176
|
+
G(null);
|
|
135
177
|
return;
|
|
136
178
|
}
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
const i = (
|
|
140
|
-
var
|
|
141
|
-
(
|
|
142
|
-
},
|
|
143
|
-
return window.addEventListener("scroll", i, !0), window.addEventListener("resize",
|
|
144
|
-
window.removeEventListener("scroll", i, !0), window.removeEventListener("resize",
|
|
179
|
+
const r = c.current.getBoundingClientRect();
|
|
180
|
+
G({ top: r.bottom + 4, left: r.left, width: Math.min(r.width, 360) });
|
|
181
|
+
const i = (g) => {
|
|
182
|
+
var $;
|
|
183
|
+
($ = B.current) != null && $.contains(g.target) || d(null);
|
|
184
|
+
}, u = () => d(null);
|
|
185
|
+
return window.addEventListener("scroll", i, !0), window.addEventListener("resize", u), () => {
|
|
186
|
+
window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", u);
|
|
145
187
|
};
|
|
146
|
-
}, [
|
|
147
|
-
function
|
|
148
|
-
const i =
|
|
149
|
-
|
|
188
|
+
}, [o]);
|
|
189
|
+
function Q(r) {
|
|
190
|
+
const i = Ot(r.value, r.selectionStart ?? r.value.length);
|
|
191
|
+
d(i), i || N(0);
|
|
150
192
|
}
|
|
151
|
-
function
|
|
152
|
-
if (!m || !
|
|
153
|
-
const i =
|
|
154
|
-
l(
|
|
155
|
-
const
|
|
193
|
+
function R(r) {
|
|
194
|
+
if (!m || !c.current) return;
|
|
195
|
+
const i = c.current.selectionStart ?? e.length, u = r === "__owners__" ? "@owners " : typeof r == "object" && "role" in r ? `@${r.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${_e(r)} `, g = e.slice(0, m.start) + u + e.slice(i);
|
|
196
|
+
l(g), d(null), N(0);
|
|
197
|
+
const $ = m.start + u.length;
|
|
156
198
|
requestAnimationFrame(() => {
|
|
157
|
-
var O,
|
|
158
|
-
(O =
|
|
199
|
+
var O, j;
|
|
200
|
+
(O = c.current) == null || O.focus(), (j = c.current) == null || j.setSelectionRange($, $);
|
|
159
201
|
});
|
|
160
202
|
}
|
|
161
|
-
function
|
|
162
|
-
if (
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
else if (
|
|
166
|
-
|
|
167
|
-
else if (
|
|
168
|
-
|
|
169
|
-
const i = Math.min(
|
|
170
|
-
if (
|
|
171
|
-
else if (i >=
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
} else
|
|
175
|
-
} else
|
|
203
|
+
function U(r) {
|
|
204
|
+
if (o)
|
|
205
|
+
if (r.key === "ArrowDown")
|
|
206
|
+
r.preventDefault(), N((i) => (i + 1) % v);
|
|
207
|
+
else if (r.key === "ArrowUp")
|
|
208
|
+
r.preventDefault(), N((i) => (i - 1 + v) % v);
|
|
209
|
+
else if (r.key === "Enter" || r.key === "Tab") {
|
|
210
|
+
r.preventDefault();
|
|
211
|
+
const i = Math.min(k, v - 1), u = _ ? 1 : 0, g = u + w.length;
|
|
212
|
+
if (_ && i === 0) R("__owners__");
|
|
213
|
+
else if (i >= g) {
|
|
214
|
+
const $ = E[i - g];
|
|
215
|
+
$ && R({ role: $.name });
|
|
216
|
+
} else R(w[i - u]);
|
|
217
|
+
} else r.key === "Escape" && (r.preventDefault(), d(null));
|
|
176
218
|
}
|
|
177
219
|
return /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
178
220
|
/* @__PURE__ */ t(
|
|
179
|
-
|
|
221
|
+
Nt,
|
|
180
222
|
{
|
|
181
|
-
...
|
|
182
|
-
|
|
223
|
+
...b,
|
|
224
|
+
...x ? Dt(x) : {},
|
|
225
|
+
ref: c,
|
|
183
226
|
value: e,
|
|
184
|
-
onChange: (
|
|
185
|
-
l(
|
|
227
|
+
onChange: (r) => {
|
|
228
|
+
l(r.target.value), Q(r.target);
|
|
186
229
|
},
|
|
187
|
-
onKeyDown:
|
|
188
|
-
onClick: (
|
|
189
|
-
onBlur: () => setTimeout(() =>
|
|
230
|
+
onKeyDown: U,
|
|
231
|
+
onClick: (r) => Q(r.currentTarget),
|
|
232
|
+
onBlur: () => setTimeout(() => d(null), 150)
|
|
190
233
|
}
|
|
191
234
|
),
|
|
192
|
-
|
|
235
|
+
o && P && Xe(
|
|
193
236
|
/* @__PURE__ */ s(
|
|
194
237
|
"div",
|
|
195
238
|
{
|
|
196
|
-
ref:
|
|
239
|
+
ref: B,
|
|
197
240
|
"data-mention-menu": "",
|
|
198
241
|
className: "fixed z-[110] max-h-60 overflow-y-auto rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-popover",
|
|
199
|
-
style: { top:
|
|
200
|
-
onMouseDown: (
|
|
242
|
+
style: { top: P.top, left: P.left, width: P.width },
|
|
243
|
+
onMouseDown: (r) => r.preventDefault(),
|
|
201
244
|
children: [
|
|
202
|
-
|
|
245
|
+
_ && /* @__PURE__ */ s(
|
|
203
246
|
"button",
|
|
204
247
|
{
|
|
205
248
|
type: "button",
|
|
206
|
-
onMouseDown: (
|
|
207
|
-
|
|
249
|
+
onMouseDown: (r) => {
|
|
250
|
+
r.preventDefault(), R("__owners__");
|
|
208
251
|
},
|
|
209
|
-
onMouseEnter: () =>
|
|
210
|
-
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${
|
|
252
|
+
onMouseEnter: () => N(0),
|
|
253
|
+
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${k === 0 ? "bg-nvr-cyan/10" : ""}`,
|
|
211
254
|
children: [
|
|
212
255
|
/* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy/80 dark:text-nvr-cyan", children: "★" }),
|
|
213
256
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
@@ -217,70 +260,70 @@ function ne({
|
|
|
217
260
|
]
|
|
218
261
|
}
|
|
219
262
|
),
|
|
220
|
-
|
|
221
|
-
var
|
|
222
|
-
const
|
|
263
|
+
w.map((r, i) => {
|
|
264
|
+
var $, O;
|
|
265
|
+
const u = _ ? i + 1 : i, g = [r.first_name, r.last_name].filter(Boolean).join(" ") || r.email;
|
|
223
266
|
return /* @__PURE__ */ s(
|
|
224
267
|
"button",
|
|
225
268
|
{
|
|
226
269
|
type: "button",
|
|
227
|
-
onMouseDown: (
|
|
228
|
-
|
|
270
|
+
onMouseDown: (j) => {
|
|
271
|
+
j.preventDefault(), R(r);
|
|
229
272
|
},
|
|
230
|
-
onMouseEnter: () =>
|
|
231
|
-
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${
|
|
273
|
+
onMouseEnter: () => N(u),
|
|
274
|
+
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${u === k ? "bg-nvr-cyan/10" : ""}`,
|
|
232
275
|
children: [
|
|
233
276
|
/* @__PURE__ */ s("span", { className: "relative flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy/80 dark:text-nvr-cyan", children: [
|
|
234
|
-
(`${((
|
|
235
|
-
|
|
277
|
+
(`${(($ = r.first_name) == null ? void 0 : $[0]) ?? ""}${((O = r.last_name) == null ? void 0 : O[0]) ?? ""}`.trim() || r.email[0]).toUpperCase(),
|
|
278
|
+
p(r.id) < 2 && /* @__PURE__ */ t(
|
|
236
279
|
"span",
|
|
237
280
|
{
|
|
238
|
-
"data-mention-presence":
|
|
239
|
-
title:
|
|
240
|
-
className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${
|
|
281
|
+
"data-mention-presence": p(r.id) === 0 ? "online" : "idle",
|
|
282
|
+
title: p(r.id) === 0 ? "Online" : "Idle",
|
|
283
|
+
className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${p(r.id) === 0 ? "bg-emerald-500" : "border border-amber-500 bg-white dark:bg-popover"}`
|
|
241
284
|
}
|
|
242
285
|
)
|
|
243
286
|
] }),
|
|
244
287
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
245
|
-
/* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children:
|
|
288
|
+
/* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: g }),
|
|
246
289
|
/* @__PURE__ */ s("span", { className: "block truncate text-[11px] text-slate-400", children: [
|
|
247
|
-
|
|
290
|
+
r.is_out_of_office && /* @__PURE__ */ s("span", { className: "mr-1 rounded bg-amber-100 px-1 py-px text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: [
|
|
248
291
|
"OOO",
|
|
249
|
-
|
|
292
|
+
r.ooo_end ? ` until ${String(r.ooo_end).slice(0, 10)}` : ""
|
|
250
293
|
] }),
|
|
251
294
|
"@",
|
|
252
|
-
|
|
253
|
-
(
|
|
295
|
+
_e(r),
|
|
296
|
+
(r.title || r.department) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-slate-500", children: [
|
|
254
297
|
" · ",
|
|
255
|
-
[
|
|
298
|
+
[r.title, r.department].filter(Boolean).join(", ")
|
|
256
299
|
] })
|
|
257
300
|
] })
|
|
258
301
|
] })
|
|
259
302
|
]
|
|
260
303
|
},
|
|
261
|
-
|
|
304
|
+
r.id
|
|
262
305
|
);
|
|
263
306
|
}),
|
|
264
|
-
|
|
265
|
-
const
|
|
307
|
+
E.map((r, i) => {
|
|
308
|
+
const u = w.length + (_ ? 1 : 0) + i;
|
|
266
309
|
return /* @__PURE__ */ s(
|
|
267
310
|
"button",
|
|
268
311
|
{
|
|
269
312
|
type: "button",
|
|
270
|
-
onMouseDown: (
|
|
271
|
-
|
|
313
|
+
onMouseDown: (g) => {
|
|
314
|
+
g.preventDefault(), R({ role: r.name });
|
|
272
315
|
},
|
|
273
|
-
onMouseEnter: () =>
|
|
274
|
-
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${
|
|
316
|
+
onMouseEnter: () => N(u),
|
|
317
|
+
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${u === k ? "bg-nvr-cyan/10" : ""}`,
|
|
275
318
|
children: [
|
|
276
319
|
/* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-violet-500/15 text-[10px] font-semibold text-violet-600 dark:text-violet-300", children: "R" }),
|
|
277
320
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
278
|
-
/* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children:
|
|
321
|
+
/* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: r.name }),
|
|
279
322
|
/* @__PURE__ */ t("span", { className: "block text-[11px] text-slate-400", children: "Role — notifies every member" })
|
|
280
323
|
] })
|
|
281
324
|
]
|
|
282
325
|
},
|
|
283
|
-
`role-${
|
|
326
|
+
`role-${r.id}`
|
|
284
327
|
);
|
|
285
328
|
})
|
|
286
329
|
]
|
|
@@ -290,7 +333,7 @@ function ne({
|
|
|
290
333
|
)
|
|
291
334
|
] });
|
|
292
335
|
}
|
|
293
|
-
function
|
|
336
|
+
function Ce(e) {
|
|
294
337
|
if (e.kind === "comment") return "people";
|
|
295
338
|
switch (e.note.source) {
|
|
296
339
|
case "note":
|
|
@@ -302,91 +345,91 @@ function ke(e) {
|
|
|
302
345
|
return "system";
|
|
303
346
|
}
|
|
304
347
|
}
|
|
305
|
-
const
|
|
348
|
+
const jt = {
|
|
306
349
|
people: "People",
|
|
307
350
|
system: "System",
|
|
308
351
|
integration: "Integration"
|
|
309
352
|
};
|
|
310
|
-
function
|
|
353
|
+
function Se(e) {
|
|
311
354
|
const l = e.kind === "comment" ? e.comment.text : e.note.text;
|
|
312
|
-
return (e.kind === "comment" ? l.replace(/<[^>]*>/g, " ") : l).replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
|
|
355
|
+
return (e.kind === "comment" ? st(l).replace(/<[^>]*>/g, " ") : l).replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
|
|
313
356
|
}
|
|
314
|
-
const
|
|
315
|
-
function
|
|
357
|
+
const Lt = "integrations:";
|
|
358
|
+
function At({
|
|
316
359
|
note: e,
|
|
317
360
|
collection: l,
|
|
318
|
-
item:
|
|
361
|
+
item: x
|
|
319
362
|
}) {
|
|
320
|
-
var
|
|
321
|
-
const
|
|
322
|
-
mutationFn: (o) =>
|
|
363
|
+
var _;
|
|
364
|
+
const b = Ze(), [f, c] = C(!1), m = e.source === "external" && !!e.provider && !e.provider.startsWith(Lt), d = le(), k = Ee(), [N, y] = C(!1), S = A({
|
|
365
|
+
mutationFn: (o) => d.request(K(`/comments/${e.comment_id}/reactions`, { emoji: o })),
|
|
323
366
|
onSuccess: () => {
|
|
324
|
-
|
|
367
|
+
y(!1), k.invalidateQueries({ queryKey: ["comments-related"] }), k.invalidateQueries({ queryKey: ["row-comment-counts"] });
|
|
325
368
|
},
|
|
326
|
-
onError: () =>
|
|
327
|
-
}), [
|
|
328
|
-
mutationFn: () =>
|
|
329
|
-
|
|
369
|
+
onError: () => M.error("Failed to react")
|
|
370
|
+
}), [q, I] = C(!1), p = A({
|
|
371
|
+
mutationFn: () => d.request(
|
|
372
|
+
K(`/integration-events/${encodeURIComponent(e.provider ?? "")}/replay`, {
|
|
330
373
|
entry_id: e.id.replace(/^external:/, "")
|
|
331
374
|
})
|
|
332
375
|
),
|
|
333
376
|
onSuccess: (o) => {
|
|
334
|
-
var
|
|
335
|
-
|
|
336
|
-
description: (
|
|
377
|
+
var v;
|
|
378
|
+
I(!1), M.success("Event replayed", {
|
|
379
|
+
description: (v = o == null ? void 0 : o.data) == null ? void 0 : v.detail
|
|
337
380
|
}), k.invalidateQueries({ queryKey: ["comments-related"] });
|
|
338
381
|
},
|
|
339
382
|
onError: (o) => {
|
|
340
|
-
var
|
|
341
|
-
|
|
342
|
-
const
|
|
343
|
-
|
|
383
|
+
var P;
|
|
384
|
+
I(!1);
|
|
385
|
+
const v = (P = o == null ? void 0 : o.response) == null ? void 0 : P.error;
|
|
386
|
+
M.error(v ?? (o == null ? void 0 : o.message) ?? "Replay failed", { duration: 8e3 });
|
|
344
387
|
}
|
|
345
|
-
}),
|
|
388
|
+
}), w = e.link ? () => {
|
|
346
389
|
const o = e.link;
|
|
347
390
|
if (!o) return;
|
|
348
|
-
const
|
|
349
|
-
if (
|
|
350
|
-
|
|
391
|
+
const v = document.querySelector(`[data-o2m-row="${o.collection}:${o.item_id}"]`);
|
|
392
|
+
if (v) {
|
|
393
|
+
v.scrollIntoView({ behavior: "smooth", block: "center" }), v.classList.add("nvr-row-flash"), setTimeout(() => v.classList.remove("nvr-row-flash"), 2400);
|
|
351
394
|
return;
|
|
352
395
|
}
|
|
353
|
-
|
|
354
|
-
} : null,
|
|
396
|
+
b == null || b.open({ collection: o.collection, itemId: o.item_id });
|
|
397
|
+
} : null, T = e.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : e.source === "addendum" ? "border-amber-200 bg-amber-50/60 text-amber-700 dark:border-amber-900/40 dark:bg-amber-900/10 dark:text-amber-400" : e.source === "external" || e.source === "inbound" ? "border-sky-200 bg-sky-50/70 text-sky-700 dark:border-sky-900/40 dark:bg-sky-900/10 dark:text-sky-300" : e.source === "import" ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50/80 text-slate-600 dark:border-border dark:bg-muted/40 dark:text-slate-300", E = e.source === "import" && ((_ = e.import) != null && _.file_id) ? e.import : null;
|
|
355
398
|
return /* @__PURE__ */ s("div", { className: "flex gap-3", "data-recorded-note": e.source, children: [
|
|
356
399
|
/* @__PURE__ */ t("div", { className: "mt-1 h-8 w-8 shrink-0", "aria-hidden": !0 }),
|
|
357
400
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
358
401
|
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
359
|
-
/* @__PURE__ */ t("span", { className: `rounded border px-1.5 py-px text-[10px] font-medium ${
|
|
402
|
+
/* @__PURE__ */ t("span", { className: `rounded border px-1.5 py-px text-[10px] font-medium ${T}`, children: e.label }),
|
|
360
403
|
e.user_name && /* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-slate-700 dark:text-slate-200", children: e.user_name }),
|
|
361
|
-
e.context && (
|
|
404
|
+
e.context && (w ? /* @__PURE__ */ t(
|
|
362
405
|
"button",
|
|
363
406
|
{
|
|
364
407
|
type: "button",
|
|
365
|
-
onClick:
|
|
408
|
+
onClick: w,
|
|
366
409
|
className: "truncate text-[11px] text-nvr-navy underline-offset-2 hover:underline dark:text-nvr-cyan",
|
|
367
410
|
"data-line-comment-link": !0,
|
|
368
411
|
children: e.context
|
|
369
412
|
}
|
|
370
|
-
) :
|
|
413
|
+
) : E ? /* @__PURE__ */ t(
|
|
371
414
|
"a",
|
|
372
415
|
{
|
|
373
|
-
href: `/api/files/${
|
|
416
|
+
href: `/api/files/${E.file_id}?download=1`,
|
|
374
417
|
target: "_blank",
|
|
375
418
|
rel: "noreferrer",
|
|
376
419
|
onClick: (o) => o.stopPropagation(),
|
|
377
420
|
className: "truncate text-[11px] text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
|
|
378
|
-
"data-note-import-file":
|
|
421
|
+
"data-note-import-file": E.file_id ?? void 0,
|
|
379
422
|
children: e.context
|
|
380
423
|
}
|
|
381
424
|
) : /* @__PURE__ */ t("span", { className: "truncate text-[11px] text-slate-400", children: e.context })),
|
|
382
|
-
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", "data-tip":
|
|
425
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", "data-tip": ie(e.created_at), children: /* @__PURE__ */ t(Ie, { value: e.created_at }) }),
|
|
383
426
|
e.source === "inbound" && e.inbound && /* @__PURE__ */ t(
|
|
384
|
-
|
|
427
|
+
ft,
|
|
385
428
|
{
|
|
386
429
|
activityId: e.inbound.activity_id,
|
|
387
430
|
callerName: e.label,
|
|
388
431
|
collection: l,
|
|
389
|
-
itemId:
|
|
432
|
+
itemId: x,
|
|
390
433
|
align: "end",
|
|
391
434
|
children: /* @__PURE__ */ t(
|
|
392
435
|
"button",
|
|
@@ -401,11 +444,11 @@ function pt({
|
|
|
401
444
|
}
|
|
402
445
|
),
|
|
403
446
|
e.source === "external" && e.status === "error" && /* @__PURE__ */ t("span", { className: "rounded bg-red-50 px-1 text-[10px] font-medium text-red-700 dark:bg-red-500/10 dark:text-red-400", children: "error" }),
|
|
404
|
-
|
|
447
|
+
m && /* @__PURE__ */ t(
|
|
405
448
|
"button",
|
|
406
449
|
{
|
|
407
450
|
type: "button",
|
|
408
|
-
onClick: () =>
|
|
451
|
+
onClick: () => c(!0),
|
|
409
452
|
"data-note-show-path": e.id,
|
|
410
453
|
className: "ml-auto rounded px-1.5 py-px text-[10.5px] font-medium text-sky-700 transition-colors hover:bg-sky-50 dark:text-sky-300 dark:hover:bg-sky-900/20",
|
|
411
454
|
"data-tip": "Everything this event set off, step by step",
|
|
@@ -416,23 +459,23 @@ function pt({
|
|
|
416
459
|
"button",
|
|
417
460
|
{
|
|
418
461
|
type: "button",
|
|
419
|
-
onClick: () =>
|
|
420
|
-
onBlur: () =>
|
|
421
|
-
disabled:
|
|
462
|
+
onClick: () => q ? p.mutate() : I(!0),
|
|
463
|
+
onBlur: () => I(!1),
|
|
464
|
+
disabled: p.isPending,
|
|
422
465
|
"data-note-replay": e.id,
|
|
423
|
-
className: `rounded px-1.5 py-px text-[10.5px] font-medium transition-colors ${
|
|
466
|
+
className: `rounded px-1.5 py-px text-[10.5px] font-medium transition-colors ${q ? "bg-sky-600 text-white" : "text-sky-700 hover:bg-sky-50 dark:text-sky-300 dark:hover:bg-sky-900/20"}`,
|
|
424
467
|
"data-tip": "Re-apply this event from its stored payload",
|
|
425
|
-
children:
|
|
468
|
+
children: p.isPending ? "Replaying…" : q ? "Replay this event?" : "Replay"
|
|
426
469
|
}
|
|
427
470
|
)
|
|
428
471
|
] }),
|
|
429
|
-
/* @__PURE__ */ t("p", { className: "mt-1 whitespace-pre-wrap break-words text-[13px] leading-snug text-slate-600 dark:text-slate-300", children: /* @__PURE__ */ t(
|
|
472
|
+
/* @__PURE__ */ t("p", { className: "mt-1 whitespace-pre-wrap break-words text-[13px] leading-snug text-slate-600 dark:text-slate-300", children: /* @__PURE__ */ t(De, { text: e.text }) }),
|
|
430
473
|
e.comment_id && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
|
|
431
474
|
(e.reactions ?? []).map((o) => /* @__PURE__ */ s(
|
|
432
475
|
"button",
|
|
433
476
|
{
|
|
434
477
|
type: "button",
|
|
435
|
-
onClick: () =>
|
|
478
|
+
onClick: () => S.mutate(o.emoji),
|
|
436
479
|
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${o.mine ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-slate-50 text-slate-600 hover:border-slate-300 dark:border-border dark:bg-muted dark:text-slate-300"}`,
|
|
437
480
|
children: [
|
|
438
481
|
o.emoji,
|
|
@@ -446,17 +489,17 @@ function pt({
|
|
|
446
489
|
"button",
|
|
447
490
|
{
|
|
448
491
|
type: "button",
|
|
449
|
-
onClick: () =>
|
|
492
|
+
onClick: () => y((o) => !o),
|
|
450
493
|
className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
|
|
451
494
|
"aria-label": "Add reaction",
|
|
452
|
-
children: /* @__PURE__ */ t(
|
|
495
|
+
children: /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" })
|
|
453
496
|
}
|
|
454
497
|
),
|
|
455
|
-
|
|
498
|
+
N && /* @__PURE__ */ t("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: Re.map((o) => /* @__PURE__ */ t(
|
|
456
499
|
"button",
|
|
457
500
|
{
|
|
458
501
|
type: "button",
|
|
459
|
-
onClick: () =>
|
|
502
|
+
onClick: () => S.mutate(o),
|
|
460
503
|
className: "rounded-full px-1 text-[14px] hover:bg-muted",
|
|
461
504
|
children: o
|
|
462
505
|
},
|
|
@@ -465,115 +508,132 @@ function pt({
|
|
|
465
508
|
] })
|
|
466
509
|
] })
|
|
467
510
|
] }),
|
|
468
|
-
|
|
469
|
-
|
|
511
|
+
m && e.provider && /* @__PURE__ */ t(
|
|
512
|
+
It,
|
|
470
513
|
{
|
|
471
|
-
target:
|
|
514
|
+
target: f ? {
|
|
472
515
|
source: e.provider,
|
|
473
516
|
id: e.id.replace(/^external:/, ""),
|
|
474
|
-
record: { collection: l, item:
|
|
517
|
+
record: { collection: l, item: x }
|
|
475
518
|
} : null,
|
|
476
519
|
event: { label: e.label },
|
|
477
|
-
onClose: () =>
|
|
520
|
+
onClose: () => c(!1)
|
|
478
521
|
}
|
|
479
522
|
)
|
|
480
523
|
] });
|
|
481
524
|
}
|
|
482
|
-
function
|
|
525
|
+
function ya({
|
|
483
526
|
collection: e,
|
|
484
527
|
item: l,
|
|
485
|
-
title:
|
|
486
|
-
defaultExpanded:
|
|
487
|
-
queuedComments:
|
|
488
|
-
onQueueComment:
|
|
489
|
-
onUnsentDraft:
|
|
528
|
+
title: x,
|
|
529
|
+
defaultExpanded: b,
|
|
530
|
+
queuedComments: f,
|
|
531
|
+
onQueueComment: c,
|
|
532
|
+
onUnsentDraft: m
|
|
490
533
|
}) {
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
var
|
|
494
|
-
(
|
|
495
|
-
}, [
|
|
496
|
-
const [
|
|
497
|
-
var
|
|
498
|
-
if (!(!
|
|
499
|
-
|
|
534
|
+
const d = le(), { userId: k } = Ve(), N = it(), y = Ee(), S = gt(), [q, I] = xt(b, !1), [p, w] = C(""), T = $t(), E = ee(m);
|
|
535
|
+
E.current = m, qe(() => {
|
|
536
|
+
var a;
|
|
537
|
+
(a = E.current) == null || a.call(E, p);
|
|
538
|
+
}, [p]);
|
|
539
|
+
const [_, o] = C(!1), v = async () => {
|
|
540
|
+
var a;
|
|
541
|
+
if (!(!p.trim() || _)) {
|
|
542
|
+
o(!0);
|
|
500
543
|
try {
|
|
501
|
-
const n = await
|
|
502
|
-
|
|
544
|
+
const n = await d.request(
|
|
545
|
+
K("/ai/cleanup", { text: p })
|
|
503
546
|
);
|
|
504
|
-
(
|
|
547
|
+
(a = n.data) != null && a.text && w(n.data.text);
|
|
505
548
|
} catch {
|
|
506
549
|
} finally {
|
|
507
|
-
|
|
550
|
+
o(!1);
|
|
508
551
|
}
|
|
509
552
|
}
|
|
510
|
-
},
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
const [W, A] = _(null), [F, Q] = _(null), [a, i] = _(""), p = !l || l === "new", f = ["comments", e, String(l)], { data: w, isLoading: O, isError: L } = z({
|
|
520
|
-
queryKey: f,
|
|
521
|
-
queryFn: () => g.request(U("/comments", { collection: e, item: l })).then((r) => r.data),
|
|
522
|
-
enabled: !p
|
|
523
|
-
}), ie = X(() => (w ?? []).filter((r) => !r.deleted), [w]), { data: Se } = z({
|
|
553
|
+
}, P = dt(e, l);
|
|
554
|
+
ct(e, l, p);
|
|
555
|
+
const [G, B] = C(null), [Q, R] = C(null), [U, r] = C(""), i = !l || l === "new", u = ["comments", e, String(l)], { data: g, isLoading: $, isError: O } = W({
|
|
556
|
+
queryKey: u,
|
|
557
|
+
queryFn: () => d.request(H("/comments", { collection: e, item: l })).then((a) => a.data),
|
|
558
|
+
enabled: !i
|
|
559
|
+
}), j = z(() => (g ?? []).filter((a) => !a.deleted), [g]), J = at(p, g, k || N), de = ee(null);
|
|
560
|
+
wt(de, J.replies.length);
|
|
561
|
+
const { data: Fe } = W({
|
|
524
562
|
queryKey: ["comments-related", e, String(l)],
|
|
525
|
-
queryFn: () =>
|
|
526
|
-
enabled: !
|
|
563
|
+
queryFn: () => d.request(H("/comments/related", { collection: e, item: l })).then((a) => a.data ?? []).catch(() => []),
|
|
564
|
+
enabled: !i,
|
|
527
565
|
staleTime: 3e4
|
|
528
|
-
}),
|
|
529
|
-
const
|
|
530
|
-
return [...
|
|
531
|
-
}, [
|
|
532
|
-
const
|
|
533
|
-
for (const n of
|
|
534
|
-
return
|
|
535
|
-
}, [
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
566
|
+
}), ce = Fe ?? [], F = z(() => {
|
|
567
|
+
const a = j.map((h) => ({ kind: "comment", at: h.created_at, comment: h })), n = ce.map((h) => ({ kind: "related", at: h.created_at, note: h }));
|
|
568
|
+
return [...a, ...n].sort((h, L) => new Date(L.at).getTime() - new Date(h.at).getTime());
|
|
569
|
+
}, [j, ce]), [X, Me] = C(() => /* @__PURE__ */ new Set()), [V, Oe] = C(""), me = z(() => {
|
|
570
|
+
const a = { people: 0, system: 0, integration: 0 };
|
|
571
|
+
for (const n of F) a[Ce(n)]++;
|
|
572
|
+
return a;
|
|
573
|
+
}, [F]), pe = i ? (f ?? []).length : me.people, je = z(
|
|
574
|
+
() => (g ?? []).map((a) => {
|
|
575
|
+
var n;
|
|
576
|
+
return { at: a.created_at, by: ((n = a.user) == null ? void 0 : n.id) ?? null };
|
|
577
|
+
}),
|
|
578
|
+
[g]
|
|
579
|
+
), Le = ut({
|
|
580
|
+
userId: k,
|
|
581
|
+
collection: e,
|
|
582
|
+
item: l,
|
|
583
|
+
tab: "comments",
|
|
584
|
+
open: q,
|
|
585
|
+
entries: je,
|
|
586
|
+
ready: !i && !!g
|
|
587
|
+
}), te = z(() => {
|
|
588
|
+
const a = V.trim().toLowerCase();
|
|
589
|
+
return F.filter((n) => X.has(Ce(n)) ? !1 : a ? (n.kind === "comment" ? `${n.comment.text} ${Pe(n.comment.user)}` : `${n.note.text} ${n.note.user_name ?? ""} ${n.note.label} ${n.note.context ?? ""} ${n.note.provider ?? ""}`).toLowerCase().includes(a) : !0);
|
|
590
|
+
}, [F, X, V]), Ae = (a) => Me((n) => {
|
|
591
|
+
const h = new Set(n);
|
|
592
|
+
return h.has(a) ? h.delete(a) : h.add(a), h;
|
|
593
|
+
}), Be = X.size > 0 || V.trim() !== "", ae = A({
|
|
594
|
+
mutationFn: (a) => d.request(K("/comments", { collection: e, item: l, text: a })),
|
|
543
595
|
onSuccess: () => {
|
|
544
|
-
|
|
596
|
+
y.invalidateQueries({ queryKey: u }), w(""), T.reset();
|
|
545
597
|
},
|
|
546
|
-
onError: () =>
|
|
547
|
-
}), ue =
|
|
548
|
-
mutationFn: ({ id:
|
|
598
|
+
onError: () => M.error("Failed to post comment")
|
|
599
|
+
}), ue = A({
|
|
600
|
+
mutationFn: ({ id: a, text: n }) => d.request(et(`/comments/${a}`, { text: n })),
|
|
549
601
|
onSuccess: () => {
|
|
550
|
-
|
|
602
|
+
y.invalidateQueries({ queryKey: u }), B(null), r("");
|
|
551
603
|
},
|
|
552
|
-
onError: () =>
|
|
553
|
-
}),
|
|
554
|
-
mutationFn: (
|
|
555
|
-
onSuccess: () =>
|
|
556
|
-
onError: () =>
|
|
557
|
-
}),
|
|
558
|
-
mutationFn: ({ id:
|
|
559
|
-
onSuccess: () =>
|
|
560
|
-
onError: () =>
|
|
561
|
-
}), [
|
|
562
|
-
mutationFn: (
|
|
563
|
-
|
|
604
|
+
onError: () => M.error("Failed to update comment")
|
|
605
|
+
}), ne = A({
|
|
606
|
+
mutationFn: (a) => d.request(tt(`/comments/${a}`)),
|
|
607
|
+
onSuccess: () => y.invalidateQueries({ queryKey: u }),
|
|
608
|
+
onError: () => M.error("Failed to delete comment")
|
|
609
|
+
}), xe = A({
|
|
610
|
+
mutationFn: ({ id: a, emoji: n }) => d.request(K(`/comments/${a}/reactions`, { emoji: n })),
|
|
611
|
+
onSuccess: () => y.invalidateQueries({ queryKey: u }),
|
|
612
|
+
onError: () => M.error("Failed to react")
|
|
613
|
+
}), [he, be] = C(null), Ke = A({
|
|
614
|
+
mutationFn: (a) => d.request(
|
|
615
|
+
K("/tasks", {
|
|
564
616
|
collection: e,
|
|
565
617
|
item: l,
|
|
566
|
-
title:
|
|
618
|
+
title: a.text.replace(/<[^>]*>/g, "").replace(/@\[([^\]]+)\]/g, "@$1").slice(0, 200),
|
|
567
619
|
assignee: k
|
|
568
620
|
})
|
|
569
621
|
),
|
|
570
622
|
onSuccess: () => {
|
|
571
|
-
|
|
623
|
+
pt(y, e, l), M.success("Task created from comment — assigned to you");
|
|
572
624
|
},
|
|
573
|
-
onError: () =>
|
|
625
|
+
onError: () => M.error("Could not create a task")
|
|
574
626
|
});
|
|
575
|
-
function
|
|
576
|
-
|
|
627
|
+
function fe(a) {
|
|
628
|
+
if (a.preventDefault(), i && c) {
|
|
629
|
+
if (!p.trim()) return;
|
|
630
|
+
c(p.trim()), w("");
|
|
631
|
+
} else {
|
|
632
|
+
if (T.uploading) return;
|
|
633
|
+
const n = T.compose(p);
|
|
634
|
+
if (!n) return;
|
|
635
|
+
ae.mutate(n);
|
|
636
|
+
}
|
|
577
637
|
}
|
|
578
638
|
return (
|
|
579
639
|
// Addressable from elsewhere (the summary panel jumps here), which needs
|
|
@@ -590,48 +650,49 @@ function jt({
|
|
|
590
650
|
{
|
|
591
651
|
type: "button",
|
|
592
652
|
"data-panel-toggle": "notes",
|
|
593
|
-
onClick: () =>
|
|
653
|
+
onClick: () => I((a) => !a),
|
|
594
654
|
className: "flex w-full flex-col px-5 py-3.5 text-left transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
|
|
595
655
|
children: [
|
|
596
656
|
/* @__PURE__ */ s("span", { className: "flex w-full items-center gap-2.5", children: [
|
|
597
|
-
/* @__PURE__ */ t(
|
|
598
|
-
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children:
|
|
599
|
-
|
|
657
|
+
/* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
658
|
+
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: x || "Comments" }),
|
|
659
|
+
pe > 0 && /* @__PURE__ */ t(
|
|
600
660
|
"span",
|
|
601
661
|
{
|
|
602
662
|
className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400",
|
|
603
663
|
"data-notes-badge": !0,
|
|
604
|
-
children:
|
|
664
|
+
children: pe
|
|
605
665
|
}
|
|
606
666
|
),
|
|
667
|
+
/* @__PURE__ */ t(Rt, { count: Le, tab: "comments" }),
|
|
607
668
|
/* @__PURE__ */ t(
|
|
608
|
-
|
|
669
|
+
Ue,
|
|
609
670
|
{
|
|
610
671
|
className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${q ? " rotate-180" : ""}`
|
|
611
672
|
}
|
|
612
673
|
)
|
|
613
674
|
] }),
|
|
614
|
-
!q && !
|
|
615
|
-
const
|
|
616
|
-
return
|
|
675
|
+
!q && !i && F.length > 0 && (() => {
|
|
676
|
+
const a = F[0], n = a.kind === "comment" ? re(a.comment) : a.note.user_name ?? "System", h = Se(a);
|
|
677
|
+
return h ? /* @__PURE__ */ s("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
|
|
617
678
|
/* @__PURE__ */ s("span", { className: "font-medium text-slate-500 dark:text-slate-400", children: [
|
|
618
679
|
n,
|
|
619
680
|
":"
|
|
620
681
|
] }),
|
|
621
682
|
" ",
|
|
622
|
-
/* @__PURE__ */ t(
|
|
683
|
+
/* @__PURE__ */ t(De, { text: h, plain: !0 })
|
|
623
684
|
] }) : null;
|
|
624
685
|
})()
|
|
625
686
|
]
|
|
626
687
|
}
|
|
627
688
|
),
|
|
628
|
-
q && /* @__PURE__ */ t("div", { className: "border-t border-slate-100 px-5 py-4 dark:border-border/60", children:
|
|
629
|
-
/* @__PURE__ */ s("form", { onSubmit:
|
|
689
|
+
q && /* @__PURE__ */ t("div", { className: "border-t border-slate-100 px-5 py-4 dark:border-border/60", children: i ? /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
690
|
+
/* @__PURE__ */ s("form", { onSubmit: fe, className: "space-y-2", children: [
|
|
630
691
|
/* @__PURE__ */ t(
|
|
631
|
-
|
|
692
|
+
se,
|
|
632
693
|
{
|
|
633
|
-
value:
|
|
634
|
-
onChange:
|
|
694
|
+
value: p,
|
|
695
|
+
onChange: w,
|
|
635
696
|
placeholder: "Write a comment…",
|
|
636
697
|
rows: 3,
|
|
637
698
|
className: "text-[13px]"
|
|
@@ -639,35 +700,50 @@ function jt({
|
|
|
639
700
|
),
|
|
640
701
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
641
702
|
/* @__PURE__ */ t("p", { className: "text-[11px] text-slate-400", children: "Comment will be posted after the record is saved." }),
|
|
642
|
-
/* @__PURE__ */ t(
|
|
703
|
+
/* @__PURE__ */ t(Z, { type: "submit", size: "sm", disabled: !p.trim(), children: "Queue" })
|
|
643
704
|
] })
|
|
644
705
|
] }),
|
|
645
|
-
(
|
|
646
|
-
/* @__PURE__ */ t(
|
|
647
|
-
(
|
|
706
|
+
(f ?? []).length > 0 && /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
707
|
+
/* @__PURE__ */ t(ke, {}),
|
|
708
|
+
(f ?? []).map((a, n) => /* @__PURE__ */ s(
|
|
648
709
|
"div",
|
|
649
710
|
{
|
|
650
711
|
className: "flex items-start gap-2.5 rounded-lg border border-dashed border-amber-200/70 bg-amber-50/40 px-3 py-2 dark:border-amber-500/20 dark:bg-amber-500/5",
|
|
651
712
|
children: [
|
|
652
713
|
/* @__PURE__ */ t("span", { className: "mt-0.5 inline-flex shrink-0 items-center rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-600 dark:bg-amber-500/15 dark:text-amber-400", children: "Pending" }),
|
|
653
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children:
|
|
714
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: a })
|
|
654
715
|
]
|
|
655
716
|
},
|
|
656
717
|
n
|
|
657
718
|
))
|
|
658
719
|
] })
|
|
659
|
-
] }) : /* @__PURE__ */ s(
|
|
660
|
-
/* @__PURE__ */
|
|
720
|
+
] }) : /* @__PURE__ */ s(Y, { children: [
|
|
721
|
+
J.replies.length > 0 && /* @__PURE__ */ t("div", { className: "mb-2", children: /* @__PURE__ */ t(
|
|
722
|
+
_t,
|
|
723
|
+
{
|
|
724
|
+
replies: J.replies.map((a) => ({
|
|
725
|
+
id: a.id,
|
|
726
|
+
name: re(a),
|
|
727
|
+
text: Se({ kind: "comment", comment: a }),
|
|
728
|
+
created_at: a.created_at
|
|
729
|
+
})),
|
|
730
|
+
onDismiss: J.dismiss,
|
|
731
|
+
onJump: Ct
|
|
732
|
+
}
|
|
733
|
+
) }),
|
|
734
|
+
/* @__PURE__ */ s("form", { ref: de, onSubmit: fe, className: "space-y-2", children: [
|
|
661
735
|
/* @__PURE__ */ t(
|
|
662
|
-
|
|
736
|
+
se,
|
|
663
737
|
{
|
|
664
|
-
value:
|
|
665
|
-
onChange:
|
|
666
|
-
|
|
738
|
+
value: p,
|
|
739
|
+
onChange: w,
|
|
740
|
+
onImages: T.addFiles,
|
|
741
|
+
placeholder: "Write a comment… paste or drop a screenshot to attach it",
|
|
667
742
|
rows: 3,
|
|
668
743
|
className: "text-[13px]"
|
|
669
744
|
}
|
|
670
745
|
),
|
|
746
|
+
/* @__PURE__ */ t(Tt, { images: T }),
|
|
671
747
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
672
748
|
/* @__PURE__ */ t("p", { className: "text-[11px] text-slate-400", children: "Type @ plus two letters to mention a teammate, or @owners to notify everyone currently assigned." }),
|
|
673
749
|
/* @__PURE__ */ s("span", { className: "flex items-center gap-1.5", children: [
|
|
@@ -675,277 +751,320 @@ function jt({
|
|
|
675
751
|
"button",
|
|
676
752
|
{
|
|
677
753
|
type: "button",
|
|
678
|
-
disabled: !
|
|
679
|
-
onClick: () => void
|
|
754
|
+
disabled: !p.trim() || _,
|
|
755
|
+
onClick: () => void v(),
|
|
680
756
|
"data-tip": "✨ Fix grammar & clarity (meaning preserved)",
|
|
681
757
|
className: "rounded-md border border-slate-200 px-2 py-1 text-[11.5px] text-slate-500 hover:bg-muted disabled:opacity-50 dark:border-border",
|
|
682
|
-
children:
|
|
758
|
+
children: _ ? "…" : "✨ Polish"
|
|
683
759
|
}
|
|
684
760
|
),
|
|
685
|
-
/* @__PURE__ */ t(
|
|
761
|
+
/* @__PURE__ */ t(
|
|
762
|
+
Z,
|
|
763
|
+
{
|
|
764
|
+
type: "submit",
|
|
765
|
+
size: "sm",
|
|
766
|
+
disabled: !p.trim() && !T.hasReady || T.uploading || ae.isPending,
|
|
767
|
+
children: ae.isPending ? "Posting…" : T.uploading ? "Uploading…" : "Comment"
|
|
768
|
+
}
|
|
769
|
+
)
|
|
686
770
|
] })
|
|
687
771
|
] })
|
|
688
772
|
] }),
|
|
689
|
-
|
|
773
|
+
P.map((a) => /* @__PURE__ */ s(
|
|
690
774
|
"p",
|
|
691
775
|
{
|
|
692
|
-
className: "flex items-center gap-1.5 text-[11.5px] italic text-slate-400",
|
|
693
|
-
"data-note-typing":
|
|
776
|
+
className: "flex items-center gap-1.5 text-[11.5px] italic text-slate-400 dark:text-slate-500",
|
|
777
|
+
"data-note-typing": a.field ?? "",
|
|
778
|
+
"aria-live": "polite",
|
|
694
779
|
children: [
|
|
695
|
-
/* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
|
|
696
|
-
|
|
780
|
+
/* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan motion-reduce:animate-none" }),
|
|
781
|
+
mt(
|
|
782
|
+
a.names,
|
|
783
|
+
a.field ? `replying on ${(S == null ? void 0 : S.labelOf(a.field)) ?? ye(a.field)}` : "replying"
|
|
784
|
+
),
|
|
697
785
|
"…"
|
|
698
786
|
]
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
787
|
+
},
|
|
788
|
+
a.field ?? ""
|
|
789
|
+
)),
|
|
790
|
+
/* @__PURE__ */ t(ke, { className: "my-4" }),
|
|
791
|
+
F.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
|
|
792
|
+
["people", "system", "integration"].map((a) => {
|
|
793
|
+
const n = !X.has(a), h = me[a];
|
|
705
794
|
return /* @__PURE__ */ s(
|
|
706
795
|
"button",
|
|
707
796
|
{
|
|
708
797
|
type: "button",
|
|
709
|
-
onClick: () =>
|
|
798
|
+
onClick: () => Ae(a),
|
|
710
799
|
"aria-pressed": n,
|
|
711
|
-
"data-notes-filter":
|
|
712
|
-
disabled:
|
|
800
|
+
"data-notes-filter": a,
|
|
801
|
+
disabled: h === 0 && n,
|
|
713
802
|
className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${n ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-400 line-through decoration-slate-300 dark:border-border"} disabled:opacity-50`,
|
|
714
|
-
title:
|
|
803
|
+
title: a === "people" ? "Comments and notes people wrote" : a === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
|
|
715
804
|
children: [
|
|
716
|
-
|
|
717
|
-
/* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] opacity-70", children:
|
|
805
|
+
jt[a],
|
|
806
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] opacity-70", children: h })
|
|
718
807
|
]
|
|
719
808
|
},
|
|
720
|
-
|
|
809
|
+
a
|
|
721
810
|
);
|
|
722
811
|
}),
|
|
723
812
|
/* @__PURE__ */ t(
|
|
724
813
|
"input",
|
|
725
814
|
{
|
|
726
|
-
value:
|
|
727
|
-
onChange: (
|
|
815
|
+
value: V,
|
|
816
|
+
onChange: (a) => Oe(a.target.value),
|
|
728
817
|
placeholder: "Search notes…",
|
|
729
818
|
"aria-label": "Search notes",
|
|
730
819
|
"data-notes-search": !0,
|
|
731
820
|
className: "ml-auto h-6 w-[150px] rounded-md border border-slate-200 bg-background px-2 text-[11.5px] dark:border-border"
|
|
732
821
|
}
|
|
733
822
|
),
|
|
734
|
-
|
|
735
|
-
|
|
823
|
+
Be && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
|
|
824
|
+
te.length,
|
|
736
825
|
" of ",
|
|
737
|
-
|
|
826
|
+
F.length
|
|
738
827
|
] })
|
|
739
828
|
] }),
|
|
740
|
-
|
|
829
|
+
$ ? /* @__PURE__ */ t("div", { className: "space-y-4", children: ["a", "b"].map((a) => /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
|
|
741
830
|
/* @__PURE__ */ t("div", { className: "h-8 w-8 shrink-0 animate-pulse rounded-full bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
742
831
|
/* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
|
|
743
832
|
/* @__PURE__ */ t("div", { className: "h-3 w-32 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
744
833
|
/* @__PURE__ */ t("div", { className: "h-3 w-full animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
745
834
|
] })
|
|
746
|
-
] },
|
|
747
|
-
var
|
|
748
|
-
if (
|
|
835
|
+
] }, a)) }) : O ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : F.length === 0 ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : te.length === 0 ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes match — clear the search or turn a filter back on." }) : /* @__PURE__ */ t("div", { className: "nvr-stagger-direct space-y-4", children: te.map((a) => {
|
|
836
|
+
var ge;
|
|
837
|
+
if (a.kind === "related")
|
|
749
838
|
return /* @__PURE__ */ t("div", { className: "nvr-section-enter", children: /* @__PURE__ */ t(
|
|
750
|
-
|
|
839
|
+
At,
|
|
751
840
|
{
|
|
752
|
-
note:
|
|
841
|
+
note: a.note,
|
|
753
842
|
collection: e,
|
|
754
843
|
item: String(l)
|
|
755
844
|
}
|
|
756
|
-
) },
|
|
757
|
-
const n =
|
|
758
|
-
return /* @__PURE__ */ s(
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
fallback: /* @__PURE__ */ t(at, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ t(nt, { className: "bg-nvr-cyan/15 text-[11px] font-bold text-nvr-navy", children: ot(n.user) }) })
|
|
765
|
-
}
|
|
766
|
-
),
|
|
767
|
-
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
768
|
-
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
769
|
-
/* @__PURE__ */ t(
|
|
770
|
-
"span",
|
|
771
|
-
{
|
|
772
|
-
className: "text-[13px] font-medium text-slate-800",
|
|
773
|
-
"data-comment-acting-admin": ((fe = n.acting_admin) == null ? void 0 : fe.id) || void 0,
|
|
774
|
-
children: ye(n)
|
|
775
|
-
}
|
|
776
|
-
),
|
|
777
|
-
/* @__PURE__ */ t(Ze, { label: n.via_agent }),
|
|
845
|
+
) }, a.note.id);
|
|
846
|
+
const n = a.comment, h = k === n.user.id, L = G === n.id;
|
|
847
|
+
return /* @__PURE__ */ s(
|
|
848
|
+
"div",
|
|
849
|
+
{
|
|
850
|
+
"data-comment-id": n.id,
|
|
851
|
+
className: "nvr-section-enter group flex gap-3 rounded-lg",
|
|
852
|
+
children: [
|
|
778
853
|
/* @__PURE__ */ t(
|
|
779
|
-
|
|
854
|
+
yt,
|
|
780
855
|
{
|
|
781
|
-
|
|
782
|
-
"
|
|
783
|
-
children:
|
|
856
|
+
userId: n.user.id,
|
|
857
|
+
className: "h-8 w-8",
|
|
858
|
+
fallback: /* @__PURE__ */ t(vt, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ t(kt, { className: "bg-nvr-cyan/15 text-[11px] font-bold text-nvr-navy dark:bg-nvr-cyan/20 dark:text-nvr-cyan", children: Pt(n.user) }) })
|
|
784
859
|
}
|
|
785
860
|
),
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
861
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
862
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
863
|
+
/* @__PURE__ */ t(
|
|
864
|
+
"span",
|
|
865
|
+
{
|
|
866
|
+
className: "text-[13px] font-medium text-slate-800",
|
|
867
|
+
"data-comment-acting-admin": ((ge = n.acting_admin) == null ? void 0 : ge.id) || void 0,
|
|
868
|
+
children: re(n)
|
|
869
|
+
}
|
|
870
|
+
),
|
|
871
|
+
/* @__PURE__ */ t(bt, { label: n.via_agent }),
|
|
872
|
+
/* @__PURE__ */ t(
|
|
873
|
+
"span",
|
|
874
|
+
{
|
|
875
|
+
className: "text-[11px] text-slate-400",
|
|
876
|
+
"data-tip": ie(n.created_at),
|
|
877
|
+
children: /* @__PURE__ */ t(Ie, { value: n.created_at })
|
|
878
|
+
}
|
|
879
|
+
),
|
|
880
|
+
n.updated_at && n.updated_at !== n.created_at && /* @__PURE__ */ t("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
|
|
881
|
+
n.field && /* @__PURE__ */ t(
|
|
882
|
+
Mt,
|
|
883
|
+
{
|
|
884
|
+
field: n.field,
|
|
885
|
+
label: (S == null ? void 0 : S.labelOf(n.field)) ?? ye(n.field),
|
|
886
|
+
resolved: !!n.resolved_at,
|
|
887
|
+
onJump: S ? () => S.jump(n.field) : void 0
|
|
888
|
+
}
|
|
889
|
+
),
|
|
890
|
+
!L && /* @__PURE__ */ s(
|
|
891
|
+
"div",
|
|
892
|
+
{
|
|
893
|
+
className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${Q === n.id ? "opacity-100" : "opacity-0"}`,
|
|
894
|
+
children: [
|
|
895
|
+
/* @__PURE__ */ t(
|
|
896
|
+
"button",
|
|
897
|
+
{
|
|
898
|
+
type: "button",
|
|
899
|
+
title: "Make a task from this comment",
|
|
900
|
+
"aria-label": "Make a task from this comment",
|
|
901
|
+
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
902
|
+
onClick: () => Ke.mutate(n),
|
|
903
|
+
children: /* @__PURE__ */ t(ze, { className: "h-3 w-3" })
|
|
904
|
+
}
|
|
905
|
+
),
|
|
906
|
+
h && (Q === n.id ? /* @__PURE__ */ s(Y, { children: [
|
|
907
|
+
/* @__PURE__ */ t(
|
|
908
|
+
"button",
|
|
909
|
+
{
|
|
910
|
+
type: "button",
|
|
911
|
+
autoFocus: !0,
|
|
912
|
+
disabled: ne.isPending,
|
|
913
|
+
"data-comment-delete-confirm": n.id,
|
|
914
|
+
className: "rounded bg-red-600 px-1.5 py-px text-[10.5px] font-medium text-white transition-colors hover:bg-red-700 disabled:opacity-60",
|
|
915
|
+
onClick: () => ne.mutate(n.id, {
|
|
916
|
+
onSettled: () => R(null)
|
|
917
|
+
}),
|
|
918
|
+
children: ne.isPending ? "Deleting…" : "Delete comment?"
|
|
919
|
+
}
|
|
920
|
+
),
|
|
921
|
+
/* @__PURE__ */ t(
|
|
922
|
+
"button",
|
|
923
|
+
{
|
|
924
|
+
type: "button",
|
|
925
|
+
className: "rounded px-1.5 py-px text-[10.5px] font-medium text-slate-500 transition-colors hover:bg-slate-100 dark:hover:bg-muted",
|
|
926
|
+
onClick: () => R(null),
|
|
927
|
+
children: "Keep"
|
|
928
|
+
}
|
|
929
|
+
)
|
|
930
|
+
] }) : /* @__PURE__ */ s(Y, { children: [
|
|
931
|
+
/* @__PURE__ */ t(
|
|
932
|
+
"button",
|
|
933
|
+
{
|
|
934
|
+
type: "button",
|
|
935
|
+
title: "Edit comment",
|
|
936
|
+
"aria-label": "Edit comment",
|
|
937
|
+
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",
|
|
938
|
+
onClick: () => {
|
|
939
|
+
B(n.id), r(n.text);
|
|
940
|
+
},
|
|
941
|
+
children: /* @__PURE__ */ t(We, { className: "h-3 w-3" })
|
|
942
|
+
}
|
|
943
|
+
),
|
|
944
|
+
/* @__PURE__ */ t(
|
|
945
|
+
"button",
|
|
946
|
+
{
|
|
947
|
+
type: "button",
|
|
948
|
+
title: "Delete comment",
|
|
949
|
+
"aria-label": "Delete comment",
|
|
950
|
+
className: "rounded p-1 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500",
|
|
951
|
+
onClick: () => R(n.id),
|
|
952
|
+
children: /* @__PURE__ */ t(He, { className: "h-3 w-3" })
|
|
953
|
+
}
|
|
954
|
+
)
|
|
955
|
+
] }))
|
|
956
|
+
]
|
|
957
|
+
}
|
|
958
|
+
)
|
|
959
|
+
] }),
|
|
960
|
+
L ? /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-2", children: [
|
|
961
|
+
/* @__PURE__ */ t(
|
|
962
|
+
se,
|
|
963
|
+
{
|
|
964
|
+
value: U,
|
|
965
|
+
onChange: r,
|
|
966
|
+
rows: 3,
|
|
967
|
+
className: "text-[13px]"
|
|
968
|
+
}
|
|
969
|
+
),
|
|
970
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
|
|
971
|
+
/* @__PURE__ */ s(
|
|
972
|
+
Z,
|
|
803
973
|
{
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
974
|
+
size: "sm",
|
|
975
|
+
className: "h-7 gap-1.5",
|
|
976
|
+
disabled: !U.trim() || ue.isPending,
|
|
977
|
+
onClick: () => ue.mutate({ id: n.id, text: U.trim() }),
|
|
978
|
+
children: [
|
|
979
|
+
/* @__PURE__ */ t($e, { className: "h-3 w-3" }),
|
|
980
|
+
" Save"
|
|
981
|
+
]
|
|
810
982
|
}
|
|
811
983
|
),
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
"
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
type: "button",
|
|
831
|
-
className: "rounded px-1.5 py-px text-[10.5px] font-medium text-slate-500 transition-colors hover:bg-slate-100 dark:hover:bg-muted",
|
|
832
|
-
onClick: () => Q(null),
|
|
833
|
-
children: "Keep"
|
|
834
|
-
}
|
|
835
|
-
)
|
|
836
|
-
] }) : /* @__PURE__ */ s(V, { children: [
|
|
837
|
-
/* @__PURE__ */ t(
|
|
838
|
-
"button",
|
|
839
|
-
{
|
|
840
|
-
type: "button",
|
|
841
|
-
title: "Edit comment",
|
|
842
|
-
"aria-label": "Edit comment",
|
|
843
|
-
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",
|
|
844
|
-
onClick: () => {
|
|
845
|
-
A(n.id), i(n.text);
|
|
846
|
-
},
|
|
847
|
-
children: /* @__PURE__ */ t(Me, { className: "h-3 w-3" })
|
|
848
|
-
}
|
|
849
|
-
),
|
|
850
|
-
/* @__PURE__ */ t(
|
|
851
|
-
"button",
|
|
852
|
-
{
|
|
853
|
-
type: "button",
|
|
854
|
-
title: "Delete comment",
|
|
855
|
-
"aria-label": "Delete comment",
|
|
856
|
-
className: "rounded p-1 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500",
|
|
857
|
-
onClick: () => Q(n.id),
|
|
858
|
-
children: /* @__PURE__ */ t(Ie, { className: "h-3 w-3" })
|
|
859
|
-
}
|
|
860
|
-
)
|
|
861
|
-
] }))
|
|
862
|
-
]
|
|
863
|
-
}
|
|
864
|
-
)
|
|
865
|
-
] }),
|
|
866
|
-
K ? /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-2", children: [
|
|
867
|
-
/* @__PURE__ */ t(
|
|
868
|
-
ne,
|
|
869
|
-
{
|
|
870
|
-
value: a,
|
|
871
|
-
onChange: i,
|
|
872
|
-
rows: 3,
|
|
873
|
-
className: "text-[13px]"
|
|
874
|
-
}
|
|
875
|
-
),
|
|
876
|
-
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
|
|
877
|
-
/* @__PURE__ */ s(
|
|
878
|
-
J,
|
|
984
|
+
/* @__PURE__ */ s(
|
|
985
|
+
Z,
|
|
986
|
+
{
|
|
987
|
+
size: "sm",
|
|
988
|
+
variant: "outline",
|
|
989
|
+
className: "h-7 gap-1.5",
|
|
990
|
+
onClick: () => {
|
|
991
|
+
B(null), r("");
|
|
992
|
+
},
|
|
993
|
+
children: [
|
|
994
|
+
/* @__PURE__ */ t(Ge, { className: "h-3 w-3" }),
|
|
995
|
+
" Cancel"
|
|
996
|
+
]
|
|
997
|
+
}
|
|
998
|
+
)
|
|
999
|
+
] })
|
|
1000
|
+
] }) : /* @__PURE__ */ t(
|
|
1001
|
+
qt,
|
|
879
1002
|
{
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
onClick: () => ue.mutate({ id: n.id, text: a.trim() }),
|
|
884
|
-
children: [
|
|
885
|
-
/* @__PURE__ */ t(Oe, { className: "h-3 w-3" }),
|
|
886
|
-
" Save"
|
|
887
|
-
]
|
|
1003
|
+
text: n.text,
|
|
1004
|
+
record: { collection: e, itemId: l },
|
|
1005
|
+
className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600"
|
|
888
1006
|
}
|
|
889
1007
|
),
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
|
|
1008
|
+
!L && /* @__PURE__ */ t(
|
|
1009
|
+
Ft,
|
|
892
1010
|
{
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
onClick: () => {
|
|
897
|
-
A(null), i("");
|
|
898
|
-
},
|
|
899
|
-
children: [
|
|
900
|
-
/* @__PURE__ */ t(je, { className: "h-3 w-3" }),
|
|
901
|
-
" Cancel"
|
|
902
|
-
]
|
|
1011
|
+
comment: n,
|
|
1012
|
+
collection: e,
|
|
1013
|
+
item: String(l)
|
|
903
1014
|
}
|
|
904
|
-
)
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
!K && /* @__PURE__ */ t(lt, { comment: n }),
|
|
908
|
-
!K && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
|
|
909
|
-
(n.reactions ?? []).map((M) => /* @__PURE__ */ s(
|
|
910
|
-
"button",
|
|
911
|
-
{
|
|
912
|
-
type: "button",
|
|
913
|
-
onClick: () => pe.mutate({ id: n.id, emoji: M.emoji }),
|
|
914
|
-
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${M.mine ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-slate-50 text-slate-600 hover:border-slate-300 dark:border-border dark:bg-muted dark:text-slate-300"}`,
|
|
915
|
-
children: [
|
|
916
|
-
M.emoji,
|
|
917
|
-
/* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] font-semibold", children: M.count })
|
|
918
|
-
]
|
|
919
|
-
},
|
|
920
|
-
M.emoji
|
|
921
|
-
)),
|
|
922
|
-
/* @__PURE__ */ s("span", { className: "relative", children: [
|
|
923
|
-
/* @__PURE__ */ t(
|
|
924
|
-
"button",
|
|
1015
|
+
),
|
|
1016
|
+
!L && /* @__PURE__ */ t(
|
|
1017
|
+
St,
|
|
925
1018
|
{
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
"aria-label": "Add reaction",
|
|
930
|
-
children: /* @__PURE__ */ t(we, { className: "h-3.5 w-3.5" })
|
|
1019
|
+
people: n.seen_by,
|
|
1020
|
+
hasMentions: oe(n).length > 0,
|
|
1021
|
+
exclude: new Set(oe(n).map((D) => String(D.id).toUpperCase()))
|
|
931
1022
|
}
|
|
932
1023
|
),
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1024
|
+
!L && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
|
|
1025
|
+
(n.reactions ?? []).map((D) => /* @__PURE__ */ s(
|
|
1026
|
+
"button",
|
|
1027
|
+
{
|
|
1028
|
+
type: "button",
|
|
1029
|
+
onClick: () => xe.mutate({ id: n.id, emoji: D.emoji }),
|
|
1030
|
+
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${D.mine ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-slate-50 text-slate-600 hover:border-slate-300 dark:border-border dark:bg-muted dark:text-slate-300"}`,
|
|
1031
|
+
children: [
|
|
1032
|
+
D.emoji,
|
|
1033
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] font-semibold", children: D.count })
|
|
1034
|
+
]
|
|
939
1035
|
},
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1036
|
+
D.emoji
|
|
1037
|
+
)),
|
|
1038
|
+
/* @__PURE__ */ s("span", { className: "relative", children: [
|
|
1039
|
+
/* @__PURE__ */ t(
|
|
1040
|
+
"button",
|
|
1041
|
+
{
|
|
1042
|
+
type: "button",
|
|
1043
|
+
onClick: () => be(he === n.id ? null : n.id),
|
|
1044
|
+
className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
|
|
1045
|
+
"aria-label": "Add reaction",
|
|
1046
|
+
children: /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" })
|
|
1047
|
+
}
|
|
1048
|
+
),
|
|
1049
|
+
he === n.id && /* @__PURE__ */ t("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: Re.map((D) => /* @__PURE__ */ t(
|
|
1050
|
+
"button",
|
|
1051
|
+
{
|
|
1052
|
+
type: "button",
|
|
1053
|
+
onClick: () => {
|
|
1054
|
+
xe.mutate({ id: n.id, emoji: D }), be(null);
|
|
1055
|
+
},
|
|
1056
|
+
className: "rounded-full px-1 text-[14px] hover:bg-muted",
|
|
1057
|
+
children: D
|
|
1058
|
+
},
|
|
1059
|
+
D
|
|
1060
|
+
)) })
|
|
1061
|
+
] })
|
|
1062
|
+
] })
|
|
945
1063
|
] })
|
|
946
|
-
]
|
|
947
|
-
|
|
948
|
-
|
|
1064
|
+
]
|
|
1065
|
+
},
|
|
1066
|
+
n.id
|
|
1067
|
+
);
|
|
949
1068
|
}) })
|
|
950
1069
|
] }) })
|
|
951
1070
|
]
|
|
@@ -954,7 +1073,7 @@ function jt({
|
|
|
954
1073
|
);
|
|
955
1074
|
}
|
|
956
1075
|
export {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1076
|
+
ya as CommentPanel,
|
|
1077
|
+
se as MentionTextarea,
|
|
1078
|
+
Se as notePreviewText
|
|
960
1079
|
};
|