@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,72 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
import { useState as N, useEffect as O, useRef as T, useMemo as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { fieldMergeKind as
|
|
8
|
-
import { liveMotionAllowed as
|
|
9
|
-
import { fetchCollectionMeta as
|
|
10
|
-
import { onOutboxReviewNudge as
|
|
11
|
-
import { titleCase as
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as $, useQueryClient as F } from "@tanstack/react-query";
|
|
3
|
+
import { ChevronDown as E, ExternalLink as L, GitMerge as q } from "lucide-react";
|
|
4
|
+
import { useState as N, useEffect as O, useRef as T, useMemo as K } from "react";
|
|
5
|
+
import { createPortal as j } from "react-dom";
|
|
6
|
+
import { useNivaroClient as z } from "../../context.js";
|
|
7
|
+
import { fieldMergeKind as A } from "../../lib/field-merge.js";
|
|
8
|
+
import { liveMotionAllowed as H } from "../../lib/live-preference.js";
|
|
9
|
+
import { fetchCollectionMeta as I, queryKeys as P } from "../../lib/query-keys.js";
|
|
10
|
+
import { onOutboxReviewNudge as Q, isRecordOutboxHeld as B, resolveRecordOutboxField as Y } from "../../lib/record-outbox.js";
|
|
11
|
+
import { titleCase as S, cn as _ } from "../../lib/utils.js";
|
|
12
12
|
import { RelativeTime as D } from "../RelativeTime.js";
|
|
13
|
-
import { useShown as G, FieldMergePanel as
|
|
14
|
-
import { useRecordLabels as
|
|
15
|
-
function
|
|
13
|
+
import { useShown as G, FieldMergePanel as V } from "./RemoteChangeUi.js";
|
|
14
|
+
import { useRecordLabels as J } from "./useRecordLabels.js";
|
|
15
|
+
function U(e) {
|
|
16
16
|
return e.filter(
|
|
17
|
-
(
|
|
18
|
-
var
|
|
19
|
-
return
|
|
17
|
+
(t) => {
|
|
18
|
+
var l;
|
|
19
|
+
return t.status === "conflict" && (((l = t.conflicts) == null ? void 0 : l.length) ?? 0) > 0 && !B(t.id);
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function he({
|
|
24
24
|
entries: e,
|
|
25
|
-
onOpenRecord:
|
|
25
|
+
onOpenRecord: t
|
|
26
26
|
}) {
|
|
27
|
-
const
|
|
28
|
-
var
|
|
29
|
-
return
|
|
30
|
-
}, 0), [
|
|
31
|
-
if (O(() =>
|
|
32
|
-
const
|
|
33
|
-
return
|
|
34
|
-
/* @__PURE__ */
|
|
27
|
+
const l = U(e), a = l.reduce((d, b) => {
|
|
28
|
+
var p;
|
|
29
|
+
return d + (((p = b.conflicts) == null ? void 0 : p.length) ?? 0);
|
|
30
|
+
}, 0), [o, s] = N(!1);
|
|
31
|
+
if (O(() => Q(() => s(!0)), []), l.length === 0 || typeof document > "u") return null;
|
|
32
|
+
const n = `${a} offline change${a === 1 ? "" : "s"} need${a === 1 ? "s" : ""} a look`;
|
|
33
|
+
return j(
|
|
34
|
+
/* @__PURE__ */ r(
|
|
35
35
|
"section",
|
|
36
36
|
{
|
|
37
37
|
"data-outbox-review": !0,
|
|
38
38
|
"aria-label": "Offline changes to review",
|
|
39
39
|
className: "fixed bottom-20 right-4 z-[60] w-[400px] max-w-[calc(100vw-2rem)]",
|
|
40
|
-
children:
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
40
|
+
children: o ? /* @__PURE__ */ i("div", { className: "nvr-expand-in flex max-h-[min(calc(100vh-7rem),640px)] flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-[0_12px_32px_-12px_rgba(15,23,42,0.35)] dark:border-border dark:bg-card", children: [
|
|
41
|
+
/* @__PURE__ */ i("header", { className: "flex shrink-0 items-start gap-2 border-b border-slate-100 px-4 py-3 dark:border-border", children: [
|
|
42
|
+
/* @__PURE__ */ r("span", { className: "mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500 dark:bg-amber-400" }),
|
|
43
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
44
|
+
/* @__PURE__ */ r("h2", { className: "text-[13px] font-semibold text-slate-900 dark:text-slate-50", children: "Changed while you were offline" }),
|
|
45
|
+
/* @__PURE__ */ r("p", { className: "mt-0.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "Nothing here is sent until you choose." })
|
|
46
46
|
] }),
|
|
47
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ r(
|
|
48
48
|
"button",
|
|
49
49
|
{
|
|
50
50
|
type: "button",
|
|
51
|
-
onClick: () =>
|
|
51
|
+
onClick: () => s(!1),
|
|
52
52
|
"aria-label": "Fold this away",
|
|
53
53
|
"data-tip": "Fold away",
|
|
54
54
|
className: "-mr-1 rounded-md p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ r(E, { className: "h-4 w-4" })
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
] }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
] }) : /* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ r(W, { children: l.map((d) => /* @__PURE__ */ r(X, { entry: d, onOpenRecord: t }, d.id)) })
|
|
60
|
+
] }) : /* @__PURE__ */ i(
|
|
61
61
|
"button",
|
|
62
62
|
{
|
|
63
63
|
type: "button",
|
|
64
64
|
"data-outbox-review-open": !0,
|
|
65
|
-
onClick: () =>
|
|
65
|
+
onClick: () => s(!0),
|
|
66
66
|
className: "ml-auto flex items-center gap-2 rounded-full border border-amber-300/80 bg-white py-1.5 pl-3 pr-3.5 text-[12px] font-medium text-slate-800 shadow-[0_4px_14px_-6px_rgba(15,23,42,0.25)] transition-colors hover:bg-amber-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60 dark:border-amber-400/30 dark:bg-card dark:text-slate-100 dark:hover:bg-amber-400/10",
|
|
67
67
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
68
|
+
/* @__PURE__ */ r("span", { className: "h-2 w-2 rounded-full bg-amber-500 dark:bg-amber-400" }),
|
|
69
|
+
n
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
)
|
|
@@ -75,31 +75,31 @@ function fe({
|
|
|
75
75
|
document.body
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
const
|
|
78
|
+
function W({ children: e }) {
|
|
79
|
+
const t = T(null), [l, a] = N(!1);
|
|
80
80
|
return O(() => {
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
for (const b of Array.from(
|
|
88
|
-
const
|
|
89
|
-
return
|
|
90
|
-
|
|
81
|
+
const o = t.current;
|
|
82
|
+
if (!o) return;
|
|
83
|
+
const s = () => a(o.scrollTop + o.clientHeight < o.scrollHeight - 4);
|
|
84
|
+
s(), o.addEventListener("scroll", s, { passive: !0 });
|
|
85
|
+
const n = typeof ResizeObserver < "u" ? new ResizeObserver(s) : null;
|
|
86
|
+
n == null || n.observe(o);
|
|
87
|
+
for (const b of Array.from(o.children)) n == null || n.observe(b);
|
|
88
|
+
const d = new MutationObserver(s);
|
|
89
|
+
return d.observe(o, { childList: !0, subtree: !0 }), () => {
|
|
90
|
+
o.removeEventListener("scroll", s), n == null || n.disconnect(), d.disconnect();
|
|
91
91
|
};
|
|
92
|
-
}, []), /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
92
|
+
}, []), /* @__PURE__ */ i("div", { className: "relative min-h-0 flex-1", children: [
|
|
93
|
+
/* @__PURE__ */ r(
|
|
94
94
|
"div",
|
|
95
95
|
{
|
|
96
|
-
ref:
|
|
96
|
+
ref: t,
|
|
97
97
|
"data-outbox-scroll": !0,
|
|
98
98
|
className: "h-full max-h-full divide-y divide-slate-100 overflow-y-auto overscroll-contain dark:divide-border",
|
|
99
99
|
children: e
|
|
100
100
|
}
|
|
101
101
|
),
|
|
102
|
-
|
|
102
|
+
l && /* @__PURE__ */ r(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
105
|
"aria-hidden": !0,
|
|
@@ -109,157 +109,159 @@ function U({ children: e }) {
|
|
|
109
109
|
)
|
|
110
110
|
] });
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function X({
|
|
113
113
|
entry: e,
|
|
114
|
-
onOpenRecord:
|
|
114
|
+
onOpenRecord: t
|
|
115
115
|
}) {
|
|
116
|
-
var
|
|
117
|
-
const
|
|
118
|
-
queryKey:
|
|
119
|
-
queryFn: () =>
|
|
116
|
+
var v;
|
|
117
|
+
const l = z(), { data: a } = $({
|
|
118
|
+
queryKey: P.collectionMeta(e.collection),
|
|
119
|
+
queryFn: () => I(l, e.collection),
|
|
120
120
|
staleTime: 10 * 6e4
|
|
121
|
-
}),
|
|
122
|
-
() => new Map(((
|
|
123
|
-
[
|
|
124
|
-
),
|
|
121
|
+
}), o = F(), s = J(e.collection, [e.item]), n = o.getQueryState(["record-label", e.collection, e.item]), d = !s.has(e.item) && (!n || n.status === "pending"), b = K(
|
|
122
|
+
() => new Map(((a == null ? void 0 : a.fields) ?? []).map((m) => [m.field, m])),
|
|
123
|
+
[a]
|
|
124
|
+
), p = (m) => {
|
|
125
125
|
var u;
|
|
126
|
-
return ((u = ((
|
|
127
|
-
(
|
|
126
|
+
return ((u = ((a == null ? void 0 : a.relations) ?? []).find(
|
|
127
|
+
(h) => h.many_collection === e.collection && h.many_field === m && !h.junction_field
|
|
128
128
|
)) == null ? void 0 : u.one_collection) ?? null;
|
|
129
|
-
},
|
|
130
|
-
if (!
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
129
|
+
}, k = (typeof (a == null ? void 0 : a.singular) == "string" ? a.singular.trim() : "") || Z(S(e.collection.replace(/_/g, " "))), f = s.get(e.item) ?? `#${e.item}`;
|
|
130
|
+
if (!a || d)
|
|
131
|
+
return /* @__PURE__ */ i("article", { "data-outbox-entry": e.id, "aria-busy": "true", className: "space-y-2 px-4 py-3", children: [
|
|
132
|
+
/* @__PURE__ */ r("div", { className: "h-3.5 w-40 rounded bg-slate-100 dark:bg-muted" }),
|
|
133
|
+
/* @__PURE__ */ r("div", { className: "h-20 rounded-lg bg-slate-50 dark:bg-muted/50" })
|
|
134
134
|
] });
|
|
135
|
-
const x = ((
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
|
|
135
|
+
const x = ((v = e.sent_fields) == null ? void 0 : v.length) ?? 0;
|
|
136
|
+
return /* @__PURE__ */ i("article", { "data-outbox-entry": e.id, className: "px-4 py-3", children: [
|
|
137
|
+
/* @__PURE__ */ i("div", { className: "flex items-baseline gap-2", children: [
|
|
138
|
+
/* @__PURE__ */ i("p", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-500 dark:text-slate-400", children: [
|
|
139
|
+
k,
|
|
140
140
|
" ",
|
|
141
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-slate-900 dark:text-slate-100", children: f })
|
|
142
142
|
] }),
|
|
143
|
-
|
|
143
|
+
t && /* @__PURE__ */ i(
|
|
144
144
|
"button",
|
|
145
145
|
{
|
|
146
146
|
type: "button",
|
|
147
|
-
onClick: () =>
|
|
147
|
+
onClick: () => t(e.collection, e.item),
|
|
148
148
|
className: "inline-flex shrink-0 items-center gap-1 rounded text-[11.5px] font-medium text-slate-500 underline-offset-2 hover:text-slate-800 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-slate-400 dark:hover:text-slate-100",
|
|
149
149
|
children: [
|
|
150
150
|
"Open ",
|
|
151
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ r(L, { className: "h-3 w-3" })
|
|
152
152
|
]
|
|
153
153
|
}
|
|
154
154
|
)
|
|
155
155
|
] }),
|
|
156
|
-
x > 0 && /* @__PURE__ */
|
|
156
|
+
x > 0 && /* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
|
|
157
157
|
x,
|
|
158
158
|
" other change",
|
|
159
159
|
x === 1 ? " was" : "s were",
|
|
160
160
|
" saved."
|
|
161
161
|
] }),
|
|
162
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ r("ul", { className: "mt-2 space-y-2", children: (e.conflicts ?? []).map((m) => {
|
|
163
163
|
const u = b.get(m.field) ?? null;
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
|
|
164
|
+
return /* @__PURE__ */ r(
|
|
165
|
+
ee,
|
|
166
166
|
{
|
|
167
167
|
entry: e,
|
|
168
168
|
clash: m,
|
|
169
169
|
field: u,
|
|
170
|
-
label: (u == null ? void 0 : u.label) ||
|
|
171
|
-
relatedCollection:
|
|
170
|
+
label: (u == null ? void 0 : u.label) || S(m.field.replace(/_/g, " ")),
|
|
171
|
+
relatedCollection: p(m.field)
|
|
172
172
|
},
|
|
173
173
|
m.field
|
|
174
174
|
);
|
|
175
175
|
}) })
|
|
176
176
|
] });
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Z(e) {
|
|
179
179
|
return /ies$/i.test(e) ? e.replace(/ies$/i, "y") : /[^s]s$/i.test(e) ? e.slice(0, -1) : e;
|
|
180
180
|
}
|
|
181
181
|
const C = "shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60 disabled:opacity-50";
|
|
182
|
-
function
|
|
182
|
+
function ee({
|
|
183
183
|
entry: e,
|
|
184
|
-
clash:
|
|
185
|
-
field:
|
|
186
|
-
label:
|
|
187
|
-
relatedCollection:
|
|
188
|
-
onPick:
|
|
184
|
+
clash: t,
|
|
185
|
+
field: l,
|
|
186
|
+
label: a,
|
|
187
|
+
relatedCollection: o,
|
|
188
|
+
onPick: s
|
|
189
189
|
}) {
|
|
190
|
-
const
|
|
190
|
+
const n = e.payload[t.field], d = t.current_value, b = e.before[t.field], p = G(l, o, [n, d, b]), g = (c, w) => typeof c == "number" && Number.isFinite(c) ? c.toLocaleString() : p(c, w), k = t.hidden ? ["", ""] : te(g(d, 400), g(n, 400)), [f, x] = N(!1), [v, m] = N(!1), u = T(null);
|
|
191
191
|
O(() => {
|
|
192
192
|
if (!f) return;
|
|
193
|
-
const
|
|
194
|
-
var w,
|
|
195
|
-
(
|
|
193
|
+
const c = setTimeout(() => {
|
|
194
|
+
var w, R;
|
|
195
|
+
(R = (w = u.current) == null ? void 0 : w.querySelector("[data-merge-apply]")) == null || R.scrollIntoView({ block: "nearest", behavior: H() ? "smooth" : "auto" });
|
|
196
196
|
}, 60);
|
|
197
|
-
return () => clearTimeout(
|
|
197
|
+
return () => clearTimeout(c);
|
|
198
198
|
}, [f]);
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
() =>
|
|
199
|
+
const h = t.hidden ? "none" : A(l, n, d), M = t.by || "Someone", y = (c) => {
|
|
200
|
+
m(!0), x(!1), s ? s(c) : Y(e.collection, e.item, t.field, c).finally(
|
|
201
|
+
() => m(!1)
|
|
202
202
|
);
|
|
203
203
|
};
|
|
204
|
-
return /* @__PURE__ */
|
|
204
|
+
return /* @__PURE__ */ i(
|
|
205
205
|
"li",
|
|
206
206
|
{
|
|
207
|
-
"data-outbox-clash":
|
|
208
|
-
ref:
|
|
207
|
+
"data-outbox-clash": t.field,
|
|
208
|
+
ref: u,
|
|
209
209
|
className: "rounded-lg border border-amber-200/80 bg-amber-50/50 px-3 py-2 dark:border-amber-400/30 dark:bg-white/[0.02]",
|
|
210
210
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ i("p", { className: "text-[12px] leading-snug text-slate-700 dark:text-slate-200", children: [
|
|
212
|
+
/* @__PURE__ */ r("span", { className: "font-semibold text-slate-900 dark:text-slate-50", children: M }),
|
|
213
213
|
" changed",
|
|
214
214
|
" ",
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
"
|
|
217
|
-
|
|
215
|
+
/* @__PURE__ */ r("span", { className: "font-semibold text-slate-900 dark:text-slate-50", children: a }),
|
|
216
|
+
" ",
|
|
217
|
+
/* @__PURE__ */ r("span", { className: "whitespace-nowrap", children: "while you were offline" }),
|
|
218
|
+
t.at && /* @__PURE__ */ i("span", { className: "whitespace-nowrap text-slate-500 dark:text-slate-400", children: [
|
|
218
219
|
" ",
|
|
219
220
|
"· ",
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ r(D, { value: t.at })
|
|
221
222
|
] })
|
|
222
223
|
] }),
|
|
223
|
-
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
224
|
+
t.hidden ? /* @__PURE__ */ r("p", { className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "You can no longer see this field's value, so only its change is shown." }) : /* @__PURE__ */ i("dl", { className: "mt-1.5 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-[11.5px]", children: [
|
|
225
|
+
/* @__PURE__ */ r("dt", { className: "text-slate-500 dark:text-slate-400", children: "Theirs" }),
|
|
226
|
+
/* @__PURE__ */ r(
|
|
226
227
|
"dd",
|
|
227
228
|
{
|
|
228
229
|
className: "min-w-0 truncate font-medium text-slate-900 tabular-nums dark:text-slate-50",
|
|
229
|
-
"data-tip":
|
|
230
|
-
children:
|
|
230
|
+
"data-tip": g(d, 400),
|
|
231
|
+
children: k[0]
|
|
231
232
|
}
|
|
232
233
|
),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ r("dt", { className: "text-slate-500 dark:text-slate-400", children: "Yours" }),
|
|
235
|
+
/* @__PURE__ */ r(
|
|
235
236
|
"dd",
|
|
236
237
|
{
|
|
237
238
|
className: "min-w-0 truncate font-medium text-slate-900 tabular-nums dark:text-slate-50",
|
|
238
|
-
"data-tip":
|
|
239
|
-
children:
|
|
239
|
+
"data-tip": g(n, 400),
|
|
240
|
+
children: k[1]
|
|
240
241
|
}
|
|
241
242
|
)
|
|
242
243
|
] }),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ i("div", { className: "mt-2 flex flex-wrap items-center gap-1", children: [
|
|
245
|
+
/* @__PURE__ */ r(
|
|
245
246
|
"button",
|
|
246
247
|
{
|
|
247
248
|
type: "button",
|
|
248
|
-
disabled:
|
|
249
|
+
disabled: v,
|
|
249
250
|
onClick: () => y("mine"),
|
|
250
251
|
"data-outbox-keep-mine": !0,
|
|
251
252
|
className: _(
|
|
252
253
|
C,
|
|
253
|
-
|
|
254
|
+
// Quiet while a merge is open: only one choice looks chosen at a time.
|
|
255
|
+
f ? "text-slate-700 hover:bg-amber-100/80 dark:text-slate-200 dark:hover:bg-amber-400/10" : "border border-amber-300 bg-white text-amber-900 hover:bg-amber-50 dark:border-amber-400/30 dark:bg-transparent dark:text-amber-100 dark:hover:bg-amber-400/10"
|
|
254
256
|
),
|
|
255
257
|
children: "Keep mine"
|
|
256
258
|
}
|
|
257
259
|
),
|
|
258
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ r(
|
|
259
261
|
"button",
|
|
260
262
|
{
|
|
261
263
|
type: "button",
|
|
262
|
-
disabled:
|
|
264
|
+
disabled: v,
|
|
263
265
|
onClick: () => y("theirs"),
|
|
264
266
|
"data-outbox-take-theirs": !0,
|
|
265
267
|
className: _(
|
|
@@ -269,12 +271,12 @@ function Z({
|
|
|
269
271
|
children: "Take theirs"
|
|
270
272
|
}
|
|
271
273
|
),
|
|
272
|
-
|
|
274
|
+
h !== "none" && /* @__PURE__ */ i(
|
|
273
275
|
"button",
|
|
274
276
|
{
|
|
275
277
|
type: "button",
|
|
276
|
-
disabled:
|
|
277
|
-
onClick: () =>
|
|
278
|
+
disabled: v,
|
|
279
|
+
onClick: () => x((c) => !c),
|
|
278
280
|
"aria-expanded": f,
|
|
279
281
|
"data-outbox-merge": !0,
|
|
280
282
|
className: _(
|
|
@@ -283,31 +285,40 @@ function Z({
|
|
|
283
285
|
f ? "bg-amber-100 text-amber-900 ring-1 ring-amber-300 dark:bg-amber-400/15 dark:text-amber-100 dark:ring-amber-400/40" : "text-slate-700 hover:bg-amber-100/80 dark:text-slate-200 dark:hover:bg-amber-400/10"
|
|
284
286
|
),
|
|
285
287
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ r(q, { className: "h-3 w-3" }),
|
|
287
289
|
" Merge"
|
|
288
290
|
]
|
|
289
291
|
}
|
|
290
292
|
)
|
|
291
293
|
] }),
|
|
292
|
-
f &&
|
|
293
|
-
|
|
294
|
+
f && h !== "none" && /* @__PURE__ */ r(
|
|
295
|
+
V,
|
|
294
296
|
{
|
|
295
|
-
kind:
|
|
297
|
+
kind: h,
|
|
296
298
|
base: b,
|
|
297
|
-
mine:
|
|
298
|
-
theirs:
|
|
299
|
-
by:
|
|
300
|
-
shown: (
|
|
301
|
-
onCancel: () =>
|
|
302
|
-
onApply: (
|
|
299
|
+
mine: n,
|
|
300
|
+
theirs: d,
|
|
301
|
+
by: M,
|
|
302
|
+
shown: (c) => g(c, 120),
|
|
303
|
+
onCancel: () => x(!1),
|
|
304
|
+
onApply: (c) => y({ merged: c })
|
|
303
305
|
}
|
|
304
306
|
)
|
|
305
307
|
]
|
|
306
308
|
}
|
|
307
309
|
);
|
|
308
310
|
}
|
|
311
|
+
function te(e, t) {
|
|
312
|
+
if (e === t) return [e, t];
|
|
313
|
+
let l = 0;
|
|
314
|
+
for (; l < e.length && l < t.length && e[l] === t[l]; ) l++;
|
|
315
|
+
if (l < 24) return [e, t];
|
|
316
|
+
const a = e.lastIndexOf(" ", l - 1), o = a > 0 ? e.lastIndexOf(" ", a - 1) : -1, s = o >= 0 ? o + 1 : a >= 0 ? a + 1 : l;
|
|
317
|
+
return s <= 0 ? [e, t] : [`…${e.slice(s)}`, `…${t.slice(s)}`];
|
|
318
|
+
}
|
|
309
319
|
export {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
320
|
+
ee as OutboxClashRow,
|
|
321
|
+
he as OutboxReviewTray,
|
|
322
|
+
U as conflictEntriesToReview,
|
|
323
|
+
te as diffPreviews
|
|
313
324
|
};
|
|
@@ -1,49 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function l() {
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "lucide-react";
|
|
3
|
+
const t = "nvr:queue-return", o = 360 * 60 * 1e3;
|
|
4
|
+
function c() {
|
|
6
5
|
try {
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
9
|
-
const
|
|
10
|
-
return !
|
|
6
|
+
const e = sessionStorage.getItem(t);
|
|
7
|
+
if (!e) return null;
|
|
8
|
+
const r = JSON.parse(e);
|
|
9
|
+
return !r || typeof r != "object" || !r.path || Date.now() - Number(r.at ?? 0) > o ? null : r;
|
|
11
10
|
} catch {
|
|
12
11
|
return null;
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
|
-
function f(
|
|
14
|
+
function f(e) {
|
|
16
15
|
try {
|
|
17
|
-
|
|
16
|
+
e ? sessionStorage.setItem(t, JSON.stringify(e)) : sessionStorage.removeItem(t);
|
|
18
17
|
} catch {
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
function x() {
|
|
25
|
-
const t = s(), e = l();
|
|
26
|
-
return e ? /* @__PURE__ */ u("div", { className: "flex items-center", "data-queue-return": e.queue_id, children: /* @__PURE__ */ i(
|
|
27
|
-
"button",
|
|
28
|
-
{
|
|
29
|
-
type: "button",
|
|
30
|
-
onClick: () => {
|
|
31
|
-
f({ ...e, restore: !0 }), t.navigate(e.path);
|
|
32
|
-
},
|
|
33
|
-
className: "inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-white px-2.5 py-1 text-[11.5px] font-medium text-slate-600 transition-colors hover:border-nvr-cyan/50 hover:text-nvr-navy dark:border-border dark:bg-card dark:text-slate-300 dark:hover:text-nvr-cyan",
|
|
34
|
-
"data-tip": "Return to the queue with its filters and scroll position",
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ u(a, { className: "h-3.5 w-3.5" }),
|
|
37
|
-
"Back to ",
|
|
38
|
-
e.name
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
) }) : null;
|
|
20
|
+
function l(e, r, n, u) {
|
|
21
|
+
return e.queue_id !== r ? !1 : e.restore || e.entry && n && e.entry === n ? !0 : u;
|
|
42
22
|
}
|
|
43
23
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
l as readQueueReturn,
|
|
24
|
+
t as QUEUE_RETURN_KEY,
|
|
25
|
+
l as queueReturnApplies,
|
|
26
|
+
c as readQueueReturn,
|
|
48
27
|
f as writeQueueReturn
|
|
49
28
|
};
|