@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
@@ -1,229 +1,243 @@
1
- import { useQuery as v, useQueries as T, useQueryClient as $ } from "@tanstack/react-query";
2
- import { useRef as y, useState as w, useCallback as p, useEffect as S, useMemo as b } from "react";
1
+ import { useQuery as R, useQueryClient as v, useQueries as T } from "@tanstack/react-query";
2
+ import { useRef as p, useState as S, useCallback as y, useEffect as w, useMemo as b } from "react";
3
3
  import { useNivaroClient as k } from "../context.js";
4
- import { post as A, get as R } from "./commands.js";
5
- import { useLiveCollection as N } from "./live.js";
6
- import { loadUserCard as j } from "./user-cards.js";
7
- const L = 6e4, D = 6e4, q = 400;
8
- function E(t, e = Date.now()) {
9
- const o = Math.max(0, Math.round((e - t) / 1e3));
10
- return o < 10 ? "just now" : o < 60 ? `${o}s ago` : `${Math.round(o / 60)} min ago`;
4
+ import { post as A, get as N } from "./commands.js";
5
+ import { useLiveCollection as L } from "./live.js";
6
+ import { useLivePreference as j, liveMotionAllowed as Q } from "./live-preference.js";
7
+ import { loadUserCard as D } from "./user-cards.js";
8
+ const E = 6e4, F = 6e4, $ = 400;
9
+ function K(t, e = Date.now()) {
10
+ const r = Math.max(0, Math.round((e - t) / 1e3));
11
+ return r < 10 ? "just now" : r < 60 ? `${r}s ago` : `${Math.round(r / 60)} min ago`;
11
12
  }
12
- function F(t, e, o = Date.now()) {
13
- const n = E(t.at, o), r = e ?? (t.by ? "someone" : null);
14
- return t.kind === "create" ? r ? `New — added by ${r} ${n}` : `New — added ${n}` : r ? `Changed by ${r} ${n}` : `Changed ${n}`;
13
+ function x(t, e, r = Date.now()) {
14
+ const n = K(t.at, r), o = e ?? (t.by ? "someone" : null);
15
+ return t.kind === "create" ? o ? `New — added by ${o} ${n}` : `New — added ${n}` : o ? `Changed by ${o} ${n}` : `Changed ${n}`;
15
16
  }
16
- function Q(t, e, o = {}) {
17
- var r;
18
- if (!t || e.length === 0 || typeof window > "u") return;
19
- try {
20
- if ((r = window.matchMedia) != null && r.call(window, "(prefers-reduced-motion: reduce)").matches) return;
21
- } catch {
22
- }
23
- const n = o.strong ? 0.34 : 0.22;
24
- for (const i of e) {
25
- const a = typeof CSS < "u" && CSS.escape ? CSS.escape(i) : i.replace(/"/g, '\\"'), s = t.querySelector(`[data-row-key="${a}"]`);
26
- if (s)
27
- for (const u of Array.from(s.children)) {
28
- const c = u;
29
- typeof c.animate == "function" && c.animate(
17
+ function O(t, e, r = {}) {
18
+ if (!t || e.length === 0 || typeof window > "u" || !Q()) return;
19
+ const n = r.strong ? 0.34 : 0.22;
20
+ for (const o of e) {
21
+ const u = typeof CSS < "u" && CSS.escape ? CSS.escape(o) : o.replace(/"/g, '\\"'), c = t.querySelector(`[data-row-key="${u}"]`);
22
+ if (c)
23
+ for (const s of Array.from(c.children)) {
24
+ const i = s;
25
+ typeof i.animate == "function" && i.animate(
30
26
  [
31
27
  { boxShadow: `inset 0 0 0 9999px rgba(0, 206, 255, ${n})` },
32
28
  { boxShadow: "inset 0 0 0 9999px rgba(0, 206, 255, 0)" }
33
29
  ],
34
- { duration: o.strong ? 2600 : 1800, easing: "ease-out" }
30
+ { duration: r.strong ? 2600 : 1800, easing: "ease-out" }
35
31
  );
36
32
  }
37
33
  }
38
34
  }
39
- function x(t) {
40
- const e = k(), o = $(), [n, r] = w(() => /* @__PURE__ */ new Map()), i = t.join(",");
41
- return S(() => {
42
- let a = !0;
43
- const s = i ? i.split(",") : [];
44
- for (const u of s)
45
- o.fetchQuery({
46
- queryKey: ["live-actor-name", u.toUpperCase()],
47
- queryFn: () => j(e, u).then(
48
- (c) => [c == null ? void 0 : c.first_name, c == null ? void 0 : c.last_name].filter(Boolean).join(" ") || (c == null ? void 0 : c.email) || ""
35
+ function U(t) {
36
+ const e = k(), r = v(), [n, o] = S(() => /* @__PURE__ */ new Map()), u = t.join(",");
37
+ return w(() => {
38
+ let c = !0;
39
+ const s = u ? u.split(",") : [];
40
+ for (const i of s)
41
+ r.fetchQuery({
42
+ queryKey: ["live-actor-name", i.toUpperCase()],
43
+ queryFn: () => D(e, i).then(
44
+ (a) => [a == null ? void 0 : a.first_name, a == null ? void 0 : a.last_name].filter(Boolean).join(" ") || (a == null ? void 0 : a.email) || ""
49
45
  ),
50
46
  staleTime: 10 * 6e4
51
- }).then((c) => {
52
- !a || !c || r((l) => l.get(u) === c ? l : new Map(l).set(u, c));
47
+ }).then((a) => {
48
+ !c || !a || o((l) => l.get(i) === a ? l : new Map(l).set(i, a));
53
49
  }).catch(() => {
54
50
  });
55
51
  return () => {
56
- a = !1;
52
+ c = !1;
57
53
  };
58
- }, [i, o, e]), n;
54
+ }, [u, r, e]), n;
59
55
  }
60
- function J() {
61
- const t = y(null), e = y(/* @__PURE__ */ new Map()), [, o] = w(0), n = y([]), r = y(null), [i, a] = w([]), s = x(i), u = p(() => {
56
+ function P() {
57
+ const t = p(null), e = p(/* @__PURE__ */ new Map()), [, r] = S(0), n = p([]), o = p(null), [u, c] = S([]), s = U(u), i = y(() => {
62
58
  const d = Date.now();
63
59
  let f = !1;
64
60
  for (const [h, g] of e.current)
65
- d - g.at > (g.kind === "create" ? D : L) && (e.current.delete(h), f = !0);
66
- f && o((h) => h + 1), e.current.size > 0 ? r.current = setTimeout(u, 1e4) : r.current = null;
67
- }, []), c = p(
61
+ d - g.at > (g.kind === "create" ? F : E) && (e.current.delete(h), f = !0);
62
+ f && r((h) => h + 1), e.current.size > 0 ? o.current = setTimeout(i, 1e4) : o.current = null;
63
+ }, []), a = y(
68
64
  (d, f, h = "update") => {
69
65
  const g = Date.now();
70
66
  for (const m of d)
71
67
  m !== "*" && e.current.set(m, { at: g, by: f, kind: h });
72
- if (e.current.size > q) {
73
- const m = [...e.current.keys()].slice(0, e.current.size - q);
68
+ if (e.current.size > $) {
69
+ const m = [...e.current.keys()].slice(0, e.current.size - $);
74
70
  for (const _ of m) e.current.delete(_);
75
71
  }
76
- n.current.push({ ids: d.filter((m) => m !== "*"), strong: h === "create" }), f && a((m) => m.includes(f) ? m : [...m, f].slice(-30)), o((m) => m + 1), r.current || (r.current = setTimeout(u, 1e4));
72
+ n.current.push({ ids: d.filter((m) => m !== "*"), strong: h === "create" }), f && c((m) => m.includes(f) ? m : [...m, f].slice(-30)), r((m) => m + 1), o.current || (o.current = setTimeout(i, 1e4));
77
73
  },
78
- [u]
74
+ [i]
79
75
  );
80
- S(() => {
76
+ w(() => {
81
77
  if (n.current.length === 0) return;
82
78
  const d = n.current;
83
79
  n.current = [];
84
80
  const f = requestAnimationFrame(() => {
85
- for (const h of d) Q(t.current ?? document, h.ids, { strong: h.strong });
81
+ for (const h of d) O(t.current ?? document, h.ids, { strong: h.strong });
86
82
  });
87
83
  return () => cancelAnimationFrame(f);
88
- }), S(
84
+ }), w(
89
85
  () => () => {
90
- r.current && clearTimeout(r.current);
86
+ o.current && clearTimeout(o.current);
91
87
  },
92
88
  []
93
89
  );
94
- const l = p(
90
+ const l = y(
95
91
  (d) => {
96
92
  const f = e.current.get(d);
97
93
  if (!f) return;
98
94
  const h = f.by ? s.get(f.by) ?? null : null;
99
- return F(f, h);
95
+ return x(f, h);
100
96
  },
101
97
  // names changing re-renders the list; tooltips are read at render time
102
98
  [s]
103
- ), M = p((d) => {
104
- var f;
105
- return ((f = e.current.get(d)) == null ? void 0 : f.kind) === "create";
106
- }, []), C = p((d) => {
99
+ ), { quiet: q } = j(), M = y(
100
+ (d) => {
101
+ var f;
102
+ return !q && ((f = e.current.get(d)) == null ? void 0 : f.kind) === "create";
103
+ },
104
+ [q]
105
+ ), C = y((d) => {
107
106
  for (const f of d) e.current.delete(f);
108
107
  }, []);
109
108
  return b(
110
- () => ({ note: c, titleFor: l, isNew: M, forget: C, rootRef: t }),
111
- [c, l, M, C]
109
+ () => ({ note: a, titleFor: l, isNew: M, forget: C, rootRef: t }),
110
+ [a, l, M, C]
112
111
  );
113
112
  }
114
- function B(t, e, o = 0) {
115
- const n = k(), r = e.slice(0, 200).join(","), { data: i } = v({
116
- queryKey: ["live-row-locks", t, r, o],
113
+ function X(t, e, r = 0) {
114
+ const n = k(), o = e.slice(0, 200).join(","), { data: u } = R({
115
+ queryKey: ["live-row-locks", t, o, r],
117
116
  queryFn: () => n.request(
118
117
  A(`/item-locks/${encodeURIComponent(String(t))}/active`, {
119
- ids: r.split(",")
118
+ ids: o.split(",")
120
119
  })
121
- ).then((a) => a.data ?? []).catch(() => []),
122
- enabled: !!t && r !== "" && !String(t).startsWith("nivaro_"),
120
+ ).then((c) => c.data ?? []).catch(() => []),
121
+ enabled: !!t && o !== "" && !String(t).startsWith("nivaro_"),
123
122
  staleTime: 15e3,
124
- placeholderData: (a) => a,
123
+ placeholderData: (c) => c,
125
124
  retry: !1
126
125
  });
127
126
  return b(() => {
128
- const a = /* @__PURE__ */ new Map();
129
- for (const s of i ?? []) a.set(String(s.item), s);
130
- return a;
131
- }, [i]);
127
+ const c = /* @__PURE__ */ new Map();
128
+ for (const s of u ?? []) c.set(String(s.item), s);
129
+ return c;
130
+ }, [u]);
132
131
  }
133
- function G(t, e = 0) {
134
- const o = k(), n = /* @__PURE__ */ new Map();
132
+ function Y(t, e = 0) {
133
+ const r = k(), n = /* @__PURE__ */ new Map();
135
134
  for (const s of t) {
136
135
  if (s.collection.startsWith("nivaro_")) continue;
137
- const u = n.get(s.collection) ?? [];
138
- u.length < 200 && u.push(s.id), n.set(s.collection, u);
136
+ const i = n.get(s.collection) ?? [];
137
+ i.length < 200 && i.push(s.id), n.set(s.collection, i);
139
138
  }
140
- const r = [...n.entries()].slice(0, 12), i = T({
141
- queries: r.map(([s, u]) => ({
142
- queryKey: ["live-row-locks", s, u.join(","), e],
143
- queryFn: () => o.request(
144
- A(`/item-locks/${encodeURIComponent(s)}/active`, { ids: u })
145
- ).then((c) => c.data ?? []).catch(() => []),
139
+ const o = [...n.entries()].slice(0, 12), u = T({
140
+ queries: o.map(([s, i]) => ({
141
+ queryKey: ["live-row-locks", s, i.join(","), e],
142
+ queryFn: () => r.request(
143
+ A(`/item-locks/${encodeURIComponent(s)}/active`, { ids: i })
144
+ ).then((a) => a.data ?? []).catch(() => []),
146
145
  staleTime: 15e3,
147
- placeholderData: (c) => c,
146
+ placeholderData: (a) => a,
148
147
  retry: !1
149
148
  }))
150
- }), a = i.map((s) => s.dataUpdatedAt).join(",");
149
+ }), c = u.map((s) => s.dataUpdatedAt).join(",");
151
150
  return b(() => {
152
151
  const s = /* @__PURE__ */ new Map();
153
- return i.forEach((u, c) => {
154
- for (const l of u.data ?? []) s.set(`${r[c][0]}:${l.item}`, l);
152
+ return u.forEach((i, a) => {
153
+ for (const l of i.data ?? []) s.set(`${o[a][0]}:${l.item}`, l);
155
154
  }), s;
156
- }, [a]);
155
+ }, [c]);
157
156
  }
158
- function H(t) {
157
+ function V(t) {
159
158
  return t.is_mine ? "You are editing this" : `${t.locked_by_name ?? "Someone"} is editing this`;
160
159
  }
161
- async function X(t, e, o, n, r) {
162
- const i = /* @__PURE__ */ new Map(), a = [...new Set(o)].filter((l) => l && l !== "*").slice(0, 100);
163
- if (a.length === 0) return i;
160
+ async function Z(t, e, r, n, o) {
161
+ const u = /* @__PURE__ */ new Map(), c = [...new Set(r)].filter((l) => l && l !== "*").slice(0, 100);
162
+ if (c.length === 0) return u;
164
163
  let s = [];
165
164
  try {
166
165
  s = n ? JSON.parse(n) : [];
167
166
  } catch {
168
167
  s = [];
169
168
  }
170
- const u = [...s, { path: ["id"], op: "_in", value: a }], c = await t.request(
171
- R(`/items/${e}`, {
172
- limit: a.length,
173
- conditions: JSON.stringify(u),
174
- ...r ? { search: r } : {}
169
+ const i = [...s, { path: ["id"], op: "_in", value: c }], a = await t.request(
170
+ N(`/items/${e}`, {
171
+ limit: c.length,
172
+ conditions: JSON.stringify(i),
173
+ ...o ? { search: o } : {}
175
174
  })
176
175
  );
177
- for (const l of c.data ?? []) i.set(String(l.id), l);
178
- return i;
176
+ for (const l of a.data ?? []) u.set(String(l.id), l);
177
+ return u;
179
178
  }
180
- function Y(t) {
179
+ function ee(t) {
181
180
  const e = /* @__PURE__ */ new Set();
182
181
  if (!t) return e;
183
- const o = (n) => {
182
+ const r = (n) => {
184
183
  if (!n || typeof n != "object") return;
185
- const r = n;
186
- Array.isArray(r.path) && typeof r.path[0] == "string" && e.add(r.path[0]);
187
- for (const i of [r.or, r.and]) Array.isArray(i) && i.forEach(o);
184
+ const o = n;
185
+ Array.isArray(o.path) && typeof o.path[0] == "string" && e.add(o.path[0]);
186
+ for (const u of [o.or, o.and]) Array.isArray(u) && u.forEach(r);
188
187
  };
189
188
  try {
190
189
  const n = JSON.parse(t);
191
- Array.isArray(n) && n.forEach(o);
190
+ Array.isArray(n) && n.forEach(r);
192
191
  } catch {
193
192
  }
194
193
  return e;
195
194
  }
196
- function P(t, e) {
195
+ function te(t, e) {
197
196
  if (t.action === "create" || t.action === "delete") return !0;
198
- const o = t.changed_fields;
199
- return !o || o.length === 0 ? !0 : o.every((n) => n.startsWith("$")) || e.size === 0 ? !1 : o.some((n) => e.has(n));
197
+ const r = t.changed_fields;
198
+ return !r || r.length === 0 ? !0 : r.every((n) => n.startsWith("$")) ? !1 : e.has("$changed") ? !0 : e.size === 0 ? !1 : r.some((n) => e.has(n));
200
199
  }
201
- function V(t, e, o = {}) {
202
- const n = $(), r = y(e);
203
- r.current = e, N(
200
+ function ne(t, e, r = {}) {
201
+ const n = v(), o = p(e);
202
+ o.current = e;
203
+ const u = p(!!r.paused);
204
+ u.current = !!r.paused;
205
+ const c = p(!1);
206
+ L(
204
207
  t,
205
- (i) => {
206
- if (!i.aspectsOnly)
207
- for (const a of r.current) n.invalidateQueries({ queryKey: a });
208
+ (s) => {
209
+ if (!s.aspectsOnly) {
210
+ if (u.current) {
211
+ c.current = !0;
212
+ return;
213
+ }
214
+ for (const i of o.current) n.invalidateQueries({ queryKey: i });
215
+ }
208
216
  },
209
- { debounceMs: o.debounceMs ?? 600, enabled: o.enabled, focusable: !0 }
210
- );
217
+ { debounceMs: r.debounceMs ?? 600, enabled: r.enabled, focusable: !0 }
218
+ ), w(() => {
219
+ if (!(r.paused || !c.current)) {
220
+ c.current = !1;
221
+ for (const s of o.current) n.invalidateQueries({ queryKey: s });
222
+ }
223
+ }, [r.paused, n]);
211
224
  }
212
- function Z(t) {
225
+ function re(t) {
213
226
  const e = t == null ? void 0 : t.user_updated;
214
227
  return typeof e == "string" && e ? e : e && typeof e == "object" && typeof e.id == "string" ? e.id : null;
215
228
  }
216
229
  export {
217
- E as agoLabel,
218
- F as changeTitle,
219
- Y as conditionFields,
220
- Q as flashRows,
221
- H as lockLabel,
222
- P as mayAffectMatch,
223
- V as useLiveQueryRefresh,
224
- J as useRowChanges,
225
- B as useRowLocks,
226
- G as useRowLocksByCollection,
227
- X as viewerMatches,
228
- Z as writerOf
230
+ K as agoLabel,
231
+ x as changeTitle,
232
+ ee as conditionFields,
233
+ O as flashRows,
234
+ V as lockLabel,
235
+ te as mayAffectMatch,
236
+ U as useActorNames,
237
+ ne as useLiveQueryRefresh,
238
+ P as useRowChanges,
239
+ X as useRowLocks,
240
+ Y as useRowLocksByCollection,
241
+ Z as viewerMatches,
242
+ re as writerOf
229
243
  };
@@ -0,0 +1,51 @@
1
+ import { useQueryClient as M } from "@tanstack/react-query";
2
+ import { useRef as m, useEffect as p } from "react";
3
+ import { useLiveRecord as y, LIVE_ASPECTS as i } from "./live.js";
4
+ const R = 1500, g = /* @__PURE__ */ new Set([
5
+ i.comments,
6
+ i.tasks,
7
+ i.lock,
8
+ i.sla
9
+ ]);
10
+ function w(e) {
11
+ return e.deleted ? !1 : e.changedFields === null ? !0 : e.changedFields.some((n) => !g.has(n));
12
+ }
13
+ const a = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
14
+ function E(e, n, t = R) {
15
+ return e == null ? n : Math.max(n, e + t);
16
+ }
17
+ function L(e, n, t = {}) {
18
+ const d = M(), l = m(!!t.hold);
19
+ l.current = !!t.hold;
20
+ const o = m(!1), r = n == null ? "" : String(n), s = `${e ?? ""}${r}`, c = () => {
21
+ if (!e || !r) return;
22
+ if (l.current) {
23
+ o.current = !0;
24
+ return;
25
+ }
26
+ if (f.has(s)) return;
27
+ const u = Date.now(), h = E(a.get(s), u), v = setTimeout(
28
+ () => {
29
+ f.delete(s), a.set(s, Date.now()), a.size > 200 && a.clear(), d.invalidateQueries({ queryKey: ["pipeline-instance", e, r] }), d.invalidateQueries({ queryKey: ["pipeline-instance", e, Number(r)] });
30
+ },
31
+ Math.max(250, h - u)
32
+ );
33
+ f.set(s, v);
34
+ };
35
+ y(
36
+ e,
37
+ r || null,
38
+ (u) => {
39
+ w(u) && c();
40
+ },
41
+ { enabled: t.enabled !== !1 && !!e && !!r }
42
+ ), p(() => {
43
+ !t.hold && o.current && (o.current = !1, c());
44
+ }, [t.hold]);
45
+ }
46
+ export {
47
+ R as MOVES_GAP_MS,
48
+ w as movesMayChange,
49
+ E as nextMovesRefresh,
50
+ L as useLiveMoves
51
+ };
@@ -1,41 +1,41 @@
1
- import { useEffect as a, useRef as m, useState as h } from "react";
1
+ import { useRef as m, useEffect as l, useState as h } from "react";
2
2
  import { useLiveEvent as S } from "./live.js";
3
3
  import { useOptionalRealtime as b } from "./realtime.js";
4
- function p(t, u, s = {}) {
5
- const n = b(), r = s.enabled !== !1 && !!t;
6
- a(() => {
7
- if (!(!n || !r || !t))
8
- return n.emit("ops:join", { topic: t }), () => n.emit("ops:leave", { topic: t });
9
- }, [n, r, t]), S(
4
+ function O(t, c, n = {}) {
5
+ const s = b(), u = n.enabled !== !1 && !!t, r = m(n.match);
6
+ r.current = n.match, l(() => {
7
+ if (!(!s || !u || !t))
8
+ return s.emit("ops:join", { topic: t }), () => s.emit("ops:leave", { topic: t });
9
+ }, [s, u, t]), S(
10
10
  "ops:changed",
11
11
  (e) => {
12
- u(e ?? {});
12
+ c(e ?? {});
13
13
  },
14
14
  {
15
- enabled: r,
16
- debounceMs: s.debounceMs ?? 300,
15
+ enabled: u,
16
+ debounceMs: n.debounceMs ?? 300,
17
17
  includeOwn: !0,
18
- match: (e) => (e == null ? void 0 : e.topic) === t
18
+ match: (e) => (e == null ? void 0 : e.topic) === t && (!r.current || r.current(e ?? {}))
19
19
  }
20
20
  );
21
21
  }
22
- function O(t, u = 4e3) {
23
- const s = m(null), [n, r] = h(() => /* @__PURE__ */ new Set()), e = (t ?? []).map(String).join("\0");
24
- return a(() => {
25
- const f = new Set(e ? e.split("\0") : []), i = s.current;
26
- if (s.current = f, !i || i.size === 0) return;
27
- const c = [...f].filter((o) => !i.has(o));
28
- c.length !== 0 && (r((o) => /* @__PURE__ */ new Set([...o, ...c])), setTimeout(
29
- () => r((o) => {
30
- const l = new Set(o);
31
- for (const d of c) l.delete(d);
32
- return l;
22
+ function R(t, c = 4e3) {
23
+ const n = m(null), [s, u] = h(() => /* @__PURE__ */ new Set()), r = (t ?? []).map(String).join("\0");
24
+ return l(() => {
25
+ const e = new Set(r ? r.split("\0") : []), i = n.current;
26
+ if (n.current = e, !i || i.size === 0) return;
27
+ const f = [...e].filter((o) => !i.has(o));
28
+ f.length !== 0 && (u((o) => /* @__PURE__ */ new Set([...o, ...f])), setTimeout(
29
+ () => u((o) => {
30
+ const a = new Set(o);
31
+ for (const d of f) a.delete(d);
32
+ return a;
33
33
  }),
34
- u
34
+ c
35
35
  ));
36
- }, [e, u]), n;
36
+ }, [r, c]), s;
37
37
  }
38
38
  export {
39
- O as useFreshIds,
40
- p as useLiveOps
39
+ R as useFreshIds,
40
+ O as useLiveOps
41
41
  };
@@ -0,0 +1,7 @@
1
+ import { liveQueryMeta as r } from "./live-queries.js";
2
+ function i(e) {
3
+ return e ? r({ reads: [e], staleOnly: !0 }) : void 0;
4
+ }
5
+ export {
6
+ i as pickerOptionsMeta
7
+ };