@nivaro/react 0.3.66 β 0.3.68
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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +836 -835
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +584 -585
- package/dist/shared/components/ConformanceView.js +34 -34
- package/dist/shared/components/ItemEditForm.js +1758 -1758
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/ReportView.js +196 -196
- package/dist/shared/components/SlaRulesView.js +36 -36
- package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
- package/dist/shared/components/chat/ChatPanel.js +484 -487
- package/dist/shared/components/chat/ChatViews.js +66 -66
- package/dist/shared/components/chat/RoomParts.js +159 -157
- package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
- package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
- package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/FieldRow.js +188 -188
- package/dist/shared/components/item-edit/FilePickerField.js +281 -297
- package/dist/shared/components/item-edit/GroupSection.js +209 -209
- package/dist/shared/components/item-edit/RecordInsights.js +101 -101
- package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
- package/dist/shared/components/panels/AddendumPanel.js +409 -411
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +204 -197
- package/dist/shared/components/panels/PipelinePanel.js +264 -264
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +229 -229
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +591 -589
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +18 -17
- package/dist/shared/lib/utils.js +87 -80
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { MessageSquare as
|
|
2
|
+
import { useQueryClient as ke, useQuery as z, useMutation as A } from "@tanstack/react-query";
|
|
3
|
+
import { MessageSquare as Te, ChevronDown as Pe, ClipboardPlus as Fe, Pencil as Re, Trash2 as Me, Check as Ie, X as je, SmilePlus as Ne } from "lucide-react";
|
|
4
4
|
import { useState as N, useRef as U, useEffect as Q, useMemo as V } from "react";
|
|
5
|
-
import { createPortal as
|
|
5
|
+
import { createPortal as Oe } from "react-dom";
|
|
6
6
|
import { toast as I } from "sonner";
|
|
7
|
-
import { useNivaroClient as oe, useItemEditAuth as
|
|
8
|
-
import { useDebounced as
|
|
9
|
-
import { get as W, post as B, patch as
|
|
10
|
-
import { usePresenceOnlinePoll as
|
|
11
|
-
import { useRecordSignalPeers as
|
|
12
|
-
import { invalidateRecordTasks as
|
|
13
|
-
import { formatRelative as le, titleCase as
|
|
14
|
-
import { AgentBadge as
|
|
7
|
+
import { useNivaroClient as oe, useItemEditAuth as Ae, useDrilldown as Le } from "../../context.js";
|
|
8
|
+
import { useDebounced as Ke } from "../../hooks/useDebounced.js";
|
|
9
|
+
import { get as W, post as B, patch as Be, del as Qe } from "../../lib/commands.js";
|
|
10
|
+
import { usePresenceOnlinePoll as ze } from "../../lib/presence-live.js";
|
|
11
|
+
import { useRecordSignalPeers as Ue, useRecordSignalSender as We, signalSentence as Ge } from "../../lib/presence-signals.js";
|
|
12
|
+
import { invalidateRecordTasks as He } from "../../lib/record-tasks.js";
|
|
13
|
+
import { formatRelative as le, formatDateTime as ie, titleCase as Xe } from "../../lib/utils.js";
|
|
14
|
+
import { AgentBadge as Je } from "../AgentBadge.js";
|
|
15
15
|
import { AutolinkedText as se } from "../AutolinkedText.js";
|
|
16
|
-
import { InboundRequestPopover as
|
|
17
|
-
import { useFieldComments as
|
|
18
|
-
import { UserAvatar as
|
|
19
|
-
import { Avatar as
|
|
16
|
+
import { InboundRequestPopover as Ve } from "../integrations/InboundRequest.js";
|
|
17
|
+
import { useFieldComments as Ze } from "../item-edit/field-comments-context.js";
|
|
18
|
+
import { UserAvatar as Ye } from "../UserAvatar.js";
|
|
19
|
+
import { Avatar as et, AvatarFallback as tt } from "../ui/avatar.js";
|
|
20
20
|
import { Button as Z } from "../ui/button.js";
|
|
21
|
-
import { Separator as
|
|
22
|
-
import { Textarea as
|
|
21
|
+
import { Separator as ge } from "../ui/separator.js";
|
|
22
|
+
import { Textarea as at } from "../ui/textarea.js";
|
|
23
23
|
import { RecordEventPathSheet as nt } from "./IntegrationActivitySection.js";
|
|
24
|
-
const
|
|
24
|
+
const we = ["π", "β
", "π", "π", "β€οΈ", "π"];
|
|
25
25
|
function rt(t) {
|
|
26
26
|
var d, c, h, m;
|
|
27
27
|
return [(d = t.first_name) == null ? void 0 : d[0], (c = t.last_name) == null ? void 0 : c[0]].filter(Boolean).join("").toUpperCase() || ((m = (h = t.email) == null ? void 0 : h[0]) == null ? void 0 : m.toUpperCase()) || "?";
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function st({ comment: t }) {
|
|
30
30
|
const l = (t.mentions ?? []).filter(
|
|
31
31
|
(d) => {
|
|
32
32
|
var c;
|
|
@@ -44,7 +44,7 @@ function at({ comment: t }) {
|
|
|
44
44
|
"span",
|
|
45
45
|
{
|
|
46
46
|
"data-mention-seen": d.seen_at ? "seen" : "unseen",
|
|
47
|
-
title: d.seen_at ? `Seen ${
|
|
47
|
+
title: d.seen_at ? `Seen ${ie(d.seen_at)}` : "Not seen yet",
|
|
48
48
|
className: d.seen_at ? "text-emerald-600 dark:text-emerald-400" : "text-slate-400",
|
|
49
49
|
children: [
|
|
50
50
|
d.seen_at ? "β " : "",
|
|
@@ -58,10 +58,10 @@ function at({ comment: t }) {
|
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function ne(t) {
|
|
62
62
|
return [t.first_name, t.last_name].filter(Boolean).join(" ") || t.email;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function ot({
|
|
65
65
|
field: t,
|
|
66
66
|
label: l,
|
|
67
67
|
resolved: d,
|
|
@@ -84,26 +84,26 @@ function st({
|
|
|
84
84
|
}
|
|
85
85
|
) : /* @__PURE__ */ e("span", { "data-comment-field": t, className: m, children: h });
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function lt(t, l) {
|
|
88
88
|
const c = t.slice(0, l).match(/(^|\s)@([a-zA-Z0-9._-]{2,})$/);
|
|
89
89
|
return c ? { start: l - c[2].length - 1, query: c[2] } : null;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function ye(t) {
|
|
92
92
|
return t.email.split("@")[0];
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function re({
|
|
95
95
|
value: t,
|
|
96
96
|
onChange: l,
|
|
97
97
|
...d
|
|
98
98
|
}) {
|
|
99
|
-
const c = oe(), h = U(null), [m, C] = N(null), [y, w] = N(0), v =
|
|
99
|
+
const c = oe(), h = U(null), [m, C] = N(null), [y, w] = N(0), v = Ke((m == null ? void 0 : m.query) ?? "", 200), { data: q = [] } = z({
|
|
100
100
|
queryKey: ["users", "mention-search", v],
|
|
101
101
|
queryFn: () => c.request(
|
|
102
102
|
W("/users", { limit: 8, sort: "first_name", search: v })
|
|
103
|
-
).then((
|
|
103
|
+
).then((a) => a.data),
|
|
104
104
|
enabled: !!m && v.length >= 2,
|
|
105
105
|
staleTime: 3e4
|
|
106
|
-
}), F =
|
|
106
|
+
}), F = ze(15e3, !!m), { data: E } = z({
|
|
107
107
|
queryKey: ["presence-online"],
|
|
108
108
|
queryFn: () => c.request(
|
|
109
109
|
W("/presence/online")
|
|
@@ -111,25 +111,25 @@ function ae({
|
|
|
111
111
|
enabled: !!m,
|
|
112
112
|
refetchInterval: F,
|
|
113
113
|
staleTime: 5e3
|
|
114
|
-
}), _ = (
|
|
114
|
+
}), _ = (a) => {
|
|
115
115
|
var p;
|
|
116
|
-
const i = (p = E == null ? void 0 : E.data) == null ? void 0 : p.find((b) => String(b.user_id).toUpperCase() ===
|
|
116
|
+
const i = (p = E == null ? void 0 : E.data) == null ? void 0 : p.find((b) => String(b.user_id).toUpperCase() === a.toUpperCase());
|
|
117
117
|
return i ? i.is_idle || i.away ? 1 : 0 : 2;
|
|
118
|
-
}, u = [...q].sort((
|
|
118
|
+
}, u = [...q].sort((a, i) => _(a.id) - _(i.id)), { data: D = [] } = z({
|
|
119
119
|
queryKey: ["mention-roles"],
|
|
120
|
-
queryFn: () => c.request(W("/chat/roles")).then((
|
|
120
|
+
queryFn: () => c.request(W("/chat/roles")).then((a) => a.data).catch(() => []),
|
|
121
121
|
enabled: !!m,
|
|
122
122
|
staleTime: 5 * 6e4
|
|
123
123
|
}), S = m ? D.filter(
|
|
124
|
-
(
|
|
125
|
-
).slice(0, 3) : [], k = !!m && v.length >= 2 && "owners".startsWith(v.toLowerCase()),
|
|
124
|
+
(a) => a.name.toLowerCase().replace(/\s+/g, "-").startsWith(v.toLowerCase())
|
|
125
|
+
).slice(0, 3) : [], k = !!m && v.length >= 2 && "owners".startsWith(v.toLowerCase()), T = !!m && v.length >= 2 && (u.length > 0 || k || S.length > 0), o = u.length + (k ? 1 : 0) + S.length, [f, $] = N(null), O = U(null);
|
|
126
126
|
Q(() => {
|
|
127
|
-
if (!
|
|
127
|
+
if (!T || !h.current) {
|
|
128
128
|
$(null);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
const
|
|
132
|
-
$({ top:
|
|
131
|
+
const a = h.current.getBoundingClientRect();
|
|
132
|
+
$({ top: a.bottom + 4, left: a.left, width: Math.min(a.width, 360) });
|
|
133
133
|
const i = (b) => {
|
|
134
134
|
var g;
|
|
135
135
|
(g = O.current) != null && g.contains(b.target) || C(null);
|
|
@@ -137,53 +137,53 @@ function ae({
|
|
|
137
137
|
return window.addEventListener("scroll", i, !0), window.addEventListener("resize", p), () => {
|
|
138
138
|
window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", p);
|
|
139
139
|
};
|
|
140
|
-
}, [
|
|
141
|
-
function G(
|
|
142
|
-
const i =
|
|
140
|
+
}, [T]);
|
|
141
|
+
function G(a) {
|
|
142
|
+
const i = lt(a.value, a.selectionStart ?? a.value.length);
|
|
143
143
|
C(i), i || w(0);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function P(a) {
|
|
146
146
|
if (!m || !h.current) return;
|
|
147
|
-
const i = h.current.selectionStart ?? t.length, p =
|
|
147
|
+
const i = h.current.selectionStart ?? t.length, p = a === "__owners__" ? "@owners " : typeof a == "object" && "role" in a ? `@${a.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${ye(a)} `, b = t.slice(0, m.start) + p + t.slice(i);
|
|
148
148
|
l(b), C(null), w(0);
|
|
149
149
|
const g = m.start + p.length;
|
|
150
150
|
requestAnimationFrame(() => {
|
|
151
|
-
var j,
|
|
152
|
-
(j = h.current) == null || j.focus(), (
|
|
151
|
+
var j, L;
|
|
152
|
+
(j = h.current) == null || j.focus(), (L = h.current) == null || L.setSelectionRange(g, g);
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
function H(
|
|
156
|
-
if (
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
else if (
|
|
160
|
-
|
|
161
|
-
else if (
|
|
162
|
-
|
|
155
|
+
function H(a) {
|
|
156
|
+
if (T)
|
|
157
|
+
if (a.key === "ArrowDown")
|
|
158
|
+
a.preventDefault(), w((i) => (i + 1) % o);
|
|
159
|
+
else if (a.key === "ArrowUp")
|
|
160
|
+
a.preventDefault(), w((i) => (i - 1 + o) % o);
|
|
161
|
+
else if (a.key === "Enter" || a.key === "Tab") {
|
|
162
|
+
a.preventDefault();
|
|
163
163
|
const i = Math.min(y, o - 1), p = k ? 1 : 0, b = p + u.length;
|
|
164
|
-
if (k && i === 0)
|
|
164
|
+
if (k && i === 0) P("__owners__");
|
|
165
165
|
else if (i >= b) {
|
|
166
166
|
const g = S[i - b];
|
|
167
|
-
g &&
|
|
168
|
-
} else
|
|
169
|
-
} else
|
|
167
|
+
g && P({ role: g.name });
|
|
168
|
+
} else P(u[i - p]);
|
|
169
|
+
} else a.key === "Escape" && (a.preventDefault(), C(null));
|
|
170
170
|
}
|
|
171
171
|
return /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
172
172
|
/* @__PURE__ */ e(
|
|
173
|
-
|
|
173
|
+
at,
|
|
174
174
|
{
|
|
175
175
|
...d,
|
|
176
176
|
ref: h,
|
|
177
177
|
value: t,
|
|
178
|
-
onChange: (
|
|
179
|
-
l(
|
|
178
|
+
onChange: (a) => {
|
|
179
|
+
l(a.target.value), G(a.target);
|
|
180
180
|
},
|
|
181
181
|
onKeyDown: H,
|
|
182
|
-
onClick: (
|
|
182
|
+
onClick: (a) => G(a.currentTarget),
|
|
183
183
|
onBlur: () => setTimeout(() => C(null), 150)
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
T && f && Oe(
|
|
187
187
|
/* @__PURE__ */ s(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
@@ -191,14 +191,14 @@ function ae({
|
|
|
191
191
|
"data-mention-menu": "",
|
|
192
192
|
className: "fixed z-[110] max-h-60 overflow-y-auto rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-popover",
|
|
193
193
|
style: { top: f.top, left: f.left, width: f.width },
|
|
194
|
-
onMouseDown: (
|
|
194
|
+
onMouseDown: (a) => a.preventDefault(),
|
|
195
195
|
children: [
|
|
196
196
|
k && /* @__PURE__ */ s(
|
|
197
197
|
"button",
|
|
198
198
|
{
|
|
199
199
|
type: "button",
|
|
200
|
-
onMouseDown: (
|
|
201
|
-
|
|
200
|
+
onMouseDown: (a) => {
|
|
201
|
+
a.preventDefault(), P("__owners__");
|
|
202
202
|
},
|
|
203
203
|
onMouseEnter: () => w(0),
|
|
204
204
|
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${y === 0 ? "bg-nvr-cyan/10" : ""}`,
|
|
@@ -211,70 +211,70 @@ function ae({
|
|
|
211
211
|
]
|
|
212
212
|
}
|
|
213
213
|
),
|
|
214
|
-
u.map((
|
|
214
|
+
u.map((a, i) => {
|
|
215
215
|
var g, j;
|
|
216
|
-
const p = k ? i + 1 : i, b = [
|
|
216
|
+
const p = k ? i + 1 : i, b = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email;
|
|
217
217
|
return /* @__PURE__ */ s(
|
|
218
218
|
"button",
|
|
219
219
|
{
|
|
220
220
|
type: "button",
|
|
221
|
-
onMouseDown: (
|
|
222
|
-
|
|
221
|
+
onMouseDown: (L) => {
|
|
222
|
+
L.preventDefault(), P(a);
|
|
223
223
|
},
|
|
224
224
|
onMouseEnter: () => w(p),
|
|
225
225
|
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${p === y ? "bg-nvr-cyan/10" : ""}`,
|
|
226
226
|
children: [
|
|
227
227
|
/* @__PURE__ */ s("span", { className: "relative flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy/80 dark:text-nvr-cyan", children: [
|
|
228
|
-
(`${((g =
|
|
229
|
-
_(
|
|
228
|
+
(`${((g = a.first_name) == null ? void 0 : g[0]) ?? ""}${((j = a.last_name) == null ? void 0 : j[0]) ?? ""}`.trim() || a.email[0]).toUpperCase(),
|
|
229
|
+
_(a.id) < 2 && /* @__PURE__ */ e(
|
|
230
230
|
"span",
|
|
231
231
|
{
|
|
232
|
-
"data-mention-presence": _(
|
|
233
|
-
title: _(
|
|
234
|
-
className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${_(
|
|
232
|
+
"data-mention-presence": _(a.id) === 0 ? "online" : "idle",
|
|
233
|
+
title: _(a.id) === 0 ? "Online" : "Idle",
|
|
234
|
+
className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${_(a.id) === 0 ? "bg-emerald-500" : "border border-amber-500 bg-white dark:bg-popover"}`
|
|
235
235
|
}
|
|
236
236
|
)
|
|
237
237
|
] }),
|
|
238
238
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
239
239
|
/* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: b }),
|
|
240
240
|
/* @__PURE__ */ s("span", { className: "block truncate text-[11px] text-slate-400", children: [
|
|
241
|
-
|
|
241
|
+
a.is_out_of_office && /* @__PURE__ */ s("span", { className: "mr-1 rounded bg-amber-100 px-1 py-px text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: [
|
|
242
242
|
"OOO",
|
|
243
|
-
|
|
243
|
+
a.ooo_end ? ` until ${String(a.ooo_end).slice(0, 10)}` : ""
|
|
244
244
|
] }),
|
|
245
245
|
"@",
|
|
246
|
-
|
|
247
|
-
(
|
|
246
|
+
ye(a),
|
|
247
|
+
(a.title || a.department) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-slate-500", children: [
|
|
248
248
|
" Β· ",
|
|
249
|
-
[
|
|
249
|
+
[a.title, a.department].filter(Boolean).join(", ")
|
|
250
250
|
] })
|
|
251
251
|
] })
|
|
252
252
|
] })
|
|
253
253
|
]
|
|
254
254
|
},
|
|
255
|
-
|
|
255
|
+
a.id
|
|
256
256
|
);
|
|
257
257
|
}),
|
|
258
|
-
S.map((
|
|
258
|
+
S.map((a, i) => {
|
|
259
259
|
const p = u.length + (k ? 1 : 0) + i;
|
|
260
260
|
return /* @__PURE__ */ s(
|
|
261
261
|
"button",
|
|
262
262
|
{
|
|
263
263
|
type: "button",
|
|
264
264
|
onMouseDown: (b) => {
|
|
265
|
-
b.preventDefault(),
|
|
265
|
+
b.preventDefault(), P({ role: a.name });
|
|
266
266
|
},
|
|
267
267
|
onMouseEnter: () => w(p),
|
|
268
268
|
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${p === y ? "bg-nvr-cyan/10" : ""}`,
|
|
269
269
|
children: [
|
|
270
270
|
/* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-violet-500/15 text-[10px] font-semibold text-violet-600 dark:text-violet-300", children: "R" }),
|
|
271
271
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
272
|
-
/* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children:
|
|
272
|
+
/* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: a.name }),
|
|
273
273
|
/* @__PURE__ */ e("span", { className: "block text-[11px] text-slate-400", children: "Role β notifies every member" })
|
|
274
274
|
] })
|
|
275
275
|
]
|
|
276
276
|
},
|
|
277
|
-
`role-${
|
|
277
|
+
`role-${a.id}`
|
|
278
278
|
);
|
|
279
279
|
})
|
|
280
280
|
]
|
|
@@ -284,7 +284,7 @@ function ae({
|
|
|
284
284
|
)
|
|
285
285
|
] });
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function ve(t) {
|
|
288
288
|
if (t.kind === "comment") return "people";
|
|
289
289
|
switch (t.note.source) {
|
|
290
290
|
case "note":
|
|
@@ -296,29 +296,29 @@ function ye(t) {
|
|
|
296
296
|
return "system";
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
const
|
|
299
|
+
const it = {
|
|
300
300
|
people: "People",
|
|
301
301
|
system: "System",
|
|
302
302
|
integration: "Integration"
|
|
303
303
|
};
|
|
304
|
-
function
|
|
304
|
+
function dt(t) {
|
|
305
305
|
const l = t.kind === "comment" ? t.comment.text : t.note.text;
|
|
306
306
|
return (t.kind === "comment" ? l.replace(/<[^>]*>/g, " ") : l).replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
|
|
307
307
|
}
|
|
308
|
-
const
|
|
309
|
-
function
|
|
308
|
+
const ct = "integrations:";
|
|
309
|
+
function mt({
|
|
310
310
|
note: t,
|
|
311
311
|
collection: l,
|
|
312
312
|
item: d
|
|
313
313
|
}) {
|
|
314
|
-
var
|
|
315
|
-
const c = Le(), [h, m] = N(!1), C = t.source === "external" && !!t.provider && !t.provider.startsWith(
|
|
314
|
+
var T;
|
|
315
|
+
const c = Le(), [h, m] = N(!1), C = t.source === "external" && !!t.provider && !t.provider.startsWith(ct), y = oe(), w = ke(), [v, q] = N(!1), F = A({
|
|
316
316
|
mutationFn: (o) => y.request(B(`/comments/${t.comment_id}/reactions`, { emoji: o })),
|
|
317
317
|
onSuccess: () => {
|
|
318
318
|
q(!1), w.invalidateQueries({ queryKey: ["comments-related"] }), w.invalidateQueries({ queryKey: ["row-comment-counts"] });
|
|
319
319
|
},
|
|
320
320
|
onError: () => I.error("Failed to react")
|
|
321
|
-
}), [E, _] = N(!1), u =
|
|
321
|
+
}), [E, _] = N(!1), u = A({
|
|
322
322
|
mutationFn: () => y.request(
|
|
323
323
|
B(`/integration-events/${encodeURIComponent(t.provider ?? "")}/replay`, {
|
|
324
324
|
entry_id: t.id.replace(/^external:/, "")
|
|
@@ -345,7 +345,7 @@ function ct({
|
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
347
|
c == null || c.open({ collection: o.collection, itemId: o.item_id });
|
|
348
|
-
} : null, S = t.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : t.source === "addendum" ? "border-amber-200 bg-amber-50/60 text-amber-700 dark:border-amber-900/40 dark:bg-amber-900/10 dark:text-amber-400" : t.source === "external" || t.source === "inbound" ? "border-sky-200 bg-sky-50/70 text-sky-700 dark:border-sky-900/40 dark:bg-sky-900/10 dark:text-sky-300" : t.source === "import" ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50/80 text-slate-600 dark:border-border dark:bg-muted/40 dark:text-slate-300", k = t.source === "import" && ((
|
|
348
|
+
} : null, S = t.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : t.source === "addendum" ? "border-amber-200 bg-amber-50/60 text-amber-700 dark:border-amber-900/40 dark:bg-amber-900/10 dark:text-amber-400" : t.source === "external" || t.source === "inbound" ? "border-sky-200 bg-sky-50/70 text-sky-700 dark:border-sky-900/40 dark:bg-sky-900/10 dark:text-sky-300" : t.source === "import" ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50/80 text-slate-600 dark:border-border dark:bg-muted/40 dark:text-slate-300", k = t.source === "import" && ((T = t.import) != null && T.file_id) ? t.import : null;
|
|
349
349
|
return /* @__PURE__ */ s("div", { className: "flex gap-3", "data-recorded-note": t.source, children: [
|
|
350
350
|
/* @__PURE__ */ e("div", { className: "mt-1 h-8 w-8 shrink-0", "aria-hidden": !0 }),
|
|
351
351
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -373,9 +373,9 @@ function ct({
|
|
|
373
373
|
children: t.context
|
|
374
374
|
}
|
|
375
375
|
) : /* @__PURE__ */ e("span", { className: "truncate text-[11px] text-slate-400", children: t.context })),
|
|
376
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: le(t.created_at) }),
|
|
376
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", "data-tip": ie(t.created_at), children: le(t.created_at) }),
|
|
377
377
|
t.source === "inbound" && t.inbound && /* @__PURE__ */ e(
|
|
378
|
-
|
|
378
|
+
Ve,
|
|
379
379
|
{
|
|
380
380
|
activityId: t.inbound.activity_id,
|
|
381
381
|
callerName: t.label,
|
|
@@ -443,10 +443,10 @@ function ct({
|
|
|
443
443
|
onClick: () => q((o) => !o),
|
|
444
444
|
className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
|
|
445
445
|
"aria-label": "Add reaction",
|
|
446
|
-
children: /* @__PURE__ */ e(
|
|
446
|
+
children: /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" })
|
|
447
447
|
}
|
|
448
448
|
),
|
|
449
|
-
v && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children:
|
|
449
|
+
v && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: we.map((o) => /* @__PURE__ */ e(
|
|
450
450
|
"button",
|
|
451
451
|
{
|
|
452
452
|
type: "button",
|
|
@@ -473,7 +473,7 @@ function ct({
|
|
|
473
473
|
)
|
|
474
474
|
] });
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Mt({
|
|
477
477
|
collection: t,
|
|
478
478
|
item: l,
|
|
479
479
|
title: d,
|
|
@@ -482,7 +482,7 @@ function Rt({
|
|
|
482
482
|
onQueueComment: m,
|
|
483
483
|
onUnsentDraft: C
|
|
484
484
|
}) {
|
|
485
|
-
const y = oe(), { userId: w } =
|
|
485
|
+
const y = oe(), { userId: w } = Ae(), v = ke(), q = Ze(), [F, E] = N(!1), _ = U(!1);
|
|
486
486
|
Q(() => {
|
|
487
487
|
!_.current && c !== void 0 && (_.current = !0, E(c));
|
|
488
488
|
}, [c]);
|
|
@@ -491,21 +491,21 @@ function Rt({
|
|
|
491
491
|
var r;
|
|
492
492
|
(r = S.current) == null || r.call(S, u);
|
|
493
493
|
}, [u]);
|
|
494
|
-
const [k,
|
|
494
|
+
const [k, T] = N(!1), o = async () => {
|
|
495
495
|
var r;
|
|
496
496
|
if (!(!u.trim() || k)) {
|
|
497
|
-
|
|
497
|
+
T(!0);
|
|
498
498
|
try {
|
|
499
|
-
const
|
|
499
|
+
const n = await y.request(
|
|
500
500
|
B("/ai/cleanup", { text: u })
|
|
501
501
|
);
|
|
502
|
-
(r =
|
|
502
|
+
(r = n.data) != null && r.text && D(n.data.text);
|
|
503
503
|
} catch {
|
|
504
504
|
} finally {
|
|
505
|
-
|
|
505
|
+
T(!1);
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
}, f =
|
|
508
|
+
}, f = Ue(t, l, "note"), $ = We(t, l, "note"), O = U(0);
|
|
509
509
|
Q(() => {
|
|
510
510
|
if (!u.trim()) {
|
|
511
511
|
O.current && $("stop"), O.current = 0;
|
|
@@ -514,49 +514,49 @@ function Rt({
|
|
|
514
514
|
const r = Date.now();
|
|
515
515
|
r - O.current < 2500 || (O.current = r, $("start"));
|
|
516
516
|
}, [u, $]), Q(() => () => $("stop"), [$]);
|
|
517
|
-
const [G,
|
|
517
|
+
const [G, P] = N(null), [H, a] = N(null), [i, p] = N(""), b = !l || l === "new", g = ["comments", t, String(l)], { data: j, isLoading: L, isError: _e } = z({
|
|
518
518
|
queryKey: g,
|
|
519
519
|
queryFn: () => y.request(W("/comments", { collection: t, item: l })).then((r) => r.data),
|
|
520
520
|
enabled: !b
|
|
521
|
-
}),
|
|
521
|
+
}), de = V(() => (j ?? []).filter((r) => !r.deleted), [j]), { data: Ce } = z({
|
|
522
522
|
queryKey: ["comments-related", t, String(l)],
|
|
523
523
|
queryFn: () => y.request(W("/comments/related", { collection: t, item: l })).then((r) => r.data ?? []).catch(() => []),
|
|
524
524
|
enabled: !b,
|
|
525
525
|
staleTime: 3e4
|
|
526
|
-
}),
|
|
527
|
-
const r =
|
|
528
|
-
return [...r, ...
|
|
529
|
-
}, [
|
|
526
|
+
}), ce = Ce ?? [], R = V(() => {
|
|
527
|
+
const r = de.map((x) => ({ kind: "comment", at: x.created_at, comment: x })), n = ce.map((x) => ({ kind: "related", at: x.created_at, note: x }));
|
|
528
|
+
return [...r, ...n].sort((x, K) => new Date(K.at).getTime() - new Date(x.at).getTime());
|
|
529
|
+
}, [de, ce]), [X, Se] = N(() => /* @__PURE__ */ new Set()), [J, $e] = N(""), me = V(() => {
|
|
530
530
|
const r = { people: 0, system: 0, integration: 0 };
|
|
531
|
-
for (const
|
|
531
|
+
for (const n of R) r[ve(n)]++;
|
|
532
532
|
return r;
|
|
533
|
-
}, [R]),
|
|
533
|
+
}, [R]), ue = b ? (h ?? []).length : me.people, ee = V(() => {
|
|
534
534
|
const r = J.trim().toLowerCase();
|
|
535
|
-
return R.filter((
|
|
536
|
-
}, [R, X, J]),
|
|
537
|
-
const x = new Set(
|
|
535
|
+
return R.filter((n) => X.has(ve(n)) ? !1 : r ? (n.kind === "comment" ? `${n.comment.text} ${ne(n.comment.user)}` : `${n.note.text} ${n.note.user_name ?? ""} ${n.note.label} ${n.note.context ?? ""} ${n.note.provider ?? ""}`).toLowerCase().includes(r) : !0);
|
|
536
|
+
}, [R, X, J]), qe = (r) => Se((n) => {
|
|
537
|
+
const x = new Set(n);
|
|
538
538
|
return x.has(r) ? x.delete(r) : x.add(r), x;
|
|
539
|
-
}),
|
|
539
|
+
}), Ee = X.size > 0 || J.trim() !== "", te = A({
|
|
540
540
|
mutationFn: (r) => y.request(B("/comments", { collection: t, item: l, text: r })),
|
|
541
541
|
onSuccess: () => {
|
|
542
542
|
v.invalidateQueries({ queryKey: g }), D("");
|
|
543
543
|
},
|
|
544
544
|
onError: () => I.error("Failed to post comment")
|
|
545
|
-
}),
|
|
546
|
-
mutationFn: ({ id: r, text:
|
|
545
|
+
}), pe = A({
|
|
546
|
+
mutationFn: ({ id: r, text: n }) => y.request(Be(`/comments/${r}`, { text: n })),
|
|
547
547
|
onSuccess: () => {
|
|
548
|
-
v.invalidateQueries({ queryKey: g }),
|
|
548
|
+
v.invalidateQueries({ queryKey: g }), P(null), p("");
|
|
549
549
|
},
|
|
550
550
|
onError: () => I.error("Failed to update comment")
|
|
551
|
-
}),
|
|
552
|
-
mutationFn: (r) => y.request(
|
|
551
|
+
}), ae = A({
|
|
552
|
+
mutationFn: (r) => y.request(Qe(`/comments/${r}`)),
|
|
553
553
|
onSuccess: () => v.invalidateQueries({ queryKey: g }),
|
|
554
554
|
onError: () => I.error("Failed to delete comment")
|
|
555
|
-
}),
|
|
556
|
-
mutationFn: ({ id: r, emoji:
|
|
555
|
+
}), xe = A({
|
|
556
|
+
mutationFn: ({ id: r, emoji: n }) => y.request(B(`/comments/${r}/reactions`, { emoji: n })),
|
|
557
557
|
onSuccess: () => v.invalidateQueries({ queryKey: g }),
|
|
558
558
|
onError: () => I.error("Failed to react")
|
|
559
|
-
}), [
|
|
559
|
+
}), [he, be] = N(null), De = A({
|
|
560
560
|
mutationFn: (r) => y.request(
|
|
561
561
|
B("/tasks", {
|
|
562
562
|
collection: t,
|
|
@@ -566,11 +566,11 @@ function Rt({
|
|
|
566
566
|
})
|
|
567
567
|
),
|
|
568
568
|
onSuccess: () => {
|
|
569
|
-
|
|
569
|
+
He(v, t, l), I.success("Task created from comment β assigned to you");
|
|
570
570
|
},
|
|
571
571
|
onError: () => I.error("Could not create a task")
|
|
572
572
|
});
|
|
573
|
-
function
|
|
573
|
+
function fe(r) {
|
|
574
574
|
r.preventDefault(), u.trim() && (b && m ? (m(u.trim()), D("")) : te.mutate(u.trim()));
|
|
575
575
|
}
|
|
576
576
|
return (
|
|
@@ -592,14 +592,14 @@ function Rt({
|
|
|
592
592
|
className: "flex w-full flex-col px-5 py-3.5 text-left transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
|
|
593
593
|
children: [
|
|
594
594
|
/* @__PURE__ */ s("span", { className: "flex w-full items-center gap-2.5", children: [
|
|
595
|
-
/* @__PURE__ */ e(
|
|
595
|
+
/* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
596
596
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: d || "Comments" }),
|
|
597
|
-
|
|
597
|
+
ue > 0 && /* @__PURE__ */ e(
|
|
598
598
|
"span",
|
|
599
599
|
{
|
|
600
600
|
className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400",
|
|
601
601
|
"data-notes-badge": !0,
|
|
602
|
-
children:
|
|
602
|
+
children: ue
|
|
603
603
|
}
|
|
604
604
|
),
|
|
605
605
|
/* @__PURE__ */ e(
|
|
@@ -610,10 +610,10 @@ function Rt({
|
|
|
610
610
|
)
|
|
611
611
|
] }),
|
|
612
612
|
!F && !b && R.length > 0 && (() => {
|
|
613
|
-
const r = R[0],
|
|
613
|
+
const r = R[0], n = r.kind === "comment" ? ne(r.comment.user) : r.note.user_name ?? "System", x = dt(r);
|
|
614
614
|
return x ? /* @__PURE__ */ s("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
|
|
615
615
|
/* @__PURE__ */ s("span", { className: "font-medium text-slate-500 dark:text-slate-400", children: [
|
|
616
|
-
|
|
616
|
+
n,
|
|
617
617
|
":"
|
|
618
618
|
] }),
|
|
619
619
|
" ",
|
|
@@ -624,9 +624,9 @@ function Rt({
|
|
|
624
624
|
}
|
|
625
625
|
),
|
|
626
626
|
F && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 px-5 py-4 dark:border-border/60", children: b ? /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
627
|
-
/* @__PURE__ */ s("form", { onSubmit:
|
|
627
|
+
/* @__PURE__ */ s("form", { onSubmit: fe, className: "space-y-2", children: [
|
|
628
628
|
/* @__PURE__ */ e(
|
|
629
|
-
|
|
629
|
+
re,
|
|
630
630
|
{
|
|
631
631
|
value: u,
|
|
632
632
|
onChange: D,
|
|
@@ -641,8 +641,8 @@ function Rt({
|
|
|
641
641
|
] })
|
|
642
642
|
] }),
|
|
643
643
|
(h ?? []).length > 0 && /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
644
|
-
/* @__PURE__ */ e(
|
|
645
|
-
(h ?? []).map((r,
|
|
644
|
+
/* @__PURE__ */ e(ge, {}),
|
|
645
|
+
(h ?? []).map((r, n) => /* @__PURE__ */ s(
|
|
646
646
|
"div",
|
|
647
647
|
{
|
|
648
648
|
className: "flex items-start gap-2.5 rounded-lg border border-dashed border-amber-200/70 bg-amber-50/40 px-3 py-2 dark:border-amber-500/20 dark:bg-amber-500/5",
|
|
@@ -651,13 +651,13 @@ function Rt({
|
|
|
651
651
|
/* @__PURE__ */ e("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: r })
|
|
652
652
|
]
|
|
653
653
|
},
|
|
654
|
-
|
|
654
|
+
n
|
|
655
655
|
))
|
|
656
656
|
] })
|
|
657
657
|
] }) : /* @__PURE__ */ s(Y, { children: [
|
|
658
|
-
/* @__PURE__ */ s("form", { onSubmit:
|
|
658
|
+
/* @__PURE__ */ s("form", { onSubmit: fe, className: "space-y-2", children: [
|
|
659
659
|
/* @__PURE__ */ e(
|
|
660
|
-
|
|
660
|
+
re,
|
|
661
661
|
{
|
|
662
662
|
value: u,
|
|
663
663
|
onChange: D,
|
|
@@ -691,27 +691,27 @@ function Rt({
|
|
|
691
691
|
"data-note-typing": !0,
|
|
692
692
|
children: [
|
|
693
693
|
/* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
|
|
694
|
-
|
|
694
|
+
Ge(f, "writing a note"),
|
|
695
695
|
"β¦"
|
|
696
696
|
]
|
|
697
697
|
}
|
|
698
698
|
),
|
|
699
|
-
/* @__PURE__ */ e(
|
|
699
|
+
/* @__PURE__ */ e(ge, { className: "my-4" }),
|
|
700
700
|
R.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
|
|
701
701
|
["people", "system", "integration"].map((r) => {
|
|
702
|
-
const
|
|
702
|
+
const n = !X.has(r), x = me[r];
|
|
703
703
|
return /* @__PURE__ */ s(
|
|
704
704
|
"button",
|
|
705
705
|
{
|
|
706
706
|
type: "button",
|
|
707
|
-
onClick: () =>
|
|
708
|
-
"aria-pressed":
|
|
707
|
+
onClick: () => qe(r),
|
|
708
|
+
"aria-pressed": n,
|
|
709
709
|
"data-notes-filter": r,
|
|
710
|
-
disabled: x === 0 &&
|
|
711
|
-
className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${
|
|
710
|
+
disabled: x === 0 && n,
|
|
711
|
+
className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${n ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-400 line-through decoration-slate-300 dark:border-border"} disabled:opacity-50`,
|
|
712
712
|
title: r === "people" ? "Comments and notes people wrote" : r === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
|
|
713
713
|
children: [
|
|
714
|
-
|
|
714
|
+
it[r],
|
|
715
715
|
/* @__PURE__ */ e("span", { className: "tabular-nums text-[10px] opacity-70", children: x })
|
|
716
716
|
]
|
|
717
717
|
},
|
|
@@ -722,64 +722,71 @@ function Rt({
|
|
|
722
722
|
"input",
|
|
723
723
|
{
|
|
724
724
|
value: J,
|
|
725
|
-
onChange: (r) =>
|
|
725
|
+
onChange: (r) => $e(r.target.value),
|
|
726
726
|
placeholder: "Search notesβ¦",
|
|
727
727
|
"aria-label": "Search notes",
|
|
728
728
|
"data-notes-search": !0,
|
|
729
729
|
className: "ml-auto h-6 w-[150px] rounded-md border border-slate-200 bg-background px-2 text-[11.5px] dark:border-border"
|
|
730
730
|
}
|
|
731
731
|
),
|
|
732
|
-
|
|
732
|
+
Ee && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
|
|
733
733
|
ee.length,
|
|
734
734
|
" of ",
|
|
735
735
|
R.length
|
|
736
736
|
] })
|
|
737
737
|
] }),
|
|
738
|
-
|
|
738
|
+
L ? /* @__PURE__ */ e("div", { className: "space-y-4", children: ["a", "b"].map((r) => /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
|
|
739
739
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 shrink-0 animate-pulse rounded-full bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
740
740
|
/* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
|
|
741
741
|
/* @__PURE__ */ e("div", { className: "h-3 w-32 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
742
742
|
/* @__PURE__ */ e("div", { className: "h-3 w-full animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
743
743
|
] })
|
|
744
|
-
] }, r)) }) :
|
|
744
|
+
] }, r)) }) : _e ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : R.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : ee.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes match β clear the search or turn a filter back on." }) : /* @__PURE__ */ e("div", { className: "nvr-stagger-direct space-y-4", children: ee.map((r) => {
|
|
745
745
|
if (r.kind === "related")
|
|
746
746
|
return /* @__PURE__ */ e("div", { className: "nvr-section-enter", children: /* @__PURE__ */ e(
|
|
747
|
-
|
|
747
|
+
mt,
|
|
748
748
|
{
|
|
749
749
|
note: r.note,
|
|
750
750
|
collection: t,
|
|
751
751
|
item: String(l)
|
|
752
752
|
}
|
|
753
753
|
) }, r.note.id);
|
|
754
|
-
const
|
|
754
|
+
const n = r.comment, x = w === n.user.id, K = G === n.id;
|
|
755
755
|
return /* @__PURE__ */ s("div", { className: "nvr-section-enter group flex gap-3", children: [
|
|
756
756
|
/* @__PURE__ */ e(
|
|
757
|
-
|
|
757
|
+
Ye,
|
|
758
758
|
{
|
|
759
|
-
userId:
|
|
759
|
+
userId: n.user.id,
|
|
760
760
|
className: "h-8 w-8",
|
|
761
|
-
fallback: /* @__PURE__ */ e(
|
|
761
|
+
fallback: /* @__PURE__ */ e(et, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ e(tt, { className: "bg-nvr-cyan/15 text-[11px] font-bold text-nvr-navy", children: rt(n.user) }) })
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
764
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
765
765
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
766
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800", children:
|
|
767
|
-
/* @__PURE__ */ e(
|
|
768
|
-
/* @__PURE__ */ e(
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
766
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800", children: ne(n.user) }),
|
|
767
|
+
/* @__PURE__ */ e(Je, { label: n.via_agent }),
|
|
768
|
+
/* @__PURE__ */ e(
|
|
769
|
+
"span",
|
|
770
|
+
{
|
|
771
|
+
className: "text-[11px] text-slate-400",
|
|
772
|
+
"data-tip": ie(n.created_at),
|
|
773
|
+
children: le(n.created_at)
|
|
774
|
+
}
|
|
775
|
+
),
|
|
776
|
+
n.updated_at && n.updated_at !== n.created_at && /* @__PURE__ */ e("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
|
|
777
|
+
n.field && /* @__PURE__ */ e(
|
|
778
|
+
ot,
|
|
772
779
|
{
|
|
773
|
-
field:
|
|
774
|
-
label: (q == null ? void 0 : q.labelOf(
|
|
775
|
-
resolved: !!
|
|
776
|
-
onJump: q ? () => q.jump(
|
|
780
|
+
field: n.field,
|
|
781
|
+
label: (q == null ? void 0 : q.labelOf(n.field)) ?? Xe(n.field),
|
|
782
|
+
resolved: !!n.resolved_at,
|
|
783
|
+
onJump: q ? () => q.jump(n.field) : void 0
|
|
777
784
|
}
|
|
778
785
|
),
|
|
779
786
|
!K && /* @__PURE__ */ s(
|
|
780
787
|
"div",
|
|
781
788
|
{
|
|
782
|
-
className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${H ===
|
|
789
|
+
className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${H === n.id ? "opacity-100" : "opacity-0"}`,
|
|
783
790
|
children: [
|
|
784
791
|
/* @__PURE__ */ e(
|
|
785
792
|
"button",
|
|
@@ -788,23 +795,23 @@ function Rt({
|
|
|
788
795
|
title: "Make a task from this comment",
|
|
789
796
|
"aria-label": "Make a task from this comment",
|
|
790
797
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
791
|
-
onClick: () =>
|
|
792
|
-
children: /* @__PURE__ */ e(
|
|
798
|
+
onClick: () => De.mutate(n),
|
|
799
|
+
children: /* @__PURE__ */ e(Fe, { className: "h-3 w-3" })
|
|
793
800
|
}
|
|
794
801
|
),
|
|
795
|
-
x && (H ===
|
|
802
|
+
x && (H === n.id ? /* @__PURE__ */ s(Y, { children: [
|
|
796
803
|
/* @__PURE__ */ e(
|
|
797
804
|
"button",
|
|
798
805
|
{
|
|
799
806
|
type: "button",
|
|
800
807
|
autoFocus: !0,
|
|
801
|
-
disabled:
|
|
802
|
-
"data-comment-delete-confirm":
|
|
808
|
+
disabled: ae.isPending,
|
|
809
|
+
"data-comment-delete-confirm": n.id,
|
|
803
810
|
className: "rounded bg-red-600 px-1.5 py-px text-[10.5px] font-medium text-white transition-colors hover:bg-red-700 disabled:opacity-60",
|
|
804
|
-
onClick: () =>
|
|
805
|
-
onSettled: () =>
|
|
811
|
+
onClick: () => ae.mutate(n.id, {
|
|
812
|
+
onSettled: () => a(null)
|
|
806
813
|
}),
|
|
807
|
-
children:
|
|
814
|
+
children: ae.isPending ? "Deletingβ¦" : "Delete comment?"
|
|
808
815
|
}
|
|
809
816
|
),
|
|
810
817
|
/* @__PURE__ */ e(
|
|
@@ -812,7 +819,7 @@ function Rt({
|
|
|
812
819
|
{
|
|
813
820
|
type: "button",
|
|
814
821
|
className: "rounded px-1.5 py-px text-[10.5px] font-medium text-slate-500 transition-colors hover:bg-slate-100 dark:hover:bg-muted",
|
|
815
|
-
onClick: () =>
|
|
822
|
+
onClick: () => a(null),
|
|
816
823
|
children: "Keep"
|
|
817
824
|
}
|
|
818
825
|
)
|
|
@@ -825,9 +832,9 @@ function Rt({
|
|
|
825
832
|
"aria-label": "Edit comment",
|
|
826
833
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",
|
|
827
834
|
onClick: () => {
|
|
828
|
-
|
|
835
|
+
P(n.id), p(n.text);
|
|
829
836
|
},
|
|
830
|
-
children: /* @__PURE__ */ e(
|
|
837
|
+
children: /* @__PURE__ */ e(Re, { className: "h-3 w-3" })
|
|
831
838
|
}
|
|
832
839
|
),
|
|
833
840
|
/* @__PURE__ */ e(
|
|
@@ -837,8 +844,8 @@ function Rt({
|
|
|
837
844
|
title: "Delete comment",
|
|
838
845
|
"aria-label": "Delete comment",
|
|
839
846
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500",
|
|
840
|
-
onClick: () => n
|
|
841
|
-
children: /* @__PURE__ */ e(
|
|
847
|
+
onClick: () => a(n.id),
|
|
848
|
+
children: /* @__PURE__ */ e(Me, { className: "h-3 w-3" })
|
|
842
849
|
}
|
|
843
850
|
)
|
|
844
851
|
] }))
|
|
@@ -848,7 +855,7 @@ function Rt({
|
|
|
848
855
|
] }),
|
|
849
856
|
K ? /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-2", children: [
|
|
850
857
|
/* @__PURE__ */ e(
|
|
851
|
-
|
|
858
|
+
re,
|
|
852
859
|
{
|
|
853
860
|
value: i,
|
|
854
861
|
onChange: p,
|
|
@@ -862,10 +869,10 @@ function Rt({
|
|
|
862
869
|
{
|
|
863
870
|
size: "sm",
|
|
864
871
|
className: "h-7 gap-1.5",
|
|
865
|
-
disabled: !i.trim() ||
|
|
866
|
-
onClick: () =>
|
|
872
|
+
disabled: !i.trim() || pe.isPending,
|
|
873
|
+
onClick: () => pe.mutate({ id: n.id, text: i.trim() }),
|
|
867
874
|
children: [
|
|
868
|
-
/* @__PURE__ */ e(
|
|
875
|
+
/* @__PURE__ */ e(Ie, { className: "h-3 w-3" }),
|
|
869
876
|
" Save"
|
|
870
877
|
]
|
|
871
878
|
}
|
|
@@ -877,23 +884,23 @@ function Rt({
|
|
|
877
884
|
variant: "outline",
|
|
878
885
|
className: "h-7 gap-1.5",
|
|
879
886
|
onClick: () => {
|
|
880
|
-
|
|
887
|
+
P(null), p("");
|
|
881
888
|
},
|
|
882
889
|
children: [
|
|
883
|
-
/* @__PURE__ */ e(
|
|
890
|
+
/* @__PURE__ */ e(je, { className: "h-3 w-3" }),
|
|
884
891
|
" Cancel"
|
|
885
892
|
]
|
|
886
893
|
}
|
|
887
894
|
)
|
|
888
895
|
] })
|
|
889
|
-
] }) : /* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600", children: /* @__PURE__ */ e(se, { text:
|
|
890
|
-
!K && /* @__PURE__ */ e(
|
|
896
|
+
] }) : /* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600", children: /* @__PURE__ */ e(se, { text: n.text }) }),
|
|
897
|
+
!K && /* @__PURE__ */ e(st, { comment: n }),
|
|
891
898
|
!K && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
|
|
892
|
-
(
|
|
899
|
+
(n.reactions ?? []).map((M) => /* @__PURE__ */ s(
|
|
893
900
|
"button",
|
|
894
901
|
{
|
|
895
902
|
type: "button",
|
|
896
|
-
onClick: () =>
|
|
903
|
+
onClick: () => xe.mutate({ id: n.id, emoji: M.emoji }),
|
|
897
904
|
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${M.mine ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-slate-50 text-slate-600 hover:border-slate-300 dark:border-border dark:bg-muted dark:text-slate-300"}`,
|
|
898
905
|
children: [
|
|
899
906
|
M.emoji,
|
|
@@ -907,18 +914,18 @@ function Rt({
|
|
|
907
914
|
"button",
|
|
908
915
|
{
|
|
909
916
|
type: "button",
|
|
910
|
-
onClick: () => he
|
|
917
|
+
onClick: () => be(he === n.id ? null : n.id),
|
|
911
918
|
className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
|
|
912
919
|
"aria-label": "Add reaction",
|
|
913
|
-
children: /* @__PURE__ */ e(
|
|
920
|
+
children: /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" })
|
|
914
921
|
}
|
|
915
922
|
),
|
|
916
|
-
|
|
923
|
+
he === n.id && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: we.map((M) => /* @__PURE__ */ e(
|
|
917
924
|
"button",
|
|
918
925
|
{
|
|
919
926
|
type: "button",
|
|
920
927
|
onClick: () => {
|
|
921
|
-
|
|
928
|
+
xe.mutate({ id: n.id, emoji: M }), be(null);
|
|
922
929
|
},
|
|
923
930
|
className: "rounded-full px-1 text-[14px] hover:bg-muted",
|
|
924
931
|
children: M
|
|
@@ -928,7 +935,7 @@ function Rt({
|
|
|
928
935
|
] })
|
|
929
936
|
] })
|
|
930
937
|
] })
|
|
931
|
-
] },
|
|
938
|
+
] }, n.id);
|
|
932
939
|
}) })
|
|
933
940
|
] }) })
|
|
934
941
|
]
|
|
@@ -937,7 +944,7 @@ function Rt({
|
|
|
937
944
|
);
|
|
938
945
|
}
|
|
939
946
|
export {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
947
|
+
Mt as CommentPanel,
|
|
948
|
+
re as MentionTextarea,
|
|
949
|
+
dt as notePreviewText
|
|
943
950
|
};
|