@nivaro/react 0.3.116 → 0.3.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +140 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3855 -3785
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ReportView.js +1086 -1091
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/cbv/column-totals.js +62 -57
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/charts/category-axis.js +93 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/use-query-entry.js +17 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsxs as s, jsx as t, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { MessageSquare as
|
|
4
|
-
import { useState as C, useRef as
|
|
5
|
-
import { createPortal as
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as $e, useQuery as W, useMutation as A } from "@tanstack/react-query";
|
|
3
|
+
import { MessageSquare as Ue, ChevronDown as ze, ClipboardPlus as We, Pencil as He, Trash2 as Ge, Check as Ee, X as Je, SmilePlus as Te, BellOff as Xe } from "lucide-react";
|
|
4
|
+
import { useState as C, useRef as te, useEffect as qe, useMemo as z } from "react";
|
|
5
|
+
import { createPortal as Ve } from "react-dom";
|
|
6
6
|
import { toast as M } from "sonner";
|
|
7
|
-
import { useNivaroClient as le, useItemEditAuth as
|
|
8
|
-
import { useDebounced as
|
|
9
|
-
import { get as H, post as K, patch as
|
|
10
|
-
import { useRepliesWhileTyping 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 ye, formatDateTime as ie,
|
|
7
|
+
import { useNivaroClient as le, useItemEditAuth as Ze, useDrilldown as Ye } from "../../context.js";
|
|
8
|
+
import { useDebounced as et } from "../../hooks/useDebounced.js";
|
|
9
|
+
import { get as H, post as K, patch as tt, del as at } from "../../lib/commands.js";
|
|
10
|
+
import { useRepliesWhileTyping as nt, mentionReceiptLine as rt, mentionReceiptSummary as st } from "../../lib/comment-awareness.js";
|
|
11
|
+
import { stripCommentImages as ot } from "../../lib/comment-images.js";
|
|
12
|
+
import { useLivePreference as lt } from "../../lib/live-preference.js";
|
|
13
|
+
import { usePresenceOnlinePoll as it } from "../../lib/presence-live.js";
|
|
14
|
+
import { useMyUserId as dt, useNoteTypists as ct, useDraftTypingSignal as mt, signalSentence as pt } from "../../lib/presence-signals.js";
|
|
15
|
+
import { invalidateRecordTasks as ut } from "../../lib/record-tasks.js";
|
|
16
|
+
import { useNewSince as xt } from "../../lib/seen-since.js";
|
|
17
|
+
import { useStartsOpen as ht } from "../../lib/use-starts-open.js";
|
|
18
|
+
import { titleCase as ye, formatDateTime as ie, formatRelative as De, cn as ve } from "../../lib/utils.js";
|
|
19
19
|
import { AgentBadge as bt } from "../AgentBadge.js";
|
|
20
|
-
import { AutolinkedText as
|
|
20
|
+
import { AutolinkedText as Ie } from "../AutolinkedText.js";
|
|
21
21
|
import { InboundRequestPopover as ft } from "../integrations/InboundRequest.js";
|
|
22
22
|
import { useFieldComments as gt } from "../item-edit/field-comments-context.js";
|
|
23
|
-
import { RelativeTime as
|
|
23
|
+
import { RelativeTime as Re } from "../RelativeTime.js";
|
|
24
24
|
import { UserAvatar as yt } from "../UserAvatar.js";
|
|
25
25
|
import { Avatar as vt, AvatarFallback as kt } from "../ui/avatar.js";
|
|
26
26
|
import { Button as Z } from "../ui/button.js";
|
|
27
27
|
import { Separator as ke } from "../ui/separator.js";
|
|
28
28
|
import { Textarea as Nt } from "../ui/textarea.js";
|
|
29
|
-
import { useHoldInPlace as wt, RepliesWhileTyping as _t, jumpToComment as Ct, SeenByLine as St, MentionDeliveryButton as
|
|
30
|
-
import { useCommentImages as
|
|
29
|
+
import { useHoldInPlace as wt, RepliesWhileTyping as _t, jumpToComment as Ct, SeenByLine as St, MentionDeliveryButton as $t } from "./CommentAwareness.js";
|
|
30
|
+
import { useCommentImages as Et, CommentImageStrip as Tt, CommentBody as qt, imageDropProps as Dt } from "./CommentImages.js";
|
|
31
31
|
import { RecordEventPathSheet as It } from "./IntegrationActivitySection.js";
|
|
32
32
|
import { NewSinceChip as Rt } from "./NewSinceChip.js";
|
|
33
|
-
const
|
|
33
|
+
const Pe = ["👍", "✅", "👀", "🎉", "❤️", "😂"];
|
|
34
34
|
function Pt(e) {
|
|
35
35
|
var x, b, f, c;
|
|
36
36
|
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()) || "?";
|
|
@@ -41,7 +41,7 @@ const Ne = {
|
|
|
41
41
|
warn: "text-amber-700 dark:text-amber-400"
|
|
42
42
|
};
|
|
43
43
|
function we({ tone: e }) {
|
|
44
|
-
return e === "ok" ? /* @__PURE__ */ t(
|
|
44
|
+
return e === "ok" ? /* @__PURE__ */ t(Ee, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : e === "warn" ? /* @__PURE__ */ t(Xe, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : null;
|
|
45
45
|
}
|
|
46
46
|
function oe(e) {
|
|
47
47
|
return (e.mentions ?? []).filter(
|
|
@@ -56,9 +56,9 @@ function Ft({
|
|
|
56
56
|
collection: l,
|
|
57
57
|
item: x
|
|
58
58
|
}) {
|
|
59
|
-
const b =
|
|
59
|
+
const b = lt(), f = oe(e);
|
|
60
60
|
if (f.length === 0) return null;
|
|
61
|
-
const c = f.map((d) => ({ m: d, ...
|
|
61
|
+
const c = f.map((d) => ({ m: d, ...rt(d, De) })), m = st(f);
|
|
62
62
|
return /* @__PURE__ */ s(
|
|
63
63
|
"p",
|
|
64
64
|
{
|
|
@@ -95,17 +95,17 @@ function Ft({
|
|
|
95
95
|
},
|
|
96
96
|
d.id
|
|
97
97
|
)),
|
|
98
|
-
e.delivery_visible && /* @__PURE__ */ t(
|
|
98
|
+
e.delivery_visible && /* @__PURE__ */ t($t, { collection: l, item: x, commentId: e.id })
|
|
99
99
|
]
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Fe(e) {
|
|
104
104
|
return [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Y(e) {
|
|
107
107
|
var x;
|
|
108
|
-
const l =
|
|
108
|
+
const l = Fe(e.user);
|
|
109
109
|
return (x = e.acting_admin) != null && x.name ? `${e.acting_admin.name} as ${l}` : l;
|
|
110
110
|
}
|
|
111
111
|
function Mt({
|
|
@@ -114,7 +114,7 @@ function Mt({
|
|
|
114
114
|
resolved: x,
|
|
115
115
|
onJump: b
|
|
116
116
|
}) {
|
|
117
|
-
const f = /* @__PURE__ */ s(
|
|
117
|
+
const f = /* @__PURE__ */ s(ee, { children: [
|
|
118
118
|
"on ",
|
|
119
119
|
/* @__PURE__ */ t("span", { className: "font-medium", children: l }),
|
|
120
120
|
x && /* @__PURE__ */ t("span", { className: "text-slate-400 dark:text-slate-500", children: " · resolved" })
|
|
@@ -144,14 +144,14 @@ function se({
|
|
|
144
144
|
onImages: x,
|
|
145
145
|
...b
|
|
146
146
|
}) {
|
|
147
|
-
const f = le(), c =
|
|
147
|
+
const f = le(), c = te(null), [m, d] = C(null), [k, N] = C(0), y = et((m == null ? void 0 : m.query) ?? "", 200), { data: S = [] } = W({
|
|
148
148
|
queryKey: ["users", "mention-search", y],
|
|
149
149
|
queryFn: () => f.request(
|
|
150
150
|
H("/users", { limit: 8, sort: "first_name", search: y })
|
|
151
151
|
).then((r) => r.data),
|
|
152
152
|
enabled: !!m && y.length >= 2,
|
|
153
153
|
staleTime: 3e4
|
|
154
|
-
}), q =
|
|
154
|
+
}), q = it(15e3, !!m), { data: I } = W({
|
|
155
155
|
queryKey: ["presence-online"],
|
|
156
156
|
queryFn: () => f.request(
|
|
157
157
|
H("/presence/online")
|
|
@@ -168,9 +168,9 @@ function se({
|
|
|
168
168
|
queryFn: () => f.request(H("/chat/roles")).then((r) => r.data).catch(() => []),
|
|
169
169
|
enabled: !!m,
|
|
170
170
|
staleTime: 5 * 6e4
|
|
171
|
-
}),
|
|
171
|
+
}), $ = m ? T.filter(
|
|
172
172
|
(r) => r.name.toLowerCase().replace(/\s+/g, "-").startsWith(y.toLowerCase())
|
|
173
|
-
).slice(0, 3) : [], _ = !!m && y.length >= 2 && "owners".startsWith(y.toLowerCase()), o = !!m && y.length >= 2 && (w.length > 0 || _ ||
|
|
173
|
+
).slice(0, 3) : [], _ = !!m && y.length >= 2 && "owners".startsWith(y.toLowerCase()), o = !!m && y.length >= 2 && (w.length > 0 || _ || $.length > 0), v = w.length + (_ ? 1 : 0) + $.length, [P, G] = C(null), B = te(null);
|
|
174
174
|
qe(() => {
|
|
175
175
|
if (!o || !c.current) {
|
|
176
176
|
G(null);
|
|
@@ -179,8 +179,8 @@ function se({
|
|
|
179
179
|
const r = c.current.getBoundingClientRect();
|
|
180
180
|
G({ top: r.bottom + 4, left: r.left, width: Math.min(r.width, 360) });
|
|
181
181
|
const i = (g) => {
|
|
182
|
-
var
|
|
183
|
-
(
|
|
182
|
+
var E;
|
|
183
|
+
(E = B.current) != null && E.contains(g.target) || d(null);
|
|
184
184
|
}, u = () => d(null);
|
|
185
185
|
return window.addEventListener("scroll", i, !0), window.addEventListener("resize", u), () => {
|
|
186
186
|
window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", u);
|
|
@@ -194,10 +194,10 @@ function se({
|
|
|
194
194
|
if (!m || !c.current) return;
|
|
195
195
|
const i = c.current.selectionStart ?? e.length, u = r === "__owners__" ? "@owners " : typeof r == "object" && "role" in r ? `@${r.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${_e(r)} `, g = e.slice(0, m.start) + u + e.slice(i);
|
|
196
196
|
l(g), d(null), N(0);
|
|
197
|
-
const
|
|
197
|
+
const E = m.start + u.length;
|
|
198
198
|
requestAnimationFrame(() => {
|
|
199
199
|
var O, j;
|
|
200
|
-
(O = c.current) == null || O.focus(), (j = c.current) == null || j.setSelectionRange(
|
|
200
|
+
(O = c.current) == null || O.focus(), (j = c.current) == null || j.setSelectionRange(E, E);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
function U(r) {
|
|
@@ -211,8 +211,8 @@ function se({
|
|
|
211
211
|
const i = Math.min(k, v - 1), u = _ ? 1 : 0, g = u + w.length;
|
|
212
212
|
if (_ && i === 0) R("__owners__");
|
|
213
213
|
else if (i >= g) {
|
|
214
|
-
const
|
|
215
|
-
|
|
214
|
+
const E = $[i - g];
|
|
215
|
+
E && R({ role: E.name });
|
|
216
216
|
} else R(w[i - u]);
|
|
217
217
|
} else r.key === "Escape" && (r.preventDefault(), d(null));
|
|
218
218
|
}
|
|
@@ -232,7 +232,7 @@ function se({
|
|
|
232
232
|
onBlur: () => setTimeout(() => d(null), 150)
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
|
-
o && P &&
|
|
235
|
+
o && P && Ve(
|
|
236
236
|
/* @__PURE__ */ s(
|
|
237
237
|
"div",
|
|
238
238
|
{
|
|
@@ -261,7 +261,7 @@ function se({
|
|
|
261
261
|
}
|
|
262
262
|
),
|
|
263
263
|
w.map((r, i) => {
|
|
264
|
-
var
|
|
264
|
+
var E, O;
|
|
265
265
|
const u = _ ? i + 1 : i, g = [r.first_name, r.last_name].filter(Boolean).join(" ") || r.email;
|
|
266
266
|
return /* @__PURE__ */ s(
|
|
267
267
|
"button",
|
|
@@ -274,7 +274,7 @@ function se({
|
|
|
274
274
|
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
275
|
children: [
|
|
276
276
|
/* @__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
|
-
(`${((
|
|
277
|
+
(`${((E = r.first_name) == null ? void 0 : E[0]) ?? ""}${((O = r.last_name) == null ? void 0 : O[0]) ?? ""}`.trim() || r.email[0]).toUpperCase(),
|
|
278
278
|
p(r.id) < 2 && /* @__PURE__ */ t(
|
|
279
279
|
"span",
|
|
280
280
|
{
|
|
@@ -304,7 +304,7 @@ function se({
|
|
|
304
304
|
r.id
|
|
305
305
|
);
|
|
306
306
|
}),
|
|
307
|
-
|
|
307
|
+
$.map((r, i) => {
|
|
308
308
|
const u = w.length + (_ ? 1 : 0) + i;
|
|
309
309
|
return /* @__PURE__ */ s(
|
|
310
310
|
"button",
|
|
@@ -352,7 +352,7 @@ const jt = {
|
|
|
352
352
|
};
|
|
353
353
|
function Se(e) {
|
|
354
354
|
const l = e.kind === "comment" ? e.comment.text : e.note.text;
|
|
355
|
-
return (e.kind === "comment" ?
|
|
355
|
+
return (e.kind === "comment" ? ot(l).replace(/<[^>]*>/g, " ") : l).replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
|
|
356
356
|
}
|
|
357
357
|
const Lt = "integrations:";
|
|
358
358
|
function At({
|
|
@@ -361,7 +361,7 @@ function At({
|
|
|
361
361
|
item: x
|
|
362
362
|
}) {
|
|
363
363
|
var _;
|
|
364
|
-
const b =
|
|
364
|
+
const b = Ye(), [f, c] = C(!1), m = e.source === "external" && !!e.provider && !e.provider.startsWith(Lt), d = le(), k = $e(), [N, y] = C(!1), S = A({
|
|
365
365
|
mutationFn: (o) => d.request(K(`/comments/${e.comment_id}/reactions`, { emoji: o })),
|
|
366
366
|
onSuccess: () => {
|
|
367
367
|
y(!1), k.invalidateQueries({ queryKey: ["comments-related"] }), k.invalidateQueries({ queryKey: ["row-comment-counts"] });
|
|
@@ -394,7 +394,7 @@ function At({
|
|
|
394
394
|
return;
|
|
395
395
|
}
|
|
396
396
|
b == null || b.open({ collection: o.collection, itemId: o.item_id });
|
|
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",
|
|
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", $ = e.source === "import" && ((_ = e.import) != null && _.file_id) ? e.import : null;
|
|
398
398
|
return /* @__PURE__ */ s("div", { className: "flex gap-3", "data-recorded-note": e.source, children: [
|
|
399
399
|
/* @__PURE__ */ t("div", { className: "mt-1 h-8 w-8 shrink-0", "aria-hidden": !0 }),
|
|
400
400
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -410,19 +410,19 @@ function At({
|
|
|
410
410
|
"data-line-comment-link": !0,
|
|
411
411
|
children: e.context
|
|
412
412
|
}
|
|
413
|
-
) :
|
|
413
|
+
) : $ ? /* @__PURE__ */ t(
|
|
414
414
|
"a",
|
|
415
415
|
{
|
|
416
|
-
href: `/api/files/${
|
|
416
|
+
href: `/api/files/${$.file_id}?download=1`,
|
|
417
417
|
target: "_blank",
|
|
418
418
|
rel: "noreferrer",
|
|
419
419
|
onClick: (o) => o.stopPropagation(),
|
|
420
420
|
className: "truncate text-[11px] text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
|
|
421
|
-
"data-note-import-file":
|
|
421
|
+
"data-note-import-file": $.file_id ?? void 0,
|
|
422
422
|
children: e.context
|
|
423
423
|
}
|
|
424
424
|
) : /* @__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(
|
|
425
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", "data-tip": ie(e.created_at), children: /* @__PURE__ */ t(Re, { value: e.created_at }) }),
|
|
426
426
|
e.source === "inbound" && e.inbound && /* @__PURE__ */ t(
|
|
427
427
|
ft,
|
|
428
428
|
{
|
|
@@ -469,7 +469,7 @@ function At({
|
|
|
469
469
|
}
|
|
470
470
|
)
|
|
471
471
|
] }),
|
|
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(
|
|
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(Ie, { text: e.text }) }),
|
|
473
473
|
e.comment_id && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
|
|
474
474
|
(e.reactions ?? []).map((o) => /* @__PURE__ */ s(
|
|
475
475
|
"button",
|
|
@@ -495,7 +495,7 @@ function At({
|
|
|
495
495
|
children: /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" })
|
|
496
496
|
}
|
|
497
497
|
),
|
|
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:
|
|
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: Pe.map((o) => /* @__PURE__ */ t(
|
|
499
499
|
"button",
|
|
500
500
|
{
|
|
501
501
|
type: "button",
|
|
@@ -531,108 +531,108 @@ function ya({
|
|
|
531
531
|
onQueueComment: c,
|
|
532
532
|
onUnsentDraft: m
|
|
533
533
|
}) {
|
|
534
|
-
const d = le(), { userId: k } =
|
|
535
|
-
|
|
536
|
-
var
|
|
537
|
-
(
|
|
534
|
+
const d = le(), { userId: k } = Ze(), N = dt(), y = $e(), S = gt(), [q, I] = ht(b, !1), [p, w] = C(""), T = Et(), $ = te(m);
|
|
535
|
+
$.current = m, qe(() => {
|
|
536
|
+
var n;
|
|
537
|
+
(n = $.current) == null || n.call($, p);
|
|
538
538
|
}, [p]);
|
|
539
539
|
const [_, o] = C(!1), v = async () => {
|
|
540
|
-
var
|
|
540
|
+
var n;
|
|
541
541
|
if (!(!p.trim() || _)) {
|
|
542
542
|
o(!0);
|
|
543
543
|
try {
|
|
544
|
-
const
|
|
544
|
+
const a = await d.request(
|
|
545
545
|
K("/ai/cleanup", { text: p })
|
|
546
546
|
);
|
|
547
|
-
(
|
|
547
|
+
(n = a.data) != null && n.text && w(a.data.text);
|
|
548
548
|
} catch {
|
|
549
549
|
} finally {
|
|
550
550
|
o(!1);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
}, P =
|
|
554
|
-
|
|
555
|
-
const [G, B] = C(null), [Q, R] = C(null), [U, r] = C(""), i = !l || l === "new", u = ["comments", e, String(l)], { data: g, isLoading:
|
|
553
|
+
}, P = ct(e, l);
|
|
554
|
+
mt(e, l, p);
|
|
555
|
+
const [G, B] = C(null), [Q, R] = C(null), [U, r] = C(""), i = !l || l === "new", u = ["comments", e, String(l)], { data: g, isLoading: E, isError: O } = W({
|
|
556
556
|
queryKey: u,
|
|
557
|
-
queryFn: () => d.request(H("/comments", { collection: e, item: l })).then((
|
|
557
|
+
queryFn: () => d.request(H("/comments", { collection: e, item: l })).then((n) => n.data),
|
|
558
558
|
enabled: !i
|
|
559
|
-
}), j = z(() => (g ?? []).filter((
|
|
559
|
+
}), j = z(() => (g ?? []).filter((n) => !n.deleted), [g]), J = nt(p, g, k || N), de = te(null);
|
|
560
560
|
wt(de, J.replies.length);
|
|
561
|
-
const { data:
|
|
561
|
+
const { data: Me } = W({
|
|
562
562
|
queryKey: ["comments-related", e, String(l)],
|
|
563
|
-
queryFn: () => d.request(H("/comments/related", { collection: e, item: l })).then((
|
|
563
|
+
queryFn: () => d.request(H("/comments/related", { collection: e, item: l })).then((n) => n.data ?? []).catch(() => []),
|
|
564
564
|
enabled: !i,
|
|
565
565
|
staleTime: 3e4
|
|
566
|
-
}), ce =
|
|
567
|
-
const
|
|
568
|
-
return [...
|
|
569
|
-
}, [j, ce]), [X,
|
|
570
|
-
const
|
|
571
|
-
for (const
|
|
572
|
-
return
|
|
573
|
-
}, [F]), pe = i ? (f ?? []).length : me.people,
|
|
574
|
-
() => (g ?? []).map((
|
|
575
|
-
var
|
|
576
|
-
return { at:
|
|
566
|
+
}), ce = Me ?? [], F = z(() => {
|
|
567
|
+
const n = j.map((h) => ({ kind: "comment", at: h.created_at, comment: h })), a = ce.map((h) => ({ kind: "related", at: h.created_at, note: h }));
|
|
568
|
+
return [...n, ...a].sort((h, L) => new Date(L.at).getTime() - new Date(h.at).getTime());
|
|
569
|
+
}, [j, ce]), [X, Oe] = C(() => /* @__PURE__ */ new Set()), [V, je] = C(""), me = z(() => {
|
|
570
|
+
const n = { people: 0, system: 0, integration: 0 };
|
|
571
|
+
for (const a of F) n[Ce(a)]++;
|
|
572
|
+
return n;
|
|
573
|
+
}, [F]), pe = i ? (f ?? []).length : me.people, Le = z(
|
|
574
|
+
() => (g ?? []).map((n) => {
|
|
575
|
+
var a;
|
|
576
|
+
return { at: n.created_at, by: ((a = n.user) == null ? void 0 : a.id) ?? null };
|
|
577
577
|
}),
|
|
578
578
|
[g]
|
|
579
|
-
),
|
|
579
|
+
), Ae = xt({
|
|
580
580
|
userId: k,
|
|
581
581
|
collection: e,
|
|
582
582
|
item: l,
|
|
583
583
|
tab: "comments",
|
|
584
584
|
open: q,
|
|
585
|
-
entries:
|
|
585
|
+
entries: Le,
|
|
586
586
|
ready: !i && !!g
|
|
587
|
-
}),
|
|
588
|
-
const
|
|
589
|
-
return F.filter((
|
|
590
|
-
}, [F, X, V]),
|
|
591
|
-
const h = new Set(
|
|
592
|
-
return h.has(
|
|
593
|
-
}),
|
|
594
|
-
mutationFn: (
|
|
587
|
+
}), ae = z(() => {
|
|
588
|
+
const n = V.trim().toLowerCase();
|
|
589
|
+
return F.filter((a) => X.has(Ce(a)) ? !1 : n ? (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(n) : !0);
|
|
590
|
+
}, [F, X, V]), Be = (n) => Oe((a) => {
|
|
591
|
+
const h = new Set(a);
|
|
592
|
+
return h.has(n) ? h.delete(n) : h.add(n), h;
|
|
593
|
+
}), Ke = X.size > 0 || V.trim() !== "", ne = A({
|
|
594
|
+
mutationFn: (n) => d.request(K("/comments", { collection: e, item: l, text: n })),
|
|
595
595
|
onSuccess: () => {
|
|
596
596
|
y.invalidateQueries({ queryKey: u }), w(""), T.reset();
|
|
597
597
|
},
|
|
598
598
|
onError: () => M.error("Failed to post comment")
|
|
599
599
|
}), ue = A({
|
|
600
|
-
mutationFn: ({ id:
|
|
600
|
+
mutationFn: ({ id: n, text: a }) => d.request(tt(`/comments/${n}`, { text: a })),
|
|
601
601
|
onSuccess: () => {
|
|
602
602
|
y.invalidateQueries({ queryKey: u }), B(null), r("");
|
|
603
603
|
},
|
|
604
604
|
onError: () => M.error("Failed to update comment")
|
|
605
|
-
}),
|
|
606
|
-
mutationFn: (
|
|
605
|
+
}), re = A({
|
|
606
|
+
mutationFn: (n) => d.request(at(`/comments/${n}`)),
|
|
607
607
|
onSuccess: () => y.invalidateQueries({ queryKey: u }),
|
|
608
608
|
onError: () => M.error("Failed to delete comment")
|
|
609
609
|
}), xe = A({
|
|
610
|
-
mutationFn: ({ id:
|
|
610
|
+
mutationFn: ({ id: n, emoji: a }) => d.request(K(`/comments/${n}/reactions`, { emoji: a })),
|
|
611
611
|
onSuccess: () => y.invalidateQueries({ queryKey: u }),
|
|
612
612
|
onError: () => M.error("Failed to react")
|
|
613
|
-
}), [he, be] = C(null),
|
|
614
|
-
mutationFn: (
|
|
613
|
+
}), [he, be] = C(null), Qe = A({
|
|
614
|
+
mutationFn: (n) => d.request(
|
|
615
615
|
K("/tasks", {
|
|
616
616
|
collection: e,
|
|
617
617
|
item: l,
|
|
618
|
-
title:
|
|
618
|
+
title: n.text.replace(/<[^>]*>/g, "").replace(/@\[([^\]]+)\]/g, "@$1").slice(0, 200),
|
|
619
619
|
assignee: k
|
|
620
620
|
})
|
|
621
621
|
),
|
|
622
622
|
onSuccess: () => {
|
|
623
|
-
|
|
623
|
+
ut(y, e, l), M.success("Task created from comment — assigned to you");
|
|
624
624
|
},
|
|
625
625
|
onError: () => M.error("Could not create a task")
|
|
626
626
|
});
|
|
627
|
-
function fe(
|
|
628
|
-
if (
|
|
627
|
+
function fe(n) {
|
|
628
|
+
if (n.preventDefault(), i && c) {
|
|
629
629
|
if (!p.trim()) return;
|
|
630
630
|
c(p.trim()), w("");
|
|
631
631
|
} else {
|
|
632
632
|
if (T.uploading) return;
|
|
633
|
-
const
|
|
634
|
-
if (!
|
|
635
|
-
|
|
633
|
+
const a = T.compose(p);
|
|
634
|
+
if (!a) return;
|
|
635
|
+
ne.mutate(a);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
return (
|
|
@@ -650,11 +650,11 @@ function ya({
|
|
|
650
650
|
{
|
|
651
651
|
type: "button",
|
|
652
652
|
"data-panel-toggle": "notes",
|
|
653
|
-
onClick: () => I((
|
|
653
|
+
onClick: () => I((n) => !n),
|
|
654
654
|
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
655
|
children: [
|
|
656
656
|
/* @__PURE__ */ s("span", { className: "flex w-full items-center gap-2.5", children: [
|
|
657
|
-
/* @__PURE__ */ t(
|
|
657
|
+
/* @__PURE__ */ t(Ue, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
658
658
|
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: x || "Comments" }),
|
|
659
659
|
pe > 0 && /* @__PURE__ */ t(
|
|
660
660
|
"span",
|
|
@@ -664,23 +664,23 @@ function ya({
|
|
|
664
664
|
children: pe
|
|
665
665
|
}
|
|
666
666
|
),
|
|
667
|
-
/* @__PURE__ */ t(Rt, { count:
|
|
667
|
+
/* @__PURE__ */ t(Rt, { count: Ae, tab: "comments" }),
|
|
668
668
|
/* @__PURE__ */ t(
|
|
669
|
-
|
|
669
|
+
ze,
|
|
670
670
|
{
|
|
671
671
|
className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${q ? " rotate-180" : ""}`
|
|
672
672
|
}
|
|
673
673
|
)
|
|
674
674
|
] }),
|
|
675
675
|
!q && !i && F.length > 0 && (() => {
|
|
676
|
-
const
|
|
676
|
+
const n = F[0], a = n.kind === "comment" ? Y(n.comment) : n.note.user_name ?? "System", h = Se(n);
|
|
677
677
|
return h ? /* @__PURE__ */ s("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
|
|
678
678
|
/* @__PURE__ */ s("span", { className: "font-medium text-slate-500 dark:text-slate-400", children: [
|
|
679
|
-
|
|
679
|
+
a,
|
|
680
680
|
":"
|
|
681
681
|
] }),
|
|
682
682
|
" ",
|
|
683
|
-
/* @__PURE__ */ t(
|
|
683
|
+
/* @__PURE__ */ t(Ie, { text: h, plain: !0 })
|
|
684
684
|
] }) : null;
|
|
685
685
|
})()
|
|
686
686
|
]
|
|
@@ -705,27 +705,27 @@ function ya({
|
|
|
705
705
|
] }),
|
|
706
706
|
(f ?? []).length > 0 && /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
707
707
|
/* @__PURE__ */ t(ke, {}),
|
|
708
|
-
(f ?? []).map((
|
|
708
|
+
(f ?? []).map((n, a) => /* @__PURE__ */ s(
|
|
709
709
|
"div",
|
|
710
710
|
{
|
|
711
711
|
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
712
|
children: [
|
|
713
713
|
/* @__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:
|
|
714
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: n })
|
|
715
715
|
]
|
|
716
716
|
},
|
|
717
|
-
|
|
717
|
+
a
|
|
718
718
|
))
|
|
719
719
|
] })
|
|
720
|
-
] }) : /* @__PURE__ */ s(
|
|
720
|
+
] }) : /* @__PURE__ */ s(ee, { children: [
|
|
721
721
|
J.replies.length > 0 && /* @__PURE__ */ t("div", { className: "mb-2", children: /* @__PURE__ */ t(
|
|
722
722
|
_t,
|
|
723
723
|
{
|
|
724
|
-
replies: J.replies.map((
|
|
725
|
-
id:
|
|
726
|
-
name:
|
|
727
|
-
text: Se({ kind: "comment", comment:
|
|
728
|
-
created_at:
|
|
724
|
+
replies: J.replies.map((n) => ({
|
|
725
|
+
id: n.id,
|
|
726
|
+
name: Y(n),
|
|
727
|
+
text: Se({ kind: "comment", comment: n }),
|
|
728
|
+
created_at: n.created_at
|
|
729
729
|
})),
|
|
730
730
|
onDismiss: J.dismiss,
|
|
731
731
|
onJump: Ct
|
|
@@ -763,99 +763,99 @@ function ya({
|
|
|
763
763
|
{
|
|
764
764
|
type: "submit",
|
|
765
765
|
size: "sm",
|
|
766
|
-
disabled: !p.trim() && !T.hasReady || T.uploading ||
|
|
767
|
-
children:
|
|
766
|
+
disabled: !p.trim() && !T.hasReady || T.uploading || ne.isPending,
|
|
767
|
+
children: ne.isPending ? "Posting…" : T.uploading ? "Uploading…" : "Comment"
|
|
768
768
|
}
|
|
769
769
|
)
|
|
770
770
|
] })
|
|
771
771
|
] })
|
|
772
772
|
] }),
|
|
773
|
-
P.map((
|
|
773
|
+
P.map((n) => /* @__PURE__ */ s(
|
|
774
774
|
"p",
|
|
775
775
|
{
|
|
776
776
|
className: "flex items-center gap-1.5 text-[11.5px] italic text-slate-400 dark:text-slate-500",
|
|
777
|
-
"data-note-typing":
|
|
777
|
+
"data-note-typing": n.field ?? "",
|
|
778
778
|
"aria-live": "polite",
|
|
779
779
|
children: [
|
|
780
780
|
/* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan motion-reduce:animate-none" }),
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
781
|
+
pt(
|
|
782
|
+
n.names,
|
|
783
|
+
n.field ? `replying on ${(S == null ? void 0 : S.labelOf(n.field)) ?? ye(n.field)}` : "replying"
|
|
784
784
|
),
|
|
785
785
|
"…"
|
|
786
786
|
]
|
|
787
787
|
},
|
|
788
|
-
|
|
788
|
+
n.field ?? ""
|
|
789
789
|
)),
|
|
790
790
|
/* @__PURE__ */ t(ke, { className: "my-4" }),
|
|
791
791
|
F.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
|
|
792
|
-
["people", "system", "integration"].map((
|
|
793
|
-
const
|
|
792
|
+
["people", "system", "integration"].map((n) => {
|
|
793
|
+
const a = !X.has(n), h = me[n];
|
|
794
794
|
return /* @__PURE__ */ s(
|
|
795
795
|
"button",
|
|
796
796
|
{
|
|
797
797
|
type: "button",
|
|
798
|
-
onClick: () =>
|
|
799
|
-
"aria-pressed":
|
|
800
|
-
"data-notes-filter":
|
|
801
|
-
disabled: h === 0 &&
|
|
802
|
-
className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${
|
|
803
|
-
title:
|
|
798
|
+
onClick: () => Be(n),
|
|
799
|
+
"aria-pressed": a,
|
|
800
|
+
"data-notes-filter": n,
|
|
801
|
+
disabled: h === 0 && a,
|
|
802
|
+
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: n === "people" ? "Comments and notes people wrote" : n === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
|
|
804
804
|
children: [
|
|
805
|
-
jt[
|
|
805
|
+
jt[n],
|
|
806
806
|
/* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] opacity-70", children: h })
|
|
807
807
|
]
|
|
808
808
|
},
|
|
809
|
-
|
|
809
|
+
n
|
|
810
810
|
);
|
|
811
811
|
}),
|
|
812
812
|
/* @__PURE__ */ t(
|
|
813
813
|
"input",
|
|
814
814
|
{
|
|
815
815
|
value: V,
|
|
816
|
-
onChange: (
|
|
816
|
+
onChange: (n) => je(n.target.value),
|
|
817
817
|
placeholder: "Search notes…",
|
|
818
818
|
"aria-label": "Search notes",
|
|
819
819
|
"data-notes-search": !0,
|
|
820
820
|
className: "ml-auto h-6 w-[150px] rounded-md border border-slate-200 bg-background px-2 text-[11.5px] dark:border-border"
|
|
821
821
|
}
|
|
822
822
|
),
|
|
823
|
-
|
|
824
|
-
|
|
823
|
+
Ke && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
|
|
824
|
+
ae.length,
|
|
825
825
|
" of ",
|
|
826
826
|
F.length
|
|
827
827
|
] })
|
|
828
828
|
] }),
|
|
829
|
-
|
|
829
|
+
E ? /* @__PURE__ */ t("div", { className: "space-y-4", children: ["a", "b"].map((n) => /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
|
|
830
830
|
/* @__PURE__ */ t("div", { className: "h-8 w-8 shrink-0 animate-pulse rounded-full bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
831
831
|
/* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
|
|
832
832
|
/* @__PURE__ */ t("div", { className: "h-3 w-32 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
833
833
|
/* @__PURE__ */ t("div", { className: "h-3 w-full animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
834
834
|
] })
|
|
835
|
-
] },
|
|
835
|
+
] }, n)) }) : O ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : F.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((n) => {
|
|
836
836
|
var ge;
|
|
837
|
-
if (
|
|
837
|
+
if (n.kind === "related")
|
|
838
838
|
return /* @__PURE__ */ t("div", { className: "nvr-section-enter", children: /* @__PURE__ */ t(
|
|
839
839
|
At,
|
|
840
840
|
{
|
|
841
|
-
note:
|
|
841
|
+
note: n.note,
|
|
842
842
|
collection: e,
|
|
843
843
|
item: String(l)
|
|
844
844
|
}
|
|
845
|
-
) },
|
|
846
|
-
const
|
|
845
|
+
) }, n.note.id);
|
|
846
|
+
const a = n.comment, h = k === a.user.id, L = G === a.id;
|
|
847
847
|
return /* @__PURE__ */ s(
|
|
848
848
|
"div",
|
|
849
849
|
{
|
|
850
|
-
"data-comment-id":
|
|
850
|
+
"data-comment-id": a.id,
|
|
851
851
|
className: "nvr-section-enter group flex gap-3 rounded-lg",
|
|
852
852
|
children: [
|
|
853
853
|
/* @__PURE__ */ t(
|
|
854
854
|
yt,
|
|
855
855
|
{
|
|
856
|
-
userId:
|
|
856
|
+
userId: a.user.id,
|
|
857
857
|
className: "h-8 w-8",
|
|
858
|
-
fallback: /* @__PURE__ */ t(vt, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ t(kt, { className: "bg-
|
|
858
|
+
fallback: /* @__PURE__ */ t(vt, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ t(kt, { className: "bg-[#cbd5e1] text-[11px] font-semibold text-[#334155] dark:bg-[#475569] dark:text-[#f1f5f9]", children: Pt(a.user) }) })
|
|
859
859
|
}
|
|
860
860
|
),
|
|
861
861
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -864,33 +864,33 @@ function ya({
|
|
|
864
864
|
"span",
|
|
865
865
|
{
|
|
866
866
|
className: "text-[13px] font-medium text-slate-800",
|
|
867
|
-
"data-comment-acting-admin": ((ge =
|
|
868
|
-
children:
|
|
867
|
+
"data-comment-acting-admin": ((ge = a.acting_admin) == null ? void 0 : ge.id) || void 0,
|
|
868
|
+
children: Y(a)
|
|
869
869
|
}
|
|
870
870
|
),
|
|
871
|
-
/* @__PURE__ */ t(bt, { label:
|
|
871
|
+
/* @__PURE__ */ t(bt, { label: a.via_agent }),
|
|
872
872
|
/* @__PURE__ */ t(
|
|
873
873
|
"span",
|
|
874
874
|
{
|
|
875
875
|
className: "text-[11px] text-slate-400",
|
|
876
|
-
"data-tip": ie(
|
|
877
|
-
children: /* @__PURE__ */ t(
|
|
876
|
+
"data-tip": ie(a.created_at),
|
|
877
|
+
children: /* @__PURE__ */ t(Re, { value: a.created_at })
|
|
878
878
|
}
|
|
879
879
|
),
|
|
880
|
-
|
|
881
|
-
|
|
880
|
+
a.updated_at && a.updated_at !== a.created_at && /* @__PURE__ */ t("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
|
|
881
|
+
a.field && /* @__PURE__ */ t(
|
|
882
882
|
Mt,
|
|
883
883
|
{
|
|
884
|
-
field:
|
|
885
|
-
label: (S == null ? void 0 : S.labelOf(
|
|
886
|
-
resolved: !!
|
|
887
|
-
onJump: S ? () => S.jump(
|
|
884
|
+
field: a.field,
|
|
885
|
+
label: (S == null ? void 0 : S.labelOf(a.field)) ?? ye(a.field),
|
|
886
|
+
resolved: !!a.resolved_at,
|
|
887
|
+
onJump: S ? () => S.jump(a.field) : void 0
|
|
888
888
|
}
|
|
889
889
|
),
|
|
890
890
|
!L && /* @__PURE__ */ s(
|
|
891
891
|
"div",
|
|
892
892
|
{
|
|
893
|
-
className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${Q ===
|
|
893
|
+
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"}`,
|
|
894
894
|
children: [
|
|
895
895
|
/* @__PURE__ */ t(
|
|
896
896
|
"button",
|
|
@@ -899,23 +899,23 @@ function ya({
|
|
|
899
899
|
title: "Make a task from this comment",
|
|
900
900
|
"aria-label": "Make a task from this comment",
|
|
901
901
|
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(
|
|
902
|
+
onClick: () => Qe.mutate(a),
|
|
903
|
+
children: /* @__PURE__ */ t(We, { className: "h-3 w-3" })
|
|
904
904
|
}
|
|
905
905
|
),
|
|
906
|
-
h && (Q ===
|
|
906
|
+
h && (Q === a.id ? /* @__PURE__ */ s(ee, { children: [
|
|
907
907
|
/* @__PURE__ */ t(
|
|
908
908
|
"button",
|
|
909
909
|
{
|
|
910
910
|
type: "button",
|
|
911
911
|
autoFocus: !0,
|
|
912
|
-
disabled:
|
|
913
|
-
"data-comment-delete-confirm":
|
|
912
|
+
disabled: re.isPending,
|
|
913
|
+
"data-comment-delete-confirm": a.id,
|
|
914
914
|
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: () =>
|
|
915
|
+
onClick: () => re.mutate(a.id, {
|
|
916
916
|
onSettled: () => R(null)
|
|
917
917
|
}),
|
|
918
|
-
children:
|
|
918
|
+
children: re.isPending ? "Deleting…" : "Delete comment?"
|
|
919
919
|
}
|
|
920
920
|
),
|
|
921
921
|
/* @__PURE__ */ t(
|
|
@@ -927,7 +927,7 @@ function ya({
|
|
|
927
927
|
children: "Keep"
|
|
928
928
|
}
|
|
929
929
|
)
|
|
930
|
-
] }) : /* @__PURE__ */ s(
|
|
930
|
+
] }) : /* @__PURE__ */ s(ee, { children: [
|
|
931
931
|
/* @__PURE__ */ t(
|
|
932
932
|
"button",
|
|
933
933
|
{
|
|
@@ -936,9 +936,9 @@ function ya({
|
|
|
936
936
|
"aria-label": "Edit comment",
|
|
937
937
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",
|
|
938
938
|
onClick: () => {
|
|
939
|
-
B(
|
|
939
|
+
B(a.id), r(a.text);
|
|
940
940
|
},
|
|
941
|
-
children: /* @__PURE__ */ t(
|
|
941
|
+
children: /* @__PURE__ */ t(He, { className: "h-3 w-3" })
|
|
942
942
|
}
|
|
943
943
|
),
|
|
944
944
|
/* @__PURE__ */ t(
|
|
@@ -948,8 +948,8 @@ function ya({
|
|
|
948
948
|
title: "Delete comment",
|
|
949
949
|
"aria-label": "Delete comment",
|
|
950
950
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500",
|
|
951
|
-
onClick: () => R(
|
|
952
|
-
children: /* @__PURE__ */ t(
|
|
951
|
+
onClick: () => R(a.id),
|
|
952
|
+
children: /* @__PURE__ */ t(Ge, { className: "h-3 w-3" })
|
|
953
953
|
}
|
|
954
954
|
)
|
|
955
955
|
] }))
|
|
@@ -974,9 +974,9 @@ function ya({
|
|
|
974
974
|
size: "sm",
|
|
975
975
|
className: "h-7 gap-1.5",
|
|
976
976
|
disabled: !U.trim() || ue.isPending,
|
|
977
|
-
onClick: () => ue.mutate({ id:
|
|
977
|
+
onClick: () => ue.mutate({ id: a.id, text: U.trim() }),
|
|
978
978
|
children: [
|
|
979
|
-
/* @__PURE__ */ t(
|
|
979
|
+
/* @__PURE__ */ t(Ee, { className: "h-3 w-3" }),
|
|
980
980
|
" Save"
|
|
981
981
|
]
|
|
982
982
|
}
|
|
@@ -991,7 +991,7 @@ function ya({
|
|
|
991
991
|
B(null), r("");
|
|
992
992
|
},
|
|
993
993
|
children: [
|
|
994
|
-
/* @__PURE__ */ t(
|
|
994
|
+
/* @__PURE__ */ t(Je, { className: "h-3 w-3" }),
|
|
995
995
|
" Cancel"
|
|
996
996
|
]
|
|
997
997
|
}
|
|
@@ -1000,15 +1000,16 @@ function ya({
|
|
|
1000
1000
|
] }) : /* @__PURE__ */ t(
|
|
1001
1001
|
qt,
|
|
1002
1002
|
{
|
|
1003
|
-
text:
|
|
1003
|
+
text: a.text,
|
|
1004
1004
|
record: { collection: e, itemId: l },
|
|
1005
|
+
caption: `${Y(a)} · ${De(a.created_at)}`,
|
|
1005
1006
|
className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600"
|
|
1006
1007
|
}
|
|
1007
1008
|
),
|
|
1008
1009
|
!L && /* @__PURE__ */ t(
|
|
1009
1010
|
Ft,
|
|
1010
1011
|
{
|
|
1011
|
-
comment:
|
|
1012
|
+
comment: a,
|
|
1012
1013
|
collection: e,
|
|
1013
1014
|
item: String(l)
|
|
1014
1015
|
}
|
|
@@ -1016,17 +1017,17 @@ function ya({
|
|
|
1016
1017
|
!L && /* @__PURE__ */ t(
|
|
1017
1018
|
St,
|
|
1018
1019
|
{
|
|
1019
|
-
people:
|
|
1020
|
-
hasMentions: oe(
|
|
1021
|
-
exclude: new Set(oe(
|
|
1020
|
+
people: a.seen_by,
|
|
1021
|
+
hasMentions: oe(a).length > 0,
|
|
1022
|
+
exclude: new Set(oe(a).map((D) => String(D.id).toUpperCase()))
|
|
1022
1023
|
}
|
|
1023
1024
|
),
|
|
1024
1025
|
!L && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
|
|
1025
|
-
(
|
|
1026
|
+
(a.reactions ?? []).map((D) => /* @__PURE__ */ s(
|
|
1026
1027
|
"button",
|
|
1027
1028
|
{
|
|
1028
1029
|
type: "button",
|
|
1029
|
-
onClick: () => xe.mutate({ id:
|
|
1030
|
+
onClick: () => xe.mutate({ id: a.id, emoji: D.emoji }),
|
|
1030
1031
|
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"}`,
|
|
1031
1032
|
children: [
|
|
1032
1033
|
D.emoji,
|
|
@@ -1040,18 +1041,18 @@ function ya({
|
|
|
1040
1041
|
"button",
|
|
1041
1042
|
{
|
|
1042
1043
|
type: "button",
|
|
1043
|
-
onClick: () => be(he ===
|
|
1044
|
+
onClick: () => be(he === a.id ? null : a.id),
|
|
1044
1045
|
className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
|
|
1045
1046
|
"aria-label": "Add reaction",
|
|
1046
1047
|
children: /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" })
|
|
1047
1048
|
}
|
|
1048
1049
|
),
|
|
1049
|
-
he ===
|
|
1050
|
+
he === 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: Pe.map((D) => /* @__PURE__ */ t(
|
|
1050
1051
|
"button",
|
|
1051
1052
|
{
|
|
1052
1053
|
type: "button",
|
|
1053
1054
|
onClick: () => {
|
|
1054
|
-
xe.mutate({ id:
|
|
1055
|
+
xe.mutate({ id: a.id, emoji: D }), be(null);
|
|
1055
1056
|
},
|
|
1056
1057
|
className: "rounded-full px-1 text-[14px] hover:bg-muted",
|
|
1057
1058
|
children: D
|
|
@@ -1063,7 +1064,7 @@ function ya({
|
|
|
1063
1064
|
] })
|
|
1064
1065
|
]
|
|
1065
1066
|
},
|
|
1066
|
-
|
|
1067
|
+
a.id
|
|
1067
1068
|
);
|
|
1068
1069
|
}) })
|
|
1069
1070
|
] }) })
|