@nivaro/react 0.3.40 → 0.3.42
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/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +645 -16
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/PickerExcludedRows.js +3 -3
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as n, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as N } from "@tanstack/react-query";
|
|
3
|
+
import { RefreshCw as b, ScrollText as w, Loader2 as k } from "lucide-react";
|
|
4
|
+
import { useState as I } from "react";
|
|
5
|
+
import { useNivaroClient as S } from "../../context.js";
|
|
6
|
+
import { get as $ } from "../../lib/commands.js";
|
|
7
|
+
import { SectionCard as g } from "../profile/primitives.js";
|
|
8
|
+
const u = 8;
|
|
9
|
+
function v(t) {
|
|
10
|
+
if (t.length <= 1) return t[0] ?? "";
|
|
11
|
+
const r = t.slice(0, 8), l = t.length - r.length;
|
|
12
|
+
return l > 0 ? `${r.join(", ")} and ${l} more` : `${r.slice(0, -1).join(", ")} and ${r[r.length - 1]}`;
|
|
13
|
+
}
|
|
14
|
+
function h(t) {
|
|
15
|
+
const r = S(), l = t.roleId ? `role=${encodeURIComponent(t.roleId)}` : `user=${encodeURIComponent(t.userId ?? "")}`;
|
|
16
|
+
return N({
|
|
17
|
+
queryKey: ["access-summary", t.roleId ? "role" : "user", t.roleId ?? t.userId],
|
|
18
|
+
queryFn: () => r.request($(`/access/summary?${l}`)).then((e) => e.data),
|
|
19
|
+
enabled: !!(t.roleId || t.userId),
|
|
20
|
+
staleTime: 6e4
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function C({
|
|
24
|
+
roleId: t,
|
|
25
|
+
userId: r,
|
|
26
|
+
pageLabel: l
|
|
27
|
+
}) {
|
|
28
|
+
var d;
|
|
29
|
+
const { data: e, isLoading: i, isError: p } = h({ roleId: t, userId: r }), [a, x] = I(!1);
|
|
30
|
+
if (i)
|
|
31
|
+
return /* @__PURE__ */ m("p", { className: "flex items-center gap-1.5 text-[12px] text-slate-500 dark:text-slate-400", children: [
|
|
32
|
+
/* @__PURE__ */ n(k, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
33
|
+
" Reading the policies…"
|
|
34
|
+
] });
|
|
35
|
+
if (p || !e)
|
|
36
|
+
return /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Could not put this access into words." });
|
|
37
|
+
const o = a ? e.lines : e.lines.slice(0, u), c = e.ui_disabled.length && l ? `Pages turned off${(d = e.ui_line) != null && d.includes(" for you") ? " for you" : ""}: ${v(
|
|
38
|
+
e.ui_disabled.map((s) => l(s) || s)
|
|
39
|
+
)}.` : e.ui_line, f = e.sentences.filter(
|
|
40
|
+
(s) => s !== e.ui_line && s !== e.closed_line && !e.lines.some((y) => y.sentence === s)
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ m(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: "space-y-2 text-[12.5px] leading-relaxed text-slate-700 dark:text-slate-300",
|
|
46
|
+
"data-access-summary": !0,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ n("p", { className: "font-medium text-slate-800 dark:text-slate-100", children: e.headline }),
|
|
49
|
+
o.length > 0 && /* @__PURE__ */ n("ul", { className: "space-y-1.5", children: o.map((s) => /* @__PURE__ */ n(
|
|
50
|
+
"li",
|
|
51
|
+
{
|
|
52
|
+
"data-access-line": s.kind,
|
|
53
|
+
className: "border-l-2 border-slate-200 pl-2.5 dark:border-border",
|
|
54
|
+
children: s.sentence
|
|
55
|
+
},
|
|
56
|
+
s.sentence
|
|
57
|
+
)) }),
|
|
58
|
+
e.lines.length > u && /* @__PURE__ */ n(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
onClick: () => x((s) => !s),
|
|
63
|
+
className: "text-[12px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
|
|
64
|
+
children: a ? "Show fewer" : `Show all ${e.lines.length}`
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
e.closed_line && e.lines.length > 0 && /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: e.closed_line }),
|
|
68
|
+
c && /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: c }),
|
|
69
|
+
f.map((s) => /* @__PURE__ */ n("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: s }, s))
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
function A({
|
|
75
|
+
roleId: t,
|
|
76
|
+
userId: r,
|
|
77
|
+
pageLabel: l
|
|
78
|
+
}) {
|
|
79
|
+
const { refetch: e, isFetching: i } = h({ roleId: t, userId: r });
|
|
80
|
+
return /* @__PURE__ */ n(
|
|
81
|
+
g,
|
|
82
|
+
{
|
|
83
|
+
icon: /* @__PURE__ */ n(w, { className: "h-4 w-4" }),
|
|
84
|
+
title: "Permissions in words",
|
|
85
|
+
hint: "From the role’s policies, field lists, row filters and User Scopes — what the API enforces",
|
|
86
|
+
testId: "permission-summary",
|
|
87
|
+
actions: /* @__PURE__ */ n(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
onClick: () => void e(),
|
|
92
|
+
disabled: i,
|
|
93
|
+
className: "text-slate-400 transition-colors hover:text-nvr-cyan disabled:opacity-50",
|
|
94
|
+
"aria-label": "Read again",
|
|
95
|
+
children: /* @__PURE__ */ n(b, { className: i ? "h-3.5 w-3.5 animate-spin" : "h-3.5 w-3.5" })
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
children: /* @__PURE__ */ n(C, { roleId: t, userId: r, pageLabel: l })
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
C as PermissionSummaryBody,
|
|
104
|
+
A as PermissionSummaryCard,
|
|
105
|
+
h as usePermissionSummary
|
|
106
|
+
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, Fragment as W, jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as X, useQuery as Y } from "@tanstack/react-query";
|
|
3
3
|
import { Loader2 as Q } from "lucide-react";
|
|
4
4
|
import { useState as y } from "react";
|
|
5
|
-
import { toast as
|
|
5
|
+
import { toast as O } from "sonner";
|
|
6
6
|
import { useNivaroClient as U } from "../../context.js";
|
|
7
7
|
import { newBulkProgressId as Z, startBulkProgress as D, endBulkProgress as ee } from "../../lib/bulk-progress.js";
|
|
8
|
-
import { get as te, post as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { get as te, post as R } from "../../lib/commands.js";
|
|
9
|
+
import { errorToastOptions as re } from "../../lib/error-toast.js";
|
|
10
|
+
import { userErrorMessage as ne } from "../../lib/safe-error.js";
|
|
11
|
+
import { cn as j } from "../../lib/utils.js";
|
|
12
|
+
import { invalidateRecordQueries as oe } from "../item-edit/RecordLiveSync.js";
|
|
13
|
+
import { Popover as se, PopoverTrigger as ie, PopoverContent as le } from "../ui/popover.js";
|
|
14
|
+
import { PushBulkButtons as ae } from "./PushBulkButtons.js";
|
|
14
15
|
function x(t) {
|
|
15
16
|
return t === !0 || t === 1 || t === "1" || t === "true" ? "true" : t === !1 || t === 0 || t === "0" || t === "false" ? "false" : String(t ?? "");
|
|
16
17
|
}
|
|
17
18
|
const H = (t) => t == null || t === "";
|
|
18
|
-
function
|
|
19
|
+
function Pe(t, i) {
|
|
19
20
|
for (const n of t ?? []) {
|
|
20
21
|
if (!n || typeof n.field != "string") continue;
|
|
21
22
|
if (!(n.field in i)) return null;
|
|
@@ -67,13 +68,13 @@ function z(t) {
|
|
|
67
68
|
function G(t, i, n) {
|
|
68
69
|
return t ? t.includes(n) || t.includes(`${i}:${n}`) : !0;
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function qe(t, i) {
|
|
71
72
|
const { data: n } = z(t), s = !!n && Object.values(n).some((o) => o.some((c) => c.source === "builtin"));
|
|
72
73
|
return (o) => s ? t.some(
|
|
73
74
|
(c) => ((n == null ? void 0 : n[c]) ?? []).some((g) => g.source === "builtin" && g.key === o) && G(i, c, o)
|
|
74
75
|
) : !0;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function ce(t, i, n) {
|
|
77
78
|
const s = /* @__PURE__ */ new Map();
|
|
78
79
|
for (const o of i)
|
|
79
80
|
for (const c of (t == null ? void 0 : t[o]) ?? []) {
|
|
@@ -83,102 +84,104 @@ function ae(t, i, n) {
|
|
|
83
84
|
}
|
|
84
85
|
return [...s.values()];
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function de(t, i, n) {
|
|
87
88
|
const s = [`${i.succeeded} done`];
|
|
88
89
|
return i.skipped && s.push(`${i.skipped} skipped`), i.failed && s.push(`${i.failed} failed`), `${t}: ${s.join(" · ")}${n !== i.succeeded + i.skipped + i.failed ? ` of ${n}` : ""}`;
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function Be({
|
|
91
92
|
targets: t,
|
|
92
93
|
enabledKeys: i,
|
|
93
94
|
tone: n = "light",
|
|
94
95
|
disabled: s,
|
|
95
96
|
onDone: o
|
|
96
97
|
}) {
|
|
97
|
-
const c = U(), g = X(), k = [...new Set(t.map((e) => e.collection))], { data: K } = z(k),
|
|
98
|
+
const c = U(), g = X(), k = [...new Set(t.map((e) => e.collection))], { data: K } = z(k), C = ce(K, k, i), [L, $] = y(null), [N, _] = y(""), [P, S] = y(null), [A, q] = y({}), [T, E] = y(!1), J = async (e) => {
|
|
98
99
|
const u = `${e.source}:${e.key}`;
|
|
99
100
|
if (e.source === "db") {
|
|
100
101
|
q((a) => ({ ...a, [u]: "loading" }));
|
|
101
102
|
try {
|
|
102
103
|
const a = { would_change: 0, skipped: 0, failed: 0, outcomes: [] };
|
|
103
|
-
for (const
|
|
104
|
-
const d = t.filter((r) => r.collection ===
|
|
104
|
+
for (const h of e.collections) {
|
|
105
|
+
const d = t.filter((r) => r.collection === h).map((r) => r.id);
|
|
105
106
|
if (d.length === 0) continue;
|
|
106
|
-
const
|
|
107
|
-
|
|
107
|
+
const b = await c.request(
|
|
108
|
+
R("/bulk-actions/preview", { collection: h, key: e.key, ids: d })
|
|
108
109
|
);
|
|
109
|
-
a.would_change +=
|
|
110
|
+
a.would_change += b.data.would_change, a.skipped += b.data.skipped, a.failed += b.data.failed, a.outcomes.push(...b.data.outcomes);
|
|
110
111
|
}
|
|
111
|
-
q((
|
|
112
|
+
q((h) => ({ ...h, [u]: a }));
|
|
112
113
|
} catch {
|
|
113
114
|
q((a) => ({ ...a, [u]: null }));
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
|
-
},
|
|
117
|
-
|
|
117
|
+
}, M = /* @__PURE__ */ f(
|
|
118
|
+
ae,
|
|
118
119
|
{
|
|
119
120
|
targets: t,
|
|
120
121
|
enabledKeys: i,
|
|
121
122
|
tone: n,
|
|
122
123
|
disabled: s || !!P,
|
|
123
|
-
onDone: (e) => o == null ? void 0 : o({ ...e, action:
|
|
124
|
+
onDone: (e) => o == null ? void 0 : o({ ...e, action: ue })
|
|
124
125
|
}
|
|
125
126
|
);
|
|
126
|
-
if (
|
|
127
|
+
if (C.length === 0) return M;
|
|
127
128
|
const F = async (e) => {
|
|
128
129
|
const u = `${e.source}:${e.key}`;
|
|
129
130
|
S(u);
|
|
130
131
|
const a = { succeeded: 0, failed: 0, skipped: 0, errors: [] };
|
|
131
|
-
let
|
|
132
|
+
let h = 0;
|
|
132
133
|
try {
|
|
133
134
|
for (const r of e.collections) {
|
|
134
135
|
const m = t.filter((B) => B.collection === r).map((B) => B.id);
|
|
135
136
|
if (m.length === 0) continue;
|
|
136
|
-
|
|
137
|
+
h += m.length;
|
|
137
138
|
const w = { collection: r, ids: m, reason: N.trim() || null }, l = e.source === "db" ? Z() : null;
|
|
138
139
|
l && D(l, m);
|
|
139
140
|
const v = (e.source === "db" ? await c.request(
|
|
140
|
-
|
|
141
|
+
R(`/bulk-actions/run?progress=${l}`, { ...w, key: e.key })
|
|
141
142
|
).finally(() => ee(l)) : await c.request(
|
|
142
|
-
|
|
143
|
+
R(`/bulk-actions/${e.key}/execute`, w)
|
|
143
144
|
)).data ?? {};
|
|
144
145
|
a.succeeded += v.succeeded ?? (e.source === "extension" ? m.length : 0), a.failed += v.failed ?? 0, a.skipped += v.skipped ?? 0, a.errors.push(...v.errors ?? []);
|
|
145
146
|
}
|
|
146
147
|
for (const r of e.collections)
|
|
147
|
-
|
|
148
|
+
oe(
|
|
148
149
|
g,
|
|
149
150
|
r,
|
|
150
151
|
t.filter((m) => m.collection === r).map((m) => m.id)
|
|
151
152
|
);
|
|
152
|
-
const d =
|
|
153
|
+
const d = de(e.label, a, h), b = a.errors.slice(0, 3).map((r) => `#${r.item}: ${r.error}`).join(`
|
|
153
154
|
`);
|
|
154
|
-
a.failed > 0 ?
|
|
155
|
+
a.failed > 0 ? O.warning(d, { description: b || void 0, duration: 8e3 }) : O.success(d, { duration: 4e3 }), o == null || o({ ...a, action: e }), $(null), _("");
|
|
155
156
|
} catch (d) {
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
O.error(
|
|
158
|
+
ne(d, `${e.label} failed`),
|
|
159
|
+
re(d, { action: e.label })
|
|
160
|
+
);
|
|
158
161
|
} finally {
|
|
159
162
|
S(null);
|
|
160
163
|
}
|
|
161
|
-
}, V = (e, u) => n === "dark" ?
|
|
164
|
+
}, V = (e, u) => n === "dark" ? j(
|
|
162
165
|
"h-8 rounded-md px-3 text-[12.5px] font-medium transition-colors disabled:opacity-50",
|
|
163
166
|
e.variant === "danger" ? "border border-red-400/50 text-red-200 hover:bg-red-500/20 dark:border-red-500/40 dark:text-red-400 dark:hover:bg-red-500/10" : "border border-white/20 hover:bg-white/10 dark:border-border dark:hover:bg-muted",
|
|
164
167
|
u && (e.variant === "danger" ? "bg-red-500/20" : "bg-white/10")
|
|
165
|
-
) :
|
|
168
|
+
) : j(
|
|
166
169
|
"rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors disabled:opacity-50",
|
|
167
170
|
e.variant === "danger" ? "text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-500/10" : "text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-muted",
|
|
168
171
|
u && (e.variant === "danger" ? "bg-red-50 dark:bg-red-500/10" : "bg-slate-100 dark:bg-muted")
|
|
169
172
|
);
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
-
|
|
172
|
-
const u = `${e.source}:${e.key}`, a = L === u,
|
|
173
|
-
return /* @__PURE__ */
|
|
174
|
-
|
|
173
|
+
return /* @__PURE__ */ p(W, { children: [
|
|
174
|
+
C.map((e) => {
|
|
175
|
+
const u = `${e.source}:${e.key}`, a = L === u, h = P === u, d = t.filter((r) => e.collections.includes(r.collection)).length, b = d > 0 && (!e.require_reason || N.trim().length > 0) && !h;
|
|
176
|
+
return /* @__PURE__ */ p(
|
|
177
|
+
se,
|
|
175
178
|
{
|
|
176
179
|
open: a,
|
|
177
180
|
onOpenChange: (r) => {
|
|
178
|
-
$(r ? u : null), r ? (
|
|
181
|
+
$(r ? u : null), r ? (E(!1), J(e)) : _("");
|
|
179
182
|
},
|
|
180
183
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ f(ie, { asChild: !0, children: /* @__PURE__ */ f(
|
|
182
185
|
"button",
|
|
183
186
|
{
|
|
184
187
|
type: "button",
|
|
@@ -186,11 +189,11 @@ function Pe({
|
|
|
186
189
|
"data-bulk-action": e.key,
|
|
187
190
|
title: e.summary,
|
|
188
191
|
className: V(e, a),
|
|
189
|
-
children:
|
|
192
|
+
children: h ? /* @__PURE__ */ f(Q, { className: "inline h-3.5 w-3.5 animate-spin" }) : e.label
|
|
190
193
|
}
|
|
191
194
|
) }),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
195
|
+
/* @__PURE__ */ p(
|
|
196
|
+
le,
|
|
194
197
|
{
|
|
195
198
|
align: "center",
|
|
196
199
|
side: "top",
|
|
@@ -198,20 +201,20 @@ function Pe({
|
|
|
198
201
|
className: "w-[320px] p-3",
|
|
199
202
|
"data-bulk-action-popover": e.key,
|
|
200
203
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ p("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
202
205
|
e.label,
|
|
203
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ p("span", { className: "ml-1.5 font-normal text-slate-500 dark:text-slate-400", children: [
|
|
204
207
|
"· ",
|
|
205
208
|
d,
|
|
206
209
|
" record",
|
|
207
210
|
d === 1 ? "" : "s"
|
|
208
211
|
] })
|
|
209
212
|
] }),
|
|
210
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ f("p", { className: "mt-1 text-[12px] leading-snug text-slate-600 dark:text-slate-400", children: e.confirm_text ?? e.summary }),
|
|
211
214
|
e.source === "db" && (() => {
|
|
212
215
|
const r = A[u];
|
|
213
216
|
if (r === "loading")
|
|
214
|
-
return /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ f("p", { className: "mt-2 text-[11.5px] text-slate-400", "data-bulk-preview": "loading", children: "Checking what would change…" });
|
|
215
218
|
if (!r) return null;
|
|
216
219
|
const m = r.outcomes.filter((l) => l.outcome !== "change"), w = /* @__PURE__ */ new Map();
|
|
217
220
|
for (const l of m)
|
|
@@ -219,36 +222,36 @@ function Pe({
|
|
|
219
222
|
l.reason ?? l.outcome,
|
|
220
223
|
(w.get(l.reason ?? l.outcome) ?? 0) + 1
|
|
221
224
|
);
|
|
222
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ p(
|
|
223
226
|
"div",
|
|
224
227
|
{
|
|
225
228
|
className: "mt-2 rounded-md border border-slate-200 bg-slate-50 px-2 py-1.5 text-[11.5px] dark:border-border dark:bg-muted/40",
|
|
226
229
|
"data-bulk-preview": r.would_change,
|
|
227
230
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ p("p", { className: "font-medium text-slate-700 dark:text-slate-200", children: [
|
|
229
232
|
r.would_change,
|
|
230
233
|
" of ",
|
|
231
234
|
d,
|
|
232
235
|
" would change",
|
|
233
|
-
m.length > 0 && /* @__PURE__ */
|
|
236
|
+
m.length > 0 && /* @__PURE__ */ p("span", { className: "font-normal text-slate-500", children: [
|
|
234
237
|
" · ",
|
|
235
238
|
[...w.entries()].map(([l, I]) => `${I} ${l}`).join(" · ")
|
|
236
239
|
] })
|
|
237
240
|
] }),
|
|
238
|
-
m.length > 0 && /* @__PURE__ */
|
|
241
|
+
m.length > 0 && /* @__PURE__ */ p(
|
|
239
242
|
"button",
|
|
240
243
|
{
|
|
241
244
|
type: "button",
|
|
242
|
-
onClick: () =>
|
|
245
|
+
onClick: () => E((l) => !l),
|
|
243
246
|
className: "mt-0.5 text-[11px] text-slate-500 underline-offset-2 hover:underline",
|
|
244
247
|
"data-bulk-preview-toggle": !0,
|
|
245
248
|
children: [
|
|
246
|
-
|
|
249
|
+
T ? "Hide" : "Show",
|
|
247
250
|
" which records"
|
|
248
251
|
]
|
|
249
252
|
}
|
|
250
253
|
),
|
|
251
|
-
|
|
254
|
+
T && /* @__PURE__ */ f("ul", { className: "mt-1 max-h-32 space-y-0.5 overflow-auto font-mono text-[10.5px] text-slate-600 dark:text-slate-300", children: m.slice(0, 50).map((l) => /* @__PURE__ */ p("li", { "data-bulk-preview-row": l.item, children: [
|
|
252
255
|
"#",
|
|
253
256
|
l.item,
|
|
254
257
|
" — ",
|
|
@@ -258,19 +261,19 @@ function Pe({
|
|
|
258
261
|
}
|
|
259
262
|
);
|
|
260
263
|
})(),
|
|
261
|
-
e.require_reason && /* @__PURE__ */
|
|
262
|
-
/* @__PURE__ */
|
|
264
|
+
e.require_reason && /* @__PURE__ */ p("label", { className: "mt-2.5 block", children: [
|
|
265
|
+
/* @__PURE__ */ p("span", { className: "text-[11px] font-medium text-slate-600 dark:text-slate-400", children: [
|
|
263
266
|
"Reason ",
|
|
264
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ f("span", { className: "text-destructive", children: "*" })
|
|
265
268
|
] }),
|
|
266
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ f(
|
|
267
270
|
"textarea",
|
|
268
271
|
{
|
|
269
272
|
autoFocus: !0,
|
|
270
273
|
value: N,
|
|
271
274
|
onChange: (r) => _(r.target.value),
|
|
272
275
|
onKeyDown: (r) => {
|
|
273
|
-
r.key === "Enter" && (r.metaKey || r.ctrlKey) &&
|
|
276
|
+
r.key === "Enter" && (r.metaKey || r.ctrlKey) && b && F(e);
|
|
274
277
|
},
|
|
275
278
|
rows: 2,
|
|
276
279
|
placeholder: "Recorded on every record’s history",
|
|
@@ -278,8 +281,8 @@ function Pe({
|
|
|
278
281
|
}
|
|
279
282
|
)
|
|
280
283
|
] }),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ p("div", { className: "mt-3 flex items-center justify-end gap-2", children: [
|
|
285
|
+
/* @__PURE__ */ f(
|
|
283
286
|
"button",
|
|
284
287
|
{
|
|
285
288
|
type: "button",
|
|
@@ -288,18 +291,18 @@ function Pe({
|
|
|
288
291
|
children: "Close"
|
|
289
292
|
}
|
|
290
293
|
),
|
|
291
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ f(
|
|
292
295
|
"button",
|
|
293
296
|
{
|
|
294
297
|
type: "button",
|
|
295
298
|
onClick: () => void F(e),
|
|
296
|
-
disabled: !
|
|
299
|
+
disabled: !b,
|
|
297
300
|
"data-bulk-action-run": !0,
|
|
298
|
-
className:
|
|
301
|
+
className: j(
|
|
299
302
|
"h-8 rounded-md px-3 text-[12.5px] font-semibold disabled:opacity-40",
|
|
300
303
|
e.variant === "danger" ? "bg-red-600 text-white hover:bg-red-700" : "bg-nvr-cyan text-[#172940] hover:bg-nvr-cyan-dark"
|
|
301
304
|
),
|
|
302
|
-
children:
|
|
305
|
+
children: h ? /* @__PURE__ */ f(Q, { className: "h-3.5 w-3.5 animate-spin" }) : (() => {
|
|
303
306
|
const r = A[u];
|
|
304
307
|
return r && r !== "loading" && r.would_change !== d ? `${e.label} · ${r.would_change} of ${d}` : `${e.label} ${d}`;
|
|
305
308
|
})()
|
|
@@ -314,10 +317,10 @@ function Pe({
|
|
|
314
317
|
u
|
|
315
318
|
);
|
|
316
319
|
}),
|
|
317
|
-
|
|
320
|
+
M
|
|
318
321
|
] });
|
|
319
322
|
}
|
|
320
|
-
const
|
|
323
|
+
const ue = {
|
|
321
324
|
key: "push",
|
|
322
325
|
source: "builtin",
|
|
323
326
|
collection: null,
|
|
@@ -330,10 +333,10 @@ const de = {
|
|
|
330
333
|
summary: "Integration push"
|
|
331
334
|
};
|
|
332
335
|
export {
|
|
333
|
-
|
|
336
|
+
Be as BulkActionButtons,
|
|
334
337
|
G as bulkActionEnabled,
|
|
335
|
-
|
|
336
|
-
|
|
338
|
+
Pe as guardMatches,
|
|
339
|
+
ce as mergeBulkActions,
|
|
337
340
|
z as useAvailableBulkActions,
|
|
338
|
-
|
|
341
|
+
qe as useBuiltinGate
|
|
339
342
|
};
|