@nivaro/react 0.3.137 → 0.3.138

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 (49) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +95 -4
  4. package/dist/index.js +748 -743
  5. package/dist/shared/components/CollectionBrowserView.js +392 -389
  6. package/dist/shared/components/DelegateCoverLine.js +80 -87
  7. package/dist/shared/components/ItemEditForm.js +589 -588
  8. package/dist/shared/components/MyWorkView.js +284 -286
  9. package/dist/shared/components/NotificationBell.js +251 -205
  10. package/dist/shared/components/ai/AiAnalyticsView.js +878 -417
  11. package/dist/shared/components/ai/AiPlanCard.js +164 -122
  12. package/dist/shared/components/ai/AiPlanUndo.js +291 -0
  13. package/dist/shared/components/ai/call-log/CallDrawer.js +357 -0
  14. package/dist/shared/components/ai/call-log/RawJson.js +126 -0
  15. package/dist/shared/components/ai/call-log/ThreadView.js +223 -0
  16. package/dist/shared/components/ai/call-log/TranscriptView.js +227 -0
  17. package/dist/shared/components/ai/call-log/controls.js +364 -0
  18. package/dist/shared/components/ai/call-log/format.js +46 -0
  19. package/dist/shared/components/ai/call-log/url.js +105 -0
  20. package/dist/shared/components/chat/chat-core.js +422 -346
  21. package/dist/shared/components/integrations/IntegrationObligationsView.js +98 -98
  22. package/dist/shared/components/integrations/RecordIntegrationPreview.js +102 -93
  23. package/dist/shared/components/integrations/console/api.js +11 -1
  24. package/dist/shared/components/item-edit/HeaderRollupExplainer.js +5 -1
  25. package/dist/shared/components/item-edit/RecordLiveSync.js +241 -229
  26. package/dist/shared/components/item-edit/RecordRecapChanges.js +166 -0
  27. package/dist/shared/components/item-edit/RecordRecapStrip.js +254 -84
  28. package/dist/shared/components/item-edit/live-related.js +34 -18
  29. package/dist/shared/components/panels/RevisionsPanel.js +735 -683
  30. package/dist/shared/components/queue/QueueWorklist.js +323 -316
  31. package/dist/shared/components/support/SupportRequestDialog.js +198 -181
  32. package/dist/shared/components/trackers/use-tracker-link.js +74 -65
  33. package/dist/shared/lib/config-update-refresh.js +34 -0
  34. package/dist/shared/lib/config-watch.js +17 -17
  35. package/dist/shared/lib/gap-refresh.js +49 -0
  36. package/dist/shared/lib/integration-dots.js +8 -8
  37. package/dist/shared/lib/live-ops.js +26 -23
  38. package/dist/shared/lib/live-pickers.js +1 -1
  39. package/dist/shared/lib/live-queries.js +223 -195
  40. package/dist/shared/lib/live.js +56 -51
  41. package/dist/shared/lib/obligation-banner.js +11 -10
  42. package/dist/shared/lib/obligation-filters.js +22 -18
  43. package/dist/shared/lib/obligation-reason-text.js +18 -8
  44. package/dist/shared/lib/presence-hooks.js +133 -132
  45. package/dist/shared/lib/reconnect-resync.js +90 -0
  46. package/dist/shared/lib/record-room-holds.js +43 -0
  47. package/dist/shared/lib/socket-realtime.js +116 -105
  48. package/dist/shared/lib/user-sync.js +1 -6
  49. package/package.json +1 -1
@@ -0,0 +1,166 @@
1
+ import { jsx as t, jsxs as c, Fragment as x } from "react/jsx-runtime";
2
+ import { useQuery as y } from "@tanstack/react-query";
3
+ import { ChevronRight as v, ArrowRight as N } from "lucide-react";
4
+ import { useState as g, useId as b } from "react";
5
+ import { useNivaroClient as k } from "../../context.js";
6
+ import { get as w } from "../../lib/commands.js";
7
+ import { compareValueText as C } from "../../lib/compare-value.js";
8
+ import { formatDateTime as R, cn as m } from "../../lib/utils.js";
9
+ import { ErrorNotice as _ } from "../ErrorNotice.js";
10
+ import { RelativeTime as S } from "../RelativeTime.js";
11
+ import { UserAvatar as T } from "../UserAvatar.js";
12
+ import { Skeleton as p } from "../ui/skeleton.js";
13
+ function f(e, a, r) {
14
+ if (a !== void 0) return a;
15
+ if (e == null || e === "" || Array.isArray(e) && e.length === 0) return null;
16
+ const i = r ? {
17
+ type: r.type,
18
+ interface: r.interface,
19
+ options: r.options,
20
+ display_options: r.options
21
+ } : void 0, n = C(e, i);
22
+ return n === "—" ? null : n;
23
+ }
24
+ function $(e, a) {
25
+ var n;
26
+ const r = [], i = [];
27
+ for (const s of e) ((n = a[s.field]) != null && n.system ? i : r).push(s);
28
+ return { main: r, system: i };
29
+ }
30
+ function j(e) {
31
+ return e.split(/\s+/).map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() || "·";
32
+ }
33
+ function h({ text: e, strong: a }) {
34
+ return e == null ? /* @__PURE__ */ t("span", { className: "italic text-slate-400 dark:text-slate-500", children: "Empty" }) : /* @__PURE__ */ t(
35
+ "span",
36
+ {
37
+ className: m(
38
+ "break-words [overflow-wrap:anywhere]",
39
+ a ? "font-medium text-slate-900 dark:text-slate-100" : "text-slate-500 dark:text-slate-400"
40
+ ),
41
+ children: e
42
+ }
43
+ );
44
+ }
45
+ function u({
46
+ change: e,
47
+ meta: a,
48
+ muted: r
49
+ }) {
50
+ const i = (a == null ? void 0 : a.label) ?? e.field, n = f(e.before, e.before_text, a), s = f(e.after, e.after_text, a);
51
+ return /* @__PURE__ */ c("li", { className: m("relative py-1.5", r && "opacity-75"), "data-recap-change": e.field, children: [
52
+ /* @__PURE__ */ t("div", { className: "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: i }),
53
+ /* @__PURE__ */ c("div", { className: "mt-0.5 flex flex-wrap items-baseline gap-x-1.5 gap-y-0.5 text-[12.5px] leading-snug", children: [
54
+ e.has_before ? /* @__PURE__ */ c(x, { children: [
55
+ /* @__PURE__ */ t(h, { text: n }),
56
+ /* @__PURE__ */ t(
57
+ N,
58
+ {
59
+ "aria-hidden": !0,
60
+ className: "h-3 w-3 shrink-0 self-center text-slate-400 dark:text-slate-500"
61
+ }
62
+ ),
63
+ /* @__PURE__ */ t("span", { className: "sr-only", children: "changed to" })
64
+ ] }) : /* @__PURE__ */ t("span", { className: "sr-only", children: "now" }),
65
+ /* @__PURE__ */ t(h, { text: s, strong: !r })
66
+ ] })
67
+ ] });
68
+ }
69
+ function q({ group: e, fields: a }) {
70
+ const [r, i] = g(!1), n = b(), { main: s, system: o } = $(e.changes, a), l = e.last_at;
71
+ return /* @__PURE__ */ c("section", { className: "py-2.5 first:pt-1", "aria-label": `Changed by ${e.name}`, children: [
72
+ /* @__PURE__ */ c("header", { className: "flex items-center gap-2", children: [
73
+ /* @__PURE__ */ t(
74
+ T,
75
+ {
76
+ userId: e.user_id,
77
+ className: "h-5 w-5 rounded-full",
78
+ fallback: /* @__PURE__ */ t("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/10 text-[9px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: j(e.name) })
79
+ }
80
+ ),
81
+ /* @__PURE__ */ t("span", { className: "min-w-0 truncate text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: e.name }),
82
+ l && /* @__PURE__ */ t("span", { className: "ml-auto shrink-0 text-[11.5px] text-slate-400 dark:text-slate-500", children: /* @__PURE__ */ t(S, { value: l, title: R(l) }) })
83
+ ] }),
84
+ s.length > 0 && /* @__PURE__ */ t("ul", { className: "mt-1 divide-y divide-slate-100 pl-7 dark:divide-border/60", children: s.map((d) => /* @__PURE__ */ t(u, { change: d, meta: a[d.field] }, d.field)) }),
85
+ o.length > 0 && /* @__PURE__ */ c("div", { className: "pl-7", children: [
86
+ /* @__PURE__ */ c(
87
+ "button",
88
+ {
89
+ type: "button",
90
+ "aria-expanded": r,
91
+ "aria-controls": n,
92
+ onClick: () => i((d) => !d),
93
+ className: "mt-1 inline-flex items-center gap-1 rounded text-[11.5px] text-slate-400 hover:text-slate-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-slate-500 dark:hover:text-slate-300",
94
+ "data-recap-system-toggle": !0,
95
+ children: [
96
+ /* @__PURE__ */ t(
97
+ v,
98
+ {
99
+ "aria-hidden": !0,
100
+ className: m(
101
+ "h-3 w-3 transition-transform duration-150 motion-reduce:transition-none",
102
+ r && "rotate-90"
103
+ )
104
+ }
105
+ ),
106
+ s.length > 0 ? "and " : "",
107
+ o.length,
108
+ " system field",
109
+ o.length === 1 ? "" : "s"
110
+ ]
111
+ }
112
+ ),
113
+ /* @__PURE__ */ t(
114
+ "ul",
115
+ {
116
+ id: n,
117
+ hidden: !r,
118
+ className: "divide-y divide-slate-100 dark:divide-border/60",
119
+ children: o.map((d) => /* @__PURE__ */ t(u, { change: d, meta: a[d.field], muted: !0 }, d.field))
120
+ }
121
+ )
122
+ ] })
123
+ ] });
124
+ }
125
+ function z({
126
+ collection: e,
127
+ itemId: a,
128
+ since: r,
129
+ everyone: i
130
+ }) {
131
+ const n = k(), s = y({
132
+ queryKey: ["record-recap-changes", e, a, r, !!i],
133
+ queryFn: () => n.request(
134
+ w(`/record-views/${e}/${encodeURIComponent(a)}/changes`, {
135
+ since: r,
136
+ ...i ? { everyone: "1" } : {}
137
+ })
138
+ ).then((l) => l.data),
139
+ staleTime: 3e4,
140
+ retry: !1
141
+ });
142
+ if (s.isLoading)
143
+ return /* @__PURE__ */ t("div", { className: "space-y-3 py-2", "aria-busy": "true", children: [0, 1, 2].map((l) => /* @__PURE__ */ c("div", { className: "space-y-1.5", children: [
144
+ /* @__PURE__ */ t(p, { className: "h-3 w-24" }),
145
+ /* @__PURE__ */ t(p, { className: "h-4 w-56 max-w-full" })
146
+ ] }, l)) });
147
+ if (s.isError)
148
+ return /* @__PURE__ */ t("div", { className: "py-2", children: /* @__PURE__ */ t(_, { error: s.error, what: "the changes", onRetry: () => void s.refetch() }) });
149
+ const o = s.data;
150
+ return !o || o.groups.length === 0 ? /* @__PURE__ */ t("p", { className: "py-3 text-[12.5px] text-slate-500 dark:text-slate-400", children: "No field changes to show — the values are back to what you last saw." }) : /* @__PURE__ */ c("div", { "data-recap-changes": !0, children: [
151
+ /* @__PURE__ */ t("div", { className: "divide-y divide-slate-200/70 dark:divide-border", children: o.groups.map((l) => /* @__PURE__ */ t(
152
+ q,
153
+ {
154
+ group: l,
155
+ fields: o.fields
156
+ },
157
+ `${l.user_id ?? "system"}|${l.first_at}`
158
+ )) }),
159
+ o.truncated && /* @__PURE__ */ t("p", { className: "pt-2 text-[11.5px] text-slate-400 dark:text-slate-500", children: "Showing the first 300 saves — the full history has the rest." })
160
+ ] });
161
+ }
162
+ export {
163
+ z as RecordRecapChangesList,
164
+ f as recapValueText,
165
+ $ as splitSystem
166
+ };
@@ -1,23 +1,28 @@
1
- import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
- import { Mail as v, X as k, History as y } from "lucide-react";
3
- import { useState as m, useRef as $, useEffect as N } from "react";
4
- import { useNivaroClient as S } from "../../context.js";
5
- import { post as x, get as R } from "../../lib/commands.js";
6
- import { formatRelative as _ } from "../../lib/utils.js";
7
- import { RelativeTime as C } from "../RelativeTime.js";
8
- function j(e) {
1
+ import { jsxs as s, Fragment as w, jsx as t } from "react/jsx-runtime";
2
+ import { useQueryClient as D } from "@tanstack/react-query";
3
+ import { Mail as q, X as $, History as P, ChevronDown as F } from "lucide-react";
4
+ import { useState as v, useRef as N, useEffect as O } from "react";
5
+ import { useNivaroClient as U } from "../../context.js";
6
+ import { post as C, get as Q } from "../../lib/commands.js";
7
+ import { cn as R, formatDateTime as T } from "../../lib/utils.js";
8
+ import { RevisionsPanel as E } from "../panels/RevisionsPanel.js";
9
+ import { RelativeTime as j } from "../RelativeTime.js";
10
+ import { Button as K } from "../ui/button.js";
11
+ import { Popover as L, PopoverTrigger as H, PopoverContent as z } from "../ui/popover.js";
12
+ import { RecordRecapChangesList as A } from "./RecordRecapChanges.js";
13
+ function B(e) {
9
14
  try {
10
- const t = new URLSearchParams(e).get("since");
11
- return !t || t.length > 40 || !Number.isFinite(Date.parse(t)) ? null : t;
15
+ const n = new URLSearchParams(e).get("since");
16
+ return !n || n.length > 40 || !Number.isFinite(Date.parse(n)) ? null : n;
12
17
  } catch {
13
18
  return null;
14
19
  }
15
20
  }
16
- function P(e) {
17
- const t = [];
18
- return e.moved_to && t.push(`moved to ${e.moved_to.label}`), e.field_changes > 0 && t.push(`${e.field_changes} field${e.field_changes === 1 ? "" : "s"} changed`), e.comments > 0 && t.push(`${e.comments} new comment${e.comments === 1 ? "" : "s"}`), t;
21
+ function M(e) {
22
+ const n = [];
23
+ return e.moved_to && n.push(`moved to ${e.moved_to.label}`), e.field_changes > 0 && n.push(`${e.field_changes} field${e.field_changes === 1 ? "" : "s"} changed`), e.comments > 0 && n.push(`${e.comments} new comment${e.comments === 1 ? "" : "s"}`), n;
19
24
  }
20
- function U() {
25
+ function X() {
21
26
  try {
22
27
  const e = new URL(window.location.href);
23
28
  if (!e.searchParams.has("since")) return;
@@ -25,107 +30,271 @@ function U() {
25
30
  } catch {
26
31
  }
27
32
  }
28
- function T({ collection: e, itemId: t }) {
29
- const i = S(), [n, u] = m(null), [r, h] = m(null), [w, f] = m(!1), c = $(null);
30
- N(() => {
31
- const a = `${e}|${t}`;
32
- if (c.current === a) return;
33
- c.current = a, u(null), h(null), f(!1), i.request(
34
- x(`/record-views/${e}/${encodeURIComponent(t)}/touch`, {})
35
- ).then((d) => u(d.data ?? null)).catch(() => {
36
- c.current = null;
33
+ function S(e) {
34
+ const n = [];
35
+ return e.comments > 0 && n.push(`${e.comments} new comment${e.comments === 1 ? "" : "s"}`), e.transitions > 0 && n.push(`${e.transitions} workflow transition${e.transitions === 1 ? "" : "s"}`), n.length ? n.join(" · ") : null;
36
+ }
37
+ function _({
38
+ collection: e,
39
+ itemId: n,
40
+ since: l,
41
+ everyone: u,
42
+ title: r,
43
+ extras: h,
44
+ historyAvailable: a,
45
+ onMarkSeen: p,
46
+ tone: b,
47
+ children: k
48
+ }) {
49
+ const [f, d] = v(!1), [i, y] = v(null), x = N(null), c = N(null), o = D();
50
+ return /* @__PURE__ */ s(w, { children: [
51
+ /* @__PURE__ */ s(L, { open: f, onOpenChange: d, children: [
52
+ /* @__PURE__ */ t(H, { asChild: !0, children: /* @__PURE__ */ s(
53
+ "button",
54
+ {
55
+ ref: x,
56
+ type: "button",
57
+ className: R(
58
+ "group flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2 py-1 text-left transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 motion-reduce:transition-none",
59
+ b === "sky" ? "hover:bg-sky-100/80 focus-visible:ring-sky-400/60 data-[state=open]:bg-sky-100/80 dark:hover:bg-sky-500/15 dark:data-[state=open]:bg-sky-500/15" : "hover:bg-slate-200/50 focus-visible:ring-slate-400/50 data-[state=open]:bg-slate-200/50 dark:hover:bg-white/[0.06] dark:data-[state=open]:bg-white/[0.06]"
60
+ ),
61
+ "data-recap-trigger": !0,
62
+ children: [
63
+ k,
64
+ /* @__PURE__ */ t(
65
+ F,
66
+ {
67
+ "aria-hidden": !0,
68
+ className: R(
69
+ "h-3.5 w-3.5 shrink-0 transition-transform duration-150 group-data-[state=open]:rotate-180 motion-reduce:transition-none",
70
+ b === "sky" ? "text-sky-500" : "text-slate-400 dark:text-slate-500"
71
+ )
72
+ }
73
+ )
74
+ ]
75
+ }
76
+ ) }),
77
+ /* @__PURE__ */ t(
78
+ z,
79
+ {
80
+ align: "start",
81
+ side: "bottom",
82
+ sideOffset: 6,
83
+ collisionPadding: 16,
84
+ "aria-label": r,
85
+ onOpenAutoFocus: (m) => {
86
+ var g;
87
+ m.preventDefault(), (g = c.current) == null || g.focus();
88
+ },
89
+ className: "w-[min(420px,calc(100vw-32px))] p-0 motion-reduce:animate-none",
90
+ "data-recap-popover": !0,
91
+ children: /* @__PURE__ */ s("div", { ref: c, tabIndex: -1, className: "outline-none", children: [
92
+ /* @__PURE__ */ s("div", { className: "border-b border-slate-200/80 px-4 pb-2 pt-3 dark:border-border", children: [
93
+ /* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-900 dark:text-slate-100", children: r }),
94
+ /* @__PURE__ */ s("p", { className: "mt-0.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
95
+ /* @__PURE__ */ t("time", { dateTime: l, children: T(l) }),
96
+ " ·",
97
+ " ",
98
+ /* @__PURE__ */ t(j, { value: l })
99
+ ] })
100
+ ] }),
101
+ /* @__PURE__ */ t("div", { className: "max-h-[min(60vh,420px)] overflow-y-auto overscroll-contain px-4 py-1", children: /* @__PURE__ */ t(
102
+ A,
103
+ {
104
+ collection: e,
105
+ itemId: n,
106
+ since: l,
107
+ everyone: u
108
+ }
109
+ ) }),
110
+ h && /* @__PURE__ */ s("p", { className: "border-t border-slate-200/80 px-4 py-2 text-[11.5px] text-slate-500 dark:border-border dark:text-slate-400", children: [
111
+ "Also ",
112
+ h
113
+ ] }),
114
+ (a || p) && /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2 border-t border-slate-200/80 px-4 py-2 dark:border-border", children: [
115
+ a ? /* @__PURE__ */ s(
116
+ "button",
117
+ {
118
+ type: "button",
119
+ onClick: () => {
120
+ d(!1), y(!0);
121
+ },
122
+ className: "inline-flex items-center gap-1.5 rounded text-[12px] font-medium text-slate-600 underline-offset-2 hover:text-slate-900 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-slate-300 dark:hover:text-slate-100",
123
+ "data-recap-history": !0,
124
+ children: [
125
+ /* @__PURE__ */ t(P, { "aria-hidden": !0, className: "h-3.5 w-3.5" }),
126
+ "See full history"
127
+ ]
128
+ }
129
+ ) : /* @__PURE__ */ t("span", {}),
130
+ p && /* @__PURE__ */ t(
131
+ K,
132
+ {
133
+ type: "button",
134
+ size: "sm",
135
+ variant: "outline",
136
+ className: "h-7 px-2.5 text-[12px]",
137
+ onClick: () => {
138
+ d(!1), p();
139
+ },
140
+ "data-recap-mark-seen": !0,
141
+ children: "Mark as seen"
142
+ }
143
+ )
144
+ ] })
145
+ ] })
146
+ }
147
+ )
148
+ ] }),
149
+ i !== null && /* @__PURE__ */ t(
150
+ E,
151
+ {
152
+ collection: e,
153
+ item: n,
154
+ open: i,
155
+ onOpenChange: y,
156
+ since: l,
157
+ onRollback: () => {
158
+ o.invalidateQueries({ queryKey: ["item", e, n] }), o.invalidateQueries({ queryKey: ["record-recap-changes", e, n] }), o.invalidateQueries({ queryKey: ["revisions", e, n] });
159
+ },
160
+ onCloseAutoFocus: (m) => {
161
+ var g;
162
+ m.preventDefault(), (g = x.current) == null || g.focus();
163
+ }
164
+ }
165
+ )
166
+ ] });
167
+ }
168
+ function ae({
169
+ collection: e,
170
+ itemId: n,
171
+ historyAvailable: l = !1
172
+ }) {
173
+ const u = U(), [r, h] = v(null), [a, p] = v(null), [b, k] = v(!1), f = N(null);
174
+ O(() => {
175
+ const c = `${e}|${n}`;
176
+ if (f.current === c) return;
177
+ f.current = c, h(null), p(null), k(!1), u.request(
178
+ C(`/record-views/${e}/${encodeURIComponent(n)}/touch`, {})
179
+ ).then((m) => h(m.data ?? null)).catch(() => {
180
+ f.current = null;
37
181
  });
38
- const g = typeof window > "u" ? null : j(window.location.search);
39
- g && i.request(
40
- R(`/record-views/${e}/${encodeURIComponent(t)}/since`, { at: g })
41
- ).then((d) => h(d.data ?? null)).catch(() => {
182
+ const o = typeof window > "u" ? null : B(window.location.search);
183
+ o && u.request(
184
+ Q(`/record-views/${e}/${encodeURIComponent(n)}/since`, { at: o })
185
+ ).then((m) => p(m.data ?? null)).catch(() => {
42
186
  });
43
- }, [i, e, t]);
44
- const p = () => {
45
- if (f(!0), r) {
46
- U();
187
+ }, [u, e, n]);
188
+ const d = () => {
189
+ if (k(!0), a) {
190
+ X();
47
191
  return;
48
192
  }
49
- i.request(x(`/record-views/${e}/${encodeURIComponent(t)}/dismiss`, {})).catch(() => {
193
+ u.request(C(`/record-views/${e}/${encodeURIComponent(n)}/dismiss`, {})).catch(() => {
50
194
  });
51
195
  };
52
- if (w) return null;
53
- if (r) {
54
- const a = P(r);
55
- return a.length === 0 ? null : /* @__PURE__ */ l(
196
+ if (b) return null;
197
+ if (a) {
198
+ const c = M(a);
199
+ if (c.length === 0) return null;
200
+ const o = /* @__PURE__ */ s(w, { children: [
201
+ /* @__PURE__ */ t(q, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
202
+ /* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300", children: [
203
+ /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-slate-400", children: "Since this email:" }),
204
+ " ",
205
+ a.moved_to && /* @__PURE__ */ t(
206
+ "span",
207
+ {
208
+ "aria-hidden": !0,
209
+ className: "mr-1 inline-block h-1.5 w-1.5 rounded-full align-middle",
210
+ style: { backgroundColor: a.moved_to.color ?? "#94a3b8" }
211
+ }
212
+ ),
213
+ /* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: c.join(" · ") })
214
+ ] })
215
+ ] });
216
+ return /* @__PURE__ */ s(
56
217
  "div",
57
218
  {
58
- className: "nvr-expand-in flex items-center gap-2.5 rounded-lg border border-slate-200 bg-slate-50 px-3 py-1.5 dark:border-border dark:bg-white/[0.03]",
219
+ className: "nvr-expand-in flex items-center gap-1 rounded-lg border border-slate-200 bg-slate-50 py-0.5 pl-1 pr-3 dark:border-border dark:bg-white/[0.03]",
59
220
  "data-record-since-email": !0,
60
221
  children: [
61
- /* @__PURE__ */ s(v, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
62
- /* @__PURE__ */ l(
63
- "p",
222
+ a.field_changes > 0 ? /* @__PURE__ */ t(
223
+ _,
64
224
  {
65
- className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300",
66
- "data-tip": r.fields.length > 0 ? `Changed: ${r.fields.join(", ")}` : `Email sent ${_(r.since)}`,
67
- children: [
68
- /* @__PURE__ */ s("span", { className: "text-slate-500 dark:text-slate-400", children: "Since this email:" }),
69
- " ",
70
- r.moved_to && /* @__PURE__ */ s(
71
- "span",
72
- {
73
- "aria-hidden": !0,
74
- className: "mr-1 inline-block h-1.5 w-1.5 rounded-full align-middle",
75
- style: { backgroundColor: r.moved_to.color ?? "#94a3b8" }
76
- }
77
- ),
78
- /* @__PURE__ */ s("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: a.join(" · ") })
79
- ]
225
+ collection: e,
226
+ itemId: n,
227
+ since: a.since,
228
+ everyone: !0,
229
+ title: "Changes since this email",
230
+ extras: S({ comments: a.comments, transitions: 0 }),
231
+ historyAvailable: l,
232
+ tone: "slate",
233
+ children: o
80
234
  }
81
- ),
82
- /* @__PURE__ */ s(
235
+ ) : /* @__PURE__ */ t("p", { className: "flex min-w-0 flex-1 items-center gap-2.5 px-2 py-1", children: o }),
236
+ /* @__PURE__ */ t(
83
237
  "button",
84
238
  {
85
239
  type: "button",
86
- onClick: p,
240
+ onClick: d,
87
241
  "aria-label": "Dismiss",
88
242
  className: "shrink-0 rounded p-0.5 text-slate-400 hover:bg-slate-200/70 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-300",
89
- children: /* @__PURE__ */ s(k, { className: "h-3.5 w-3.5" })
243
+ children: /* @__PURE__ */ t($, { className: "h-3.5 w-3.5" })
90
244
  }
91
245
  )
92
246
  ]
93
247
  }
94
248
  );
95
249
  }
96
- if (!n) return null;
97
- const o = [];
98
- n.field_changes > 0 && o.push(`${n.field_changes} field${n.field_changes === 1 ? "" : "s"} changed`), n.comments > 0 && o.push(`${n.comments} new comment${n.comments === 1 ? "" : "s"}`), n.transitions > 0 && o.push(`${n.transitions} workflow transition${n.transitions === 1 ? "" : "s"}`);
99
- const b = n.editors.length > 0 ? ` by ${n.editors.join(", ")}` : "";
100
- return /* @__PURE__ */ l(
250
+ if (!r) return null;
251
+ const i = [];
252
+ r.field_changes > 0 && i.push(`${r.field_changes} field${r.field_changes === 1 ? "" : "s"} changed`), r.comments > 0 && i.push(`${r.comments} new comment${r.comments === 1 ? "" : "s"}`), r.transitions > 0 && i.push(`${r.transitions} workflow transition${r.transitions === 1 ? "" : "s"}`);
253
+ const y = r.editors.length > 0 ? ` by ${r.editors.join(", ")}` : "", x = /* @__PURE__ */ s(w, { children: [
254
+ /* @__PURE__ */ t(P, { "aria-hidden": !0, className: "h-4 w-4 shrink-0 text-sky-500" }),
255
+ /* @__PURE__ */ s("span", { className: "relative min-w-0 flex-1 truncate text-[12px] text-sky-800 dark:text-sky-300", children: [
256
+ /* @__PURE__ */ s("span", { className: "max-sm:hidden", children: [
257
+ "Since you last viewed (",
258
+ /* @__PURE__ */ t(j, { value: r.since }),
259
+ "):",
260
+ " "
261
+ ] }),
262
+ /* @__PURE__ */ t("span", { className: "sr-only sm:hidden", children: "Since you last viewed: " }),
263
+ /* @__PURE__ */ t("span", { className: "font-medium", children: r.field_changes > 0 ? /* @__PURE__ */ s(w, { children: [
264
+ /* @__PURE__ */ t("span", { className: "underline decoration-sky-400/60 decoration-dotted underline-offset-[3px] group-hover:decoration-solid dark:decoration-sky-400/50", children: i[0] }),
265
+ i.length > 1 ? ` · ${i.slice(1).join(" · ")}` : ""
266
+ ] }) : i.join(" · ") }),
267
+ /* @__PURE__ */ t("span", { className: "max-sm:hidden", children: y })
268
+ ] })
269
+ ] });
270
+ return /* @__PURE__ */ s(
101
271
  "div",
102
272
  {
103
- className: "nvr-expand-in flex items-center gap-3 rounded-lg border border-sky-200 bg-sky-50 px-3.5 py-2 dark:border-sky-500/30 dark:bg-sky-500/10",
273
+ className: "nvr-expand-in flex items-center gap-1 rounded-lg border border-sky-200 bg-sky-50 py-1 pl-1.5 pr-3.5 dark:border-sky-500/30 dark:bg-sky-500/10",
104
274
  "data-record-recap": !0,
105
275
  children: [
106
- /* @__PURE__ */ s(y, { className: "h-4 w-4 shrink-0 text-sky-500" }),
107
- /* @__PURE__ */ l(
108
- "p",
276
+ r.field_changes > 0 ? /* @__PURE__ */ t(
277
+ _,
109
278
  {
110
- className: "min-w-0 flex-1 truncate text-[12px] text-sky-800 dark:text-sky-300",
111
- "data-tip": n.fields.length > 0 ? `Changed: ${n.fields.join(", ")}` : void 0,
112
- children: [
113
- "Since you last viewed (",
114
- /* @__PURE__ */ s(C, { value: n.since }),
115
- "): ",
116
- /* @__PURE__ */ s("span", { className: "font-medium", children: o.join(" · ") }),
117
- b
118
- ]
279
+ collection: e,
280
+ itemId: n,
281
+ since: r.since,
282
+ title: "Changes since you last viewed",
283
+ extras: S(r),
284
+ historyAvailable: l,
285
+ onMarkSeen: d,
286
+ tone: "sky",
287
+ children: x
119
288
  }
120
- ),
121
- /* @__PURE__ */ s(
289
+ ) : /* @__PURE__ */ t("p", { className: "flex min-w-0 flex-1 items-center gap-3 px-2 py-1", children: x }),
290
+ /* @__PURE__ */ t(
122
291
  "button",
123
292
  {
124
293
  type: "button",
125
- onClick: p,
294
+ onClick: d,
126
295
  "aria-label": "Dismiss recap",
127
296
  className: "shrink-0 rounded p-0.5 text-sky-400 hover:bg-sky-100 hover:text-sky-600 dark:hover:bg-sky-500/15",
128
- children: /* @__PURE__ */ s(k, { className: "h-3.5 w-3.5" })
297
+ children: /* @__PURE__ */ t($, { className: "h-3.5 w-3.5" })
129
298
  }
130
299
  )
131
300
  ]
@@ -133,7 +302,8 @@ function T({ collection: e, itemId: t }) {
133
302
  );
134
303
  }
135
304
  export {
136
- T as RecordRecapStrip,
137
- j as emailSinceFromSearch,
138
- P as emailSinceParts
305
+ ae as RecordRecapStrip,
306
+ B as emailSinceFromSearch,
307
+ M as emailSinceParts,
308
+ S as recapExtras
139
309
  };
@@ -1,36 +1,52 @@
1
- const o = (n, t) => n != null && String(n) === t;
2
- function a(n, t) {
1
+ const o = (e, t) => e != null && String(e) === t;
2
+ function a(e, t) {
3
3
  return (r) => {
4
- const e = r[0];
5
- return e === "o2m-rows" || e === "o2m-field-snapshots" || e === "m2m-items" || e === "summary-m2a-items" ? o(r[3], t) : e === "rrv-related" || e === "record-links" || e === "record-graph" || e === "referenced-by" ? r[1] === n && o(r[2], t) : e === "o2m-compare";
4
+ const n = r[0];
5
+ return n === "o2m-rows" || n === "o2m-field-snapshots" || n === "m2m-items" || n === "summary-m2a-items" ? o(r[3], t) : n === "rrv-related" || n === "record-links" || n === "record-graph" || n === "referenced-by" || // rt-fix C (admin #13): the dynamic attributes panel (server sends `$attributes` + `$related`).
6
+ n === "attribute-values" ? r[1] === e && o(r[2], t) : n === "o2m-compare";
6
7
  };
7
8
  }
8
- function s(n, t) {
9
- return (r) => (r[0] === "item-actions" || r[0] === "ext-item-actions") && r[1] === n && o(r[2], t);
9
+ function s(e, t) {
10
+ return (r) => (r[0] === "item-actions" || r[0] === "ext-item-actions") && r[1] === e && o(r[2], t);
10
11
  }
11
- function u(n, t) {
12
- return (r) => r[0] === "resolve-paths" && r[1] === n && o(r[2], t);
12
+ function u(e, t) {
13
+ return (r) => {
14
+ const n = r[0];
15
+ return n === "erp-submissions" || n === "record-integrations" || n === "record-external-ids" ? r[1] === e && o(r[2], t) : n === "integration-obligations" ? r[1] === "record" && r[2] === e && o(r[3], t) : !1;
16
+ };
17
+ }
18
+ function c(e, t) {
19
+ return (r) => r[0] === "integration-obligations" && r[1] === "record" && r[2] === e && o(r[3], t);
20
+ }
21
+ function f(e, t) {
22
+ return (r) => r[0] === "change-proposals" && r[1] === e && o(r[2], t);
23
+ }
24
+ function d(e, t) {
25
+ return (r) => r[0] === "resolve-paths" && r[1] === e && o(r[2], t);
13
26
  }
14
- const f = [
27
+ const l = [
15
28
  ["pipeline-instance", "nivaro_addendums"],
16
29
  ["addendum-lines"]
17
30
  ];
18
- function c(n, t) {
31
+ function m(e, t) {
19
32
  return (r) => {
20
- const e = r[0];
21
- return e === "m2m-items" ? o(r[3], t) : e === "file-usage" || e === "file-download-stats" ? r[1] === n && o(r[2], t) : e === "files-meta" || e === "file-meta" || e === "file-health";
33
+ const n = r[0];
34
+ return n === "m2m-items" ? o(r[3], t) : n === "file-usage" || n === "file-download-stats" ? r[1] === e && o(r[2], t) : n === "files-meta" || n === "file-meta" || n === "file-health";
22
35
  };
23
36
  }
24
37
  const i = 3e3;
25
- function d(n = Math.random) {
26
- return Math.floor(n() * i);
38
+ function p(e = Math.random) {
39
+ return Math.floor(e() * i);
27
40
  }
28
41
  export {
29
- f as ADDENDUM_DETAIL_KEYS,
42
+ l as ADDENDUM_DETAIL_KEYS,
30
43
  i as WIDE_RELATED_SPREAD_MS,
31
44
  s as actionQueryOfRecord,
32
- c as fileQueryOfRecord,
45
+ m as fileQueryOfRecord,
46
+ u as integrationQueryOfRecord,
47
+ c as obligationQueryOfRecord,
48
+ f as proposalQueryOfRecord,
33
49
  a as relatedQueryOfRecord,
34
- u as resolvedPathQueryOfRecord,
35
- d as wideSpreadDelay
50
+ d as resolvedPathQueryOfRecord,
51
+ p as wideSpreadDelay
36
52
  };