@nivaro/react 0.3.114 → 0.3.116
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 +1728 -22
- 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 +4909 -4182
- 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 +612 -551
- 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/OverflowRail.js +326 -0
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/SignalCard.js +84 -77
- 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/list/PhonePager.js +50 -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 +389 -323
- 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 +2050 -1942
- 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/OwnerAvatars.js +9 -9
- 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 +2407 -1950
- package/dist/shared/components/queue/worklist-helpers.js +10 -6
- 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/ui/popover.js +53 -29
- 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/keep-row-focus.js +43 -0
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/obligation-banner.js +17 -17
- 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/rail-menu-context.js +9 -0
- 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/row-surface.js +7 -0
- 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/table-pins.js +20 -18
- 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 +62 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-below-md.js +29 -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,81 +1,85 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Check as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useApiFetchConfig as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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
|
-
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as fe, useQuery as ke, useMutation as K } from "@tanstack/react-query";
|
|
3
|
+
import { Check as ye, Bot as we } from "lucide-react";
|
|
4
|
+
import { useState as $, useRef as B, useMemo as ne, useEffect as z } from "react";
|
|
5
|
+
import { useApiFetchConfig as Ne, useItemNavigation as ve, useNavigation as _e } from "../context.js";
|
|
6
|
+
import { useDeadlineNow as Ce, liveSlaReading as Se } from "../lib/deadline-ticker.js";
|
|
7
|
+
import { useLiveEvent as $e } from "../lib/live.js";
|
|
8
|
+
import { useLiveOps as Te, useFreshIds as je } from "../lib/live-ops.js";
|
|
9
|
+
import { resolveNotificationTarget as se, runNotificationTarget as Oe } from "../lib/notification-target.js";
|
|
10
|
+
import { usePrefetchIntent as Ie } from "../lib/prefetch.js";
|
|
11
|
+
import { useOptionalRealtime as Le } from "../lib/realtime.js";
|
|
12
|
+
import { usePeekOrOpen as Ae, peekable as de } from "../lib/record-peek.js";
|
|
13
|
+
import { userErrorMessage as Me } from "../lib/safe-error.js";
|
|
14
|
+
import { withinDay as oe, slaChip as De } from "../lib/sla-chip.js";
|
|
15
|
+
import { cn as D, formatRelative as qe } from "../lib/utils.js";
|
|
16
|
+
import { AgentQuestionsCard as Fe } from "./AgentQuestionsCard.js";
|
|
17
|
+
import { FirstWeekCard as Ue } from "./ai/FirstWeekCard.js";
|
|
18
|
+
import { TaskDoButton as We } from "./ai/TaskDo.js";
|
|
19
|
+
import { openChatRoom as Ee, canOpenChatRoom as Pe } from "./chat/chat-core.js";
|
|
20
|
+
import { useMyRecordRooms as Qe } from "./chat/chat-hooks.js";
|
|
21
|
+
import { useCoveringQuery as Ke, DelegateCoverLine as Be } from "./DelegateCoverLine.js";
|
|
22
|
+
import { LearningPathCard as ze } from "./help-videos/viewer/LearningPathCard.js";
|
|
23
|
+
import { RequiredVideosCard as He } from "./help-videos/viewer/RequiredVideosCard.js";
|
|
24
|
+
import { SkeletonBar as Je, ListSkeleton as Ve } from "./Skeletons.js";
|
|
25
|
+
import { TickerNumber as Ye } from "./TickerNumber.js";
|
|
26
|
+
import { UserAvatar as Ze } from "./UserAvatar.js";
|
|
27
|
+
const Re = 8e3, ie = ["records", "proposals", "tasks", "team", "waiting", "notifications"], le = /* @__PURE__ */ new Set(["records", "proposals"]), ce = {
|
|
25
28
|
records: "Waiting on you",
|
|
29
|
+
proposals: "Changes to review",
|
|
26
30
|
tasks: "My tasks",
|
|
27
31
|
team: "Team tasks",
|
|
28
32
|
waiting: "Waiting on others",
|
|
29
33
|
notifications: "Notifications"
|
|
30
|
-
},
|
|
34
|
+
}, Ge = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), q = (i) => !!i && String(i).slice(0, 10) < Ge(), Xe = {
|
|
31
35
|
alert: "bg-red-500/10 text-red-600 dark:text-red-400",
|
|
32
36
|
warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
|
|
33
37
|
neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
|
|
34
38
|
ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
|
|
35
39
|
};
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
return
|
|
40
|
+
function et({ sla: i }) {
|
|
41
|
+
const p = Ce(!!(i != null && i.due_at)), c = i != null && i.due_at ? Se(i, p) : i, x = De(c);
|
|
42
|
+
return x ? /* @__PURE__ */ e(
|
|
39
43
|
"span",
|
|
40
44
|
{
|
|
41
|
-
"data-sla-chip":
|
|
42
|
-
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${
|
|
43
|
-
children:
|
|
45
|
+
"data-sla-chip": x.tone,
|
|
46
|
+
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums transition-colors duration-500 ${Xe[x.tone]}`,
|
|
47
|
+
children: x.label
|
|
44
48
|
}
|
|
45
49
|
) : null;
|
|
46
50
|
}
|
|
47
|
-
function
|
|
51
|
+
function tt({ state: i, color: p }) {
|
|
48
52
|
return i ? /* @__PURE__ */ e(
|
|
49
53
|
"span",
|
|
50
54
|
{
|
|
51
55
|
className: "rounded-full px-2 py-0.5 text-[10.5px] font-medium",
|
|
52
56
|
style: {
|
|
53
|
-
backgroundColor:
|
|
54
|
-
color:
|
|
57
|
+
backgroundColor: p ? `${p}22` : "rgba(100,116,139,.12)",
|
|
58
|
+
color: p ?? void 0
|
|
55
59
|
},
|
|
56
60
|
children: i.replace(/_/g, " ")
|
|
57
61
|
}
|
|
58
62
|
) : null;
|
|
59
63
|
}
|
|
60
|
-
function
|
|
64
|
+
function rt({ order: i, hidden: p }) {
|
|
61
65
|
const c = i.filter(
|
|
62
|
-
(
|
|
63
|
-
),
|
|
66
|
+
(u) => !p.includes(u) && (u === "records" || u === "tasks" || u === "notifications")
|
|
67
|
+
), x = (u, v) => /* @__PURE__ */ n(
|
|
64
68
|
"section",
|
|
65
69
|
{
|
|
66
70
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
67
71
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium text-slate-400 dark:text-slate-500", children:
|
|
70
|
-
|
|
72
|
+
/* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
73
|
+
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium text-slate-400 dark:text-slate-500", children: ce[u] ?? u }),
|
|
74
|
+
u === "records" && /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
|
|
71
75
|
] }),
|
|
72
76
|
/* @__PURE__ */ e(
|
|
73
|
-
|
|
77
|
+
Ve,
|
|
74
78
|
{
|
|
75
79
|
header: !1,
|
|
76
|
-
rows:
|
|
80
|
+
rows: v,
|
|
77
81
|
rowClassName: "h-[37px] px-4",
|
|
78
|
-
columns:
|
|
82
|
+
columns: u === "records" ? [
|
|
79
83
|
{ key: "label", grow: 6 },
|
|
80
84
|
{ key: "where", width: 90, shape: "short" },
|
|
81
85
|
{ key: "state", width: 72, shape: "badge" },
|
|
@@ -88,30 +92,30 @@ function Pe({ order: i, hidden: u }) {
|
|
|
88
92
|
)
|
|
89
93
|
]
|
|
90
94
|
},
|
|
91
|
-
|
|
95
|
+
u
|
|
92
96
|
), k = [];
|
|
93
|
-
for (let
|
|
94
|
-
if (c[
|
|
95
|
-
k.push(
|
|
97
|
+
for (let u = 0; u < c.length; ) {
|
|
98
|
+
if (c[u] === "records") {
|
|
99
|
+
k.push(x("records", 5)), u++;
|
|
96
100
|
continue;
|
|
97
101
|
}
|
|
98
|
-
const
|
|
102
|
+
const v = c.slice(u, u + 2).filter((y) => y !== "records");
|
|
99
103
|
k.push(
|
|
100
|
-
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children:
|
|
101
|
-
),
|
|
104
|
+
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: v.map((y) => x(y, 4)) }, v.join("+"))
|
|
105
|
+
), u += v.length;
|
|
102
106
|
}
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */ e("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: ["Waiting on you", "SLA breached", "Open tasks", "Unread notifications"].map((
|
|
107
|
+
return /* @__PURE__ */ n("div", { className: "space-y-5 p-6", "data-my-work-loading": !0, "aria-busy": "true", children: [
|
|
108
|
+
/* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
|
|
109
|
+
/* @__PURE__ */ e("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: ["Waiting on you", "SLA breached", "Open tasks", "Unread notifications"].map((u) => /* @__PURE__ */ n(
|
|
106
110
|
"div",
|
|
107
111
|
{
|
|
108
112
|
className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card",
|
|
109
113
|
children: [
|
|
110
|
-
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children:
|
|
111
|
-
/* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(
|
|
114
|
+
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: u }),
|
|
115
|
+
/* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(Je, { width: 34, className: "h-[18px] rounded-md" }) })
|
|
112
116
|
]
|
|
113
117
|
},
|
|
114
|
-
|
|
118
|
+
u
|
|
115
119
|
)) }),
|
|
116
120
|
/* @__PURE__ */ e("span", { className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] text-slate-400 dark:border-border dark:text-slate-500", children: "Refresh" }),
|
|
117
121
|
/* @__PURE__ */ e("span", { className: "ml-2 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] text-slate-400 dark:border-border dark:text-slate-500", children: "Customize" })
|
|
@@ -119,162 +123,171 @@ function Pe({ order: i, hidden: u }) {
|
|
|
119
123
|
k
|
|
120
124
|
] });
|
|
121
125
|
}
|
|
122
|
-
function
|
|
123
|
-
return /* @__PURE__ */
|
|
126
|
+
function F({ label: i, value: p, tone: c }) {
|
|
127
|
+
return /* @__PURE__ */ n("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
|
|
124
128
|
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: i }),
|
|
125
|
-
/* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(
|
|
129
|
+
/* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(Ye, { value: p }) })
|
|
126
130
|
] });
|
|
127
131
|
}
|
|
128
|
-
function
|
|
132
|
+
function Ot({
|
|
129
133
|
notificationRoutes: i,
|
|
130
|
-
onOpenPath:
|
|
134
|
+
onOpenPath: p
|
|
131
135
|
} = {}) {
|
|
132
|
-
const { apiBase: c, authHeaders:
|
|
133
|
-
var
|
|
134
|
-
const s = ((
|
|
135
|
-
|
|
136
|
-
},
|
|
136
|
+
const { apiBase: c, authHeaders: x, credentials: k } = Ne(), { open: u } = ve(), v = Ae(), y = _e(), _ = fe(), H = Ie(), J = (r) => {
|
|
137
|
+
var h, m;
|
|
138
|
+
const s = ((h = i == null ? void 0 : i.support) == null ? void 0 : h.call(i, String(r))) ?? ((m = y.consoleUrl) == null ? void 0 : m.call(y, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
|
|
139
|
+
p ? p(s) : y.navigate(s);
|
|
140
|
+
}, U = Le(), [me, O] = $(!1), [g, ue] = $(() => {
|
|
137
141
|
try {
|
|
138
142
|
const r = localStorage.getItem("nvr_mywork_sections");
|
|
139
143
|
if (r) {
|
|
140
144
|
const s = JSON.parse(r);
|
|
141
145
|
if (Array.isArray(s == null ? void 0 : s.order) && Array.isArray(s == null ? void 0 : s.hidden)) {
|
|
142
|
-
const
|
|
143
|
-
k:
|
|
144
|
-
at: s.order.indexOf(
|
|
145
|
-
})).sort((
|
|
146
|
-
return { order:
|
|
146
|
+
const h = ie.map((m, b) => ({
|
|
147
|
+
k: m,
|
|
148
|
+
at: s.order.indexOf(m) >= 0 ? s.order.indexOf(m) : b - 0.5
|
|
149
|
+
})).sort((m, b) => m.at - b.at).map((m) => m.k);
|
|
150
|
+
return { order: h, hidden: s.hidden.filter((m) => h.includes(m)) };
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
153
|
} catch {
|
|
150
154
|
}
|
|
151
|
-
return { order: [...
|
|
152
|
-
}),
|
|
153
|
-
|
|
155
|
+
return { order: [...ie], hidden: [] };
|
|
156
|
+
}), V = (r) => {
|
|
157
|
+
ue(r);
|
|
154
158
|
try {
|
|
155
159
|
localStorage.setItem("nvr_mywork_sections", JSON.stringify(r));
|
|
156
160
|
} catch {
|
|
157
161
|
}
|
|
158
|
-
}, [
|
|
162
|
+
}, [pe, he] = $(!1), Y = B(0), [I, be] = $("all"), [W, Z] = $(null), { data: L } = Ke(), w = ne(() => {
|
|
163
|
+
const r = W ? L == null ? void 0 : L.find((s) => s.user_id === W) : null;
|
|
164
|
+
return r ? { userId: r.user_id, name: r.first_name || r.name, keys: new Set(r.keys) } : null;
|
|
165
|
+
}, [W, L]), { data: a, isLoading: xe, refetch: R, isFetching: G } = ke({
|
|
159
166
|
queryKey: ["my-work"],
|
|
160
167
|
queryFn: async () => {
|
|
161
|
-
const r = await fetch(`${c}/my-work`, { headers:
|
|
168
|
+
const r = await fetch(`${c}/my-work`, { headers: x, credentials: k });
|
|
162
169
|
if (!r.ok) throw new Error("my-work failed");
|
|
163
170
|
return (await r.json()).data;
|
|
164
171
|
},
|
|
165
172
|
staleTime: 6e4
|
|
166
|
-
}),
|
|
173
|
+
}), X = B(0), T = B(null), ee = () => {
|
|
167
174
|
const r = () => {
|
|
168
|
-
|
|
169
|
-
}, s =
|
|
170
|
-
|
|
175
|
+
T.current = null, X.current = Date.now(), O(!1), _.invalidateQueries({ queryKey: ["my-work"] });
|
|
176
|
+
}, s = X.current + Re - Date.now();
|
|
177
|
+
T.current || (s <= 0 ? r() : T.current = setTimeout(r, s));
|
|
171
178
|
};
|
|
172
|
-
|
|
179
|
+
Te("my-work", ee, { debounceMs: 1500 }), $e("notification:new", ee, { debounceMs: 1500 }), z(
|
|
173
180
|
() => () => {
|
|
174
|
-
|
|
181
|
+
T.current && clearTimeout(T.current);
|
|
175
182
|
},
|
|
176
183
|
[]
|
|
177
184
|
);
|
|
178
|
-
const
|
|
185
|
+
const te = je([
|
|
179
186
|
...((a == null ? void 0 : a.owned) ?? []).map((r) => `o:${r.collection}:${r.item}`),
|
|
180
187
|
...((a == null ? void 0 : a.tasks) ?? []).map((r) => `t:${r.id}`),
|
|
181
188
|
...((a == null ? void 0 : a.team_tasks) ?? []).map((r) => `tt:${r.id}`),
|
|
182
189
|
...((a == null ? void 0 : a.requested) ?? []).map((r) => `r:${r.id}`),
|
|
183
|
-
...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`)
|
|
184
|
-
|
|
190
|
+
...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`),
|
|
191
|
+
...((a == null ? void 0 : a.proposals) ?? []).map((r) => `p:${r.id}`)
|
|
192
|
+
]), C = (r) => te.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", E = ne(() => {
|
|
185
193
|
const r = /* @__PURE__ */ new Set();
|
|
186
194
|
for (const s of (a == null ? void 0 : a.owned) ?? []) s.collection && r.add(s.collection);
|
|
187
195
|
return [...r];
|
|
188
196
|
}, [a]);
|
|
189
|
-
|
|
190
|
-
if (!(!
|
|
191
|
-
return
|
|
197
|
+
z(() => {
|
|
198
|
+
if (!(!U || E.length === 0))
|
|
199
|
+
return U.subscribeCollections(E, () => {
|
|
192
200
|
const r = Date.now();
|
|
193
|
-
r -
|
|
201
|
+
r - Y.current < 3e4 || (Y.current = r, O(!0));
|
|
194
202
|
});
|
|
195
|
-
}, [
|
|
196
|
-
const
|
|
203
|
+
}, [U, E]);
|
|
204
|
+
const re = K({
|
|
197
205
|
// A ticket closes through /support so its requester hears about it.
|
|
198
206
|
mutationFn: (r) => fetch(`${c}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
|
|
199
207
|
method: "PATCH",
|
|
200
|
-
headers: { ...
|
|
208
|
+
headers: { ...x, "content-type": "application/json" },
|
|
201
209
|
credentials: k,
|
|
202
210
|
body: JSON.stringify({ status: "done" })
|
|
203
211
|
}),
|
|
204
|
-
onSuccess: () =>
|
|
205
|
-
}),
|
|
212
|
+
onSuccess: () => _.invalidateQueries({ queryKey: ["my-work"] })
|
|
213
|
+
}), A = K({
|
|
206
214
|
mutationFn: async ({ id: r, action: s }) => {
|
|
207
|
-
const
|
|
215
|
+
const h = await fetch(`${c}/tasks/${r}/${s}`, {
|
|
208
216
|
method: "POST",
|
|
209
|
-
headers: { ...
|
|
217
|
+
headers: { ...x, "content-type": "application/json" },
|
|
210
218
|
credentials: k,
|
|
211
219
|
body: "{}"
|
|
212
|
-
}),
|
|
213
|
-
if (!
|
|
220
|
+
}), m = await h.json().catch(() => ({}));
|
|
221
|
+
if (!h.ok) throw new Error(m.error ?? "Failed");
|
|
214
222
|
return s;
|
|
215
223
|
},
|
|
216
224
|
onSuccess: (r) => {
|
|
217
|
-
|
|
225
|
+
P(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), _.invalidateQueries({ queryKey: ["my-work"] });
|
|
218
226
|
},
|
|
219
|
-
onError: (r) =>
|
|
220
|
-
}), [
|
|
221
|
-
|
|
222
|
-
if (!
|
|
223
|
-
const r = setTimeout(() =>
|
|
227
|
+
onError: (r) => P(Me(r, "Failed"))
|
|
228
|
+
}), [M, P] = $(null);
|
|
229
|
+
z(() => {
|
|
230
|
+
if (!M) return;
|
|
231
|
+
const r = setTimeout(() => P(null), 4e3);
|
|
224
232
|
return () => clearTimeout(r);
|
|
225
|
-
}, [
|
|
226
|
-
const
|
|
233
|
+
}, [M]);
|
|
234
|
+
const ae = K({
|
|
227
235
|
mutationFn: (r) => fetch(`${c}/notifications/mark-read`, {
|
|
228
236
|
method: "POST",
|
|
229
|
-
headers: { ...
|
|
237
|
+
headers: { ...x, "content-type": "application/json" },
|
|
230
238
|
credentials: k,
|
|
231
239
|
body: JSON.stringify({ ids: r })
|
|
232
240
|
}),
|
|
233
241
|
onSuccess: () => {
|
|
234
|
-
|
|
242
|
+
_.invalidateQueries({ queryKey: ["my-work"] }), _.invalidateQueries({ queryKey: ["notifications"] });
|
|
243
|
+
}
|
|
244
|
+
}), S = (r, s, h, m) => {
|
|
245
|
+
if (r && s && de(r)) {
|
|
246
|
+
const l = (m ?? []).filter((d) => d.collection && d.item && de(d.collection)).map((d) => ({ collection: d.collection, itemId: String(d.item) }));
|
|
247
|
+
if (v({ collection: r, itemId: String(s) }, h, { list: l }) !== "navigate")
|
|
248
|
+
return;
|
|
235
249
|
}
|
|
236
|
-
}), _ = (r, s) => {
|
|
237
250
|
const b = {
|
|
238
|
-
record: (
|
|
251
|
+
record: (l, d) => (u({ collection: l, itemId: d }), null),
|
|
239
252
|
...i
|
|
240
|
-
},
|
|
253
|
+
}, t = se(r, s, {
|
|
241
254
|
...b,
|
|
242
|
-
record: (
|
|
243
|
-
var
|
|
244
|
-
return ((
|
|
255
|
+
record: (l, d) => {
|
|
256
|
+
var f;
|
|
257
|
+
return ((f = i == null ? void 0 : i.record) == null ? void 0 : f.call(i, l, d)) ?? null;
|
|
245
258
|
}
|
|
246
259
|
});
|
|
247
|
-
if (
|
|
248
|
-
|
|
260
|
+
if (t) {
|
|
261
|
+
Oe(t, (l) => p == null ? void 0 : p(l));
|
|
249
262
|
return;
|
|
250
263
|
}
|
|
251
|
-
r && s && !/^nivaro_/i.test(r) && r !== "__chat__" &&
|
|
252
|
-
},
|
|
264
|
+
r && s && !/^nivaro_/i.test(r) && r !== "__chat__" && u({ collection: r, itemId: s });
|
|
265
|
+
}, ge = (r, s) => r && s && !/^nivaro_/i.test(r) && r !== "__chat__" ? !0 : !!se(r, s, {
|
|
253
266
|
record: () => null,
|
|
254
267
|
...i
|
|
255
268
|
});
|
|
256
|
-
return
|
|
257
|
-
/* @__PURE__ */ e(
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */ e(
|
|
269
|
+
return xe || !a ? /* @__PURE__ */ e(rt, { order: g.order, hidden: g.hidden }) : /* @__PURE__ */ n("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
|
|
270
|
+
/* @__PURE__ */ e(Ue, { onOpenPath: p }),
|
|
271
|
+
/* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
|
|
272
|
+
/* @__PURE__ */ n("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
|
|
273
|
+
/* @__PURE__ */ e(F, { label: "Waiting on you", value: a.counts.owned }),
|
|
261
274
|
/* @__PURE__ */ e(
|
|
262
|
-
|
|
275
|
+
F,
|
|
263
276
|
{
|
|
264
277
|
label: "SLA breached",
|
|
265
278
|
value: a.counts.owned_breached,
|
|
266
279
|
tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
|
|
267
280
|
}
|
|
268
281
|
),
|
|
269
|
-
/* @__PURE__ */ e(
|
|
270
|
-
/* @__PURE__ */ e(
|
|
282
|
+
/* @__PURE__ */ e(F, { label: "Open tasks", value: a.counts.tasks }),
|
|
283
|
+
/* @__PURE__ */ e(F, { label: "Unread notifications", value: a.counts.notifications })
|
|
271
284
|
] }),
|
|
272
|
-
|
|
285
|
+
me && /* @__PURE__ */ n(
|
|
273
286
|
"button",
|
|
274
287
|
{
|
|
275
288
|
type: "button",
|
|
276
289
|
onClick: () => {
|
|
277
|
-
|
|
290
|
+
O(!1), R();
|
|
278
291
|
},
|
|
279
292
|
className: "ml-3 inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
|
|
280
293
|
children: [
|
|
@@ -288,56 +301,56 @@ function pt({
|
|
|
288
301
|
{
|
|
289
302
|
type: "button",
|
|
290
303
|
onClick: () => {
|
|
291
|
-
|
|
304
|
+
O(!1), R();
|
|
292
305
|
},
|
|
293
|
-
disabled:
|
|
306
|
+
disabled: G,
|
|
294
307
|
className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted disabled:opacity-50 dark:border-border",
|
|
295
|
-
children:
|
|
308
|
+
children: G ? "Refreshing…" : "Refresh"
|
|
296
309
|
}
|
|
297
310
|
),
|
|
298
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ n("div", { className: "relative ml-2", children: [
|
|
299
312
|
/* @__PURE__ */ e(
|
|
300
313
|
"button",
|
|
301
314
|
{
|
|
302
315
|
type: "button",
|
|
303
|
-
onClick: () =>
|
|
316
|
+
onClick: () => he((r) => !r),
|
|
304
317
|
className: "rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted dark:border-border",
|
|
305
318
|
children: "Customize"
|
|
306
319
|
}
|
|
307
320
|
),
|
|
308
|
-
|
|
321
|
+
pe && /* @__PURE__ */ n("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
309
322
|
/* @__PURE__ */ e("p", { className: "px-1 pb-1.5 text-[11px] font-semibold text-slate-500", children: "Sections" }),
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
const
|
|
313
|
-
|
|
323
|
+
g.order.map((r, s) => {
|
|
324
|
+
const h = ce[r] ?? r, m = g.hidden.includes(r), b = (t) => {
|
|
325
|
+
const l = [...g.order], d = s + t;
|
|
326
|
+
d < 0 || d >= l.length || ([l[s], l[d]] = [l[d], l[s]], V({ ...g, order: l }));
|
|
314
327
|
};
|
|
315
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ n("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
|
|
316
329
|
/* @__PURE__ */ e(
|
|
317
330
|
"button",
|
|
318
331
|
{
|
|
319
332
|
type: "button",
|
|
320
|
-
onClick: () =>
|
|
321
|
-
...
|
|
322
|
-
hidden:
|
|
333
|
+
onClick: () => V({
|
|
334
|
+
...g,
|
|
335
|
+
hidden: m ? g.hidden.filter((t) => t !== r) : [...g.hidden, r]
|
|
323
336
|
}),
|
|
324
337
|
className: "flex h-4 w-4 items-center justify-center rounded border border-slate-300 text-[10px] dark:border-border",
|
|
325
|
-
title:
|
|
326
|
-
children:
|
|
338
|
+
title: m ? "Show section" : "Hide section",
|
|
339
|
+
children: m ? "" : "✓"
|
|
327
340
|
}
|
|
328
341
|
),
|
|
329
342
|
/* @__PURE__ */ e(
|
|
330
343
|
"span",
|
|
331
344
|
{
|
|
332
|
-
className: `min-w-0 flex-1 truncate text-[12px] ${
|
|
333
|
-
children:
|
|
345
|
+
className: `min-w-0 flex-1 truncate text-[12px] ${m ? "text-slate-400 line-through" : ""}`,
|
|
346
|
+
children: h
|
|
334
347
|
}
|
|
335
348
|
),
|
|
336
349
|
/* @__PURE__ */ e(
|
|
337
350
|
"button",
|
|
338
351
|
{
|
|
339
352
|
type: "button",
|
|
340
|
-
onClick: () =>
|
|
353
|
+
onClick: () => b(-1),
|
|
341
354
|
disabled: s === 0,
|
|
342
355
|
className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
|
|
343
356
|
children: "↑"
|
|
@@ -347,8 +360,8 @@ function pt({
|
|
|
347
360
|
"button",
|
|
348
361
|
{
|
|
349
362
|
type: "button",
|
|
350
|
-
onClick: () =>
|
|
351
|
-
disabled: s ===
|
|
363
|
+
onClick: () => b(1),
|
|
364
|
+
disabled: s === g.order.length - 1,
|
|
352
365
|
className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
|
|
353
366
|
children: "↓"
|
|
354
367
|
}
|
|
@@ -358,70 +371,94 @@ function pt({
|
|
|
358
371
|
] })
|
|
359
372
|
] })
|
|
360
373
|
] }),
|
|
361
|
-
|
|
374
|
+
M && /* @__PURE__ */ e(
|
|
362
375
|
"p",
|
|
363
376
|
{
|
|
364
377
|
className: "rounded-md border border-slate-200 bg-white px-3 py-2 text-[12px] dark:border-border dark:bg-card",
|
|
365
378
|
role: "status",
|
|
366
379
|
"data-my-work-task-note": !0,
|
|
367
|
-
children:
|
|
380
|
+
children: M
|
|
368
381
|
}
|
|
369
382
|
),
|
|
370
|
-
/* @__PURE__ */ e(
|
|
371
|
-
/* @__PURE__ */ e(
|
|
372
|
-
|
|
383
|
+
/* @__PURE__ */ e(Fe, { questions: a.questions ?? [] }),
|
|
384
|
+
/* @__PURE__ */ e(
|
|
385
|
+
Be,
|
|
386
|
+
{
|
|
387
|
+
showing: (w == null ? void 0 : w.userId) ?? null,
|
|
388
|
+
onShow: (r) => Z((s) => s === r.user_id ? null : r.user_id)
|
|
389
|
+
}
|
|
390
|
+
),
|
|
391
|
+
/* @__PURE__ */ e(He, { className: "mb-4" }),
|
|
392
|
+
/* @__PURE__ */ e(ze, { className: "mb-4" }),
|
|
373
393
|
(() => {
|
|
374
394
|
const r = {
|
|
375
395
|
records: () => {
|
|
376
|
-
const t = a.owned.filter((
|
|
377
|
-
var
|
|
378
|
-
return ((
|
|
379
|
-
}).length,
|
|
380
|
-
var
|
|
381
|
-
return ((
|
|
382
|
-
}) : a.owned,
|
|
396
|
+
const t = a.owned.filter((o) => oe(o.sla)).length, l = a.owned.filter((o) => {
|
|
397
|
+
var N;
|
|
398
|
+
return ((N = o.sla) == null ? void 0 : N.status) === "breached";
|
|
399
|
+
}).length, d = I === "soon" ? a.owned.filter((o) => oe(o.sla)) : I === "breached" ? a.owned.filter((o) => {
|
|
400
|
+
var N;
|
|
401
|
+
return ((N = o.sla) == null ? void 0 : N.status) === "breached";
|
|
402
|
+
}) : a.owned, f = w ? d.filter((o) => w.keys.has(`${o.collection}:${o.item}`)) : d, j = [
|
|
383
403
|
{ key: "all", label: `All (${a.owned.length})` },
|
|
384
404
|
{ key: "soon", label: `Warning within 24h (${t})` },
|
|
385
|
-
{ key: "breached", label: `Breached (${
|
|
405
|
+
{ key: "breached", label: `Breached (${l})` }
|
|
386
406
|
];
|
|
387
|
-
return /* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
407
|
+
return /* @__PURE__ */ n("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
408
|
+
/* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
389
409
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Waiting on you" }),
|
|
390
410
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
|
|
391
411
|
] }),
|
|
392
|
-
a.owned.length > 0 && /* @__PURE__ */
|
|
393
|
-
"
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
412
|
+
a.owned.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1 border-b border-slate-100 px-4 py-2 dark:border-border/60", children: [
|
|
413
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 rounded-lg bg-slate-100 p-1 dark:bg-muted", children: j.map((o) => /* @__PURE__ */ e(
|
|
414
|
+
"button",
|
|
415
|
+
{
|
|
416
|
+
type: "button",
|
|
417
|
+
"data-my-work-sla-filter": o.key,
|
|
418
|
+
"aria-pressed": I === o.key,
|
|
419
|
+
onClick: () => be(o.key),
|
|
420
|
+
className: [
|
|
421
|
+
"rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",
|
|
422
|
+
I === o.key ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
|
|
423
|
+
].join(" "),
|
|
424
|
+
children: o.label
|
|
425
|
+
},
|
|
426
|
+
o.key
|
|
427
|
+
)) }),
|
|
428
|
+
w && /* @__PURE__ */ n(
|
|
429
|
+
"button",
|
|
430
|
+
{
|
|
431
|
+
type: "button",
|
|
432
|
+
"data-my-work-cover-filter": !0,
|
|
433
|
+
onClick: () => Z(null),
|
|
434
|
+
"aria-label": `Show all records, not only ${w.name}'s`,
|
|
435
|
+
className: "ml-1 inline-flex items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-2.5 py-1 text-[11px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
|
|
436
|
+
children: [
|
|
437
|
+
w.name,
|
|
438
|
+
"'s records",
|
|
439
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-[12px] leading-none", children: "×" })
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
)
|
|
443
|
+
] }),
|
|
444
|
+
f.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: f.map((o) => {
|
|
445
|
+
var N;
|
|
409
446
|
return /* @__PURE__ */ e(
|
|
410
447
|
"li",
|
|
411
448
|
{
|
|
412
|
-
className:
|
|
413
|
-
"data-my-work-fresh":
|
|
414
|
-
children: /* @__PURE__ */
|
|
449
|
+
className: C(`o:${o.collection}:${o.item}`),
|
|
450
|
+
"data-my-work-fresh": te.has(`o:${o.collection}:${o.item}`) || void 0,
|
|
451
|
+
children: /* @__PURE__ */ n(
|
|
415
452
|
"button",
|
|
416
453
|
{
|
|
417
454
|
type: "button",
|
|
418
|
-
onClick: () =>
|
|
419
|
-
...
|
|
455
|
+
onClick: (Q) => S(o.collection, o.item, Q, f),
|
|
456
|
+
...H.record(o.collection, o.item),
|
|
420
457
|
className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-muted",
|
|
421
458
|
children: [
|
|
422
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children:
|
|
423
|
-
/* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children:
|
|
424
|
-
((
|
|
459
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: o.label }),
|
|
460
|
+
/* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: o.collection.replace(/_/g, " ") }),
|
|
461
|
+
((N = o.flags) == null ? void 0 : N.some((Q) => /^on hold$/i.test(Q.name.trim()))) && /* @__PURE__ */ e(
|
|
425
462
|
"span",
|
|
426
463
|
{
|
|
427
464
|
"data-my-work-hold": !0,
|
|
@@ -429,54 +466,91 @@ function pt({
|
|
|
429
466
|
children: "On hold"
|
|
430
467
|
}
|
|
431
468
|
),
|
|
432
|
-
/* @__PURE__ */ e(
|
|
433
|
-
/* @__PURE__ */ e(
|
|
469
|
+
/* @__PURE__ */ e(tt, { state: o.state, color: o.state_color }),
|
|
470
|
+
/* @__PURE__ */ e(et, { sla: o.sla })
|
|
434
471
|
]
|
|
435
472
|
}
|
|
436
473
|
)
|
|
437
474
|
},
|
|
438
|
-
`${
|
|
475
|
+
`${o.collection}:${o.item}`
|
|
439
476
|
);
|
|
440
477
|
}) })
|
|
441
478
|
] });
|
|
442
479
|
},
|
|
443
|
-
|
|
480
|
+
// Idea 6 — only when something waits on this person's decision.
|
|
481
|
+
proposals: () => (a.proposals ?? []).length === 0 ? null : /* @__PURE__ */ n(
|
|
482
|
+
"section",
|
|
483
|
+
{
|
|
484
|
+
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
485
|
+
"data-my-work-proposals": !0,
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
488
|
+
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Changes to review" }),
|
|
489
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Proposed changes on locked records — open one to compare old and new and accept or decline it." })
|
|
490
|
+
] }),
|
|
491
|
+
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.proposals ?? []).map((t) => /* @__PURE__ */ e("li", { className: C(`p:${t.id}`), "data-my-work-proposal": t.id, children: /* @__PURE__ */ n(
|
|
492
|
+
"button",
|
|
493
|
+
{
|
|
494
|
+
type: "button",
|
|
495
|
+
onClick: () => S(t.collection, t.item),
|
|
496
|
+
...H.record(t.collection, t.item),
|
|
497
|
+
className: "flex w-full items-start gap-2.5 px-4 py-2 text-left hover:bg-muted",
|
|
498
|
+
children: [
|
|
499
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
|
|
500
|
+
/* @__PURE__ */ n("span", { className: "flex flex-wrap items-baseline gap-x-2", children: [
|
|
501
|
+
/* @__PURE__ */ e("span", { className: "text-[12.5px] font-medium", children: t.item_label }),
|
|
502
|
+
/* @__PURE__ */ e("span", { className: "text-[11.5px] text-muted-foreground", children: t.fields.join(", ") })
|
|
503
|
+
] }),
|
|
504
|
+
/* @__PURE__ */ n("span", { className: "mt-0.5 block truncate text-[11.5px] text-slate-500 dark:text-slate-400", children: [
|
|
505
|
+
t.created_by_name ?? "Someone",
|
|
506
|
+
": ",
|
|
507
|
+
t.reason
|
|
508
|
+
] })
|
|
509
|
+
] }),
|
|
510
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 pt-0.5 text-[11px] text-muted-foreground", children: qe(t.created_at) })
|
|
511
|
+
]
|
|
512
|
+
}
|
|
513
|
+
) }, t.id)) })
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
),
|
|
517
|
+
tasks: () => /* @__PURE__ */ n("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
444
518
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "My tasks" }) }),
|
|
445
|
-
a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((t) => /* @__PURE__ */
|
|
519
|
+
a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((t) => /* @__PURE__ */ n(
|
|
446
520
|
"li",
|
|
447
521
|
{
|
|
448
|
-
className:
|
|
522
|
+
className: D("flex items-center gap-2.5 px-4 py-2", C(`t:${t.id}`)),
|
|
449
523
|
children: [
|
|
450
524
|
/* @__PURE__ */ e(
|
|
451
525
|
"button",
|
|
452
526
|
{
|
|
453
527
|
type: "button",
|
|
454
528
|
title: "Mark done",
|
|
455
|
-
onClick: () =>
|
|
456
|
-
disabled:
|
|
529
|
+
onClick: () => re.mutate(t),
|
|
530
|
+
disabled: re.isPending,
|
|
457
531
|
className: "flex h-4 w-4 shrink-0 items-center justify-center rounded border border-slate-300 text-transparent hover:border-emerald-500 hover:text-emerald-500 dark:border-border",
|
|
458
532
|
children: "✓"
|
|
459
533
|
}
|
|
460
534
|
),
|
|
461
535
|
t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
|
|
462
536
|
t.kind === "support" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-slate-100 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-slate-600 dark:bg-white/10 dark:text-slate-300", children: "support" }),
|
|
463
|
-
t.agent_assignee && /* @__PURE__ */
|
|
537
|
+
t.agent_assignee && /* @__PURE__ */ n(
|
|
464
538
|
"span",
|
|
465
539
|
{
|
|
466
540
|
className: "inline-flex shrink-0 items-center gap-1 rounded bg-nvr-cyan/10 px-1 py-px text-[10px] font-medium text-[#0e7490] dark:text-[#67e8f9]",
|
|
467
541
|
"data-tip": `Handed to ${t.agent_name ?? "your agent"} — it picks this up through My Work`,
|
|
468
542
|
"data-my-work-agent-task": t.id,
|
|
469
543
|
children: [
|
|
470
|
-
/* @__PURE__ */ e(
|
|
544
|
+
/* @__PURE__ */ e(we, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
471
545
|
t.agent_name ?? "Agent"
|
|
472
546
|
]
|
|
473
547
|
}
|
|
474
548
|
),
|
|
475
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ n(
|
|
476
550
|
"button",
|
|
477
551
|
{
|
|
478
552
|
type: "button",
|
|
479
|
-
onClick: () => t.kind === "support" ?
|
|
553
|
+
onClick: (l) => t.kind === "support" ? J(t.id) : S(t.collection, t.item, l),
|
|
480
554
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
481
555
|
children: [
|
|
482
556
|
t.title,
|
|
@@ -485,18 +559,18 @@ function pt({
|
|
|
485
559
|
}
|
|
486
560
|
),
|
|
487
561
|
/* @__PURE__ */ e(
|
|
488
|
-
|
|
562
|
+
We,
|
|
489
563
|
{
|
|
490
564
|
task: t,
|
|
491
565
|
isAssignee: !0,
|
|
492
566
|
compact: !0,
|
|
493
|
-
onTaskChanged: () => void
|
|
567
|
+
onTaskChanged: () => void _.invalidateQueries({ queryKey: ["my-work"] })
|
|
494
568
|
}
|
|
495
569
|
),
|
|
496
570
|
t.due_date && /* @__PURE__ */ e(
|
|
497
571
|
"span",
|
|
498
572
|
{
|
|
499
|
-
className: `text-[11px] tabular-nums ${
|
|
573
|
+
className: `text-[11px] tabular-nums ${q(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
500
574
|
children: new Date(t.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
|
|
501
575
|
}
|
|
502
576
|
)
|
|
@@ -505,28 +579,28 @@ function pt({
|
|
|
505
579
|
t.id
|
|
506
580
|
)) })
|
|
507
581
|
] }),
|
|
508
|
-
team: () => !a.on_a_team && !(a.team_tasks ?? []).length ? null : /* @__PURE__ */
|
|
582
|
+
team: () => !a.on_a_team && !(a.team_tasks ?? []).length ? null : /* @__PURE__ */ n(
|
|
509
583
|
"section",
|
|
510
584
|
{
|
|
511
585
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
512
586
|
"data-my-work-team": !0,
|
|
513
587
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
515
589
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Team tasks" }),
|
|
516
590
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Waiting with a team you are on — pick one up to make it yours." })
|
|
517
591
|
] }),
|
|
518
|
-
(a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((t) => /* @__PURE__ */
|
|
592
|
+
(a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((t) => /* @__PURE__ */ n(
|
|
519
593
|
"li",
|
|
520
594
|
{
|
|
521
|
-
className:
|
|
595
|
+
className: D("flex items-center gap-2.5 px-4 py-2", C(`tt:${t.id}`)),
|
|
522
596
|
"data-my-work-team-task": t.id,
|
|
523
597
|
children: [
|
|
524
598
|
t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
|
|
525
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ n(
|
|
526
600
|
"button",
|
|
527
601
|
{
|
|
528
602
|
type: "button",
|
|
529
|
-
onClick: () =>
|
|
603
|
+
onClick: (l) => S(t.collection, t.item, l),
|
|
530
604
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
531
605
|
children: [
|
|
532
606
|
t.title,
|
|
@@ -537,7 +611,7 @@ function pt({
|
|
|
537
611
|
t.due_date && /* @__PURE__ */ e(
|
|
538
612
|
"span",
|
|
539
613
|
{
|
|
540
|
-
className: `text-[11px] tabular-nums ${
|
|
614
|
+
className: `text-[11px] tabular-nums ${q(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
541
615
|
children: new Date(t.due_date).toLocaleDateString(void 0, {
|
|
542
616
|
timeZone: "UTC"
|
|
543
617
|
})
|
|
@@ -547,8 +621,8 @@ function pt({
|
|
|
547
621
|
"button",
|
|
548
622
|
{
|
|
549
623
|
type: "button",
|
|
550
|
-
onClick: () =>
|
|
551
|
-
disabled:
|
|
624
|
+
onClick: () => A.mutate({ id: t.id, action: "claim" }),
|
|
625
|
+
disabled: A.isPending,
|
|
552
626
|
className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted dark:border-border",
|
|
553
627
|
"data-my-work-claim": t.id,
|
|
554
628
|
children: "Pick it up"
|
|
@@ -562,110 +636,110 @@ function pt({
|
|
|
562
636
|
}
|
|
563
637
|
),
|
|
564
638
|
waiting: () => {
|
|
565
|
-
const t = a.requested ?? [],
|
|
566
|
-
return /* @__PURE__ */
|
|
639
|
+
const t = a.requested ?? [], l = t.filter((d) => q(d.due_date)).length;
|
|
640
|
+
return /* @__PURE__ */ n(
|
|
567
641
|
"section",
|
|
568
642
|
{
|
|
569
643
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
570
644
|
"data-my-work-waiting": !0,
|
|
571
645
|
children: [
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
647
|
+
/* @__PURE__ */ n("h2", { className: "text-[13px] font-medium", children: [
|
|
574
648
|
"Waiting on others",
|
|
575
|
-
|
|
576
|
-
|
|
649
|
+
l > 0 && /* @__PURE__ */ n("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
|
|
650
|
+
l,
|
|
577
651
|
" overdue"
|
|
578
652
|
] })
|
|
579
653
|
] }),
|
|
580
654
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
|
|
581
655
|
] }),
|
|
582
|
-
t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((
|
|
583
|
-
const
|
|
584
|
-
return /* @__PURE__ */
|
|
656
|
+
t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((d) => {
|
|
657
|
+
const f = q(d.due_date), j = !!d.nudged_at && Date.now() - new Date(d.nudged_at).getTime() < 20 * 36e5;
|
|
658
|
+
return /* @__PURE__ */ n(
|
|
585
659
|
"li",
|
|
586
660
|
{
|
|
587
|
-
className:
|
|
588
|
-
"data-my-work-requested":
|
|
661
|
+
className: D("flex items-center gap-2.5 px-4 py-2", C(`r:${d.id}`)),
|
|
662
|
+
"data-my-work-requested": d.id,
|
|
589
663
|
children: [
|
|
590
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ n(
|
|
591
665
|
"button",
|
|
592
666
|
{
|
|
593
667
|
type: "button",
|
|
594
|
-
onClick: () =>
|
|
668
|
+
onClick: (o) => d.kind === "support" ? J(d.id) : S(d.collection, d.item, o),
|
|
595
669
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
596
670
|
children: [
|
|
597
|
-
|
|
671
|
+
d.title,
|
|
598
672
|
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [
|
|
599
|
-
|
|
600
|
-
|
|
673
|
+
d.assignee_name ?? (d.team_name ? `${d.team_name} team` : "Unassigned"),
|
|
674
|
+
d.item_label
|
|
601
675
|
].filter(Boolean).join(" · ") })
|
|
602
676
|
]
|
|
603
677
|
}
|
|
604
678
|
),
|
|
605
|
-
|
|
679
|
+
d.due_date && /* @__PURE__ */ n(
|
|
606
680
|
"span",
|
|
607
681
|
{
|
|
608
|
-
className: `text-[11px] tabular-nums ${
|
|
682
|
+
className: `text-[11px] tabular-nums ${f ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
609
683
|
children: [
|
|
610
|
-
|
|
611
|
-
new Date(
|
|
684
|
+
f ? "Overdue · " : "",
|
|
685
|
+
new Date(d.due_date).toLocaleDateString(void 0, {
|
|
612
686
|
timeZone: "UTC"
|
|
613
687
|
})
|
|
614
688
|
]
|
|
615
689
|
}
|
|
616
690
|
),
|
|
617
|
-
|
|
691
|
+
d.kind !== "support" && /* @__PURE__ */ e(
|
|
618
692
|
"button",
|
|
619
693
|
{
|
|
620
694
|
type: "button",
|
|
621
|
-
onClick: () =>
|
|
622
|
-
disabled:
|
|
623
|
-
title:
|
|
695
|
+
onClick: () => A.mutate({ id: d.id, action: "nudge" }),
|
|
696
|
+
disabled: A.isPending || j,
|
|
697
|
+
title: j ? "Already nudged today" : "Send a reminder",
|
|
624
698
|
className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted disabled:opacity-50 dark:border-border",
|
|
625
|
-
"data-my-work-nudge":
|
|
626
|
-
children:
|
|
699
|
+
"data-my-work-nudge": d.id,
|
|
700
|
+
children: j ? "Nudged" : "Nudge"
|
|
627
701
|
}
|
|
628
702
|
)
|
|
629
703
|
]
|
|
630
704
|
},
|
|
631
|
-
|
|
705
|
+
d.id
|
|
632
706
|
);
|
|
633
707
|
}) })
|
|
634
708
|
]
|
|
635
709
|
}
|
|
636
710
|
);
|
|
637
711
|
},
|
|
638
|
-
notifications: () => /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
712
|
+
notifications: () => /* @__PURE__ */ n("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
713
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
640
714
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Unread notifications" }),
|
|
641
715
|
a.notifications.length > 0 && /* @__PURE__ */ e(
|
|
642
716
|
"button",
|
|
643
717
|
{
|
|
644
718
|
type: "button",
|
|
645
|
-
onClick: () =>
|
|
719
|
+
onClick: () => ae.mutate(a.notifications.map((t) => t.id)),
|
|
646
720
|
className: "text-[11px] text-[#00a5cc] hover:underline",
|
|
647
721
|
children: "Mark all read"
|
|
648
722
|
}
|
|
649
723
|
)
|
|
650
724
|
] }),
|
|
651
|
-
a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((t) => /* @__PURE__ */
|
|
725
|
+
a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((t) => /* @__PURE__ */ n(
|
|
652
726
|
"li",
|
|
653
727
|
{
|
|
654
|
-
className:
|
|
728
|
+
className: D("flex items-start gap-2.5 px-4 py-2", C(`n:${t.id}`)),
|
|
655
729
|
children: [
|
|
656
730
|
/* @__PURE__ */ e(
|
|
657
|
-
|
|
731
|
+
Ze,
|
|
658
732
|
{
|
|
659
733
|
userId: t.sender,
|
|
660
734
|
className: "mt-0.5 h-5 w-5",
|
|
661
735
|
fallback: /* @__PURE__ */ e("span", { className: "mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-slate-100 text-[9px] font-semibold text-slate-500 dark:bg-muted" })
|
|
662
736
|
}
|
|
663
737
|
),
|
|
664
|
-
|
|
738
|
+
ge(t.collection, t.item) ? /* @__PURE__ */ n(
|
|
665
739
|
"button",
|
|
666
740
|
{
|
|
667
741
|
type: "button",
|
|
668
|
-
onClick: () =>
|
|
742
|
+
onClick: (l) => S(t.collection, t.item, l, a.notifications),
|
|
669
743
|
className: "min-w-0 flex-1 cursor-pointer text-left hover:opacity-80",
|
|
670
744
|
children: [
|
|
671
745
|
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
|
|
@@ -674,7 +748,7 @@ function pt({
|
|
|
674
748
|
}
|
|
675
749
|
) : (
|
|
676
750
|
// Nowhere to open: plain text, never a button that does nothing.
|
|
677
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", "data-notification-plain": !0, children: [
|
|
678
752
|
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
|
|
679
753
|
t.message && /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-muted-foreground", children: t.message })
|
|
680
754
|
] })
|
|
@@ -685,9 +759,9 @@ function pt({
|
|
|
685
759
|
type: "button",
|
|
686
760
|
"aria-label": "Mark read",
|
|
687
761
|
"data-tip": "Mark read",
|
|
688
|
-
onClick: () =>
|
|
762
|
+
onClick: () => ae.mutate([t.id]),
|
|
689
763
|
className: "mt-0.5 shrink-0 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
690
|
-
children: /* @__PURE__ */ e(
|
|
764
|
+
children: /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
|
|
691
765
|
}
|
|
692
766
|
)
|
|
693
767
|
]
|
|
@@ -696,45 +770,45 @@ function pt({
|
|
|
696
770
|
)) })
|
|
697
771
|
] })
|
|
698
772
|
}, s = new Map(
|
|
699
|
-
|
|
700
|
-
),
|
|
701
|
-
let
|
|
702
|
-
for (;
|
|
703
|
-
const t = b
|
|
704
|
-
if (t
|
|
705
|
-
|
|
773
|
+
g.order.filter((t) => !g.hidden.includes(t) && r[t]).map((t) => [t, r[t]()]).filter(([, t]) => t != null)
|
|
774
|
+
), h = [...s.keys()], m = [];
|
|
775
|
+
let b = 0;
|
|
776
|
+
for (; b < h.length; ) {
|
|
777
|
+
const t = h[b];
|
|
778
|
+
if (le.has(t))
|
|
779
|
+
m.push(/* @__PURE__ */ e("div", { children: s.get(t) }, t)), b++;
|
|
706
780
|
else {
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children:
|
|
710
|
-
),
|
|
781
|
+
const l = [t];
|
|
782
|
+
b + 1 < h.length && !le.has(h[b + 1]) && l.push(h[b + 1]), m.push(
|
|
783
|
+
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: l.map((d) => /* @__PURE__ */ e("div", { children: s.get(d) }, d)) }, l.join("+"))
|
|
784
|
+
), b += l.length;
|
|
711
785
|
}
|
|
712
786
|
}
|
|
713
|
-
return
|
|
787
|
+
return m;
|
|
714
788
|
})(),
|
|
715
|
-
/* @__PURE__ */ e(
|
|
789
|
+
/* @__PURE__ */ e(at, {})
|
|
716
790
|
] });
|
|
717
791
|
}
|
|
718
|
-
function
|
|
719
|
-
const i =
|
|
720
|
-
return !i ||
|
|
792
|
+
function at() {
|
|
793
|
+
const i = Pe(), { rooms: p } = Qe(i);
|
|
794
|
+
return !i || p.length === 0 ? null : /* @__PURE__ */ n(
|
|
721
795
|
"section",
|
|
722
796
|
{
|
|
723
797
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
724
798
|
"data-my-work-chat": !0,
|
|
725
799
|
children: [
|
|
726
800
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Record conversations" }) }),
|
|
727
|
-
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children:
|
|
801
|
+
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: p.map((c) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n(
|
|
728
802
|
"button",
|
|
729
803
|
{
|
|
730
804
|
type: "button",
|
|
731
|
-
onClick: () =>
|
|
805
|
+
onClick: () => Ee(c.room, c.label),
|
|
732
806
|
className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-muted/40",
|
|
733
807
|
"data-my-work-chat-room": c.room,
|
|
734
808
|
children: [
|
|
735
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
|
|
736
810
|
/* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium", children: c.label }),
|
|
737
|
-
c.last_message && /* @__PURE__ */
|
|
811
|
+
c.last_message && /* @__PURE__ */ n("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
|
|
738
812
|
c.last_message.sender_name ? `${c.last_message.sender_name}: ` : "",
|
|
739
813
|
c.last_message.message.replace(/@\[([^\]]+)\]/g, "@$1")
|
|
740
814
|
] })
|
|
@@ -749,5 +823,5 @@ function Qe() {
|
|
|
749
823
|
);
|
|
750
824
|
}
|
|
751
825
|
export {
|
|
752
|
-
|
|
826
|
+
Ot as MyWorkView
|
|
753
827
|
};
|