@nivaro/react 0.3.116 → 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 (142) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +140 -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 +3855 -3785
  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/ReportView.js +1086 -1091
  27. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  28. package/dist/shared/components/TipLayer.js +65 -58
  29. package/dist/shared/components/WidgetImageMenu.js +83 -43
  30. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  32. package/dist/shared/components/cbv/column-totals.js +62 -57
  33. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  34. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  35. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  36. package/dist/shared/components/charts/category-axis.js +93 -0
  37. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  38. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  40. package/dist/shared/components/collections-directory/page-model.js +72 -67
  41. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  42. package/dist/shared/components/integrations/SendStatus.js +65 -59
  43. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  44. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  45. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  46. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  47. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  48. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  49. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  50. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  51. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  52. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  53. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  54. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  55. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  56. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  57. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  58. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  59. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  60. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  61. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  62. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  63. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  64. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  65. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  66. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  67. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  68. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  69. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  70. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  71. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  72. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  73. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  74. package/dist/shared/components/item-edit/UserChip.js +1 -1
  75. package/dist/shared/components/item-edit/file-live.js +69 -54
  76. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  77. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  78. package/dist/shared/components/item-edit/removed-line.js +31 -25
  79. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  80. package/dist/shared/components/list/ListViewers.js +46 -35
  81. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  82. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  83. package/dist/shared/components/panels/AlertBanners.js +82 -72
  84. package/dist/shared/components/panels/BranchLanes.js +22 -22
  85. package/dist/shared/components/panels/CommentImages.js +123 -102
  86. package/dist/shared/components/panels/CommentPanel.js +186 -185
  87. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  88. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  89. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  90. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  91. package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
  92. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  93. package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
  94. package/dist/shared/components/profile/AgentNameField.js +107 -81
  95. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  96. package/dist/shared/components/profile/PersonAccess.js +599 -495
  97. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  98. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  99. package/dist/shared/components/profile/primitives.js +1 -1
  100. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  101. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  102. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  103. package/dist/shared/components/support/AssignRules.js +1733 -0
  104. package/dist/shared/components/support/PersonPick.js +88 -0
  105. package/dist/shared/components/support/RequestList.js +790 -0
  106. package/dist/shared/components/support/ScreenShare.js +158 -152
  107. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  108. package/dist/shared/components/support/SupportView.js +140 -246
  109. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  110. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  111. package/dist/shared/components/support/assign-rules-text.js +171 -0
  112. package/dist/shared/components/support/support-list.js +125 -0
  113. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  114. package/dist/shared/components/ui/checkbox.js +6 -6
  115. package/dist/shared/components/ui/select.js +43 -39
  116. package/dist/shared/components/ui/sheet.js +9 -9
  117. package/dist/shared/components/ui/switch.js +12 -11
  118. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  119. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  120. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  121. package/dist/shared/lib/activity-sentence.js +103 -91
  122. package/dist/shared/lib/agent-presence.js +27 -21
  123. package/dist/shared/lib/approval-progress.js +2 -2
  124. package/dist/shared/lib/copy-rules.js +31 -24
  125. package/dist/shared/lib/derived-causes.js +113 -78
  126. package/dist/shared/lib/grid-cursors.js +26 -26
  127. package/dist/shared/lib/label-flash.js +27 -0
  128. package/dist/shared/lib/list-return.js +137 -125
  129. package/dist/shared/lib/live-deltas.js +40 -34
  130. package/dist/shared/lib/live-groups.js +56 -52
  131. package/dist/shared/lib/live-preference.js +64 -59
  132. package/dist/shared/lib/live-screen.js +223 -192
  133. package/dist/shared/lib/partner-failure.js +11 -11
  134. package/dist/shared/lib/rollup-recalc.js +68 -64
  135. package/dist/shared/lib/screen-refresh.js +74 -68
  136. package/dist/shared/lib/screen-share.js +108 -104
  137. package/dist/shared/lib/send-status.js +77 -61
  138. package/dist/shared/lib/text-diff-window.js +29 -0
  139. package/dist/shared/lib/use-query-entry.js +17 -0
  140. package/dist/shared/lib/watch-list.js +210 -209
  141. package/dist/shared/lib/widget-image-render.js +72 -49
  142. package/package.json +1 -1
@@ -1,156 +1,175 @@
1
- import { jsxs as t, jsx as n, Fragment as y } from "react/jsx-runtime";
2
- import { History as D, ExternalLink as T, RotateCcw as B, Trash2 as H } from "lucide-react";
3
- import { useState as E } from "react";
4
- import { useItemNavigation as I } from "../../context.js";
5
- import { draftIsFromOtherDevice as J, draftFilledBack as L } from "../../lib/draft-store.js";
6
- import { titleCase as $ } from "../../lib/utils.js";
7
- import { RelativeTime as _ } from "../RelativeTime.js";
8
- const j = (r) => {
9
- if (r == null || r === "") return "empty";
10
- if (typeof r == "boolean") return r ? "Yes" : "No";
11
- const c = typeof r == "object" ? JSON.stringify(r) : String(r);
12
- return c.length > 60 ? `${c.slice(0, 60)}…` : c;
1
+ import { jsxs as t, jsx as a, Fragment as O } from "react/jsx-runtime";
2
+ import { History as D, ExternalLink as B, RotateCcw as H, Trash2 as E } from "lucide-react";
3
+ import { useState as I } from "react";
4
+ import { useItemNavigation as J } from "../../context.js";
5
+ import { draftIsFromOtherDevice as L, draftFilledBack as P } from "../../lib/draft-store.js";
6
+ import { diffWindow as W } from "../../lib/text-diff-window.js";
7
+ import { titleCase as C } from "../../lib/utils.js";
8
+ import { RelativeTime as S } from "../RelativeTime.js";
9
+ const R = (e) => {
10
+ if (e == null || e === "") return "empty";
11
+ if (typeof e == "boolean") return e ? "Yes" : "No";
12
+ const s = typeof e == "object" ? JSON.stringify(e) : String(e);
13
+ return s.length > 60 ? `${s.slice(0, 60)}…` : s;
13
14
  };
14
- function P({
15
- draft: r,
16
- labelFor: c,
17
- current: N,
18
- recordChanged: O,
19
- onRestore: C,
20
- onDiscard: R,
21
- createdId: p = null,
22
- collection: x,
23
- renderValue: b
15
+ function Y(e, s) {
16
+ const d = (o) => typeof o == "string" || o == null;
17
+ if (!d(e) || !d(s)) return null;
18
+ const b = e == null ? "" : String(e), u = s == null ? "" : String(s);
19
+ if (b.length <= 60 && u.length <= 60) return null;
20
+ const f = W(b.replace(/\s+/g, " "), u.replace(/\s+/g, " "));
21
+ return { before: f.before || "empty", after: f.after || "empty" };
22
+ }
23
+ function X({
24
+ draft: e,
25
+ labelFor: s,
26
+ current: d,
27
+ recordChanged: b,
28
+ onRestore: u,
29
+ onDiscard: f,
30
+ createdId: o = null,
31
+ collection: k,
32
+ renderValue: x
24
33
  }) {
25
- const [k, S] = E(!1), s = J(r) ? r.device : null, w = I(), f = Object.entries(r.fields ?? {}), F = L(r), g = f.filter(([e]) => F.has(e)).length, h = f.length - g, u = p !== null, v = Object.values(r.pending_rows ?? {}).reduce((e, a) => e + a.length, 0), i = Object.values(r.pending_edits ?? {}).reduce(
26
- (e, a) => e + Object.keys(a).length,
34
+ const [N, F] = I(!1), l = L(e) ? e.device : null, j = J(), y = Object.entries(e.fields ?? {}), T = P(e), $ = y.filter(([r]) => T.has(r)).length, g = y.length - $, v = o !== null, _ = Object.values(e.pending_rows ?? {}).reduce((r, n) => r + n.length, 0), m = Object.values(e.pending_edits ?? {}).reduce(
35
+ (r, n) => r + Object.keys(n).length,
27
36
  0
28
- ), o = Object.values(r.pending_deletes ?? {}).reduce((e, a) => e + a.length, 0), d = Object.values(r.m2m_links ?? {}).reduce((e, a) => e + a.length, 0), m = Object.values(r.m2m_unlinks ?? {}).reduce((e, a) => e + a.length, 0), l = [];
29
- return h && l.push(`${h} field${h === 1 ? "" : "s"}`), g && l.push(`${g} filled in from ${h === 1 ? "it" : "them"}`), v && l.push(`${v} new line${v === 1 ? "" : "s"}`), i && l.push(`${i} line edit${i === 1 ? "" : "s"}`), o && l.push(`${o} line removal${o === 1 ? "" : "s"}`), d && l.push(`${d} link${d === 1 ? "" : "s"}`), m && l.push(`${m} unlink${m === 1 ? "" : "s"}`), /* @__PURE__ */ t(
37
+ ), c = Object.values(e.pending_deletes ?? {}).reduce((r, n) => r + n.length, 0), p = Object.values(e.m2m_links ?? {}).reduce((r, n) => r + n.length, 0), h = Object.values(e.m2m_unlinks ?? {}).reduce((r, n) => r + n.length, 0), i = [];
38
+ return g && i.push(`${g} field${g === 1 ? "" : "s"}`), $ && i.push(`${$} filled in from ${g === 1 ? "it" : "them"}`), _ && i.push(`${_} new line${_ === 1 ? "" : "s"}`), m && i.push(`${m} line edit${m === 1 ? "" : "s"}`), c && i.push(`${c} line removal${c === 1 ? "" : "s"}`), p && i.push(`${p} link${p === 1 ? "" : "s"}`), h && i.push(`${h} unlink${h === 1 ? "" : "s"}`), /* @__PURE__ */ t(
30
39
  "div",
31
40
  {
32
41
  className: "mb-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-[12.5px] text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200",
33
42
  "data-nvr-draft-recovery": !0,
34
43
  children: [
35
- /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
36
- /* @__PURE__ */ n(D, { className: "h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400" }),
37
- /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
38
- u ? /* @__PURE__ */ t("span", { className: "font-semibold", "data-nvr-draft-created": !0, children: [
39
- "These changes from ",
40
- /* @__PURE__ */ n(_, { value: r.saved_at }),
41
- " were already saved as a new record — restoring them makes a second one."
42
- ] }) : /* @__PURE__ */ t("span", { className: "font-semibold", "data-nvr-draft-other-device": s == null ? void 0 : s.label, children: [
43
- s ? /* @__PURE__ */ t(y, { children: [
44
- "Continue your draft from your ",
45
- s.label
46
- ] }) : /* @__PURE__ */ n(y, { children: "Restore your unsaved changes from" }),
47
- " ",
48
- s ? "(" : "",
49
- /* @__PURE__ */ n(_, { value: r.saved_at }),
50
- s ? ")" : "",
51
- "?"
52
- ] }),
53
- " ",
54
- /* @__PURE__ */ n("span", { className: "text-amber-800/80 dark:text-amber-200/80", children: l.join(" · ") }),
55
- !!r.dropped_fields && /* @__PURE__ */ t("span", { className: "ml-1 text-[11.5px]", "data-nvr-draft-dropped": !0, children: [
56
- "(",
57
- r.dropped_fields,
58
- " field",
59
- r.dropped_fields === 1 ? "" : "s",
60
- " you can no longer edit ",
61
- r.dropped_fields === 1 ? "was" : "were",
62
- " left out)"
63
- ] }),
64
- O && /* @__PURE__ */ n("span", { className: "ml-1 rounded bg-amber-200/70 px-1 py-px text-[10.5px] font-semibold uppercase tracking-wide text-amber-900 dark:bg-amber-500/30 dark:text-amber-100", children: "record changed since — review before restoring" })
65
- ] }),
66
- /* @__PURE__ */ n(
67
- "button",
68
- {
69
- type: "button",
70
- onClick: () => S((e) => !e),
71
- className: "text-[11.5px] underline decoration-dotted underline-offset-2",
72
- children: k ? "Hide changes" : "Show changes"
73
- }
74
- ),
75
- u && p && x && /* @__PURE__ */ t(
76
- "a",
77
- {
78
- href: w.urlFor({ collection: x, itemId: p }),
79
- onClick: (e) => {
80
- e.preventDefault(), w.open({ collection: x, itemId: p });
81
- },
82
- className: "inline-flex h-7 items-center gap-1 rounded-md bg-amber-600 px-2.5 text-[11.5px] font-semibold text-white hover:bg-amber-700",
83
- "data-nvr-draft-open-created": !0,
84
- children: [
85
- /* @__PURE__ */ n(T, { className: "h-3 w-3" }),
86
- " Open the record"
87
- ]
88
- }
89
- ),
90
- /* @__PURE__ */ t(
91
- "button",
92
- {
93
- type: "button",
94
- onClick: C,
95
- className: u ? "inline-flex h-7 items-center gap-1 rounded-md border border-amber-300 px-2.5 text-[11.5px] font-medium hover:bg-amber-100 dark:border-amber-500/40 dark:hover:bg-amber-500/15" : "inline-flex h-7 items-center gap-1 rounded-md bg-amber-600 px-2.5 text-[11.5px] font-semibold text-white hover:bg-amber-700",
96
- "data-nvr-draft-restore": !0,
97
- children: [
98
- /* @__PURE__ */ n(B, { className: "h-3 w-3" }),
44
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-start gap-x-3 gap-y-2", children: [
45
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 basis-[18rem] items-start gap-2", children: [
46
+ /* @__PURE__ */ a(D, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400" }),
47
+ /* @__PURE__ */ t("div", { className: "min-w-0", children: [
48
+ v ? /* @__PURE__ */ t("p", { className: "font-semibold", "data-nvr-draft-created": !0, children: [
49
+ "These changes from ",
50
+ /* @__PURE__ */ a(S, { value: e.saved_at }),
51
+ " were already saved as a new record — restoring them makes a second one."
52
+ ] }) : /* @__PURE__ */ t("p", { className: "font-semibold", "data-nvr-draft-other-device": l == null ? void 0 : l.label, children: [
53
+ l ? /* @__PURE__ */ t(O, { children: [
54
+ "Continue your draft from your ",
55
+ l.label
56
+ ] }) : /* @__PURE__ */ a(O, { children: "Restore your unsaved changes from" }),
99
57
  " ",
100
- u ? "Restore anyway" : s ? "Continue" : "Restore"
101
- ]
102
- }
103
- ),
104
- /* @__PURE__ */ t(
105
- "button",
106
- {
107
- type: "button",
108
- onClick: R,
109
- className: "inline-flex h-7 items-center gap-1 rounded-md border border-amber-300 px-2.5 text-[11.5px] font-medium hover:bg-amber-100 dark:border-amber-500/40 dark:hover:bg-amber-500/15",
110
- "data-nvr-draft-discard": !0,
111
- children: [
112
- /* @__PURE__ */ n(H, { className: "h-3 w-3" }),
113
- " Discard"
114
- ]
115
- }
116
- )
117
- ] }),
118
- k && /* @__PURE__ */ t("div", { className: "mt-2 max-h-[240px] space-y-1 overflow-y-auto border-t border-amber-200/70 pt-2 dark:border-amber-500/30", children: [
119
- f.map(([e, a]) => /* @__PURE__ */ t("div", { className: "text-[11.5px]", children: [
120
- /* @__PURE__ */ n("span", { className: "font-medium", children: c(e) || $(e.replace(/_/g, " ")) }),
121
- /* @__PURE__ */ t("p", { className: "break-words text-amber-800/80 dark:text-amber-200/80", children: [
122
- /* @__PURE__ */ n("span", { className: "line-through opacity-70", children: b ? b(e, N[e]) : j(N[e]) }),
123
- " ",
124
- /* @__PURE__ */ n("span", { className: "font-medium text-amber-900 dark:text-amber-100", children: b ? b(e, a) : j(a) })
58
+ l ? "(" : "",
59
+ /* @__PURE__ */ a(S, { value: e.saved_at }),
60
+ l ? ")" : "",
61
+ "?"
62
+ ] }),
63
+ /* @__PURE__ */ t("p", { className: "mt-0.5 text-[11.5px] text-amber-800/90 dark:text-amber-200/85", children: [
64
+ i.join(" · "),
65
+ i.length > 0 && " · ",
66
+ /* @__PURE__ */ a(
67
+ "button",
68
+ {
69
+ type: "button",
70
+ onClick: () => F((r) => !r),
71
+ "aria-expanded": N,
72
+ className: "whitespace-nowrap rounded underline decoration-dotted underline-offset-2 hover:decoration-solid focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60",
73
+ children: N ? "Hide changes" : "Show changes"
74
+ }
75
+ ),
76
+ !!e.dropped_fields && /* @__PURE__ */ t("span", { className: "ml-1", "data-nvr-draft-dropped": !0, children: [
77
+ "(",
78
+ e.dropped_fields,
79
+ " field",
80
+ e.dropped_fields === 1 ? "" : "s",
81
+ " you can no longer edit ",
82
+ e.dropped_fields === 1 ? "was" : "were",
83
+ " left out)"
84
+ ] })
85
+ ] }),
86
+ b && /* @__PURE__ */ a("span", { className: "mt-1 inline-block rounded bg-amber-200/70 px-1 py-px text-[10.5px] font-semibold uppercase tracking-wide text-amber-900 dark:bg-amber-500/30 dark:text-amber-100", children: "record changed since — review before restoring" })
125
87
  ] })
126
- ] }, e)),
127
- Object.entries(r.pending_rows ?? {}).filter(([, e]) => e.length > 0).map(([e, a]) => /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
128
- a.length,
88
+ ] }),
89
+ /* @__PURE__ */ t("div", { className: "flex shrink-0 flex-wrap items-center gap-2 max-sm:pl-6", children: [
90
+ v && o && k && /* @__PURE__ */ t(
91
+ "a",
92
+ {
93
+ href: j.urlFor({ collection: k, itemId: o }),
94
+ onClick: (r) => {
95
+ r.preventDefault(), j.open({ collection: k, itemId: o });
96
+ },
97
+ className: "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-95",
98
+ "data-nvr-draft-open-created": !0,
99
+ children: [
100
+ /* @__PURE__ */ a(B, { className: "h-3.5 w-3.5" }),
101
+ " Open the record"
102
+ ]
103
+ }
104
+ ),
105
+ /* @__PURE__ */ t(
106
+ "button",
107
+ {
108
+ type: "button",
109
+ onClick: u,
110
+ className: v ? "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-amber-300 bg-white px-3 text-[12px] font-medium text-amber-900 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-100 dark:hover:bg-amber-500/15" : "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-95",
111
+ "data-nvr-draft-restore": !0,
112
+ children: [
113
+ /* @__PURE__ */ a(H, { className: "h-3.5 w-3.5" }),
114
+ " ",
115
+ v ? "Restore anyway" : l ? "Continue" : "Restore"
116
+ ]
117
+ }
118
+ ),
119
+ /* @__PURE__ */ t(
120
+ "button",
121
+ {
122
+ type: "button",
123
+ onClick: f,
124
+ className: "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-amber-300 bg-white px-3 text-[12px] font-medium text-amber-900 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-100 dark:hover:bg-amber-500/15",
125
+ "data-nvr-draft-discard": !0,
126
+ children: [
127
+ /* @__PURE__ */ a(E, { className: "h-3.5 w-3.5" }),
128
+ " Discard"
129
+ ]
130
+ }
131
+ )
132
+ ] })
133
+ ] }),
134
+ N && /* @__PURE__ */ t("div", { className: "mt-2 max-h-[240px] space-y-1 overflow-y-auto border-t border-amber-200/70 pt-2 dark:border-amber-500/30", children: [
135
+ y.map(([r, n]) => {
136
+ const w = Y(d[r], n);
137
+ return /* @__PURE__ */ t("div", { className: "text-[11.5px]", children: [
138
+ /* @__PURE__ */ a("span", { className: "font-medium", children: s(r) || C(r.replace(/_/g, " ")) }),
139
+ /* @__PURE__ */ t("p", { className: "break-words text-amber-800/80 dark:text-amber-200/80", children: [
140
+ /* @__PURE__ */ a("span", { className: "line-through opacity-70", children: w ? w.before : x ? x(r, d[r]) : R(d[r]) }),
141
+ " ",
142
+ /* @__PURE__ */ a("span", { className: "font-medium text-amber-900 dark:text-amber-100", children: w ? w.after : x ? x(r, n) : R(n) })
143
+ ] })
144
+ ] }, r);
145
+ }),
146
+ Object.entries(e.pending_rows ?? {}).filter(([, r]) => r.length > 0).map(([r, n]) => /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
147
+ n.length,
129
148
  " new line",
130
- a.length === 1 ? "" : "s",
149
+ n.length === 1 ? "" : "s",
131
150
  " in",
132
151
  " ",
133
- $(e.split(".")[0].replace(/_/g, " "))
134
- ] }, e)),
135
- i > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
136
- i,
152
+ C(r.split(".")[0].replace(/_/g, " "))
153
+ ] }, r)),
154
+ m > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
155
+ m,
137
156
  " edited line",
138
- i === 1 ? "" : "s"
157
+ m === 1 ? "" : "s"
139
158
  ] }),
140
- o > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
141
- o,
159
+ c > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
160
+ c,
142
161
  " line removal",
143
- o === 1 ? "" : "s"
162
+ c === 1 ? "" : "s"
144
163
  ] }),
145
- d > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
146
- d,
164
+ p > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
165
+ p,
147
166
  " relation link",
148
- d === 1 ? "" : "s"
167
+ p === 1 ? "" : "s"
149
168
  ] }),
150
- m > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
151
- m,
169
+ h > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
170
+ h,
152
171
  " relation removal",
153
- m === 1 ? "" : "s"
172
+ h === 1 ? "" : "s"
154
173
  ] })
155
174
  ] })
156
175
  ]
@@ -158,5 +177,5 @@ function P({
158
177
  );
159
178
  }
160
179
  export {
161
- P as DraftRecoveryBanner
180
+ X as DraftRecoveryBanner
162
181
  };
@@ -1,36 +1,36 @@
1
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";
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
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";
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
12
  import { RepliesWhileTyping as ne, SeenByLine as re, MentionDeliveryButton as ie } from "../panels/CommentAwareness.js";
13
13
  import { useCommentImages as ae, 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 i = L();
20
+ return E({
21
+ queryKey: K(t, o),
22
+ queryFn: () => i.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: i } = O(t.collection, o, r), [m, s] = k(null), c = v(() => V(i ?? []), [i]), { 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 }) {
@@ -52,12 +52,12 @@ function xe({
52
52
  "data-field-comment-count": i || void 0,
53
53
  "aria-label": i ? `${i} open ${i === 1 ? "comment" : "comments"} on ${r}` : `Comment on ${r}`,
54
54
  "data-tip": i ? void 0 : `Comment on ${r}`,
55
- className: L(
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
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"
58
58
  ),
59
59
  children: [
60
- /* @__PURE__ */ n(U, { "aria-hidden": !0, className: "h-3 w-3" }),
60
+ /* @__PURE__ */ n(W, { "aria-hidden": !0, className: "h-3 w-3" }),
61
61
  i > 0 && /* @__PURE__ */ n("span", { className: "tabular-nums", children: i })
62
62
  ]
63
63
  }
@@ -82,17 +82,17 @@ function fe({
82
82
  field: o,
83
83
  label: r
84
84
  }) {
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(
85
+ const i = 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, w] = k(""), p = ae();
86
+ Z(t.collection, t.item, h, o);
87
+ const C = ee(t.collection, t.item, "note", { field: o }), j = te(), B = v(
88
88
  () => (s ?? []).filter((e) => e.field === o && !e.resolved_at),
89
89
  [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 = _({
90
+ ), N = J(h, s ? B : void 0, j), $ = () => m.invalidateQueries({ queryKey: K(t.collection, t.item) }), F = (e, d) => {
91
+ var x, _, P;
92
+ 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;
93
+ }, y = q({
94
94
  mutationFn: (e) => i.request(
95
- q("/comments", {
95
+ D("/comments", {
96
96
  collection: t.collection,
97
97
  item: t.item,
98
98
  text: e,
@@ -101,40 +101,40 @@ function fe({
101
101
  })
102
102
  ),
103
103
  onSuccess: () => {
104
- k(""), p.reset(), N();
104
+ w(""), p.reset(), $();
105
105
  },
106
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(),
107
+ }), R = q({
108
+ mutationFn: ({ id: e, resolved: d }) => i.request(D(`/comments/${e}/resolve`, { resolved: d })),
109
+ onSuccess: () => void $(),
110
110
  onError: (e) => g.error(F(e, "Could not update the comment"))
111
- }), R = () => {
111
+ }), S = () => {
112
112
  const e = p.compose(h);
113
113
  e && !p.uploading && !y.isPending && y.mutate(e);
114
- }, B = () => {
114
+ }, Q = () => {
115
115
  const e = new URL(window.location.href);
116
116
  e.searchParams.delete("field");
117
117
  const d = e.search ? "&" : "?";
118
- navigator.clipboard.writeText(`${e.origin}${e.pathname}${e.search}${d}${X(o)}`).then(
118
+ navigator.clipboard.writeText(`${e.origin}${e.pathname}${e.search}${d}${Y(o)}`).then(
119
119
  () => g.success("Link to this field copied"),
120
120
  () => g.error("Could not copy")
121
121
  );
122
- }, S = (e, d) => {
122
+ }, T = (e, d) => {
123
123
  var x;
124
124
  return /* @__PURE__ */ a("li", { "data-field-comment-row": e.id, className: "px-3 py-2", children: [
125
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) }),
126
+ /* @__PURE__ */ n("span", { className: "truncate text-[12px] font-medium text-slate-800 dark:text-foreground", children: b(e.user) }),
127
+ /* @__PURE__ */ n("span", { className: "shrink-0 text-[11px] text-slate-400 dark:text-muted-foreground", children: I(e.created_at) }),
128
128
  /* @__PURE__ */ a(
129
129
  "button",
130
130
  {
131
131
  type: "button",
132
- disabled: $.isPending,
133
- onClick: () => $.mutate({ id: e.id, resolved: !d }),
132
+ disabled: R.isPending,
133
+ onClick: () => R.mutate({ id: e.id, resolved: !d }),
134
134
  "data-field-comment-resolve": e.id,
135
135
  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
136
  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" }),
137
+ d ? /* @__PURE__ */ n(H, { "aria-hidden": !0, className: "h-3 w-3" }) : /* @__PURE__ */ n(z, { "aria-hidden": !0, className: "h-3 w-3" }),
138
138
  d ? "Reopen" : "Resolve"
139
139
  ]
140
140
  }
@@ -144,7 +144,8 @@ function fe({
144
144
  le,
145
145
  {
146
146
  text: e.text,
147
- className: L(
147
+ caption: `${b(e.user)} · ${I(e.created_at)}`,
148
+ className: M(
148
149
  "m-0 mt-0.5 whitespace-pre-wrap text-[12.5px] leading-snug [overflow-wrap:anywhere]",
149
150
  d ? "text-slate-400 dark:text-muted-foreground" : "text-slate-600 dark:text-slate-300"
150
151
  )
@@ -166,18 +167,18 @@ function fe({
166
167
  "button",
167
168
  {
168
169
  type: "button",
169
- onClick: B,
170
+ onClick: Q,
170
171
  "aria-label": `Copy a link to ${r}`,
171
172
  "data-tip": "Copy a link that opens the record on this field",
172
173
  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" })
174
+ children: /* @__PURE__ */ n(A, { "aria-hidden": !0, className: "h-3.5 w-3.5" })
174
175
  }
175
176
  )
176
177
  ] }),
177
178
  /* @__PURE__ */ a("div", { className: "max-h-[260px] overflow-y-auto overscroll-contain", children: [
178
179
  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
+ l.open.map((e) => T(e, !1)),
181
+ u && l.resolved.map((e) => T(e, !0))
181
182
  ] }),
182
183
  l.resolved.length > 0 && /* @__PURE__ */ n(
183
184
  "button",
@@ -190,7 +191,7 @@ function fe({
190
191
  }
191
192
  )
192
193
  ] }),
193
- w.length > 0 && /* @__PURE__ */ a(
194
+ C.length > 0 && /* @__PURE__ */ a(
194
195
  "p",
195
196
  {
196
197
  "data-field-comment-typing": o,
@@ -198,7 +199,7 @@ function fe({
198
199
  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
200
  children: [
200
201
  /* @__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"),
202
+ oe(C, "replying"),
202
203
  "…"
203
204
  ]
204
205
  }
@@ -208,27 +209,27 @@ function fe({
208
209
  ne,
209
210
  {
210
211
  compact: !0,
211
- replies: C.replies.map((e) => ({
212
+ replies: N.replies.map((e) => ({
212
213
  id: e.id,
213
- name: D(e.user),
214
+ name: b(e.user),
214
215
  text: de({ kind: "comment", comment: e }),
215
216
  created_at: e.created_at
216
217
  })),
217
- onDismiss: C.dismiss
218
+ onDismiss: N.dismiss
218
219
  }
219
220
  ),
220
221
  /* @__PURE__ */ n(
221
222
  me,
222
223
  {
223
224
  value: h,
224
- onChange: k,
225
+ onChange: w,
225
226
  onImages: p.addFiles,
226
227
  rows: 2,
227
228
  "aria-label": `Comment on ${r}`,
228
229
  placeholder: "Write a comment… type @ to mention someone",
229
230
  className: "min-h-[56px] text-[12.5px]",
230
231
  onKeyDownCapture: (e) => {
231
- e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), R());
232
+ e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), S());
232
233
  }
233
234
  }
234
235
  ),
@@ -239,7 +240,7 @@ function fe({
239
240
  "button",
240
241
  {
241
242
  type: "button",
242
- onClick: R,
243
+ onClick: S,
243
244
  disabled: !h.trim() && !p.hasReady || p.uploading || y.isPending,
244
245
  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
246
  children: y.isPending ? "Posting…" : p.uploading ? "Uploading…" : "Comment"