@nivaro/react 0.3.117 → 0.3.118

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 (137) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3757 -3695
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/file-live.js +69 -54
  73. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  74. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  75. package/dist/shared/components/item-edit/removed-line.js +31 -25
  76. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  77. package/dist/shared/components/list/ListViewers.js +46 -35
  78. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  79. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  80. package/dist/shared/components/panels/AlertBanners.js +82 -72
  81. package/dist/shared/components/panels/BranchLanes.js +22 -22
  82. package/dist/shared/components/panels/CommentImages.js +123 -102
  83. package/dist/shared/components/panels/CommentPanel.js +186 -185
  84. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  85. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  86. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  87. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  88. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  89. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  90. package/dist/shared/components/profile/AgentNameField.js +107 -81
  91. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  92. package/dist/shared/components/profile/PersonAccess.js +599 -495
  93. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  94. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  95. package/dist/shared/components/profile/primitives.js +1 -1
  96. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  97. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  98. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  99. package/dist/shared/components/support/AssignRules.js +1733 -0
  100. package/dist/shared/components/support/PersonPick.js +88 -0
  101. package/dist/shared/components/support/RequestList.js +790 -0
  102. package/dist/shared/components/support/ScreenShare.js +158 -152
  103. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  104. package/dist/shared/components/support/SupportView.js +140 -246
  105. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  106. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  107. package/dist/shared/components/support/assign-rules-text.js +171 -0
  108. package/dist/shared/components/support/support-list.js +125 -0
  109. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  110. package/dist/shared/components/ui/checkbox.js +6 -6
  111. package/dist/shared/components/ui/select.js +43 -39
  112. package/dist/shared/components/ui/sheet.js +9 -9
  113. package/dist/shared/components/ui/switch.js +12 -11
  114. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  115. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  116. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  117. package/dist/shared/lib/activity-sentence.js +103 -91
  118. package/dist/shared/lib/agent-presence.js +27 -21
  119. package/dist/shared/lib/approval-progress.js +2 -2
  120. package/dist/shared/lib/copy-rules.js +31 -24
  121. package/dist/shared/lib/derived-causes.js +113 -78
  122. package/dist/shared/lib/grid-cursors.js +26 -26
  123. package/dist/shared/lib/label-flash.js +27 -0
  124. package/dist/shared/lib/list-return.js +137 -125
  125. package/dist/shared/lib/live-deltas.js +40 -34
  126. package/dist/shared/lib/live-groups.js +56 -52
  127. package/dist/shared/lib/live-preference.js +64 -59
  128. package/dist/shared/lib/live-screen.js +223 -192
  129. package/dist/shared/lib/partner-failure.js +11 -11
  130. package/dist/shared/lib/rollup-recalc.js +68 -64
  131. package/dist/shared/lib/screen-refresh.js +74 -68
  132. package/dist/shared/lib/screen-share.js +108 -104
  133. package/dist/shared/lib/send-status.js +77 -61
  134. package/dist/shared/lib/text-diff-window.js +29 -0
  135. package/dist/shared/lib/watch-list.js +210 -209
  136. package/dist/shared/lib/widget-image-render.js +72 -49
  137. package/package.json +1 -1
@@ -1,72 +1,72 @@
1
- import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
- import { useQuery as S, useQueryClient as F } from "@tanstack/react-query";
3
- import { ChevronDown as $, ExternalLink as E, GitMerge as L } from "lucide-react";
4
- import { useState as N, useEffect as O, useRef as T, useMemo as q } from "react";
5
- import { createPortal as K } from "react-dom";
6
- import { useNivaroClient as j } from "../../context.js";
7
- import { fieldMergeKind as z } from "../../lib/field-merge.js";
8
- import { liveMotionAllowed as A } from "../../lib/live-preference.js";
9
- import { fetchCollectionMeta as H, queryKeys as Q } from "../../lib/query-keys.js";
10
- import { onOutboxReviewNudge as B, isRecordOutboxHeld as P, resolveRecordOutboxField as Y } from "../../lib/record-outbox.js";
11
- import { titleCase as R, cn as _ } from "../../lib/utils.js";
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { useQuery as $, useQueryClient as F } from "@tanstack/react-query";
3
+ import { ChevronDown as E, ExternalLink as L, GitMerge as q } from "lucide-react";
4
+ import { useState as N, useEffect as O, useRef as T, useMemo as K } from "react";
5
+ import { createPortal as j } from "react-dom";
6
+ import { useNivaroClient as z } from "../../context.js";
7
+ import { fieldMergeKind as A } from "../../lib/field-merge.js";
8
+ import { liveMotionAllowed as H } from "../../lib/live-preference.js";
9
+ import { fetchCollectionMeta as I, queryKeys as P } from "../../lib/query-keys.js";
10
+ import { onOutboxReviewNudge as Q, isRecordOutboxHeld as B, resolveRecordOutboxField as Y } from "../../lib/record-outbox.js";
11
+ import { titleCase as S, cn as _ } from "../../lib/utils.js";
12
12
  import { RelativeTime as D } from "../RelativeTime.js";
13
- import { useShown as G, FieldMergePanel as I } from "./RemoteChangeUi.js";
14
- import { useRecordLabels as V } from "./useRecordLabels.js";
15
- function J(e) {
13
+ import { useShown as G, FieldMergePanel as V } from "./RemoteChangeUi.js";
14
+ import { useRecordLabels as J } from "./useRecordLabels.js";
15
+ function U(e) {
16
16
  return e.filter(
17
- (a) => {
18
- var c;
19
- return a.status === "conflict" && (((c = a.conflicts) == null ? void 0 : c.length) ?? 0) > 0 && !P(a.id);
17
+ (t) => {
18
+ var l;
19
+ return t.status === "conflict" && (((l = t.conflicts) == null ? void 0 : l.length) ?? 0) > 0 && !B(t.id);
20
20
  }
21
21
  );
22
22
  }
23
- function fe({
23
+ function he({
24
24
  entries: e,
25
- onOpenRecord: a
25
+ onOpenRecord: t
26
26
  }) {
27
- const c = J(e), r = c.reduce((i, b) => {
28
- var h;
29
- return i + (((h = b.conflicts) == null ? void 0 : h.length) ?? 0);
30
- }, 0), [s, n] = N(!1);
31
- if (O(() => B(() => n(!0)), []), c.length === 0 || typeof document > "u") return null;
32
- const l = `${r} offline change${r === 1 ? "" : "s"} need${r === 1 ? "s" : ""} a look`;
33
- return K(
34
- /* @__PURE__ */ t(
27
+ const l = U(e), a = l.reduce((d, b) => {
28
+ var p;
29
+ return d + (((p = b.conflicts) == null ? void 0 : p.length) ?? 0);
30
+ }, 0), [o, s] = N(!1);
31
+ if (O(() => Q(() => s(!0)), []), l.length === 0 || typeof document > "u") return null;
32
+ const n = `${a} offline change${a === 1 ? "" : "s"} need${a === 1 ? "s" : ""} a look`;
33
+ return j(
34
+ /* @__PURE__ */ r(
35
35
  "section",
36
36
  {
37
37
  "data-outbox-review": !0,
38
38
  "aria-label": "Offline changes to review",
39
39
  className: "fixed bottom-20 right-4 z-[60] w-[400px] max-w-[calc(100vw-2rem)]",
40
- children: s ? /* @__PURE__ */ o("div", { className: "nvr-expand-in flex max-h-[min(calc(100vh-7rem),640px)] flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-[0_12px_32px_-12px_rgba(15,23,42,0.35)] dark:border-border dark:bg-card", children: [
41
- /* @__PURE__ */ o("header", { className: "flex shrink-0 items-start gap-2 border-b border-slate-100 px-4 py-3 dark:border-border", children: [
42
- /* @__PURE__ */ t("span", { className: "mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500 dark:bg-amber-400" }),
43
- /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
44
- /* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-900 dark:text-slate-50", children: "Changed while you were offline" }),
45
- /* @__PURE__ */ t("p", { className: "mt-0.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "Nothing here is sent until you choose." })
40
+ children: o ? /* @__PURE__ */ i("div", { className: "nvr-expand-in flex max-h-[min(calc(100vh-7rem),640px)] flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-[0_12px_32px_-12px_rgba(15,23,42,0.35)] dark:border-border dark:bg-card", children: [
41
+ /* @__PURE__ */ i("header", { className: "flex shrink-0 items-start gap-2 border-b border-slate-100 px-4 py-3 dark:border-border", children: [
42
+ /* @__PURE__ */ r("span", { className: "mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500 dark:bg-amber-400" }),
43
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
44
+ /* @__PURE__ */ r("h2", { className: "text-[13px] font-semibold text-slate-900 dark:text-slate-50", children: "Changed while you were offline" }),
45
+ /* @__PURE__ */ r("p", { className: "mt-0.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "Nothing here is sent until you choose." })
46
46
  ] }),
47
- /* @__PURE__ */ t(
47
+ /* @__PURE__ */ r(
48
48
  "button",
49
49
  {
50
50
  type: "button",
51
- onClick: () => n(!1),
51
+ onClick: () => s(!1),
52
52
  "aria-label": "Fold this away",
53
53
  "data-tip": "Fold away",
54
54
  className: "-mr-1 rounded-md p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:hover:bg-muted dark:hover:text-slate-200",
55
- children: /* @__PURE__ */ t($, { className: "h-4 w-4" })
55
+ children: /* @__PURE__ */ r(E, { className: "h-4 w-4" })
56
56
  }
57
57
  )
58
58
  ] }),
59
- /* @__PURE__ */ t(U, { children: c.map((i) => /* @__PURE__ */ t(W, { entry: i, onOpenRecord: a }, i.id)) })
60
- ] }) : /* @__PURE__ */ o(
59
+ /* @__PURE__ */ r(W, { children: l.map((d) => /* @__PURE__ */ r(X, { entry: d, onOpenRecord: t }, d.id)) })
60
+ ] }) : /* @__PURE__ */ i(
61
61
  "button",
62
62
  {
63
63
  type: "button",
64
64
  "data-outbox-review-open": !0,
65
- onClick: () => n(!0),
65
+ onClick: () => s(!0),
66
66
  className: "ml-auto flex items-center gap-2 rounded-full border border-amber-300/80 bg-white py-1.5 pl-3 pr-3.5 text-[12px] font-medium text-slate-800 shadow-[0_4px_14px_-6px_rgba(15,23,42,0.25)] transition-colors hover:bg-amber-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60 dark:border-amber-400/30 dark:bg-card dark:text-slate-100 dark:hover:bg-amber-400/10",
67
67
  children: [
68
- /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-amber-500 dark:bg-amber-400" }),
69
- l
68
+ /* @__PURE__ */ r("span", { className: "h-2 w-2 rounded-full bg-amber-500 dark:bg-amber-400" }),
69
+ n
70
70
  ]
71
71
  }
72
72
  )
@@ -75,31 +75,31 @@ function fe({
75
75
  document.body
76
76
  );
77
77
  }
78
- function U({ children: e }) {
79
- const a = T(null), [c, r] = N(!1);
78
+ function W({ children: e }) {
79
+ const t = T(null), [l, a] = N(!1);
80
80
  return O(() => {
81
- const s = a.current;
82
- if (!s) return;
83
- const n = () => r(s.scrollTop + s.clientHeight < s.scrollHeight - 4);
84
- n(), s.addEventListener("scroll", n, { passive: !0 });
85
- const l = typeof ResizeObserver < "u" ? new ResizeObserver(n) : null;
86
- l == null || l.observe(s);
87
- for (const b of Array.from(s.children)) l == null || l.observe(b);
88
- const i = new MutationObserver(n);
89
- return i.observe(s, { childList: !0, subtree: !0 }), () => {
90
- s.removeEventListener("scroll", n), l == null || l.disconnect(), i.disconnect();
81
+ const o = t.current;
82
+ if (!o) return;
83
+ const s = () => a(o.scrollTop + o.clientHeight < o.scrollHeight - 4);
84
+ s(), o.addEventListener("scroll", s, { passive: !0 });
85
+ const n = typeof ResizeObserver < "u" ? new ResizeObserver(s) : null;
86
+ n == null || n.observe(o);
87
+ for (const b of Array.from(o.children)) n == null || n.observe(b);
88
+ const d = new MutationObserver(s);
89
+ return d.observe(o, { childList: !0, subtree: !0 }), () => {
90
+ o.removeEventListener("scroll", s), n == null || n.disconnect(), d.disconnect();
91
91
  };
92
- }, []), /* @__PURE__ */ o("div", { className: "relative min-h-0 flex-1", children: [
93
- /* @__PURE__ */ t(
92
+ }, []), /* @__PURE__ */ i("div", { className: "relative min-h-0 flex-1", children: [
93
+ /* @__PURE__ */ r(
94
94
  "div",
95
95
  {
96
- ref: a,
96
+ ref: t,
97
97
  "data-outbox-scroll": !0,
98
98
  className: "h-full max-h-full divide-y divide-slate-100 overflow-y-auto overscroll-contain dark:divide-border",
99
99
  children: e
100
100
  }
101
101
  ),
102
- c && /* @__PURE__ */ t(
102
+ l && /* @__PURE__ */ r(
103
103
  "div",
104
104
  {
105
105
  "aria-hidden": !0,
@@ -109,157 +109,159 @@ function U({ children: e }) {
109
109
  )
110
110
  ] });
111
111
  }
112
- function W({
112
+ function X({
113
113
  entry: e,
114
- onOpenRecord: a
114
+ onOpenRecord: t
115
115
  }) {
116
- var k;
117
- const c = j(), { data: r } = S({
118
- queryKey: Q.collectionMeta(e.collection),
119
- queryFn: () => H(c, e.collection),
116
+ var v;
117
+ const l = z(), { data: a } = $({
118
+ queryKey: P.collectionMeta(e.collection),
119
+ queryFn: () => I(l, e.collection),
120
120
  staleTime: 10 * 6e4
121
- }), s = F(), n = V(e.collection, [e.item]), l = s.getQueryState(["record-label", e.collection, e.item]), i = !n.has(e.item) && (!l || l.status === "pending"), b = q(
122
- () => new Map(((r == null ? void 0 : r.fields) ?? []).map((m) => [m.field, m])),
123
- [r]
124
- ), h = (m) => {
121
+ }), o = F(), s = J(e.collection, [e.item]), n = o.getQueryState(["record-label", e.collection, e.item]), d = !s.has(e.item) && (!n || n.status === "pending"), b = K(
122
+ () => new Map(((a == null ? void 0 : a.fields) ?? []).map((m) => [m.field, m])),
123
+ [a]
124
+ ), p = (m) => {
125
125
  var u;
126
- return ((u = ((r == null ? void 0 : r.relations) ?? []).find(
127
- (g) => g.many_collection === e.collection && g.many_field === m && !g.junction_field
126
+ return ((u = ((a == null ? void 0 : a.relations) ?? []).find(
127
+ (h) => h.many_collection === e.collection && h.many_field === m && !h.junction_field
128
128
  )) == null ? void 0 : u.one_collection) ?? null;
129
- }, f = (typeof (r == null ? void 0 : r.singular) == "string" ? r.singular.trim() : "") || X(R(e.collection.replace(/_/g, " "))), v = n.get(e.item) ?? `#${e.item}`;
130
- if (!r || i)
131
- return /* @__PURE__ */ o("article", { "data-outbox-entry": e.id, "aria-busy": "true", className: "space-y-2 px-4 py-3", children: [
132
- /* @__PURE__ */ t("div", { className: "h-3.5 w-40 rounded bg-slate-100 dark:bg-muted" }),
133
- /* @__PURE__ */ t("div", { className: "h-20 rounded-lg bg-slate-50 dark:bg-muted/50" })
129
+ }, k = (typeof (a == null ? void 0 : a.singular) == "string" ? a.singular.trim() : "") || Z(S(e.collection.replace(/_/g, " "))), f = s.get(e.item) ?? `#${e.item}`;
130
+ if (!a || d)
131
+ return /* @__PURE__ */ i("article", { "data-outbox-entry": e.id, "aria-busy": "true", className: "space-y-2 px-4 py-3", children: [
132
+ /* @__PURE__ */ r("div", { className: "h-3.5 w-40 rounded bg-slate-100 dark:bg-muted" }),
133
+ /* @__PURE__ */ r("div", { className: "h-20 rounded-lg bg-slate-50 dark:bg-muted/50" })
134
134
  ] });
135
- const x = ((k = e.sent_fields) == null ? void 0 : k.length) ?? 0;
136
- return /* @__PURE__ */ o("article", { "data-outbox-entry": e.id, className: "px-4 py-3", children: [
137
- /* @__PURE__ */ o("div", { className: "flex items-baseline gap-2", children: [
138
- /* @__PURE__ */ o("p", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-500 dark:text-slate-400", children: [
139
- f,
135
+ const x = ((v = e.sent_fields) == null ? void 0 : v.length) ?? 0;
136
+ return /* @__PURE__ */ i("article", { "data-outbox-entry": e.id, className: "px-4 py-3", children: [
137
+ /* @__PURE__ */ i("div", { className: "flex items-baseline gap-2", children: [
138
+ /* @__PURE__ */ i("p", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-500 dark:text-slate-400", children: [
139
+ k,
140
140
  " ",
141
- /* @__PURE__ */ t("span", { className: "font-medium text-slate-900 dark:text-slate-100", children: v })
141
+ /* @__PURE__ */ r("span", { className: "font-medium text-slate-900 dark:text-slate-100", children: f })
142
142
  ] }),
143
- a && /* @__PURE__ */ o(
143
+ t && /* @__PURE__ */ i(
144
144
  "button",
145
145
  {
146
146
  type: "button",
147
- onClick: () => a(e.collection, e.item),
147
+ onClick: () => t(e.collection, e.item),
148
148
  className: "inline-flex shrink-0 items-center gap-1 rounded text-[11.5px] font-medium text-slate-500 underline-offset-2 hover:text-slate-800 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-slate-400 dark:hover:text-slate-100",
149
149
  children: [
150
150
  "Open ",
151
- /* @__PURE__ */ t(E, { className: "h-3 w-3" })
151
+ /* @__PURE__ */ r(L, { className: "h-3 w-3" })
152
152
  ]
153
153
  }
154
154
  )
155
155
  ] }),
156
- x > 0 && /* @__PURE__ */ o("p", { className: "mt-0.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
156
+ x > 0 && /* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
157
157
  x,
158
158
  " other change",
159
159
  x === 1 ? " was" : "s were",
160
160
  " saved."
161
161
  ] }),
162
- /* @__PURE__ */ t("ul", { className: "mt-2 space-y-2", children: (e.conflicts ?? []).map((m) => {
162
+ /* @__PURE__ */ r("ul", { className: "mt-2 space-y-2", children: (e.conflicts ?? []).map((m) => {
163
163
  const u = b.get(m.field) ?? null;
164
- return /* @__PURE__ */ t(
165
- Z,
164
+ return /* @__PURE__ */ r(
165
+ ee,
166
166
  {
167
167
  entry: e,
168
168
  clash: m,
169
169
  field: u,
170
- label: (u == null ? void 0 : u.label) || R(m.field.replace(/_/g, " ")),
171
- relatedCollection: h(m.field)
170
+ label: (u == null ? void 0 : u.label) || S(m.field.replace(/_/g, " ")),
171
+ relatedCollection: p(m.field)
172
172
  },
173
173
  m.field
174
174
  );
175
175
  }) })
176
176
  ] });
177
177
  }
178
- function X(e) {
178
+ function Z(e) {
179
179
  return /ies$/i.test(e) ? e.replace(/ies$/i, "y") : /[^s]s$/i.test(e) ? e.slice(0, -1) : e;
180
180
  }
181
181
  const C = "shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60 disabled:opacity-50";
182
- function Z({
182
+ function ee({
183
183
  entry: e,
184
- clash: a,
185
- field: c,
186
- label: r,
187
- relatedCollection: s,
188
- onPick: n
184
+ clash: t,
185
+ field: l,
186
+ label: a,
187
+ relatedCollection: o,
188
+ onPick: s
189
189
  }) {
190
- const l = e.payload[a.field], i = a.current_value, b = e.before[a.field], h = G(c, s, [l, i, b]), p = (d, w) => typeof d == "number" && Number.isFinite(d) ? d.toLocaleString() : h(d, w), [f, v] = N(!1), [x, k] = N(!1), m = T(null);
190
+ const n = e.payload[t.field], d = t.current_value, b = e.before[t.field], p = G(l, o, [n, d, b]), g = (c, w) => typeof c == "number" && Number.isFinite(c) ? c.toLocaleString() : p(c, w), k = t.hidden ? ["", ""] : te(g(d, 400), g(n, 400)), [f, x] = N(!1), [v, m] = N(!1), u = T(null);
191
191
  O(() => {
192
192
  if (!f) return;
193
- const d = setTimeout(() => {
194
- var w, M;
195
- (M = (w = m.current) == null ? void 0 : w.querySelector("[data-merge-apply]")) == null || M.scrollIntoView({ block: "nearest", behavior: A() ? "smooth" : "auto" });
193
+ const c = setTimeout(() => {
194
+ var w, R;
195
+ (R = (w = u.current) == null ? void 0 : w.querySelector("[data-merge-apply]")) == null || R.scrollIntoView({ block: "nearest", behavior: H() ? "smooth" : "auto" });
196
196
  }, 60);
197
- return () => clearTimeout(d);
197
+ return () => clearTimeout(c);
198
198
  }, [f]);
199
- const u = a.hidden ? "none" : z(c, l, i), g = a.by || "Someone", y = (d) => {
200
- k(!0), v(!1), n ? n(d) : Y(e.collection, e.item, a.field, d).finally(
201
- () => k(!1)
199
+ const h = t.hidden ? "none" : A(l, n, d), M = t.by || "Someone", y = (c) => {
200
+ m(!0), x(!1), s ? s(c) : Y(e.collection, e.item, t.field, c).finally(
201
+ () => m(!1)
202
202
  );
203
203
  };
204
- return /* @__PURE__ */ o(
204
+ return /* @__PURE__ */ i(
205
205
  "li",
206
206
  {
207
- "data-outbox-clash": a.field,
208
- ref: m,
207
+ "data-outbox-clash": t.field,
208
+ ref: u,
209
209
  className: "rounded-lg border border-amber-200/80 bg-amber-50/50 px-3 py-2 dark:border-amber-400/30 dark:bg-white/[0.02]",
210
210
  children: [
211
- /* @__PURE__ */ o("p", { className: "text-[12px] leading-snug text-slate-700 dark:text-slate-200", children: [
212
- /* @__PURE__ */ t("span", { className: "font-semibold text-slate-900 dark:text-slate-50", children: g }),
211
+ /* @__PURE__ */ i("p", { className: "text-[12px] leading-snug text-slate-700 dark:text-slate-200", children: [
212
+ /* @__PURE__ */ r("span", { className: "font-semibold text-slate-900 dark:text-slate-50", children: M }),
213
213
  " changed",
214
214
  " ",
215
- /* @__PURE__ */ t("span", { className: "font-semibold text-slate-900 dark:text-slate-50", children: r }),
216
- " while you were offline",
217
- a.at && /* @__PURE__ */ o("span", { className: "whitespace-nowrap text-slate-500 dark:text-slate-400", children: [
215
+ /* @__PURE__ */ r("span", { className: "font-semibold text-slate-900 dark:text-slate-50", children: a }),
216
+ " ",
217
+ /* @__PURE__ */ r("span", { className: "whitespace-nowrap", children: "while you were offline" }),
218
+ t.at && /* @__PURE__ */ i("span", { className: "whitespace-nowrap text-slate-500 dark:text-slate-400", children: [
218
219
  " ",
219
220
  "· ",
220
- /* @__PURE__ */ t(D, { value: a.at })
221
+ /* @__PURE__ */ r(D, { value: t.at })
221
222
  ] })
222
223
  ] }),
223
- a.hidden ? /* @__PURE__ */ t("p", { className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "You can no longer see this field's value, so only its change is shown." }) : /* @__PURE__ */ o("dl", { className: "mt-1.5 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-[11.5px]", children: [
224
- /* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: "Theirs" }),
225
- /* @__PURE__ */ t(
224
+ t.hidden ? /* @__PURE__ */ r("p", { className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "You can no longer see this field's value, so only its change is shown." }) : /* @__PURE__ */ i("dl", { className: "mt-1.5 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-[11.5px]", children: [
225
+ /* @__PURE__ */ r("dt", { className: "text-slate-500 dark:text-slate-400", children: "Theirs" }),
226
+ /* @__PURE__ */ r(
226
227
  "dd",
227
228
  {
228
229
  className: "min-w-0 truncate font-medium text-slate-900 tabular-nums dark:text-slate-50",
229
- "data-tip": p(i, 400),
230
- children: p(i)
230
+ "data-tip": g(d, 400),
231
+ children: k[0]
231
232
  }
232
233
  ),
233
- /* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: "Yours" }),
234
- /* @__PURE__ */ t(
234
+ /* @__PURE__ */ r("dt", { className: "text-slate-500 dark:text-slate-400", children: "Yours" }),
235
+ /* @__PURE__ */ r(
235
236
  "dd",
236
237
  {
237
238
  className: "min-w-0 truncate font-medium text-slate-900 tabular-nums dark:text-slate-50",
238
- "data-tip": p(l, 400),
239
- children: p(l)
239
+ "data-tip": g(n, 400),
240
+ children: k[1]
240
241
  }
241
242
  )
242
243
  ] }),
243
- /* @__PURE__ */ o("div", { className: "mt-2 flex flex-wrap items-center gap-1", children: [
244
- /* @__PURE__ */ t(
244
+ /* @__PURE__ */ i("div", { className: "mt-2 flex flex-wrap items-center gap-1", children: [
245
+ /* @__PURE__ */ r(
245
246
  "button",
246
247
  {
247
248
  type: "button",
248
- disabled: x,
249
+ disabled: v,
249
250
  onClick: () => y("mine"),
250
251
  "data-outbox-keep-mine": !0,
251
252
  className: _(
252
253
  C,
253
- "border border-amber-300 bg-white text-amber-900 hover:bg-amber-50 dark:border-amber-400/30 dark:bg-transparent dark:text-amber-100 dark:hover:bg-amber-400/10"
254
+ // Quiet while a merge is open: only one choice looks chosen at a time.
255
+ f ? "text-slate-700 hover:bg-amber-100/80 dark:text-slate-200 dark:hover:bg-amber-400/10" : "border border-amber-300 bg-white text-amber-900 hover:bg-amber-50 dark:border-amber-400/30 dark:bg-transparent dark:text-amber-100 dark:hover:bg-amber-400/10"
254
256
  ),
255
257
  children: "Keep mine"
256
258
  }
257
259
  ),
258
- /* @__PURE__ */ t(
260
+ /* @__PURE__ */ r(
259
261
  "button",
260
262
  {
261
263
  type: "button",
262
- disabled: x,
264
+ disabled: v,
263
265
  onClick: () => y("theirs"),
264
266
  "data-outbox-take-theirs": !0,
265
267
  className: _(
@@ -269,12 +271,12 @@ function Z({
269
271
  children: "Take theirs"
270
272
  }
271
273
  ),
272
- u !== "none" && /* @__PURE__ */ o(
274
+ h !== "none" && /* @__PURE__ */ i(
273
275
  "button",
274
276
  {
275
277
  type: "button",
276
- disabled: x,
277
- onClick: () => v((d) => !d),
278
+ disabled: v,
279
+ onClick: () => x((c) => !c),
278
280
  "aria-expanded": f,
279
281
  "data-outbox-merge": !0,
280
282
  className: _(
@@ -283,31 +285,40 @@ function Z({
283
285
  f ? "bg-amber-100 text-amber-900 ring-1 ring-amber-300 dark:bg-amber-400/15 dark:text-amber-100 dark:ring-amber-400/40" : "text-slate-700 hover:bg-amber-100/80 dark:text-slate-200 dark:hover:bg-amber-400/10"
284
286
  ),
285
287
  children: [
286
- /* @__PURE__ */ t(L, { className: "h-3 w-3" }),
288
+ /* @__PURE__ */ r(q, { className: "h-3 w-3" }),
287
289
  " Merge"
288
290
  ]
289
291
  }
290
292
  )
291
293
  ] }),
292
- f && u !== "none" && /* @__PURE__ */ t(
293
- I,
294
+ f && h !== "none" && /* @__PURE__ */ r(
295
+ V,
294
296
  {
295
- kind: u,
297
+ kind: h,
296
298
  base: b,
297
- mine: l,
298
- theirs: i,
299
- by: g,
300
- shown: (d) => p(d, 120),
301
- onCancel: () => v(!1),
302
- onApply: (d) => y({ merged: d })
299
+ mine: n,
300
+ theirs: d,
301
+ by: M,
302
+ shown: (c) => g(c, 120),
303
+ onCancel: () => x(!1),
304
+ onApply: (c) => y({ merged: c })
303
305
  }
304
306
  )
305
307
  ]
306
308
  }
307
309
  );
308
310
  }
311
+ function te(e, t) {
312
+ if (e === t) return [e, t];
313
+ let l = 0;
314
+ for (; l < e.length && l < t.length && e[l] === t[l]; ) l++;
315
+ if (l < 24) return [e, t];
316
+ const a = e.lastIndexOf(" ", l - 1), o = a > 0 ? e.lastIndexOf(" ", a - 1) : -1, s = o >= 0 ? o + 1 : a >= 0 ? a + 1 : l;
317
+ return s <= 0 ? [e, t] : [`…${e.slice(s)}`, `…${t.slice(s)}`];
318
+ }
309
319
  export {
310
- Z as OutboxClashRow,
311
- fe as OutboxReviewTray,
312
- J as conflictEntriesToReview
320
+ ee as OutboxClashRow,
321
+ he as OutboxReviewTray,
322
+ U as conflictEntriesToReview,
323
+ te as diffPreviews
313
324
  };
@@ -1,49 +1,28 @@
1
- import { jsx as u, jsxs as i } from "react/jsx-runtime";
2
- import { ArrowLeft as a } from "lucide-react";
3
- import { useNavigation as s } from "../../context.js";
4
- const r = "nvr:queue-return", c = 360 * 60 * 1e3;
5
- function l() {
1
+ import "react/jsx-runtime";
2
+ import "lucide-react";
3
+ const t = "nvr:queue-return", o = 360 * 60 * 1e3;
4
+ function c() {
6
5
  try {
7
- const t = sessionStorage.getItem(r);
8
- if (!t) return null;
9
- const e = JSON.parse(t);
10
- return !e || typeof e != "object" || !e.path || Date.now() - Number(e.at ?? 0) > c ? null : e;
6
+ const e = sessionStorage.getItem(t);
7
+ if (!e) return null;
8
+ const r = JSON.parse(e);
9
+ return !r || typeof r != "object" || !r.path || Date.now() - Number(r.at ?? 0) > o ? null : r;
11
10
  } catch {
12
11
  return null;
13
12
  }
14
13
  }
15
- function f(t) {
14
+ function f(e) {
16
15
  try {
17
- t ? sessionStorage.setItem(r, JSON.stringify(t)) : sessionStorage.removeItem(r);
16
+ e ? sessionStorage.setItem(t, JSON.stringify(e)) : sessionStorage.removeItem(t);
18
17
  } catch {
19
18
  }
20
19
  }
21
- function v(t, e, n, o) {
22
- return t.queue_id !== e ? !1 : t.restore || t.entry && n && t.entry === n ? !0 : o;
23
- }
24
- function x() {
25
- const t = s(), e = l();
26
- return e ? /* @__PURE__ */ u("div", { className: "flex items-center", "data-queue-return": e.queue_id, children: /* @__PURE__ */ i(
27
- "button",
28
- {
29
- type: "button",
30
- onClick: () => {
31
- f({ ...e, restore: !0 }), t.navigate(e.path);
32
- },
33
- className: "inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-white px-2.5 py-1 text-[11.5px] font-medium text-slate-600 transition-colors hover:border-nvr-cyan/50 hover:text-nvr-navy dark:border-border dark:bg-card dark:text-slate-300 dark:hover:text-nvr-cyan",
34
- "data-tip": "Return to the queue with its filters and scroll position",
35
- children: [
36
- /* @__PURE__ */ u(a, { className: "h-3.5 w-3.5" }),
37
- "Back to ",
38
- e.name
39
- ]
40
- }
41
- ) }) : null;
20
+ function l(e, r, n, u) {
21
+ return e.queue_id !== r ? !1 : e.restore || e.entry && n && e.entry === n ? !0 : u;
42
22
  }
43
23
  export {
44
- r as QUEUE_RETURN_KEY,
45
- x as QueueReturnChip,
46
- v as queueReturnApplies,
47
- l as readQueueReturn,
24
+ t as QUEUE_RETURN_KEY,
25
+ l as queueReturnApplies,
26
+ c as readQueueReturn,
48
27
  f as writeQueueReturn
49
28
  };