@nivaro/react 0.3.117 → 0.3.119

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 (138) 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 +4451 -4385
  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 +135 -94
  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 +88 -85
  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 +245 -141
  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 +15 -16
  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/addendum-view.js +6 -0
  73. package/dist/shared/components/item-edit/file-live.js +69 -54
  74. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  75. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  76. package/dist/shared/components/item-edit/removed-line.js +31 -25
  77. package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
  78. package/dist/shared/components/list/ListViewers.js +46 -35
  79. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  80. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  81. package/dist/shared/components/panels/AlertBanners.js +82 -72
  82. package/dist/shared/components/panels/BranchLanes.js +22 -22
  83. package/dist/shared/components/panels/CommentImages.js +123 -102
  84. package/dist/shared/components/panels/CommentPanel.js +186 -185
  85. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  86. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  87. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  88. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  89. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  90. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  91. package/dist/shared/components/profile/AgentNameField.js +107 -81
  92. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  93. package/dist/shared/components/profile/PersonAccess.js +599 -495
  94. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  95. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  96. package/dist/shared/components/profile/primitives.js +1 -1
  97. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  98. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  99. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  100. package/dist/shared/components/support/AssignRules.js +1733 -0
  101. package/dist/shared/components/support/PersonPick.js +88 -0
  102. package/dist/shared/components/support/RequestList.js +790 -0
  103. package/dist/shared/components/support/ScreenShare.js +158 -152
  104. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  105. package/dist/shared/components/support/SupportView.js +140 -246
  106. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  107. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  108. package/dist/shared/components/support/assign-rules-text.js +171 -0
  109. package/dist/shared/components/support/support-list.js +125 -0
  110. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  111. package/dist/shared/components/ui/checkbox.js +6 -6
  112. package/dist/shared/components/ui/select.js +43 -39
  113. package/dist/shared/components/ui/sheet.js +9 -9
  114. package/dist/shared/components/ui/switch.js +12 -11
  115. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  116. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  117. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  118. package/dist/shared/lib/activity-sentence.js +103 -91
  119. package/dist/shared/lib/agent-presence.js +27 -21
  120. package/dist/shared/lib/approval-progress.js +2 -2
  121. package/dist/shared/lib/copy-rules.js +31 -24
  122. package/dist/shared/lib/derived-causes.js +113 -78
  123. package/dist/shared/lib/grid-cursors.js +26 -26
  124. package/dist/shared/lib/label-flash.js +27 -0
  125. package/dist/shared/lib/list-return.js +137 -125
  126. package/dist/shared/lib/live-deltas.js +40 -34
  127. package/dist/shared/lib/live-groups.js +56 -52
  128. package/dist/shared/lib/live-preference.js +64 -59
  129. package/dist/shared/lib/live-screen.js +223 -192
  130. package/dist/shared/lib/partner-failure.js +11 -11
  131. package/dist/shared/lib/rollup-recalc.js +68 -64
  132. package/dist/shared/lib/screen-refresh.js +74 -68
  133. package/dist/shared/lib/screen-share.js +108 -104
  134. package/dist/shared/lib/send-status.js +77 -61
  135. package/dist/shared/lib/text-diff-window.js +29 -0
  136. package/dist/shared/lib/watch-list.js +210 -209
  137. package/dist/shared/lib/widget-image-render.js +72 -49
  138. package/package.json +1 -1
@@ -1,36 +1,36 @@
1
- import { jsx as n, jsxs as a } from "react/jsx-runtime";
2
- import { useQuery as Q, useQueryClient as E, useMutation as _ } from "@tanstack/react-query";
3
- import { MessageSquare as U, Link2 as W, RotateCcw as A, Check as H } from "lucide-react";
4
- import { useState as b, useMemo as v } from "react";
5
- import { toast as g } from "sonner";
6
- import { useNivaroClient as I } from "../../context.js";
7
- import { get as z, post as q } from "../../lib/commands.js";
8
- import { useRepliesWhileTyping as G } from "../../lib/comment-awareness.js";
9
- import { openFieldCommentCounts as J, fieldThread as V, fieldDeepLinkQuery as X } from "../../lib/field-comments.js";
10
- import { useDraftTypingSignal as Y, useRecordSignalPeers as Z, useMyUserId as ee, signalSentence as te } from "../../lib/presence-signals.js";
11
- import { cn as L, formatRelative as oe } from "../../lib/utils.js";
12
- import { RepliesWhileTyping as ne, SeenByLine as re, MentionDeliveryButton as ie } from "../panels/CommentAwareness.js";
13
- import { useCommentImages as ae, CommentImageStrip as se, CommentBody as le } from "../panels/CommentImages.js";
1
+ import { jsx as n, jsxs as i } from "react/jsx-runtime";
2
+ import { useQuery as E, useQueryClient as U, useMutation as q } from "@tanstack/react-query";
3
+ import { MessageSquare as W, Link2 as A, RotateCcw as H, Check as z } from "lucide-react";
4
+ import { useState as k, useMemo as v } from "react";
5
+ import { toast as y } from "sonner";
6
+ import { useNivaroClient as L } from "../../context.js";
7
+ import { get as G, post as D } from "../../lib/commands.js";
8
+ import { useRepliesWhileTyping as J } from "../../lib/comment-awareness.js";
9
+ import { openFieldCommentCounts as V, fieldThread as X, fieldDeepLinkQuery as Y } from "../../lib/field-comments.js";
10
+ import { useDraftTypingSignal as Z, useRecordSignalPeers as ee, useMyUserId as te, signalSentence as oe } from "../../lib/presence-signals.js";
11
+ import { cn as M, formatRelative as I } from "../../lib/utils.js";
12
+ import { RepliesWhileTyping as ne, SeenByLine as re, MentionDeliveryButton as ae } from "../panels/CommentAwareness.js";
13
+ import { useCommentImages as ie, CommentImageStrip as se, CommentBody as le } from "../panels/CommentImages.js";
14
14
  import { notePreviewText as de, MentionTextarea as me } from "../panels/CommentPanel.js";
15
15
  import { Popover as ce, PopoverTrigger as pe, PopoverContent as ue } from "../ui/popover.js";
16
16
  import { useFieldComments as he } from "./field-comments-context.js";
17
- const M = (t, o) => ["comments", t, o];
18
- function K(t, o, r) {
19
- const i = I();
20
- return Q({
21
- queryKey: M(t, o),
22
- queryFn: () => i.request(z("/comments", { collection: t, item: o })).then((m) => m.data),
17
+ const K = (t, o) => ["comments", t, o];
18
+ function O(t, o, r) {
19
+ const a = L();
20
+ return E({
21
+ queryKey: K(t, o),
22
+ queryFn: () => a.request(G("/comments", { collection: t, item: o })).then((m) => m.data),
23
23
  enabled: r
24
24
  });
25
25
  }
26
26
  function De(t) {
27
- const o = t.itemId == null ? "" : String(t.itemId), r = t.enabled && o !== "" && o !== "new", { data: i } = K(t.collection, o, r), [m, s] = b(null), c = v(() => J(i ?? []), [i]), { labelOf: l, jump: u, collection: f } = t;
27
+ const o = t.itemId == null ? "" : String(t.itemId), r = t.enabled && o !== "" && o !== "new", { data: a } = O(t.collection, o, r), [m, s] = k(null), c = v(() => V(a ?? []), [a]), { labelOf: l, jump: u, collection: f } = t;
28
28
  return v(
29
29
  () => r ? { collection: f, item: o, counts: c, openField: m, setOpenField: s, labelOf: l, jump: u } : null,
30
30
  [r, f, o, c, m, l, u]
31
31
  );
32
32
  }
33
- function D(t) {
33
+ function b(t) {
34
34
  return t ? [t.first_name, t.last_name].filter(Boolean).join(" ") || t.email : "Someone";
35
35
  }
36
36
  function Ie({ field: t, label: o }) {
@@ -42,23 +42,25 @@ function xe({
42
42
  field: o,
43
43
  label: r
44
44
  }) {
45
- const i = t.counts[o] ?? 0, m = t.openField === o;
46
- return /* @__PURE__ */ a(ce, { open: m, onOpenChange: (s) => t.setOpenField(s ? o : null), children: [
47
- /* @__PURE__ */ n(pe, { asChild: !0, children: /* @__PURE__ */ a(
45
+ const a = t.counts[o] ?? 0, m = t.openField === o;
46
+ return /* @__PURE__ */ i(ce, { open: m, onOpenChange: (s) => t.setOpenField(s ? o : null), children: [
47
+ /* @__PURE__ */ n(pe, { asChild: !0, children: /* @__PURE__ */ i(
48
48
  "button",
49
49
  {
50
50
  type: "button",
51
51
  "data-field-comment": o,
52
- "data-field-comment-count": i || void 0,
53
- "aria-label": i ? `${i} open ${i === 1 ? "comment" : "comments"} on ${r}` : `Comment on ${r}`,
54
- "data-tip": i ? void 0 : `Comment on ${r}`,
55
- className: L(
52
+ "data-field-comment-count": a || void 0,
53
+ "aria-label": a ? `${a} open ${a === 1 ? "comment" : "comments"} on ${r}` : `Comment on ${r}`,
54
+ "data-tip": a ? void 0 : `Comment on ${r}`,
55
+ className: M(
56
56
  "inline-flex items-center gap-0.5 rounded px-0.5 py-0.5 text-[10px] font-semibold transition-[opacity,color]",
57
- i || m ? "text-[#0e7490] opacity-100 dark:text-nvr-cyan" : "text-slate-400 opacity-0 hover:text-[#0e7490] focus-visible:opacity-100 group-hover/fieldrow:opacity-100 group-focus-within/fieldrow:opacity-100 dark:text-slate-400 dark:hover:text-nvr-cyan"
57
+ // Always shown where comments are on (Rob 2026-11-16: a hover-only icon was easy to
58
+ // miss and jumped in beside the lock); quiet grey until a thread exists.
59
+ a || m ? "text-[#0e7490] dark:text-nvr-cyan" : "text-slate-400 hover:text-[#0e7490] dark:text-slate-500 dark:hover:text-nvr-cyan"
58
60
  ),
59
61
  children: [
60
- /* @__PURE__ */ n(U, { "aria-hidden": !0, className: "h-3 w-3" }),
61
- i > 0 && /* @__PURE__ */ n("span", { className: "tabular-nums", children: i })
62
+ /* @__PURE__ */ n(W, { "aria-hidden": !0, className: "h-3 w-3" }),
63
+ a > 0 && /* @__PURE__ */ n("span", { className: "tabular-nums", children: a })
62
64
  ]
63
65
  }
64
66
  ) }),
@@ -82,17 +84,17 @@ function fe({
82
84
  field: o,
83
85
  label: r
84
86
  }) {
85
- const i = I(), m = E(), { data: s, isLoading: c } = K(t.collection, t.item, !0), l = v(() => V(s ?? [], o), [s, o]), [u, f] = b(!1), [h, k] = b(""), p = ae();
86
- Y(t.collection, t.item, h, o);
87
- const w = Z(t.collection, t.item, "note", { field: o }), O = ee(), j = v(
87
+ const a = L(), m = U(), { data: s, isLoading: c } = O(t.collection, t.item, !0), l = v(() => X(s ?? [], o), [s, o]), [u, f] = k(!1), [h, C] = k(""), p = ie();
88
+ Z(t.collection, t.item, h, o);
89
+ const w = ee(t.collection, t.item, "note", { field: o }), j = te(), B = v(
88
90
  () => (s ?? []).filter((e) => e.field === o && !e.resolved_at),
89
91
  [s, o]
90
- ), C = G(h, s ? j : void 0, O), N = () => m.invalidateQueries({ queryKey: M(t.collection, t.item) }), F = (e, d) => {
91
- var x, T, P;
92
- return ((T = (x = e == null ? void 0 : e.response) == null ? void 0 : x.data) == null ? void 0 : T.error) ?? ((P = e == null ? void 0 : e.data) == null ? void 0 : P.error) ?? d;
93
- }, y = _({
94
- mutationFn: (e) => i.request(
95
- q("/comments", {
92
+ ), N = J(h, s ? B : void 0, j), $ = () => m.invalidateQueries({ queryKey: K(t.collection, t.item) }), F = (e, d) => {
93
+ var x, _, P;
94
+ return ((_ = (x = e == null ? void 0 : e.response) == null ? void 0 : x.data) == null ? void 0 : _.error) ?? ((P = e == null ? void 0 : e.data) == null ? void 0 : P.error) ?? d;
95
+ }, g = q({
96
+ mutationFn: (e) => a.request(
97
+ D("/comments", {
96
98
  collection: t.collection,
97
99
  item: t.item,
98
100
  text: e,
@@ -101,40 +103,40 @@ function fe({
101
103
  })
102
104
  ),
103
105
  onSuccess: () => {
104
- k(""), p.reset(), N();
106
+ C(""), p.reset(), $();
105
107
  },
106
- onError: (e) => g.error(F(e, "Could not post the comment"))
107
- }), $ = _({
108
- mutationFn: ({ id: e, resolved: d }) => i.request(q(`/comments/${e}/resolve`, { resolved: d })),
109
- onSuccess: () => void N(),
110
- onError: (e) => g.error(F(e, "Could not update the comment"))
111
- }), R = () => {
108
+ onError: (e) => y.error(F(e, "Could not post the comment"))
109
+ }), R = q({
110
+ mutationFn: ({ id: e, resolved: d }) => a.request(D(`/comments/${e}/resolve`, { resolved: d })),
111
+ onSuccess: () => void $(),
112
+ onError: (e) => y.error(F(e, "Could not update the comment"))
113
+ }), S = () => {
112
114
  const e = p.compose(h);
113
- e && !p.uploading && !y.isPending && y.mutate(e);
114
- }, B = () => {
115
+ e && !p.uploading && !g.isPending && g.mutate(e);
116
+ }, Q = () => {
115
117
  const e = new URL(window.location.href);
116
118
  e.searchParams.delete("field");
117
119
  const d = e.search ? "&" : "?";
118
- navigator.clipboard.writeText(`${e.origin}${e.pathname}${e.search}${d}${X(o)}`).then(
119
- () => g.success("Link to this field copied"),
120
- () => g.error("Could not copy")
120
+ navigator.clipboard.writeText(`${e.origin}${e.pathname}${e.search}${d}${Y(o)}`).then(
121
+ () => y.success("Link to this field copied"),
122
+ () => y.error("Could not copy")
121
123
  );
122
- }, S = (e, d) => {
124
+ }, T = (e, d) => {
123
125
  var x;
124
- return /* @__PURE__ */ a("li", { "data-field-comment-row": e.id, className: "px-3 py-2", children: [
125
- /* @__PURE__ */ a("div", { className: "flex items-baseline gap-1.5", children: [
126
- /* @__PURE__ */ n("span", { className: "truncate text-[12px] font-medium text-slate-800 dark:text-foreground", children: D(e.user) }),
127
- /* @__PURE__ */ n("span", { className: "shrink-0 text-[11px] text-slate-400 dark:text-muted-foreground", children: oe(e.created_at) }),
128
- /* @__PURE__ */ a(
126
+ return /* @__PURE__ */ i("li", { "data-field-comment-row": e.id, className: "px-3 py-2", children: [
127
+ /* @__PURE__ */ i("div", { className: "flex items-baseline gap-1.5", children: [
128
+ /* @__PURE__ */ n("span", { className: "truncate text-[12px] font-medium text-slate-800 dark:text-foreground", children: b(e.user) }),
129
+ /* @__PURE__ */ n("span", { className: "shrink-0 text-[11px] text-slate-400 dark:text-muted-foreground", children: I(e.created_at) }),
130
+ /* @__PURE__ */ i(
129
131
  "button",
130
132
  {
131
133
  type: "button",
132
- disabled: $.isPending,
133
- onClick: () => $.mutate({ id: e.id, resolved: !d }),
134
+ disabled: R.isPending,
135
+ onClick: () => R.mutate({ id: e.id, resolved: !d }),
134
136
  "data-field-comment-resolve": e.id,
135
137
  className: "ml-auto inline-flex shrink-0 items-center gap-1 rounded px-1 py-px text-[11px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground",
136
138
  children: [
137
- d ? /* @__PURE__ */ n(A, { "aria-hidden": !0, className: "h-3 w-3" }) : /* @__PURE__ */ n(H, { "aria-hidden": !0, className: "h-3 w-3" }),
139
+ d ? /* @__PURE__ */ n(H, { "aria-hidden": !0, className: "h-3 w-3" }) : /* @__PURE__ */ n(z, { "aria-hidden": !0, className: "h-3 w-3" }),
138
140
  d ? "Reopen" : "Resolve"
139
141
  ]
140
142
  }
@@ -144,21 +146,22 @@ function fe({
144
146
  le,
145
147
  {
146
148
  text: e.text,
147
- className: L(
149
+ caption: `${b(e.user)} · ${I(e.created_at)}`,
150
+ className: M(
148
151
  "m-0 mt-0.5 whitespace-pre-wrap text-[12.5px] leading-snug [overflow-wrap:anywhere]",
149
152
  d ? "text-slate-400 dark:text-muted-foreground" : "text-slate-600 dark:text-slate-300"
150
153
  )
151
154
  }
152
155
  ),
153
- !d && ((((x = e.seen_by) == null ? void 0 : x.length) ?? 0) > 0 || e.delivery_visible) && /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-2", children: [
156
+ !d && ((((x = e.seen_by) == null ? void 0 : x.length) ?? 0) > 0 || e.delivery_visible) && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-x-2", children: [
154
157
  /* @__PURE__ */ n(re, { people: e.seen_by }),
155
- e.delivery_visible && /* @__PURE__ */ n(ie, { collection: t.collection, item: t.item, commentId: e.id })
158
+ e.delivery_visible && /* @__PURE__ */ n(ae, { collection: t.collection, item: t.item, commentId: e.id })
156
159
  ] })
157
160
  ] }, e.id);
158
161
  };
159
- return /* @__PURE__ */ a("div", { "data-field-comments": o, children: [
160
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-border", children: [
161
- /* @__PURE__ */ a("p", { className: "m-0 min-w-0 flex-1 truncate text-[12px] font-semibold text-slate-700 dark:text-foreground", children: [
162
+ return /* @__PURE__ */ i("div", { "data-field-comments": o, children: [
163
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-border", children: [
164
+ /* @__PURE__ */ i("p", { className: "m-0 min-w-0 flex-1 truncate text-[12px] font-semibold text-slate-700 dark:text-foreground", children: [
162
165
  "Comments on ",
163
166
  r
164
167
  ] }),
@@ -166,18 +169,18 @@ function fe({
166
169
  "button",
167
170
  {
168
171
  type: "button",
169
- onClick: B,
172
+ onClick: Q,
170
173
  "aria-label": `Copy a link to ${r}`,
171
174
  "data-tip": "Copy a link that opens the record on this field",
172
175
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-foreground",
173
- children: /* @__PURE__ */ n(W, { "aria-hidden": !0, className: "h-3.5 w-3.5" })
176
+ children: /* @__PURE__ */ n(A, { "aria-hidden": !0, className: "h-3.5 w-3.5" })
174
177
  }
175
178
  )
176
179
  ] }),
177
- /* @__PURE__ */ a("div", { className: "max-h-[260px] overflow-y-auto overscroll-contain", children: [
178
- c ? /* @__PURE__ */ n("p", { className: "m-0 px-3 py-3 text-[12px] text-slate-400 dark:text-muted-foreground", children: "Loading…" }) : l.open.length === 0 && l.resolved.length === 0 ? /* @__PURE__ */ n("p", { className: "m-0 px-3 py-3 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No comments on this field yet. They also show in the record’s Comments." }) : /* @__PURE__ */ a("ul", { className: "m-0 list-none divide-y divide-slate-100 p-0 dark:divide-border", children: [
179
- l.open.map((e) => S(e, !1)),
180
- u && l.resolved.map((e) => S(e, !0))
180
+ /* @__PURE__ */ i("div", { className: "max-h-[260px] overflow-y-auto overscroll-contain", children: [
181
+ c ? /* @__PURE__ */ n("p", { className: "m-0 px-3 py-3 text-[12px] text-slate-400 dark:text-muted-foreground", children: "Loading…" }) : l.open.length === 0 && l.resolved.length === 0 ? /* @__PURE__ */ n("p", { className: "m-0 px-3 py-3 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No comments on this field yet. They also show in the record’s Comments." }) : /* @__PURE__ */ i("ul", { className: "m-0 list-none divide-y divide-slate-100 p-0 dark:divide-border", children: [
182
+ l.open.map((e) => T(e, !1)),
183
+ u && l.resolved.map((e) => T(e, !0))
181
184
  ] }),
182
185
  l.resolved.length > 0 && /* @__PURE__ */ n(
183
186
  "button",
@@ -190,7 +193,7 @@ function fe({
190
193
  }
191
194
  )
192
195
  ] }),
193
- w.length > 0 && /* @__PURE__ */ a(
196
+ w.length > 0 && /* @__PURE__ */ i(
194
197
  "p",
195
198
  {
196
199
  "data-field-comment-typing": o,
@@ -198,51 +201,51 @@ function fe({
198
201
  className: "m-0 flex items-center gap-1.5 border-t border-slate-100 px-3 py-1.5 text-[11.5px] italic text-slate-400 dark:border-border dark:text-slate-500",
199
202
  children: [
200
203
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan motion-reduce:animate-none" }),
201
- te(w, "replying"),
204
+ oe(w, "replying"),
202
205
  "…"
203
206
  ]
204
207
  }
205
208
  ),
206
- /* @__PURE__ */ a("div", { className: "space-y-1.5 border-t border-slate-200 p-2 dark:border-border", children: [
209
+ /* @__PURE__ */ i("div", { className: "space-y-1.5 border-t border-slate-200 p-2 dark:border-border", children: [
207
210
  /* @__PURE__ */ n(
208
211
  ne,
209
212
  {
210
213
  compact: !0,
211
- replies: C.replies.map((e) => ({
214
+ replies: N.replies.map((e) => ({
212
215
  id: e.id,
213
- name: D(e.user),
216
+ name: b(e.user),
214
217
  text: de({ kind: "comment", comment: e }),
215
218
  created_at: e.created_at
216
219
  })),
217
- onDismiss: C.dismiss
220
+ onDismiss: N.dismiss
218
221
  }
219
222
  ),
220
223
  /* @__PURE__ */ n(
221
224
  me,
222
225
  {
223
226
  value: h,
224
- onChange: k,
227
+ onChange: C,
225
228
  onImages: p.addFiles,
226
229
  rows: 2,
227
230
  "aria-label": `Comment on ${r}`,
228
231
  placeholder: "Write a comment… type @ to mention someone",
229
232
  className: "min-h-[56px] text-[12.5px]",
230
233
  onKeyDownCapture: (e) => {
231
- e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), R());
234
+ e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), S());
232
235
  }
233
236
  }
234
237
  ),
235
238
  /* @__PURE__ */ n(se, { images: p }),
236
- /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-2", children: [
239
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
237
240
  /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Only people who can open this record are notified." }),
238
241
  /* @__PURE__ */ n(
239
242
  "button",
240
243
  {
241
244
  type: "button",
242
- onClick: R,
243
- disabled: !h.trim() && !p.hasReady || p.uploading || y.isPending,
245
+ onClick: S,
246
+ disabled: !h.trim() && !p.hasReady || p.uploading || g.isPending,
244
247
  className: "inline-flex h-7 shrink-0 items-center rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white transition-colors hover:bg-nvr-cyan-dark disabled:opacity-50",
245
- children: y.isPending ? "Posting…" : p.uploading ? "Uploading…" : "Comment"
248
+ children: g.isPending ? "Posting…" : p.uploading ? "Uploading…" : "Comment"
246
249
  }
247
250
  )
248
251
  ] })
@@ -1,126 +1,141 @@
1
- import { jsxs as d, Fragment as R, jsx as i } from "react/jsx-runtime";
2
- import { Crosshair as q, X as T } from "lucide-react";
3
- import { useState as D, useRef as m, useEffect as u } from "react";
4
- import { createPortal as E } from "react-dom";
5
- import { toast as g } from "sonner";
6
- import { useFieldPointer as H, useCoViewers as j, pointMayScroll as F, pointRefusalText as I } from "../../lib/co-edit.js";
7
- import { useLivePreference as L } from "../../lib/live-preference.js";
8
- import { CoViewerAvatar as M } from "./SectionPresence.js";
9
- const O = 6e4, _ = 6e3;
1
+ import { jsxs as p, Fragment as E, jsx as l } from "react/jsx-runtime";
2
+ import { Crosshair as H, X as R } from "lucide-react";
3
+ import { useState as q, useRef as b, useEffect as c } from "react";
4
+ import { createPortal as T } from "react-dom";
5
+ import { toast as w } from "sonner";
6
+ import { useFieldPointer as _, useCoViewers as A, pointMayScroll as B, pointRefusalText as D } from "../../lib/co-edit.js";
7
+ import { useLivePreference as F } from "../../lib/live-preference.js";
8
+ import { CoViewerAvatar as I } from "./SectionPresence.js";
9
+ const L = 6e4, O = 6e3, j = 72;
10
+ function M(e) {
11
+ for (let t = (e == null ? void 0 : e.parentElement) ?? null; t; t = t.parentElement) {
12
+ const i = getComputedStyle(t).overflowY;
13
+ if ((i === "auto" || i === "scroll") && t.scrollHeight > t.clientHeight) return t;
14
+ }
15
+ return null;
16
+ }
10
17
  let C = 0, k = !1;
11
- function z() {
18
+ function $() {
12
19
  if (k || typeof document > "u") return;
13
20
  k = !0;
14
21
  const e = () => {
15
22
  C = Date.now();
16
23
  };
17
- for (const n of ["pointerdown", "wheel", "keydown", "touchstart"])
18
- document.addEventListener(n, e, { capture: !0, passive: !0 });
24
+ for (const t of ["pointerdown", "wheel", "keydown", "touchstart"])
25
+ document.addEventListener(t, e, { capture: !0, passive: !0 });
19
26
  }
20
- function A() {
21
- var n;
27
+ function z() {
28
+ var t;
22
29
  const e = typeof document < "u" ? document.activeElement : null;
23
- return !e || e === document.body ? !1 : ((n = e.matches) == null ? void 0 : n.call(e, 'input, textarea, select, [contenteditable="true"], [role="combobox"]')) ?? !1;
30
+ return !e || e === document.body ? !1 : ((t = e.matches) == null ? void 0 : t.call(e, 'input, textarea, select, [contenteditable="true"], [role="combobox"]')) ?? !1;
24
31
  }
25
32
  function G() {
26
33
  return typeof document < "u" && !!document.querySelector('[data-radix-popper-content-wrapper], [role="menu"]');
27
34
  }
28
- function Y({
35
+ function ee({
29
36
  collection: e,
30
- itemId: n,
31
- fieldLabel: s,
32
- onGo: a
37
+ itemId: t,
38
+ fieldLabel: i,
39
+ onGo: d
33
40
  }) {
34
- var w;
35
- const { pointer: o, result: t, dismiss: S } = H(e, n), N = j(e, n), { quiet: h } = L(), [r, c] = D(null), b = m(null), f = m(a);
36
- f.current = a;
37
- const x = m(h);
38
- x.current = h, u(() => z(), []), u(() => {
39
- if (!o) return;
40
- const p = F({
41
+ var g;
42
+ const { pointer: s, result: n, dismiss: S } = _(e, t), N = A(e, t), { quiet: v } = F(), [r, u] = q(null), m = b(null), h = b(d);
43
+ h.current = d;
44
+ const x = b(v);
45
+ x.current = v, c(() => $(), []), c(() => {
46
+ if (!s) return;
47
+ const a = B({
41
48
  quiet: x.current,
42
49
  visible: typeof document > "u" || document.visibilityState === "visible",
43
- editingSomething: A(),
50
+ editingSomething: z(),
44
51
  popoverOpen: G(),
45
52
  lastInputAt: C,
46
53
  now: Date.now()
47
- }) ? f.current(o.field) : !1;
48
- c({ p: o, scrolled: p }), S();
49
- }, [o == null ? void 0 : o.at]), u(() => {
54
+ }) ? h.current(s.field) : !1;
55
+ u({ p: s, scrolled: a }), S();
56
+ }, [s == null ? void 0 : s.at]), c(() => {
57
+ if (!r) return;
58
+ const o = setTimeout(() => u(null), r.scrolled ? O : L);
59
+ return () => clearTimeout(o);
60
+ }, [r]), c(() => {
61
+ var f;
62
+ if (!n) return;
63
+ const o = (f = N.find((P) => P.id.toUpperCase() === n.to.toUpperCase())) == null ? void 0 : f.name, a = o ?? "They";
64
+ n.ok ? w(`${a} was pointed to ${i(n.field)}`) : w.info(D(n.reason, o ?? "That person"));
65
+ }, [n == null ? void 0 : n.seq]), c(() => {
50
66
  if (!r) return;
51
- const l = setTimeout(() => c(null), r.scrolled ? _ : O);
52
- return () => clearTimeout(l);
53
- }, [r]), u(() => {
54
- var y;
55
- if (!t) return;
56
- const l = (y = N.find((P) => P.id.toUpperCase() === t.to.toUpperCase())) == null ? void 0 : y.name, p = l ?? "They";
57
- t.ok ? g(`${p} was pointed to ${s(t.field)}`) : g.info(I(t.reason, l ?? "That person"));
58
- }, [t == null ? void 0 : t.seq]);
59
- const v = ((w = b.current) == null ? void 0 : w.closest('[role="dialog"]')) ?? (typeof document < "u" ? document.body : null);
60
- return /* @__PURE__ */ d(R, { children: [
61
- /* @__PURE__ */ i("span", { ref: b, hidden: !0 }),
62
- r && v && E(
63
- /* @__PURE__ */ i(
67
+ const o = M(m.current);
68
+ if (!o) return;
69
+ const a = o.style.paddingBottom, f = Number.parseFloat(getComputedStyle(o).paddingBottom) || 0;
70
+ return o.style.paddingBottom = `${f + j}px`, () => {
71
+ o.style.paddingBottom = a;
72
+ };
73
+ }, [r]);
74
+ const y = ((g = m.current) == null ? void 0 : g.closest('[role="dialog"]')) ?? (typeof document < "u" ? document.body : null);
75
+ return /* @__PURE__ */ p(E, { children: [
76
+ /* @__PURE__ */ l("span", { ref: m, hidden: !0 }),
77
+ r && y && T(
78
+ /* @__PURE__ */ l(
64
79
  U,
65
80
  {
66
81
  pointer: r.p,
67
- label: s(r.p.field),
82
+ label: i(r.p.field),
68
83
  scrolled: r.scrolled,
69
84
  onGo: () => {
70
- f.current(r.p.field), c(null);
85
+ h.current(r.p.field), u(null);
71
86
  },
72
- onClose: () => c(null)
87
+ onClose: () => u(null)
73
88
  }
74
89
  ),
75
- v
90
+ y
76
91
  )
77
92
  ] });
78
93
  }
79
94
  function U({
80
95
  pointer: e,
81
- label: n,
82
- scrolled: s,
83
- onGo: a,
84
- onClose: o
96
+ label: t,
97
+ scrolled: i,
98
+ onGo: d,
99
+ onClose: s
85
100
  }) {
86
- const t = e.user;
87
- return /* @__PURE__ */ d(
101
+ const n = e.user;
102
+ return /* @__PURE__ */ p(
88
103
  "div",
89
104
  {
90
105
  role: "status",
91
106
  "aria-live": "polite",
92
107
  "data-field-pointer": e.field,
93
- className: "nvr-slide-up-centered fixed bottom-5 left-1/2 z-[60] flex max-w-[calc(100vw-32px)] -translate-x-1/2 items-center gap-2 rounded-full border border-slate-200 bg-white py-1 pl-1.5 pr-1 text-[12.5px] text-slate-700 shadow-lg shadow-slate-900/5 dark:border-border dark:bg-card dark:text-slate-200 dark:shadow-black/30",
108
+ className: "nvr-slide-up-centered fixed bottom-[max(1.25rem,env(safe-area-inset-bottom))] left-1/2 z-[60] flex max-w-[calc(100vw-32px)] -translate-x-1/2 items-center gap-2 rounded-full border border-slate-200 bg-white py-1 pl-1.5 pr-1 text-[12.5px] text-slate-700 shadow-lg shadow-slate-900/5 dark:border-border dark:bg-card dark:text-slate-200 dark:shadow-black/30",
94
109
  children: [
95
- /* @__PURE__ */ i(M, { person: t, size: 22 }),
96
- /* @__PURE__ */ d("span", { className: "min-w-0 truncate", children: [
97
- /* @__PURE__ */ i("span", { className: "font-medium text-slate-900 dark:text-slate-50", children: t.name }),
110
+ /* @__PURE__ */ l(I, { person: n, size: 22 }),
111
+ /* @__PURE__ */ p("span", { className: "min-w-0 truncate", children: [
112
+ /* @__PURE__ */ l("span", { className: "font-medium text-slate-900 dark:text-slate-50", children: n.name }),
98
113
  " ",
99
- s ? "pointed you here:" : "pointed you to",
114
+ i ? "pointed you here:" : "pointed you to",
100
115
  " ",
101
- /* @__PURE__ */ i("span", { className: "font-medium text-slate-900 dark:text-slate-50", children: n })
116
+ /* @__PURE__ */ l("span", { className: "font-medium text-slate-900 dark:text-slate-50", children: t })
102
117
  ] }),
103
- !s && /* @__PURE__ */ d(
118
+ !i && /* @__PURE__ */ p(
104
119
  "button",
105
120
  {
106
121
  type: "button",
107
- onClick: a,
122
+ onClick: d,
108
123
  "data-field-pointer-go": "",
109
- className: "inline-flex shrink-0 items-center gap-1 rounded px-1.5 py-1 text-[12px] font-semibold text-[#0e7490] underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-nvr-cyan",
124
+ className: "inline-flex h-7 shrink-0 items-center gap-1 rounded-full border border-cyan-600/30 bg-cyan-50 px-2.5 text-[12px] font-semibold text-[#0e7490] transition-colors hover:bg-cyan-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:border-nvr-cyan/40 dark:bg-nvr-cyan/10 dark:text-nvr-cyan dark:hover:bg-nvr-cyan/20",
110
125
  children: [
111
- /* @__PURE__ */ i(q, { className: "h-3 w-3", "aria-hidden": !0 }),
126
+ /* @__PURE__ */ l(H, { className: "h-3 w-3", "aria-hidden": !0 }),
112
127
  "Go"
113
128
  ]
114
129
  }
115
130
  ),
116
- /* @__PURE__ */ i(
131
+ /* @__PURE__ */ l(
117
132
  "button",
118
133
  {
119
134
  type: "button",
120
- onClick: o,
135
+ onClick: s,
121
136
  "aria-label": "Dismiss",
122
137
  className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-slate-400 hover:bg-slate-100 hover:text-slate-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:hover:bg-muted dark:hover:text-slate-300",
123
- children: /* @__PURE__ */ i(T, { className: "h-3.5 w-3.5" })
138
+ children: /* @__PURE__ */ l(R, { className: "h-3.5 w-3.5" })
124
139
  }
125
140
  )
126
141
  ]
@@ -128,5 +143,5 @@ function U({
128
143
  );
129
144
  }
130
145
  export {
131
- Y as FieldPointerHost
146
+ ee as FieldPointerHost
132
147
  };