@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,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t, jsxs as h, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as De, useQuery as Y } from "@tanstack/react-query";
|
|
3
3
|
import { useMemo as he, useState as T, useEffect as te, createContext as tt, useRef as ee, useCallback as rt, useContext as nt, useDeferredValue as at } from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { useNivaroClient as re, useItemEditAuth as
|
|
4
|
+
import { createPortal as lt } from "react-dom";
|
|
5
|
+
import { useNivaroClient as re, useItemEditAuth as st, useDrilldown as Ie, useOverlayState as ot, DrilldownContext as it, useItemNavigation as dt } from "../context.js";
|
|
6
6
|
import { useDebounced as ct } from "../hooks/useDebounced.js";
|
|
7
|
-
import { get as xe, post as
|
|
7
|
+
import { get as xe, post as se } from "../lib/commands.js";
|
|
8
8
|
import { describeError as ut } from "../lib/error-message.js";
|
|
9
9
|
import { liveQueryMeta as mt } from "../lib/live-queries.js";
|
|
10
10
|
import { useLiveFade as pt } from "../lib/live-screen.js";
|
|
@@ -45,46 +45,46 @@ function Rt(e) {
|
|
|
45
45
|
return r.length > 80 ? `${r.slice(0, 80)}…` : r;
|
|
46
46
|
}
|
|
47
47
|
function pe(e, r) {
|
|
48
|
-
const n = [],
|
|
49
|
-
return e.split(
|
|
48
|
+
const n = [], l = /(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|\[[^\]]+\]\([^)]+\))/g;
|
|
49
|
+
return e.split(l).forEach((s, m) => {
|
|
50
50
|
const u = `${r}-${m}`;
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
n.push(/* @__PURE__ */ t("strong", { children:
|
|
54
|
-
else if (
|
|
55
|
-
n.push(/* @__PURE__ */ t("em", { children:
|
|
56
|
-
else if (
|
|
51
|
+
if (s)
|
|
52
|
+
if (s.startsWith("**") && s.endsWith("**"))
|
|
53
|
+
n.push(/* @__PURE__ */ t("strong", { children: s.slice(2, -2) }, u));
|
|
54
|
+
else if (s.startsWith("*") && s.endsWith("*") && s.length > 2)
|
|
55
|
+
n.push(/* @__PURE__ */ t("em", { children: s.slice(1, -1) }, u));
|
|
56
|
+
else if (s.startsWith("`") && s.endsWith("`"))
|
|
57
57
|
n.push(
|
|
58
58
|
/* @__PURE__ */ t(
|
|
59
59
|
"code",
|
|
60
60
|
{
|
|
61
61
|
className: "rounded bg-slate-100 px-1 py-0.5 font-mono text-[0.9em] dark:bg-muted",
|
|
62
|
-
children:
|
|
62
|
+
children: s.slice(1, -1)
|
|
63
63
|
},
|
|
64
64
|
u
|
|
65
65
|
)
|
|
66
66
|
);
|
|
67
67
|
else {
|
|
68
|
-
const d =
|
|
68
|
+
const d = s.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
|
|
69
69
|
d && gt(d[2]) !== null ? n.push(
|
|
70
70
|
/* @__PURE__ */ t("a", { href: d[2], className: "text-nvr-cyan underline-offset-2 hover:underline", children: d[1] }, u)
|
|
71
|
-
) : n.push(
|
|
71
|
+
) : n.push(s);
|
|
72
72
|
}
|
|
73
73
|
}), n;
|
|
74
74
|
}
|
|
75
75
|
function Wt({ content: e }) {
|
|
76
76
|
const r = [];
|
|
77
|
-
let n = [],
|
|
77
|
+
let n = [], l = [], s = !1;
|
|
78
78
|
const m = (d) => {
|
|
79
79
|
n.length && (r.push(
|
|
80
80
|
/* @__PURE__ */ t("p", { className: "leading-relaxed", children: pe(n.join(" "), d) }, d)
|
|
81
81
|
), n = []);
|
|
82
82
|
}, u = (d) => {
|
|
83
|
-
if (!
|
|
84
|
-
const o =
|
|
83
|
+
if (!l.length) return;
|
|
84
|
+
const o = l.map((c, x) => /* @__PURE__ */ t("li", { children: pe(c, `${d}-${x}`) }, `${d}-${x}`));
|
|
85
85
|
r.push(
|
|
86
|
-
|
|
87
|
-
),
|
|
86
|
+
s ? /* @__PURE__ */ t("ol", { className: "list-decimal space-y-0.5 pl-5", children: o }, d) : /* @__PURE__ */ t("ul", { className: "list-disc space-y-0.5 pl-5", children: o }, d)
|
|
87
|
+
), l = [];
|
|
88
88
|
};
|
|
89
89
|
return e.split(`
|
|
90
90
|
`).forEach((d, o) => {
|
|
@@ -98,7 +98,7 @@ function Wt({ content: e }) {
|
|
|
98
98
|
} else if (N || C) {
|
|
99
99
|
m(`${c}-fp`);
|
|
100
100
|
const S = !!C;
|
|
101
|
-
|
|
101
|
+
l.length && s !== S && u(`${c}-fl`), s = S, l.push((N == null ? void 0 : N[1]) ?? (C == null ? void 0 : C[1]));
|
|
102
102
|
} else d.trim() === "" ? (u(`${c}-fl`), m(`${c}-fp`)) : (u(`${c}-fl`), n.push(d.trim()));
|
|
103
103
|
}), u("md-end-l"), m("md-end-p"), /* @__PURE__ */ t("div", { className: "space-y-2 p-4 text-[13px] text-slate-700 dark:text-slate-300", children: r });
|
|
104
104
|
}
|
|
@@ -109,10 +109,10 @@ function be() {
|
|
|
109
109
|
}
|
|
110
110
|
const Pt = /* @__PURE__ */ new Set(["page-renderer-query", "page-renderer-widget-data"]);
|
|
111
111
|
function ge(e, r, n) {
|
|
112
|
-
const
|
|
112
|
+
const l = re();
|
|
113
113
|
return Y({
|
|
114
114
|
queryKey: ["page-renderer-widget-data", e, r.id],
|
|
115
|
-
queryFn: () =>
|
|
115
|
+
queryFn: () => l.request(se(`/pages/${e}/widget-data`, { widget_id: r.id })).then((s) => s.data),
|
|
116
116
|
enabled: n,
|
|
117
117
|
retry: !1,
|
|
118
118
|
staleTime: 3e4,
|
|
@@ -121,12 +121,12 @@ function ge(e, r, n) {
|
|
|
121
121
|
}
|
|
122
122
|
function Lt({ slug: e, widget: r }) {
|
|
123
123
|
var c;
|
|
124
|
-
const n = r.config ?? {}, { data:
|
|
124
|
+
const n = r.config ?? {}, { data: l, isLoading: s, error: m } = ge(e, r, !!n.collection), u = dt();
|
|
125
125
|
if (!n.collection)
|
|
126
126
|
return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Select a collection" });
|
|
127
|
-
if (
|
|
127
|
+
if (s) return /* @__PURE__ */ t(oe, {});
|
|
128
128
|
if (m) return /* @__PURE__ */ t(ie, { error: m });
|
|
129
|
-
const d = (
|
|
129
|
+
const d = (l == null ? void 0 : l.rows) ?? [];
|
|
130
130
|
if (!d.length) return /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "No records" });
|
|
131
131
|
const o = (c = n.columns) != null && c.length ? n.columns : Object.keys(d[0]).filter((x) => {
|
|
132
132
|
const N = d[0][x];
|
|
@@ -160,16 +160,16 @@ function Lt({ slug: e, widget: r }) {
|
|
|
160
160
|
] }) });
|
|
161
161
|
}
|
|
162
162
|
function Ot({ slug: e, widget: r }) {
|
|
163
|
-
const n = r.config ?? {}, { data:
|
|
163
|
+
const n = r.config ?? {}, { data: l, isLoading: s, error: m } = ge(e, r, !!n.collection);
|
|
164
164
|
return n.collection ? m ? /* @__PURE__ */ t(ie, { error: m }) : /* @__PURE__ */ h("div", { className: "flex h-full flex-col items-start justify-center px-4", children: [
|
|
165
|
-
|
|
165
|
+
s ? /* @__PURE__ */ t("div", { className: "h-9 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ t("span", { className: "text-[32px] font-semibold leading-none tracking-tight text-slate-900 dark:text-slate-100", children: (l == null ? void 0 : l.value) != null ? $t(Number(l.value)) : "—" }),
|
|
166
166
|
/* @__PURE__ */ t("span", { className: "mt-1.5 text-[12px] text-slate-400", children: n.label || `${n.aggregate ?? "count"} of ${n.collection}` })
|
|
167
167
|
] }) : /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Select a collection" });
|
|
168
168
|
}
|
|
169
169
|
function At({ slug: e, widget: r }) {
|
|
170
|
-
const { data: n, isLoading:
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
170
|
+
const { data: n, isLoading: l, error: s } = ge(e, r, !0);
|
|
171
|
+
if (l) return /* @__PURE__ */ t(oe, {});
|
|
172
|
+
if (s) return /* @__PURE__ */ t(ie, { error: s });
|
|
173
173
|
const m = (n == null ? void 0 : n.rows) ?? [];
|
|
174
174
|
return m.length ? /* @__PURE__ */ t("div", { className: "h-full overflow-auto px-3 py-1.5", children: m.map((u) => /* @__PURE__ */ h(
|
|
175
175
|
"div",
|
|
@@ -204,24 +204,25 @@ function Qe({
|
|
|
204
204
|
config: e,
|
|
205
205
|
initialScope: r,
|
|
206
206
|
width: n,
|
|
207
|
-
title:
|
|
208
|
-
onClose:
|
|
207
|
+
title: l,
|
|
208
|
+
onClose: s
|
|
209
209
|
}) {
|
|
210
210
|
const m = typeof n == "number" ? `${n}px` : n ?? "85%";
|
|
211
|
-
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick:
|
|
211
|
+
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick: s, children: /* @__PURE__ */ h(
|
|
212
212
|
"div",
|
|
213
213
|
{
|
|
214
|
-
|
|
214
|
+
"data-page-drawer": !0,
|
|
215
|
+
className: "flex h-full flex-col border-l border-slate-200 max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 bg-white shadow-2xl dark:border-border dark:bg-background",
|
|
215
216
|
style: { width: m, maxWidth: "96%" },
|
|
216
217
|
onClick: (u) => u.stopPropagation(),
|
|
217
218
|
children: [
|
|
218
219
|
/* @__PURE__ */ h("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
219
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children:
|
|
220
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: l ?? e.title ?? "Manage" }),
|
|
220
221
|
/* @__PURE__ */ t(
|
|
221
222
|
"button",
|
|
222
223
|
{
|
|
223
224
|
type: "button",
|
|
224
|
-
onClick:
|
|
225
|
+
onClick: s,
|
|
225
226
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
226
227
|
children: "Close"
|
|
227
228
|
}
|
|
@@ -233,13 +234,13 @@ function Qe({
|
|
|
233
234
|
) });
|
|
234
235
|
}
|
|
235
236
|
function Et({ widget: e }) {
|
|
236
|
-
const r = e.config ?? {}, [n,
|
|
237
|
+
const r = e.config ?? {}, [n, l] = T(!1);
|
|
237
238
|
return !r.target_collection || !r.option_collection || !r.key_field || !r.value_field ? /* @__PURE__ */ t("div", { className: "p-3 text-[12px] text-slate-400", children: "Matrix editor not configured" }) : r.display === "drawer" ? /* @__PURE__ */ h("div", { className: "flex h-full items-center", children: [
|
|
238
239
|
/* @__PURE__ */ t(
|
|
239
240
|
"button",
|
|
240
241
|
{
|
|
241
242
|
type: "button",
|
|
242
|
-
onClick: () =>
|
|
243
|
+
onClick: () => l(!0),
|
|
243
244
|
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 bg-white px-3 text-[12.5px] font-medium text-slate-700 shadow-sm transition-colors hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
244
245
|
children: r.button_label ?? r.title ?? "Manage"
|
|
245
246
|
}
|
|
@@ -249,7 +250,7 @@ function Et({ widget: e }) {
|
|
|
249
250
|
{
|
|
250
251
|
config: r,
|
|
251
252
|
width: r.sheet_width,
|
|
252
|
-
onClose: () =>
|
|
253
|
+
onClose: () => l(!1)
|
|
253
254
|
}
|
|
254
255
|
)
|
|
255
256
|
] }) : /* @__PURE__ */ t(fe, { config: r });
|
|
@@ -261,57 +262,57 @@ function Bt(e) {
|
|
|
261
262
|
);
|
|
262
263
|
}
|
|
263
264
|
function Fe(e, r) {
|
|
264
|
-
const n = [...new Set(e.map((
|
|
265
|
+
const n = [...new Set(e.map((l) => l[r]).filter((l) => l != null && l !== ""))];
|
|
265
266
|
return n.length ? n.map(String).join(",") : void 0;
|
|
266
267
|
}
|
|
267
|
-
function Ue(e, r, n,
|
|
268
|
+
function Ue(e, r, n, l, s, m, u) {
|
|
268
269
|
if (typeof e != "string") return e;
|
|
269
270
|
if (e.startsWith("$row.")) {
|
|
270
271
|
const d = e.slice(5);
|
|
271
272
|
return !r && u ? Fe(u, d) : r == null ? void 0 : r[d];
|
|
272
273
|
}
|
|
273
274
|
if (e.startsWith("$rows.")) return Fe(n, e.slice(6));
|
|
274
|
-
if (e.startsWith("$param.")) return
|
|
275
|
+
if (e.startsWith("$param.")) return l[e.slice(7)];
|
|
275
276
|
if (e.startsWith("$filters.")) {
|
|
276
|
-
const d = e.slice(9), o = m == null ? void 0 : m.find((x) => x.param === d), c =
|
|
277
|
+
const d = e.slice(9), o = m == null ? void 0 : m.find((x) => x.param === d), c = s[d] ?? [];
|
|
277
278
|
return c.length ? c.map((x) => String(x[(o == null ? void 0 : o.value_field) ?? "id"] ?? "")).join(",") : void 0;
|
|
278
279
|
}
|
|
279
280
|
return e;
|
|
280
281
|
}
|
|
281
|
-
function Dt(e, r, n,
|
|
282
|
+
function Dt(e, r, n, l, s, m, u) {
|
|
282
283
|
const d = {}, o = [];
|
|
283
284
|
for (const [c, x] of Object.entries(e.params ?? {})) {
|
|
284
|
-
const N = Ue(x, r, n,
|
|
285
|
+
const N = Ue(x, r, n, l, s, m, u);
|
|
285
286
|
N !== void 0 ? d[c] = N : typeof x == "string" && (x.startsWith("$row.") || x.startsWith("$rows.")) && o.push(c);
|
|
286
287
|
}
|
|
287
288
|
return { ...e, params: d, ...o.length ? { unresolved_params: o } : {} };
|
|
288
289
|
}
|
|
289
290
|
function It(e, r) {
|
|
290
|
-
var
|
|
291
|
-
let n = (
|
|
291
|
+
var s, m;
|
|
292
|
+
let n = (s = e.row_noun) == null ? void 0 : s.trim();
|
|
292
293
|
if (!n) {
|
|
293
294
|
const u = (m = /\{\{\s*([a-z]+)_[\w.]*\s*\}\}/i.exec(e.title ?? "")) == null ? void 0 : m[1];
|
|
294
295
|
n = u ? `${u.toLowerCase()}s` : "rows";
|
|
295
296
|
}
|
|
296
|
-
const
|
|
297
|
-
return `Total of ${r.toLocaleString("en-US")} ${
|
|
297
|
+
const l = r === 1 && n.endsWith("s") ? n.slice(0, -1) : n;
|
|
298
|
+
return `Total of ${r.toLocaleString("en-US")} ${l}`;
|
|
298
299
|
}
|
|
299
300
|
function zt(e, r) {
|
|
300
|
-
const n = ut(e),
|
|
301
|
-
if (!
|
|
302
|
-
const m = Q(
|
|
303
|
-
return r != null && r.includes(
|
|
301
|
+
const n = ut(e), l = [n.title, n.technical ?? ""].join(" "), s = /Missing required parameter:\s*([\w]+)/i.exec(l);
|
|
302
|
+
if (!s) return null;
|
|
303
|
+
const m = Q(s[1]).toLowerCase();
|
|
304
|
+
return r != null && r.includes(s[1]) ? `Nothing to show: the row you opened has no ${m}.` : `Choose ${m} to see this view.`;
|
|
304
305
|
}
|
|
305
306
|
function Kt({
|
|
306
307
|
config: e,
|
|
307
308
|
stats: r,
|
|
308
309
|
asOf: n,
|
|
309
|
-
note:
|
|
310
|
+
note: l
|
|
310
311
|
}) {
|
|
311
|
-
const
|
|
312
|
+
const s = re(), m = be(), u = e.params ?? {}, { data: d, isPending: o, isError: c } = Y({
|
|
312
313
|
queryKey: ["page-renderer-query", e.query_slug, JSON.stringify(u)],
|
|
313
|
-
queryFn: () =>
|
|
314
|
-
|
|
314
|
+
queryFn: () => s.request(
|
|
315
|
+
se(`/custom-queries/${e.query_slug}/execute`, { params: u })
|
|
315
316
|
),
|
|
316
317
|
enabled: !!e.query_slug,
|
|
317
318
|
staleTime: 6e4,
|
|
@@ -331,7 +332,7 @@ function Kt({
|
|
|
331
332
|
loading: o && !c,
|
|
332
333
|
error: c,
|
|
333
334
|
asOf: n,
|
|
334
|
-
note:
|
|
335
|
+
note: l
|
|
335
336
|
}
|
|
336
337
|
)
|
|
337
338
|
}
|
|
@@ -341,16 +342,17 @@ function Qt({
|
|
|
341
342
|
def: e,
|
|
342
343
|
row: r,
|
|
343
344
|
totalCount: n,
|
|
344
|
-
onClose:
|
|
345
|
+
onClose: l
|
|
345
346
|
}) {
|
|
346
|
-
const [
|
|
347
|
+
const [s, m] = T(e.initialTab ?? 0), u = !r && n != null ? It(e, n) : e.title ? e.title.replace(/\{\{\s*([\w.]+)\s*\}\}/g, (c, x) => {
|
|
347
348
|
const N = r == null ? void 0 : r[x];
|
|
348
349
|
return N == null ? "" : String(N);
|
|
349
|
-
}) : "Details", d = typeof e.width == "number" ? `${e.width}px` : e.width ?? "90%", o = e.resolvedTabs[
|
|
350
|
-
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick:
|
|
350
|
+
}) : "Details", d = typeof e.width == "number" ? `${e.width}px` : e.width ?? "90%", o = e.resolvedTabs[s];
|
|
351
|
+
return /* @__PURE__ */ t("div", { className: "fixed inset-0 z-50 flex justify-end bg-black/30", onClick: l, children: /* @__PURE__ */ h(
|
|
351
352
|
"div",
|
|
352
353
|
{
|
|
353
|
-
|
|
354
|
+
"data-page-drawer": !0,
|
|
355
|
+
className: "flex h-full flex-col border-l border-slate-200 max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 bg-slate-50 shadow-2xl dark:border-border dark:bg-background",
|
|
354
356
|
style: { width: d, maxWidth: "96%" },
|
|
355
357
|
onClick: (c) => c.stopPropagation(),
|
|
356
358
|
children: [
|
|
@@ -362,7 +364,7 @@ function Qt({
|
|
|
362
364
|
{
|
|
363
365
|
type: "button",
|
|
364
366
|
onClick: () => m(x),
|
|
365
|
-
className: `rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors ${x ===
|
|
367
|
+
className: `rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors ${x === s ? "bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,
|
|
366
368
|
children: c.label
|
|
367
369
|
},
|
|
368
370
|
c.label
|
|
@@ -372,7 +374,7 @@ function Qt({
|
|
|
372
374
|
"button",
|
|
373
375
|
{
|
|
374
376
|
type: "button",
|
|
375
|
-
onClick:
|
|
377
|
+
onClick: l,
|
|
376
378
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
377
379
|
children: "Close"
|
|
378
380
|
}
|
|
@@ -394,7 +396,7 @@ function Qt({
|
|
|
394
396
|
initialScope: o.matrix.initialScope,
|
|
395
397
|
lockScope: !0
|
|
396
398
|
},
|
|
397
|
-
|
|
399
|
+
s
|
|
398
400
|
) : o != null && o.config ? /* @__PURE__ */ h(H, { children: [
|
|
399
401
|
o.note && /* @__PURE__ */ t(
|
|
400
402
|
"p",
|
|
@@ -404,22 +406,22 @@ function Qt({
|
|
|
404
406
|
children: o.note
|
|
405
407
|
}
|
|
406
408
|
),
|
|
407
|
-
/* @__PURE__ */ t(Ve, { config: o.config },
|
|
409
|
+
/* @__PURE__ */ t(Ve, { config: o.config }, s)
|
|
408
410
|
] }) : /* @__PURE__ */ t("p", { className: "p-4 text-[12px] text-slate-400", children: "Sheet not configured" }) })
|
|
409
411
|
]
|
|
410
412
|
}
|
|
411
413
|
) });
|
|
412
414
|
}
|
|
413
|
-
function Ut(e, r, n,
|
|
415
|
+
function Ut(e, r, n, l) {
|
|
414
416
|
if (!e) return;
|
|
415
|
-
const
|
|
417
|
+
const s = (o) => {
|
|
416
418
|
const c = /^\$filters\.(\w+)(?:\.(\w+))?$/.exec(o);
|
|
417
419
|
if (!c) return;
|
|
418
|
-
const x =
|
|
420
|
+
const x = l == null ? void 0 : l.find((S) => S.param === c[1]), N = (n == null ? void 0 : n[c[1]]) ?? [];
|
|
419
421
|
if (N.length === 0) return;
|
|
420
422
|
const C = c[2] ?? (x == null ? void 0 : x.value_field) ?? "id";
|
|
421
423
|
return N.map((S) => S[C]);
|
|
422
|
-
}, m = (o) => typeof o == "string" && o.startsWith("$row.") ? r[o.slice(5)] : typeof o == "string" && o.startsWith("$filters.") ?
|
|
424
|
+
}, m = (o) => typeof o == "string" && o.startsWith("$row.") ? r[o.slice(5)] : typeof o == "string" && o.startsWith("$filters.") ? s(o) : Array.isArray(o) ? o.map(m) : o && typeof o == "object" ? Object.fromEntries(
|
|
423
425
|
Object.entries(o).map(([c, x]) => [c, m(x)])
|
|
424
426
|
) : o, u = (o) => o === void 0 ? !0 : Array.isArray(o) ? o.some(u) : o && typeof o == "object" ? Object.values(o).some(u) : !1, d = m(e);
|
|
425
427
|
return Array.isArray(d._and) && (d._and = d._and.filter((o) => !u(o))), u(d) ? void 0 : d;
|
|
@@ -432,8 +434,8 @@ function Jt({
|
|
|
432
434
|
filter: e,
|
|
433
435
|
selected: r,
|
|
434
436
|
onChange: n,
|
|
435
|
-
allowedIds:
|
|
436
|
-
scopeDefault:
|
|
437
|
+
allowedIds: l,
|
|
438
|
+
scopeDefault: s,
|
|
437
439
|
onOpenChange: m
|
|
438
440
|
}) {
|
|
439
441
|
const u = re(), [d, o] = T(!1), c = ee(m);
|
|
@@ -483,15 +485,15 @@ function Jt({
|
|
|
483
485
|
return window.addEventListener("mousedown", f), () => window.removeEventListener("mousedown", f);
|
|
484
486
|
}, [d]);
|
|
485
487
|
const K = e.label ?? Q(e.param), z = L && $ ? [...r, ...I] : U, E = vt(
|
|
486
|
-
|
|
488
|
+
l != null && l.length ? z.filter((f) => l.some((a) => String(a) === String(f.id))) : z,
|
|
487
489
|
(f) => String(f[S] ?? "")
|
|
488
490
|
), O = (f) => [f[S], f[q], v ? f[v] : null].filter((a) => a != null && a !== "").join(" ").toLowerCase(), V = E.filter(
|
|
489
491
|
(f) => $ ? O(f).includes($.toLowerCase()) : !0
|
|
490
|
-
), G = L && $.length > 0 && R !== $, B =
|
|
492
|
+
), G = L && $.length > 0 && R !== $, B = l != null && l.length ? {
|
|
491
493
|
label: "restricted",
|
|
492
494
|
cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
|
|
493
|
-
title: `Options limited to your restricted ${K} scope${
|
|
494
|
-
} :
|
|
495
|
+
title: `Options limited to your restricted ${K} scope${s ? "; selection seeded from your defaults" : ""}`
|
|
496
|
+
} : s && r.length > 0 ? {
|
|
495
497
|
label: "your default",
|
|
496
498
|
cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
|
|
497
499
|
title: `Pre-selected from your default ${K} scope — adjust freely`
|
|
@@ -577,13 +579,13 @@ function Ht({ widget: e }) {
|
|
|
577
579
|
return /* @__PURE__ */ t(Ve, { config: e.config ?? {} });
|
|
578
580
|
}
|
|
579
581
|
function Yt({ widget: e }) {
|
|
580
|
-
const r = e.config ?? {}, [n,
|
|
582
|
+
const r = e.config ?? {}, [n, l] = T(!1);
|
|
581
583
|
return r.collection ? r.display === "drawer" ? /* @__PURE__ */ h("div", { className: "flex h-full items-center", children: [
|
|
582
584
|
/* @__PURE__ */ t(
|
|
583
585
|
"button",
|
|
584
586
|
{
|
|
585
587
|
type: "button",
|
|
586
|
-
onClick: () =>
|
|
588
|
+
onClick: () => l(!0),
|
|
587
589
|
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 bg-white px-3 text-[12.5px] font-medium text-slate-700 shadow-sm transition-colors hover:border-nvr-cyan hover:text-nvr-navy dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
588
590
|
children: r.button_label ?? r.title ?? "Manage"
|
|
589
591
|
}
|
|
@@ -592,16 +594,17 @@ function Yt({ widget: e }) {
|
|
|
592
594
|
"div",
|
|
593
595
|
{
|
|
594
596
|
className: "fixed inset-0 z-50 flex justify-end bg-black/30",
|
|
595
|
-
onClick: () =>
|
|
597
|
+
onClick: () => l(!1),
|
|
596
598
|
children: /* @__PURE__ */ h(
|
|
597
599
|
"div",
|
|
598
600
|
{
|
|
599
|
-
|
|
601
|
+
"data-page-drawer": !0,
|
|
602
|
+
className: "flex h-full flex-col border-l border-slate-200 max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 bg-white shadow-2xl dark:border-border dark:bg-background",
|
|
600
603
|
style: {
|
|
601
604
|
width: typeof r.sheet_width == "number" ? `${r.sheet_width}px` : r.sheet_width ?? "92%",
|
|
602
605
|
maxWidth: "96%"
|
|
603
606
|
},
|
|
604
|
-
onClick: (
|
|
607
|
+
onClick: (s) => s.stopPropagation(),
|
|
605
608
|
children: [
|
|
606
609
|
/* @__PURE__ */ h("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
607
610
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: r.button_label ?? r.title ?? "Manage" }),
|
|
@@ -609,7 +612,7 @@ function Yt({ widget: e }) {
|
|
|
609
612
|
"button",
|
|
610
613
|
{
|
|
611
614
|
type: "button",
|
|
612
|
-
onClick: () =>
|
|
615
|
+
onClick: () => l(!1),
|
|
613
616
|
className: "rounded px-2 py-1 text-[12px] text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
|
|
614
617
|
children: "Close"
|
|
615
618
|
}
|
|
@@ -626,8 +629,8 @@ function Yt({ widget: e }) {
|
|
|
626
629
|
function Xt({
|
|
627
630
|
cfg: e
|
|
628
631
|
}) {
|
|
629
|
-
const [r, n] = T(!1),
|
|
630
|
-
return delete
|
|
632
|
+
const [r, n] = T(!1), l = { ...e };
|
|
633
|
+
return delete l.display, /* @__PURE__ */ h("div", { className: "flex h-full items-center", children: [
|
|
631
634
|
/* @__PURE__ */ t(
|
|
632
635
|
"button",
|
|
633
636
|
{
|
|
@@ -645,12 +648,13 @@ function Xt({
|
|
|
645
648
|
children: /* @__PURE__ */ h(
|
|
646
649
|
"div",
|
|
647
650
|
{
|
|
648
|
-
|
|
651
|
+
"data-page-drawer": !0,
|
|
652
|
+
className: "flex h-full flex-col border-l border-slate-200 max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 bg-slate-50 shadow-2xl dark:border-border dark:bg-background",
|
|
649
653
|
style: {
|
|
650
654
|
width: typeof e.sheet_width == "number" ? `${e.sheet_width}px` : e.sheet_width ?? "90%",
|
|
651
655
|
maxWidth: "96%"
|
|
652
656
|
},
|
|
653
|
-
onClick: (
|
|
657
|
+
onClick: (s) => s.stopPropagation(),
|
|
654
658
|
children: [
|
|
655
659
|
/* @__PURE__ */ h("div", { className: "flex shrink-0 items-center justify-between border-b border-slate-200 bg-white px-4 py-2.5 dark:border-border dark:bg-card", children: [
|
|
656
660
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-700 dark:text-slate-200", children: e.button_label ?? e.label ?? "View" }),
|
|
@@ -664,7 +668,7 @@ function Xt({
|
|
|
664
668
|
}
|
|
665
669
|
)
|
|
666
670
|
] }),
|
|
667
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(Ge, { config:
|
|
671
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ t(Ge, { config: l }) })
|
|
668
672
|
]
|
|
669
673
|
}
|
|
670
674
|
)
|
|
@@ -677,7 +681,7 @@ function Ve({ config: e }) {
|
|
|
677
681
|
}
|
|
678
682
|
function Ge({ config: e }) {
|
|
679
683
|
var _e, Ce, qe, je, Te, Me, Re, We, Pe, Le;
|
|
680
|
-
const r = re(), n = Ie(), [
|
|
684
|
+
const r = re(), n = Ie(), [l, s] = T(null), [m, u] = T(null), [d, o] = T(null), [c, x] = T(
|
|
681
685
|
() => Bt(e.filters)
|
|
682
686
|
), [N] = T(
|
|
683
687
|
() => xt(e.filters, typeof window > "u" ? "" : window.location.search)
|
|
@@ -774,7 +778,7 @@ function Ge({ config: e }) {
|
|
|
774
778
|
queryFn: () => {
|
|
775
779
|
const i = J.current;
|
|
776
780
|
return J.current = !1, r.request(
|
|
777
|
-
|
|
781
|
+
se(`/custom-queries/${e.query_slug}/execute`, {
|
|
778
782
|
params: D,
|
|
779
783
|
...i ? { refresh: !0 } : {}
|
|
780
784
|
})
|
|
@@ -817,7 +821,7 @@ function Ge({ config: e }) {
|
|
|
817
821
|
j({ ...i, phase: "running", startedAt: p, elapsedMs: 0 });
|
|
818
822
|
try {
|
|
819
823
|
const b = await r.request(
|
|
820
|
-
|
|
824
|
+
se(`/custom-queries/${i.action.query_slug}/execute`, { params: i.params })
|
|
821
825
|
), y = Array.isArray(b == null ? void 0 : b.data) ? b.data : [];
|
|
822
826
|
j(
|
|
823
827
|
(k) => k && k.action === i.action ? {
|
|
@@ -828,7 +832,7 @@ function Ge({ config: e }) {
|
|
|
828
832
|
resultSample: y[0] ?? null
|
|
829
833
|
} : k
|
|
830
834
|
), q(
|
|
831
|
-
`${i.action.success_message ?? `${i.action.label} completed`} · ${
|
|
835
|
+
`${i.action.success_message ?? `${i.action.label} completed`} · ${le(Date.now() - p)}`
|
|
832
836
|
), U.invalidateQueries({ queryKey: ["page-renderer-query", e.query_slug] });
|
|
833
837
|
} catch (b) {
|
|
834
838
|
const y = ze(b, "unknown error");
|
|
@@ -938,7 +942,7 @@ function Ge({ config: e }) {
|
|
|
938
942
|
totalCount: y ? y.length : null
|
|
939
943
|
});
|
|
940
944
|
}, Ze = w ? (i) => {
|
|
941
|
-
w.picker ?
|
|
945
|
+
w.picker ? s(i) : w.sheet ? $e(w.sheet, i) : w.matrix && i.id != null ? u(i.id) : w.drill && i.id != null && (n == null || n.open({
|
|
942
946
|
collection: w.drill.collection ?? "",
|
|
943
947
|
itemId: String(i.id),
|
|
944
948
|
layoutId: w.drill.layout_id,
|
|
@@ -992,11 +996,11 @@ function Ge({ config: e }) {
|
|
|
992
996
|
)
|
|
993
997
|
}
|
|
994
998
|
),
|
|
995
|
-
(w == null ? void 0 : w.picker) &&
|
|
999
|
+
(w == null ? void 0 : w.picker) && l && /* @__PURE__ */ t(
|
|
996
1000
|
"div",
|
|
997
1001
|
{
|
|
998
1002
|
className: "fixed inset-0 z-50 flex items-start justify-center bg-black/30 pt-32",
|
|
999
|
-
onClick: () =>
|
|
1003
|
+
onClick: () => s(null),
|
|
1000
1004
|
children: /* @__PURE__ */ h(
|
|
1001
1005
|
"div",
|
|
1002
1006
|
{
|
|
@@ -1011,7 +1015,7 @@ function Ge({ config: e }) {
|
|
|
1011
1015
|
value: null,
|
|
1012
1016
|
onChange: (i) => {
|
|
1013
1017
|
var p, b, y, k;
|
|
1014
|
-
if (
|
|
1018
|
+
if (s(null), i != null) {
|
|
1015
1019
|
if (w.matrix) {
|
|
1016
1020
|
u(i);
|
|
1017
1021
|
return;
|
|
@@ -1024,7 +1028,7 @@ function Ge({ config: e }) {
|
|
|
1024
1028
|
});
|
|
1025
1029
|
}
|
|
1026
1030
|
},
|
|
1027
|
-
extraFilter: Ut(w.picker.filter,
|
|
1031
|
+
extraFilter: Ut(w.picker.filter, l, c, e.filters),
|
|
1028
1032
|
placeholder: "Search…"
|
|
1029
1033
|
}
|
|
1030
1034
|
),
|
|
@@ -1032,7 +1036,7 @@ function Ge({ config: e }) {
|
|
|
1032
1036
|
"button",
|
|
1033
1037
|
{
|
|
1034
1038
|
type: "button",
|
|
1035
|
-
onClick: () =>
|
|
1039
|
+
onClick: () => s(null),
|
|
1036
1040
|
className: "mt-3 h-7 rounded px-2 text-[12px] text-slate-500 hover:text-slate-700",
|
|
1037
1041
|
children: "Cancel"
|
|
1038
1042
|
}
|
|
@@ -1075,14 +1079,14 @@ function Ge({ config: e }) {
|
|
|
1075
1079
|
}
|
|
1076
1080
|
);
|
|
1077
1081
|
}
|
|
1078
|
-
const
|
|
1082
|
+
const le = (e) => e < 6e4 ? `${(e / 1e3).toFixed(e < 1e4 ? 1 : 0)}s` : `${Math.floor(e / 6e4)}m ${Math.round(e % 6e4 / 1e3)}s`;
|
|
1079
1083
|
function Zt({
|
|
1080
1084
|
run: e,
|
|
1081
1085
|
onConfirm: r,
|
|
1082
1086
|
onClose: n
|
|
1083
1087
|
}) {
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
1088
|
+
const l = Object.entries(e.params);
|
|
1089
|
+
return lt(
|
|
1086
1090
|
/* @__PURE__ */ h(H, { children: [
|
|
1087
1091
|
/* @__PURE__ */ t(
|
|
1088
1092
|
"div",
|
|
@@ -1101,10 +1105,10 @@ function Zt({
|
|
|
1101
1105
|
className: "fixed left-1/2 top-[24vh] z-50 w-[min(400px,92vw)] -translate-x-1/2 rounded-xl border border-slate-200 bg-white p-4 shadow-2xl dark:border-border dark:bg-card",
|
|
1102
1106
|
children: [
|
|
1103
1107
|
/* @__PURE__ */ t("p", { className: "text-[13.5px] font-semibold text-slate-900 dark:text-foreground", children: e.action.label }),
|
|
1104
|
-
|
|
1105
|
-
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: Q(
|
|
1108
|
+
l.length > 0 && /* @__PURE__ */ t("dl", { className: "mt-2 space-y-0.5 rounded-lg bg-slate-50 px-2.5 py-1.5 text-[11.5px] dark:bg-muted", children: l.map(([s, m]) => /* @__PURE__ */ h("div", { className: "flex gap-2", children: [
|
|
1109
|
+
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: Q(s) }),
|
|
1106
1110
|
/* @__PURE__ */ t("dd", { className: "ml-auto font-medium tabular-nums text-slate-800 dark:text-slate-100", children: String(m) })
|
|
1107
|
-
] },
|
|
1111
|
+
] }, s)) }),
|
|
1108
1112
|
e.phase === "confirm" && /* @__PURE__ */ h(H, { children: [
|
|
1109
1113
|
/* @__PURE__ */ t("p", { className: "mt-2 text-[12.5px] text-slate-600 dark:text-slate-300", children: e.confirmText }),
|
|
1110
1114
|
/* @__PURE__ */ h("div", { className: "mt-3 flex gap-2", children: [
|
|
@@ -1131,19 +1135,19 @@ function Zt({
|
|
|
1131
1135
|
e.phase === "running" && /* @__PURE__ */ h("div", { className: "mt-3 flex items-center gap-2.5 text-[12.5px] text-slate-600 dark:text-slate-300", children: [
|
|
1132
1136
|
/* @__PURE__ */ t("span", { className: "h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-nvr-cyan border-t-transparent" }),
|
|
1133
1137
|
"Running… ",
|
|
1134
|
-
/* @__PURE__ */ t("span", { className: "tabular-nums", children:
|
|
1138
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums", children: le(e.elapsedMs) })
|
|
1135
1139
|
] }),
|
|
1136
1140
|
e.phase === "done" && /* @__PURE__ */ h(H, { children: [
|
|
1137
1141
|
/* @__PURE__ */ h("p", { className: "mt-2 text-[12.5px] font-medium text-emerald-600 dark:text-emerald-400", children: [
|
|
1138
1142
|
e.action.success_message ?? "Completed",
|
|
1139
1143
|
" · ",
|
|
1140
|
-
|
|
1144
|
+
le(e.elapsedMs)
|
|
1141
1145
|
] }),
|
|
1142
1146
|
e.resultRows != null && e.resultRows > 0 && e.resultSample && /* @__PURE__ */ h("dl", { className: "mt-2 max-h-40 space-y-0.5 overflow-y-auto rounded-lg bg-slate-50 px-2.5 py-1.5 text-[11.5px] dark:bg-muted", children: [
|
|
1143
|
-
Object.entries(e.resultSample).slice(0, 8).map(([
|
|
1144
|
-
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: Q(
|
|
1147
|
+
Object.entries(e.resultSample).slice(0, 8).map(([s, m]) => /* @__PURE__ */ h("div", { className: "flex gap-2", children: [
|
|
1148
|
+
/* @__PURE__ */ t("dt", { className: "text-slate-500 dark:text-slate-400", children: Q(s) }),
|
|
1145
1149
|
/* @__PURE__ */ t("dd", { className: "ml-auto font-medium tabular-nums text-slate-800 dark:text-slate-100", children: String(m ?? "—") })
|
|
1146
|
-
] },
|
|
1150
|
+
] }, s)),
|
|
1147
1151
|
e.resultRows > 1 && /* @__PURE__ */ h("p", { className: "pt-0.5 text-slate-400", children: [
|
|
1148
1152
|
"…",
|
|
1149
1153
|
e.resultRows,
|
|
@@ -1163,7 +1167,7 @@ function Zt({
|
|
|
1163
1167
|
e.phase === "error" && /* @__PURE__ */ h(H, { children: [
|
|
1164
1168
|
/* @__PURE__ */ h("p", { className: "mt-2 text-[12.5px] font-medium text-red-600 dark:text-red-400", children: [
|
|
1165
1169
|
"Failed after ",
|
|
1166
|
-
|
|
1170
|
+
le(e.elapsedMs),
|
|
1167
1171
|
": ",
|
|
1168
1172
|
e.error
|
|
1169
1173
|
] }),
|
|
@@ -1222,20 +1226,20 @@ function _r({
|
|
|
1222
1226
|
slug: e,
|
|
1223
1227
|
hideHeader: r,
|
|
1224
1228
|
className: n,
|
|
1225
|
-
liveReads:
|
|
1226
|
-
liveGapMs:
|
|
1229
|
+
liveReads: l,
|
|
1230
|
+
liveGapMs: s
|
|
1227
1231
|
}) {
|
|
1228
1232
|
var B, f;
|
|
1229
|
-
const m = re(), u = De(), d = (
|
|
1233
|
+
const m = re(), u = De(), d = (l ?? []).filter(Boolean).join(","), o = he(
|
|
1230
1234
|
() => d ? {
|
|
1231
1235
|
reads: d.split(","),
|
|
1232
|
-
minGapMs:
|
|
1236
|
+
minGapMs: s ?? 15e3,
|
|
1233
1237
|
// Server-cached figures are dropped a moment after the write (a few seconds'
|
|
1234
1238
|
// window): read after that, and spread the viewers out.
|
|
1235
1239
|
delayMs: 3500,
|
|
1236
1240
|
jitterMs: 3e3
|
|
1237
1241
|
} : null,
|
|
1238
|
-
[d,
|
|
1242
|
+
[d, s]
|
|
1239
1243
|
), [c, x] = T(0);
|
|
1240
1244
|
te(() => {
|
|
1241
1245
|
if (o)
|
|
@@ -1245,7 +1249,7 @@ function _r({
|
|
|
1245
1249
|
!Pt.has(String(g.queryKey[0])) || g.state.dataUpdateCount < 2 || x(Date.now());
|
|
1246
1250
|
});
|
|
1247
1251
|
}, [u, o]);
|
|
1248
|
-
const N = pt(c, { enabled: !!o }), { isAdmin: C } =
|
|
1252
|
+
const N = pt(c, { enabled: !!o }), { isAdmin: C } = st(), S = Ie(), q = ot("drill.page"), v = q.value, {
|
|
1249
1253
|
data: j,
|
|
1250
1254
|
isLoading: W,
|
|
1251
1255
|
error: U
|