@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,60 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Unplug as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useRealtimeStatus as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const e =
|
|
8
|
-
|
|
1
|
+
import { jsxs as i, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { Unplug as x, RefreshCw as k } from "lucide-react";
|
|
3
|
+
import { useState as f, useRef as p, useEffect as b } from "react";
|
|
4
|
+
import { useRealtimeStatus as h } from "../lib/realtime.js";
|
|
5
|
+
const R = 3e3, S = 6e3;
|
|
6
|
+
function E() {
|
|
7
|
+
const e = h(), [r, o] = f(!1), [l, a] = f(null), s = p(!1), d = (e == null ? void 0 : e.repair) === "silent", t = (e == null ? void 0 : e.state) === "reconnecting" && !d, m = p(d);
|
|
8
|
+
if (m.current = d, b(() => {
|
|
9
9
|
if (!t) return;
|
|
10
|
-
const
|
|
11
|
-
s.current = !0,
|
|
12
|
-
},
|
|
13
|
-
return () => clearTimeout(
|
|
10
|
+
const n = setTimeout(() => {
|
|
11
|
+
s.current = !0, o(!0);
|
|
12
|
+
}, R);
|
|
13
|
+
return () => clearTimeout(n);
|
|
14
14
|
}, [t]), b(() => {
|
|
15
15
|
if (t) {
|
|
16
|
-
|
|
16
|
+
a(null);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
if (m.current || !s.current && !
|
|
21
|
-
s.current = !1,
|
|
22
|
-
const
|
|
23
|
-
return () => clearTimeout(
|
|
24
|
-
}, [t, e == null ? void 0 : e.refreshed]), typeof navigator < "u" && navigator.onLine === !1
|
|
19
|
+
const n = (e == null ? void 0 : e.refreshed) ?? null;
|
|
20
|
+
if (m.current || !s.current && !n) return;
|
|
21
|
+
s.current = !1, o(!1), a(n ?? "Live updates resumed.");
|
|
22
|
+
const g = setTimeout(() => a(null), S);
|
|
23
|
+
return () => clearTimeout(g);
|
|
24
|
+
}, [t, e == null ? void 0 : e.refreshed]), typeof navigator < "u" && navigator.onLine === !1) return null;
|
|
25
|
+
const c = typeof document < "u" && !!document.querySelector("[data-environment-edge]");
|
|
26
|
+
return r && t ? /* @__PURE__ */ i(
|
|
25
27
|
"div",
|
|
26
28
|
{
|
|
27
29
|
role: "status",
|
|
28
30
|
"data-realtime-banner": "paused",
|
|
29
|
-
className:
|
|
31
|
+
className: `flex items-center justify-center gap-2 border-b border-amber-200 bg-amber-50 px-4 pb-1.5 text-[12px] text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200 ${c ? "pt-[26px]" : "pt-1.5"}`,
|
|
30
32
|
children: [
|
|
31
|
-
/* @__PURE__ */ u(
|
|
33
|
+
/* @__PURE__ */ u(x, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
32
34
|
"Live updates paused, reconnecting. Lists may be out of date until then."
|
|
33
35
|
]
|
|
34
36
|
}
|
|
35
|
-
) :
|
|
37
|
+
) : l ? /* @__PURE__ */ i(
|
|
36
38
|
"div",
|
|
37
39
|
{
|
|
38
40
|
role: "status",
|
|
39
41
|
"data-realtime-banner": "resumed",
|
|
40
|
-
className:
|
|
42
|
+
className: `flex items-center justify-center gap-2 border-b border-emerald-200 bg-emerald-50 px-4 pb-1.5 text-[12px] text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-200 ${c ? "pt-[26px]" : "pt-1.5"}`,
|
|
41
43
|
children: [
|
|
42
|
-
/* @__PURE__ */ u(
|
|
43
|
-
|
|
44
|
+
/* @__PURE__ */ u(k, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
45
|
+
l
|
|
44
46
|
]
|
|
45
47
|
}
|
|
46
48
|
) : null;
|
|
47
49
|
}
|
|
48
50
|
function L({ className: e }) {
|
|
49
|
-
const r =
|
|
50
|
-
return (r == null ? void 0 : r.state) !== "reconnecting" || r.repair === "silent" ? null : /* @__PURE__ */
|
|
51
|
+
const r = h();
|
|
52
|
+
return (r == null ? void 0 : r.state) !== "reconnecting" || r.repair === "silent" ? null : /* @__PURE__ */ i(
|
|
51
53
|
"span",
|
|
52
54
|
{
|
|
53
55
|
"data-realtime-stale": !0,
|
|
54
56
|
"data-tip": "Live updates are paused while the connection comes back. Refresh to see the latest.",
|
|
55
57
|
className: `inline-flex h-6 shrink-0 items-center gap-1 rounded-full border border-amber-300 bg-amber-50 px-2 text-[11px] font-medium text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200 ${e ?? ""}`,
|
|
56
58
|
children: [
|
|
57
|
-
/* @__PURE__ */ u(
|
|
59
|
+
/* @__PURE__ */ u(x, { className: "h-3 w-3" }),
|
|
58
60
|
"May be stale"
|
|
59
61
|
]
|
|
60
62
|
}
|
|
@@ -62,5 +64,5 @@ function L({ className: e }) {
|
|
|
62
64
|
}
|
|
63
65
|
export {
|
|
64
66
|
L as RealtimeStaleMark,
|
|
65
|
-
|
|
67
|
+
E as RealtimeStatusBanner
|
|
66
68
|
};
|
|
@@ -22,7 +22,7 @@ function Se({
|
|
|
22
22
|
collection: a,
|
|
23
23
|
itemId: E,
|
|
24
24
|
layoutId: Q,
|
|
25
|
-
rootLayoutSlug:
|
|
25
|
+
rootLayoutSlug: w,
|
|
26
26
|
width: p,
|
|
27
27
|
title: _,
|
|
28
28
|
stack: x,
|
|
@@ -30,7 +30,7 @@ function Se({
|
|
|
30
30
|
onPop: h,
|
|
31
31
|
onClose: B,
|
|
32
32
|
design: l,
|
|
33
|
-
onOpenRecord:
|
|
33
|
+
onOpenRecord: k,
|
|
34
34
|
headerExtra: g
|
|
35
35
|
}) {
|
|
36
36
|
var K;
|
|
@@ -46,7 +46,7 @@ function Se({
|
|
|
46
46
|
}, [s, h]), { viewers: i } = ne(
|
|
47
47
|
l ? null : e.collection,
|
|
48
48
|
l ? null : e.itemId
|
|
49
|
-
), v = ee(() => l ? null : { open: N }, [l, N]), T = re(), d = l ? null : T[e.collection] ?? null, m = !l && c.length === 1 && !!
|
|
49
|
+
), v = ee(() => l ? null : { open: N }, [l, N]), T = re(), d = l ? null : T[e.collection] ?? null, m = !l && c.length === 1 && !!w, { data: U, isLoading: G } = X({
|
|
50
50
|
queryKey: ["drilldown-layout", e.collection, e.layoutId ?? null],
|
|
51
51
|
enabled: !m && !l,
|
|
52
52
|
queryFn: () => V.request(
|
|
@@ -58,7 +58,7 @@ function Se({
|
|
|
58
58
|
}), o = l ? {
|
|
59
59
|
...l.layout,
|
|
60
60
|
layout: l.layout.layout ?? { id: 0, name: "", slug: null }
|
|
61
|
-
} : U, C = m ?
|
|
61
|
+
} : U, C = m ? w ?? void 0 : (o == null ? void 0 : o.layout.slug) ?? void 0, D = (K = o == null ? void 0 : o.layout) == null ? void 0 : K.sheet_width, $ = /* @__PURE__ */ n(j, { children: [
|
|
62
62
|
/* @__PURE__ */ n("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
63
63
|
c.length > 1 && /* @__PURE__ */ t(
|
|
64
64
|
"button",
|
|
@@ -98,9 +98,9 @@ function Se({
|
|
|
98
98
|
if (r.metaKey || r.ctrlKey || r.shiftKey || r.altKey || r.button !== 0) return;
|
|
99
99
|
r.preventDefault();
|
|
100
100
|
const f = { collection: e.collection, itemId: String(e.itemId) };
|
|
101
|
-
|
|
101
|
+
k ? k(f) : z(f);
|
|
102
102
|
},
|
|
103
|
-
className: "flex shrink-0 items-center gap-1 text-[11px] font-
|
|
103
|
+
className: "flex shrink-0 items-center gap-1 rounded text-[11px] font-medium text-slate-600 underline-offset-2 hover:text-slate-900 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-300 dark:hover:text-white",
|
|
104
104
|
children: [
|
|
105
105
|
"Open record ",
|
|
106
106
|
/* @__PURE__ */ t(L, { className: "h-3 w-3" })
|
|
@@ -156,7 +156,7 @@ function Se({
|
|
|
156
156
|
) }) : /* @__PURE__ */ t(se, { open: !0, onOpenChange: (r) => !r && B(), children: /* @__PURE__ */ n(
|
|
157
157
|
de,
|
|
158
158
|
{
|
|
159
|
-
className: "flex flex-col gap-0 overflow-hidden p-0",
|
|
159
|
+
className: "flex flex-col gap-0 overflow-hidden p-0 max-sm:!w-screen max-sm:!max-w-none",
|
|
160
160
|
style: {
|
|
161
161
|
width: (d == null ? void 0 : d.width) ?? e.width ?? D ?? p ?? 640,
|
|
162
162
|
maxWidth: "96vw"
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { get as
|
|
6
|
-
import { useLiveRecord as
|
|
7
|
-
import { formatRelative as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as a, Fragment as k, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as w, useQuery as C } from "@tanstack/react-query";
|
|
3
|
+
import { useEffect as y } from "react";
|
|
4
|
+
import { useNivaroClient as E } from "../context.js";
|
|
5
|
+
import { get as S } from "../lib/commands.js";
|
|
6
|
+
import { useLiveRecord as P } from "../lib/live.js";
|
|
7
|
+
import { formatRelative as _ } from "../lib/utils.js";
|
|
8
|
+
import { RECORD_CARD_OPEN_EVENT as T } from "./CellCopyLayer.js";
|
|
9
|
+
import { useHoverIntent as D } from "./collections-directory/CollectionHoverCard.js";
|
|
10
|
+
import { Popover as R, PopoverAnchor as A, PopoverContent as O } from "./ui/popover.js";
|
|
11
|
+
import { Skeleton as f } from "./ui/skeleton.js";
|
|
12
|
+
const L = 15e3, q = /^(nivaro_|directus_)/i, x = (e, o) => ["record-card", e, o];
|
|
13
|
+
function F(e, o) {
|
|
14
|
+
return !!e && !q.test(e) && o != null && o !== "" && typeof o != "object";
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function v(e) {
|
|
16
17
|
return e.inactive === "suspended" ? `${e.name} (suspended)` : e.name;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function $(e) {
|
|
19
20
|
return e.money ? e.value.toLocaleString("en-US", { style: "currency", currency: "USD" }) : e.value.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
function b(e) {
|
|
23
|
+
return !e.state && !e.sla && e.owners.length === 0 && e.amounts.length === 0;
|
|
24
|
+
}
|
|
25
|
+
const U = {
|
|
22
26
|
warning: {
|
|
23
27
|
text: "Due soon",
|
|
24
28
|
cls: "bg-amber-100 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300"
|
|
@@ -28,38 +32,43 @@ const q = {
|
|
|
28
32
|
cls: "bg-red-100 text-red-700 dark:bg-red-500/15 dark:text-red-300"
|
|
29
33
|
}
|
|
30
34
|
};
|
|
31
|
-
function
|
|
35
|
+
function j({
|
|
32
36
|
collection: e,
|
|
33
|
-
id:
|
|
37
|
+
id: o,
|
|
34
38
|
onGone: c
|
|
35
39
|
}) {
|
|
36
|
-
const
|
|
37
|
-
queryKey: x(e,
|
|
38
|
-
queryFn: () =>
|
|
39
|
-
|
|
40
|
-
).then((
|
|
41
|
-
staleTime:
|
|
40
|
+
const u = E(), m = w(), { data: t, isPending: p, isError: l } = C({
|
|
41
|
+
queryKey: x(e, o),
|
|
42
|
+
queryFn: () => u.request(
|
|
43
|
+
S(`/records/${e}/${encodeURIComponent(o)}/card`)
|
|
44
|
+
).then((s) => s.data),
|
|
45
|
+
staleTime: L,
|
|
42
46
|
gcTime: 6e4,
|
|
43
47
|
retry: !1
|
|
44
48
|
});
|
|
45
|
-
|
|
46
|
-
m.invalidateQueries({ queryKey: x(e,
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
P(e, o, () => {
|
|
50
|
+
m.invalidateQueries({ queryKey: x(e, o) });
|
|
51
|
+
});
|
|
52
|
+
const n = !!t && b(t);
|
|
53
|
+
if (y(() => {
|
|
54
|
+
(l || n) && c();
|
|
55
|
+
}, [l, n, c]), p)
|
|
56
|
+
return (
|
|
57
|
+
// In dark the popover and the skeleton token are the same grey: lift the bars a step.
|
|
58
|
+
/* @__PURE__ */ i("div", { className: "space-y-2 dark:[&>div]:bg-white/[0.09]", "aria-busy": !0, children: [
|
|
59
|
+
/* @__PURE__ */ a(f, { className: "h-4 w-40" }),
|
|
60
|
+
/* @__PURE__ */ a(f, { className: "h-3 w-24" }),
|
|
61
|
+
/* @__PURE__ */ a(f, { className: "h-3 w-32" })
|
|
62
|
+
] })
|
|
63
|
+
);
|
|
64
|
+
if (l || !t || n) return null;
|
|
65
|
+
const d = t.sla ? U[t.sla] : null;
|
|
66
|
+
return /* @__PURE__ */ i("div", { className: "min-w-0", "data-record-card": !0, children: [
|
|
67
|
+
/* @__PURE__ */ a("p", { className: "text-[10.5px] font-medium uppercase tracking-wide text-slate-400 dark:text-slate-500", children: t.collection_label }),
|
|
68
|
+
/* @__PURE__ */ a("p", { className: "mt-0.5 line-clamp-2 text-[13px] font-semibold leading-snug text-slate-800 dark:text-slate-100", children: t.title }),
|
|
69
|
+
(t.state || d) && /* @__PURE__ */ i("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: [
|
|
70
|
+
t.state && /* @__PURE__ */ i("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-medium text-slate-700 dark:bg-white/10 dark:text-slate-200", children: [
|
|
71
|
+
/* @__PURE__ */ a(
|
|
63
72
|
"span",
|
|
64
73
|
{
|
|
65
74
|
"aria-hidden": !0,
|
|
@@ -67,81 +76,90 @@ function F({
|
|
|
67
76
|
style: t.state.color ? { backgroundColor: t.state.color } : void 0
|
|
68
77
|
}
|
|
69
78
|
),
|
|
70
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ a("span", { className: "truncate", children: t.state.label })
|
|
71
80
|
] }),
|
|
72
|
-
|
|
81
|
+
d && /* @__PURE__ */ a("span", { className: `rounded-full px-2 py-0.5 text-[11px] font-medium ${d.cls}`, children: d.text })
|
|
73
82
|
] }),
|
|
74
|
-
t.owners.length > 0 && /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
t.owners.length <= 2 ? t.owners.map(
|
|
83
|
+
t.owners.length > 0 && /* @__PURE__ */ i("p", { className: "mt-2 truncate text-[11.5px] text-slate-600 dark:text-slate-300", children: [
|
|
84
|
+
/* @__PURE__ */ a("span", { className: "text-slate-400 dark:text-slate-500", children: "With " }),
|
|
85
|
+
t.owners.length <= 2 ? t.owners.map(v).join(" and ") : `${v(t.owners[0])} and ${t.owners.length - 1} others`
|
|
77
86
|
] }),
|
|
78
|
-
t.amounts.length > 0 && /* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
] },
|
|
82
|
-
t.updated_at && /* @__PURE__ */
|
|
87
|
+
t.amounts.length > 0 && /* @__PURE__ */ a("dl", { className: "mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-[11.5px]", children: t.amounts.map((s) => /* @__PURE__ */ i("div", { className: "contents", children: [
|
|
88
|
+
/* @__PURE__ */ a("dt", { className: "truncate text-slate-500 dark:text-slate-400", children: s.label }),
|
|
89
|
+
/* @__PURE__ */ a("dd", { className: "text-right font-medium tabular-nums text-slate-800 dark:text-slate-100", children: $(s) })
|
|
90
|
+
] }, s.field)) }),
|
|
91
|
+
t.updated_at && /* @__PURE__ */ i("p", { className: "mt-2 text-[10.5px] text-slate-400 dark:text-slate-500", children: [
|
|
83
92
|
"Updated ",
|
|
84
|
-
|
|
93
|
+
_(t.updated_at)
|
|
85
94
|
] })
|
|
86
95
|
] });
|
|
87
96
|
}
|
|
88
|
-
function
|
|
97
|
+
function G({
|
|
89
98
|
collection: e,
|
|
90
|
-
id:
|
|
99
|
+
id: o,
|
|
91
100
|
children: c,
|
|
92
|
-
disabled:
|
|
101
|
+
disabled: u,
|
|
93
102
|
side: m = "bottom",
|
|
94
103
|
block: t = !1,
|
|
95
|
-
delayMs:
|
|
104
|
+
delayMs: p = 500
|
|
96
105
|
}) {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
const l = !u && F(e, o), n = D(l, p), d = w();
|
|
107
|
+
y(() => {
|
|
108
|
+
!n.open || typeof window > "u" || window.dispatchEvent(new CustomEvent(T));
|
|
109
|
+
}, [n.open]);
|
|
110
|
+
const s = () => {
|
|
111
|
+
const r = d.getQueryState(x(String(e), String(o)));
|
|
112
|
+
(r == null ? void 0 : r.status) !== "error" && (r != null && r.data && b(r.data) || n.show());
|
|
100
113
|
};
|
|
101
|
-
if (!
|
|
102
|
-
const
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
114
|
+
if (!l) return /* @__PURE__ */ a(k, { children: c });
|
|
115
|
+
const N = String(o);
|
|
116
|
+
return /* @__PURE__ */ i(R, { open: n.open, onOpenChange: (r) => !r && n.close(), children: [
|
|
117
|
+
/* @__PURE__ */ a(A, { asChild: !0, children: /* @__PURE__ */ a(
|
|
105
118
|
"span",
|
|
106
119
|
{
|
|
107
120
|
className: t ? "block" : "inline",
|
|
108
121
|
"data-record-card-anchor": !0,
|
|
109
|
-
onPointerEnter: (
|
|
110
|
-
|
|
122
|
+
onPointerEnter: (r) => {
|
|
123
|
+
r.pointerType === "mouse" && s();
|
|
124
|
+
},
|
|
125
|
+
onPointerLeave: (r) => {
|
|
126
|
+
r.pointerType === "mouse" && n.hide();
|
|
111
127
|
},
|
|
112
|
-
|
|
113
|
-
|
|
128
|
+
onPointerOver: (r) => {
|
|
129
|
+
var h, g;
|
|
130
|
+
r.pointerType === "mouse" && ((g = (h = r.target).closest) != null && g.call(h, "[data-no-hovercard]") ? n.close() : n.open || s());
|
|
114
131
|
},
|
|
115
|
-
onPointerDown:
|
|
116
|
-
onFocus:
|
|
117
|
-
onBlur:
|
|
132
|
+
onPointerDown: n.close,
|
|
133
|
+
onFocus: s,
|
|
134
|
+
onBlur: n.hide,
|
|
118
135
|
children: c
|
|
119
136
|
}
|
|
120
137
|
) }),
|
|
121
|
-
|
|
122
|
-
|
|
138
|
+
n.open && /* @__PURE__ */ a(
|
|
139
|
+
O,
|
|
123
140
|
{
|
|
124
141
|
side: m,
|
|
125
142
|
align: "start",
|
|
126
143
|
sideOffset: 6,
|
|
127
144
|
collisionPadding: 12,
|
|
128
145
|
avoidCollisions: !0,
|
|
129
|
-
onOpenAutoFocus: (
|
|
130
|
-
onCloseAutoFocus: (
|
|
131
|
-
onPointerEnter:
|
|
132
|
-
onPointerLeave:
|
|
133
|
-
onClick: (
|
|
146
|
+
onOpenAutoFocus: (r) => r.preventDefault(),
|
|
147
|
+
onCloseAutoFocus: (r) => r.preventDefault(),
|
|
148
|
+
onPointerEnter: n.cancel,
|
|
149
|
+
onPointerLeave: n.hide,
|
|
150
|
+
onClick: (r) => r.stopPropagation(),
|
|
134
151
|
className: "w-[280px] max-w-[calc(100vw-24px)] p-3 motion-reduce:animate-none",
|
|
135
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ a(j, { collection: e, id: N, onGone: n.close })
|
|
136
153
|
}
|
|
137
154
|
)
|
|
138
155
|
] });
|
|
139
156
|
}
|
|
140
157
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
158
|
+
L as RECORD_CARD_STALE_MS,
|
|
159
|
+
G as RecordHoverCard,
|
|
160
|
+
b as cardAddsNothing,
|
|
161
|
+
$ as cardAmountText,
|
|
162
|
+
F as hoverCardEligible,
|
|
163
|
+
v as ownerText,
|
|
146
164
|
x as recordCardKey
|
|
147
165
|
};
|