@nivaro/react 0.3.128 โ 0.3.130
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/components/slots/CommentsSlot.js +124 -95
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/CollectionBrowserView.js +3042 -3038
- package/dist/shared/components/ItemEditForm.js +2187 -2158
- package/dist/shared/components/ai/AiMarkdown.js +215 -196
- package/dist/shared/components/item-edit/HeaderTools.js +216 -210
- package/dist/shared/components/layout-editor/outputs/output-api.js +6 -1
- package/dist/shared/components/panels/CommentPanel.js +345 -327
- package/dist/shared/components/support/TicketDetailSheet.js +161 -139
- package/dist/shared/components/trackers/MirroredText.js +40 -0
- package/dist/shared/components/trackers/SourceTracker.js +168 -0
- package/dist/shared/components/trackers/TrackerChip.js +71 -0
- package/dist/shared/components/trackers/TrackerLinkPanel.js +1039 -0
- package/dist/shared/components/trackers/TrackerPickers.js +245 -0
- package/dist/shared/components/trackers/tracker-model.js +126 -0
- package/dist/shared/components/trackers/use-tracker-link.js +159 -0
- package/package.json +1 -1
|
@@ -1,64 +1,66 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { MessageSquare as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { toast as
|
|
7
|
-
import { useNivaroClient as le, useItemEditAuth as
|
|
8
|
-
import { useDebounced as
|
|
9
|
-
import { get as
|
|
10
|
-
import { useRepliesWhileTyping as nt, mentionReceiptLine as
|
|
11
|
-
import { stripCommentImages as
|
|
12
|
-
import { useLivePreference as
|
|
13
|
-
import { usePresenceOnlinePoll as
|
|
14
|
-
import { useMyUserId as
|
|
15
|
-
import { invalidateRecordTasks as
|
|
16
|
-
import { useNewSince as
|
|
17
|
-
import { useStartsOpen as
|
|
18
|
-
import { titleCase as
|
|
19
|
-
import { AgentBadge as
|
|
20
|
-
import { AutolinkedText as
|
|
21
|
-
import { InboundRequestPopover as
|
|
22
|
-
import { useFieldComments as
|
|
23
|
-
import { RelativeTime as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
2
|
+
import { useQueryClient as Ee, useQuery as W, useMutation as L } from "@tanstack/react-query";
|
|
3
|
+
import { MessageSquare as ze, ChevronDown as We, ClipboardPlus as Ge, Pencil as He, Trash2 as Je, Check as Te, X as Xe, SmilePlus as qe, BellOff as Ve } from "lucide-react";
|
|
4
|
+
import { useState as S, useRef as te, useEffect as De, useMemo as z } from "react";
|
|
5
|
+
import { createPortal as Ze } from "react-dom";
|
|
6
|
+
import { toast as F } from "sonner";
|
|
7
|
+
import { useNivaroClient as le, useItemEditAuth as Ye, useDrilldown as et } from "../../context.js";
|
|
8
|
+
import { useDebounced as tt } from "../../hooks/useDebounced.js";
|
|
9
|
+
import { get as G, post as K, patch as at, del as rt } from "../../lib/commands.js";
|
|
10
|
+
import { useRepliesWhileTyping as nt, mentionReceiptLine as st, mentionReceiptSummary as ot } from "../../lib/comment-awareness.js";
|
|
11
|
+
import { stripCommentImages as lt } from "../../lib/comment-images.js";
|
|
12
|
+
import { useLivePreference as it } from "../../lib/live-preference.js";
|
|
13
|
+
import { usePresenceOnlinePoll as dt } from "../../lib/presence-live.js";
|
|
14
|
+
import { useMyUserId as ct, useNoteTypists as mt, useDraftTypingSignal as pt, signalSentence as ut } from "../../lib/presence-signals.js";
|
|
15
|
+
import { invalidateRecordTasks as xt } from "../../lib/record-tasks.js";
|
|
16
|
+
import { useNewSince as ht } from "../../lib/seen-since.js";
|
|
17
|
+
import { useStartsOpen as bt } from "../../lib/use-starts-open.js";
|
|
18
|
+
import { titleCase as ve, formatDateTime as ie, formatRelative as Ie, cn as ke } from "../../lib/utils.js";
|
|
19
|
+
import { AgentBadge as ft } from "../AgentBadge.js";
|
|
20
|
+
import { AutolinkedText as Re } from "../AutolinkedText.js";
|
|
21
|
+
import { InboundRequestPopover as gt } from "../integrations/InboundRequest.js";
|
|
22
|
+
import { useFieldComments as yt } from "../item-edit/field-comments-context.js";
|
|
23
|
+
import { RelativeTime as Pe } from "../RelativeTime.js";
|
|
24
|
+
import { GitlabSharedNotice as vt, MirroredAuthor as kt, MirroredBody as Nt, mirroredAuthorName as wt } from "../trackers/MirroredText.js";
|
|
25
|
+
import { useSourceTracker as _t } from "../trackers/use-tracker-link.js";
|
|
26
|
+
import { UserAvatar as Ct } from "../UserAvatar.js";
|
|
27
|
+
import { Avatar as St, AvatarFallback as $t } from "../ui/avatar.js";
|
|
26
28
|
import { Button as Z } from "../ui/button.js";
|
|
27
|
-
import { Separator as
|
|
28
|
-
import { Textarea as
|
|
29
|
-
import { useHoldInPlace as
|
|
30
|
-
import { useCommentImages as
|
|
31
|
-
import { RecordEventPathSheet as
|
|
32
|
-
import { NewSinceChip as
|
|
33
|
-
const
|
|
34
|
-
function
|
|
29
|
+
import { Separator as Ne } from "../ui/separator.js";
|
|
30
|
+
import { Textarea as Et } from "../ui/textarea.js";
|
|
31
|
+
import { useHoldInPlace as Tt, RepliesWhileTyping as qt, jumpToComment as Dt, SeenByLine as It, MentionDeliveryButton as Rt } from "./CommentAwareness.js";
|
|
32
|
+
import { useCommentImages as Pt, CommentImageStrip as Mt, CommentBody as Ft, imageDropProps as Ot } from "./CommentImages.js";
|
|
33
|
+
import { RecordEventPathSheet as jt } from "./IntegrationActivitySection.js";
|
|
34
|
+
import { NewSinceChip as Lt } from "./NewSinceChip.js";
|
|
35
|
+
const Me = ["๐", "โ
", "๐", "๐", "โค๏ธ", "๐"];
|
|
36
|
+
function At(e) {
|
|
35
37
|
var x, b, f, c;
|
|
36
38
|
return [(x = e.first_name) == null ? void 0 : x[0], (b = e.last_name) == null ? void 0 : b[0]].filter(Boolean).join("").toUpperCase() || ((c = (f = e.email) == null ? void 0 : f[0]) == null ? void 0 : c.toUpperCase()) || "?";
|
|
37
39
|
}
|
|
38
|
-
const
|
|
40
|
+
const we = {
|
|
39
41
|
ok: "text-emerald-700 dark:text-emerald-400",
|
|
40
42
|
neutral: "text-slate-500 dark:text-slate-400",
|
|
41
43
|
warn: "text-amber-700 dark:text-amber-400"
|
|
42
44
|
};
|
|
43
|
-
function
|
|
44
|
-
return e === "ok" ? /* @__PURE__ */ t(
|
|
45
|
+
function _e({ tone: e }) {
|
|
46
|
+
return e === "ok" ? /* @__PURE__ */ t(Te, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : e === "warn" ? /* @__PURE__ */ t(Ve, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : null;
|
|
45
47
|
}
|
|
46
48
|
function oe(e) {
|
|
47
49
|
return (e.mentions ?? []).filter(
|
|
48
|
-
(
|
|
50
|
+
(o) => {
|
|
49
51
|
var x;
|
|
50
|
-
return
|
|
52
|
+
return o.id && String(o.id).toUpperCase() !== String(((x = e.user) == null ? void 0 : x.id) ?? "").toUpperCase();
|
|
51
53
|
}
|
|
52
54
|
);
|
|
53
55
|
}
|
|
54
|
-
function
|
|
56
|
+
function Bt({
|
|
55
57
|
comment: e,
|
|
56
|
-
collection:
|
|
58
|
+
collection: o,
|
|
57
59
|
item: x
|
|
58
60
|
}) {
|
|
59
|
-
const b =
|
|
61
|
+
const b = it(), f = oe(e);
|
|
60
62
|
if (f.length === 0) return null;
|
|
61
|
-
const c = f.map((d) => ({ m: d, ...
|
|
63
|
+
const c = f.map((d) => ({ m: d, ...st(d, Ie) })), m = ot(f);
|
|
62
64
|
return /* @__PURE__ */ s(
|
|
63
65
|
"p",
|
|
64
66
|
{
|
|
@@ -74,9 +76,9 @@ function Ft({
|
|
|
74
76
|
"data-mention-receipts-summary": !0,
|
|
75
77
|
"data-tip": c.map((d) => d.text).join(" ยท "),
|
|
76
78
|
"aria-label": c.map((d) => d.text).join(". "),
|
|
77
|
-
className:
|
|
79
|
+
className: ke("inline-flex items-center gap-1 rounded", we[m.tone]),
|
|
78
80
|
children: [
|
|
79
|
-
/* @__PURE__ */ t(
|
|
81
|
+
/* @__PURE__ */ t(_e, { tone: m.tone }),
|
|
80
82
|
m.text
|
|
81
83
|
]
|
|
82
84
|
}
|
|
@@ -87,15 +89,15 @@ function Ft({
|
|
|
87
89
|
"data-mention-seen": N === "ok" ? "seen" : "unseen",
|
|
88
90
|
"data-mention-status": d.status ?? void 0,
|
|
89
91
|
"data-tip": d.seen_at ? `Seen ${ie(d.seen_at)}` : void 0,
|
|
90
|
-
className:
|
|
92
|
+
className: ke("inline-flex items-center gap-1", we[N]),
|
|
91
93
|
children: [
|
|
92
|
-
/* @__PURE__ */ t(
|
|
94
|
+
/* @__PURE__ */ t(_e, { tone: N }),
|
|
93
95
|
k
|
|
94
96
|
]
|
|
95
97
|
},
|
|
96
98
|
d.id
|
|
97
99
|
)),
|
|
98
|
-
e.delivery_visible && /* @__PURE__ */ t(
|
|
100
|
+
e.delivery_visible && /* @__PURE__ */ t(Rt, { collection: o, item: x, commentId: e.id })
|
|
99
101
|
]
|
|
100
102
|
}
|
|
101
103
|
);
|
|
@@ -105,18 +107,19 @@ function Fe(e) {
|
|
|
105
107
|
}
|
|
106
108
|
function Y(e) {
|
|
107
109
|
var x;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
if (e.tracker) return wt(e.tracker);
|
|
111
|
+
const o = Fe(e.user);
|
|
112
|
+
return (x = e.acting_admin) != null && x.name ? `${e.acting_admin.name} as ${o}` : o;
|
|
110
113
|
}
|
|
111
|
-
function
|
|
114
|
+
function Kt({
|
|
112
115
|
field: e,
|
|
113
|
-
label:
|
|
116
|
+
label: o,
|
|
114
117
|
resolved: x,
|
|
115
118
|
onJump: b
|
|
116
119
|
}) {
|
|
117
120
|
const f = /* @__PURE__ */ s(ee, { children: [
|
|
118
121
|
"on ",
|
|
119
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
122
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: o }),
|
|
120
123
|
x && /* @__PURE__ */ t("span", { className: "text-slate-400 dark:text-slate-500", children: " ยท resolved" })
|
|
121
124
|
] }), c = "inline-flex min-w-0 max-w-[220px] items-center gap-1 truncate rounded-full border border-slate-200 bg-slate-50 px-1.5 py-px text-[10.5px] text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300";
|
|
122
125
|
return b ? /* @__PURE__ */ t(
|
|
@@ -125,129 +128,129 @@ function Mt({
|
|
|
125
128
|
type: "button",
|
|
126
129
|
"data-comment-field": e,
|
|
127
130
|
onClick: b,
|
|
128
|
-
"data-tip": `Go to ${
|
|
131
|
+
"data-tip": `Go to ${o}`,
|
|
129
132
|
className: `${c} transition-colors hover:border-nvr-cyan/50 hover:text-[#0e7490] dark:hover:text-nvr-cyan`,
|
|
130
133
|
children: f
|
|
131
134
|
}
|
|
132
135
|
) : /* @__PURE__ */ t("span", { "data-comment-field": e, className: c, children: f });
|
|
133
136
|
}
|
|
134
|
-
function
|
|
135
|
-
const b = e.slice(0,
|
|
136
|
-
return b ? { start:
|
|
137
|
+
function Qt(e, o) {
|
|
138
|
+
const b = e.slice(0, o).match(/(^|\s)@([a-zA-Z0-9._-]{2,})$/);
|
|
139
|
+
return b ? { start: o - b[2].length - 1, query: b[2] } : null;
|
|
137
140
|
}
|
|
138
|
-
function
|
|
141
|
+
function Ce(e) {
|
|
139
142
|
return e.email.split("@")[0];
|
|
140
143
|
}
|
|
141
144
|
function se({
|
|
142
145
|
value: e,
|
|
143
|
-
onChange:
|
|
146
|
+
onChange: o,
|
|
144
147
|
onImages: x,
|
|
145
148
|
...b
|
|
146
149
|
}) {
|
|
147
|
-
const f = le(), c = te(null), [m, d] =
|
|
150
|
+
const f = le(), c = te(null), [m, d] = S(null), [k, N] = S(0), y = tt((m == null ? void 0 : m.query) ?? "", 200), { data: $ = [] } = W({
|
|
148
151
|
queryKey: ["users", "mention-search", y],
|
|
149
152
|
queryFn: () => f.request(
|
|
150
|
-
|
|
151
|
-
).then((
|
|
153
|
+
G("/users", { limit: 8, sort: "first_name", search: y })
|
|
154
|
+
).then((n) => n.data),
|
|
152
155
|
enabled: !!m && y.length >= 2,
|
|
153
156
|
staleTime: 3e4
|
|
154
|
-
}), q =
|
|
157
|
+
}), q = dt(15e3, !!m), { data: I } = W({
|
|
155
158
|
queryKey: ["presence-online"],
|
|
156
159
|
queryFn: () => f.request(
|
|
157
|
-
|
|
160
|
+
G("/presence/online")
|
|
158
161
|
),
|
|
159
162
|
enabled: !!m,
|
|
160
163
|
refetchInterval: q,
|
|
161
164
|
staleTime: 5e3
|
|
162
|
-
}), p = (
|
|
165
|
+
}), p = (n) => {
|
|
163
166
|
var u;
|
|
164
|
-
const i = (u = I == null ? void 0 : I.data) == null ? void 0 : u.find((
|
|
167
|
+
const i = (u = I == null ? void 0 : I.data) == null ? void 0 : u.find((C) => String(C.user_id).toUpperCase() === n.toUpperCase());
|
|
165
168
|
return i ? i.is_idle || i.away ? 1 : 0 : 2;
|
|
166
|
-
}, w =
|
|
169
|
+
}, w = $, { data: T = [] } = W({
|
|
167
170
|
queryKey: ["mention-roles"],
|
|
168
|
-
queryFn: () => f.request(
|
|
171
|
+
queryFn: () => f.request(G("/chat/roles")).then((n) => n.data).catch(() => []),
|
|
169
172
|
enabled: !!m,
|
|
170
173
|
staleTime: 5 * 6e4
|
|
171
|
-
}),
|
|
172
|
-
(
|
|
173
|
-
).slice(0, 3) : [], _ = !!m && y.length >= 2 && "owners".startsWith(y.toLowerCase()),
|
|
174
|
-
|
|
175
|
-
if (!
|
|
176
|
-
|
|
174
|
+
}), E = m ? T.filter(
|
|
175
|
+
(n) => n.name.toLowerCase().replace(/\s+/g, "-").startsWith(y.toLowerCase())
|
|
176
|
+
).slice(0, 3) : [], _ = !!m && y.length >= 2 && "owners".startsWith(y.toLowerCase()), l = !!m && y.length >= 2 && (w.length > 0 || _ || E.length > 0), v = w.length + (_ ? 1 : 0) + E.length, [P, H] = S(null), A = te(null);
|
|
177
|
+
De(() => {
|
|
178
|
+
if (!l || !c.current) {
|
|
179
|
+
H(null);
|
|
177
180
|
return;
|
|
178
181
|
}
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
const i = (
|
|
182
|
-
var
|
|
183
|
-
(
|
|
182
|
+
const n = c.current.getBoundingClientRect();
|
|
183
|
+
H({ top: n.bottom + 4, left: n.left, width: Math.min(n.width, 360) });
|
|
184
|
+
const i = (C) => {
|
|
185
|
+
var g;
|
|
186
|
+
(g = A.current) != null && g.contains(C.target) || d(null);
|
|
184
187
|
}, u = () => d(null);
|
|
185
188
|
return window.addEventListener("scroll", i, !0), window.addEventListener("resize", u), () => {
|
|
186
189
|
window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", u);
|
|
187
190
|
};
|
|
188
|
-
}, [
|
|
189
|
-
function Q(
|
|
190
|
-
const i =
|
|
191
|
+
}, [l]);
|
|
192
|
+
function Q(n) {
|
|
193
|
+
const i = Qt(n.value, n.selectionStart ?? n.value.length);
|
|
191
194
|
d(i), i || N(0);
|
|
192
195
|
}
|
|
193
|
-
function R(
|
|
196
|
+
function R(n) {
|
|
194
197
|
if (!m || !c.current) return;
|
|
195
|
-
const i = c.current.selectionStart ?? e.length, u =
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
+
const i = c.current.selectionStart ?? e.length, u = n === "__owners__" ? "@owners " : typeof n == "object" && "role" in n ? `@${n.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${Ce(n)} `, C = e.slice(0, m.start) + u + e.slice(i);
|
|
199
|
+
o(C), d(null), N(0);
|
|
200
|
+
const g = m.start + u.length;
|
|
198
201
|
requestAnimationFrame(() => {
|
|
199
|
-
var O,
|
|
200
|
-
(O = c.current) == null || O.focus(), (
|
|
202
|
+
var O, B;
|
|
203
|
+
(O = c.current) == null || O.focus(), (B = c.current) == null || B.setSelectionRange(g, g);
|
|
201
204
|
});
|
|
202
205
|
}
|
|
203
|
-
function U(
|
|
204
|
-
if (
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
else if (
|
|
208
|
-
|
|
209
|
-
else if (
|
|
210
|
-
|
|
211
|
-
const i = Math.min(k, v - 1), u = _ ? 1 : 0,
|
|
206
|
+
function U(n) {
|
|
207
|
+
if (l)
|
|
208
|
+
if (n.key === "ArrowDown")
|
|
209
|
+
n.preventDefault(), N((i) => (i + 1) % v);
|
|
210
|
+
else if (n.key === "ArrowUp")
|
|
211
|
+
n.preventDefault(), N((i) => (i - 1 + v) % v);
|
|
212
|
+
else if (n.key === "Enter" || n.key === "Tab") {
|
|
213
|
+
n.preventDefault();
|
|
214
|
+
const i = Math.min(k, v - 1), u = _ ? 1 : 0, C = u + w.length;
|
|
212
215
|
if (_ && i === 0) R("__owners__");
|
|
213
|
-
else if (i >=
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
+
else if (i >= C) {
|
|
217
|
+
const g = E[i - C];
|
|
218
|
+
g && R({ role: g.name });
|
|
216
219
|
} else R(w[i - u]);
|
|
217
|
-
} else
|
|
220
|
+
} else n.key === "Escape" && (n.preventDefault(), d(null));
|
|
218
221
|
}
|
|
219
222
|
return /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
220
223
|
/* @__PURE__ */ t(
|
|
221
|
-
|
|
224
|
+
Et,
|
|
222
225
|
{
|
|
223
226
|
...b,
|
|
224
|
-
...x ?
|
|
227
|
+
...x ? Ot(x) : {},
|
|
225
228
|
ref: c,
|
|
226
229
|
value: e,
|
|
227
|
-
onChange: (
|
|
228
|
-
|
|
230
|
+
onChange: (n) => {
|
|
231
|
+
o(n.target.value), Q(n.target);
|
|
229
232
|
},
|
|
230
233
|
onKeyDown: U,
|
|
231
|
-
onClick: (
|
|
234
|
+
onClick: (n) => Q(n.currentTarget),
|
|
232
235
|
onBlur: () => setTimeout(() => d(null), 150)
|
|
233
236
|
}
|
|
234
237
|
),
|
|
235
|
-
|
|
238
|
+
l && P && Ze(
|
|
236
239
|
/* @__PURE__ */ s(
|
|
237
240
|
"div",
|
|
238
241
|
{
|
|
239
|
-
ref:
|
|
242
|
+
ref: A,
|
|
240
243
|
"data-mention-menu": "",
|
|
241
244
|
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",
|
|
242
245
|
style: { top: P.top, left: P.left, width: P.width },
|
|
243
|
-
onMouseDown: (
|
|
246
|
+
onMouseDown: (n) => n.preventDefault(),
|
|
244
247
|
children: [
|
|
245
248
|
_ && /* @__PURE__ */ s(
|
|
246
249
|
"button",
|
|
247
250
|
{
|
|
248
251
|
type: "button",
|
|
249
|
-
onMouseDown: (
|
|
250
|
-
|
|
252
|
+
onMouseDown: (n) => {
|
|
253
|
+
n.preventDefault(), R("__owners__");
|
|
251
254
|
},
|
|
252
255
|
onMouseEnter: () => N(0),
|
|
253
256
|
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${k === 0 ? "bg-nvr-cyan/10" : ""}`,
|
|
@@ -260,70 +263,70 @@ function se({
|
|
|
260
263
|
]
|
|
261
264
|
}
|
|
262
265
|
),
|
|
263
|
-
w.map((
|
|
264
|
-
var
|
|
265
|
-
const u = _ ? i + 1 : i,
|
|
266
|
+
w.map((n, i) => {
|
|
267
|
+
var g, O;
|
|
268
|
+
const u = _ ? i + 1 : i, C = [n.first_name, n.last_name].filter(Boolean).join(" ") || n.email;
|
|
266
269
|
return /* @__PURE__ */ s(
|
|
267
270
|
"button",
|
|
268
271
|
{
|
|
269
272
|
type: "button",
|
|
270
|
-
onMouseDown: (
|
|
271
|
-
|
|
273
|
+
onMouseDown: (B) => {
|
|
274
|
+
B.preventDefault(), R(n);
|
|
272
275
|
},
|
|
273
276
|
onMouseEnter: () => N(u),
|
|
274
277
|
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${u === k ? "bg-nvr-cyan/10" : ""}`,
|
|
275
278
|
children: [
|
|
276
279
|
/* @__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: [
|
|
277
|
-
(`${((
|
|
278
|
-
p(
|
|
280
|
+
(`${((g = n.first_name) == null ? void 0 : g[0]) ?? ""}${((O = n.last_name) == null ? void 0 : O[0]) ?? ""}`.trim() || n.email[0]).toUpperCase(),
|
|
281
|
+
p(n.id) < 2 && /* @__PURE__ */ t(
|
|
279
282
|
"span",
|
|
280
283
|
{
|
|
281
|
-
"data-mention-presence": p(
|
|
282
|
-
title: p(
|
|
283
|
-
className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${p(
|
|
284
|
+
"data-mention-presence": p(n.id) === 0 ? "online" : "idle",
|
|
285
|
+
title: p(n.id) === 0 ? "Online" : "Idle",
|
|
286
|
+
className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${p(n.id) === 0 ? "bg-emerald-500" : "border border-amber-500 bg-white dark:bg-popover"}`
|
|
284
287
|
}
|
|
285
288
|
)
|
|
286
289
|
] }),
|
|
287
290
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
288
|
-
/* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children:
|
|
291
|
+
/* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: C }),
|
|
289
292
|
/* @__PURE__ */ s("span", { className: "block truncate text-[11px] text-slate-400", children: [
|
|
290
|
-
|
|
293
|
+
n.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: [
|
|
291
294
|
"OOO",
|
|
292
|
-
|
|
295
|
+
n.ooo_end ? ` until ${String(n.ooo_end).slice(0, 10)}` : ""
|
|
293
296
|
] }),
|
|
294
297
|
"@",
|
|
295
|
-
|
|
296
|
-
(
|
|
298
|
+
Ce(n),
|
|
299
|
+
(n.title || n.department) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-slate-500", children: [
|
|
297
300
|
" ยท ",
|
|
298
|
-
[
|
|
301
|
+
[n.title, n.department].filter(Boolean).join(", ")
|
|
299
302
|
] })
|
|
300
303
|
] })
|
|
301
304
|
] })
|
|
302
305
|
]
|
|
303
306
|
},
|
|
304
|
-
|
|
307
|
+
n.id
|
|
305
308
|
);
|
|
306
309
|
}),
|
|
307
|
-
|
|
310
|
+
E.map((n, i) => {
|
|
308
311
|
const u = w.length + (_ ? 1 : 0) + i;
|
|
309
312
|
return /* @__PURE__ */ s(
|
|
310
313
|
"button",
|
|
311
314
|
{
|
|
312
315
|
type: "button",
|
|
313
|
-
onMouseDown: (
|
|
314
|
-
|
|
316
|
+
onMouseDown: (C) => {
|
|
317
|
+
C.preventDefault(), R({ role: n.name });
|
|
315
318
|
},
|
|
316
319
|
onMouseEnter: () => N(u),
|
|
317
320
|
className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${u === k ? "bg-nvr-cyan/10" : ""}`,
|
|
318
321
|
children: [
|
|
319
322
|
/* @__PURE__ */ t("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" }),
|
|
320
323
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
321
|
-
/* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children:
|
|
324
|
+
/* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: n.name }),
|
|
322
325
|
/* @__PURE__ */ t("span", { className: "block text-[11px] text-slate-400", children: "Role โ notifies every member" })
|
|
323
326
|
] })
|
|
324
327
|
]
|
|
325
328
|
},
|
|
326
|
-
`role-${
|
|
329
|
+
`role-${n.id}`
|
|
327
330
|
);
|
|
328
331
|
})
|
|
329
332
|
]
|
|
@@ -333,7 +336,7 @@ function se({
|
|
|
333
336
|
)
|
|
334
337
|
] });
|
|
335
338
|
}
|
|
336
|
-
function
|
|
339
|
+
function Se(e) {
|
|
337
340
|
if (e.kind === "comment") return "people";
|
|
338
341
|
switch (e.note.source) {
|
|
339
342
|
case "note":
|
|
@@ -345,56 +348,56 @@ function Ce(e) {
|
|
|
345
348
|
return "system";
|
|
346
349
|
}
|
|
347
350
|
}
|
|
348
|
-
const
|
|
351
|
+
const Ut = {
|
|
349
352
|
people: "People",
|
|
350
353
|
system: "System",
|
|
351
354
|
integration: "Integration"
|
|
352
355
|
};
|
|
353
|
-
function
|
|
354
|
-
const
|
|
355
|
-
return (e.kind === "comment" ?
|
|
356
|
+
function $e(e) {
|
|
357
|
+
const o = e.kind === "comment" ? e.comment.text : e.note.text;
|
|
358
|
+
return (e.kind === "comment" ? lt(o).replace(/<[^>]*>/g, " ") : o).replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
|
|
356
359
|
}
|
|
357
|
-
const
|
|
358
|
-
function
|
|
360
|
+
const zt = "integrations:";
|
|
361
|
+
function Wt({
|
|
359
362
|
note: e,
|
|
360
|
-
collection:
|
|
363
|
+
collection: o,
|
|
361
364
|
item: x
|
|
362
365
|
}) {
|
|
363
366
|
var _;
|
|
364
|
-
const b =
|
|
365
|
-
mutationFn: (
|
|
367
|
+
const b = et(), [f, c] = S(!1), m = e.source === "external" && !!e.provider && !e.provider.startsWith(zt), d = le(), k = Ee(), [N, y] = S(!1), $ = L({
|
|
368
|
+
mutationFn: (l) => d.request(K(`/comments/${e.comment_id}/reactions`, { emoji: l })),
|
|
366
369
|
onSuccess: () => {
|
|
367
370
|
y(!1), k.invalidateQueries({ queryKey: ["comments-related"] }), k.invalidateQueries({ queryKey: ["row-comment-counts"] });
|
|
368
371
|
},
|
|
369
|
-
onError: () =>
|
|
370
|
-
}), [q, I] =
|
|
372
|
+
onError: () => F.error("Failed to react")
|
|
373
|
+
}), [q, I] = S(!1), p = L({
|
|
371
374
|
mutationFn: () => d.request(
|
|
372
375
|
K(`/integration-events/${encodeURIComponent(e.provider ?? "")}/replay`, {
|
|
373
376
|
entry_id: e.id.replace(/^external:/, "")
|
|
374
377
|
})
|
|
375
378
|
),
|
|
376
|
-
onSuccess: (
|
|
379
|
+
onSuccess: (l) => {
|
|
377
380
|
var v;
|
|
378
|
-
I(!1),
|
|
379
|
-
description: (v =
|
|
381
|
+
I(!1), F.success("Event replayed", {
|
|
382
|
+
description: (v = l == null ? void 0 : l.data) == null ? void 0 : v.detail
|
|
380
383
|
}), k.invalidateQueries({ queryKey: ["comments-related"] });
|
|
381
384
|
},
|
|
382
|
-
onError: (
|
|
385
|
+
onError: (l) => {
|
|
383
386
|
var P;
|
|
384
387
|
I(!1);
|
|
385
|
-
const v = (P =
|
|
386
|
-
|
|
388
|
+
const v = (P = l == null ? void 0 : l.response) == null ? void 0 : P.error;
|
|
389
|
+
F.error(v ?? (l == null ? void 0 : l.message) ?? "Replay failed", { duration: 8e3 });
|
|
387
390
|
}
|
|
388
391
|
}), w = e.link ? () => {
|
|
389
|
-
const
|
|
390
|
-
if (!
|
|
391
|
-
const v = document.querySelector(`[data-o2m-row="${
|
|
392
|
+
const l = e.link;
|
|
393
|
+
if (!l) return;
|
|
394
|
+
const v = document.querySelector(`[data-o2m-row="${l.collection}:${l.item_id}"]`);
|
|
392
395
|
if (v) {
|
|
393
396
|
v.scrollIntoView({ behavior: "smooth", block: "center" }), v.classList.add("nvr-row-flash"), setTimeout(() => v.classList.remove("nvr-row-flash"), 2400);
|
|
394
397
|
return;
|
|
395
398
|
}
|
|
396
|
-
b == null || b.open({ collection:
|
|
397
|
-
} : null, T = e.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : e.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" : e.source === "external" || e.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" : e.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",
|
|
399
|
+
b == null || b.open({ collection: l.collection, itemId: l.item_id });
|
|
400
|
+
} : null, T = e.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : e.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" : e.source === "external" || e.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" : e.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", E = e.source === "import" && ((_ = e.import) != null && _.file_id) ? e.import : null;
|
|
398
401
|
return /* @__PURE__ */ s("div", { className: "flex gap-3", "data-recorded-note": e.source, children: [
|
|
399
402
|
/* @__PURE__ */ t("div", { className: "mt-1 h-8 w-8 shrink-0", "aria-hidden": !0 }),
|
|
400
403
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -410,25 +413,25 @@ function At({
|
|
|
410
413
|
"data-line-comment-link": !0,
|
|
411
414
|
children: e.context
|
|
412
415
|
}
|
|
413
|
-
) :
|
|
416
|
+
) : E ? /* @__PURE__ */ t(
|
|
414
417
|
"a",
|
|
415
418
|
{
|
|
416
|
-
href: `/api/files/${
|
|
419
|
+
href: `/api/files/${E.file_id}?download=1`,
|
|
417
420
|
target: "_blank",
|
|
418
421
|
rel: "noreferrer",
|
|
419
|
-
onClick: (
|
|
422
|
+
onClick: (l) => l.stopPropagation(),
|
|
420
423
|
className: "truncate text-[11px] text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
|
|
421
|
-
"data-note-import-file":
|
|
424
|
+
"data-note-import-file": E.file_id ?? void 0,
|
|
422
425
|
children: e.context
|
|
423
426
|
}
|
|
424
427
|
) : /* @__PURE__ */ t("span", { className: "truncate text-[11px] text-slate-400", children: e.context })),
|
|
425
|
-
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", "data-tip": ie(e.created_at), children: /* @__PURE__ */ t(
|
|
428
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", "data-tip": ie(e.created_at), children: /* @__PURE__ */ t(Pe, { value: e.created_at }) }),
|
|
426
429
|
e.source === "inbound" && e.inbound && /* @__PURE__ */ t(
|
|
427
|
-
|
|
430
|
+
gt,
|
|
428
431
|
{
|
|
429
432
|
activityId: e.inbound.activity_id,
|
|
430
433
|
callerName: e.label,
|
|
431
|
-
collection:
|
|
434
|
+
collection: o,
|
|
432
435
|
itemId: x,
|
|
433
436
|
align: "end",
|
|
434
437
|
children: /* @__PURE__ */ t(
|
|
@@ -469,52 +472,52 @@ function At({
|
|
|
469
472
|
}
|
|
470
473
|
)
|
|
471
474
|
] }),
|
|
472
|
-
/* @__PURE__ */ t("p", { className: "mt-1 whitespace-pre-wrap break-words text-[13px] leading-snug text-slate-600 dark:text-slate-300", children: /* @__PURE__ */ t(
|
|
475
|
+
/* @__PURE__ */ t("p", { className: "mt-1 whitespace-pre-wrap break-words text-[13px] leading-snug text-slate-600 dark:text-slate-300", children: /* @__PURE__ */ t(Re, { text: e.text }) }),
|
|
473
476
|
e.comment_id && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
|
|
474
|
-
(e.reactions ?? []).map((
|
|
477
|
+
(e.reactions ?? []).map((l) => /* @__PURE__ */ s(
|
|
475
478
|
"button",
|
|
476
479
|
{
|
|
477
480
|
type: "button",
|
|
478
|
-
onClick: () =>
|
|
479
|
-
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${
|
|
481
|
+
onClick: () => $.mutate(l.emoji),
|
|
482
|
+
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${l.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"}`,
|
|
480
483
|
children: [
|
|
481
|
-
|
|
482
|
-
/* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] font-semibold", children:
|
|
484
|
+
l.emoji,
|
|
485
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] font-semibold", children: l.count })
|
|
483
486
|
]
|
|
484
487
|
},
|
|
485
|
-
|
|
488
|
+
l.emoji
|
|
486
489
|
)),
|
|
487
490
|
/* @__PURE__ */ s("span", { className: "relative", children: [
|
|
488
491
|
/* @__PURE__ */ t(
|
|
489
492
|
"button",
|
|
490
493
|
{
|
|
491
494
|
type: "button",
|
|
492
|
-
onClick: () => y((
|
|
495
|
+
onClick: () => y((l) => !l),
|
|
493
496
|
className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
|
|
494
497
|
"aria-label": "Add reaction",
|
|
495
|
-
children: /* @__PURE__ */ t(
|
|
498
|
+
children: /* @__PURE__ */ t(qe, { className: "h-3.5 w-3.5" })
|
|
496
499
|
}
|
|
497
500
|
),
|
|
498
|
-
N && /* @__PURE__ */ t("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:
|
|
501
|
+
N && /* @__PURE__ */ t("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: Me.map((l) => /* @__PURE__ */ t(
|
|
499
502
|
"button",
|
|
500
503
|
{
|
|
501
504
|
type: "button",
|
|
502
|
-
onClick: () =>
|
|
505
|
+
onClick: () => $.mutate(l),
|
|
503
506
|
className: "rounded-full px-1 text-[14px] hover:bg-muted",
|
|
504
|
-
children:
|
|
507
|
+
children: l
|
|
505
508
|
},
|
|
506
|
-
|
|
509
|
+
l
|
|
507
510
|
)) })
|
|
508
511
|
] })
|
|
509
512
|
] })
|
|
510
513
|
] }),
|
|
511
514
|
m && e.provider && /* @__PURE__ */ t(
|
|
512
|
-
|
|
515
|
+
jt,
|
|
513
516
|
{
|
|
514
517
|
target: f ? {
|
|
515
518
|
source: e.provider,
|
|
516
519
|
id: e.id.replace(/^external:/, ""),
|
|
517
|
-
record: { collection:
|
|
520
|
+
record: { collection: o, item: x }
|
|
518
521
|
} : null,
|
|
519
522
|
event: { label: e.label },
|
|
520
523
|
onClose: () => c(!1)
|
|
@@ -522,117 +525,119 @@ function At({
|
|
|
522
525
|
)
|
|
523
526
|
] });
|
|
524
527
|
}
|
|
525
|
-
function
|
|
528
|
+
function $a({
|
|
526
529
|
collection: e,
|
|
527
|
-
item:
|
|
530
|
+
item: o,
|
|
528
531
|
title: x,
|
|
529
532
|
defaultExpanded: b,
|
|
530
533
|
queuedComments: f,
|
|
531
534
|
onQueueComment: c,
|
|
532
535
|
onUnsentDraft: m
|
|
533
536
|
}) {
|
|
534
|
-
const d = le(), { userId: k } =
|
|
535
|
-
|
|
536
|
-
var
|
|
537
|
-
(
|
|
537
|
+
const d = le(), { userId: k } = Ye(), N = ct(), y = Ee(), $ = yt(), [q, I] = bt(b, !1), [p, w] = S(""), T = Pt(), E = te(m);
|
|
538
|
+
E.current = m, De(() => {
|
|
539
|
+
var r;
|
|
540
|
+
(r = E.current) == null || r.call(E, p);
|
|
538
541
|
}, [p]);
|
|
539
|
-
const [_,
|
|
540
|
-
var
|
|
542
|
+
const [_, l] = S(!1), v = async () => {
|
|
543
|
+
var r;
|
|
541
544
|
if (!(!p.trim() || _)) {
|
|
542
|
-
|
|
545
|
+
l(!0);
|
|
543
546
|
try {
|
|
544
547
|
const a = await d.request(
|
|
545
548
|
K("/ai/cleanup", { text: p })
|
|
546
549
|
);
|
|
547
|
-
(
|
|
550
|
+
(r = a.data) != null && r.text && w(a.data.text);
|
|
548
551
|
} catch {
|
|
549
552
|
} finally {
|
|
550
|
-
|
|
553
|
+
l(!1);
|
|
551
554
|
}
|
|
552
555
|
}
|
|
553
|
-
}, P =
|
|
554
|
-
|
|
555
|
-
const [
|
|
556
|
+
}, P = mt(e, o);
|
|
557
|
+
pt(e, o, p);
|
|
558
|
+
const [H, A] = S(null), [Q, R] = S(null), [U, n] = S(""), i = !o || o === "new", u = ["comments", e, String(o)], C = _t(i ? null : { kind: "record", id: `${e}:${o}` }, {
|
|
559
|
+
mayCreate: !1
|
|
560
|
+
}), { data: g, isLoading: O, isError: B } = W({
|
|
556
561
|
queryKey: u,
|
|
557
|
-
queryFn: () => d.request(
|
|
562
|
+
queryFn: () => d.request(G("/comments", { collection: e, item: o })).then((r) => r.data),
|
|
558
563
|
enabled: !i
|
|
559
|
-
}),
|
|
560
|
-
|
|
561
|
-
const { data:
|
|
562
|
-
queryKey: ["comments-related", e, String(
|
|
563
|
-
queryFn: () => d.request(
|
|
564
|
+
}), de = z(() => (g ?? []).filter((r) => !r.deleted), [g]), J = nt(p, g, k || N), ce = te(null);
|
|
565
|
+
Tt(ce, J.replies.length);
|
|
566
|
+
const { data: Oe } = W({
|
|
567
|
+
queryKey: ["comments-related", e, String(o)],
|
|
568
|
+
queryFn: () => d.request(G("/comments/related", { collection: e, item: o })).then((r) => r.data ?? []).catch(() => []),
|
|
564
569
|
enabled: !i,
|
|
565
570
|
staleTime: 3e4
|
|
566
|
-
}),
|
|
567
|
-
const
|
|
568
|
-
return [...
|
|
569
|
-
}, [
|
|
570
|
-
const
|
|
571
|
-
for (const a of
|
|
572
|
-
return
|
|
573
|
-
}, [
|
|
574
|
-
() => (g ?? []).map((
|
|
571
|
+
}), me = Oe ?? [], M = z(() => {
|
|
572
|
+
const r = de.map((h) => ({ kind: "comment", at: h.created_at, comment: h })), a = me.map((h) => ({ kind: "related", at: h.created_at, note: h }));
|
|
573
|
+
return [...r, ...a].sort((h, j) => new Date(j.at).getTime() - new Date(h.at).getTime());
|
|
574
|
+
}, [de, me]), [X, je] = S(() => /* @__PURE__ */ new Set()), [V, Le] = S(""), pe = z(() => {
|
|
575
|
+
const r = { people: 0, system: 0, integration: 0 };
|
|
576
|
+
for (const a of M) r[Se(a)]++;
|
|
577
|
+
return r;
|
|
578
|
+
}, [M]), ue = i ? (f ?? []).length : pe.people, Ae = z(
|
|
579
|
+
() => (g ?? []).map((r) => {
|
|
575
580
|
var a;
|
|
576
|
-
return { at:
|
|
581
|
+
return { at: r.created_at, by: ((a = r.user) == null ? void 0 : a.id) ?? null };
|
|
577
582
|
}),
|
|
578
583
|
[g]
|
|
579
|
-
),
|
|
584
|
+
), Be = ht({
|
|
580
585
|
userId: k,
|
|
581
586
|
collection: e,
|
|
582
|
-
item:
|
|
587
|
+
item: o,
|
|
583
588
|
tab: "comments",
|
|
584
589
|
open: q,
|
|
585
|
-
entries:
|
|
590
|
+
entries: Ae,
|
|
586
591
|
ready: !i && !!g
|
|
587
592
|
}), ae = z(() => {
|
|
588
|
-
const
|
|
589
|
-
return
|
|
590
|
-
}, [
|
|
593
|
+
const r = V.trim().toLowerCase();
|
|
594
|
+
return M.filter((a) => X.has(Se(a)) ? !1 : r ? (a.kind === "comment" ? `${a.comment.text} ${Fe(a.comment.user)}` : `${a.note.text} ${a.note.user_name ?? ""} ${a.note.label} ${a.note.context ?? ""} ${a.note.provider ?? ""}`).toLowerCase().includes(r) : !0);
|
|
595
|
+
}, [M, X, V]), Ke = (r) => je((a) => {
|
|
591
596
|
const h = new Set(a);
|
|
592
|
-
return h.has(
|
|
593
|
-
}),
|
|
594
|
-
mutationFn: (
|
|
597
|
+
return h.has(r) ? h.delete(r) : h.add(r), h;
|
|
598
|
+
}), Qe = X.size > 0 || V.trim() !== "", re = L({
|
|
599
|
+
mutationFn: (r) => d.request(K("/comments", { collection: e, item: o, text: r })),
|
|
595
600
|
onSuccess: () => {
|
|
596
601
|
y.invalidateQueries({ queryKey: u }), w(""), T.reset();
|
|
597
602
|
},
|
|
598
|
-
onError: () =>
|
|
599
|
-
}),
|
|
600
|
-
mutationFn: ({ id:
|
|
603
|
+
onError: () => F.error("Failed to post comment")
|
|
604
|
+
}), xe = L({
|
|
605
|
+
mutationFn: ({ id: r, text: a }) => d.request(at(`/comments/${r}`, { text: a })),
|
|
601
606
|
onSuccess: () => {
|
|
602
|
-
y.invalidateQueries({ queryKey: u }),
|
|
607
|
+
y.invalidateQueries({ queryKey: u }), A(null), n("");
|
|
603
608
|
},
|
|
604
|
-
onError: () =>
|
|
605
|
-
}),
|
|
606
|
-
mutationFn: (
|
|
609
|
+
onError: () => F.error("Failed to update comment")
|
|
610
|
+
}), ne = L({
|
|
611
|
+
mutationFn: (r) => d.request(rt(`/comments/${r}`)),
|
|
607
612
|
onSuccess: () => y.invalidateQueries({ queryKey: u }),
|
|
608
|
-
onError: () =>
|
|
609
|
-
}),
|
|
610
|
-
mutationFn: ({ id:
|
|
613
|
+
onError: () => F.error("Failed to delete comment")
|
|
614
|
+
}), he = L({
|
|
615
|
+
mutationFn: ({ id: r, emoji: a }) => d.request(K(`/comments/${r}/reactions`, { emoji: a })),
|
|
611
616
|
onSuccess: () => y.invalidateQueries({ queryKey: u }),
|
|
612
|
-
onError: () =>
|
|
613
|
-
}), [
|
|
614
|
-
mutationFn: (
|
|
617
|
+
onError: () => F.error("Failed to react")
|
|
618
|
+
}), [be, fe] = S(null), Ue = L({
|
|
619
|
+
mutationFn: (r) => d.request(
|
|
615
620
|
K("/tasks", {
|
|
616
621
|
collection: e,
|
|
617
|
-
item:
|
|
618
|
-
title:
|
|
622
|
+
item: o,
|
|
623
|
+
title: r.text.replace(/<[^>]*>/g, "").replace(/@\[([^\]]+)\]/g, "@$1").slice(0, 200),
|
|
619
624
|
assignee: k
|
|
620
625
|
})
|
|
621
626
|
),
|
|
622
627
|
onSuccess: () => {
|
|
623
|
-
|
|
628
|
+
xt(y, e, o), F.success("Task created from comment โ assigned to you");
|
|
624
629
|
},
|
|
625
|
-
onError: () =>
|
|
630
|
+
onError: () => F.error("Could not create a task")
|
|
626
631
|
});
|
|
627
|
-
function
|
|
628
|
-
if (
|
|
632
|
+
function ge(r) {
|
|
633
|
+
if (r.preventDefault(), i && c) {
|
|
629
634
|
if (!p.trim()) return;
|
|
630
635
|
c(p.trim()), w("");
|
|
631
636
|
} else {
|
|
632
637
|
if (T.uploading) return;
|
|
633
638
|
const a = T.compose(p);
|
|
634
639
|
if (!a) return;
|
|
635
|
-
|
|
640
|
+
re.mutate(a);
|
|
636
641
|
}
|
|
637
642
|
}
|
|
638
643
|
return (
|
|
@@ -650,44 +655,44 @@ function ya({
|
|
|
650
655
|
{
|
|
651
656
|
type: "button",
|
|
652
657
|
"data-panel-toggle": "notes",
|
|
653
|
-
onClick: () => I((
|
|
658
|
+
onClick: () => I((r) => !r),
|
|
654
659
|
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]",
|
|
655
660
|
children: [
|
|
656
661
|
/* @__PURE__ */ s("span", { className: "flex w-full items-center gap-2.5", children: [
|
|
657
|
-
/* @__PURE__ */ t(
|
|
662
|
+
/* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
658
663
|
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: x || "Comments" }),
|
|
659
|
-
|
|
664
|
+
ue > 0 && /* @__PURE__ */ t(
|
|
660
665
|
"span",
|
|
661
666
|
{
|
|
662
667
|
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",
|
|
663
668
|
"data-notes-badge": !0,
|
|
664
|
-
children:
|
|
669
|
+
children: ue
|
|
665
670
|
}
|
|
666
671
|
),
|
|
667
|
-
/* @__PURE__ */ t(
|
|
672
|
+
/* @__PURE__ */ t(Lt, { count: Be, tab: "comments" }),
|
|
668
673
|
/* @__PURE__ */ t(
|
|
669
|
-
|
|
674
|
+
We,
|
|
670
675
|
{
|
|
671
676
|
className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${q ? " rotate-180" : ""}`
|
|
672
677
|
}
|
|
673
678
|
)
|
|
674
679
|
] }),
|
|
675
|
-
!q && !i &&
|
|
676
|
-
const
|
|
680
|
+
!q && !i && M.length > 0 && (() => {
|
|
681
|
+
const r = M[0], a = r.kind === "comment" ? Y(r.comment) : r.note.user_name ?? "System", h = $e(r);
|
|
677
682
|
return h ? /* @__PURE__ */ s("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
|
|
678
683
|
/* @__PURE__ */ s("span", { className: "font-medium text-slate-500 dark:text-slate-400", children: [
|
|
679
684
|
a,
|
|
680
685
|
":"
|
|
681
686
|
] }),
|
|
682
687
|
" ",
|
|
683
|
-
/* @__PURE__ */ t(
|
|
688
|
+
/* @__PURE__ */ t(Re, { text: h, plain: !0 })
|
|
684
689
|
] }) : null;
|
|
685
690
|
})()
|
|
686
691
|
]
|
|
687
692
|
}
|
|
688
693
|
),
|
|
689
694
|
q && /* @__PURE__ */ t("div", { className: "border-t border-slate-100 px-5 py-4 dark:border-border/60", children: i ? /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
690
|
-
/* @__PURE__ */ s("form", { onSubmit:
|
|
695
|
+
/* @__PURE__ */ s("form", { onSubmit: ge, className: "space-y-2", children: [
|
|
691
696
|
/* @__PURE__ */ t(
|
|
692
697
|
se,
|
|
693
698
|
{
|
|
@@ -704,14 +709,14 @@ function ya({
|
|
|
704
709
|
] })
|
|
705
710
|
] }),
|
|
706
711
|
(f ?? []).length > 0 && /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
707
|
-
/* @__PURE__ */ t(
|
|
708
|
-
(f ?? []).map((
|
|
712
|
+
/* @__PURE__ */ t(Ne, {}),
|
|
713
|
+
(f ?? []).map((r, a) => /* @__PURE__ */ s(
|
|
709
714
|
"div",
|
|
710
715
|
{
|
|
711
716
|
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",
|
|
712
717
|
children: [
|
|
713
718
|
/* @__PURE__ */ t("span", { className: "mt-0.5 inline-flex shrink-0 items-center rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-600 dark:bg-amber-500/15 dark:text-amber-400", children: "Pending" }),
|
|
714
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children:
|
|
719
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: r })
|
|
715
720
|
]
|
|
716
721
|
},
|
|
717
722
|
a
|
|
@@ -719,19 +724,20 @@ function ya({
|
|
|
719
724
|
] })
|
|
720
725
|
] }) : /* @__PURE__ */ s(ee, { children: [
|
|
721
726
|
J.replies.length > 0 && /* @__PURE__ */ t("div", { className: "mb-2", children: /* @__PURE__ */ t(
|
|
722
|
-
|
|
727
|
+
qt,
|
|
723
728
|
{
|
|
724
|
-
replies: J.replies.map((
|
|
725
|
-
id:
|
|
726
|
-
name: Y(
|
|
727
|
-
text:
|
|
728
|
-
created_at:
|
|
729
|
+
replies: J.replies.map((r) => ({
|
|
730
|
+
id: r.id,
|
|
731
|
+
name: Y(r),
|
|
732
|
+
text: $e({ kind: "comment", comment: r }),
|
|
733
|
+
created_at: r.created_at
|
|
729
734
|
})),
|
|
730
735
|
onDismiss: J.dismiss,
|
|
731
|
-
onJump:
|
|
736
|
+
onJump: Dt
|
|
732
737
|
}
|
|
733
738
|
) }),
|
|
734
|
-
/* @__PURE__ */ s("form", { ref:
|
|
739
|
+
/* @__PURE__ */ s("form", { ref: ce, onSubmit: ge, className: "space-y-2", children: [
|
|
740
|
+
C.shown.length > 0 && /* @__PURE__ */ t(vt, {}),
|
|
735
741
|
/* @__PURE__ */ t(
|
|
736
742
|
se,
|
|
737
743
|
{
|
|
@@ -743,7 +749,7 @@ function ya({
|
|
|
743
749
|
className: "text-[13px]"
|
|
744
750
|
}
|
|
745
751
|
),
|
|
746
|
-
/* @__PURE__ */ t(
|
|
752
|
+
/* @__PURE__ */ t(Mt, { images: T }),
|
|
747
753
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
748
754
|
/* @__PURE__ */ t("p", { className: "text-[11px] text-slate-400", children: "Type @ plus two letters to mention a teammate, or @owners to notify everyone currently assigned." }),
|
|
749
755
|
/* @__PURE__ */ s("span", { className: "flex items-center gap-1.5", children: [
|
|
@@ -763,87 +769,87 @@ function ya({
|
|
|
763
769
|
{
|
|
764
770
|
type: "submit",
|
|
765
771
|
size: "sm",
|
|
766
|
-
disabled: !p.trim() && !T.hasReady || T.uploading ||
|
|
767
|
-
children:
|
|
772
|
+
disabled: !p.trim() && !T.hasReady || T.uploading || re.isPending,
|
|
773
|
+
children: re.isPending ? "Postingโฆ" : T.uploading ? "Uploadingโฆ" : "Comment"
|
|
768
774
|
}
|
|
769
775
|
)
|
|
770
776
|
] })
|
|
771
777
|
] })
|
|
772
778
|
] }),
|
|
773
|
-
P.map((
|
|
779
|
+
P.map((r) => /* @__PURE__ */ s(
|
|
774
780
|
"p",
|
|
775
781
|
{
|
|
776
782
|
className: "flex items-center gap-1.5 text-[11.5px] italic text-slate-400 dark:text-slate-500",
|
|
777
|
-
"data-note-typing":
|
|
783
|
+
"data-note-typing": r.field ?? "",
|
|
778
784
|
"aria-live": "polite",
|
|
779
785
|
children: [
|
|
780
786
|
/* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan motion-reduce:animate-none" }),
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
787
|
+
ut(
|
|
788
|
+
r.names,
|
|
789
|
+
r.field ? `replying on ${($ == null ? void 0 : $.labelOf(r.field)) ?? ve(r.field)}` : "replying"
|
|
784
790
|
),
|
|
785
791
|
"โฆ"
|
|
786
792
|
]
|
|
787
793
|
},
|
|
788
|
-
|
|
794
|
+
r.field ?? ""
|
|
789
795
|
)),
|
|
790
|
-
/* @__PURE__ */ t(
|
|
791
|
-
|
|
792
|
-
["people", "system", "integration"].map((
|
|
793
|
-
const a = !X.has(
|
|
796
|
+
/* @__PURE__ */ t(Ne, { className: "my-4" }),
|
|
797
|
+
M.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
|
|
798
|
+
["people", "system", "integration"].map((r) => {
|
|
799
|
+
const a = !X.has(r), h = pe[r];
|
|
794
800
|
return /* @__PURE__ */ s(
|
|
795
801
|
"button",
|
|
796
802
|
{
|
|
797
803
|
type: "button",
|
|
798
|
-
onClick: () =>
|
|
804
|
+
onClick: () => Ke(r),
|
|
799
805
|
"aria-pressed": a,
|
|
800
|
-
"data-notes-filter":
|
|
806
|
+
"data-notes-filter": r,
|
|
801
807
|
disabled: h === 0 && a,
|
|
802
808
|
className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${a ? "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`,
|
|
803
|
-
title:
|
|
809
|
+
title: r === "people" ? "Comments and notes people wrote" : r === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
|
|
804
810
|
children: [
|
|
805
|
-
|
|
811
|
+
Ut[r],
|
|
806
812
|
/* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] opacity-70", children: h })
|
|
807
813
|
]
|
|
808
814
|
},
|
|
809
|
-
|
|
815
|
+
r
|
|
810
816
|
);
|
|
811
817
|
}),
|
|
812
818
|
/* @__PURE__ */ t(
|
|
813
819
|
"input",
|
|
814
820
|
{
|
|
815
821
|
value: V,
|
|
816
|
-
onChange: (
|
|
822
|
+
onChange: (r) => Le(r.target.value),
|
|
817
823
|
placeholder: "Search notesโฆ",
|
|
818
824
|
"aria-label": "Search notes",
|
|
819
825
|
"data-notes-search": !0,
|
|
820
826
|
className: "ml-auto h-6 w-[150px] rounded-md border border-slate-200 bg-background px-2 text-[11.5px] dark:border-border"
|
|
821
827
|
}
|
|
822
828
|
),
|
|
823
|
-
|
|
829
|
+
Qe && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
|
|
824
830
|
ae.length,
|
|
825
831
|
" of ",
|
|
826
|
-
|
|
832
|
+
M.length
|
|
827
833
|
] })
|
|
828
834
|
] }),
|
|
829
|
-
|
|
835
|
+
O ? /* @__PURE__ */ t("div", { className: "space-y-4", children: ["a", "b"].map((r) => /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
|
|
830
836
|
/* @__PURE__ */ t("div", { className: "h-8 w-8 shrink-0 animate-pulse rounded-full bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
831
837
|
/* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
|
|
832
838
|
/* @__PURE__ */ t("div", { className: "h-3 w-32 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
833
839
|
/* @__PURE__ */ t("div", { className: "h-3 w-full animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
834
840
|
] })
|
|
835
|
-
] },
|
|
836
|
-
var
|
|
837
|
-
if (
|
|
841
|
+
] }, r)) }) : B ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : M.length === 0 ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : ae.length === 0 ? /* @__PURE__ */ t("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__ */ t("div", { className: "nvr-stagger-direct space-y-4", children: ae.map((r) => {
|
|
842
|
+
var ye;
|
|
843
|
+
if (r.kind === "related")
|
|
838
844
|
return /* @__PURE__ */ t("div", { className: "nvr-section-enter", children: /* @__PURE__ */ t(
|
|
839
|
-
|
|
845
|
+
Wt,
|
|
840
846
|
{
|
|
841
|
-
note:
|
|
847
|
+
note: r.note,
|
|
842
848
|
collection: e,
|
|
843
|
-
item: String(
|
|
849
|
+
item: String(o)
|
|
844
850
|
}
|
|
845
|
-
) },
|
|
846
|
-
const a =
|
|
851
|
+
) }, r.note.id);
|
|
852
|
+
const a = r.comment, h = k === a.user.id, j = H === a.id;
|
|
847
853
|
return /* @__PURE__ */ s(
|
|
848
854
|
"div",
|
|
849
855
|
{
|
|
@@ -851,43 +857,49 @@ function ya({
|
|
|
851
857
|
className: "nvr-section-enter group flex gap-3 rounded-lg",
|
|
852
858
|
children: [
|
|
853
859
|
/* @__PURE__ */ t(
|
|
854
|
-
|
|
860
|
+
Ct,
|
|
855
861
|
{
|
|
856
862
|
userId: a.user.id,
|
|
857
863
|
className: "h-8 w-8",
|
|
858
|
-
fallback: /* @__PURE__ */ t(
|
|
864
|
+
fallback: /* @__PURE__ */ t(St, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ t($t, { className: "bg-[#cbd5e1] text-[11px] font-semibold text-[#334155] dark:bg-[#475569] dark:text-[#f1f5f9]", children: At(a.user) }) })
|
|
859
865
|
}
|
|
860
866
|
),
|
|
861
867
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
862
868
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
863
|
-
/* @__PURE__ */ t(
|
|
869
|
+
a.tracker ? /* @__PURE__ */ t(
|
|
870
|
+
kt,
|
|
871
|
+
{
|
|
872
|
+
from: a.tracker,
|
|
873
|
+
className: "text-[13px] font-medium text-slate-800 dark:text-slate-100"
|
|
874
|
+
}
|
|
875
|
+
) : /* @__PURE__ */ t(
|
|
864
876
|
"span",
|
|
865
877
|
{
|
|
866
878
|
className: "text-[13px] font-medium text-slate-800",
|
|
867
|
-
"data-comment-acting-admin": ((
|
|
879
|
+
"data-comment-acting-admin": ((ye = a.acting_admin) == null ? void 0 : ye.id) || void 0,
|
|
868
880
|
children: Y(a)
|
|
869
881
|
}
|
|
870
882
|
),
|
|
871
|
-
/* @__PURE__ */ t(
|
|
883
|
+
/* @__PURE__ */ t(ft, { label: a.via_agent }),
|
|
872
884
|
/* @__PURE__ */ t(
|
|
873
885
|
"span",
|
|
874
886
|
{
|
|
875
887
|
className: "text-[11px] text-slate-400",
|
|
876
888
|
"data-tip": ie(a.created_at),
|
|
877
|
-
children: /* @__PURE__ */ t(
|
|
889
|
+
children: /* @__PURE__ */ t(Pe, { value: a.created_at })
|
|
878
890
|
}
|
|
879
891
|
),
|
|
880
892
|
a.updated_at && a.updated_at !== a.created_at && /* @__PURE__ */ t("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
|
|
881
893
|
a.field && /* @__PURE__ */ t(
|
|
882
|
-
|
|
894
|
+
Kt,
|
|
883
895
|
{
|
|
884
896
|
field: a.field,
|
|
885
|
-
label: (
|
|
897
|
+
label: ($ == null ? void 0 : $.labelOf(a.field)) ?? ve(a.field),
|
|
886
898
|
resolved: !!a.resolved_at,
|
|
887
|
-
onJump:
|
|
899
|
+
onJump: $ ? () => $.jump(a.field) : void 0
|
|
888
900
|
}
|
|
889
901
|
),
|
|
890
|
-
!
|
|
902
|
+
!j && /* @__PURE__ */ s(
|
|
891
903
|
"div",
|
|
892
904
|
{
|
|
893
905
|
className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${Q === a.id ? "opacity-100" : "opacity-0"}`,
|
|
@@ -899,8 +911,8 @@ function ya({
|
|
|
899
911
|
title: "Make a task from this comment",
|
|
900
912
|
"aria-label": "Make a task from this comment",
|
|
901
913
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
902
|
-
onClick: () =>
|
|
903
|
-
children: /* @__PURE__ */ t(
|
|
914
|
+
onClick: () => Ue.mutate(a),
|
|
915
|
+
children: /* @__PURE__ */ t(Ge, { className: "h-3 w-3" })
|
|
904
916
|
}
|
|
905
917
|
),
|
|
906
918
|
h && (Q === a.id ? /* @__PURE__ */ s(ee, { children: [
|
|
@@ -909,13 +921,13 @@ function ya({
|
|
|
909
921
|
{
|
|
910
922
|
type: "button",
|
|
911
923
|
autoFocus: !0,
|
|
912
|
-
disabled:
|
|
924
|
+
disabled: ne.isPending,
|
|
913
925
|
"data-comment-delete-confirm": a.id,
|
|
914
926
|
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",
|
|
915
|
-
onClick: () =>
|
|
927
|
+
onClick: () => ne.mutate(a.id, {
|
|
916
928
|
onSettled: () => R(null)
|
|
917
929
|
}),
|
|
918
|
-
children:
|
|
930
|
+
children: ne.isPending ? "Deletingโฆ" : "Delete comment?"
|
|
919
931
|
}
|
|
920
932
|
),
|
|
921
933
|
/* @__PURE__ */ t(
|
|
@@ -936,7 +948,7 @@ function ya({
|
|
|
936
948
|
"aria-label": "Edit comment",
|
|
937
949
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",
|
|
938
950
|
onClick: () => {
|
|
939
|
-
|
|
951
|
+
A(a.id), n(a.text);
|
|
940
952
|
},
|
|
941
953
|
children: /* @__PURE__ */ t(He, { className: "h-3 w-3" })
|
|
942
954
|
}
|
|
@@ -949,7 +961,7 @@ function ya({
|
|
|
949
961
|
"aria-label": "Delete comment",
|
|
950
962
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500",
|
|
951
963
|
onClick: () => R(a.id),
|
|
952
|
-
children: /* @__PURE__ */ t(
|
|
964
|
+
children: /* @__PURE__ */ t(Je, { className: "h-3 w-3" })
|
|
953
965
|
}
|
|
954
966
|
)
|
|
955
967
|
] }))
|
|
@@ -957,12 +969,12 @@ function ya({
|
|
|
957
969
|
}
|
|
958
970
|
)
|
|
959
971
|
] }),
|
|
960
|
-
|
|
972
|
+
j ? /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-2", children: [
|
|
961
973
|
/* @__PURE__ */ t(
|
|
962
974
|
se,
|
|
963
975
|
{
|
|
964
976
|
value: U,
|
|
965
|
-
onChange:
|
|
977
|
+
onChange: n,
|
|
966
978
|
rows: 3,
|
|
967
979
|
className: "text-[13px]"
|
|
968
980
|
}
|
|
@@ -973,10 +985,10 @@ function ya({
|
|
|
973
985
|
{
|
|
974
986
|
size: "sm",
|
|
975
987
|
className: "h-7 gap-1.5",
|
|
976
|
-
disabled: !U.trim() ||
|
|
977
|
-
onClick: () =>
|
|
988
|
+
disabled: !U.trim() || xe.isPending,
|
|
989
|
+
onClick: () => xe.mutate({ id: a.id, text: U.trim() }),
|
|
978
990
|
children: [
|
|
979
|
-
/* @__PURE__ */ t(
|
|
991
|
+
/* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
|
|
980
992
|
" Save"
|
|
981
993
|
]
|
|
982
994
|
}
|
|
@@ -988,46 +1000,52 @@ function ya({
|
|
|
988
1000
|
variant: "outline",
|
|
989
1001
|
className: "h-7 gap-1.5",
|
|
990
1002
|
onClick: () => {
|
|
991
|
-
|
|
1003
|
+
A(null), n("");
|
|
992
1004
|
},
|
|
993
1005
|
children: [
|
|
994
|
-
/* @__PURE__ */ t(
|
|
1006
|
+
/* @__PURE__ */ t(Xe, { className: "h-3 w-3" }),
|
|
995
1007
|
" Cancel"
|
|
996
1008
|
]
|
|
997
1009
|
}
|
|
998
1010
|
)
|
|
999
1011
|
] })
|
|
1000
|
-
] }) : /* @__PURE__ */ t(
|
|
1001
|
-
|
|
1012
|
+
] }) : a.tracker ? /* @__PURE__ */ t(
|
|
1013
|
+
Nt,
|
|
1014
|
+
{
|
|
1015
|
+
text: a.text,
|
|
1016
|
+
className: "mt-0.5 text-[13px] leading-relaxed text-slate-600 dark:text-slate-300"
|
|
1017
|
+
}
|
|
1018
|
+
) : /* @__PURE__ */ t(
|
|
1019
|
+
Ft,
|
|
1002
1020
|
{
|
|
1003
1021
|
text: a.text,
|
|
1004
|
-
record: { collection: e, itemId:
|
|
1005
|
-
caption: `${Y(a)} ยท ${
|
|
1022
|
+
record: { collection: e, itemId: o },
|
|
1023
|
+
caption: `${Y(a)} ยท ${Ie(a.created_at)}`,
|
|
1006
1024
|
className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600"
|
|
1007
1025
|
}
|
|
1008
1026
|
),
|
|
1009
|
-
!
|
|
1010
|
-
|
|
1027
|
+
!j && /* @__PURE__ */ t(
|
|
1028
|
+
Bt,
|
|
1011
1029
|
{
|
|
1012
1030
|
comment: a,
|
|
1013
1031
|
collection: e,
|
|
1014
|
-
item: String(
|
|
1032
|
+
item: String(o)
|
|
1015
1033
|
}
|
|
1016
1034
|
),
|
|
1017
|
-
!
|
|
1018
|
-
|
|
1035
|
+
!j && /* @__PURE__ */ t(
|
|
1036
|
+
It,
|
|
1019
1037
|
{
|
|
1020
1038
|
people: a.seen_by,
|
|
1021
1039
|
hasMentions: oe(a).length > 0,
|
|
1022
1040
|
exclude: new Set(oe(a).map((D) => String(D.id).toUpperCase()))
|
|
1023
1041
|
}
|
|
1024
1042
|
),
|
|
1025
|
-
!
|
|
1043
|
+
!j && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
|
|
1026
1044
|
(a.reactions ?? []).map((D) => /* @__PURE__ */ s(
|
|
1027
1045
|
"button",
|
|
1028
1046
|
{
|
|
1029
1047
|
type: "button",
|
|
1030
|
-
onClick: () =>
|
|
1048
|
+
onClick: () => he.mutate({ id: a.id, emoji: D.emoji }),
|
|
1031
1049
|
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${D.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"}`,
|
|
1032
1050
|
children: [
|
|
1033
1051
|
D.emoji,
|
|
@@ -1041,18 +1059,18 @@ function ya({
|
|
|
1041
1059
|
"button",
|
|
1042
1060
|
{
|
|
1043
1061
|
type: "button",
|
|
1044
|
-
onClick: () => be
|
|
1062
|
+
onClick: () => fe(be === a.id ? null : a.id),
|
|
1045
1063
|
className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
|
|
1046
1064
|
"aria-label": "Add reaction",
|
|
1047
|
-
children: /* @__PURE__ */ t(
|
|
1065
|
+
children: /* @__PURE__ */ t(qe, { className: "h-3.5 w-3.5" })
|
|
1048
1066
|
}
|
|
1049
1067
|
),
|
|
1050
|
-
|
|
1068
|
+
be === a.id && /* @__PURE__ */ t("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: Me.map((D) => /* @__PURE__ */ t(
|
|
1051
1069
|
"button",
|
|
1052
1070
|
{
|
|
1053
1071
|
type: "button",
|
|
1054
1072
|
onClick: () => {
|
|
1055
|
-
|
|
1073
|
+
he.mutate({ id: a.id, emoji: D }), fe(null);
|
|
1056
1074
|
},
|
|
1057
1075
|
className: "rounded-full px-1 text-[14px] hover:bg-muted",
|
|
1058
1076
|
children: D
|
|
@@ -1074,7 +1092,7 @@ function ya({
|
|
|
1074
1092
|
);
|
|
1075
1093
|
}
|
|
1076
1094
|
export {
|
|
1077
|
-
|
|
1095
|
+
$a as CommentPanel,
|
|
1078
1096
|
se as MentionTextarea,
|
|
1079
|
-
|
|
1097
|
+
$e as notePreviewText
|
|
1080
1098
|
};
|