@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.
Files changed (285) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1727 -19
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4088 -3592
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +544 -504
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/PageRenderer.js +636 -599
  39. package/dist/shared/components/PresenceDot.js +21 -0
  40. package/dist/shared/components/ProfileView.js +656 -536
  41. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  42. package/dist/shared/components/RecentRecordsRail.js +51 -48
  43. package/dist/shared/components/RecordCompare.js +241 -150
  44. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  45. package/dist/shared/components/RecordGridEditor.js +350 -311
  46. package/dist/shared/components/RecordHoverCard.js +147 -0
  47. package/dist/shared/components/RecordPeekHost.js +111 -0
  48. package/dist/shared/components/RecordReadView.js +414 -412
  49. package/dist/shared/components/RelativeTime.js +16 -0
  50. package/dist/shared/components/ReportView.js +1396 -1304
  51. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  52. package/dist/shared/components/TabCountHost.js +10 -0
  53. package/dist/shared/components/TickerNumber.js +19 -18
  54. package/dist/shared/components/TipLayer.js +70 -58
  55. package/dist/shared/components/WidgetImageMenu.js +59 -0
  56. package/dist/shared/components/WidgetSlot.js +571 -524
  57. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  58. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  59. package/dist/shared/components/cbv/approval-changed.js +20 -0
  60. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  61. package/dist/shared/components/cbv/column-totals.js +75 -67
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/api.js +161 -117
  79. package/dist/shared/components/integrations/console/tone.js +15 -12
  80. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  81. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  82. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  83. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  84. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  85. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  86. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  87. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  88. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  89. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  90. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  91. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  92. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  93. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  94. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  95. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  96. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  97. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  98. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  99. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  100. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  101. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  102. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  103. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  104. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  105. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  106. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  107. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  108. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  109. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  110. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  111. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  112. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  113. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  114. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  115. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  116. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  117. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  118. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  119. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  120. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  121. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  122. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  123. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  124. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  125. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  126. package/dist/shared/components/item-edit/file-live.js +77 -0
  127. package/dist/shared/components/item-edit/file-processing.js +87 -0
  128. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  129. package/dist/shared/components/item-edit/live-related.js +23 -0
  130. package/dist/shared/components/item-edit/live-title.js +66 -0
  131. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  132. package/dist/shared/components/item-edit/removed-line.js +58 -0
  133. package/dist/shared/components/item-edit/render-stability.js +70 -59
  134. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  135. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  136. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  137. package/dist/shared/components/list/InlineEdit.js +504 -208
  138. package/dist/shared/components/list/ListViewers.js +81 -0
  139. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  140. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  141. package/dist/shared/components/merge/merge-values.js +110 -0
  142. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  143. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  144. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  145. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  146. package/dist/shared/components/notifications/bundles.js +21 -19
  147. package/dist/shared/components/notifications/resolved-line.js +25 -0
  148. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  149. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  150. package/dist/shared/components/panels/AlertBanners.js +132 -0
  151. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  152. package/dist/shared/components/panels/BranchLanes.js +82 -54
  153. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  154. package/dist/shared/components/panels/CommentImages.js +219 -0
  155. package/dist/shared/components/panels/CommentPanel.js +649 -530
  156. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  157. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  158. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  159. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  160. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  161. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  162. package/dist/shared/components/panels/SlaClock.js +130 -99
  163. package/dist/shared/components/panels/TaskPanel.js +308 -287
  164. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  165. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  166. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  167. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  168. package/dist/shared/components/profile/AgentNameField.js +141 -0
  169. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  170. package/dist/shared/components/profile/PersonAccess.js +398 -330
  171. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  172. package/dist/shared/components/profile/PersonProfile.js +81 -73
  173. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  174. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  175. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  176. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  177. package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
  178. package/dist/shared/components/queue/queue-totals.js +92 -0
  179. package/dist/shared/components/queue/worklist-helpers.js +18 -14
  180. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  181. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  182. package/dist/shared/components/support/ReportProblem.js +1 -0
  183. package/dist/shared/components/support/ScreenShare.js +554 -0
  184. package/dist/shared/components/support/SupportView.js +160 -129
  185. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  186. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  187. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  188. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  189. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  190. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  191. package/dist/shared/lib/activity-sentence.js +87 -75
  192. package/dist/shared/lib/agent-presence.js +46 -0
  193. package/dist/shared/lib/approval-progress.js +49 -0
  194. package/dist/shared/lib/attention-prefs.js +27 -0
  195. package/dist/shared/lib/cell-locks.js +56 -0
  196. package/dist/shared/lib/co-edit.js +166 -0
  197. package/dist/shared/lib/coedit-registry.js +44 -0
  198. package/dist/shared/lib/comment-awareness.js +124 -0
  199. package/dist/shared/lib/comment-images.js +45 -0
  200. package/dist/shared/lib/config-watch.js +94 -0
  201. package/dist/shared/lib/copy-rules.js +65 -0
  202. package/dist/shared/lib/count-step.js +30 -0
  203. package/dist/shared/lib/deadline-ticker.js +68 -0
  204. package/dist/shared/lib/derived-causes.js +115 -0
  205. package/dist/shared/lib/draft-store.js +114 -85
  206. package/dist/shared/lib/error-hints.js +1 -0
  207. package/dist/shared/lib/field-merge.js +126 -0
  208. package/dist/shared/lib/filter-sentence.js +10 -10
  209. package/dist/shared/lib/focus-mode.js +16 -12
  210. package/dist/shared/lib/grid-cursors.js +77 -0
  211. package/dist/shared/lib/grid-presence.js +182 -0
  212. package/dist/shared/lib/idle-reload.js +100 -73
  213. package/dist/shared/lib/in-step.js +45 -0
  214. package/dist/shared/lib/integration-chip.js +19 -18
  215. package/dist/shared/lib/line-locks.js +141 -0
  216. package/dist/shared/lib/line-split.js +41 -0
  217. package/dist/shared/lib/linked-changes.js +150 -0
  218. package/dist/shared/lib/list-link.js +56 -50
  219. package/dist/shared/lib/list-return.js +231 -0
  220. package/dist/shared/lib/list-viewers.js +52 -0
  221. package/dist/shared/lib/live-announcer.js +86 -0
  222. package/dist/shared/lib/live-counts.js +85 -0
  223. package/dist/shared/lib/live-data-changed.js +108 -0
  224. package/dist/shared/lib/live-deltas.js +81 -0
  225. package/dist/shared/lib/live-findings.js +113 -0
  226. package/dist/shared/lib/live-groups.js +122 -0
  227. package/dist/shared/lib/live-link-labels.js +162 -0
  228. package/dist/shared/lib/live-list-flow.js +334 -0
  229. package/dist/shared/lib/live-list.js +143 -129
  230. package/dist/shared/lib/live-moves.js +51 -0
  231. package/dist/shared/lib/live-ops.js +26 -26
  232. package/dist/shared/lib/live-pickers.js +7 -0
  233. package/dist/shared/lib/live-preference.js +184 -0
  234. package/dist/shared/lib/live-queries.js +226 -181
  235. package/dist/shared/lib/live-screen.js +333 -0
  236. package/dist/shared/lib/live-search.js +108 -0
  237. package/dist/shared/lib/live-seen.js +35 -0
  238. package/dist/shared/lib/live-views.js +100 -0
  239. package/dist/shared/lib/live.js +159 -133
  240. package/dist/shared/lib/missed-updates.js +198 -0
  241. package/dist/shared/lib/newer-file.js +56 -0
  242. package/dist/shared/lib/notification-sound.js +42 -20
  243. package/dist/shared/lib/own-writes.js +59 -41
  244. package/dist/shared/lib/picker-badges.js +94 -0
  245. package/dist/shared/lib/presence-signals.js +131 -84
  246. package/dist/shared/lib/realtime.js +49 -24
  247. package/dist/shared/lib/record-gaps.js +85 -0
  248. package/dist/shared/lib/record-outbox.js +369 -222
  249. package/dist/shared/lib/record-peek.js +75 -0
  250. package/dist/shared/lib/record-tabs.js +92 -72
  251. package/dist/shared/lib/relative-ticker.js +42 -0
  252. package/dist/shared/lib/request-gate.js +119 -119
  253. package/dist/shared/lib/rollup-recalc.js +107 -0
  254. package/dist/shared/lib/room-gaps.js +40 -36
  255. package/dist/shared/lib/rum.js +137 -87
  256. package/dist/shared/lib/save-progress.js +20 -0
  257. package/dist/shared/lib/scheduled-countdown.js +67 -0
  258. package/dist/shared/lib/screen-refresh.js +160 -0
  259. package/dist/shared/lib/screen-share.js +234 -0
  260. package/dist/shared/lib/seen-since.js +74 -0
  261. package/dist/shared/lib/selection-watch.js +205 -0
  262. package/dist/shared/lib/send-status.js +132 -0
  263. package/dist/shared/lib/send-view.js +23 -0
  264. package/dist/shared/lib/socket-liveness.js +155 -0
  265. package/dist/shared/lib/socket-realtime.js +168 -140
  266. package/dist/shared/lib/state-census.js +53 -0
  267. package/dist/shared/lib/summary-mode.js +61 -39
  268. package/dist/shared/lib/tab-attention.js +143 -32
  269. package/dist/shared/lib/table-density.js +64 -0
  270. package/dist/shared/lib/track-travel.js +40 -0
  271. package/dist/shared/lib/unseen-changes.js +68 -0
  272. package/dist/shared/lib/upload-file.js +33 -0
  273. package/dist/shared/lib/upload-presence.js +127 -0
  274. package/dist/shared/lib/urgent-chime.js +65 -0
  275. package/dist/shared/lib/use-online-users.js +32 -11
  276. package/dist/shared/lib/user-sync.js +155 -39
  277. package/dist/shared/lib/waiting-count.js +44 -0
  278. package/dist/shared/lib/watch-desktop.js +83 -0
  279. package/dist/shared/lib/watch-list.js +447 -0
  280. package/dist/shared/lib/widget-image-render.js +64 -0
  281. package/dist/shared/lib/widget-image.js +111 -0
  282. package/dist/shared/lib/worker-socket.js +130 -104
  283. package/dist/shared/lib/write-to-screen.js +133 -0
  284. package/package.json +1 -1
  285. package/styles.css +49 -1
@@ -0,0 +1,46 @@
1
+ import { jsxs as b, jsx as r } from "react/jsx-runtime";
2
+ import { Binoculars as p } from "lucide-react";
3
+ import { useWatchUi as f, useWatchActions as m, watchUi as l } from "../../lib/watch-list.js";
4
+ function $({
5
+ variant: s = "bar",
6
+ className: c = "",
7
+ ringClass: h
8
+ }) {
9
+ const t = f(), { prefs: d, setDock: u } = m();
10
+ if (!t.mounted) return null;
11
+ const a = d.dock.state, e = t.wide && a === "open", w = t.changed + t.unreadMentions, g = t.wide && a === "minimized", i = w > 0 && !(e || g || !t.wide && t.sheet), o = e ? "Close watch list" : "Open watch list", n = i ? [
12
+ t.changed > 0 ? `${t.changed} changed` : "",
13
+ t.unreadMentions > 0 ? `${t.unreadMentions} new mention${t.unreadMentions === 1 ? "" : "s"}` : ""
14
+ ].filter(Boolean).join(", ") : "";
15
+ return /* @__PURE__ */ b(
16
+ "button",
17
+ {
18
+ type: "button",
19
+ "aria-label": n ? `${o} (${n})` : o,
20
+ "aria-pressed": e || !t.wide && t.sheet,
21
+ "data-tip": n ? `Watch list · ${n}` : "Watch list (Shift W)",
22
+ "data-watch-list-button": i ? "dot" : "plain",
23
+ onClick: () => {
24
+ if (!t.wide) {
25
+ t.sheet ? l.closeSheet() : l.openSheet();
26
+ return;
27
+ }
28
+ u({ state: e ? "closed" : "open" });
29
+ },
30
+ className: `relative inline-flex shrink-0 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${s === "rail" ? `h-8 w-8 ${e ? "bg-white/[0.08] text-white" : "text-slate-400 hover:bg-white/[0.05] hover:text-white"}` : `h-8 w-8 ${e ? "bg-slate-100 text-slate-800 dark:bg-white/[0.08] dark:text-slate-100" : "text-slate-500 hover:bg-slate-100 hover:text-slate-800 dark:text-slate-400 dark:hover:bg-white/[0.06] dark:hover:text-slate-100"}`} ${c}`,
31
+ children: [
32
+ /* @__PURE__ */ r(p, { className: "h-[15px] w-[15px]" }),
33
+ i && /* @__PURE__ */ r(
34
+ "span",
35
+ {
36
+ "aria-hidden": !0,
37
+ className: `absolute right-1 top-1 h-2 w-2 rounded-full bg-nvr-cyan ring-2 ${h ?? (s === "rail" ? "ring-nvr-navy dark:ring-[#090c10]" : "ring-white dark:ring-slate-900")}`
38
+ }
39
+ )
40
+ ]
41
+ }
42
+ );
43
+ }
44
+ export {
45
+ $ as WatchListButton
46
+ };
@@ -0,0 +1,67 @@
1
+ import { jsxs as v, jsx as a, Fragment as $ } from "react/jsx-runtime";
2
+ import { Pin as w, PinOff as K } from "lucide-react";
3
+ import { useRef as N, useEffect as y } from "react";
4
+ import { useOptionalNivaroClient as P } from "../../context.js";
5
+ import { useLiveRecord as S } from "../../lib/live.js";
6
+ import { useWatchActions as W, pinKeyOf as O, typingTarget as j } from "../../lib/watch-list.js";
7
+ import { WatchShareMenu as E } from "./WatchExtras.js";
8
+ const o = [];
9
+ let u = !1;
10
+ function b(e) {
11
+ if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey || e.key !== "w" && e.key !== "W" || j(e.target)) return;
12
+ const t = o[o.length - 1];
13
+ t && (e.preventDefault(), t());
14
+ }
15
+ function L(e) {
16
+ return o.push(e), !u && typeof window < "u" && (window.addEventListener("keydown", b), u = !0), () => {
17
+ const t = o.lastIndexOf(e);
18
+ t >= 0 && o.splice(t, 1), o.length === 0 && u && (window.removeEventListener("keydown", b), u = !1);
19
+ };
20
+ }
21
+ function T({
22
+ collection: e,
23
+ itemId: t,
24
+ shortcut: f = !1,
25
+ size: d = "md",
26
+ className: k = ""
27
+ }) {
28
+ const x = P(), i = W(), n = t == null || t === "" || t === "new" ? null : String(t), r = n ? i.isPinned(e, n) : !1, l = N(i);
29
+ l.current = i, y(() => {
30
+ if (!(!f || !n))
31
+ return L(() => void l.current.toggle(e, n).catch(() => {
32
+ }));
33
+ }, [f, e, n]);
34
+ const c = n ? O(e, n) : "";
35
+ if (y(() => {
36
+ r && c && l.current.markSeen([c]);
37
+ }, [r, c]), S(r ? e : null, n, () => l.current.markSeen([c]), {
38
+ debounceMs: 2e3
39
+ }), !x || !n) return null;
40
+ const m = r ? "Remove from your watch list" : "Add to your watch list", p = !r && i.full, h = d === "sm" ? "h-3 w-3" : "h-3.5 w-3.5", g = /* @__PURE__ */ a(
41
+ "button",
42
+ {
43
+ type: "button",
44
+ "aria-pressed": r,
45
+ "aria-label": m,
46
+ "data-tip": p ? "Your watch list is full. Unpin a record to add this one." : `${m}${f ? " (W)" : ""}`,
47
+ "data-watch-pin": r ? "on" : "off",
48
+ disabled: p,
49
+ onClick: (s) => {
50
+ s.stopPropagation(), i.toggle(e, n).catch(() => {
51
+ });
52
+ },
53
+ className: `group/pin inline-flex shrink-0 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 disabled:cursor-not-allowed disabled:opacity-40 ${d === "sm" ? "h-6 w-6" : "h-7 w-7"} ${r ? "text-nvr-cyan hover:bg-nvr-cyan/10" : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-300"} ${k}`,
54
+ children: r ? /* @__PURE__ */ v($, { children: [
55
+ /* @__PURE__ */ a(w, { className: `${h} fill-current group-hover/pin:hidden` }),
56
+ /* @__PURE__ */ a(K, { className: `${h} hidden group-hover/pin:block` })
57
+ ] }) : /* @__PURE__ */ a(w, { className: h })
58
+ }
59
+ );
60
+ return i.prefs.teams.some((s) => (s.is_member || s.can_manage) && !s.owner_gone) ? /* @__PURE__ */ v("span", { className: "inline-flex shrink-0 items-center", children: [
61
+ g,
62
+ /* @__PURE__ */ a(E, { actions: i, collection: e, itemId: n, size: d })
63
+ ] }) : g;
64
+ }
65
+ export {
66
+ T as WatchPinButton
67
+ };
@@ -0,0 +1,348 @@
1
+ import { jsx as t, jsxs as l, Fragment as D } from "react/jsx-runtime";
2
+ import { useSensors as T, useSensor as _, PointerSensor as M, KeyboardSensor as R, DndContext as O, closestCenter as W } from "@dnd-kit/core";
3
+ import { sortableKeyboardCoordinates as P, SortableContext as E, verticalListSortingStrategy as K, useSortable as L } from "@dnd-kit/sortable";
4
+ import { CSS as U } from "@dnd-kit/utilities";
5
+ import { X as z, GripVertical as B, CircleCheck as F } from "lucide-react";
6
+ import { useDeadlineNow as j, dueInText as G, liveDeadlineStatus as q } from "../../lib/deadline-ticker.js";
7
+ import { usePeekOrOpen as H } from "../../lib/record-peek.js";
8
+ import { serverNow as V } from "../../lib/server-clock.js";
9
+ import { spanText as k } from "../../lib/watch-list.js";
10
+ import { RecordHoverCard as X, cardAmountText as Y, ownerText as J } from "../RecordHoverCard.js";
11
+ import { UserAvatar as Q } from "../UserAvatar.js";
12
+ function I(e, r = V()) {
13
+ if (!e) return "";
14
+ const n = new Date(e).getTime();
15
+ if (!Number.isFinite(n)) return "";
16
+ const a = Math.max(0, (r - n) / 1e3);
17
+ return a < 60 ? "now" : a < 3600 ? `${Math.floor(a / 60)} m` : a < 86400 ? `${Math.floor(a / 3600)} h` : a < 7 * 86400 ? `${Math.floor(a / 86400)} d` : new Date(n).toLocaleDateString(void 0, { month: "short", day: "numeric" });
18
+ }
19
+ const Z = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((r) => {
20
+ var n;
21
+ return ((n = r[0]) == null ? void 0 : n.toUpperCase()) ?? "";
22
+ }).join("") || "?";
23
+ function A({ state: e }) {
24
+ return e ? /* @__PURE__ */ l("span", { className: "inline-flex min-w-0 max-w-[140px] items-center gap-1.5 rounded-full bg-slate-100 px-1.5 py-px text-[11px] font-medium text-slate-700 dark:bg-white/[0.07] dark:text-slate-200", children: [
25
+ /* @__PURE__ */ t(
26
+ "span",
27
+ {
28
+ "aria-hidden": !0,
29
+ className: "h-1.5 w-1.5 shrink-0 rounded-full bg-slate-400",
30
+ style: e.color ? { backgroundColor: e.color } : void 0
31
+ }
32
+ ),
33
+ /* @__PURE__ */ t("span", { className: "truncate", children: e.label })
34
+ ] }) : null;
35
+ }
36
+ function ee({
37
+ owners: e,
38
+ max: r = 2
39
+ }) {
40
+ if (e.length === 0) return null;
41
+ const n = e.slice(0, r), a = e.length - n.length, m = e.map(J).join(", ");
42
+ return (
43
+ // No tooltip: the row's hover card names the owners (one overlay at a time).
44
+ /* @__PURE__ */ l("span", { className: "flex shrink-0 items-center pl-1", children: [
45
+ /* @__PURE__ */ l("span", { className: "sr-only", children: [
46
+ "With ",
47
+ m
48
+ ] }),
49
+ n.map((s, c) => /* @__PURE__ */ t(
50
+ "span",
51
+ {
52
+ "aria-hidden": !0,
53
+ className: `relative inline-flex h-[18px] w-[18px] shrink-0 items-center justify-center overflow-hidden rounded-full bg-slate-200 text-[8.5px] font-semibold text-slate-600 ring-2 ring-card dark:bg-slate-700 dark:text-slate-200 ${c > 0 ? "-ml-1" : ""} ${s.inactive ? "opacity-50 grayscale" : ""}`,
54
+ style: { zIndex: n.length - c },
55
+ children: /* @__PURE__ */ t(
56
+ Q,
57
+ {
58
+ userId: s.id,
59
+ fallback: Z(s.name),
60
+ className: "h-full w-full rounded-full object-cover",
61
+ alt: ""
62
+ }
63
+ )
64
+ },
65
+ s.id
66
+ )),
67
+ a > 0 && /* @__PURE__ */ l(
68
+ "span",
69
+ {
70
+ "aria-hidden": !0,
71
+ className: "relative -ml-1 inline-flex h-[18px] min-w-[22px] shrink-0 items-center justify-center rounded-full bg-slate-100 px-1 text-[9px] font-semibold tabular-nums text-slate-600 ring-2 ring-card dark:bg-slate-800 dark:text-slate-300",
72
+ children: [
73
+ "+",
74
+ a
75
+ ]
76
+ }
77
+ )
78
+ ] })
79
+ );
80
+ }
81
+ function te({
82
+ timing: e,
83
+ stepLabel: r
84
+ }) {
85
+ const n = e.ratio != null && e.ratio > 1, a = `${k(e.in_step_s)} in ${r ?? "this step"}${e.usual_s ? `, usually ${k(e.usual_s)}` : ""}`;
86
+ return /* @__PURE__ */ l("span", { className: "flex min-w-0 shrink-0 items-baseline", "data-step-timeline": !0, children: [
87
+ /* @__PURE__ */ t("span", { className: "sr-only", children: a }),
88
+ /* @__PURE__ */ t(
89
+ "span",
90
+ {
91
+ "aria-hidden": !0,
92
+ className: `text-[10.5px] font-medium tabular-nums ${n ? "text-amber-700 dark:text-amber-300" : "text-slate-600 dark:text-slate-300"}`,
93
+ children: k(e.in_step_s)
94
+ }
95
+ ),
96
+ e.usual_s != null && /* @__PURE__ */ l(
97
+ "span",
98
+ {
99
+ "aria-hidden": !0,
100
+ className: "whitespace-pre text-[10.5px] tabular-nums text-slate-500 dark:text-slate-400",
101
+ children: [
102
+ " / usually ",
103
+ k(e.usual_s)
104
+ ]
105
+ }
106
+ )
107
+ ] });
108
+ }
109
+ function ae({ at: e }) {
110
+ return /* @__PURE__ */ l(
111
+ "span",
112
+ {
113
+ className: "inline-flex min-w-0 items-center gap-1 rounded-full bg-emerald-50 px-1.5 py-px text-[11px] font-medium text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300",
114
+ "data-watch-completed": !0,
115
+ children: [
116
+ /* @__PURE__ */ t(F, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }),
117
+ "Completed",
118
+ /* @__PURE__ */ l("span", { className: "font-normal text-emerald-700/80 dark:text-emerald-300/70", children: [
119
+ "· ",
120
+ I(e)
121
+ ] })
122
+ ]
123
+ }
124
+ );
125
+ }
126
+ function ne({ sla: e }) {
127
+ const r = j(!!e.due_at), n = G(e, r);
128
+ if (!n) return null;
129
+ const a = q(e, r);
130
+ return /* @__PURE__ */ t(
131
+ "span",
132
+ {
133
+ className: `shrink-0 text-[10.5px] font-medium tabular-nums ${a === "breached" ? "text-red-600 dark:text-red-400" : a === "warning" ? "text-amber-700 dark:text-amber-300" : "text-slate-500 dark:text-slate-400"}`,
134
+ "data-deadline": a ?? void 0,
135
+ children: n.charAt(0).toUpperCase() + n.slice(1)
136
+ }
137
+ );
138
+ }
139
+ function w({
140
+ sortable: e,
141
+ id: r,
142
+ children: n
143
+ }) {
144
+ const a = L({ id: r, disabled: !e }), m = {
145
+ transform: U.Transform.toString(a.transform),
146
+ transition: a.transition,
147
+ zIndex: a.isDragging ? 2 : void 0,
148
+ position: "relative"
149
+ }, s = e ? /* @__PURE__ */ t(
150
+ "button",
151
+ {
152
+ type: "button",
153
+ "aria-label": "Move",
154
+ ...a.attributes,
155
+ ...a.listeners,
156
+ onClick: (c) => c.stopPropagation(),
157
+ className: "absolute left-0 top-1/2 flex h-7 w-3.5 -translate-y-1/2 cursor-grab items-center justify-center text-slate-300 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/row:opacity-100 active:cursor-grabbing dark:text-slate-600",
158
+ children: /* @__PURE__ */ t(B, { className: "h-3 w-3" })
159
+ }
160
+ ) : null;
161
+ return /* @__PURE__ */ t(D, { children: n(s, m, a.setNodeRef) });
162
+ }
163
+ function le({
164
+ row: e,
165
+ list: r,
166
+ sortable: n,
167
+ onUnpin: a,
168
+ onSeen: m,
169
+ rowActions: s,
170
+ unpinLabel: c = "Unpin",
171
+ canRemove: v = !0
172
+ }) {
173
+ var h;
174
+ const g = H();
175
+ j(!0);
176
+ const u = !!((h = e.change) != null && h.changed);
177
+ if (!e.available)
178
+ return /* @__PURE__ */ t(w, { sortable: n, id: e.key, children: (d, f, N) => /* @__PURE__ */ l(
179
+ "li",
180
+ {
181
+ ref: N,
182
+ style: f,
183
+ className: "group/row flex items-center gap-2 py-2.5 pl-4 pr-2",
184
+ "data-watch-row": "unavailable",
185
+ children: [
186
+ d,
187
+ /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
188
+ /* @__PURE__ */ l("p", { className: "truncate text-[12.5px] font-medium text-slate-600 dark:text-slate-300", children: [
189
+ e.collection_label,
190
+ " ",
191
+ e.id
192
+ ] }),
193
+ /* @__PURE__ */ t("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "No longer available to you" })
194
+ ] }),
195
+ /* @__PURE__ */ t(
196
+ "button",
197
+ {
198
+ type: "button",
199
+ onClick: () => a(e),
200
+ className: "shrink-0 rounded-md border border-slate-200 px-2 py-1 text-[11.5px] font-medium text-slate-700 transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:border-white/[0.12] dark:text-slate-200 dark:hover:bg-white/[0.05]",
201
+ children: "Remove"
202
+ }
203
+ )
204
+ ]
205
+ }
206
+ ) });
207
+ const p = e.title ?? e.collection_label, y = e.figures[0], i = (d) => {
208
+ m(e.key), g({ collection: e.collection, itemId: e.id, title: p }, d, { list: r });
209
+ }, o = e.change, x = o ? [o.text, o.by && !o.by.self ? o.by.name : o.by ? "You" : ""].filter(Boolean).join(" · ") : null;
210
+ return /* @__PURE__ */ t(w, { sortable: n, id: e.key, children: (d, f, N) => {
211
+ var C, S, $;
212
+ return /* @__PURE__ */ l(
213
+ "li",
214
+ {
215
+ ref: N,
216
+ style: f,
217
+ "data-watch-row": u ? "changed" : "quiet",
218
+ className: `group/row relative transition-colors duration-700 motion-reduce:transition-none ${u ? "bg-sky-50 dark:bg-nvr-cyan/[0.07]" : "hover:bg-slate-50 dark:hover:bg-white/[0.03]"}`,
219
+ children: [
220
+ d,
221
+ /* @__PURE__ */ t(
222
+ X,
223
+ {
224
+ collection: e.collection,
225
+ id: e.id,
226
+ side: "bottom",
227
+ block: !0,
228
+ delayMs: 800,
229
+ children: /* @__PURE__ */ l(
230
+ "div",
231
+ {
232
+ role: "button",
233
+ tabIndex: 0,
234
+ "aria-label": `${p}${u ? ", changed" : ""}`,
235
+ onClick: i,
236
+ onAuxClick: i,
237
+ onKeyDown: (b) => {
238
+ (b.key === "Enter" || b.key === " ") && (b.preventDefault(), m(e.key), g({ collection: e.collection, itemId: e.id, title: p }, null, { list: r }));
239
+ },
240
+ className: `block cursor-pointer py-2.5 pl-4 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/60 ${s ? "pr-14" : "pr-8"}`,
241
+ children: [
242
+ /* @__PURE__ */ l("div", { className: "flex items-baseline gap-2", children: [
243
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium text-slate-800 dark:text-slate-100", children: p }),
244
+ y && /* @__PURE__ */ t("span", { className: "shrink-0 text-[12px] font-medium tabular-nums text-slate-700 dark:text-slate-200", children: Y(y) })
245
+ ] }),
246
+ /* @__PURE__ */ l("div", { className: "mt-1 flex min-w-0 items-center gap-2", children: [
247
+ e.completed_at ? /* @__PURE__ */ t(ae, { at: e.completed_at }) : /* @__PURE__ */ l(D, { children: [
248
+ /* @__PURE__ */ t(A, { state: e.state }),
249
+ e.timing && /* @__PURE__ */ t(te, { timing: e.timing, stepLabel: ((C = e.state) == null ? void 0 : C.label) ?? null })
250
+ ] }),
251
+ /* @__PURE__ */ t("span", { className: "flex-1" }),
252
+ !e.completed_at && /* @__PURE__ */ t(ee, { owners: e.owners })
253
+ ] }),
254
+ (x || ((S = e.sla) == null ? void 0 : S.due_at)) && /* @__PURE__ */ l("div", { className: "mt-1 flex min-w-0 items-center gap-2", children: [
255
+ x ? /* @__PURE__ */ l(
256
+ "span",
257
+ {
258
+ className: `flex min-w-0 flex-1 items-center gap-1.5 text-[11px] ${u ? "text-slate-700 dark:text-slate-200" : "text-slate-500 dark:text-slate-400"}`,
259
+ children: [
260
+ u && /* @__PURE__ */ t(
261
+ "span",
262
+ {
263
+ "aria-hidden": !0,
264
+ className: "h-1.5 w-1.5 shrink-0 rounded-full bg-nvr-cyan"
265
+ }
266
+ ),
267
+ /* @__PURE__ */ l("span", { className: "flex min-w-0", children: [
268
+ /* @__PURE__ */ t("span", { className: "truncate", children: x }),
269
+ /* @__PURE__ */ l("span", { className: "shrink-0 whitespace-pre tabular-nums text-slate-500 dark:text-slate-400", children: [
270
+ " · ",
271
+ I(o == null ? void 0 : o.at)
272
+ ] })
273
+ ] })
274
+ ]
275
+ }
276
+ ) : /* @__PURE__ */ t("span", { className: "flex-1" }),
277
+ (($ = e.sla) == null ? void 0 : $.due_at) && !e.completed_at && /* @__PURE__ */ t(ne, { sla: e.sla })
278
+ ] })
279
+ ]
280
+ }
281
+ )
282
+ }
283
+ ),
284
+ /* @__PURE__ */ l("div", { className: "absolute right-1.5 top-2 flex items-center gap-0.5", children: [
285
+ s == null ? void 0 : s(e),
286
+ v && /* @__PURE__ */ t(
287
+ "button",
288
+ {
289
+ type: "button",
290
+ "aria-label": `${c}: ${p}`,
291
+ "data-tip": c,
292
+ onClick: (b) => {
293
+ b.stopPropagation(), a(e);
294
+ },
295
+ className: "invisible flex h-6 w-6 items-center justify-center rounded-md text-slate-400 hover:bg-slate-200/70 hover:text-slate-700 focus-visible:visible group-hover/row:visible dark:text-slate-500 dark:hover:bg-white/[0.08] dark:hover:text-slate-200",
296
+ children: /* @__PURE__ */ t(z, { className: "h-3.5 w-3.5" })
297
+ }
298
+ )
299
+ ] })
300
+ ]
301
+ }
302
+ );
303
+ } });
304
+ }
305
+ function fe({
306
+ rows: e,
307
+ sortable: r,
308
+ onReorder: n,
309
+ onUnpin: a,
310
+ onSeen: m,
311
+ rowActions: s,
312
+ unpinLabel: c,
313
+ canRemove: v,
314
+ label: g = "Watched records"
315
+ }) {
316
+ const u = T(
317
+ _(M, { activationConstraint: { distance: 4 } }),
318
+ _(R, { coordinateGetter: P })
319
+ ), p = e.filter((i) => i.available).map((i) => ({ collection: i.collection, itemId: i.id, title: i.title }));
320
+ return /* @__PURE__ */ t(O, { sensors: u, collisionDetection: W, onDragEnd: (i) => {
321
+ if (!i.over || i.active.id === i.over.id) return;
322
+ const o = e.map((f) => f.key), x = o.indexOf(String(i.active.id)), h = o.indexOf(String(i.over.id));
323
+ if (x < 0 || h < 0) return;
324
+ const d = [...o];
325
+ d.splice(h, 0, d.splice(x, 1)[0]), n(d);
326
+ }, children: /* @__PURE__ */ t(E, { items: e.map((i) => i.key), strategy: K, children: /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-white/[0.05]", "aria-label": g, children: e.map((i) => /* @__PURE__ */ t(
327
+ le,
328
+ {
329
+ row: i,
330
+ list: p,
331
+ sortable: r,
332
+ onUnpin: a,
333
+ onSeen: m,
334
+ rowActions: s,
335
+ unpinLabel: c,
336
+ canRemove: v
337
+ },
338
+ i.key
339
+ )) }) }) });
340
+ }
341
+ export {
342
+ ae as CompletedChip,
343
+ ee as OwnerStack,
344
+ A as StepChip,
345
+ le as WatchRow,
346
+ fe as WatchRowList,
347
+ I as agoText
348
+ };