@nivaro/react 0.3.98 → 0.3.100
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/useFormSchema.js +82 -85
- package/dist/hooks/useSessionRecorder.js +206 -175
- package/dist/index.d.ts +38 -13
- package/dist/index.js +182 -180
- package/dist/lib/commands.js +15 -11
- package/dist/shared/components/CollectionBrowserView.js +516 -503
- package/dist/shared/components/ItemEditForm.js +3021 -3019
- package/dist/shared/components/JobsTray.js +20 -16
- package/dist/shared/components/MyWorkView.js +133 -126
- package/dist/shared/components/NotificationBell.js +314 -288
- package/dist/shared/components/RecordCompare.js +38 -40
- package/dist/shared/components/RecordReadView.js +119 -119
- package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
- package/dist/shared/components/item-edit/InlineGridField.js +45 -45
- package/dist/shared/components/item-edit/InlineTableField.js +750 -749
- package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
- package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
- package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
- package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
- package/dist/shared/components/item-edit/related-missing.js +75 -19
- package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
- package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
- package/dist/shared/components/panels/BackgroundMove.js +175 -0
- package/dist/shared/components/panels/MoveAdvisory.js +204 -0
- package/dist/shared/components/panels/PipelinePanel.js +1450 -1219
- package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
- package/dist/shared/lib/commands.js +18 -14
- package/dist/shared/lib/error-hints.js +1 -1
- package/dist/shared/lib/job-failure-text.js +12 -0
- package/dist/shared/lib/move-failure.js +9 -0
- package/dist/shared/lib/obligation-banner.js +15 -14
- package/dist/shared/lib/partner-failure.js +71 -0
- package/dist/shared/lib/prefetch.js +73 -73
- package/dist/shared/lib/replay-checkout.js +18 -13
- package/dist/shared/lib/replay-context.js +90 -77
- package/dist/shared/lib/replay-idle.js +21 -0
- package/dist/shared/lib/replay-socket.js +21 -17
- package/dist/shared/lib/rum.js +56 -51
- package/dist/shared/lib/safe-error.js +17 -13
- package/dist/shared/lib/stale-chunk.js +69 -26
- package/dist/shared/lib/system-collections.js +20 -0
- package/package.json +1 -1
|
@@ -6,13 +6,14 @@ import { createPortal as q } from "react-dom";
|
|
|
6
6
|
import { useOptionalNivaroClient as J, useNavigation as D } from "../context.js";
|
|
7
7
|
import { clock as F } from "../lib/background-runs.js";
|
|
8
8
|
import { get as T, post as E } from "../lib/commands.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import { jobFailureText as M } from "../lib/job-failure-text.js";
|
|
10
|
+
import { useTrayJobs as O, seedJobs as U, dismissFinishedJobs as L, dismissJob as R, applyJobUpdate as S } from "../lib/jobs-tray.js";
|
|
11
|
+
import { useLiveEvent as z } from "../lib/live.js";
|
|
12
|
+
import { cn as A } from "../lib/utils.js";
|
|
13
|
+
import { queueStanding as B } from "./imports/run-parts.js";
|
|
14
|
+
function ae() {
|
|
15
|
+
const e = J(), d = D(), s = O(), [l, c] = v(!0);
|
|
16
|
+
z("job:progress", (a) => S(a), { includeOwn: !0 });
|
|
16
17
|
const m = s.some((a) => a.status === "running" || a.status === "queued"), { data: i } = b({
|
|
17
18
|
queryKey: ["jobs-tray-seed"],
|
|
18
19
|
enabled: !!e,
|
|
@@ -21,7 +22,7 @@ function ee() {
|
|
|
21
22
|
queryFn: () => e.request(T("/my-jobs")).then((a) => a.data ?? []).catch(() => [])
|
|
22
23
|
});
|
|
23
24
|
if ($(() => {
|
|
24
|
-
i &&
|
|
25
|
+
i && U(i);
|
|
25
26
|
}, [i]), s.length === 0 || typeof document > "u") return null;
|
|
26
27
|
const r = s.filter((a) => a.status === "running" || a.status === "queued").length, n = s.length - r, u = (a) => d.navigate ? d.navigate(a) : window.location.assign(a);
|
|
27
28
|
return q(
|
|
@@ -49,7 +50,7 @@ function ee() {
|
|
|
49
50
|
"button",
|
|
50
51
|
{
|
|
51
52
|
type: "button",
|
|
52
|
-
onClick:
|
|
53
|
+
onClick: L,
|
|
53
54
|
"data-jobs-tray-clear": !0,
|
|
54
55
|
className: "text-[11px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100",
|
|
55
56
|
children: "Clear finished"
|
|
@@ -67,7 +68,7 @@ function ee() {
|
|
|
67
68
|
)
|
|
68
69
|
] }),
|
|
69
70
|
l && /* @__PURE__ */ t("ul", { className: "max-h-[40vh] divide-y divide-slate-100 overflow-y-auto border-t border-slate-100 dark:divide-[#334155] dark:border-[#334155]", children: s.map((a) => /* @__PURE__ */ t(
|
|
70
|
-
|
|
71
|
+
H,
|
|
71
72
|
{
|
|
72
73
|
job: a,
|
|
73
74
|
onOpen: u,
|
|
@@ -82,14 +83,17 @@ function ee() {
|
|
|
82
83
|
document.body
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function H({
|
|
86
87
|
job: e,
|
|
87
88
|
onOpen: d,
|
|
88
89
|
onCancel: s
|
|
89
90
|
}) {
|
|
90
|
-
const [l, c] = v("idle"), m = e.status === "completed", i = e.status === "error", r = e.status === "queued", n = e.progress ?? {}, u = Number(n.total), a = Number(n.done), h = Number.isFinite(u) && u > 0 && Number.isFinite(a) ? Math.max(0, Math.min(100, Math.round(a / u * 100))) : null, k = typeof n.phase == "string" ? n.phase : null, p = r ?
|
|
91
|
+
const [l, c] = v("idle"), m = e.status === "completed", i = e.status === "error", r = e.status === "queued", n = e.progress ?? {}, u = Number(n.total), a = Number(n.done), h = Number.isFinite(u) && u > 0 && Number.isFinite(a) ? Math.max(0, Math.min(100, Math.round(a / u * 100))) : null, k = typeof n.phase == "string" ? n.phase : null, p = r ? B(
|
|
91
92
|
e.position != null ? { position: e.position, eta_seconds: e.eta_seconds ?? null } : void 0
|
|
92
|
-
) : i ?
|
|
93
|
+
) : i ? (
|
|
94
|
+
// Read, never shown as stored: a job's error is written for the log (lib/job-failure-text).
|
|
95
|
+
M(e.error)
|
|
96
|
+
) : m ? e.outcome : e.kind === "background-run" ? (
|
|
93
97
|
// #2759 — a slow read the server is finishing: say how long it usually takes.
|
|
94
98
|
Number(n.expected_ms) >= 1e3 ? `Usually takes about ${F(Number(n.expected_ms))}` : "Running on the server"
|
|
95
99
|
) : [k, h != null ? `${a} of ${u}` : null].filter(Boolean).join(" · ") || null;
|
|
@@ -106,7 +110,7 @@ function B({
|
|
|
106
110
|
p && /* @__PURE__ */ t(
|
|
107
111
|
"p",
|
|
108
112
|
{
|
|
109
|
-
className:
|
|
113
|
+
className: A(
|
|
110
114
|
"line-clamp-2 text-[11px]",
|
|
111
115
|
i ? "text-rose-600 dark:text-rose-300" : "text-slate-500 dark:text-slate-400"
|
|
112
116
|
),
|
|
@@ -185,7 +189,7 @@ function B({
|
|
|
185
189
|
"button",
|
|
186
190
|
{
|
|
187
191
|
type: "button",
|
|
188
|
-
onClick: () =>
|
|
192
|
+
onClick: () => R(e.key),
|
|
189
193
|
"aria-label": "Dismiss",
|
|
190
194
|
"data-job-dismiss": !0,
|
|
191
195
|
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded hover:bg-black/5 dark:hover:bg-white/10",
|
|
@@ -197,5 +201,5 @@ function B({
|
|
|
197
201
|
);
|
|
198
202
|
}
|
|
199
203
|
export {
|
|
200
|
-
|
|
204
|
+
ae as JobsTray
|
|
201
205
|
};
|