@nivaro/react 0.3.114 → 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 (281) 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 +1717 -21
  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 +1 -0
  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/change-proposals/ChangeProposalsPanel.js +320 -0
  62. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  63. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  65. package/dist/shared/components/change-proposals/types.js +4 -0
  66. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  67. package/dist/shared/components/chat/Composer.js +276 -298
  68. package/dist/shared/components/chat/room-due.js +13 -0
  69. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  70. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  71. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  72. package/dist/shared/components/imports/ImportConsole.js +159 -155
  73. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  74. package/dist/shared/components/integrations/SendStatus.js +202 -0
  75. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  76. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  77. package/dist/shared/components/integrations/console/api.js +161 -117
  78. package/dist/shared/components/integrations/console/tone.js +15 -12
  79. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  80. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  81. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  82. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  83. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  84. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  85. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  86. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  87. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  88. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  89. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  90. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  91. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  92. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  93. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  94. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  95. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  96. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  97. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  98. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  99. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  100. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  101. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  102. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  103. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  104. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  105. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  106. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  107. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  108. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  109. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  110. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  111. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  112. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  113. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  114. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  115. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  116. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  117. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  118. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  119. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  120. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  121. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  122. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  123. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  124. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  125. package/dist/shared/components/item-edit/file-live.js +77 -0
  126. package/dist/shared/components/item-edit/file-processing.js +87 -0
  127. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  128. package/dist/shared/components/item-edit/live-related.js +23 -0
  129. package/dist/shared/components/item-edit/live-title.js +66 -0
  130. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  131. package/dist/shared/components/item-edit/removed-line.js +58 -0
  132. package/dist/shared/components/item-edit/render-stability.js +70 -59
  133. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  134. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  135. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  136. package/dist/shared/components/list/InlineEdit.js +504 -208
  137. package/dist/shared/components/list/ListViewers.js +81 -0
  138. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  139. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  140. package/dist/shared/components/merge/merge-values.js +110 -0
  141. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  142. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  143. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  144. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  145. package/dist/shared/components/notifications/bundles.js +21 -19
  146. package/dist/shared/components/notifications/resolved-line.js +25 -0
  147. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  148. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  149. package/dist/shared/components/panels/AlertBanners.js +132 -0
  150. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  151. package/dist/shared/components/panels/BranchLanes.js +82 -54
  152. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  153. package/dist/shared/components/panels/CommentImages.js +219 -0
  154. package/dist/shared/components/panels/CommentPanel.js +649 -530
  155. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  156. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  157. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  158. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  159. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  160. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  161. package/dist/shared/components/panels/SlaClock.js +130 -99
  162. package/dist/shared/components/panels/TaskPanel.js +308 -287
  163. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  164. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  165. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  166. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  167. package/dist/shared/components/profile/AgentNameField.js +141 -0
  168. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  169. package/dist/shared/components/profile/PersonAccess.js +398 -330
  170. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  171. package/dist/shared/components/profile/PersonProfile.js +81 -73
  172. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  173. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  174. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  175. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  176. package/dist/shared/components/queue/QueueWorklist.js +1927 -1635
  177. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  178. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  179. package/dist/shared/components/support/ReportProblem.js +1 -0
  180. package/dist/shared/components/support/ScreenShare.js +554 -0
  181. package/dist/shared/components/support/SupportView.js +160 -129
  182. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  183. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  184. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  185. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  186. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  187. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  188. package/dist/shared/lib/activity-sentence.js +87 -75
  189. package/dist/shared/lib/agent-presence.js +46 -0
  190. package/dist/shared/lib/approval-progress.js +49 -0
  191. package/dist/shared/lib/attention-prefs.js +27 -0
  192. package/dist/shared/lib/cell-locks.js +56 -0
  193. package/dist/shared/lib/co-edit.js +166 -0
  194. package/dist/shared/lib/coedit-registry.js +44 -0
  195. package/dist/shared/lib/comment-awareness.js +124 -0
  196. package/dist/shared/lib/comment-images.js +45 -0
  197. package/dist/shared/lib/config-watch.js +94 -0
  198. package/dist/shared/lib/copy-rules.js +65 -0
  199. package/dist/shared/lib/count-step.js +30 -0
  200. package/dist/shared/lib/deadline-ticker.js +68 -0
  201. package/dist/shared/lib/derived-causes.js +115 -0
  202. package/dist/shared/lib/draft-store.js +114 -85
  203. package/dist/shared/lib/error-hints.js +1 -0
  204. package/dist/shared/lib/field-merge.js +126 -0
  205. package/dist/shared/lib/filter-sentence.js +10 -10
  206. package/dist/shared/lib/focus-mode.js +16 -12
  207. package/dist/shared/lib/grid-cursors.js +77 -0
  208. package/dist/shared/lib/grid-presence.js +182 -0
  209. package/dist/shared/lib/idle-reload.js +100 -73
  210. package/dist/shared/lib/in-step.js +45 -0
  211. package/dist/shared/lib/integration-chip.js +19 -18
  212. package/dist/shared/lib/line-locks.js +141 -0
  213. package/dist/shared/lib/line-split.js +41 -0
  214. package/dist/shared/lib/linked-changes.js +150 -0
  215. package/dist/shared/lib/list-return.js +231 -0
  216. package/dist/shared/lib/list-viewers.js +52 -0
  217. package/dist/shared/lib/live-announcer.js +86 -0
  218. package/dist/shared/lib/live-counts.js +85 -0
  219. package/dist/shared/lib/live-data-changed.js +108 -0
  220. package/dist/shared/lib/live-deltas.js +81 -0
  221. package/dist/shared/lib/live-findings.js +113 -0
  222. package/dist/shared/lib/live-groups.js +122 -0
  223. package/dist/shared/lib/live-link-labels.js +162 -0
  224. package/dist/shared/lib/live-list-flow.js +334 -0
  225. package/dist/shared/lib/live-list.js +143 -129
  226. package/dist/shared/lib/live-moves.js +51 -0
  227. package/dist/shared/lib/live-ops.js +26 -26
  228. package/dist/shared/lib/live-pickers.js +7 -0
  229. package/dist/shared/lib/live-preference.js +184 -0
  230. package/dist/shared/lib/live-queries.js +226 -181
  231. package/dist/shared/lib/live-screen.js +333 -0
  232. package/dist/shared/lib/live-search.js +108 -0
  233. package/dist/shared/lib/live-seen.js +35 -0
  234. package/dist/shared/lib/live-views.js +100 -0
  235. package/dist/shared/lib/live.js +159 -133
  236. package/dist/shared/lib/missed-updates.js +198 -0
  237. package/dist/shared/lib/newer-file.js +56 -0
  238. package/dist/shared/lib/notification-sound.js +42 -20
  239. package/dist/shared/lib/own-writes.js +59 -41
  240. package/dist/shared/lib/picker-badges.js +94 -0
  241. package/dist/shared/lib/presence-signals.js +131 -84
  242. package/dist/shared/lib/realtime.js +49 -24
  243. package/dist/shared/lib/record-gaps.js +85 -0
  244. package/dist/shared/lib/record-outbox.js +369 -222
  245. package/dist/shared/lib/record-peek.js +75 -0
  246. package/dist/shared/lib/record-tabs.js +92 -72
  247. package/dist/shared/lib/relative-ticker.js +42 -0
  248. package/dist/shared/lib/request-gate.js +119 -119
  249. package/dist/shared/lib/rollup-recalc.js +107 -0
  250. package/dist/shared/lib/room-gaps.js +40 -36
  251. package/dist/shared/lib/rum.js +137 -87
  252. package/dist/shared/lib/save-progress.js +20 -0
  253. package/dist/shared/lib/scheduled-countdown.js +67 -0
  254. package/dist/shared/lib/screen-refresh.js +160 -0
  255. package/dist/shared/lib/screen-share.js +234 -0
  256. package/dist/shared/lib/seen-since.js +74 -0
  257. package/dist/shared/lib/selection-watch.js +205 -0
  258. package/dist/shared/lib/send-status.js +132 -0
  259. package/dist/shared/lib/send-view.js +23 -0
  260. package/dist/shared/lib/socket-liveness.js +155 -0
  261. package/dist/shared/lib/socket-realtime.js +168 -140
  262. package/dist/shared/lib/state-census.js +53 -0
  263. package/dist/shared/lib/summary-mode.js +61 -39
  264. package/dist/shared/lib/tab-attention.js +143 -32
  265. package/dist/shared/lib/table-density.js +64 -0
  266. package/dist/shared/lib/track-travel.js +40 -0
  267. package/dist/shared/lib/unseen-changes.js +68 -0
  268. package/dist/shared/lib/upload-file.js +33 -0
  269. package/dist/shared/lib/upload-presence.js +127 -0
  270. package/dist/shared/lib/urgent-chime.js +65 -0
  271. package/dist/shared/lib/use-online-users.js +32 -11
  272. package/dist/shared/lib/user-sync.js +155 -39
  273. package/dist/shared/lib/waiting-count.js +44 -0
  274. package/dist/shared/lib/watch-desktop.js +83 -0
  275. package/dist/shared/lib/watch-list.js +447 -0
  276. package/dist/shared/lib/widget-image-render.js +64 -0
  277. package/dist/shared/lib/widget-image.js +111 -0
  278. package/dist/shared/lib/worker-socket.js +130 -104
  279. package/dist/shared/lib/write-to-screen.js +133 -0
  280. package/package.json +1 -1
  281. package/styles.css +49 -1
@@ -1,50 +1,51 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
- import { useQueryClient as D, useQuery as I, useMutation as q } from "@tanstack/react-query";
3
- import { Loader2 as K, EyeOff as L, CalendarClock as Q, ChevronsUpDown as j, Check as H } from "lucide-react";
4
- import { useState as m, useId as M, useMemo as A } from "react";
5
- import { toast as g } from "sonner";
6
- import { useNivaroClient as F } from "../../context.js";
7
- import { get as B, post as O } from "../../lib/commands.js";
8
- import { userErrorMessage as U } from "../../lib/safe-error.js";
9
- import { titleCase as V, cn as W } from "../../lib/utils.js";
10
- import { PICKER_EXCLUSIONS_PAGE_KEY as z } from "../PickerExcludedRows.js";
11
- import { Button as S } from "../ui/button.js";
12
- import { Command as G, CommandInput as R, CommandList as X, CommandEmpty as Y, CommandItem as J } from "../ui/command.js";
13
- import { Input as w } from "../ui/input.js";
14
- import { Popover as E, PopoverTrigger as _, PopoverContent as P } from "../ui/popover.js";
15
- function $(i, l) {
16
- return U(i, l);
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
+ import { useQueryClient as F, useQuery as L, useMutation as O } from "@tanstack/react-query";
3
+ import { Loader2 as Q, EyeOff as I, CalendarClock as j, ChevronsUpDown as H, Check as M } from "lucide-react";
4
+ import { useState as u, useId as A, useMemo as B } from "react";
5
+ import { toast as x } from "sonner";
6
+ import { useNivaroClient as $ } from "../../context.js";
7
+ import { get as U, post as K } from "../../lib/commands.js";
8
+ import { userErrorMessage as V } from "../../lib/safe-error.js";
9
+ import { titleCase as W, cn as z } from "../../lib/utils.js";
10
+ import { PICKER_EXCLUSIONS_PAGE_KEY as G } from "../PickerExcludedRows.js";
11
+ import { Button as w } from "../ui/button.js";
12
+ import { Command as R, CommandInput as X, CommandList as Y, CommandEmpty as J, CommandItem as Z } from "../ui/command.js";
13
+ import { Input as E } from "../ui/input.js";
14
+ import { Popover as _, PopoverTrigger as P, PopoverContent as q } from "../ui/popover.js";
15
+ import { scheduledChangesKey as ee } from "./ScheduledChangeChip.js";
16
+ function T(i, r) {
17
+ return V(i, r);
17
18
  }
18
- function Z(i, l, r = {}) {
19
- const o = F(), s = D(), h = ["picker-exclusion", i, l], { data: c, isLoading: p } = I({
20
- queryKey: h,
19
+ function te(i, r, l = {}) {
20
+ const o = $(), s = F(), m = ["picker-exclusion", i, r], { data: d, isLoading: h } = L({
21
+ queryKey: m,
21
22
  queryFn: () => o.request(
22
- B(`/picker-exclusions/status/${i}/${l}`)
23
- ).then((a) => a.data),
24
- enabled: r.enabled ?? !0,
23
+ U(`/picker-exclusions/status/${i}/${r}`)
24
+ ).then((n) => n.data),
25
+ enabled: l.enabled ?? !0,
25
26
  staleTime: 6e4
26
- }), d = (c == null ? void 0 : c.excluded) ?? !1, u = q({
27
+ }), c = (d == null ? void 0 : d.excluded) ?? !1, p = O({
27
28
  mutationFn: () => {
28
- const a = { collection: i, item_id: l, layout: r.layoutSlug ?? null };
29
+ const n = { collection: i, item_id: r, layout: l.layoutSlug ?? null };
29
30
  return o.request(
30
- d ? { _method: "DELETE", _path: "/picker-exclusions", _body: a } : O("/picker-exclusions", a)
31
+ c ? { _method: "DELETE", _path: "/picker-exclusions", _body: n } : K("/picker-exclusions", n)
31
32
  );
32
33
  },
33
34
  onSuccess: () => {
34
- var a;
35
- s.invalidateQueries({ queryKey: h }), s.invalidateQueries({ queryKey: [z, i] }), g.success(d ? "Shown in pickers again" : "Hidden from pickers"), (a = r.onDone) == null || a.call(r);
35
+ var n;
36
+ s.invalidateQueries({ queryKey: m }), s.invalidateQueries({ queryKey: [G, i] }), x.success(c ? "Shown in pickers again" : "Hidden from pickers"), (n = l.onDone) == null || n.call(l);
36
37
  },
37
- onError: (a) => g.error($(a, "Could not change picker visibility"))
38
+ onError: (n) => x.error(T(n, "Could not change picker visibility"))
38
39
  });
39
- return { excluded: d, isLoading: p, toggle: u };
40
+ return { excluded: c, isLoading: h, toggle: p };
40
41
  }
41
- function pe({
42
+ function xe({
42
43
  collection: i,
43
- itemId: l,
44
- layoutSlug: r
44
+ itemId: r,
45
+ layoutSlug: l
45
46
  }) {
46
- const { excluded: o, toggle: s } = Z(i, l, { layoutSlug: r });
47
- return /* @__PURE__ */ n(
47
+ const { excluded: o, toggle: s } = te(i, r, { layoutSlug: l });
48
+ return /* @__PURE__ */ a(
48
49
  "button",
49
50
  {
50
51
  type: "button",
@@ -55,40 +56,40 @@ function pe({
55
56
  "data-tip": o ? "This record is hidden from pickers — click to offer it again" : "Hide this record from every picker that would offer it",
56
57
  className: "inline-flex items-center",
57
58
  children: [
58
- s.isPending ? /* @__PURE__ */ t(K, { className: "animate-spin" }) : /* @__PURE__ */ t(L, {}),
59
+ s.isPending ? /* @__PURE__ */ t(Q, { className: "animate-spin" }) : /* @__PURE__ */ t(I, {}),
59
60
  o ? "Show in pickers" : "Hide from pickers"
60
61
  ]
61
62
  }
62
63
  );
63
64
  }
64
- function fe({
65
+ function ye({
65
66
  collection: i,
66
- itemId: l,
67
- fields: r,
67
+ itemId: r,
68
+ fields: l,
68
69
  layoutSlug: o
69
70
  }) {
70
- const s = F(), [h, c] = m(!1), [p, d] = m(!1), [u, a] = m(""), [b, N] = m(""), [f, C] = m(""), x = M(), k = A(
71
- () => r.filter((e) => !e.field.startsWith("__") && !e.field.includes(".")).map((e) => ({ field: e.field, label: e.label || V(e.field) })),
72
- [r]
73
- ), y = k.find((e) => e.field === u), v = q({
71
+ const s = $(), m = F(), [d, h] = u(!1), [c, p] = u(!1), [n, N] = u(""), [y, C] = u(""), [f, k] = u(""), g = A(), S = B(
72
+ () => l.filter((e) => !e.field.startsWith("__") && !e.field.includes(".")).map((e) => ({ field: e.field, label: e.label || W(e.field) })),
73
+ [l]
74
+ ), b = S.find((e) => e.field === n), v = O({
74
75
  mutationFn: () => s.request(
75
- O("/scheduled-changes", {
76
+ K("/scheduled-changes", {
76
77
  collection: i,
77
- item_id: l,
78
+ item_id: r,
78
79
  change_type: "field_update",
79
- changes: { [u]: b },
80
+ changes: { [n]: y },
80
81
  // datetime-local is the viewer's local time; the API stores UTC.
81
82
  scheduled_at: new Date(f).toISOString(),
82
83
  layout: o ?? null
83
84
  })
84
85
  ),
85
86
  onSuccess: () => {
86
- c(!1), a(""), N(""), C(""), g.success("Change scheduled");
87
+ h(!1), N(""), C(""), k(""), m.invalidateQueries({ queryKey: ee(i, r) }), x.success("Change scheduled");
87
88
  },
88
- onError: (e) => g.error($(e, "Could not schedule the change"))
89
- }), T = f !== "" && !Number.isNaN(new Date(f).getTime());
90
- return /* @__PURE__ */ n(E, { open: h, onOpenChange: c, children: [
91
- /* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ n(
89
+ onError: (e) => x.error(T(e, "Could not schedule the change"))
90
+ }), D = f !== "" && !Number.isNaN(new Date(f).getTime());
91
+ return /* @__PURE__ */ a(_, { open: d, onOpenChange: h, children: [
92
+ /* @__PURE__ */ t(P, { asChild: !0, children: /* @__PURE__ */ a(
92
93
  "button",
93
94
  {
94
95
  type: "button",
@@ -96,51 +97,51 @@ function fe({
96
97
  "data-tip": "Set a field to a new value at a time you choose",
97
98
  className: "inline-flex items-center",
98
99
  children: [
99
- /* @__PURE__ */ t(Q, {}),
100
+ /* @__PURE__ */ t(j, {}),
100
101
  "Schedule a change…"
101
102
  ]
102
103
  }
103
104
  ) }),
104
- /* @__PURE__ */ n(P, { side: "left", align: "start", className: "w-80 p-4", "data-schedule-change-panel": !0, children: [
105
+ /* @__PURE__ */ a(q, { side: "left", align: "start", className: "w-80 p-4", "data-schedule-change-panel": !0, children: [
105
106
  /* @__PURE__ */ t("p", { className: "mb-3 text-[13px] font-medium", children: "Schedule a field change" }),
106
- /* @__PURE__ */ n("div", { className: "space-y-3", children: [
107
- /* @__PURE__ */ n("div", { children: [
107
+ /* @__PURE__ */ a("div", { className: "space-y-3", children: [
108
+ /* @__PURE__ */ a("div", { children: [
108
109
  /* @__PURE__ */ t("span", { className: "mb-1 block text-[11px] font-medium text-muted-foreground", children: "Field" }),
109
- /* @__PURE__ */ n(E, { open: p, onOpenChange: d, children: [
110
- /* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ n(
111
- S,
110
+ /* @__PURE__ */ a(_, { open: c, onOpenChange: p, children: [
111
+ /* @__PURE__ */ t(P, { asChild: !0, children: /* @__PURE__ */ a(
112
+ w,
112
113
  {
113
114
  type: "button",
114
115
  variant: "outline",
115
116
  role: "combobox",
116
- "aria-expanded": p,
117
+ "aria-expanded": c,
117
118
  "aria-label": "Field",
118
119
  className: "h-8 w-full justify-between text-[12px] font-normal",
119
120
  children: [
120
- /* @__PURE__ */ t("span", { className: "truncate", children: (y == null ? void 0 : y.label) ?? "Select a field…" }),
121
- /* @__PURE__ */ t(j, { className: "ml-1 h-3 w-3 shrink-0 opacity-50" })
121
+ /* @__PURE__ */ t("span", { className: "truncate", children: (b == null ? void 0 : b.label) ?? "Select a field…" }),
122
+ /* @__PURE__ */ t(H, { className: "ml-1 h-3 w-3 shrink-0 opacity-50" })
122
123
  ]
123
124
  }
124
125
  ) }),
125
- /* @__PURE__ */ t(P, { className: "w-[--radix-popover-trigger-width] p-0", align: "start", children: /* @__PURE__ */ n(G, { children: [
126
- /* @__PURE__ */ t(R, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
127
- /* @__PURE__ */ n(X, { children: [
128
- /* @__PURE__ */ t(Y, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No field matches" }),
129
- k.map((e) => /* @__PURE__ */ n(
130
- J,
126
+ /* @__PURE__ */ t(q, { className: "w-[--radix-popover-trigger-width] p-0", align: "start", children: /* @__PURE__ */ a(R, { children: [
127
+ /* @__PURE__ */ t(X, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
128
+ /* @__PURE__ */ a(Y, { children: [
129
+ /* @__PURE__ */ t(J, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No field matches" }),
130
+ S.map((e) => /* @__PURE__ */ a(
131
+ Z,
131
132
  {
132
133
  value: `${e.label} ${e.field}`,
133
134
  onSelect: () => {
134
- a(e.field), d(!1);
135
+ N(e.field), p(!1);
135
136
  },
136
137
  className: "text-[12px]",
137
138
  children: [
138
139
  /* @__PURE__ */ t(
139
- H,
140
+ M,
140
141
  {
141
- className: W(
142
+ className: z(
142
143
  "mr-2 h-3.5 w-3.5",
143
- u === e.field ? "opacity-100" : "opacity-0"
144
+ n === e.field ? "opacity-100" : "opacity-0"
144
145
  )
145
146
  }
146
147
  ),
@@ -154,52 +155,52 @@ function fe({
154
155
  ] }) })
155
156
  ] })
156
157
  ] }),
157
- /* @__PURE__ */ n("div", { children: [
158
+ /* @__PURE__ */ a("div", { children: [
158
159
  /* @__PURE__ */ t(
159
160
  "label",
160
161
  {
161
- htmlFor: `${x}-value`,
162
+ htmlFor: `${g}-value`,
162
163
  className: "mb-1 block text-[11px] font-medium text-muted-foreground",
163
164
  children: "New value"
164
165
  }
165
166
  ),
166
167
  /* @__PURE__ */ t(
167
- w,
168
+ E,
168
169
  {
169
- id: `${x}-value`,
170
- value: b,
171
- onChange: (e) => N(e.target.value),
170
+ id: `${g}-value`,
171
+ value: y,
172
+ onChange: (e) => C(e.target.value),
172
173
  className: "h-8 text-[12px]"
173
174
  }
174
175
  )
175
176
  ] }),
176
- /* @__PURE__ */ n("div", { children: [
177
+ /* @__PURE__ */ a("div", { children: [
177
178
  /* @__PURE__ */ t(
178
179
  "label",
179
180
  {
180
- htmlFor: `${x}-at`,
181
+ htmlFor: `${g}-at`,
181
182
  className: "mb-1 block text-[11px] font-medium text-muted-foreground",
182
183
  children: "When"
183
184
  }
184
185
  ),
185
186
  /* @__PURE__ */ t(
186
- w,
187
+ E,
187
188
  {
188
- id: `${x}-at`,
189
+ id: `${g}-at`,
189
190
  type: "datetime-local",
190
191
  value: f,
191
- onChange: (e) => C(e.target.value),
192
+ onChange: (e) => k(e.target.value),
192
193
  className: "h-8 text-[12px]"
193
194
  }
194
195
  )
195
196
  ] }),
196
197
  /* @__PURE__ */ t(
197
- S,
198
+ w,
198
199
  {
199
200
  type: "button",
200
201
  size: "sm",
201
202
  className: "h-8 w-full bg-nvr-cyan text-[12px] text-white hover:bg-nvr-cyan/90",
202
- disabled: !u || !b || !T || v.isPending,
203
+ disabled: !n || !y || !D || v.isPending,
203
204
  onClick: () => v.mutate(),
204
205
  children: v.isPending ? "Scheduling…" : "Schedule change"
205
206
  }
@@ -209,7 +210,7 @@ function fe({
209
210
  ] });
210
211
  }
211
212
  export {
212
- pe as PickerExclusionToggle,
213
- fe as ScheduleChangeButton,
214
- Z as usePickerExclusion
213
+ xe as PickerExclusionToggle,
214
+ ye as ScheduleChangeButton,
215
+ te as usePickerExclusion
215
216
  };
@@ -0,0 +1,70 @@
1
+ import { jsx as a, jsxs as g, Fragment as k } from "react/jsx-runtime";
2
+ import { useQueryClient as x, useQuery as v } from "@tanstack/react-query";
3
+ import { LifeBuoy as $ } from "lucide-react";
4
+ import { useNivaroClient as C, useNavigation as q } from "../../context.js";
5
+ import { get as N } from "../../lib/commands.js";
6
+ import { useLiveRecordQueries as w, LIVE_ASPECTS as A } from "../../lib/live.js";
7
+ const h = (e, t) => [
8
+ "record-help",
9
+ e,
10
+ t
11
+ ];
12
+ function H(e) {
13
+ const t = Array.isArray(e == null ? void 0 : e.tickets) ? e.tickets[0] : void 0;
14
+ if (!e || !t) return null;
15
+ const i = e.tickets.length - 1, c = t.requested_by, n = c ? `Help requested by ${c}` : "Help requested";
16
+ return i > 0 ? `${n} +${i}` : n;
17
+ }
18
+ function y(e) {
19
+ const t = e.tickets[0];
20
+ if (!t) return "";
21
+ const i = t.status === "in_progress" ? t.assignee ? `${t.assignee} is on it` : "In progress" : "Waiting for the support team";
22
+ return `“${t.title}” · ${i}`;
23
+ }
24
+ function Q({ collection: e, itemId: t }) {
25
+ var f;
26
+ const i = C(), c = x(), n = q(), o = t && t !== "new" ? String(t) : null, { data: s } = v({
27
+ queryKey: h(e, o ?? ""),
28
+ queryFn: () => i.request(
29
+ N(`/support/record/${encodeURIComponent(e)}/${encodeURIComponent(o ?? "")}`)
30
+ ).then((r) => {
31
+ var b;
32
+ return Array.isArray((b = r == null ? void 0 : r.data) == null ? void 0 : b.tickets) ? r.data : null;
33
+ }).catch(() => null),
34
+ enabled: !!o && !/^(nivaro_|directus_)/.test(e),
35
+ staleTime: 6e4,
36
+ retry: !1
37
+ });
38
+ w(e, o, [h(e, o ?? "")], {
39
+ aspects: [A.support],
40
+ includeOwn: !0,
41
+ client: c
42
+ });
43
+ const d = H(s);
44
+ if (!s || !d) return null;
45
+ const l = s.tickets[0], u = l ? ((f = n.consoleUrl) == null ? void 0 : f.call(n, `/support?ticket=${l.id}`)) ?? (n.consoleUrl ? null : `/support?ticket=${l.id}`) : null, p = "nvr-fade-in relative inline-flex max-w-[16rem] shrink-0 items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-px text-[10.5px] font-medium text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200", m = /* @__PURE__ */ g(k, { children: [
46
+ /* @__PURE__ */ a($, { className: "h-3 w-3 shrink-0 text-amber-600 dark:text-amber-300", "aria-hidden": !0 }),
47
+ /* @__PURE__ */ a("span", { className: "truncate sm:hidden", "aria-hidden": !0, children: "Help requested" }),
48
+ /* @__PURE__ */ a("span", { className: "hidden truncate sm:inline", children: d }),
49
+ /* @__PURE__ */ a("span", { className: "sr-only sm:hidden", children: d })
50
+ ] });
51
+ return u ? /* @__PURE__ */ a(
52
+ "a",
53
+ {
54
+ href: u,
55
+ "data-record-help": s.open,
56
+ "data-tip": y(s),
57
+ onClick: (r) => {
58
+ r.metaKey || r.ctrlKey || r.shiftKey || /^https?:/.test(u) || (r.preventDefault(), n.navigate(u));
59
+ },
60
+ className: `${p} hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400 dark:hover:bg-amber-500/20`,
61
+ children: m
62
+ }
63
+ ) : /* @__PURE__ */ a("span", { "data-record-help": s.open, "data-tip": y(s), className: p, children: m });
64
+ }
65
+ export {
66
+ Q as RecordHelpChip,
67
+ H as helpChipText,
68
+ y as helpChipTip,
69
+ h as recordHelpKey
70
+ };