@nivaro/react 0.3.117 → 0.3.119
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 +136 -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 +3757 -3695
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4451 -4385
- 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/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/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/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 +135 -94
- 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 +88 -85
- 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 +245 -141
- 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 +15 -16
- 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/addendum-view.js +6 -0
- 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 +151 -130
- 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/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
- 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/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 { jsx as n, jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { MessageSquare as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { useRepliesWhileTyping as
|
|
9
|
-
import { openFieldCommentCounts as
|
|
10
|
-
import { useDraftTypingSignal as
|
|
11
|
-
import { cn as
|
|
12
|
-
import { RepliesWhileTyping as ne, SeenByLine as re, MentionDeliveryButton as
|
|
13
|
-
import { useCommentImages as
|
|
1
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as E, useQueryClient as U, useMutation as q } from "@tanstack/react-query";
|
|
3
|
+
import { MessageSquare as W, Link2 as A, RotateCcw as H, Check as z } from "lucide-react";
|
|
4
|
+
import { useState as k, useMemo as v } from "react";
|
|
5
|
+
import { toast as y } from "sonner";
|
|
6
|
+
import { useNivaroClient as L } from "../../context.js";
|
|
7
|
+
import { get as G, post as D } from "../../lib/commands.js";
|
|
8
|
+
import { useRepliesWhileTyping as J } from "../../lib/comment-awareness.js";
|
|
9
|
+
import { openFieldCommentCounts as V, fieldThread as X, fieldDeepLinkQuery as Y } from "../../lib/field-comments.js";
|
|
10
|
+
import { useDraftTypingSignal as Z, useRecordSignalPeers as ee, useMyUserId as te, signalSentence as oe } from "../../lib/presence-signals.js";
|
|
11
|
+
import { cn as M, formatRelative as I } from "../../lib/utils.js";
|
|
12
|
+
import { RepliesWhileTyping as ne, SeenByLine as re, MentionDeliveryButton as ae } from "../panels/CommentAwareness.js";
|
|
13
|
+
import { useCommentImages as ie, CommentImageStrip as se, CommentBody as le } from "../panels/CommentImages.js";
|
|
14
14
|
import { notePreviewText as de, MentionTextarea as me } from "../panels/CommentPanel.js";
|
|
15
15
|
import { Popover as ce, PopoverTrigger as pe, PopoverContent as ue } from "../ui/popover.js";
|
|
16
16
|
import { useFieldComments as he } from "./field-comments-context.js";
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
queryKey:
|
|
22
|
-
queryFn: () =>
|
|
17
|
+
const K = (t, o) => ["comments", t, o];
|
|
18
|
+
function O(t, o, r) {
|
|
19
|
+
const a = L();
|
|
20
|
+
return E({
|
|
21
|
+
queryKey: K(t, o),
|
|
22
|
+
queryFn: () => a.request(G("/comments", { collection: t, item: o })).then((m) => m.data),
|
|
23
23
|
enabled: r
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
function De(t) {
|
|
27
|
-
const o = t.itemId == null ? "" : String(t.itemId), r = t.enabled && o !== "" && o !== "new", { data:
|
|
27
|
+
const o = t.itemId == null ? "" : String(t.itemId), r = t.enabled && o !== "" && o !== "new", { data: a } = O(t.collection, o, r), [m, s] = k(null), c = v(() => V(a ?? []), [a]), { labelOf: l, jump: u, collection: f } = t;
|
|
28
28
|
return v(
|
|
29
29
|
() => r ? { collection: f, item: o, counts: c, openField: m, setOpenField: s, labelOf: l, jump: u } : null,
|
|
30
30
|
[r, f, o, c, m, l, u]
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function b(t) {
|
|
34
34
|
return t ? [t.first_name, t.last_name].filter(Boolean).join(" ") || t.email : "Someone";
|
|
35
35
|
}
|
|
36
36
|
function Ie({ field: t, label: o }) {
|
|
@@ -42,23 +42,25 @@ function xe({
|
|
|
42
42
|
field: o,
|
|
43
43
|
label: r
|
|
44
44
|
}) {
|
|
45
|
-
const
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */ n(pe, { asChild: !0, children: /* @__PURE__ */
|
|
45
|
+
const a = t.counts[o] ?? 0, m = t.openField === o;
|
|
46
|
+
return /* @__PURE__ */ i(ce, { open: m, onOpenChange: (s) => t.setOpenField(s ? o : null), children: [
|
|
47
|
+
/* @__PURE__ */ n(pe, { asChild: !0, children: /* @__PURE__ */ i(
|
|
48
48
|
"button",
|
|
49
49
|
{
|
|
50
50
|
type: "button",
|
|
51
51
|
"data-field-comment": o,
|
|
52
|
-
"data-field-comment-count":
|
|
53
|
-
"aria-label":
|
|
54
|
-
"data-tip":
|
|
55
|
-
className:
|
|
52
|
+
"data-field-comment-count": a || void 0,
|
|
53
|
+
"aria-label": a ? `${a} open ${a === 1 ? "comment" : "comments"} on ${r}` : `Comment on ${r}`,
|
|
54
|
+
"data-tip": a ? void 0 : `Comment on ${r}`,
|
|
55
|
+
className: M(
|
|
56
56
|
"inline-flex items-center gap-0.5 rounded px-0.5 py-0.5 text-[10px] font-semibold transition-[opacity,color]",
|
|
57
|
-
|
|
57
|
+
// Always shown where comments are on (Rob 2026-11-16: a hover-only icon was easy to
|
|
58
|
+
// miss and jumped in beside the lock); quiet grey until a thread exists.
|
|
59
|
+
a || m ? "text-[#0e7490] dark:text-nvr-cyan" : "text-slate-400 hover:text-[#0e7490] dark:text-slate-500 dark:hover:text-nvr-cyan"
|
|
58
60
|
),
|
|
59
61
|
children: [
|
|
60
|
-
/* @__PURE__ */ n(
|
|
61
|
-
|
|
62
|
+
/* @__PURE__ */ n(W, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
63
|
+
a > 0 && /* @__PURE__ */ n("span", { className: "tabular-nums", children: a })
|
|
62
64
|
]
|
|
63
65
|
}
|
|
64
66
|
) }),
|
|
@@ -82,17 +84,17 @@ function fe({
|
|
|
82
84
|
field: o,
|
|
83
85
|
label: r
|
|
84
86
|
}) {
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const w =
|
|
87
|
+
const a = L(), m = U(), { data: s, isLoading: c } = O(t.collection, t.item, !0), l = v(() => X(s ?? [], o), [s, o]), [u, f] = k(!1), [h, C] = k(""), p = ie();
|
|
88
|
+
Z(t.collection, t.item, h, o);
|
|
89
|
+
const w = ee(t.collection, t.item, "note", { field: o }), j = te(), B = v(
|
|
88
90
|
() => (s ?? []).filter((e) => e.field === o && !e.resolved_at),
|
|
89
91
|
[s, o]
|
|
90
|
-
),
|
|
91
|
-
var x,
|
|
92
|
-
return ((
|
|
93
|
-
},
|
|
94
|
-
mutationFn: (e) =>
|
|
95
|
-
|
|
92
|
+
), N = J(h, s ? B : void 0, j), $ = () => m.invalidateQueries({ queryKey: K(t.collection, t.item) }), F = (e, d) => {
|
|
93
|
+
var x, _, P;
|
|
94
|
+
return ((_ = (x = e == null ? void 0 : e.response) == null ? void 0 : x.data) == null ? void 0 : _.error) ?? ((P = e == null ? void 0 : e.data) == null ? void 0 : P.error) ?? d;
|
|
95
|
+
}, g = q({
|
|
96
|
+
mutationFn: (e) => a.request(
|
|
97
|
+
D("/comments", {
|
|
96
98
|
collection: t.collection,
|
|
97
99
|
item: t.item,
|
|
98
100
|
text: e,
|
|
@@ -101,40 +103,40 @@ function fe({
|
|
|
101
103
|
})
|
|
102
104
|
),
|
|
103
105
|
onSuccess: () => {
|
|
104
|
-
|
|
106
|
+
C(""), p.reset(), $();
|
|
105
107
|
},
|
|
106
|
-
onError: (e) =>
|
|
107
|
-
}),
|
|
108
|
-
mutationFn: ({ id: e, resolved: d }) =>
|
|
109
|
-
onSuccess: () => void
|
|
110
|
-
onError: (e) =>
|
|
111
|
-
}),
|
|
108
|
+
onError: (e) => y.error(F(e, "Could not post the comment"))
|
|
109
|
+
}), R = q({
|
|
110
|
+
mutationFn: ({ id: e, resolved: d }) => a.request(D(`/comments/${e}/resolve`, { resolved: d })),
|
|
111
|
+
onSuccess: () => void $(),
|
|
112
|
+
onError: (e) => y.error(F(e, "Could not update the comment"))
|
|
113
|
+
}), S = () => {
|
|
112
114
|
const e = p.compose(h);
|
|
113
|
-
e && !p.uploading && !
|
|
114
|
-
},
|
|
115
|
+
e && !p.uploading && !g.isPending && g.mutate(e);
|
|
116
|
+
}, Q = () => {
|
|
115
117
|
const e = new URL(window.location.href);
|
|
116
118
|
e.searchParams.delete("field");
|
|
117
119
|
const d = e.search ? "&" : "?";
|
|
118
|
-
navigator.clipboard.writeText(`${e.origin}${e.pathname}${e.search}${d}${
|
|
119
|
-
() =>
|
|
120
|
-
() =>
|
|
120
|
+
navigator.clipboard.writeText(`${e.origin}${e.pathname}${e.search}${d}${Y(o)}`).then(
|
|
121
|
+
() => y.success("Link to this field copied"),
|
|
122
|
+
() => y.error("Could not copy")
|
|
121
123
|
);
|
|
122
|
-
},
|
|
124
|
+
}, T = (e, d) => {
|
|
123
125
|
var x;
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */ n("span", { className: "truncate text-[12px] font-medium text-slate-800 dark:text-foreground", children:
|
|
127
|
-
/* @__PURE__ */ n("span", { className: "shrink-0 text-[11px] text-slate-400 dark:text-muted-foreground", children:
|
|
128
|
-
/* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ i("li", { "data-field-comment-row": e.id, className: "px-3 py-2", children: [
|
|
127
|
+
/* @__PURE__ */ i("div", { className: "flex items-baseline gap-1.5", children: [
|
|
128
|
+
/* @__PURE__ */ n("span", { className: "truncate text-[12px] font-medium text-slate-800 dark:text-foreground", children: b(e.user) }),
|
|
129
|
+
/* @__PURE__ */ n("span", { className: "shrink-0 text-[11px] text-slate-400 dark:text-muted-foreground", children: I(e.created_at) }),
|
|
130
|
+
/* @__PURE__ */ i(
|
|
129
131
|
"button",
|
|
130
132
|
{
|
|
131
133
|
type: "button",
|
|
132
|
-
disabled:
|
|
133
|
-
onClick: () =>
|
|
134
|
+
disabled: R.isPending,
|
|
135
|
+
onClick: () => R.mutate({ id: e.id, resolved: !d }),
|
|
134
136
|
"data-field-comment-resolve": e.id,
|
|
135
137
|
className: "ml-auto inline-flex shrink-0 items-center gap-1 rounded px-1 py-px text-[11px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground",
|
|
136
138
|
children: [
|
|
137
|
-
d ? /* @__PURE__ */ n(
|
|
139
|
+
d ? /* @__PURE__ */ n(H, { "aria-hidden": !0, className: "h-3 w-3" }) : /* @__PURE__ */ n(z, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
138
140
|
d ? "Reopen" : "Resolve"
|
|
139
141
|
]
|
|
140
142
|
}
|
|
@@ -144,21 +146,22 @@ function fe({
|
|
|
144
146
|
le,
|
|
145
147
|
{
|
|
146
148
|
text: e.text,
|
|
147
|
-
|
|
149
|
+
caption: `${b(e.user)} · ${I(e.created_at)}`,
|
|
150
|
+
className: M(
|
|
148
151
|
"m-0 mt-0.5 whitespace-pre-wrap text-[12.5px] leading-snug [overflow-wrap:anywhere]",
|
|
149
152
|
d ? "text-slate-400 dark:text-muted-foreground" : "text-slate-600 dark:text-slate-300"
|
|
150
153
|
)
|
|
151
154
|
}
|
|
152
155
|
),
|
|
153
|
-
!d && ((((x = e.seen_by) == null ? void 0 : x.length) ?? 0) > 0 || e.delivery_visible) && /* @__PURE__ */
|
|
156
|
+
!d && ((((x = e.seen_by) == null ? void 0 : x.length) ?? 0) > 0 || e.delivery_visible) && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-x-2", children: [
|
|
154
157
|
/* @__PURE__ */ n(re, { people: e.seen_by }),
|
|
155
|
-
e.delivery_visible && /* @__PURE__ */ n(
|
|
158
|
+
e.delivery_visible && /* @__PURE__ */ n(ae, { collection: t.collection, item: t.item, commentId: e.id })
|
|
156
159
|
] })
|
|
157
160
|
] }, e.id);
|
|
158
161
|
};
|
|
159
|
-
return /* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ i("div", { "data-field-comments": o, children: [
|
|
163
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-border", children: [
|
|
164
|
+
/* @__PURE__ */ i("p", { className: "m-0 min-w-0 flex-1 truncate text-[12px] font-semibold text-slate-700 dark:text-foreground", children: [
|
|
162
165
|
"Comments on ",
|
|
163
166
|
r
|
|
164
167
|
] }),
|
|
@@ -166,18 +169,18 @@ function fe({
|
|
|
166
169
|
"button",
|
|
167
170
|
{
|
|
168
171
|
type: "button",
|
|
169
|
-
onClick:
|
|
172
|
+
onClick: Q,
|
|
170
173
|
"aria-label": `Copy a link to ${r}`,
|
|
171
174
|
"data-tip": "Copy a link that opens the record on this field",
|
|
172
175
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-foreground",
|
|
173
|
-
children: /* @__PURE__ */ n(
|
|
176
|
+
children: /* @__PURE__ */ n(A, { "aria-hidden": !0, className: "h-3.5 w-3.5" })
|
|
174
177
|
}
|
|
175
178
|
)
|
|
176
179
|
] }),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
c ? /* @__PURE__ */ n("p", { className: "m-0 px-3 py-3 text-[12px] text-slate-400 dark:text-muted-foreground", children: "Loading…" }) : l.open.length === 0 && l.resolved.length === 0 ? /* @__PURE__ */ n("p", { className: "m-0 px-3 py-3 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No comments on this field yet. They also show in the record’s Comments." }) : /* @__PURE__ */
|
|
179
|
-
l.open.map((e) =>
|
|
180
|
-
u && l.resolved.map((e) =>
|
|
180
|
+
/* @__PURE__ */ i("div", { className: "max-h-[260px] overflow-y-auto overscroll-contain", children: [
|
|
181
|
+
c ? /* @__PURE__ */ n("p", { className: "m-0 px-3 py-3 text-[12px] text-slate-400 dark:text-muted-foreground", children: "Loading…" }) : l.open.length === 0 && l.resolved.length === 0 ? /* @__PURE__ */ n("p", { className: "m-0 px-3 py-3 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No comments on this field yet. They also show in the record’s Comments." }) : /* @__PURE__ */ i("ul", { className: "m-0 list-none divide-y divide-slate-100 p-0 dark:divide-border", children: [
|
|
182
|
+
l.open.map((e) => T(e, !1)),
|
|
183
|
+
u && l.resolved.map((e) => T(e, !0))
|
|
181
184
|
] }),
|
|
182
185
|
l.resolved.length > 0 && /* @__PURE__ */ n(
|
|
183
186
|
"button",
|
|
@@ -190,7 +193,7 @@ function fe({
|
|
|
190
193
|
}
|
|
191
194
|
)
|
|
192
195
|
] }),
|
|
193
|
-
w.length > 0 && /* @__PURE__ */
|
|
196
|
+
w.length > 0 && /* @__PURE__ */ i(
|
|
194
197
|
"p",
|
|
195
198
|
{
|
|
196
199
|
"data-field-comment-typing": o,
|
|
@@ -198,51 +201,51 @@ function fe({
|
|
|
198
201
|
className: "m-0 flex items-center gap-1.5 border-t border-slate-100 px-3 py-1.5 text-[11.5px] italic text-slate-400 dark:border-border dark:text-slate-500",
|
|
199
202
|
children: [
|
|
200
203
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan motion-reduce:animate-none" }),
|
|
201
|
-
|
|
204
|
+
oe(w, "replying"),
|
|
202
205
|
"…"
|
|
203
206
|
]
|
|
204
207
|
}
|
|
205
208
|
),
|
|
206
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ i("div", { className: "space-y-1.5 border-t border-slate-200 p-2 dark:border-border", children: [
|
|
207
210
|
/* @__PURE__ */ n(
|
|
208
211
|
ne,
|
|
209
212
|
{
|
|
210
213
|
compact: !0,
|
|
211
|
-
replies:
|
|
214
|
+
replies: N.replies.map((e) => ({
|
|
212
215
|
id: e.id,
|
|
213
|
-
name:
|
|
216
|
+
name: b(e.user),
|
|
214
217
|
text: de({ kind: "comment", comment: e }),
|
|
215
218
|
created_at: e.created_at
|
|
216
219
|
})),
|
|
217
|
-
onDismiss:
|
|
220
|
+
onDismiss: N.dismiss
|
|
218
221
|
}
|
|
219
222
|
),
|
|
220
223
|
/* @__PURE__ */ n(
|
|
221
224
|
me,
|
|
222
225
|
{
|
|
223
226
|
value: h,
|
|
224
|
-
onChange:
|
|
227
|
+
onChange: C,
|
|
225
228
|
onImages: p.addFiles,
|
|
226
229
|
rows: 2,
|
|
227
230
|
"aria-label": `Comment on ${r}`,
|
|
228
231
|
placeholder: "Write a comment… type @ to mention someone",
|
|
229
232
|
className: "min-h-[56px] text-[12.5px]",
|
|
230
233
|
onKeyDownCapture: (e) => {
|
|
231
|
-
e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(),
|
|
234
|
+
e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), S());
|
|
232
235
|
}
|
|
233
236
|
}
|
|
234
237
|
),
|
|
235
238
|
/* @__PURE__ */ n(se, { images: p }),
|
|
236
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
|
|
237
240
|
/* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Only people who can open this record are notified." }),
|
|
238
241
|
/* @__PURE__ */ n(
|
|
239
242
|
"button",
|
|
240
243
|
{
|
|
241
244
|
type: "button",
|
|
242
|
-
onClick:
|
|
243
|
-
disabled: !h.trim() && !p.hasReady || p.uploading ||
|
|
245
|
+
onClick: S,
|
|
246
|
+
disabled: !h.trim() && !p.hasReady || p.uploading || g.isPending,
|
|
244
247
|
className: "inline-flex h-7 shrink-0 items-center rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white transition-colors hover:bg-nvr-cyan-dark disabled:opacity-50",
|
|
245
|
-
children:
|
|
248
|
+
children: g.isPending ? "Posting…" : p.uploading ? "Uploading…" : "Comment"
|
|
246
249
|
}
|
|
247
250
|
)
|
|
248
251
|
] })
|
|
@@ -1,126 +1,141 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Crosshair as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useFieldPointer as
|
|
7
|
-
import { useLivePreference as
|
|
8
|
-
import { CoViewerAvatar as
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as p, Fragment as E, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Crosshair as H, X as R } from "lucide-react";
|
|
3
|
+
import { useState as q, useRef as b, useEffect as c } from "react";
|
|
4
|
+
import { createPortal as T } from "react-dom";
|
|
5
|
+
import { toast as w } from "sonner";
|
|
6
|
+
import { useFieldPointer as _, useCoViewers as A, pointMayScroll as B, pointRefusalText as D } from "../../lib/co-edit.js";
|
|
7
|
+
import { useLivePreference as F } from "../../lib/live-preference.js";
|
|
8
|
+
import { CoViewerAvatar as I } from "./SectionPresence.js";
|
|
9
|
+
const L = 6e4, O = 6e3, j = 72;
|
|
10
|
+
function M(e) {
|
|
11
|
+
for (let t = (e == null ? void 0 : e.parentElement) ?? null; t; t = t.parentElement) {
|
|
12
|
+
const i = getComputedStyle(t).overflowY;
|
|
13
|
+
if ((i === "auto" || i === "scroll") && t.scrollHeight > t.clientHeight) return t;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
10
17
|
let C = 0, k = !1;
|
|
11
|
-
function
|
|
18
|
+
function $() {
|
|
12
19
|
if (k || typeof document > "u") return;
|
|
13
20
|
k = !0;
|
|
14
21
|
const e = () => {
|
|
15
22
|
C = Date.now();
|
|
16
23
|
};
|
|
17
|
-
for (const
|
|
18
|
-
document.addEventListener(
|
|
24
|
+
for (const t of ["pointerdown", "wheel", "keydown", "touchstart"])
|
|
25
|
+
document.addEventListener(t, e, { capture: !0, passive: !0 });
|
|
19
26
|
}
|
|
20
|
-
function
|
|
21
|
-
var
|
|
27
|
+
function z() {
|
|
28
|
+
var t;
|
|
22
29
|
const e = typeof document < "u" ? document.activeElement : null;
|
|
23
|
-
return !e || e === document.body ? !1 : ((
|
|
30
|
+
return !e || e === document.body ? !1 : ((t = e.matches) == null ? void 0 : t.call(e, 'input, textarea, select, [contenteditable="true"], [role="combobox"]')) ?? !1;
|
|
24
31
|
}
|
|
25
32
|
function G() {
|
|
26
33
|
return typeof document < "u" && !!document.querySelector('[data-radix-popper-content-wrapper], [role="menu"]');
|
|
27
34
|
}
|
|
28
|
-
function
|
|
35
|
+
function ee({
|
|
29
36
|
collection: e,
|
|
30
|
-
itemId:
|
|
31
|
-
fieldLabel:
|
|
32
|
-
onGo:
|
|
37
|
+
itemId: t,
|
|
38
|
+
fieldLabel: i,
|
|
39
|
+
onGo: d
|
|
33
40
|
}) {
|
|
34
|
-
var
|
|
35
|
-
const { pointer:
|
|
36
|
-
|
|
37
|
-
const x =
|
|
38
|
-
x.current =
|
|
39
|
-
if (!
|
|
40
|
-
const
|
|
41
|
+
var g;
|
|
42
|
+
const { pointer: s, result: n, dismiss: S } = _(e, t), N = A(e, t), { quiet: v } = F(), [r, u] = q(null), m = b(null), h = b(d);
|
|
43
|
+
h.current = d;
|
|
44
|
+
const x = b(v);
|
|
45
|
+
x.current = v, c(() => $(), []), c(() => {
|
|
46
|
+
if (!s) return;
|
|
47
|
+
const a = B({
|
|
41
48
|
quiet: x.current,
|
|
42
49
|
visible: typeof document > "u" || document.visibilityState === "visible",
|
|
43
|
-
editingSomething:
|
|
50
|
+
editingSomething: z(),
|
|
44
51
|
popoverOpen: G(),
|
|
45
52
|
lastInputAt: C,
|
|
46
53
|
now: Date.now()
|
|
47
|
-
}) ?
|
|
48
|
-
|
|
49
|
-
}, [
|
|
54
|
+
}) ? h.current(s.field) : !1;
|
|
55
|
+
u({ p: s, scrolled: a }), S();
|
|
56
|
+
}, [s == null ? void 0 : s.at]), c(() => {
|
|
57
|
+
if (!r) return;
|
|
58
|
+
const o = setTimeout(() => u(null), r.scrolled ? O : L);
|
|
59
|
+
return () => clearTimeout(o);
|
|
60
|
+
}, [r]), c(() => {
|
|
61
|
+
var f;
|
|
62
|
+
if (!n) return;
|
|
63
|
+
const o = (f = N.find((P) => P.id.toUpperCase() === n.to.toUpperCase())) == null ? void 0 : f.name, a = o ?? "They";
|
|
64
|
+
n.ok ? w(`${a} was pointed to ${i(n.field)}`) : w.info(D(n.reason, o ?? "That person"));
|
|
65
|
+
}, [n == null ? void 0 : n.seq]), c(() => {
|
|
50
66
|
if (!r) return;
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/* @__PURE__ */ i(
|
|
67
|
+
const o = M(m.current);
|
|
68
|
+
if (!o) return;
|
|
69
|
+
const a = o.style.paddingBottom, f = Number.parseFloat(getComputedStyle(o).paddingBottom) || 0;
|
|
70
|
+
return o.style.paddingBottom = `${f + j}px`, () => {
|
|
71
|
+
o.style.paddingBottom = a;
|
|
72
|
+
};
|
|
73
|
+
}, [r]);
|
|
74
|
+
const y = ((g = m.current) == null ? void 0 : g.closest('[role="dialog"]')) ?? (typeof document < "u" ? document.body : null);
|
|
75
|
+
return /* @__PURE__ */ p(E, { children: [
|
|
76
|
+
/* @__PURE__ */ l("span", { ref: m, hidden: !0 }),
|
|
77
|
+
r && y && T(
|
|
78
|
+
/* @__PURE__ */ l(
|
|
64
79
|
U,
|
|
65
80
|
{
|
|
66
81
|
pointer: r.p,
|
|
67
|
-
label:
|
|
82
|
+
label: i(r.p.field),
|
|
68
83
|
scrolled: r.scrolled,
|
|
69
84
|
onGo: () => {
|
|
70
|
-
|
|
85
|
+
h.current(r.p.field), u(null);
|
|
71
86
|
},
|
|
72
|
-
onClose: () =>
|
|
87
|
+
onClose: () => u(null)
|
|
73
88
|
}
|
|
74
89
|
),
|
|
75
|
-
|
|
90
|
+
y
|
|
76
91
|
)
|
|
77
92
|
] });
|
|
78
93
|
}
|
|
79
94
|
function U({
|
|
80
95
|
pointer: e,
|
|
81
|
-
label:
|
|
82
|
-
scrolled:
|
|
83
|
-
onGo:
|
|
84
|
-
onClose:
|
|
96
|
+
label: t,
|
|
97
|
+
scrolled: i,
|
|
98
|
+
onGo: d,
|
|
99
|
+
onClose: s
|
|
85
100
|
}) {
|
|
86
|
-
const
|
|
87
|
-
return /* @__PURE__ */
|
|
101
|
+
const n = e.user;
|
|
102
|
+
return /* @__PURE__ */ p(
|
|
88
103
|
"div",
|
|
89
104
|
{
|
|
90
105
|
role: "status",
|
|
91
106
|
"aria-live": "polite",
|
|
92
107
|
"data-field-pointer": e.field,
|
|
93
|
-
className: "nvr-slide-up-centered fixed bottom-
|
|
108
|
+
className: "nvr-slide-up-centered fixed bottom-[max(1.25rem,env(safe-area-inset-bottom))] left-1/2 z-[60] flex max-w-[calc(100vw-32px)] -translate-x-1/2 items-center gap-2 rounded-full border border-slate-200 bg-white py-1 pl-1.5 pr-1 text-[12.5px] text-slate-700 shadow-lg shadow-slate-900/5 dark:border-border dark:bg-card dark:text-slate-200 dark:shadow-black/30",
|
|
94
109
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ l(I, { person: n, size: 22 }),
|
|
111
|
+
/* @__PURE__ */ p("span", { className: "min-w-0 truncate", children: [
|
|
112
|
+
/* @__PURE__ */ l("span", { className: "font-medium text-slate-900 dark:text-slate-50", children: n.name }),
|
|
98
113
|
" ",
|
|
99
|
-
|
|
114
|
+
i ? "pointed you here:" : "pointed you to",
|
|
100
115
|
" ",
|
|
101
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ l("span", { className: "font-medium text-slate-900 dark:text-slate-50", children: t })
|
|
102
117
|
] }),
|
|
103
|
-
!
|
|
118
|
+
!i && /* @__PURE__ */ p(
|
|
104
119
|
"button",
|
|
105
120
|
{
|
|
106
121
|
type: "button",
|
|
107
|
-
onClick:
|
|
122
|
+
onClick: d,
|
|
108
123
|
"data-field-pointer-go": "",
|
|
109
|
-
className: "inline-flex shrink-0 items-center gap-1 rounded px-
|
|
124
|
+
className: "inline-flex h-7 shrink-0 items-center gap-1 rounded-full border border-cyan-600/30 bg-cyan-50 px-2.5 text-[12px] font-semibold text-[#0e7490] transition-colors hover:bg-cyan-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:border-nvr-cyan/40 dark:bg-nvr-cyan/10 dark:text-nvr-cyan dark:hover:bg-nvr-cyan/20",
|
|
110
125
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ l(H, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
112
127
|
"Go"
|
|
113
128
|
]
|
|
114
129
|
}
|
|
115
130
|
),
|
|
116
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ l(
|
|
117
132
|
"button",
|
|
118
133
|
{
|
|
119
134
|
type: "button",
|
|
120
|
-
onClick:
|
|
135
|
+
onClick: s,
|
|
121
136
|
"aria-label": "Dismiss",
|
|
122
137
|
className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-slate-400 hover:bg-slate-100 hover:text-slate-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:hover:bg-muted dark:hover:text-slate-300",
|
|
123
|
-
children: /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ l(R, { className: "h-3.5 w-3.5" })
|
|
124
139
|
}
|
|
125
140
|
)
|
|
126
141
|
]
|
|
@@ -128,5 +143,5 @@ function U({
|
|
|
128
143
|
);
|
|
129
144
|
}
|
|
130
145
|
export {
|
|
131
|
-
|
|
146
|
+
ee as FieldPointerHost
|
|
132
147
|
};
|