@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.
Files changed (43) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useFormSchema.js +82 -85
  3. package/dist/hooks/useSessionRecorder.js +206 -175
  4. package/dist/index.d.ts +38 -13
  5. package/dist/index.js +182 -180
  6. package/dist/lib/commands.js +15 -11
  7. package/dist/shared/components/CollectionBrowserView.js +516 -503
  8. package/dist/shared/components/ItemEditForm.js +3021 -3019
  9. package/dist/shared/components/JobsTray.js +20 -16
  10. package/dist/shared/components/MyWorkView.js +133 -126
  11. package/dist/shared/components/NotificationBell.js +314 -288
  12. package/dist/shared/components/RecordCompare.js +38 -40
  13. package/dist/shared/components/RecordReadView.js +119 -119
  14. package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
  15. package/dist/shared/components/item-edit/InlineGridField.js +45 -45
  16. package/dist/shared/components/item-edit/InlineTableField.js +750 -749
  17. package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
  18. package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
  19. package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
  20. package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
  21. package/dist/shared/components/item-edit/related-missing.js +75 -19
  22. package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
  23. package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
  24. package/dist/shared/components/panels/BackgroundMove.js +175 -0
  25. package/dist/shared/components/panels/MoveAdvisory.js +204 -0
  26. package/dist/shared/components/panels/PipelinePanel.js +1450 -1219
  27. package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
  28. package/dist/shared/lib/commands.js +18 -14
  29. package/dist/shared/lib/error-hints.js +1 -1
  30. package/dist/shared/lib/job-failure-text.js +12 -0
  31. package/dist/shared/lib/move-failure.js +9 -0
  32. package/dist/shared/lib/obligation-banner.js +15 -14
  33. package/dist/shared/lib/partner-failure.js +71 -0
  34. package/dist/shared/lib/prefetch.js +73 -73
  35. package/dist/shared/lib/replay-checkout.js +18 -13
  36. package/dist/shared/lib/replay-context.js +90 -77
  37. package/dist/shared/lib/replay-idle.js +21 -0
  38. package/dist/shared/lib/replay-socket.js +21 -17
  39. package/dist/shared/lib/rum.js +56 -51
  40. package/dist/shared/lib/safe-error.js +17 -13
  41. package/dist/shared/lib/stale-chunk.js +69 -26
  42. package/dist/shared/lib/system-collections.js +20 -0
  43. 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 { useTrayJobs as M, seedJobs as O, dismissFinishedJobs as U, dismissJob as L, applyJobUpdate as R } from "../lib/jobs-tray.js";
10
- import { useLiveEvent as S } from "../lib/live.js";
11
- import { cn as z } from "../lib/utils.js";
12
- import { queueStanding as A } from "./imports/run-parts.js";
13
- function ee() {
14
- const e = J(), d = D(), s = M(), [l, c] = v(!0);
15
- S("job:progress", (a) => R(a), { includeOwn: !0 });
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 && O(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: U,
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
- B,
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 B({
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 ? A(
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 ? e.error : m ? e.outcome : e.kind === "background-run" ? (
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: z(
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: () => L(e.key),
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
- ee as JobsTray
204
+ ae as JobsTray
201
205
  };