@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.
Files changed (293) 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 +1728 -22
  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 +4909 -4182
  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 +612 -551
  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/OverflowRail.js +326 -0
  39. package/dist/shared/components/PageRenderer.js +636 -599
  40. package/dist/shared/components/PresenceDot.js +21 -0
  41. package/dist/shared/components/ProfileView.js +656 -536
  42. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  43. package/dist/shared/components/RecentRecordsRail.js +51 -48
  44. package/dist/shared/components/RecordCompare.js +241 -150
  45. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  46. package/dist/shared/components/RecordGridEditor.js +350 -311
  47. package/dist/shared/components/RecordHoverCard.js +147 -0
  48. package/dist/shared/components/RecordPeekHost.js +111 -0
  49. package/dist/shared/components/RecordReadView.js +414 -412
  50. package/dist/shared/components/RelativeTime.js +16 -0
  51. package/dist/shared/components/ReportView.js +1396 -1304
  52. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  53. package/dist/shared/components/TabCountHost.js +10 -0
  54. package/dist/shared/components/TickerNumber.js +19 -18
  55. package/dist/shared/components/TipLayer.js +70 -58
  56. package/dist/shared/components/WidgetImageMenu.js +59 -0
  57. package/dist/shared/components/WidgetSlot.js +571 -524
  58. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  59. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  60. package/dist/shared/components/cbv/approval-changed.js +20 -0
  61. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  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/SignalCard.js +84 -77
  79. package/dist/shared/components/integrations/console/api.js +161 -117
  80. package/dist/shared/components/integrations/console/tone.js +15 -12
  81. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  82. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  83. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  84. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  85. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  86. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  87. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  88. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  89. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  90. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  91. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  92. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  93. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  94. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  95. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  96. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  97. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  98. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  99. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  100. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  101. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  102. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  103. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  104. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  105. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  106. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  107. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  108. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  109. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  110. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  111. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  112. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  113. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  114. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  115. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  116. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  117. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  118. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  119. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  120. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  121. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  122. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  123. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  124. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  125. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  126. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  127. package/dist/shared/components/item-edit/file-live.js +77 -0
  128. package/dist/shared/components/item-edit/file-processing.js +87 -0
  129. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  130. package/dist/shared/components/item-edit/live-related.js +23 -0
  131. package/dist/shared/components/item-edit/live-title.js +66 -0
  132. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  133. package/dist/shared/components/item-edit/removed-line.js +58 -0
  134. package/dist/shared/components/item-edit/render-stability.js +70 -59
  135. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  136. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  137. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  138. package/dist/shared/components/list/InlineEdit.js +504 -208
  139. package/dist/shared/components/list/ListViewers.js +81 -0
  140. package/dist/shared/components/list/PhonePager.js +50 -0
  141. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  142. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  143. package/dist/shared/components/merge/merge-values.js +110 -0
  144. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  145. package/dist/shared/components/notifications/NotificationCenterView.js +389 -323
  146. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  147. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  148. package/dist/shared/components/notifications/bundles.js +21 -19
  149. package/dist/shared/components/notifications/resolved-line.js +25 -0
  150. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  151. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  152. package/dist/shared/components/panels/AlertBanners.js +132 -0
  153. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  154. package/dist/shared/components/panels/BranchLanes.js +82 -54
  155. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  156. package/dist/shared/components/panels/CommentImages.js +219 -0
  157. package/dist/shared/components/panels/CommentPanel.js +649 -530
  158. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  159. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  160. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  161. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  162. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  163. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  164. package/dist/shared/components/panels/SlaClock.js +130 -99
  165. package/dist/shared/components/panels/TaskPanel.js +308 -287
  166. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  167. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  168. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  169. package/dist/shared/components/pipeline/PipelineEditorView.js +2050 -1942
  170. package/dist/shared/components/profile/AgentNameField.js +141 -0
  171. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  172. package/dist/shared/components/profile/PersonAccess.js +398 -330
  173. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  174. package/dist/shared/components/profile/PersonProfile.js +81 -73
  175. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  176. package/dist/shared/components/queue/OwnerAvatars.js +9 -9
  177. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  178. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  179. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  180. package/dist/shared/components/queue/QueueWorklist.js +2407 -1950
  181. package/dist/shared/components/queue/worklist-helpers.js +10 -6
  182. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  183. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  184. package/dist/shared/components/support/ReportProblem.js +1 -0
  185. package/dist/shared/components/support/ScreenShare.js +554 -0
  186. package/dist/shared/components/support/SupportView.js +160 -129
  187. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  188. package/dist/shared/components/ui/popover.js +53 -29
  189. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  190. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  191. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  192. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  193. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  194. package/dist/shared/lib/activity-sentence.js +87 -75
  195. package/dist/shared/lib/agent-presence.js +46 -0
  196. package/dist/shared/lib/approval-progress.js +49 -0
  197. package/dist/shared/lib/attention-prefs.js +27 -0
  198. package/dist/shared/lib/cell-locks.js +56 -0
  199. package/dist/shared/lib/co-edit.js +166 -0
  200. package/dist/shared/lib/coedit-registry.js +44 -0
  201. package/dist/shared/lib/comment-awareness.js +124 -0
  202. package/dist/shared/lib/comment-images.js +45 -0
  203. package/dist/shared/lib/config-watch.js +94 -0
  204. package/dist/shared/lib/copy-rules.js +65 -0
  205. package/dist/shared/lib/count-step.js +30 -0
  206. package/dist/shared/lib/deadline-ticker.js +68 -0
  207. package/dist/shared/lib/derived-causes.js +115 -0
  208. package/dist/shared/lib/draft-store.js +114 -85
  209. package/dist/shared/lib/error-hints.js +1 -0
  210. package/dist/shared/lib/field-merge.js +126 -0
  211. package/dist/shared/lib/filter-sentence.js +10 -10
  212. package/dist/shared/lib/focus-mode.js +16 -12
  213. package/dist/shared/lib/grid-cursors.js +77 -0
  214. package/dist/shared/lib/grid-presence.js +182 -0
  215. package/dist/shared/lib/idle-reload.js +100 -73
  216. package/dist/shared/lib/in-step.js +45 -0
  217. package/dist/shared/lib/integration-chip.js +19 -18
  218. package/dist/shared/lib/keep-row-focus.js +43 -0
  219. package/dist/shared/lib/line-locks.js +141 -0
  220. package/dist/shared/lib/line-split.js +41 -0
  221. package/dist/shared/lib/linked-changes.js +150 -0
  222. package/dist/shared/lib/list-return.js +231 -0
  223. package/dist/shared/lib/list-viewers.js +52 -0
  224. package/dist/shared/lib/live-announcer.js +86 -0
  225. package/dist/shared/lib/live-counts.js +85 -0
  226. package/dist/shared/lib/live-data-changed.js +108 -0
  227. package/dist/shared/lib/live-deltas.js +81 -0
  228. package/dist/shared/lib/live-findings.js +113 -0
  229. package/dist/shared/lib/live-groups.js +122 -0
  230. package/dist/shared/lib/live-link-labels.js +162 -0
  231. package/dist/shared/lib/live-list-flow.js +334 -0
  232. package/dist/shared/lib/live-list.js +143 -129
  233. package/dist/shared/lib/live-moves.js +51 -0
  234. package/dist/shared/lib/live-ops.js +26 -26
  235. package/dist/shared/lib/live-pickers.js +7 -0
  236. package/dist/shared/lib/live-preference.js +184 -0
  237. package/dist/shared/lib/live-queries.js +226 -181
  238. package/dist/shared/lib/live-screen.js +333 -0
  239. package/dist/shared/lib/live-search.js +108 -0
  240. package/dist/shared/lib/live-seen.js +35 -0
  241. package/dist/shared/lib/live-views.js +100 -0
  242. package/dist/shared/lib/live.js +159 -133
  243. package/dist/shared/lib/missed-updates.js +198 -0
  244. package/dist/shared/lib/newer-file.js +56 -0
  245. package/dist/shared/lib/notification-sound.js +42 -20
  246. package/dist/shared/lib/obligation-banner.js +17 -17
  247. package/dist/shared/lib/own-writes.js +59 -41
  248. package/dist/shared/lib/picker-badges.js +94 -0
  249. package/dist/shared/lib/presence-signals.js +131 -84
  250. package/dist/shared/lib/rail-menu-context.js +9 -0
  251. package/dist/shared/lib/realtime.js +49 -24
  252. package/dist/shared/lib/record-gaps.js +85 -0
  253. package/dist/shared/lib/record-outbox.js +369 -222
  254. package/dist/shared/lib/record-peek.js +75 -0
  255. package/dist/shared/lib/record-tabs.js +92 -72
  256. package/dist/shared/lib/relative-ticker.js +42 -0
  257. package/dist/shared/lib/request-gate.js +119 -119
  258. package/dist/shared/lib/rollup-recalc.js +107 -0
  259. package/dist/shared/lib/room-gaps.js +40 -36
  260. package/dist/shared/lib/row-surface.js +7 -0
  261. package/dist/shared/lib/rum.js +137 -87
  262. package/dist/shared/lib/save-progress.js +20 -0
  263. package/dist/shared/lib/scheduled-countdown.js +67 -0
  264. package/dist/shared/lib/screen-refresh.js +160 -0
  265. package/dist/shared/lib/screen-share.js +234 -0
  266. package/dist/shared/lib/seen-since.js +74 -0
  267. package/dist/shared/lib/selection-watch.js +205 -0
  268. package/dist/shared/lib/send-status.js +132 -0
  269. package/dist/shared/lib/send-view.js +23 -0
  270. package/dist/shared/lib/socket-liveness.js +155 -0
  271. package/dist/shared/lib/socket-realtime.js +168 -140
  272. package/dist/shared/lib/state-census.js +53 -0
  273. package/dist/shared/lib/summary-mode.js +61 -39
  274. package/dist/shared/lib/tab-attention.js +143 -32
  275. package/dist/shared/lib/table-density.js +64 -0
  276. package/dist/shared/lib/table-pins.js +20 -18
  277. package/dist/shared/lib/track-travel.js +40 -0
  278. package/dist/shared/lib/unseen-changes.js +68 -0
  279. package/dist/shared/lib/upload-file.js +62 -0
  280. package/dist/shared/lib/upload-presence.js +127 -0
  281. package/dist/shared/lib/urgent-chime.js +65 -0
  282. package/dist/shared/lib/use-below-md.js +29 -0
  283. package/dist/shared/lib/use-online-users.js +32 -11
  284. package/dist/shared/lib/user-sync.js +155 -39
  285. package/dist/shared/lib/waiting-count.js +44 -0
  286. package/dist/shared/lib/watch-desktop.js +83 -0
  287. package/dist/shared/lib/watch-list.js +447 -0
  288. package/dist/shared/lib/widget-image-render.js +64 -0
  289. package/dist/shared/lib/widget-image.js +111 -0
  290. package/dist/shared/lib/worker-socket.js +130 -104
  291. package/dist/shared/lib/write-to-screen.js +133 -0
  292. package/package.json +1 -1
  293. package/styles.css +49 -1
@@ -0,0 +1,86 @@
1
+ const _ = 5e3, E = 800;
2
+ function T(e) {
3
+ const t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
4
+ return t ? t.charAt(0).toUpperCase() + t.slice(1).toLowerCase() : "";
5
+ }
6
+ const $ = {
7
+ $state: "Status",
8
+ $comments: "Comments",
9
+ $tasks: "Tasks",
10
+ $addendums: "Addendums",
11
+ $owners: "Owners"
12
+ };
13
+ function A(e) {
14
+ const t = [];
15
+ for (const o of e) {
16
+ const i = o.startsWith("$") ? $[o] : T(o);
17
+ i && !t.includes(i) && t.push(i);
18
+ }
19
+ return t;
20
+ }
21
+ function g(e) {
22
+ if (e.action === "create" || e.action === "delete") return !0;
23
+ const t = e.fields;
24
+ return !t || t.length === 0 ? !0 : A(t).length > 0;
25
+ }
26
+ function p(e, t, o) {
27
+ return `${e} ${e === 1 ? t : o}`;
28
+ }
29
+ function S(e, t = "full") {
30
+ if (t === "off") return "";
31
+ const o = e.filter(g);
32
+ if (o.length === 0) return "";
33
+ const i = /* @__PURE__ */ new Set();
34
+ let h = 0;
35
+ const u = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), s = [];
36
+ let r = !1, f = 0;
37
+ for (const d of o) {
38
+ f++;
39
+ const m = d.item == null ? `#${f}` : String(d.item);
40
+ if (d.item === "*" ? h += Math.max(1, d.bulk ?? 1) : i.add(m), d.action === "create") u.add(m);
41
+ else if (d.action === "delete") c.add(m);
42
+ else {
43
+ r = !0;
44
+ for (const N of A(d.fields ?? [])) s.includes(N) || s.push(N);
45
+ }
46
+ }
47
+ const l = i.size + h;
48
+ if (t === "brief") return l <= 1 ? "Updated" : `${l} rows updated`;
49
+ const n = [];
50
+ if (l === 1 && u.size === 0 && c.size === 0)
51
+ return s.length > 0 && s.length <= 2 ? `${s.join(" and ")} changed` : s.length > 2 ? `${s.length} fields changed` : "Record updated";
52
+ const a = l - u.size - c.size;
53
+ u.size > 0 && n.push(p(u.size, "row added", "rows added")), c.size > 0 && n.push(p(c.size, "row removed", "rows removed")), r && a > 0 && n.push(p(a, "row updated", "rows updated")), n.length === 0 && n.push(p(l, "row updated", "rows updated"));
54
+ const w = n.join(", ");
55
+ return w.charAt(0).toUpperCase() + w.slice(1);
56
+ }
57
+ function z(e) {
58
+ const t = e.minGapMs ?? 5e3, o = e.settleMs ?? 800, i = e.now ?? (() => Date.now()), h = e.setTimer ?? ((n, a) => setTimeout(n, a)), u = e.clearTimer ?? ((n) => clearTimeout(n));
59
+ let c = e.verbosity ?? "full", s = [], r = null, f = Number.NEGATIVE_INFINITY;
60
+ const l = () => {
61
+ r = null;
62
+ const n = s;
63
+ s = [];
64
+ const a = S(n, c);
65
+ a && (f = i(), e.say(a));
66
+ };
67
+ return {
68
+ note(n) {
69
+ c === "off" || !g(n) || (s.push(n), !r && (r = h(l, Math.max(o, f + t - i()))));
70
+ },
71
+ setVerbosity(n) {
72
+ c = n, n === "off" && (s = [], r && (u(r), r = null));
73
+ },
74
+ dispose() {
75
+ s = [], r && u(r), r = null;
76
+ }
77
+ };
78
+ }
79
+ export {
80
+ _ as ANNOUNCE_MIN_GAP_MS,
81
+ E as ANNOUNCE_SETTLE_MS,
82
+ S as composeAnnouncement,
83
+ z as createAnnouncer,
84
+ T as humanField,
85
+ g as worthAnnouncing
86
+ };
@@ -0,0 +1,85 @@
1
+ import { useQueryClient as k } from "@tanstack/react-query";
2
+ import { useRef as p, useEffect as S } from "react";
3
+ import { useLiveOps as T } from "./live-ops.js";
4
+ function q() {
5
+ return typeof document > "u" || document.visibilityState !== "hidden";
6
+ }
7
+ const y = 2e3, w = 15e3;
8
+ function O(e, n = {}) {
9
+ const o = Math.max(0, n.quietMs ?? y), c = Math.max(o, n.maxWaitMs ?? w), l = n.isVisible ?? q, f = n.now ?? (() => Date.now());
10
+ let t = null, s = null, i = !1;
11
+ const d = () => {
12
+ if (t = null, s = null, !l()) {
13
+ i = !0;
14
+ return;
15
+ }
16
+ i = !1, e();
17
+ };
18
+ return {
19
+ poke() {
20
+ const r = f();
21
+ s === null && (s = r);
22
+ const u = Math.min(r + o, s + c);
23
+ t && clearTimeout(t), t = setTimeout(d, Math.max(0, u - r));
24
+ },
25
+ resume() {
26
+ t || !i || !l() || (i = !1, e());
27
+ },
28
+ cancel() {
29
+ t && clearTimeout(t), t = null, s = null, i = !1;
30
+ },
31
+ pending: () => t != null || i
32
+ };
33
+ }
34
+ const M = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new WeakMap();
35
+ let W = 1;
36
+ function C(e, n, o, c) {
37
+ return `${e}|${o}|${c ?? ""}|${JSON.stringify(n)}`;
38
+ }
39
+ function E(e) {
40
+ const n = k(), o = e.enabled !== !1, c = Math.max(y, e.quietMs ?? y), l = e.maxWaitMs, f = JSON.stringify(e.keys), t = p(() => {
41
+ }), s = p(e.onReady);
42
+ s.current = e.onReady, S(() => {
43
+ var h;
44
+ if (!o) return;
45
+ let i = x.get(n);
46
+ i == null && (i = W++, x.set(n, i));
47
+ const d = JSON.parse(f), r = C(i, d, c, l);
48
+ let u = M.get(r);
49
+ if (!u) {
50
+ const b = O(
51
+ () => {
52
+ for (const g of d)
53
+ n.invalidateQueries({ queryKey: g, refetchType: "active" });
54
+ },
55
+ { quietMs: c, maxWaitMs: l }
56
+ ), v = () => b.resume();
57
+ typeof document < "u" && document.addEventListener("visibilitychange", v), u = {
58
+ co: b,
59
+ users: 0,
60
+ stopVis: () => {
61
+ typeof document < "u" && document.removeEventListener("visibilitychange", v);
62
+ }
63
+ }, M.set(r, u);
64
+ }
65
+ u.users += 1;
66
+ const a = u;
67
+ t.current = () => a.co.poke();
68
+ const m = (h = s.current) == null ? void 0 : h.call(s, () => a.co.poke());
69
+ return () => {
70
+ m == null || m(), t.current = () => {
71
+ }, a.users -= 1, a.users <= 0 && (a.co.cancel(), a.stopVis(), M.delete(r));
72
+ };
73
+ }, [n, o, f, c, l]), T(e.topic ?? null, () => t.current(), {
74
+ enabled: o && !!e.topic,
75
+ // The coalescer is the real wait; the ops hook only forwards.
76
+ debounceMs: 0
77
+ });
78
+ }
79
+ export {
80
+ w as COUNT_MAX_WAIT_MS,
81
+ y as COUNT_QUIET_MS,
82
+ O as createCoalescer,
83
+ C as refreshSignature,
84
+ E as useLiveRefresh
85
+ };
@@ -0,0 +1,108 @@
1
+ import { useState as m, useEffect as h, useCallback as g, useMemo as R, useRef as l } from "react";
2
+ import { useLiveCollection as A } from "./live.js";
3
+ function S(t) {
4
+ const e = [];
5
+ for (const n of (t == null ? void 0 : t.freshness_sources) ?? []) {
6
+ const r = typeof (n == null ? void 0 : n.table) == "string" ? n.table.trim() : "";
7
+ r && !e.includes(r) && e.push(r);
8
+ }
9
+ return e.slice(0, 12);
10
+ }
11
+ function _(t) {
12
+ return (t == null ? void 0 : t.cached_at) ?? (t == null ? void 0 : t.executed_at) ?? null;
13
+ }
14
+ function b(t) {
15
+ return !t.aspectsOnly && t.events.length > 0;
16
+ }
17
+ function E(t, e, n = !0) {
18
+ const [r, c] = m(null);
19
+ h(() => {
20
+ c(null);
21
+ }, [e]);
22
+ const s = t.join(",");
23
+ return A(
24
+ s ? t : null,
25
+ (o) => {
26
+ b(o) && c((u) => u ?? Date.now());
27
+ },
28
+ { debounceMs: 1e3, includeOwn: !0, enabled: n && s !== "" }
29
+ ), r;
30
+ }
31
+ const f = "nvr:auto-refresh:";
32
+ function d(t) {
33
+ try {
34
+ return localStorage.getItem(f + t) === "1";
35
+ } catch {
36
+ return !1;
37
+ }
38
+ }
39
+ function T(t, e) {
40
+ try {
41
+ e ? localStorage.setItem(f + t, "1") : localStorage.removeItem(f + t);
42
+ } catch {
43
+ }
44
+ }
45
+ function w(t) {
46
+ const [e, n] = m(() => d(t));
47
+ h(() => {
48
+ n(d(t));
49
+ }, [t]);
50
+ const r = g(
51
+ (c) => {
52
+ T(t, c), n(c);
53
+ },
54
+ [t]
55
+ );
56
+ return [e, r];
57
+ }
58
+ const y = 15e3, C = 6, M = [];
59
+ function O(t = Date.now(), e = M, n = C) {
60
+ for (; e.length > 0 && t - e[0] >= 6e4; ) e.shift();
61
+ return e.length >= n ? !1 : (e.push(t), !0);
62
+ }
63
+ function D(t) {
64
+ const { changedAt: e, enabled: n } = t, r = l(t.refresh);
65
+ r.current = t.refresh;
66
+ const c = l(0), s = l(null), o = t.minGapMs ?? y;
67
+ h(() => {
68
+ if (!n || e == null || s.current === e) return;
69
+ let u = null;
70
+ const a = () => {
71
+ if (u = null, !document.hidden) {
72
+ if (!O()) {
73
+ u = setTimeout(a, 1e4);
74
+ return;
75
+ }
76
+ s.current = e, c.current = Date.now(), r.current();
77
+ }
78
+ }, i = () => {
79
+ !document.hidden && !u && s.current !== e && (u = setTimeout(a, 0));
80
+ };
81
+ return document.addEventListener("visibilitychange", i), u = setTimeout(a, Math.max(0, c.current + o - Date.now())), () => {
82
+ document.removeEventListener("visibilitychange", i), u && clearTimeout(u);
83
+ };
84
+ }, [n, e, o]);
85
+ }
86
+ function F(t) {
87
+ const { envelope: e, scope: n, refresh: r, autoOverride: c } = t, s = R(() => S(e), [e]), o = E(s, _(e), s.length > 0), [u, a] = w(n), i = c ?? u;
88
+ return D({ changedAt: o, enabled: i && s.length > 0, refresh: r }), {
89
+ /** Tables are known and one changed since the run (and auto-refresh is not already on it). */
90
+ changed: o != null && !i,
91
+ /** null when no table is known — nothing to offer. */
92
+ autoRefresh: s.length > 0 && c === void 0 ? { on: u, onChange: a } : null
93
+ };
94
+ }
95
+ export {
96
+ y as AUTO_REFRESH_MIN_GAP_MS,
97
+ C as AUTO_REFRESH_TAB_PER_MINUTE,
98
+ b as countsAsDataChange,
99
+ d as readAutoRefresh,
100
+ _ as runStamp,
101
+ O as takeAutoRefreshSlot,
102
+ D as useAutoRefreshOnChange,
103
+ w as useAutoRefreshPref,
104
+ E as useDataChanged,
105
+ F as useLiveStamp,
106
+ S as watchedTables,
107
+ T as writeAutoRefresh
108
+ };
@@ -0,0 +1,81 @@
1
+ import { useState as d, useEffect as f, useMemo as y } from "react";
2
+ function p(t) {
3
+ if (t == null) return null;
4
+ const n = String(t).trim().replace(/−/g, "-");
5
+ if (!/^-?\d{1,3}(,\d{3})*$|^-?\d+$/.test(n)) return null;
6
+ const r = Number(n.replace(/,/g, ""));
7
+ return Number.isSafeInteger(r) ? r : null;
8
+ }
9
+ const o = (t) => String(t).padStart(2, "0");
10
+ function g(t) {
11
+ return `${t.getFullYear()}-${o(t.getMonth() + 1)}-${o(t.getDate())}`;
12
+ }
13
+ function N(t) {
14
+ const n = new Date(t.getFullYear(), t.getMonth(), t.getDate() - 1);
15
+ return g(n);
16
+ }
17
+ function c(t, n, r = /* @__PURE__ */ new Date()) {
18
+ const e = g(r);
19
+ return t ? t.day === e ? t.last === n ? t : { ...t, last: n } : {
20
+ day: e,
21
+ first: n,
22
+ firstHour: r.getHours(),
23
+ last: n,
24
+ // Only the day right before counts as "yesterday"; an older visit is no baseline.
25
+ prevLast: t.day === N(r) ? t.last : null
26
+ } : { day: e, first: n, firstHour: r.getHours(), last: n, prevLast: null };
27
+ }
28
+ function S(t) {
29
+ if (!t) return null;
30
+ let n = t.last - t.first, r = t.firstHour < 12 ? "this morning" : "earlier today";
31
+ if (n === 0) {
32
+ if (t.prevLast == null || t.prevLast === t.last) return null;
33
+ n = t.last - t.prevLast, r = "yesterday";
34
+ }
35
+ const e = `${n > 0 ? "+" : "−"}${Math.abs(n).toLocaleString("en-US")}`;
36
+ return { delta: n, sign: e, since: r, text: `${e} since ${r}` };
37
+ }
38
+ const m = "nvr:chip:";
39
+ function i(t) {
40
+ try {
41
+ const n = localStorage.getItem(m + t);
42
+ if (!n) return null;
43
+ const r = JSON.parse(n);
44
+ return typeof r.day != "string" || !Number.isFinite(r.first) || !Number.isFinite(r.last) || !Number.isFinite(r.firstHour) ? null : {
45
+ day: r.day,
46
+ first: Number(r.first),
47
+ firstHour: Number(r.firstHour),
48
+ last: Number(r.last),
49
+ prevLast: r.prevLast == null || !Number.isFinite(r.prevLast) ? null : Number(r.prevLast)
50
+ };
51
+ } catch {
52
+ return null;
53
+ }
54
+ }
55
+ function h(t, n) {
56
+ try {
57
+ localStorage.setItem(m + t, JSON.stringify(n));
58
+ } catch {
59
+ }
60
+ }
61
+ function $(t, n, r = !0) {
62
+ const e = r ? p(n) : null, [u, l] = d(
63
+ () => r ? i(t) : null
64
+ );
65
+ return f(() => {
66
+ l(r ? i(t) : null);
67
+ }, [t, r]), f(() => {
68
+ e != null && l((a) => {
69
+ const s = c(a ?? i(t), e);
70
+ return s !== a && h(t, s), s;
71
+ });
72
+ }, [e, t]), y(() => e == null ? null : S(c(u, e)), [e, u]);
73
+ }
74
+ export {
75
+ c as advanceBaseline,
76
+ g as dayKey,
77
+ S as deltaChip,
78
+ p as parseCount,
79
+ i as readBaseline,
80
+ $ as useChangeChip
81
+ };
@@ -0,0 +1,113 @@
1
+ import { useState as F, useRef as d, useEffect as v, useCallback as C, useMemo as O } from "react";
2
+ import { useOptionalNivaroClient as q } from "../context.js";
3
+ import { get as I } from "./commands.js";
4
+ import { useLiveCollection as P } from "./live.js";
5
+ import { writerOf as U } from "./live-list.js";
6
+ const g = (o) => String(o).toUpperCase();
7
+ function j(o, i, l = 40) {
8
+ if (i.aspectsOnly) return [];
9
+ const u = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set();
10
+ for (const e of i.events) {
11
+ const f = String(e.collection);
12
+ e.item === "*" ? y.add(f) : u.add(`${f}:${g(e.item)}`);
13
+ }
14
+ const a = [], m = /* @__PURE__ */ new Set();
15
+ for (const e of o)
16
+ if (!m.has(e.key) && (u.has(`${e.collection}:${g(e.itemId)}`) || y.has(e.collection)) && (m.add(e.key), a.push(e), a.length >= l))
17
+ break;
18
+ return a;
19
+ }
20
+ function E(o, i, l) {
21
+ if (!o.by) return "Fixed";
22
+ if (l && g(o.by) === g(l)) return "Fixed by you";
23
+ const u = (i ?? "").trim();
24
+ return u ? `Fixed by ${u}` : "Fixed";
25
+ }
26
+ function N(o) {
27
+ const { findings: i, enabled: l = !0, maxPerRun: u = 40 } = o, y = q(), [a, m] = F(() => /* @__PURE__ */ new Map()), e = d(o);
28
+ e.current = o;
29
+ const f = d(i);
30
+ f.current = i;
31
+ const S = d(y);
32
+ S.current = y;
33
+ const p = d(!0), h = d([]), b = d(!1);
34
+ v(() => (p.current = !0, () => {
35
+ p.current = !1;
36
+ }), []);
37
+ const $ = i.map((t) => t.key).join("\0");
38
+ v(() => {
39
+ const t = new Set(f.current.map((n) => n.key));
40
+ m((n) => {
41
+ let c = !1;
42
+ const r = /* @__PURE__ */ new Map();
43
+ for (const [s, k] of n)
44
+ t.has(s) ? r.set(s, k) : c = !0;
45
+ return c ? r : n;
46
+ });
47
+ }, [$]);
48
+ const R = C(async (t) => {
49
+ const n = e.current;
50
+ if (n.lookupWriter) return n.lookupWriter(t).catch(() => null);
51
+ const c = S.current;
52
+ if (!c) return null;
53
+ try {
54
+ const r = await c.request(
55
+ I(`/items/${encodeURIComponent(t.collection)}/${encodeURIComponent(t.itemId)}`, {
56
+ fields: "user_updated"
57
+ })
58
+ );
59
+ return U(r.data);
60
+ } catch {
61
+ return null;
62
+ }
63
+ }, []), M = C(async () => {
64
+ if (!b.current) {
65
+ b.current = !0;
66
+ try {
67
+ for (; h.current.length > 0 && p.current; ) {
68
+ const t = h.current.splice(0, e.current.maxPerRun ?? 40);
69
+ let n = [];
70
+ try {
71
+ n = await e.current.recheck(t);
72
+ } catch {
73
+ continue;
74
+ }
75
+ if (!p.current) return;
76
+ const c = new Set(n), r = /* @__PURE__ */ new Map();
77
+ if (await Promise.all(
78
+ t.filter((s) => c.has(s.key)).slice(0, 12).map(async (s) => r.set(s.key, await R(s)))
79
+ ), !p.current) return;
80
+ m((s) => {
81
+ const k = new Map(s);
82
+ for (const w of t)
83
+ c.has(w.key) ? k.set(w.key, s.get(w.key) ?? { at: Date.now(), by: r.get(w.key) ?? null }) : k.delete(w.key);
84
+ return k;
85
+ });
86
+ }
87
+ } finally {
88
+ b.current = !1;
89
+ }
90
+ }
91
+ }, [R]), x = [...new Set(i.map((t) => t.collection))].sort().join(",");
92
+ return P(
93
+ x ? x.split(",") : null,
94
+ (t) => {
95
+ const n = j(f.current, t, u);
96
+ if (n.length === 0) return;
97
+ const c = new Set(h.current.map((r) => r.key));
98
+ for (const r of n) c.has(r.key) || h.current.push(r);
99
+ M();
100
+ },
101
+ {
102
+ debounceMs: 1e3,
103
+ includeOwn: !0,
104
+ enabled: l && x !== "",
105
+ focusable: !0
106
+ }
107
+ ), O(() => ({ resolved: a }), [a]);
108
+ }
109
+ export {
110
+ j as findingsTouchedBy,
111
+ E as resolvedLabel,
112
+ N as useResolvedFindings
113
+ };
@@ -0,0 +1,122 @@
1
+ import { useRef as K, useState as _, useEffect as S, useLayoutEffect as A } from "react";
2
+ import { useListAnchors as G, ROW_HOLD_MAX_MS as C, GROUP_ANCHOR_PREFIX as H } from "./live-list-flow.js";
3
+ import { liveMotionAllowed as O } from "./live-preference.js";
4
+ const v = (t) => t.flatMap((n) => [`${H}${n.key}`, ...n.rows]);
5
+ function T(t, n, i) {
6
+ const s = { held: !1, groups: n, gone: [], moving: /* @__PURE__ */ new Map() }, u = v(t);
7
+ let c = -1;
8
+ for (const e of i) e != null && (c = Math.max(c, u.indexOf(e)));
9
+ if (c < 0) return s;
10
+ const f = v(n);
11
+ let l = f.length > c;
12
+ for (let e = 0; l && e <= c; e++) u[e] !== f[e] && (l = !1);
13
+ if (l) return s;
14
+ const g = /* @__PURE__ */ new Map();
15
+ for (const e of n) for (const a of e.rows) g.set(a, e.key);
16
+ const p = [], r = /* @__PURE__ */ new Map();
17
+ for (const e of t)
18
+ for (const a of e.rows) {
19
+ const y = g.get(a);
20
+ y == null ? p.push(a) : y !== e.key && r.set(a, y);
21
+ }
22
+ return {
23
+ held: !0,
24
+ groups: t.map((e) => ({ key: e.key, rows: [...e.rows] })),
25
+ gone: p,
26
+ moving: r
27
+ };
28
+ }
29
+ function I(t) {
30
+ return `Now in ${t} — it moves there when you move the pointer away`;
31
+ }
32
+ function X(t, n, i, s = {}) {
33
+ const u = s.enabled !== !1, c = K({ groups: [], rowByKey: /* @__PURE__ */ new Map(), groupByKey: /* @__PURE__ */ new Map() }), f = K(!1), [, l] = _(0), g = G(i, u, () => {
34
+ f.current && l((o) => o + 1);
35
+ }), p = t.map((o) => ({ key: o.key, rows: o.rows.map(n) })), r = c.current, e = u && r.resetKey === s.resetKey ? T(r.groups, p, g.current()) : null, a = !!(e != null && e.held), y = s.maxHoldMs ?? C;
36
+ S(() => {
37
+ if (f.current = a, !a) return;
38
+ const o = setTimeout(() => {
39
+ g.clear(), l((w) => w + 1);
40
+ }, y);
41
+ return () => clearTimeout(o);
42
+ }, [a, y, g]);
43
+ const h = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
44
+ for (const o of t) {
45
+ M.set(o.key, o);
46
+ for (const w of o.rows) h.set(n(w), w);
47
+ }
48
+ let k, m;
49
+ e != null && e.held ? (m = e.groups, k = e.groups.map((o) => ({
50
+ key: o.key,
51
+ group: M.get(o.key) ?? null,
52
+ rows: o.rows.map((w) => h.get(w) ?? r.rowByKey.get(w)).filter((w) => w !== void 0)
53
+ }))) : (m = p, k = t.map((o) => ({ key: o.key, group: o, rows: o.rows }))), S(() => {
54
+ const o = new Map(h);
55
+ for (const w of m)
56
+ for (const d of w.rows)
57
+ !o.has(d) && r.rowByKey.has(d) && o.set(d, r.rowByKey.get(d));
58
+ c.current = { groups: m, rowByKey: o, groupByKey: M, resetKey: s.resetKey };
59
+ });
60
+ const b = new Set((e == null ? void 0 : e.gone) ?? []), B = (e == null ? void 0 : e.moving) ?? /* @__PURE__ */ new Map();
61
+ return {
62
+ groups: k,
63
+ isGone: (o) => b.has(o),
64
+ movingTo: (o) => B.get(o) ?? null,
65
+ holding: a
66
+ };
67
+ }
68
+ const R = 280, $ = 60;
69
+ function x(t, n, i = $) {
70
+ const s = [];
71
+ for (const [u, c] of n) {
72
+ const f = t.get(u);
73
+ if (f == null) continue;
74
+ const l = f - c;
75
+ Math.abs(l) > 1 && s.push({ key: u, dy: l });
76
+ }
77
+ return s.length > i ? [] : s;
78
+ }
79
+ function E(t) {
80
+ const n = /* @__PURE__ */ new Map(), i = t.getBoundingClientRect().top;
81
+ for (const s of t.querySelectorAll("[data-row-key]")) {
82
+ const u = s.getAttribute("data-row-key");
83
+ u != null && !n.has(u) && n.set(u, s.getBoundingClientRect().top - i);
84
+ }
85
+ return n;
86
+ }
87
+ function N(t, n, i = {}) {
88
+ const s = K(null), u = i.enabled !== !1;
89
+ A(() => {
90
+ const c = t.current;
91
+ if (!c || !u) {
92
+ s.current = null;
93
+ return;
94
+ }
95
+ const f = s.current;
96
+ if (f && f.sig === n && f.reset === i.resetKey) return;
97
+ const l = E(c);
98
+ if (s.current = { sig: n, reset: i.resetKey, tops: l }, !f || f.reset !== i.resetKey || !O()) return;
99
+ const g = x(f.tops, l);
100
+ if (g.length === 0) return;
101
+ const p = [];
102
+ for (const { key: r, dy: e } of g) {
103
+ const a = typeof CSS < "u" && CSS.escape ? CSS.escape(r) : r, y = c.querySelector(`[data-row-key="${a}"]`);
104
+ y && (y.style.transition = "none", y.style.transform = `translateY(${e}px)`, p.push(y));
105
+ }
106
+ c.offsetHeight;
107
+ for (const r of p)
108
+ r.style.transition = `transform ${R}ms cubic-bezier(0.22, 1, 0.36, 1)`, r.style.transform = "";
109
+ setTimeout(() => {
110
+ for (const r of p) r.style.transition = "";
111
+ }, R + 40);
112
+ });
113
+ }
114
+ export {
115
+ $ as GLIDE_MAX_ROWS,
116
+ R as GLIDE_MS,
117
+ x as glideMoves,
118
+ I as movingRowTitle,
119
+ T as planGroupHold,
120
+ N as useRowGlide,
121
+ X as useSteadyGroups
122
+ };