@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,232 +1,223 @@
1
- import { jsxs as h, jsx as r } from "react/jsx-runtime";
2
- import { useQuery as ye } from "@tanstack/react-query";
3
- import { Activity as ge, ChevronUp as X, ChevronDown as we } from "lucide-react";
4
- import { useMemo as p, useState as v, useCallback as V, useRef as b, useEffect as k } from "react";
5
- import { createPortal as xe } from "react-dom";
6
- import { useNivaroClient as ke, useItemNavigation as Ne } from "../../context.js";
7
- import { groupActivity as Se, recordPhrase as Ce } from "../../lib/activity-sentence.js";
8
- import { post as Ee } from "../../lib/commands.js";
9
- import { useLiveCollection as Re } from "../../lib/live.js";
10
- import { useTopInserts as Me, slideIn as Ae } from "../../lib/live-screen.js";
11
- import { titleCase as Te, cn as T } from "../../lib/utils.js";
12
- import { useActivityLabels as Oe, ActivityEntry as Fe } from "../ActivityEntry.js";
13
- import { ErrorNotice as Y } from "../ErrorNotice.js";
14
- import { activityLinkable as Le } from "../profile/ActivityFeedCard.js";
15
- const Ie = 2e3, Pe = 30;
16
- function $e(n) {
17
- if (typeof document > "u") return 0;
18
- let i = 0;
19
- for (const u of document.body.querySelectorAll("*")) {
20
- if (n != null && n.contains(u)) continue;
21
- const f = getComputedStyle(u).position;
22
- if (f !== "sticky" && f !== "fixed") continue;
23
- const m = u.getBoundingClientRect();
24
- m.top > 200 || m.bottom <= 0 || m.width < window.innerWidth * 0.5 || m.height > window.innerHeight * 0.5 || (i = Math.max(i, m.bottom));
25
- }
26
- return i;
27
- }
28
- const je = (n) => String(n.id);
29
- function Ye({
30
- sources: n,
31
- records: i,
32
- typeLabels: u,
33
- live: f = !0,
34
- empty: m,
35
- className: ee,
1
+ import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
+ import { useQuery as Ee } from "@tanstack/react-query";
3
+ import { Activity as Ce, ChevronUp as te, ChevronDown as Re } from "lucide-react";
4
+ import { useMemo as h, useState as u, useCallback as A, useRef as m, useEffect as y } from "react";
5
+ import { createPortal as _e } from "react-dom";
6
+ import { useNivaroClient as Me, useItemNavigation as Te } from "../../context.js";
7
+ import { groupActivity as Ae, recordPhrase as Oe } from "../../lib/activity-sentence.js";
8
+ import { post as Fe } from "../../lib/commands.js";
9
+ import { useLiveCollection as Le } from "../../lib/live.js";
10
+ import { useTopInserts as Pe, slideIn as Ie, scrollParentOf as Be, stickyTopOffset as ze } from "../../lib/live-screen.js";
11
+ import { titleCase as $e, cn as O } from "../../lib/utils.js";
12
+ import { useActivityLabelsState as je, ActivityEntry as De } from "../ActivityEntry.js";
13
+ import { ErrorNotice as re } from "../ErrorNotice.js";
14
+ import { activityLinkable as Ke } from "../profile/ActivityFeedCard.js";
15
+ const qe = 2e3, He = 30, Ue = (s) => String(s.id);
16
+ function at({
17
+ sources: s,
18
+ records: c,
19
+ typeLabels: p,
20
+ live: g = !0,
21
+ empty: oe,
22
+ className: ie,
36
23
  // On a phone the page scrolls and the list grows (no scroll box inside the scrolling page).
37
- maxHeightClass: te = "md:max-h-[30rem]",
38
- onOpenRecord: O
24
+ maxHeightClass: ae = "md:max-h-[30rem]",
25
+ onOpenRecord: F
39
26
  }) {
40
- var Q, W, J;
41
- const F = ke(), re = Ne(), ne = p(
42
- () => JSON.stringify({ sources: n, records: i ?? [] }),
43
- [n, i]
44
- ), [y, L] = v([]), a = `${ne}|${y.join(",")}`, I = V(
45
- (e) => F.request(
46
- Ee("/activity/feed", {
47
- sources: n,
48
- records: (i ?? []).map((t) => ({ collection: t.collection, id: String(t.id) })),
49
- collections: y,
50
- limit: Pe,
27
+ var Y, Z, ee;
28
+ const L = Me(), le = Te(), se = h(
29
+ () => JSON.stringify({ sources: s, records: c ?? [] }),
30
+ [s, c]
31
+ ), [v, P] = u([]), i = `${se}|${v.join(",")}`, I = A(
32
+ (e) => L.request(
33
+ Fe("/activity/feed", {
34
+ sources: s,
35
+ records: (c ?? []).map((t) => ({ collection: t.collection, id: String(t.id) })),
36
+ collections: v,
37
+ limit: He,
51
38
  ...e ? { before: e } : {}
52
39
  })
53
40
  ).then((t) => t),
54
- [F, n, i, y]
55
- ), oe = p(
41
+ [L, s, c, v]
42
+ ), ce = h(
56
43
  () => [
57
- .../* @__PURE__ */ new Set([...n.map((e) => e.collection), ...(i ?? []).map((e) => e.collection)])
44
+ .../* @__PURE__ */ new Set([...s.map((e) => e.collection), ...(c ?? []).map((e) => e.collection)])
58
45
  ],
59
- [n, i]
60
- ), o = ye({
61
- queryKey: ["record-activity-feed", a],
46
+ [s, c]
47
+ ), n = Ee({
48
+ queryKey: ["record-activity-feed", i],
62
49
  queryFn: () => I(),
63
50
  staleTime: 3e4,
64
51
  placeholderData: (e) => e,
65
52
  // Never on a timer or a window focus: only a live write to a followed record refetches it.
66
53
  refetchInterval: !1,
67
54
  refetchOnWindowFocus: !1
68
- }), P = b([]);
69
- (W = (Q = o.data) == null ? void 0 : Q.types) != null && W.length && (P.current = o.data.types);
70
- const w = P.current, ie = p(() => {
55
+ }), B = m([]);
56
+ (Z = (Y = n.data) == null ? void 0 : Y.types) != null && Z.length && (B.current = n.data.types);
57
+ const w = B.current, de = h(() => {
71
58
  const e = /* @__PURE__ */ new Map();
72
59
  for (const t of w) e.set(t.collection, new Set(t.ids ?? []));
73
60
  return e;
74
- }, [w]), N = b(!1), $ = b(!1);
75
- $.current = o.isFetching;
76
- const S = o.refetch;
77
- Re(
78
- f ? oe : null,
61
+ }, [w]), k = m(!1), z = m(!1);
62
+ z.current = n.isFetching;
63
+ const N = n.refetch;
64
+ Le(
65
+ g ? ce : null,
79
66
  () => {
80
- $.current ? N.current = !0 : S();
67
+ z.current ? k.current = !0 : N();
81
68
  },
82
69
  {
83
- debounceMs: Ie,
70
+ debounceMs: qe,
84
71
  includeOwn: !0,
85
72
  match: (e) => {
86
- const t = ie.get(String(e.collection));
73
+ const t = de.get(String(e.collection));
87
74
  return t ? e.item === "*" || e.action === "create" || t.has(String(e.item)) : !1;
88
75
  }
89
76
  }
90
- ), k(() => {
91
- !o.isFetching && N.current && (N.current = !1, S());
92
- }, [o.isFetching, S]);
93
- const [C, j] = v({
94
- view: a,
77
+ ), y(() => {
78
+ !n.isFetching && k.current && (k.current = !1, N());
79
+ }, [n.isFetching, N]);
80
+ const [S, $] = u({
81
+ view: i,
95
82
  rows: /* @__PURE__ */ new Map()
96
- }), [E, ae] = v({
97
- view: a,
83
+ }), [E, ue] = u({
84
+ view: i,
98
85
  next: void 0
99
- }), [R, q] = v(!1), [M, z] = v(null);
100
- k(() => {
101
- const e = o.data;
102
- !e || o.isPlaceholderData || j((t) => {
103
- const s = t.view === a ? new Map(t.rows) : /* @__PURE__ */ new Map();
104
- for (const c of e.data) s.set(Number(c.id), c);
105
- return { view: a, rows: s };
86
+ }), [C, j] = u(!1), [R, D] = u(null);
87
+ y(() => {
88
+ const e = n.data;
89
+ !e || n.isPlaceholderData || $((t) => {
90
+ const o = t.view === i ? new Map(t.rows) : /* @__PURE__ */ new Map();
91
+ for (const l of e.data) o.set(Number(l.id), l);
92
+ return { view: i, rows: o };
106
93
  });
107
- }, [o.data, o.isPlaceholderData, a]);
108
- const d = p(() => {
109
- if (C.view === a)
110
- return [...C.rows.values()].sort((e, t) => Number(t.id) - Number(e.id));
111
- }, [C, a]), l = Me(d, je, { enabled: f, resetKey: a }), g = d ? l.rows : [], le = p(() => Se(g), [g]), se = g.length > 0, A = Oe(g, { enabled: se }), ce = p(
112
- () => (i ?? []).map((e) => Ce(e.collection, String(e.id), A)).filter((e) => !!e),
113
- [i, A]
114
- ), [de, ue] = v(!1), D = b(null), K = b(null), [_, B] = v(null), U = l.held;
115
- k(() => {
116
- if (U <= 0) {
117
- B(null);
94
+ }, [n.data, n.isPlaceholderData, i]);
95
+ const d = h(() => {
96
+ if (S.view === i)
97
+ return [...S.rows.values()].sort((e, t) => Number(t.id) - Number(e.id));
98
+ }, [S, i]), a = Pe(d, Ue, { enabled: g, resetKey: i }), b = d ? a.rows : [], K = h(() => Ae(b), [b]), q = b.length > 0, { labels: _, settled: fe } = je(b, { enabled: q }), me = h(
99
+ () => (c ?? []).map((e) => Oe(e.collection, String(e.id), _)).filter((e) => !!e),
100
+ [c, _]
101
+ ), [he, pe] = u(!1), H = m(null), U = m(null), [G, Q] = u(null), J = a.held;
102
+ y(() => {
103
+ if (J <= 0) {
104
+ Q(null);
118
105
  return;
119
106
  }
120
107
  const e = () => {
121
- const t = K.current, s = D.current;
122
- if (!t || !s) return;
123
- const c = $e(s), x = t.getBoundingClientRect().bottom < c + 2, be = s.getBoundingClientRect().bottom > c + 48;
124
- B(x && be ? c : null);
108
+ const t = U.current, o = H.current;
109
+ if (!t || !o) return;
110
+ const l = Be(o), x = l && l !== document.scrollingElement && l !== document.documentElement ? l.getBoundingClientRect().top : 0, T = Math.max(ze(o), x), Ne = t.getBoundingClientRect().bottom < T + 2, Se = o.getBoundingClientRect().bottom > T + 48;
111
+ Q(Ne && Se ? T : null);
125
112
  };
126
113
  return e(), window.addEventListener("scroll", e, { capture: !0, passive: !0 }), window.addEventListener("resize", e), () => {
127
114
  window.removeEventListener("scroll", e, { capture: !0 }), window.removeEventListener("resize", e);
128
115
  };
129
- }, [U]);
130
- const G = b(null), fe = V(
116
+ }, [J]);
117
+ const W = m(null), ve = A(
131
118
  (e) => {
132
- G.current = e, l.rootRef(e);
119
+ W.current = e, a.rootRef(e);
133
120
  },
134
- [l.rootRef]
121
+ [a.rootRef]
135
122
  );
136
- k(() => {
137
- Ae(G.current, l.arrived);
138
- }, [l.arrived]);
139
- const me = E.view === a && E.next !== void 0 ? E.next !== null : ((J = o.data) == null ? void 0 : J.next) != null, H = async () => {
140
- if (!(!(d != null && d.length) || R)) {
141
- q(!0), z(null);
123
+ y(() => {
124
+ Ie(W.current, a.arrived);
125
+ }, [a.arrived]);
126
+ const be = E.view === i && E.next !== void 0 ? E.next !== null : ((ee = n.data) == null ? void 0 : ee.next) != null, X = async () => {
127
+ if (!(!(d != null && d.length) || C)) {
128
+ j(!0), D(null);
142
129
  try {
143
- const e = d.reduce((s, c) => Math.min(s, Number(c.id)), Number.MAX_SAFE_INTEGER), t = await I(e);
144
- j((s) => {
145
- const c = s.view === a ? new Map(s.rows) : /* @__PURE__ */ new Map();
146
- for (const x of t.data) c.set(Number(x.id), x);
147
- return { view: a, rows: c };
148
- }), ae({ view: a, next: t.next });
130
+ const e = d.reduce((o, l) => Math.min(o, Number(l.id)), Number.MAX_SAFE_INTEGER), t = await I(e);
131
+ $((o) => {
132
+ const l = o.view === i ? new Map(o.rows) : /* @__PURE__ */ new Map();
133
+ for (const x of t.data) l.set(Number(x.id), x);
134
+ return { view: i, rows: l };
135
+ }), ue({ view: i, next: t.next });
149
136
  } catch (e) {
150
- z(e);
137
+ D(e);
151
138
  } finally {
152
- q(!1);
139
+ j(!1);
153
140
  }
154
141
  }
155
- }, he = (e) => L((t) => t.includes(e) ? t.filter((s) => s !== e) : [...t, e]), ve = (e) => {
156
- if (!Le({
142
+ }, ye = (e) => P((t) => t.includes(e) ? t.filter((o) => o !== e) : [...t, e]), ge = (e) => {
143
+ if (!Ke({
157
144
  action: e.action ?? "",
158
145
  collection: e.collection ?? null,
159
146
  item: e.item == null ? null : String(e.item)
160
147
  }))
161
148
  return;
162
149
  const t = { collection: String(e.collection), itemId: String(e.item) };
163
- O ? O(t) : re.open(t);
164
- }, pe = d === void 0 && !o.isError;
165
- return /* @__PURE__ */ h(
150
+ F ? F(t) : le.open(t);
151
+ }, we = d === void 0 && !n.isError || q && !fe, [xe, ke] = u(!1), V = m(null), M = A((e) => {
152
+ e && ke(e.scrollHeight - e.scrollTop - e.clientHeight > 2);
153
+ }, []);
154
+ return y(() => {
155
+ M(V.current);
156
+ }, [K, M]), /* @__PURE__ */ f(
166
157
  "section",
167
158
  {
168
- ref: D,
159
+ ref: H,
169
160
  "data-record-activity-stream": !0,
170
- className: T(
161
+ className: O(
171
162
  "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
172
- ee
163
+ ie
173
164
  ),
174
165
  children: [
175
- /* @__PURE__ */ h(
166
+ /* @__PURE__ */ f(
176
167
  "header",
177
168
  {
178
- ref: K,
169
+ ref: U,
179
170
  className: "flex flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-slate-100 px-4 py-2.5 dark:border-border/60",
180
171
  children: [
181
- /* @__PURE__ */ r(ge, { className: "h-4 w-4 shrink-0 text-nvr-navy dark:text-nvr-cyan", "aria-hidden": !0 }),
182
- /* @__PURE__ */ r("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Activity" }),
183
- l.held > 0 && // In the header, never over the rows: it takes no room from the list and covers no text.
184
- /* @__PURE__ */ h(
172
+ /* @__PURE__ */ r(Ce, { className: "h-4 w-4 shrink-0 text-nvr-navy dark:text-nvr-cyan", "aria-hidden": !0 }),
173
+ /* @__PURE__ */ r("h3", { className: "text-[13px] font-semibold leading-6 text-slate-800 dark:text-slate-100", children: "Activity" }),
174
+ a.held > 0 && // In the header, never over the rows: it takes no room from the list and covers no text.
175
+ /* @__PURE__ */ f(
185
176
  "button",
186
177
  {
187
178
  type: "button",
188
- "data-activity-new-pill": l.held,
189
- onClick: l.reveal,
179
+ "data-activity-new-pill": a.held,
180
+ onClick: a.reveal,
190
181
  className: "inline-flex h-6 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-2.5 text-[11.5px] font-medium text-nvr-navy transition-colors hover:bg-nvr-cyan/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:text-nvr-cyan",
191
182
  children: [
192
- /* @__PURE__ */ r(X, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
193
- l.held,
183
+ /* @__PURE__ */ r(te, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
184
+ a.held,
194
185
  " new"
195
186
  ]
196
187
  }
197
188
  ),
198
- _ != null && typeof document < "u" && xe(
199
- /* @__PURE__ */ h(
189
+ G != null && typeof document < "u" && _e(
190
+ /* @__PURE__ */ f(
200
191
  "button",
201
192
  {
202
193
  type: "button",
203
- "data-activity-new-pill-float": l.held,
204
- onClick: l.reveal,
205
- style: { top: _ + 8 },
206
- className: "fixed left-1/2 z-[60] inline-flex h-7 -translate-x-1/2 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-white px-3 text-[12px] font-medium text-nvr-navy shadow-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:bg-card dark:text-nvr-cyan",
194
+ "data-activity-new-pill-float": a.held,
195
+ onClick: a.reveal,
196
+ style: { top: G + 10 },
197
+ className: "fixed left-1/2 z-[60] inline-flex h-7 -translate-x-1/2 items-center gap-1 rounded-full border border-nvr-cyan/50 bg-white px-3 text-[12px] font-medium text-nvr-navy shadow-[0_6px_18px_-4px_rgba(15,23,42,0.35),0_2px_4px_-1px_rgba(15,23,42,0.12)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:bg-[#2a3140] dark:text-nvr-cyan dark:shadow-[0_8px_20px_-4px_rgba(0,0,0,0.6)]",
207
198
  children: [
208
- /* @__PURE__ */ r(X, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
209
- l.held,
199
+ /* @__PURE__ */ r(te, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
200
+ a.held,
210
201
  " new"
211
202
  ]
212
203
  }
213
204
  ),
214
205
  document.body
215
206
  ),
216
- w.length > 1 && /* @__PURE__ */ h(
207
+ w.length > 1 && /* @__PURE__ */ f(
217
208
  "fieldset",
218
209
  {
219
210
  className: "m-0 ml-auto flex min-w-0 flex-wrap items-center gap-1 border-0 p-0",
220
211
  "aria-label": "Filter by type",
221
212
  children: [
222
- /* @__PURE__ */ r(Z, { active: y.length === 0, onClick: () => L([]), children: "All" }),
213
+ /* @__PURE__ */ r(ne, { active: v.length === 0, onClick: () => P([]), children: "All" }),
223
214
  w.map((e) => /* @__PURE__ */ r(
224
- Z,
215
+ ne,
225
216
  {
226
- active: y.includes(e.collection),
227
- onClick: () => he(e.collection),
217
+ active: v.includes(e.collection),
218
+ onClick: () => ye(e.collection),
228
219
  title: `${e.records.toLocaleString("en-US")} ${e.records === 1 ? "record" : "records"}${e.truncated ? " (the newest are followed)" : ""}`,
229
- children: (u == null ? void 0 : u[e.collection]) ?? Te(e.collection)
220
+ children: (p == null ? void 0 : p[e.collection]) ?? $e(e.collection)
230
221
  },
231
222
  e.collection
232
223
  ))
@@ -236,13 +227,16 @@ function Ye({
236
227
  ]
237
228
  }
238
229
  ),
239
- pe ? /* @__PURE__ */ r("div", { className: "space-y-3 p-4", "aria-hidden": !0, children: [0, 1, 2, 3].map((e) => /* @__PURE__ */ r("div", { className: "h-4 animate-pulse rounded bg-slate-100 dark:bg-white/[0.06]" }, e)) }) : o.isError && !(d != null && d.length) ? /* @__PURE__ */ r("div", { className: "p-4", children: /* @__PURE__ */ r(Y, { error: o.error, what: "the activity", onRetry: () => o.refetch() }) }) : g.length === 0 ? /* @__PURE__ */ r("p", { className: "px-4 py-8 text-center text-[12.5px] text-slate-500 dark:text-slate-400", children: m ?? "Nothing has changed here yet." }) : /* @__PURE__ */ h(
230
+ we ? /* @__PURE__ */ r("div", { className: "space-y-3 p-4", "aria-hidden": !0, children: [0, 1, 2, 3].map((e) => /* @__PURE__ */ r("div", { className: "h-4 animate-pulse rounded bg-slate-100 dark:bg-white/[0.06]" }, e)) }) : n.isError && !(d != null && d.length) ? /* @__PURE__ */ r("div", { className: "p-4", children: /* @__PURE__ */ r(re, { error: n.error, what: "the activity", onRetry: () => n.refetch() }) }) : b.length === 0 ? /* @__PURE__ */ r("p", { className: "px-4 py-8 text-center text-[12.5px] text-slate-500 dark:text-slate-400", children: oe ?? "Nothing has changed here yet." }) : /* @__PURE__ */ f(
240
231
  "div",
241
232
  {
242
- className: T("relative md:overflow-y-auto", te),
243
- onScroll: (e) => ue(e.currentTarget.scrollTop > 2),
233
+ ref: V,
234
+ className: O("relative md:overflow-y-auto", ae),
235
+ onScroll: (e) => {
236
+ pe(e.currentTarget.scrollTop > 2), M(e.currentTarget);
237
+ },
244
238
  children: [
245
- de && /* @__PURE__ */ r(
239
+ he && /* @__PURE__ */ r(
246
240
  "div",
247
241
  {
248
242
  "aria-hidden": !0,
@@ -253,32 +247,40 @@ function Ye({
253
247
  /* @__PURE__ */ r(
254
248
  "div",
255
249
  {
256
- ref: fe,
250
+ ref: ve,
257
251
  "data-activity-stream-list": !0,
258
252
  className: "divide-y divide-slate-100 px-2 dark:divide-border",
259
- children: le.map((e) => /* @__PURE__ */ r("div", { "data-live-key": String(e.entries[0].id ?? e.key), children: /* @__PURE__ */ r(
260
- Fe,
253
+ children: K.map((e) => /* @__PURE__ */ r("div", { "data-live-key": String(e.entries[0].id ?? e.key), children: /* @__PURE__ */ r(
254
+ De,
261
255
  {
262
256
  entry: e.entries[0],
263
257
  group: e.entries.length > 1 ? e.entries : void 0,
264
- labels: A,
265
- onOpen: ve,
266
- omitPhrases: ce,
258
+ labels: _,
259
+ onOpen: ge,
260
+ omitPhrases: me,
267
261
  reserveChevron: !0
268
262
  }
269
263
  ) }, e.key))
270
264
  }
271
265
  ),
272
- (me || M != null) && /* @__PURE__ */ r("div", { className: "flex justify-center border-t border-slate-100 px-4 py-2.5 dark:border-border/60", children: M != null ? /* @__PURE__ */ r(Y, { error: M, what: "earlier activity", onRetry: H }) : /* @__PURE__ */ h(
266
+ xe && /* @__PURE__ */ r(
267
+ "div",
268
+ {
269
+ "aria-hidden": !0,
270
+ "data-activity-scroll-fade-bottom": !0,
271
+ className: "pointer-events-none sticky bottom-0 z-10 -mt-6 h-6 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-card dark:via-card/80"
272
+ }
273
+ ),
274
+ (be || R != null) && /* @__PURE__ */ r("div", { className: "flex justify-center border-t border-slate-100 px-4 py-2.5 dark:border-border/60", children: R != null ? /* @__PURE__ */ r(re, { error: R, what: "earlier activity", onRetry: X }) : /* @__PURE__ */ f(
273
275
  "button",
274
276
  {
275
277
  type: "button",
276
- onClick: H,
277
- disabled: R,
278
+ onClick: X,
279
+ disabled: C,
278
280
  className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-3.5 text-[12px] font-medium text-slate-700 transition-colors hover:border-nvr-cyan/50 hover:bg-nvr-cyan/5 focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan disabled:opacity-60 dark:border-border dark:bg-transparent dark:text-slate-200 dark:hover:bg-white/[0.05]",
279
281
  children: [
280
- /* @__PURE__ */ r(we, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
281
- R ? "Loading…" : "Show earlier"
282
+ /* @__PURE__ */ r(Re, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
283
+ C ? "Loading…" : "Show earlier"
282
284
  ]
283
285
  }
284
286
  ) })
@@ -289,29 +291,29 @@ function Ye({
289
291
  }
290
292
  );
291
293
  }
292
- function Z({
293
- active: n,
294
- onClick: i,
295
- title: u,
296
- children: f
294
+ function ne({
295
+ active: s,
296
+ onClick: c,
297
+ title: p,
298
+ children: g
297
299
  }) {
298
300
  return /* @__PURE__ */ r(
299
301
  "button",
300
302
  {
301
303
  type: "button",
302
- "aria-pressed": n,
303
- title: u,
304
- onClick: i,
305
- className: T(
304
+ "aria-pressed": s,
305
+ title: p,
306
+ onClick: c,
307
+ className: O(
306
308
  "rounded-full border px-2.5 py-0.5 text-[11.5px] font-medium transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan",
307
- n ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-transparent dark:text-slate-300 dark:hover:bg-white/[0.05]"
309
+ s ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-transparent dark:text-slate-300 dark:hover:bg-white/[0.05]"
308
310
  ),
309
- children: f
311
+ children: g
310
312
  }
311
313
  );
312
314
  }
313
315
  export {
314
- Ye as RecordActivityStream,
315
- Ie as STREAM_QUIET_MS,
316
- $e as stickyTopOffset
316
+ at as RecordActivityStream,
317
+ qe as STREAM_QUIET_MS,
318
+ ze as stickyTopOffset
317
319
  };