@nivaro/react 0.3.36 → 0.3.38
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/slots/CommentsSlot.js +44 -36
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/AgentBadge.js +26 -0
- package/dist/shared/components/AgentQuestionsCard.js +198 -0
- package/dist/shared/components/ItemEditForm.js +3329 -3263
- package/dist/shared/components/McpConnectionScope.js +480 -0
- package/dist/shared/components/MyWorkView.js +223 -208
- package/dist/shared/components/RecordReadView.js +620 -575
- package/dist/shared/components/chat/ChatPanel.js +683 -671
- package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
- package/dist/shared/components/imports/ImportConsole.js +106 -104
- package/dist/shared/components/imports/RunDetailSheet.js +34 -32
- package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
- package/dist/shared/components/item-edit/FormTour.js +279 -0
- package/dist/shared/components/item-edit/GroupSection.js +377 -360
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
- package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
- package/dist/shared/components/item-edit/form-density.js +36 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
- package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
- package/dist/shared/components/layout-editor/AddPanel.js +349 -192
- package/dist/shared/components/layout-editor/DesignNode.js +126 -112
- package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
- package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
- package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
- package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
- package/dist/shared/components/layout-editor/add-target.js +54 -43
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
- package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
- package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
- package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
- package/dist/shared/components/layout-editor/dnd/node.js +115 -105
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
- package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
- package/dist/shared/components/layout-editor/even-row.js +86 -0
- package/dist/shared/components/layout-editor/field-list.js +99 -0
- package/dist/shared/components/layout-editor/format-painter.js +102 -0
- package/dist/shared/components/layout-editor/grid-guides.js +15 -13
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
- package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
- package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
- package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
- package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
- package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
- package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
- package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
- package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
- package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
- package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
- package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
- package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
- package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/pin.js +37 -19
- package/dist/shared/components/layout-editor/place-clip.js +257 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
- package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
- package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
- package/dist/shared/components/layout-editor/removed-log.js +151 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
- package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
- package/dist/shared/components/layout-editor/revert-element.js +140 -0
- package/dist/shared/components/layout-editor/section-structure.js +193 -170
- package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
- package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
- package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
- package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
- package/dist/shared/components/layout-editor/shortcuts.js +21 -16
- package/dist/shared/components/layout-editor/structure-ops.js +221 -195
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
- package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
- package/dist/shared/components/panels/CommentPanel.js +47 -45
- package/dist/shared/components/panels/RevisionsPanel.js +66 -64
- package/dist/shared/components/panels/TaskPanel.js +395 -332
- package/dist/shared/components/profile/AgentsPanel.js +196 -147
- package/dist/shared/components/profile/ConnectionRollback.js +329 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
- package/dist/shared/lib/entry-config.js +22 -22
- package/dist/shared/lib/form-usage-beacon.js +91 -55
- package/dist/shared/lib/layout-lint.js +530 -284
- package/dist/shared/lib/layout-resolve.js +58 -44
- package/package.json +1 -1
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as W, useMutation as D } from "@tanstack/react-query";
|
|
3
|
+
import { RotateCcw as R, X as Y, Loader2 as P, AlertTriangle as E, Check as z } from "lucide-react";
|
|
4
|
+
import { useState as m } from "react";
|
|
5
|
+
import { useNivaroClient as G, useItemNavigation as J } from "../../context.js";
|
|
6
|
+
import { post as F } from "../../lib/commands.js";
|
|
7
|
+
import { cn as V, formatNumber as i, formatDateTime as I, formatRelative as L } from "../../lib/utils.js";
|
|
8
|
+
import { Pill as Z, ConfirmButton as ee } from "./primitives.js";
|
|
9
|
+
const q = [
|
|
10
|
+
["1h", "Last hour", 36e5],
|
|
11
|
+
["24h", "Last 24 hours", 864e5],
|
|
12
|
+
["7d", "Last 7 days", 7 * 864e5],
|
|
13
|
+
["14d", "Last 14 days", 14 * 864e5],
|
|
14
|
+
["custom", "Between…", 0]
|
|
15
|
+
], te = {
|
|
16
|
+
delete_created: () => "Delete the record it created",
|
|
17
|
+
restore_values: (n) => `Put back ${n} field${n === 1 ? "" : "s"}`,
|
|
18
|
+
restore_deleted: (n) => n ? `Bring back the record it deleted, then put back ${n} field${n === 1 ? "" : "s"}` : "Bring back the record it deleted",
|
|
19
|
+
remove_comment: () => "Remove its comment"
|
|
20
|
+
};
|
|
21
|
+
function K(n) {
|
|
22
|
+
const d = (x) => String(x).padStart(2, "0");
|
|
23
|
+
return `${n.getFullYear()}-${d(n.getMonth() + 1)}-${d(n.getDate())}T${d(n.getHours())}:${d(n.getMinutes())}`;
|
|
24
|
+
}
|
|
25
|
+
const O = "h-8 rounded-md border border-slate-200 bg-white px-2 text-[12.5px] text-slate-800 outline-none transition-colors focus:border-nvr-cyan focus-visible:ring-2 focus-visible:ring-nvr-cyan/25 dark:border-border dark:bg-background dark:text-slate-100 dark:[color-scheme:dark]", B = (n) => (n == null ? void 0 : n.message) || "Something went wrong. Try again in a moment.";
|
|
26
|
+
function ce({
|
|
27
|
+
conn: n,
|
|
28
|
+
name: d,
|
|
29
|
+
scope: x,
|
|
30
|
+
onClose: M
|
|
31
|
+
}) {
|
|
32
|
+
var S;
|
|
33
|
+
const f = G(), w = W(), { urlFor: Q, open: j } = J(), v = x === "mine" ? `/mcp-connections/mine/${n}` : `/mcp-connections/${n}`, [h, A] = m("24h"), [N, X] = m(() => K(new Date(Date.now() - 864e5))), [y, H] = m(() => K(/* @__PURE__ */ new Date())), [a, c] = m(null), [g, $] = m(null), [l, C] = m(null), U = () => {
|
|
34
|
+
var s;
|
|
35
|
+
if (h === "custom") {
|
|
36
|
+
const o = new Date(N), b = new Date(y);
|
|
37
|
+
return Number.isNaN(o.getTime()) || Number.isNaN(b.getTime()) ? null : { from: o.toISOString(), to: b.toISOString() };
|
|
38
|
+
}
|
|
39
|
+
const e = ((s = q.find((o) => o[0] === h)) == null ? void 0 : s[2]) ?? 864e5;
|
|
40
|
+
return { from: new Date(Date.now() - e).toISOString() };
|
|
41
|
+
}, p = D({
|
|
42
|
+
mutationFn: () => {
|
|
43
|
+
const e = U();
|
|
44
|
+
if (!e) throw new Error("Choose when the window starts and ends");
|
|
45
|
+
return f.request(F(`${v}/rollback/preview`, e)).then((s) => s.data);
|
|
46
|
+
},
|
|
47
|
+
onSuccess: (e) => {
|
|
48
|
+
c(e), C(null), $(null);
|
|
49
|
+
}
|
|
50
|
+
}), u = D({
|
|
51
|
+
mutationFn: (e) => f.request(
|
|
52
|
+
F(`${v}/rollback`, {
|
|
53
|
+
from: e.from,
|
|
54
|
+
to: e.to,
|
|
55
|
+
plan_hash: e.plan_hash
|
|
56
|
+
})
|
|
57
|
+
).then((s) => s.data),
|
|
58
|
+
onSuccess: (e) => {
|
|
59
|
+
C(e), c(null), w.invalidateQueries({ queryKey: ["nvr-mcp-activity"] }), w.invalidateQueries({ queryKey: ["nvr-mcp-connections"] });
|
|
60
|
+
},
|
|
61
|
+
onError: (e) => {
|
|
62
|
+
var o;
|
|
63
|
+
const s = e;
|
|
64
|
+
s.status === 409 && ((o = s.response) != null && o.data) && (c(s.response.data), $(
|
|
65
|
+
"Some records changed since the preview. This is the new list — check it and apply again."
|
|
66
|
+
));
|
|
67
|
+
}
|
|
68
|
+
}), _ = (e, s, o) => {
|
|
69
|
+
const b = { collection: e, itemId: s };
|
|
70
|
+
return /* @__PURE__ */ r(
|
|
71
|
+
"a",
|
|
72
|
+
{
|
|
73
|
+
href: Q(b),
|
|
74
|
+
onClick: (k) => {
|
|
75
|
+
k.metaKey || k.ctrlKey || (k.preventDefault(), j(b));
|
|
76
|
+
},
|
|
77
|
+
className: "font-mono text-[11.5px] text-nvr-navy underline-offset-2 hover:underline dark:text-nvr-cyan",
|
|
78
|
+
children: o
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ t(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: "rounded-lg border border-slate-200 bg-slate-50/70 p-3 dark:border-border dark:bg-muted/30",
|
|
86
|
+
"data-nvr-connection-rollback": !0,
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
89
|
+
/* @__PURE__ */ r(R, { className: "h-4 w-4 text-slate-500 dark:text-slate-400", "aria-hidden": !0 }),
|
|
90
|
+
/* @__PURE__ */ t("span", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
91
|
+
"Roll back what ",
|
|
92
|
+
d,
|
|
93
|
+
" changed"
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ r(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
type: "button",
|
|
99
|
+
onClick: M,
|
|
100
|
+
"aria-label": "Close",
|
|
101
|
+
"data-tip": "Close",
|
|
102
|
+
className: "ml-auto rounded p-1 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:hover:text-slate-200",
|
|
103
|
+
children: /* @__PURE__ */ r(Y, { className: "h-3.5 w-3.5" })
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ t("div", { className: "mt-2.5 flex flex-wrap items-center gap-2", children: [
|
|
108
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: q.map(([e, s]) => /* @__PURE__ */ r(
|
|
109
|
+
"button",
|
|
110
|
+
{
|
|
111
|
+
type: "button",
|
|
112
|
+
"aria-pressed": h === e,
|
|
113
|
+
onClick: () => {
|
|
114
|
+
A(e), c(null);
|
|
115
|
+
},
|
|
116
|
+
className: V(
|
|
117
|
+
"h-7 rounded px-2.5 text-[12px] font-medium transition-colors",
|
|
118
|
+
h === e ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-white" : "text-slate-600 hover:text-slate-900 dark:text-slate-300 dark:hover:text-white"
|
|
119
|
+
),
|
|
120
|
+
children: s
|
|
121
|
+
},
|
|
122
|
+
e
|
|
123
|
+
)) }),
|
|
124
|
+
h === "custom" && /* @__PURE__ */ t("span", { className: "flex flex-wrap items-center gap-1.5 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
125
|
+
/* @__PURE__ */ r(
|
|
126
|
+
"input",
|
|
127
|
+
{
|
|
128
|
+
type: "datetime-local",
|
|
129
|
+
value: N,
|
|
130
|
+
onChange: (e) => {
|
|
131
|
+
X(e.target.value), c(null);
|
|
132
|
+
},
|
|
133
|
+
"aria-label": "From",
|
|
134
|
+
className: O
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
"to",
|
|
138
|
+
/* @__PURE__ */ r(
|
|
139
|
+
"input",
|
|
140
|
+
{
|
|
141
|
+
type: "datetime-local",
|
|
142
|
+
value: y,
|
|
143
|
+
onChange: (e) => {
|
|
144
|
+
H(e.target.value), c(null);
|
|
145
|
+
},
|
|
146
|
+
"aria-label": "To",
|
|
147
|
+
className: O
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ t(
|
|
152
|
+
"button",
|
|
153
|
+
{
|
|
154
|
+
type: "button",
|
|
155
|
+
onClick: () => p.mutate(),
|
|
156
|
+
disabled: p.isPending,
|
|
157
|
+
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-3 text-[12.5px] font-medium text-slate-700 transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 disabled:opacity-40 dark:border-border dark:bg-card dark:text-slate-200",
|
|
158
|
+
children: [
|
|
159
|
+
p.isPending && /* @__PURE__ */ r(P, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
160
|
+
"Preview"
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
] }),
|
|
165
|
+
p.isError && /* @__PURE__ */ r("p", { className: "mt-2 text-[12px] text-red-600 dark:text-red-400", children: B(p.error) }),
|
|
166
|
+
g && /* @__PURE__ */ t(
|
|
167
|
+
"p",
|
|
168
|
+
{
|
|
169
|
+
className: "mt-2 flex items-center gap-1.5 text-[12px] text-amber-700 dark:text-amber-400",
|
|
170
|
+
role: "status",
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ r(E, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
173
|
+
g
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
l && /* @__PURE__ */ t(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
className: "mt-3 rounded-md border border-slate-200 bg-white px-3 py-2 text-[12.5px] dark:border-border dark:bg-card",
|
|
181
|
+
role: "status",
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ t("p", { className: "flex items-center gap-1.5 text-slate-800 dark:text-slate-100", children: [
|
|
184
|
+
/* @__PURE__ */ r(z, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" }),
|
|
185
|
+
l.done ? `Rolled back ${i(l.done)} change${l.done === 1 ? "" : "s"}.` : "Nothing was rolled back.",
|
|
186
|
+
l.skipped > 0 && ` ${i(l.skipped)} left alone.`
|
|
187
|
+
] }),
|
|
188
|
+
l.acted_as === "administrator" && /* @__PURE__ */ r("p", { className: "mt-1 text-[12px] text-slate-500 dark:text-slate-400", children: "The person this app acted for can no longer sign in, so the rollback ran as you." }),
|
|
189
|
+
l.failed.length > 0 && /* @__PURE__ */ r("ul", { className: "mt-2 space-y-1", children: l.failed.map((e) => /* @__PURE__ */ t(
|
|
190
|
+
"li",
|
|
191
|
+
{
|
|
192
|
+
className: "text-[12px] text-red-700 dark:text-red-400",
|
|
193
|
+
children: [
|
|
194
|
+
e.collection,
|
|
195
|
+
" #",
|
|
196
|
+
e.item,
|
|
197
|
+
": ",
|
|
198
|
+
e.error
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
`${e.collection}:${e.item}:${e.kind}`
|
|
202
|
+
)) })
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
a && /* @__PURE__ */ t("div", { className: "mt-3 space-y-3", children: [
|
|
207
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
208
|
+
I(a.from),
|
|
209
|
+
" – ",
|
|
210
|
+
I(a.to),
|
|
211
|
+
a.owner && x === "admin" && /* @__PURE__ */ t(T, { children: [
|
|
212
|
+
" · acting for ",
|
|
213
|
+
a.owner.name
|
|
214
|
+
] })
|
|
215
|
+
] }),
|
|
216
|
+
a.truncated && /* @__PURE__ */ t("p", { className: "flex items-center gap-1.5 text-[12px] text-amber-700 dark:text-amber-400", children: [
|
|
217
|
+
/* @__PURE__ */ r(E, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
218
|
+
"More changes than one rollback takes. Choose a shorter window."
|
|
219
|
+
] }),
|
|
220
|
+
a.actions.length === 0 && a.skipped.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12.5px] text-slate-600 dark:text-slate-300", children: [
|
|
221
|
+
d,
|
|
222
|
+
" changed nothing in this window."
|
|
223
|
+
] }) : /* @__PURE__ */ t(T, { children: [
|
|
224
|
+
a.actions.length > 0 && /* @__PURE__ */ t("section", { children: [
|
|
225
|
+
/* @__PURE__ */ t("h4", { className: "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
226
|
+
"Will be undone · ",
|
|
227
|
+
i(a.actions.length)
|
|
228
|
+
] }),
|
|
229
|
+
/* @__PURE__ */ r("ul", { className: "mt-1 max-h-72 divide-y divide-slate-100 overflow-y-auto rounded-md border border-slate-200 bg-white dark:divide-border/60 dark:border-border dark:bg-card", children: a.actions.slice(0, 300).map((e) => /* @__PURE__ */ t(
|
|
230
|
+
"li",
|
|
231
|
+
{
|
|
232
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1.5 text-[12px]",
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ r("span", { className: "min-w-[180px] text-slate-700 dark:text-slate-200", children: te[e.kind](e.fields.length) }),
|
|
235
|
+
e.kind === "delete_created" || e.kind === "restore_deleted" ? /* @__PURE__ */ t("span", { className: "font-mono text-[11.5px] text-slate-600 dark:text-slate-300", children: [
|
|
236
|
+
e.collection_label,
|
|
237
|
+
" #",
|
|
238
|
+
e.item
|
|
239
|
+
] }) : _(e.collection, e.item, `${e.collection_label} #${e.item}`),
|
|
240
|
+
e.fields.length > 0 && /* @__PURE__ */ t("span", { className: "flex flex-wrap gap-1", children: [
|
|
241
|
+
e.fields.slice(0, 6).map((s) => /* @__PURE__ */ r(
|
|
242
|
+
"span",
|
|
243
|
+
{
|
|
244
|
+
className: "rounded bg-slate-100 px-1.5 py-px font-mono text-[11px] text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
245
|
+
children: s
|
|
246
|
+
},
|
|
247
|
+
s
|
|
248
|
+
)),
|
|
249
|
+
e.fields.length > 6 && /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
250
|
+
"+",
|
|
251
|
+
e.fields.length - 6
|
|
252
|
+
] })
|
|
253
|
+
] }),
|
|
254
|
+
/* @__PURE__ */ t("span", { className: "ml-auto whitespace-nowrap text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
255
|
+
e.writes > 1 ? `${e.writes} writes · ` : "",
|
|
256
|
+
L(e.last_at)
|
|
257
|
+
] })
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
|
+
`${e.kind}:${e.collection}:${e.item}:${e.comment_id ?? ""}`
|
|
261
|
+
)) }),
|
|
262
|
+
a.actions.length > 300 && /* @__PURE__ */ t("p", { className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
|
|
263
|
+
"And ",
|
|
264
|
+
i(a.actions.length - 300),
|
|
265
|
+
" more."
|
|
266
|
+
] })
|
|
267
|
+
] }),
|
|
268
|
+
a.skipped.length > 0 && /* @__PURE__ */ t("section", { children: [
|
|
269
|
+
/* @__PURE__ */ t("h4", { className: "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
270
|
+
"Left alone · ",
|
|
271
|
+
i(a.skipped.length)
|
|
272
|
+
] }),
|
|
273
|
+
/* @__PURE__ */ r("ul", { className: "mt-1 max-h-52 divide-y divide-slate-100 overflow-y-auto rounded-md border border-slate-200 bg-white dark:divide-border/60 dark:border-border dark:bg-card", children: a.skipped.slice(0, 300).map((e) => /* @__PURE__ */ t(
|
|
274
|
+
"li",
|
|
275
|
+
{
|
|
276
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1.5 text-[12px]",
|
|
277
|
+
children: [
|
|
278
|
+
_(e.collection, e.item, `${e.collection_label} #${e.item}`),
|
|
279
|
+
/* @__PURE__ */ t("span", { className: "text-slate-600 dark:text-slate-300", children: [
|
|
280
|
+
e.reason,
|
|
281
|
+
e.by ? ` (${e.by}` : "",
|
|
282
|
+
e.by && e.at ? `, ${L(e.at)})` : e.by ? ")" : ""
|
|
283
|
+
] })
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
`${e.collection}:${e.item}`
|
|
287
|
+
)) })
|
|
288
|
+
] })
|
|
289
|
+
] }),
|
|
290
|
+
a.system_writes > 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: [
|
|
291
|
+
/* @__PURE__ */ r(Z, { tone: "neutral", children: i(a.system_writes) }),
|
|
292
|
+
" configuration change",
|
|
293
|
+
a.system_writes === 1 ? "" : "s",
|
|
294
|
+
" in this window are not rolled back here."
|
|
295
|
+
] }),
|
|
296
|
+
a.actions.length > 0 && !a.truncated && /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
297
|
+
/* @__PURE__ */ t(
|
|
298
|
+
ee,
|
|
299
|
+
{
|
|
300
|
+
onConfirm: () => u.mutate(a),
|
|
301
|
+
disabled: u.isPending,
|
|
302
|
+
confirmLabel: `Undo ${i(a.actions.length)} now?`,
|
|
303
|
+
title: `Roll back ${a.actions.length} change${a.actions.length === 1 ? "" : "s"}`,
|
|
304
|
+
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-3 text-[12.5px] font-medium text-slate-800 transition-colors hover:border-red-300 hover:text-red-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-400/40 disabled:opacity-40 dark:border-border dark:bg-card dark:text-slate-100 dark:hover:border-red-500/50 dark:hover:text-red-400",
|
|
305
|
+
armedClassName: "border-red-300 bg-red-50 text-red-700 dark:border-red-500/50 dark:bg-red-500/10 dark:text-red-400",
|
|
306
|
+
children: [
|
|
307
|
+
u.isPending ? /* @__PURE__ */ r(P, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(R, { className: "h-3.5 w-3.5" }),
|
|
308
|
+
"Roll back ",
|
|
309
|
+
i(a.actions.length),
|
|
310
|
+
" change",
|
|
311
|
+
a.actions.length === 1 ? "" : "s"
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ t("span", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: [
|
|
316
|
+
"Runs as ",
|
|
317
|
+
x === "mine" ? "you" : ((S = a.owner) == null ? void 0 : S.name) ?? "the person",
|
|
318
|
+
", with their permissions. Each change is logged."
|
|
319
|
+
] }),
|
|
320
|
+
u.isError && !g && /* @__PURE__ */ r("span", { className: "text-[12px] text-red-600 dark:text-red-400", children: B(u.error) })
|
|
321
|
+
] })
|
|
322
|
+
] })
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
export {
|
|
328
|
+
ce as ConnectionRollback
|
|
329
|
+
};
|