@nivaro/react 0.3.113 → 0.3.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1727 -19
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4088 -3592
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +544 -504
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/PageRenderer.js +636 -599
  39. package/dist/shared/components/PresenceDot.js +21 -0
  40. package/dist/shared/components/ProfileView.js +656 -536
  41. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  42. package/dist/shared/components/RecentRecordsRail.js +51 -48
  43. package/dist/shared/components/RecordCompare.js +241 -150
  44. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  45. package/dist/shared/components/RecordGridEditor.js +350 -311
  46. package/dist/shared/components/RecordHoverCard.js +147 -0
  47. package/dist/shared/components/RecordPeekHost.js +111 -0
  48. package/dist/shared/components/RecordReadView.js +414 -412
  49. package/dist/shared/components/RelativeTime.js +16 -0
  50. package/dist/shared/components/ReportView.js +1396 -1304
  51. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  52. package/dist/shared/components/TabCountHost.js +10 -0
  53. package/dist/shared/components/TickerNumber.js +19 -18
  54. package/dist/shared/components/TipLayer.js +70 -58
  55. package/dist/shared/components/WidgetImageMenu.js +59 -0
  56. package/dist/shared/components/WidgetSlot.js +571 -524
  57. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  58. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  59. package/dist/shared/components/cbv/approval-changed.js +20 -0
  60. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  61. package/dist/shared/components/cbv/column-totals.js +75 -67
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/api.js +161 -117
  79. package/dist/shared/components/integrations/console/tone.js +15 -12
  80. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  81. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  82. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  83. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  84. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  85. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  86. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  87. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  88. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  89. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  90. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  91. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  92. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  93. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  94. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  95. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  96. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  97. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  98. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  99. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  100. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  101. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  102. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  103. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  104. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  105. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  106. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  107. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  108. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  109. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  110. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  111. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  112. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  113. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  114. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  115. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  116. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  117. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  118. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  119. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  120. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  121. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  122. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  123. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  124. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  125. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  126. package/dist/shared/components/item-edit/file-live.js +77 -0
  127. package/dist/shared/components/item-edit/file-processing.js +87 -0
  128. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  129. package/dist/shared/components/item-edit/live-related.js +23 -0
  130. package/dist/shared/components/item-edit/live-title.js +66 -0
  131. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  132. package/dist/shared/components/item-edit/removed-line.js +58 -0
  133. package/dist/shared/components/item-edit/render-stability.js +70 -59
  134. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  135. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  136. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  137. package/dist/shared/components/list/InlineEdit.js +504 -208
  138. package/dist/shared/components/list/ListViewers.js +81 -0
  139. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  140. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  141. package/dist/shared/components/merge/merge-values.js +110 -0
  142. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  143. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  144. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  145. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  146. package/dist/shared/components/notifications/bundles.js +21 -19
  147. package/dist/shared/components/notifications/resolved-line.js +25 -0
  148. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  149. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  150. package/dist/shared/components/panels/AlertBanners.js +132 -0
  151. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  152. package/dist/shared/components/panels/BranchLanes.js +82 -54
  153. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  154. package/dist/shared/components/panels/CommentImages.js +219 -0
  155. package/dist/shared/components/panels/CommentPanel.js +649 -530
  156. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  157. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  158. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  159. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  160. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  161. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  162. package/dist/shared/components/panels/SlaClock.js +130 -99
  163. package/dist/shared/components/panels/TaskPanel.js +308 -287
  164. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  165. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  166. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  167. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  168. package/dist/shared/components/profile/AgentNameField.js +141 -0
  169. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  170. package/dist/shared/components/profile/PersonAccess.js +398 -330
  171. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  172. package/dist/shared/components/profile/PersonProfile.js +81 -73
  173. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  174. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  175. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  176. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  177. package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
  178. package/dist/shared/components/queue/queue-totals.js +92 -0
  179. package/dist/shared/components/queue/worklist-helpers.js +18 -14
  180. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  181. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  182. package/dist/shared/components/support/ReportProblem.js +1 -0
  183. package/dist/shared/components/support/ScreenShare.js +554 -0
  184. package/dist/shared/components/support/SupportView.js +160 -129
  185. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  186. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  187. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  188. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  189. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  190. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  191. package/dist/shared/lib/activity-sentence.js +87 -75
  192. package/dist/shared/lib/agent-presence.js +46 -0
  193. package/dist/shared/lib/approval-progress.js +49 -0
  194. package/dist/shared/lib/attention-prefs.js +27 -0
  195. package/dist/shared/lib/cell-locks.js +56 -0
  196. package/dist/shared/lib/co-edit.js +166 -0
  197. package/dist/shared/lib/coedit-registry.js +44 -0
  198. package/dist/shared/lib/comment-awareness.js +124 -0
  199. package/dist/shared/lib/comment-images.js +45 -0
  200. package/dist/shared/lib/config-watch.js +94 -0
  201. package/dist/shared/lib/copy-rules.js +65 -0
  202. package/dist/shared/lib/count-step.js +30 -0
  203. package/dist/shared/lib/deadline-ticker.js +68 -0
  204. package/dist/shared/lib/derived-causes.js +115 -0
  205. package/dist/shared/lib/draft-store.js +114 -85
  206. package/dist/shared/lib/error-hints.js +1 -0
  207. package/dist/shared/lib/field-merge.js +126 -0
  208. package/dist/shared/lib/filter-sentence.js +10 -10
  209. package/dist/shared/lib/focus-mode.js +16 -12
  210. package/dist/shared/lib/grid-cursors.js +77 -0
  211. package/dist/shared/lib/grid-presence.js +182 -0
  212. package/dist/shared/lib/idle-reload.js +100 -73
  213. package/dist/shared/lib/in-step.js +45 -0
  214. package/dist/shared/lib/integration-chip.js +19 -18
  215. package/dist/shared/lib/line-locks.js +141 -0
  216. package/dist/shared/lib/line-split.js +41 -0
  217. package/dist/shared/lib/linked-changes.js +150 -0
  218. package/dist/shared/lib/list-link.js +56 -50
  219. package/dist/shared/lib/list-return.js +231 -0
  220. package/dist/shared/lib/list-viewers.js +52 -0
  221. package/dist/shared/lib/live-announcer.js +86 -0
  222. package/dist/shared/lib/live-counts.js +85 -0
  223. package/dist/shared/lib/live-data-changed.js +108 -0
  224. package/dist/shared/lib/live-deltas.js +81 -0
  225. package/dist/shared/lib/live-findings.js +113 -0
  226. package/dist/shared/lib/live-groups.js +122 -0
  227. package/dist/shared/lib/live-link-labels.js +162 -0
  228. package/dist/shared/lib/live-list-flow.js +334 -0
  229. package/dist/shared/lib/live-list.js +143 -129
  230. package/dist/shared/lib/live-moves.js +51 -0
  231. package/dist/shared/lib/live-ops.js +26 -26
  232. package/dist/shared/lib/live-pickers.js +7 -0
  233. package/dist/shared/lib/live-preference.js +184 -0
  234. package/dist/shared/lib/live-queries.js +226 -181
  235. package/dist/shared/lib/live-screen.js +333 -0
  236. package/dist/shared/lib/live-search.js +108 -0
  237. package/dist/shared/lib/live-seen.js +35 -0
  238. package/dist/shared/lib/live-views.js +100 -0
  239. package/dist/shared/lib/live.js +159 -133
  240. package/dist/shared/lib/missed-updates.js +198 -0
  241. package/dist/shared/lib/newer-file.js +56 -0
  242. package/dist/shared/lib/notification-sound.js +42 -20
  243. package/dist/shared/lib/own-writes.js +59 -41
  244. package/dist/shared/lib/picker-badges.js +94 -0
  245. package/dist/shared/lib/presence-signals.js +131 -84
  246. package/dist/shared/lib/realtime.js +49 -24
  247. package/dist/shared/lib/record-gaps.js +85 -0
  248. package/dist/shared/lib/record-outbox.js +369 -222
  249. package/dist/shared/lib/record-peek.js +75 -0
  250. package/dist/shared/lib/record-tabs.js +92 -72
  251. package/dist/shared/lib/relative-ticker.js +42 -0
  252. package/dist/shared/lib/request-gate.js +119 -119
  253. package/dist/shared/lib/rollup-recalc.js +107 -0
  254. package/dist/shared/lib/room-gaps.js +40 -36
  255. package/dist/shared/lib/rum.js +137 -87
  256. package/dist/shared/lib/save-progress.js +20 -0
  257. package/dist/shared/lib/scheduled-countdown.js +67 -0
  258. package/dist/shared/lib/screen-refresh.js +160 -0
  259. package/dist/shared/lib/screen-share.js +234 -0
  260. package/dist/shared/lib/seen-since.js +74 -0
  261. package/dist/shared/lib/selection-watch.js +205 -0
  262. package/dist/shared/lib/send-status.js +132 -0
  263. package/dist/shared/lib/send-view.js +23 -0
  264. package/dist/shared/lib/socket-liveness.js +155 -0
  265. package/dist/shared/lib/socket-realtime.js +168 -140
  266. package/dist/shared/lib/state-census.js +53 -0
  267. package/dist/shared/lib/summary-mode.js +61 -39
  268. package/dist/shared/lib/tab-attention.js +143 -32
  269. package/dist/shared/lib/table-density.js +64 -0
  270. package/dist/shared/lib/track-travel.js +40 -0
  271. package/dist/shared/lib/unseen-changes.js +68 -0
  272. package/dist/shared/lib/upload-file.js +33 -0
  273. package/dist/shared/lib/upload-presence.js +127 -0
  274. package/dist/shared/lib/urgent-chime.js +65 -0
  275. package/dist/shared/lib/use-online-users.js +32 -11
  276. package/dist/shared/lib/user-sync.js +155 -39
  277. package/dist/shared/lib/waiting-count.js +44 -0
  278. package/dist/shared/lib/watch-desktop.js +83 -0
  279. package/dist/shared/lib/watch-list.js +447 -0
  280. package/dist/shared/lib/widget-image-render.js +64 -0
  281. package/dist/shared/lib/widget-image.js +111 -0
  282. package/dist/shared/lib/worker-socket.js +130 -104
  283. package/dist/shared/lib/write-to-screen.js +133 -0
  284. package/package.json +1 -1
  285. package/styles.css +49 -1
@@ -1,73 +1,81 @@
1
- import { jsx as u, Fragment as h, jsxs as _ } from "react/jsx-runtime";
2
- import { useQuery as v, useQueryClient as q } from "@tanstack/react-query";
3
- import { useMemo as w } from "react";
4
- import { useNivaroClient as T, useNavigation as $, defaultItemUrl as k } from "../context.js";
5
- import { get as g } from "../lib/commands.js";
6
- import { useLiveRecord as N, batchTouches as R, LIVE_ASPECTS as E } from "../lib/live.js";
7
- import { chatRoomTypesQuery as I } from "./chat/chat-core.js";
8
- const S = String.raw`\b([A-Za-z]{2,4}\d{2}(?:INV)?-\d+)\b`, A = String.raw`\b([a-z][a-z0-9_]{2,})\/(\d{1,12})\b`, C = [];
9
- function j() {
10
- const t = T(), { data: r } = v(I(t));
11
- return r ?? C;
1
+ import { jsx as a, Fragment as g, jsxs as N } from "react/jsx-runtime";
2
+ import { useQuery as k, useQueryClient as E } from "@tanstack/react-query";
3
+ import { useMemo as I } from "react";
4
+ import { useNivaroClient as w, useNavigation as $, defaultItemUrl as b } from "../context.js";
5
+ import { get as x } from "../lib/commands.js";
6
+ import { useLiveRecord as S, batchTouches as C, LIVE_ASPECTS as A } from "../lib/live.js";
7
+ import { useRecordPeek as _, peekDecision as q } from "../lib/record-peek.js";
8
+ import { chatRoomTypesQuery as P } from "./chat/chat-core.js";
9
+ import { RecordHoverCard as R } from "./RecordHoverCard.js";
10
+ const j = String.raw`\b([A-Za-z]{2,4}\d{2}(?:INV)?-\d+)\b`, U = String.raw`\b([a-z][a-z0-9_]{2,})\/(\d{1,12})\b`, M = [];
11
+ function O() {
12
+ const t = w(), { data: i } = k(P(t));
13
+ return i ?? M;
12
14
  }
13
- function P({ token: t, plain: r }) {
14
- const c = T(), l = $(), n = j(), { data: e } = v({
15
+ function Q({ token: t, plain: i }) {
16
+ const m = w(), l = $(), n = _(), r = O(), { data: e } = k({
15
17
  queryKey: ["nvr-record-token", t],
16
18
  queryFn: async () => {
17
- var i, x, m, p;
18
- for (const d of n)
19
+ var u, f, s, h;
20
+ for (const p of r)
19
21
  try {
20
- const y = (x = (i = (await c.request(
21
- g(`/items/${d.collection}`, {
22
+ const y = (f = (u = (await m.request(
23
+ x(`/items/${p.collection}`, {
22
24
  limit: 1,
23
25
  fields: "id",
24
- filter: JSON.stringify({ [d.match_field]: { _eq: t } })
26
+ filter: JSON.stringify({ [p.match_field]: { _eq: t } })
25
27
  })
26
- )).data) == null ? void 0 : i[0]) == null ? void 0 : x.id;
28
+ )).data) == null ? void 0 : u[0]) == null ? void 0 : f.id;
27
29
  if (y == null) continue;
28
- let s = null;
30
+ let d = null;
29
31
  try {
30
- s = ((p = (m = (await c.request(
31
- g(`/pipelines/instance/${d.collection}/${y}`)
32
- )).data) == null ? void 0 : m.instance) == null ? void 0 : p.current_state_obj) ?? null;
32
+ d = ((h = (s = (await m.request(
33
+ x(`/pipelines/instance/${p.collection}/${y}`)
34
+ )).data) == null ? void 0 : s.instance) == null ? void 0 : h.current_state_obj) ?? null;
33
35
  } catch {
34
36
  }
35
37
  return {
36
- collection: d.collection,
38
+ collection: p.collection,
37
39
  id: y,
38
- state: (s == null ? void 0 : s.label) ?? null,
39
- color: (s == null ? void 0 : s.color) ?? null
40
+ state: (d == null ? void 0 : d.label) ?? null,
41
+ color: (d == null ? void 0 : d.color) ?? null
40
42
  };
41
43
  } catch {
42
44
  }
43
45
  return null;
44
46
  },
45
- enabled: n.length > 0,
47
+ enabled: r.length > 0,
46
48
  staleTime: 10 * 6e4
47
- }), a = q();
48
- if (N(
49
+ }), c = E();
50
+ if (S(
49
51
  e == null ? void 0 : e.collection,
50
52
  e == null ? void 0 : e.id,
51
- (i) => {
52
- R(i, E.state) && a.invalidateQueries({ queryKey: ["nvr-record-token", t] });
53
+ (u) => {
54
+ C(u, A.state) && c.invalidateQueries({ queryKey: ["nvr-record-token", t] });
53
55
  },
54
56
  { includeOwn: !0, debounceMs: 400 }
55
- ), !e) return /* @__PURE__ */ u(h, { children: t });
56
- if (r) return /* @__PURE__ */ u("span", { className: "font-medium", children: t });
57
- const o = { collection: e.collection, itemId: String(e.id) };
58
- return /* @__PURE__ */ _(
57
+ ), !e) return /* @__PURE__ */ a(g, { children: t });
58
+ if (i) return /* @__PURE__ */ a("span", { className: "font-medium", children: t });
59
+ const o = { collection: e.collection, itemId: String(e.id) }, T = (u) => {
60
+ var s;
61
+ const f = n ? q(u, !0, o.collection) : null;
62
+ if (f === "peek" && n) return n.open(o);
63
+ if (f === "new-tab") {
64
+ window.open((l.itemUrl ?? b)(o), "_blank", "noopener");
65
+ return;
66
+ }
67
+ (s = l.openItem) != null && s.call(l, o) || l.navigate((l.itemUrl ?? b)(o));
68
+ };
69
+ return /* @__PURE__ */ a(R, { collection: e.collection, id: e.id, children: /* @__PURE__ */ N(
59
70
  "button",
60
71
  {
61
72
  type: "button",
62
- onClick: () => {
63
- var i;
64
- (i = l.openItem) != null && i.call(l, o) || l.navigate((l.itemUrl ?? k)(o));
65
- },
73
+ onClick: T,
66
74
  className: "inline-flex max-w-full items-center gap-1 align-baseline font-medium text-nvr-navy underline decoration-nvr-cyan/50 decoration-[1.5px] underline-offset-2 hover:decoration-nvr-cyan dark:text-nvr-cyan",
67
75
  "data-record-token": t,
68
76
  children: [
69
77
  t,
70
- e.state && /* @__PURE__ */ u(
78
+ e.state && /* @__PURE__ */ a(
71
79
  "span",
72
80
  {
73
81
  className: "inline-flex items-center rounded-full px-1.5 py-px text-[9px] font-semibold leading-tight",
@@ -80,89 +88,94 @@ function P({ token: t, plain: r }) {
80
88
  )
81
89
  ]
82
90
  }
83
- );
91
+ ) });
84
92
  }
85
- function M(t, r) {
86
- return t ? t.replace(/\{\{\s*([\w.[\]]+)\s*\}\}/g, (c, l) => {
87
- let n = r;
88
- for (const e of l.replace(/\[(\d+)\]/g, ".$1").split(".")) {
93
+ function z(t, i) {
94
+ return t ? t.replace(/\{\{\s*([\w.[\]]+)\s*\}\}/g, (m, l) => {
95
+ let n = i;
96
+ for (const r of l.replace(/\[(\d+)\]/g, ".$1").split(".")) {
89
97
  if (n == null || typeof n != "object") return "";
90
- n = n[e];
98
+ n = n[r];
91
99
  }
92
100
  return n == null ? "" : String(n);
93
101
  }).replace(/\s+/g, " ").trim() : "";
94
102
  }
95
- function O({
103
+ function F({
96
104
  collection: t,
97
- id: r,
98
- raw: c,
105
+ id: i,
106
+ raw: m,
99
107
  plain: l
100
108
  }) {
101
- const n = T(), e = $(), { data: a } = v({
102
- queryKey: ["nvr-record-path", t, r],
109
+ const n = w(), r = $(), e = _(), { data: c } = k({
110
+ queryKey: ["nvr-record-path", t, i],
103
111
  queryFn: async () => {
104
- var i;
112
+ var u;
105
113
  try {
106
- const m = ((i = (await n.request(
107
- g(`/collections/${t}`)
108
- )).data) == null ? void 0 : i.display_template) ?? null, p = [...(m ?? "").matchAll(/\{\{\s*([\w.[\]]+)/g)].map((s) => s[1]), d = m ? ["id", ...p.map((s) => s.replace(/\[\d+\]/g, ""))].join(",") : void 0, b = await n.request(
109
- g(
110
- `/items/${t}/${r}`,
111
- d ? { fields: d } : {}
114
+ const s = ((u = (await n.request(
115
+ x(`/collections/${t}`)
116
+ )).data) == null ? void 0 : u.display_template) ?? null, h = [...(s ?? "").matchAll(/\{\{\s*([\w.[\]]+)/g)].map((d) => d[1]), p = s ? ["id", ...h.map((d) => d.replace(/\[\d+\]/g, ""))].join(",") : void 0, v = await n.request(
117
+ x(
118
+ `/items/${t}/${i}`,
119
+ p ? { fields: p } : {}
112
120
  )
113
121
  );
114
- return b.data ? { label: M(m, b.data) || `#${r}` } : null;
122
+ return v.data ? { label: z(s, v.data) || `#${i}` } : null;
115
123
  } catch {
116
124
  return null;
117
125
  }
118
126
  },
119
127
  staleTime: 10 * 6e4
120
128
  });
121
- if (!a) return /* @__PURE__ */ u(h, { children: c });
122
- if (l) return /* @__PURE__ */ u("span", { className: "font-medium", children: a.label });
123
- const o = { collection: t, itemId: r };
124
- return /* @__PURE__ */ u(
129
+ if (!c) return /* @__PURE__ */ a(g, { children: m });
130
+ if (l) return /* @__PURE__ */ a("span", { className: "font-medium", children: c.label });
131
+ const o = { collection: t, itemId: i };
132
+ return /* @__PURE__ */ a(R, { collection: t, id: i, children: /* @__PURE__ */ a(
125
133
  "button",
126
134
  {
127
135
  type: "button",
128
- onClick: () => {
129
- var i;
130
- (i = e.openItem) != null && i.call(e, o) || e.navigate((e.itemUrl ?? k)(o));
136
+ onClick: (u) => {
137
+ var s;
138
+ const f = e ? q(u, !0, o.collection) : null;
139
+ if (f === "peek" && e) return e.open(o);
140
+ if (f === "new-tab") {
141
+ window.open((r.itemUrl ?? b)(o), "_blank", "noopener");
142
+ return;
143
+ }
144
+ (s = r.openItem) != null && s.call(r, o) || r.navigate((r.itemUrl ?? b)(o));
131
145
  },
132
146
  className: "inline-flex max-w-full items-center align-baseline font-medium text-nvr-navy underline decoration-nvr-cyan/50 decoration-[1.5px] underline-offset-2 hover:decoration-nvr-cyan dark:text-nvr-cyan",
133
- "data-record-path": c,
134
- "data-tip": c,
135
- children: a.label
147
+ "data-record-path": m,
148
+ children: c.label
136
149
  }
137
- );
150
+ ) });
138
151
  }
139
- function H({ text: t, plain: r }) {
152
+ function W({ text: t, plain: i }) {
140
153
  var l;
141
- const c = w(() => {
142
- const n = new RegExp(`${S}|${A}`, "g"), e = [];
143
- let a = 0;
144
- for (const o of t.matchAll(n)) {
145
- const f = o.index ?? 0;
146
- f > a && e.push({ kind: "text", text: t.slice(a, f) }), o[1] !== void 0 ? e.push({ kind: "entity", text: o[0] }) : e.push({ kind: "path", text: o[0], collection: o[2], id: o[3] }), a = f + o[0].length;
154
+ const m = I(() => {
155
+ const n = new RegExp(`${j}|${U}`, "g"), r = [];
156
+ let e = 0;
157
+ for (const c of t.matchAll(n)) {
158
+ const o = c.index ?? 0;
159
+ o > e && r.push({ kind: "text", text: t.slice(e, o) }), c[1] !== void 0 ? r.push({ kind: "entity", text: c[0] }) : r.push({ kind: "path", text: c[0], collection: c[2], id: c[3] }), e = o + c[0].length;
147
160
  }
148
- return a < t.length && e.push({ kind: "text", text: t.slice(a) }), e;
161
+ return e < t.length && r.push({ kind: "text", text: t.slice(e) }), r;
149
162
  }, [t]);
150
- return c.length === 1 && ((l = c[0]) == null ? void 0 : l.kind) === "text" ? /* @__PURE__ */ u(h, { children: t }) : /* @__PURE__ */ u(h, { children: c.map(
151
- (n, e) => n.kind === "entity" ? /* @__PURE__ */ u(P, { token: n.text, plain: r }, `${n.text}-${e}`) : n.kind === "path" ? /* @__PURE__ */ u(
152
- O,
163
+ return m.length === 1 && ((l = m[0]) == null ? void 0 : l.kind) === "text" ? /* @__PURE__ */ a(g, { children: t }) : /* @__PURE__ */ a(g, { children: m.map(
164
+ (n, r) => n.kind === "entity" ? /* @__PURE__ */ a(Q, { token: n.text, plain: i }, `${n.text}-${r}`) : n.kind === "path" ? /* @__PURE__ */ a(
165
+ F,
153
166
  {
154
167
  collection: n.collection,
155
168
  id: n.id,
156
169
  raw: n.text,
157
- plain: r
170
+ plain: i
158
171
  },
159
- `${n.text}-${e}`
172
+ `${n.text}-${r}`
160
173
  ) : (
161
174
  // biome-ignore lint/suspicious/noArrayIndexKey: static segment list
162
- /* @__PURE__ */ u("span", { children: n.text }, e)
175
+ /* @__PURE__ */ a("span", { children: n.text }, r)
163
176
  )
164
177
  ) });
165
178
  }
166
179
  export {
167
- H as AutolinkedText
180
+ W as AutolinkedText
168
181
  };