@nivaro/react 0.3.117 → 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 +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 +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/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 +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/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,156 +1,175 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
2
|
-
import { History as D, ExternalLink as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useItemNavigation as
|
|
5
|
-
import { draftIsFromOtherDevice as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as t, jsx as a, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { History as D, ExternalLink as B, RotateCcw as H, Trash2 as E } from "lucide-react";
|
|
3
|
+
import { useState as I } from "react";
|
|
4
|
+
import { useItemNavigation as J } from "../../context.js";
|
|
5
|
+
import { draftIsFromOtherDevice as L, draftFilledBack as P } from "../../lib/draft-store.js";
|
|
6
|
+
import { diffWindow as W } from "../../lib/text-diff-window.js";
|
|
7
|
+
import { titleCase as C } from "../../lib/utils.js";
|
|
8
|
+
import { RelativeTime as S } from "../RelativeTime.js";
|
|
9
|
+
const R = (e) => {
|
|
10
|
+
if (e == null || e === "") return "empty";
|
|
11
|
+
if (typeof e == "boolean") return e ? "Yes" : "No";
|
|
12
|
+
const s = typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
13
|
+
return s.length > 60 ? `${s.slice(0, 60)}…` : s;
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
function Y(e, s) {
|
|
16
|
+
const d = (o) => typeof o == "string" || o == null;
|
|
17
|
+
if (!d(e) || !d(s)) return null;
|
|
18
|
+
const b = e == null ? "" : String(e), u = s == null ? "" : String(s);
|
|
19
|
+
if (b.length <= 60 && u.length <= 60) return null;
|
|
20
|
+
const f = W(b.replace(/\s+/g, " "), u.replace(/\s+/g, " "));
|
|
21
|
+
return { before: f.before || "empty", after: f.after || "empty" };
|
|
22
|
+
}
|
|
23
|
+
function X({
|
|
24
|
+
draft: e,
|
|
25
|
+
labelFor: s,
|
|
26
|
+
current: d,
|
|
27
|
+
recordChanged: b,
|
|
28
|
+
onRestore: u,
|
|
29
|
+
onDiscard: f,
|
|
30
|
+
createdId: o = null,
|
|
31
|
+
collection: k,
|
|
32
|
+
renderValue: x
|
|
24
33
|
}) {
|
|
25
|
-
const [
|
|
26
|
-
(
|
|
34
|
+
const [N, F] = I(!1), l = L(e) ? e.device : null, j = J(), y = Object.entries(e.fields ?? {}), T = P(e), $ = y.filter(([r]) => T.has(r)).length, g = y.length - $, v = o !== null, _ = Object.values(e.pending_rows ?? {}).reduce((r, n) => r + n.length, 0), m = Object.values(e.pending_edits ?? {}).reduce(
|
|
35
|
+
(r, n) => r + Object.keys(n).length,
|
|
27
36
|
0
|
|
28
|
-
),
|
|
29
|
-
return
|
|
37
|
+
), c = Object.values(e.pending_deletes ?? {}).reduce((r, n) => r + n.length, 0), p = Object.values(e.m2m_links ?? {}).reduce((r, n) => r + n.length, 0), h = Object.values(e.m2m_unlinks ?? {}).reduce((r, n) => r + n.length, 0), i = [];
|
|
38
|
+
return g && i.push(`${g} field${g === 1 ? "" : "s"}`), $ && i.push(`${$} filled in from ${g === 1 ? "it" : "them"}`), _ && i.push(`${_} new line${_ === 1 ? "" : "s"}`), m && i.push(`${m} line edit${m === 1 ? "" : "s"}`), c && i.push(`${c} line removal${c === 1 ? "" : "s"}`), p && i.push(`${p} link${p === 1 ? "" : "s"}`), h && i.push(`${h} unlink${h === 1 ? "" : "s"}`), /* @__PURE__ */ t(
|
|
30
39
|
"div",
|
|
31
40
|
{
|
|
32
41
|
className: "mb-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-[12.5px] text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200",
|
|
33
42
|
"data-nvr-draft-recovery": !0,
|
|
34
43
|
children: [
|
|
35
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
s ? "(" : "",
|
|
49
|
-
/* @__PURE__ */ n(_, { value: r.saved_at }),
|
|
50
|
-
s ? ")" : "",
|
|
51
|
-
"?"
|
|
52
|
-
] }),
|
|
53
|
-
" ",
|
|
54
|
-
/* @__PURE__ */ n("span", { className: "text-amber-800/80 dark:text-amber-200/80", children: l.join(" · ") }),
|
|
55
|
-
!!r.dropped_fields && /* @__PURE__ */ t("span", { className: "ml-1 text-[11.5px]", "data-nvr-draft-dropped": !0, children: [
|
|
56
|
-
"(",
|
|
57
|
-
r.dropped_fields,
|
|
58
|
-
" field",
|
|
59
|
-
r.dropped_fields === 1 ? "" : "s",
|
|
60
|
-
" you can no longer edit ",
|
|
61
|
-
r.dropped_fields === 1 ? "was" : "were",
|
|
62
|
-
" left out)"
|
|
63
|
-
] }),
|
|
64
|
-
O && /* @__PURE__ */ n("span", { className: "ml-1 rounded bg-amber-200/70 px-1 py-px text-[10.5px] font-semibold uppercase tracking-wide text-amber-900 dark:bg-amber-500/30 dark:text-amber-100", children: "record changed since — review before restoring" })
|
|
65
|
-
] }),
|
|
66
|
-
/* @__PURE__ */ n(
|
|
67
|
-
"button",
|
|
68
|
-
{
|
|
69
|
-
type: "button",
|
|
70
|
-
onClick: () => S((e) => !e),
|
|
71
|
-
className: "text-[11.5px] underline decoration-dotted underline-offset-2",
|
|
72
|
-
children: k ? "Hide changes" : "Show changes"
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
u && p && x && /* @__PURE__ */ t(
|
|
76
|
-
"a",
|
|
77
|
-
{
|
|
78
|
-
href: w.urlFor({ collection: x, itemId: p }),
|
|
79
|
-
onClick: (e) => {
|
|
80
|
-
e.preventDefault(), w.open({ collection: x, itemId: p });
|
|
81
|
-
},
|
|
82
|
-
className: "inline-flex h-7 items-center gap-1 rounded-md bg-amber-600 px-2.5 text-[11.5px] font-semibold text-white hover:bg-amber-700",
|
|
83
|
-
"data-nvr-draft-open-created": !0,
|
|
84
|
-
children: [
|
|
85
|
-
/* @__PURE__ */ n(T, { className: "h-3 w-3" }),
|
|
86
|
-
" Open the record"
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ t(
|
|
91
|
-
"button",
|
|
92
|
-
{
|
|
93
|
-
type: "button",
|
|
94
|
-
onClick: C,
|
|
95
|
-
className: u ? "inline-flex h-7 items-center gap-1 rounded-md border border-amber-300 px-2.5 text-[11.5px] font-medium hover:bg-amber-100 dark:border-amber-500/40 dark:hover:bg-amber-500/15" : "inline-flex h-7 items-center gap-1 rounded-md bg-amber-600 px-2.5 text-[11.5px] font-semibold text-white hover:bg-amber-700",
|
|
96
|
-
"data-nvr-draft-restore": !0,
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ n(B, { className: "h-3 w-3" }),
|
|
44
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-start gap-x-3 gap-y-2", children: [
|
|
45
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 basis-[18rem] items-start gap-2", children: [
|
|
46
|
+
/* @__PURE__ */ a(D, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400" }),
|
|
47
|
+
/* @__PURE__ */ t("div", { className: "min-w-0", children: [
|
|
48
|
+
v ? /* @__PURE__ */ t("p", { className: "font-semibold", "data-nvr-draft-created": !0, children: [
|
|
49
|
+
"These changes from ",
|
|
50
|
+
/* @__PURE__ */ a(S, { value: e.saved_at }),
|
|
51
|
+
" were already saved as a new record — restoring them makes a second one."
|
|
52
|
+
] }) : /* @__PURE__ */ t("p", { className: "font-semibold", "data-nvr-draft-other-device": l == null ? void 0 : l.label, children: [
|
|
53
|
+
l ? /* @__PURE__ */ t(O, { children: [
|
|
54
|
+
"Continue your draft from your ",
|
|
55
|
+
l.label
|
|
56
|
+
] }) : /* @__PURE__ */ a(O, { children: "Restore your unsaved changes from" }),
|
|
99
57
|
" ",
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
58
|
+
l ? "(" : "",
|
|
59
|
+
/* @__PURE__ */ a(S, { value: e.saved_at }),
|
|
60
|
+
l ? ")" : "",
|
|
61
|
+
"?"
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[11.5px] text-amber-800/90 dark:text-amber-200/85", children: [
|
|
64
|
+
i.join(" · "),
|
|
65
|
+
i.length > 0 && " · ",
|
|
66
|
+
/* @__PURE__ */ a(
|
|
67
|
+
"button",
|
|
68
|
+
{
|
|
69
|
+
type: "button",
|
|
70
|
+
onClick: () => F((r) => !r),
|
|
71
|
+
"aria-expanded": N,
|
|
72
|
+
className: "whitespace-nowrap rounded underline decoration-dotted underline-offset-2 hover:decoration-solid focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60",
|
|
73
|
+
children: N ? "Hide changes" : "Show changes"
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
!!e.dropped_fields && /* @__PURE__ */ t("span", { className: "ml-1", "data-nvr-draft-dropped": !0, children: [
|
|
77
|
+
"(",
|
|
78
|
+
e.dropped_fields,
|
|
79
|
+
" field",
|
|
80
|
+
e.dropped_fields === 1 ? "" : "s",
|
|
81
|
+
" you can no longer edit ",
|
|
82
|
+
e.dropped_fields === 1 ? "was" : "were",
|
|
83
|
+
" left out)"
|
|
84
|
+
] })
|
|
85
|
+
] }),
|
|
86
|
+
b && /* @__PURE__ */ a("span", { className: "mt-1 inline-block rounded bg-amber-200/70 px-1 py-px text-[10.5px] font-semibold uppercase tracking-wide text-amber-900 dark:bg-amber-500/30 dark:text-amber-100", children: "record changed since — review before restoring" })
|
|
125
87
|
] })
|
|
126
|
-
] }
|
|
127
|
-
|
|
128
|
-
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ t("div", { className: "flex shrink-0 flex-wrap items-center gap-2 max-sm:pl-6", children: [
|
|
90
|
+
v && o && k && /* @__PURE__ */ t(
|
|
91
|
+
"a",
|
|
92
|
+
{
|
|
93
|
+
href: j.urlFor({ collection: k, itemId: o }),
|
|
94
|
+
onClick: (r) => {
|
|
95
|
+
r.preventDefault(), j.open({ collection: k, itemId: o });
|
|
96
|
+
},
|
|
97
|
+
className: "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-95",
|
|
98
|
+
"data-nvr-draft-open-created": !0,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ a(B, { className: "h-3.5 w-3.5" }),
|
|
101
|
+
" Open the record"
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ t(
|
|
106
|
+
"button",
|
|
107
|
+
{
|
|
108
|
+
type: "button",
|
|
109
|
+
onClick: u,
|
|
110
|
+
className: v ? "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-amber-300 bg-white px-3 text-[12px] font-medium text-amber-900 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-100 dark:hover:bg-amber-500/15" : "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-95",
|
|
111
|
+
"data-nvr-draft-restore": !0,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ a(H, { className: "h-3.5 w-3.5" }),
|
|
114
|
+
" ",
|
|
115
|
+
v ? "Restore anyway" : l ? "Continue" : "Restore"
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ t(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
type: "button",
|
|
123
|
+
onClick: f,
|
|
124
|
+
className: "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-amber-300 bg-white px-3 text-[12px] font-medium text-amber-900 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-100 dark:hover:bg-amber-500/15",
|
|
125
|
+
"data-nvr-draft-discard": !0,
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ a(E, { className: "h-3.5 w-3.5" }),
|
|
128
|
+
" Discard"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] })
|
|
133
|
+
] }),
|
|
134
|
+
N && /* @__PURE__ */ t("div", { className: "mt-2 max-h-[240px] space-y-1 overflow-y-auto border-t border-amber-200/70 pt-2 dark:border-amber-500/30", children: [
|
|
135
|
+
y.map(([r, n]) => {
|
|
136
|
+
const w = Y(d[r], n);
|
|
137
|
+
return /* @__PURE__ */ t("div", { className: "text-[11.5px]", children: [
|
|
138
|
+
/* @__PURE__ */ a("span", { className: "font-medium", children: s(r) || C(r.replace(/_/g, " ")) }),
|
|
139
|
+
/* @__PURE__ */ t("p", { className: "break-words text-amber-800/80 dark:text-amber-200/80", children: [
|
|
140
|
+
/* @__PURE__ */ a("span", { className: "line-through opacity-70", children: w ? w.before : x ? x(r, d[r]) : R(d[r]) }),
|
|
141
|
+
" ",
|
|
142
|
+
/* @__PURE__ */ a("span", { className: "font-medium text-amber-900 dark:text-amber-100", children: w ? w.after : x ? x(r, n) : R(n) })
|
|
143
|
+
] })
|
|
144
|
+
] }, r);
|
|
145
|
+
}),
|
|
146
|
+
Object.entries(e.pending_rows ?? {}).filter(([, r]) => r.length > 0).map(([r, n]) => /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
|
|
147
|
+
n.length,
|
|
129
148
|
" new line",
|
|
130
|
-
|
|
149
|
+
n.length === 1 ? "" : "s",
|
|
131
150
|
" in",
|
|
132
151
|
" ",
|
|
133
|
-
|
|
134
|
-
] },
|
|
135
|
-
|
|
136
|
-
|
|
152
|
+
C(r.split(".")[0].replace(/_/g, " "))
|
|
153
|
+
] }, r)),
|
|
154
|
+
m > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
|
|
155
|
+
m,
|
|
137
156
|
" edited line",
|
|
138
|
-
|
|
157
|
+
m === 1 ? "" : "s"
|
|
139
158
|
] }),
|
|
140
|
-
|
|
141
|
-
|
|
159
|
+
c > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
|
|
160
|
+
c,
|
|
142
161
|
" line removal",
|
|
143
|
-
|
|
162
|
+
c === 1 ? "" : "s"
|
|
144
163
|
] }),
|
|
145
|
-
|
|
146
|
-
|
|
164
|
+
p > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
|
|
165
|
+
p,
|
|
147
166
|
" relation link",
|
|
148
|
-
|
|
167
|
+
p === 1 ? "" : "s"
|
|
149
168
|
] }),
|
|
150
|
-
|
|
151
|
-
|
|
169
|
+
h > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px]", children: [
|
|
170
|
+
h,
|
|
152
171
|
" relation removal",
|
|
153
|
-
|
|
172
|
+
h === 1 ? "" : "s"
|
|
154
173
|
] })
|
|
155
174
|
] })
|
|
156
175
|
]
|
|
@@ -158,5 +177,5 @@ function P({
|
|
|
158
177
|
);
|
|
159
178
|
}
|
|
160
179
|
export {
|
|
161
|
-
|
|
180
|
+
X as DraftRecoveryBanner
|
|
162
181
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { MessageSquare as
|
|
4
|
-
import { useState as
|
|
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
5
|
import { toast as g } from "sonner";
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { useRepliesWhileTyping as
|
|
9
|
-
import { openFieldCommentCounts as
|
|
10
|
-
import { useDraftTypingSignal as
|
|
11
|
-
import { cn as
|
|
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
12
|
import { RepliesWhileTyping as ne, SeenByLine as re, MentionDeliveryButton as ie } from "../panels/CommentAwareness.js";
|
|
13
13
|
import { useCommentImages as ae, 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 i =
|
|
20
|
-
return
|
|
21
|
-
queryKey:
|
|
22
|
-
queryFn: () => i.request(
|
|
17
|
+
const K = (t, o) => ["comments", t, o];
|
|
18
|
+
function O(t, o, r) {
|
|
19
|
+
const i = L();
|
|
20
|
+
return E({
|
|
21
|
+
queryKey: K(t, o),
|
|
22
|
+
queryFn: () => i.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: i } =
|
|
27
|
+
const o = t.itemId == null ? "" : String(t.itemId), r = t.enabled && o !== "" && o !== "new", { data: i } = O(t.collection, o, r), [m, s] = k(null), c = v(() => V(i ?? []), [i]), { 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 }) {
|
|
@@ -52,12 +52,12 @@ function xe({
|
|
|
52
52
|
"data-field-comment-count": i || void 0,
|
|
53
53
|
"aria-label": i ? `${i} open ${i === 1 ? "comment" : "comments"} on ${r}` : `Comment on ${r}`,
|
|
54
54
|
"data-tip": i ? void 0 : `Comment on ${r}`,
|
|
55
|
-
className:
|
|
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
|
i || m ? "text-[#0e7490] opacity-100 dark:text-nvr-cyan" : "text-slate-400 opacity-0 hover:text-[#0e7490] focus-visible:opacity-100 group-hover/fieldrow:opacity-100 group-focus-within/fieldrow:opacity-100 dark:text-slate-400 dark:hover:text-nvr-cyan"
|
|
58
58
|
),
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */ n(
|
|
60
|
+
/* @__PURE__ */ n(W, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
61
61
|
i > 0 && /* @__PURE__ */ n("span", { className: "tabular-nums", children: i })
|
|
62
62
|
]
|
|
63
63
|
}
|
|
@@ -82,17 +82,17 @@ function fe({
|
|
|
82
82
|
field: o,
|
|
83
83
|
label: r
|
|
84
84
|
}) {
|
|
85
|
-
const i =
|
|
86
|
-
|
|
87
|
-
const
|
|
85
|
+
const i = 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, w] = k(""), p = ae();
|
|
86
|
+
Z(t.collection, t.item, h, o);
|
|
87
|
+
const C = ee(t.collection, t.item, "note", { field: o }), j = te(), B = v(
|
|
88
88
|
() => (s ?? []).filter((e) => e.field === o && !e.resolved_at),
|
|
89
89
|
[s, o]
|
|
90
|
-
),
|
|
91
|
-
var x,
|
|
92
|
-
return ((
|
|
93
|
-
}, y =
|
|
90
|
+
), N = J(h, s ? B : void 0, j), $ = () => m.invalidateQueries({ queryKey: K(t.collection, t.item) }), F = (e, d) => {
|
|
91
|
+
var x, _, P;
|
|
92
|
+
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;
|
|
93
|
+
}, y = q({
|
|
94
94
|
mutationFn: (e) => i.request(
|
|
95
|
-
|
|
95
|
+
D("/comments", {
|
|
96
96
|
collection: t.collection,
|
|
97
97
|
item: t.item,
|
|
98
98
|
text: e,
|
|
@@ -101,40 +101,40 @@ function fe({
|
|
|
101
101
|
})
|
|
102
102
|
),
|
|
103
103
|
onSuccess: () => {
|
|
104
|
-
|
|
104
|
+
w(""), p.reset(), $();
|
|
105
105
|
},
|
|
106
106
|
onError: (e) => g.error(F(e, "Could not post the comment"))
|
|
107
|
-
}),
|
|
108
|
-
mutationFn: ({ id: e, resolved: d }) => i.request(
|
|
109
|
-
onSuccess: () => void
|
|
107
|
+
}), R = q({
|
|
108
|
+
mutationFn: ({ id: e, resolved: d }) => i.request(D(`/comments/${e}/resolve`, { resolved: d })),
|
|
109
|
+
onSuccess: () => void $(),
|
|
110
110
|
onError: (e) => g.error(F(e, "Could not update the comment"))
|
|
111
|
-
}),
|
|
111
|
+
}), S = () => {
|
|
112
112
|
const e = p.compose(h);
|
|
113
113
|
e && !p.uploading && !y.isPending && y.mutate(e);
|
|
114
|
-
},
|
|
114
|
+
}, Q = () => {
|
|
115
115
|
const e = new URL(window.location.href);
|
|
116
116
|
e.searchParams.delete("field");
|
|
117
117
|
const d = e.search ? "&" : "?";
|
|
118
|
-
navigator.clipboard.writeText(`${e.origin}${e.pathname}${e.search}${d}${
|
|
118
|
+
navigator.clipboard.writeText(`${e.origin}${e.pathname}${e.search}${d}${Y(o)}`).then(
|
|
119
119
|
() => g.success("Link to this field copied"),
|
|
120
120
|
() => g.error("Could not copy")
|
|
121
121
|
);
|
|
122
|
-
},
|
|
122
|
+
}, T = (e, d) => {
|
|
123
123
|
var x;
|
|
124
124
|
return /* @__PURE__ */ a("li", { "data-field-comment-row": e.id, className: "px-3 py-2", children: [
|
|
125
125
|
/* @__PURE__ */ a("div", { className: "flex items-baseline gap-1.5", children: [
|
|
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:
|
|
126
|
+
/* @__PURE__ */ n("span", { className: "truncate text-[12px] font-medium text-slate-800 dark:text-foreground", children: b(e.user) }),
|
|
127
|
+
/* @__PURE__ */ n("span", { className: "shrink-0 text-[11px] text-slate-400 dark:text-muted-foreground", children: I(e.created_at) }),
|
|
128
128
|
/* @__PURE__ */ a(
|
|
129
129
|
"button",
|
|
130
130
|
{
|
|
131
131
|
type: "button",
|
|
132
|
-
disabled:
|
|
133
|
-
onClick: () =>
|
|
132
|
+
disabled: R.isPending,
|
|
133
|
+
onClick: () => R.mutate({ id: e.id, resolved: !d }),
|
|
134
134
|
"data-field-comment-resolve": e.id,
|
|
135
135
|
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
136
|
children: [
|
|
137
|
-
d ? /* @__PURE__ */ n(
|
|
137
|
+
d ? /* @__PURE__ */ n(H, { "aria-hidden": !0, className: "h-3 w-3" }) : /* @__PURE__ */ n(z, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
138
138
|
d ? "Reopen" : "Resolve"
|
|
139
139
|
]
|
|
140
140
|
}
|
|
@@ -144,7 +144,8 @@ function fe({
|
|
|
144
144
|
le,
|
|
145
145
|
{
|
|
146
146
|
text: e.text,
|
|
147
|
-
|
|
147
|
+
caption: `${b(e.user)} · ${I(e.created_at)}`,
|
|
148
|
+
className: M(
|
|
148
149
|
"m-0 mt-0.5 whitespace-pre-wrap text-[12.5px] leading-snug [overflow-wrap:anywhere]",
|
|
149
150
|
d ? "text-slate-400 dark:text-muted-foreground" : "text-slate-600 dark:text-slate-300"
|
|
150
151
|
)
|
|
@@ -166,18 +167,18 @@ function fe({
|
|
|
166
167
|
"button",
|
|
167
168
|
{
|
|
168
169
|
type: "button",
|
|
169
|
-
onClick:
|
|
170
|
+
onClick: Q,
|
|
170
171
|
"aria-label": `Copy a link to ${r}`,
|
|
171
172
|
"data-tip": "Copy a link that opens the record on this field",
|
|
172
173
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-foreground",
|
|
173
|
-
children: /* @__PURE__ */ n(
|
|
174
|
+
children: /* @__PURE__ */ n(A, { "aria-hidden": !0, className: "h-3.5 w-3.5" })
|
|
174
175
|
}
|
|
175
176
|
)
|
|
176
177
|
] }),
|
|
177
178
|
/* @__PURE__ */ a("div", { className: "max-h-[260px] overflow-y-auto overscroll-contain", children: [
|
|
178
179
|
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__ */ a("ul", { className: "m-0 list-none divide-y divide-slate-100 p-0 dark:divide-border", children: [
|
|
179
|
-
l.open.map((e) =>
|
|
180
|
-
u && l.resolved.map((e) =>
|
|
180
|
+
l.open.map((e) => T(e, !1)),
|
|
181
|
+
u && l.resolved.map((e) => T(e, !0))
|
|
181
182
|
] }),
|
|
182
183
|
l.resolved.length > 0 && /* @__PURE__ */ n(
|
|
183
184
|
"button",
|
|
@@ -190,7 +191,7 @@ function fe({
|
|
|
190
191
|
}
|
|
191
192
|
)
|
|
192
193
|
] }),
|
|
193
|
-
|
|
194
|
+
C.length > 0 && /* @__PURE__ */ a(
|
|
194
195
|
"p",
|
|
195
196
|
{
|
|
196
197
|
"data-field-comment-typing": o,
|
|
@@ -198,7 +199,7 @@ function fe({
|
|
|
198
199
|
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
200
|
children: [
|
|
200
201
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan motion-reduce:animate-none" }),
|
|
201
|
-
|
|
202
|
+
oe(C, "replying"),
|
|
202
203
|
"…"
|
|
203
204
|
]
|
|
204
205
|
}
|
|
@@ -208,27 +209,27 @@ function fe({
|
|
|
208
209
|
ne,
|
|
209
210
|
{
|
|
210
211
|
compact: !0,
|
|
211
|
-
replies:
|
|
212
|
+
replies: N.replies.map((e) => ({
|
|
212
213
|
id: e.id,
|
|
213
|
-
name:
|
|
214
|
+
name: b(e.user),
|
|
214
215
|
text: de({ kind: "comment", comment: e }),
|
|
215
216
|
created_at: e.created_at
|
|
216
217
|
})),
|
|
217
|
-
onDismiss:
|
|
218
|
+
onDismiss: N.dismiss
|
|
218
219
|
}
|
|
219
220
|
),
|
|
220
221
|
/* @__PURE__ */ n(
|
|
221
222
|
me,
|
|
222
223
|
{
|
|
223
224
|
value: h,
|
|
224
|
-
onChange:
|
|
225
|
+
onChange: w,
|
|
225
226
|
onImages: p.addFiles,
|
|
226
227
|
rows: 2,
|
|
227
228
|
"aria-label": `Comment on ${r}`,
|
|
228
229
|
placeholder: "Write a comment… type @ to mention someone",
|
|
229
230
|
className: "min-h-[56px] text-[12.5px]",
|
|
230
231
|
onKeyDownCapture: (e) => {
|
|
231
|
-
e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(),
|
|
232
|
+
e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), S());
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
235
|
),
|
|
@@ -239,7 +240,7 @@ function fe({
|
|
|
239
240
|
"button",
|
|
240
241
|
{
|
|
241
242
|
type: "button",
|
|
242
|
-
onClick:
|
|
243
|
+
onClick: S,
|
|
243
244
|
disabled: !h.trim() && !p.hasReady || p.uploading || y.isPending,
|
|
244
245
|
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
246
|
children: y.isPending ? "Posting…" : p.uploading ? "Uploading…" : "Comment"
|