@nivaro/react 0.3.114 → 0.3.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1728 -22
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4909 -4182
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +612 -551
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/OverflowRail.js +326 -0
  39. package/dist/shared/components/PageRenderer.js +636 -599
  40. package/dist/shared/components/PresenceDot.js +21 -0
  41. package/dist/shared/components/ProfileView.js +656 -536
  42. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  43. package/dist/shared/components/RecentRecordsRail.js +51 -48
  44. package/dist/shared/components/RecordCompare.js +241 -150
  45. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  46. package/dist/shared/components/RecordGridEditor.js +350 -311
  47. package/dist/shared/components/RecordHoverCard.js +147 -0
  48. package/dist/shared/components/RecordPeekHost.js +111 -0
  49. package/dist/shared/components/RecordReadView.js +414 -412
  50. package/dist/shared/components/RelativeTime.js +16 -0
  51. package/dist/shared/components/ReportView.js +1396 -1304
  52. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  53. package/dist/shared/components/TabCountHost.js +10 -0
  54. package/dist/shared/components/TickerNumber.js +19 -18
  55. package/dist/shared/components/TipLayer.js +70 -58
  56. package/dist/shared/components/WidgetImageMenu.js +59 -0
  57. package/dist/shared/components/WidgetSlot.js +571 -524
  58. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  59. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  60. package/dist/shared/components/cbv/approval-changed.js +20 -0
  61. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/SignalCard.js +84 -77
  79. package/dist/shared/components/integrations/console/api.js +161 -117
  80. package/dist/shared/components/integrations/console/tone.js +15 -12
  81. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  82. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  83. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  84. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  85. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  86. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  87. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  88. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  89. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  90. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  91. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  92. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  93. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  94. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  95. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  96. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  97. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  98. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  99. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  100. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  101. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  102. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  103. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  104. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  105. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  106. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  107. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  108. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  109. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  110. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  111. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  112. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  113. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  114. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  115. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  116. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  117. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  118. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  119. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  120. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  121. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  122. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  123. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  124. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  125. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  126. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  127. package/dist/shared/components/item-edit/file-live.js +77 -0
  128. package/dist/shared/components/item-edit/file-processing.js +87 -0
  129. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  130. package/dist/shared/components/item-edit/live-related.js +23 -0
  131. package/dist/shared/components/item-edit/live-title.js +66 -0
  132. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  133. package/dist/shared/components/item-edit/removed-line.js +58 -0
  134. package/dist/shared/components/item-edit/render-stability.js +70 -59
  135. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  136. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  137. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  138. package/dist/shared/components/list/InlineEdit.js +504 -208
  139. package/dist/shared/components/list/ListViewers.js +81 -0
  140. package/dist/shared/components/list/PhonePager.js +50 -0
  141. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  142. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  143. package/dist/shared/components/merge/merge-values.js +110 -0
  144. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  145. package/dist/shared/components/notifications/NotificationCenterView.js +389 -323
  146. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  147. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  148. package/dist/shared/components/notifications/bundles.js +21 -19
  149. package/dist/shared/components/notifications/resolved-line.js +25 -0
  150. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  151. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  152. package/dist/shared/components/panels/AlertBanners.js +132 -0
  153. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  154. package/dist/shared/components/panels/BranchLanes.js +82 -54
  155. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  156. package/dist/shared/components/panels/CommentImages.js +219 -0
  157. package/dist/shared/components/panels/CommentPanel.js +649 -530
  158. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  159. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  160. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  161. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  162. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  163. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  164. package/dist/shared/components/panels/SlaClock.js +130 -99
  165. package/dist/shared/components/panels/TaskPanel.js +308 -287
  166. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  167. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  168. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  169. package/dist/shared/components/pipeline/PipelineEditorView.js +2050 -1942
  170. package/dist/shared/components/profile/AgentNameField.js +141 -0
  171. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  172. package/dist/shared/components/profile/PersonAccess.js +398 -330
  173. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  174. package/dist/shared/components/profile/PersonProfile.js +81 -73
  175. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  176. package/dist/shared/components/queue/OwnerAvatars.js +9 -9
  177. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  178. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  179. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  180. package/dist/shared/components/queue/QueueWorklist.js +2407 -1950
  181. package/dist/shared/components/queue/worklist-helpers.js +10 -6
  182. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  183. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  184. package/dist/shared/components/support/ReportProblem.js +1 -0
  185. package/dist/shared/components/support/ScreenShare.js +554 -0
  186. package/dist/shared/components/support/SupportView.js +160 -129
  187. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  188. package/dist/shared/components/ui/popover.js +53 -29
  189. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  190. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  191. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  192. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  193. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  194. package/dist/shared/lib/activity-sentence.js +87 -75
  195. package/dist/shared/lib/agent-presence.js +46 -0
  196. package/dist/shared/lib/approval-progress.js +49 -0
  197. package/dist/shared/lib/attention-prefs.js +27 -0
  198. package/dist/shared/lib/cell-locks.js +56 -0
  199. package/dist/shared/lib/co-edit.js +166 -0
  200. package/dist/shared/lib/coedit-registry.js +44 -0
  201. package/dist/shared/lib/comment-awareness.js +124 -0
  202. package/dist/shared/lib/comment-images.js +45 -0
  203. package/dist/shared/lib/config-watch.js +94 -0
  204. package/dist/shared/lib/copy-rules.js +65 -0
  205. package/dist/shared/lib/count-step.js +30 -0
  206. package/dist/shared/lib/deadline-ticker.js +68 -0
  207. package/dist/shared/lib/derived-causes.js +115 -0
  208. package/dist/shared/lib/draft-store.js +114 -85
  209. package/dist/shared/lib/error-hints.js +1 -0
  210. package/dist/shared/lib/field-merge.js +126 -0
  211. package/dist/shared/lib/filter-sentence.js +10 -10
  212. package/dist/shared/lib/focus-mode.js +16 -12
  213. package/dist/shared/lib/grid-cursors.js +77 -0
  214. package/dist/shared/lib/grid-presence.js +182 -0
  215. package/dist/shared/lib/idle-reload.js +100 -73
  216. package/dist/shared/lib/in-step.js +45 -0
  217. package/dist/shared/lib/integration-chip.js +19 -18
  218. package/dist/shared/lib/keep-row-focus.js +43 -0
  219. package/dist/shared/lib/line-locks.js +141 -0
  220. package/dist/shared/lib/line-split.js +41 -0
  221. package/dist/shared/lib/linked-changes.js +150 -0
  222. package/dist/shared/lib/list-return.js +231 -0
  223. package/dist/shared/lib/list-viewers.js +52 -0
  224. package/dist/shared/lib/live-announcer.js +86 -0
  225. package/dist/shared/lib/live-counts.js +85 -0
  226. package/dist/shared/lib/live-data-changed.js +108 -0
  227. package/dist/shared/lib/live-deltas.js +81 -0
  228. package/dist/shared/lib/live-findings.js +113 -0
  229. package/dist/shared/lib/live-groups.js +122 -0
  230. package/dist/shared/lib/live-link-labels.js +162 -0
  231. package/dist/shared/lib/live-list-flow.js +334 -0
  232. package/dist/shared/lib/live-list.js +143 -129
  233. package/dist/shared/lib/live-moves.js +51 -0
  234. package/dist/shared/lib/live-ops.js +26 -26
  235. package/dist/shared/lib/live-pickers.js +7 -0
  236. package/dist/shared/lib/live-preference.js +184 -0
  237. package/dist/shared/lib/live-queries.js +226 -181
  238. package/dist/shared/lib/live-screen.js +333 -0
  239. package/dist/shared/lib/live-search.js +108 -0
  240. package/dist/shared/lib/live-seen.js +35 -0
  241. package/dist/shared/lib/live-views.js +100 -0
  242. package/dist/shared/lib/live.js +159 -133
  243. package/dist/shared/lib/missed-updates.js +198 -0
  244. package/dist/shared/lib/newer-file.js +56 -0
  245. package/dist/shared/lib/notification-sound.js +42 -20
  246. package/dist/shared/lib/obligation-banner.js +17 -17
  247. package/dist/shared/lib/own-writes.js +59 -41
  248. package/dist/shared/lib/picker-badges.js +94 -0
  249. package/dist/shared/lib/presence-signals.js +131 -84
  250. package/dist/shared/lib/rail-menu-context.js +9 -0
  251. package/dist/shared/lib/realtime.js +49 -24
  252. package/dist/shared/lib/record-gaps.js +85 -0
  253. package/dist/shared/lib/record-outbox.js +369 -222
  254. package/dist/shared/lib/record-peek.js +75 -0
  255. package/dist/shared/lib/record-tabs.js +92 -72
  256. package/dist/shared/lib/relative-ticker.js +42 -0
  257. package/dist/shared/lib/request-gate.js +119 -119
  258. package/dist/shared/lib/rollup-recalc.js +107 -0
  259. package/dist/shared/lib/room-gaps.js +40 -36
  260. package/dist/shared/lib/row-surface.js +7 -0
  261. package/dist/shared/lib/rum.js +137 -87
  262. package/dist/shared/lib/save-progress.js +20 -0
  263. package/dist/shared/lib/scheduled-countdown.js +67 -0
  264. package/dist/shared/lib/screen-refresh.js +160 -0
  265. package/dist/shared/lib/screen-share.js +234 -0
  266. package/dist/shared/lib/seen-since.js +74 -0
  267. package/dist/shared/lib/selection-watch.js +205 -0
  268. package/dist/shared/lib/send-status.js +132 -0
  269. package/dist/shared/lib/send-view.js +23 -0
  270. package/dist/shared/lib/socket-liveness.js +155 -0
  271. package/dist/shared/lib/socket-realtime.js +168 -140
  272. package/dist/shared/lib/state-census.js +53 -0
  273. package/dist/shared/lib/summary-mode.js +61 -39
  274. package/dist/shared/lib/tab-attention.js +143 -32
  275. package/dist/shared/lib/table-density.js +64 -0
  276. package/dist/shared/lib/table-pins.js +20 -18
  277. package/dist/shared/lib/track-travel.js +40 -0
  278. package/dist/shared/lib/unseen-changes.js +68 -0
  279. package/dist/shared/lib/upload-file.js +62 -0
  280. package/dist/shared/lib/upload-presence.js +127 -0
  281. package/dist/shared/lib/urgent-chime.js +65 -0
  282. package/dist/shared/lib/use-below-md.js +29 -0
  283. package/dist/shared/lib/use-online-users.js +32 -11
  284. package/dist/shared/lib/user-sync.js +155 -39
  285. package/dist/shared/lib/waiting-count.js +44 -0
  286. package/dist/shared/lib/watch-desktop.js +83 -0
  287. package/dist/shared/lib/watch-list.js +447 -0
  288. package/dist/shared/lib/widget-image-render.js +64 -0
  289. package/dist/shared/lib/widget-image.js +111 -0
  290. package/dist/shared/lib/worker-socket.js +130 -104
  291. package/dist/shared/lib/write-to-screen.js +133 -0
  292. package/package.json +1 -1
  293. package/styles.css +49 -1
@@ -0,0 +1,87 @@
1
+ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
+ import { useQueryClient as p, useQuery as h } from "@tanstack/react-query";
3
+ import { Loader2 as c } from "lucide-react";
4
+ import { useRef as w } from "react";
5
+ import { useNivaroClient as b } from "../../context.js";
6
+ import { get as x } from "../../lib/commands.js";
7
+ import { useLiveRecordEvent as y } from "../../lib/live.js";
8
+ const S = 3e3, L = 12e4, P = "w=160&h=160&fit=cover&format=webp&q=80";
9
+ function I(e) {
10
+ return !e || /^(blob|data):/i.test(e) || e.includes("?") ? e : `${e}/transform?${P}`;
11
+ }
12
+ function u(e) {
13
+ const t = /* @__PURE__ */ new Set();
14
+ for (const [s, i] of Object.entries(e ?? {}))
15
+ (i == null ? void 0 : i.status) === "processing" && t.add(s.toLowerCase());
16
+ return t;
17
+ }
18
+ function C(e, t, s = Date.now()) {
19
+ return e === 0 ? !1 : s - t < L ? S : !1;
20
+ }
21
+ function R(e, t) {
22
+ const s = b(), i = p(), o = [...new Set(e.map((n) => String(n).toLowerCase()))].sort(), l = ["file-processing", o.join(",")], m = w(Date.now()), { data: d } = h({
23
+ queryKey: l,
24
+ queryFn: () => s.request(
25
+ x("/files/processing", { ids: o.join(",") })
26
+ ).then((n) => n.data ?? {}).catch(() => ({})),
27
+ enabled: o.length > 0,
28
+ staleTime: 1e4,
29
+ refetchInterval: (n) => C(
30
+ u(n.state.data).size,
31
+ m.current
32
+ )
33
+ });
34
+ y(
35
+ "file:processed",
36
+ (t == null ? void 0 : t.collection) ?? null,
37
+ (t == null ? void 0 : t.itemId) ?? null,
38
+ (n) => {
39
+ const a = String((n == null ? void 0 : n.file) ?? "").toLowerCase();
40
+ a && o.includes(a) && i.invalidateQueries({ queryKey: ["file-processing"] });
41
+ },
42
+ { includeOwn: !0 }
43
+ );
44
+ const f = u(d);
45
+ return { isProcessing: (n) => f.has(String(n).toLowerCase()) };
46
+ }
47
+ function F() {
48
+ return /* @__PURE__ */ g(
49
+ "span",
50
+ {
51
+ "data-file-processing": !0,
52
+ role: "status",
53
+ className: "inline-flex shrink-0 items-center gap-1 rounded bg-slate-100 px-1.5 py-0.5 text-[10px] font-medium text-slate-600 dark:bg-white/10 dark:text-slate-300",
54
+ children: [
55
+ /* @__PURE__ */ r(c, { className: "h-2.5 w-2.5 animate-spin motion-reduce:animate-none", "aria-hidden": !0 }),
56
+ "Processing…"
57
+ ]
58
+ }
59
+ );
60
+ }
61
+ function E({ className: e }) {
62
+ return /* @__PURE__ */ r(
63
+ "div",
64
+ {
65
+ "data-file-thumb-processing": !0,
66
+ className: `flex shrink-0 items-center justify-center rounded bg-slate-100 dark:bg-white/10 ${e ?? "h-10 w-10"}`,
67
+ children: /* @__PURE__ */ r(
68
+ c,
69
+ {
70
+ className: "h-4 w-4 animate-spin text-slate-400 motion-reduce:animate-none dark:text-slate-500",
71
+ "aria-hidden": !0
72
+ }
73
+ )
74
+ }
75
+ );
76
+ }
77
+ export {
78
+ P as CHIP_THUMB_QUERY,
79
+ F as FileProcessingBadge,
80
+ E as FileProcessingTile,
81
+ L as PROCESSING_POLL_FOR_MS,
82
+ S as PROCESSING_POLL_MS,
83
+ I as chipThumbUrl,
84
+ C as pollDelay,
85
+ u as processingIds,
86
+ R as useFileProcessing
87
+ };
@@ -0,0 +1,148 @@
1
+ import { useState as v, useRef as p, useEffect as F, useLayoutEffect as q } from "react";
2
+ function j(t, n) {
3
+ return t.deleted || !n || n.length === 0 ? !1 : t.changedFields === null ? !t.aspectsOnly : t.changedFields.some((e) => n.includes(e));
4
+ }
5
+ function A(t, n) {
6
+ const e = (t ?? []).find((u) => u.field === n);
7
+ return e ? e.hidden ? "hidden" : e.readonly ? "readonly" : "editable" : "absent";
8
+ }
9
+ const B = (t, n) => {
10
+ if (t === n || (t == null || t === "") && (n == null || n === "")) return !0;
11
+ try {
12
+ return JSON.stringify(t) === JSON.stringify(n);
13
+ } catch {
14
+ return !1;
15
+ }
16
+ };
17
+ function H(t, n, e) {
18
+ const u = [], r = [];
19
+ for (const o of Object.keys(t)) {
20
+ if (o.startsWith("$") || o.startsWith("__") || B(t[o], n[o])) continue;
21
+ const l = A(e, o);
22
+ l === "editable" ? u.push(o) : r.push({ field: o, status: l });
23
+ }
24
+ return { keep: u, held: r };
25
+ }
26
+ function J(t, n, e, u) {
27
+ const r = /* @__PURE__ */ new Set([...t.keys(), ...n.keys()]), o = [];
28
+ for (const l of r) {
29
+ const s = t.get(l) ?? [], f = [...n.get(l) ?? []];
30
+ if (s.length === 0 && f.length === 0) continue;
31
+ const i = e.get(l);
32
+ if (!i) continue;
33
+ const d = A(u, i);
34
+ d !== "editable" && o.push({ field: i, stagingKey: l, status: d, links: [...s], unlinks: f });
35
+ }
36
+ return o;
37
+ }
38
+ function M(t, n) {
39
+ const e = [];
40
+ return t > 0 && e.push(`${t} link${t === 1 ? "" : "s"} added`), n > 0 && e.push(`${n} link${n === 1 ? "" : "s"} removed`), e.join(" · ") || "No change";
41
+ }
42
+ function U(t) {
43
+ const n = t == null ? void 0 : t.trim();
44
+ return n ? `Form updated for ${n}` : "Form updated";
45
+ }
46
+ function O(t) {
47
+ let n = (t == null ? void 0 : t.parentElement) ?? null;
48
+ for (; n && n !== document.body; ) {
49
+ const e = getComputedStyle(n);
50
+ if (/(auto|scroll)/.test(e.overflowY) && n.scrollHeight > n.clientHeight) return n;
51
+ n = n.parentElement;
52
+ }
53
+ return document.scrollingElement ?? null;
54
+ }
55
+ function C(t) {
56
+ try {
57
+ return document.querySelector(`[data-field="${CSS.escape(t)}"]`);
58
+ } catch {
59
+ return null;
60
+ }
61
+ }
62
+ function I() {
63
+ var l, s;
64
+ if (typeof document > "u") return null;
65
+ const t = [...document.querySelectorAll("[data-field]")];
66
+ if (t.length === 0) return null;
67
+ const n = O(t[0]), e = n && n !== document.scrollingElement ? n.getBoundingClientRect().top : 0, u = [];
68
+ for (const f of t) {
69
+ const i = f.getBoundingClientRect();
70
+ if (i.height === 0 || i.bottom <= e) continue;
71
+ const d = f.getAttribute("data-field");
72
+ if (!(!d || u.some((a) => a.key === d)) && (u.push({ key: d, top: i.top - e }), u.length >= 6))
73
+ break;
74
+ }
75
+ const r = document.activeElement, o = ((s = (l = r == null ? void 0 : r.closest) == null ? void 0 : l.call(r, "[data-field]")) == null ? void 0 : s.getAttribute("data-field")) ?? null;
76
+ return { fields: u, focused: o, scroller: n };
77
+ }
78
+ function R(t) {
79
+ if (!t || typeof document > "u") return !1;
80
+ const n = t.scroller, e = n && n !== document.scrollingElement ? n.getBoundingClientRect().top : 0;
81
+ let u = !1;
82
+ for (const r of t.fields) {
83
+ const o = C(r.key);
84
+ if (!o) continue;
85
+ const l = o.getBoundingClientRect().top - e - r.top;
86
+ Math.abs(l) >= 1 && (n ? n.scrollTop += l : window.scrollBy(0, l)), u = !0;
87
+ break;
88
+ }
89
+ if (t.focused) {
90
+ const r = C(t.focused);
91
+ if (r && !r.contains(document.activeElement)) {
92
+ const o = r.querySelector(
93
+ 'input:not([type=hidden]):not([disabled]), textarea:not([disabled]), [role="combobox"], [contenteditable="true"]'
94
+ );
95
+ o == null || o.focus({ preventScroll: !0 });
96
+ }
97
+ }
98
+ return u;
99
+ }
100
+ function W(t, n) {
101
+ var g, y, h;
102
+ const [e, u] = v(t), [r, o] = v(null), l = p(e);
103
+ l.current = e;
104
+ const s = p(n);
105
+ s.current = n;
106
+ const f = p(null), i = p(0);
107
+ F(() => {
108
+ var w, E;
109
+ const c = l.current, m = ((w = t == null ? void 0 : t.layout) == null ? void 0 : w.id) ?? null, $ = ((E = c == null ? void 0 : c.layout) == null ? void 0 : E.id) ?? null;
110
+ if (!s.current.enabled || c === void 0 || t === void 0 || m === $) {
111
+ t !== c && u(t);
112
+ return;
113
+ }
114
+ if (t === null || m == null) {
115
+ u(t);
116
+ return;
117
+ }
118
+ let S = !1;
119
+ const k = ++i.current;
120
+ return s.current.prepare(m).catch(() => null).then((x) => {
121
+ if (S || k !== i.current) return;
122
+ f.current = I();
123
+ const b = { from: c ?? null, to: t, n: k };
124
+ s.current.onSwitch(b, x), u(t), o(b);
125
+ }), () => {
126
+ S = !0;
127
+ };
128
+ }, [t]);
129
+ const a = t == null || e === void 0 || !n.enabled || (((g = t == null ? void 0 : t.layout) == null ? void 0 : g.id) ?? null) === (((y = e == null ? void 0 : e.layout) == null ? void 0 : y.id) ?? null) ? t : e, T = ((h = a == null ? void 0 : a.layout) == null ? void 0 : h.id) ?? null;
130
+ return q(() => {
131
+ const c = f.current;
132
+ if (c && (f.current = null, !R(c))) {
133
+ const m = requestAnimationFrame(() => R(c));
134
+ return () => cancelAnimationFrame(m);
135
+ }
136
+ }, [T]), { shown: a, last: r };
137
+ }
138
+ export {
139
+ I as captureFormAnchor,
140
+ A as fieldStatus,
141
+ U as formUpdatedText,
142
+ j as layoutMayChange,
143
+ M as linkChangeText,
144
+ R as restoreFormAnchor,
145
+ J as splitStagedLinks,
146
+ H as splitUnsaved,
147
+ W as useSmoothLayout
148
+ };
@@ -0,0 +1,23 @@
1
+ const o = (t, n) => t != null && String(t) === n;
2
+ function f(t, n) {
3
+ return (e) => {
4
+ const r = e[0];
5
+ return r === "o2m-rows" || r === "o2m-field-snapshots" || r === "m2m-items" ? o(e[3], n) : r === "rrv-related" || r === "record-links" || r === "record-graph" ? e[1] === t && o(e[2], n) : r === "o2m-compare";
6
+ };
7
+ }
8
+ function i(t, n) {
9
+ return (e) => {
10
+ const r = e[0];
11
+ return r === "m2m-items" ? o(e[3], n) : r === "file-usage" || r === "file-download-stats" ? e[1] === t && o(e[2], n) : r === "files-meta" || r === "file-meta" || r === "file-health";
12
+ };
13
+ }
14
+ const a = 3e3;
15
+ function l(t = Math.random) {
16
+ return Math.floor(t() * a);
17
+ }
18
+ export {
19
+ a as WIDE_RELATED_SPREAD_MS,
20
+ i as fileQueryOfRecord,
21
+ f as relatedQueryOfRecord,
22
+ l as wideSpreadDelay
23
+ };
@@ -0,0 +1,66 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useQueryClient as m } from "@tanstack/react-query";
3
+ import { useRef as d, useEffect as l, useState as v } from "react";
4
+ import { useLiveRecord as p } from "../../lib/live.js";
5
+ function h(e) {
6
+ if (!e) return [];
7
+ const n = [];
8
+ for (const i of e.matchAll(/\{\{\s*([A-Za-z_][\w]*)/g))
9
+ n.includes(i[1]) || n.push(i[1]);
10
+ return n;
11
+ }
12
+ const g = (e) => e == null || e === "";
13
+ function y(e, n, i) {
14
+ if (!e.own || e.deleted || !i || n.length === 0) return !1;
15
+ const t = e.changedFields;
16
+ return (t === null ? n : n.filter((r) => t.includes(r))).some((r) => g(i[r]));
17
+ }
18
+ function T(e, n, i, t) {
19
+ const r = [...new Set(i.map((s) => s.split(".")[0]))].map((s) => {
20
+ const o = t == null ? void 0 : t[s];
21
+ return o != null && typeof o == "object" ? String(o.id ?? "") : String(o ?? "");
22
+ });
23
+ return ["item-heading-links", e, n, i.join(","), r.join("|")];
24
+ }
25
+ function _(e, n, i, t, u) {
26
+ const r = m(), s = d(t);
27
+ s.current = t;
28
+ const o = h(i);
29
+ p(
30
+ u && o.length > 0 ? e : null,
31
+ n,
32
+ (c) => {
33
+ !e || n == null || y(c, o, s.current) && r.invalidateQueries({ queryKey: ["item", e, String(n)] });
34
+ },
35
+ { includeOwn: !0, match: (c) => c.own }
36
+ );
37
+ }
38
+ function C(e) {
39
+ const [n, i] = v(0), t = d(void 0);
40
+ return l(() => {
41
+ t.current !== void 0 && t.current && e && t.current !== e && i((u) => u + 1), e && (t.current = e);
42
+ }, [e]), n;
43
+ }
44
+ const S = "@keyframes nvr-live-title-in{from{opacity:.35}to{opacity:1}}[data-live-title-changed]{animation:nvr-live-title-in .6s ease-out both}@media (prefers-reduced-motion:reduce){[data-live-title-changed]{animation:none}}";
45
+ let a = !1;
46
+ function j() {
47
+ if (a || typeof document > "u") return;
48
+ a = !0;
49
+ const e = document.createElement("style");
50
+ e.setAttribute("data-nvr-live-title", ""), e.textContent = S, document.head.appendChild(e);
51
+ }
52
+ function k({ text: e }) {
53
+ const n = C(e);
54
+ return l(() => {
55
+ n > 0 && j();
56
+ }, [n]), /* @__PURE__ */ f("span", { "data-live-title-changed": n > 0 ? "" : void 0, children: e }, n);
57
+ }
58
+ export {
59
+ S as LIVE_TITLE_FADE_CSS,
60
+ k as LiveTitleText,
61
+ h as headingFieldNames,
62
+ T as headingLinksKey,
63
+ y as ownBatchFillsHeading,
64
+ C as useChangeKey,
65
+ _ as useLiveHeadingFill
66
+ };
@@ -0,0 +1,142 @@
1
+ import { jsxs as w, jsx as g } from "react/jsx-runtime";
2
+ import { useQuery as _, keepPreviousData as J } from "@tanstack/react-query";
3
+ import { Send as O } from "lucide-react";
4
+ import { useContext as L, createContext as q, useState as j, useRef as F, useCallback as A, useMemo as T } from "react";
5
+ import { useNivaroClient as B } from "../../context.js";
6
+ import { useDebounced as R } from "../../hooks/useDebounced.js";
7
+ import { post as H } from "../../lib/commands.js";
8
+ import { cn as V } from "../../lib/utils.js";
9
+ const G = q(null), oe = () => L(G), Q = 600;
10
+ function ae(e) {
11
+ return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && "id" in e ? e.id == null : !1;
12
+ }
13
+ function k(e) {
14
+ return Array.isArray(e) ? e.map(k) : e && typeof e == "object" && "id" in e ? e.id : e instanceof Date ? e.toISOString() : e;
15
+ }
16
+ function U(e, t, i) {
17
+ var m;
18
+ const p = {};
19
+ for (const n of (e == null ? void 0 : e.record) ?? []) n in t && (p[n] = k(t[n]));
20
+ const l = {};
21
+ for (const [n, x] of i) {
22
+ const h = (m = e == null ? void 0 : e.lines[n]) == null ? void 0 : m.fields;
23
+ h && (l[n] = x.map((u) => {
24
+ const c = {};
25
+ for (const f of h) f in u.values && (c[f] = k(u.values[f]));
26
+ return { key: u.key, values: c };
27
+ }));
28
+ }
29
+ return JSON.stringify({ values: p, lines: l });
30
+ }
31
+ function z(e) {
32
+ const [t, ...i] = e.partners;
33
+ return `Needed by ${t ?? "a partner"}${i.length ? ` + ${i.length}` : ""}`;
34
+ }
35
+ function C(e) {
36
+ const t = e.partners.join(", ") || "A partner system", i = e.steps.length ? ` at ${e.steps.join(" / ")}` : " at a later step";
37
+ return `${t} needs this${i}. Fill it in now so the step does not stop on it later.`;
38
+ }
39
+ const W = {}, X = {}, Y = {};
40
+ function de(e) {
41
+ const t = B(), { collection: i, itemId: p, enabled: l, draft: m } = e, [n, x] = j(null), [h, u] = j(/* @__PURE__ */ new Map()), c = F(/* @__PURE__ */ new Map()), f = A((o, a) => {
42
+ if (a === null) {
43
+ if (!c.current.has(o)) return;
44
+ c.current.delete(o), u((r) => {
45
+ const N = new Map(r);
46
+ return N.delete(o), N;
47
+ });
48
+ return;
49
+ }
50
+ const d = JSON.stringify(a);
51
+ c.current.get(o) !== d && (c.current.set(o, d), u((r) => new Map(r).set(o, a)));
52
+ }, []), I = l ? U(n, m, h) : "", y = R(I, Q), M = _({
53
+ queryKey: ["partner-needs", i, p ?? "new", y],
54
+ enabled: l && !!i && y !== "",
55
+ staleTime: 3e4,
56
+ retry: !1,
57
+ placeholderData: J,
58
+ queryFn: async () => {
59
+ const o = JSON.parse(y), a = await t.request(
60
+ H(`/partner-needs/${i}`, { item: p, ...o })
61
+ ).catch(() => null), d = (a == null ? void 0 : a.data) ?? null;
62
+ return d != null && d.inputs && x((r) => {
63
+ const N = /* @__PURE__ */ new Set([...(r == null ? void 0 : r.record) ?? [], ...d.inputs.record]), b = { ...(r == null ? void 0 : r.lines) ?? {} };
64
+ for (const [D, $] of Object.entries(d.inputs.lines)) {
65
+ const S = b[D];
66
+ b[D] = { ...$, fields: [.../* @__PURE__ */ new Set([...(S == null ? void 0 : S.fields) ?? [], ...$.fields])] };
67
+ }
68
+ const E = { record: [...N].sort(), lines: b };
69
+ return JSON.stringify(E) === JSON.stringify(r) ? r : E;
70
+ }), d;
71
+ }
72
+ }), s = l ? M.data : null, P = A((o) => {
73
+ var a;
74
+ return (a = n == null ? void 0 : n.lines[o]) == null ? void 0 : a.fields;
75
+ }, [n]);
76
+ return T(() => l ? {
77
+ fields: (s == null ? void 0 : s.fields) ?? W,
78
+ hints: (s == null ? void 0 : s.hints) ?? X,
79
+ lines: (s == null ? void 0 : s.lines) ?? Y,
80
+ lineInputs: P,
81
+ reportLines: f
82
+ } : null, [l, s, P, f]);
83
+ }
84
+ const Z = "inline-flex max-w-full items-center gap-1 rounded-full border border-indigo-200 bg-indigo-50 px-1.5 py-px text-[10px] font-medium leading-4 text-indigo-700 dark:border-indigo-400/25 dark:bg-indigo-400/10 dark:text-indigo-200";
85
+ function le({ field: e, mark: t }) {
86
+ return /* @__PURE__ */ w(
87
+ "span",
88
+ {
89
+ "data-partner-need": e,
90
+ "data-tip": C(t),
91
+ className: V(Z, "cursor-default"),
92
+ children: [
93
+ /* @__PURE__ */ g(O, { className: "h-2.5 w-2.5 shrink-0", "aria-hidden": "true" }),
94
+ /* @__PURE__ */ g("span", { className: "truncate", children: z(t) })
95
+ ]
96
+ }
97
+ );
98
+ }
99
+ function ce({ field: e, label: t }) {
100
+ return /* @__PURE__ */ w(
101
+ "p",
102
+ {
103
+ "data-partner-need-hint": e,
104
+ className: "flex items-center gap-1 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400",
105
+ children: [
106
+ /* @__PURE__ */ g(O, { className: "h-3 w-3 shrink-0 text-indigo-400 dark:text-indigo-300", "aria-hidden": "true" }),
107
+ "Pick a ",
108
+ t,
109
+ " to see what it needs."
110
+ ]
111
+ }
112
+ );
113
+ }
114
+ function ue({ field: e, mark: t }) {
115
+ return /* @__PURE__ */ w(
116
+ "span",
117
+ {
118
+ "data-partner-need-cell": e,
119
+ "data-tip": C(t),
120
+ className: "pointer-events-auto absolute right-1 top-1/2 inline-flex -translate-y-1/2 items-center gap-0.5 rounded border border-indigo-200 bg-indigo-50 px-1 text-[9.5px] font-medium leading-4 text-indigo-700 dark:border-indigo-400/25 dark:bg-indigo-400/10 dark:text-indigo-200",
121
+ children: [
122
+ /* @__PURE__ */ g(O, { className: "h-2 w-2 shrink-0", "aria-hidden": "true" }),
123
+ /* @__PURE__ */ g("span", { className: "sr-only", children: "Needed by " }),
124
+ t.partners[0] ?? "Partner",
125
+ t.partners.length > 1 ? ` +${t.partners.length - 1}` : ""
126
+ ]
127
+ }
128
+ );
129
+ }
130
+ export {
131
+ Q as PARTNER_NEEDS_DEBOUNCE_MS,
132
+ le as PartnerNeedBadge,
133
+ ue as PartnerNeedCellMark,
134
+ ce as PartnerNeedHint,
135
+ G as PartnerNeedsContext,
136
+ ae as isEmptyValue,
137
+ z as needLabel,
138
+ C as needTip,
139
+ U as partnerNeedsSignature,
140
+ oe as usePartnerNeeds,
141
+ de as usePartnerNeedsForm
142
+ };
@@ -0,0 +1,58 @@
1
+ const l = /* @__PURE__ */ new Set(["id", "sort", "date_created", "date_updated", "user_created", "user_updated"]);
2
+ function d(e, i, n, r = /* @__PURE__ */ new Set()) {
3
+ const t = {}, u = e ?? {}, a = (c) => {
4
+ for (const [s, o] of Object.entries(c ?? {})) {
5
+ if (l.has(s) || r.has(s) || s.startsWith("$") || s.startsWith("__") || o !== null && typeof o == "object" && !Array.isArray(o)) continue;
6
+ const f = u[s];
7
+ if (String(o ?? "") === String(f ?? "")) {
8
+ delete t[s];
9
+ continue;
10
+ }
11
+ t[s] = o;
12
+ }
13
+ };
14
+ return a(n), a(i), t;
15
+ }
16
+ function h(e, i, n) {
17
+ const r = e.indexOf(n);
18
+ if (r < 0) return null;
19
+ for (let t = r + 1; t < e.length; t++) if (i.has(e[t])) return e[t];
20
+ for (let t = r - 1; t >= 0; t--) if (i.has(e[t])) return e[t];
21
+ return null;
22
+ }
23
+ function p(e, i) {
24
+ if (!e) return "This line was removed";
25
+ if (e.user_id && i && e.user_id.toUpperCase() === i.toUpperCase())
26
+ return "You removed this line in another tab";
27
+ if (e.via === "outside") return "This line was removed outside the app";
28
+ const n = String(e.who ?? "").trim();
29
+ return n ? `${n.charAt(0).toUpperCase()}${n.slice(1)} removed this line` : "This line was removed";
30
+ }
31
+ function v(e) {
32
+ return String(e ?? "").replace(/^[\s·•|,;:–—-]+|[\s·•|,;:–—-]+$/g, "").replace(/\s*·\s*·\s*/g, " · ");
33
+ }
34
+ function g(e, i) {
35
+ const n = {};
36
+ for (const [r, t] of Object.entries({ ...e, ...i }))
37
+ if (!Array.isArray(t)) {
38
+ if (t !== null && typeof t == "object") {
39
+ const u = t.id;
40
+ u != null && (n[r] = u);
41
+ continue;
42
+ }
43
+ n[r] = t;
44
+ }
45
+ return n;
46
+ }
47
+ function j(e, i) {
48
+ return Object.entries(e).map(([n, r]) => `${i(n)}: ${r == null ? "" : String(r)}`).join(`
49
+ `);
50
+ }
51
+ export {
52
+ v as cleanLineLabel,
53
+ h as nextLineAfter,
54
+ p as removedLineText,
55
+ g as restorableLine,
56
+ d as unsavedLineChanges,
57
+ j as unsavedLineText
58
+ };