@nivaro/react 0.3.99 → 0.3.101

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 (60) 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 +84 -16
  5. package/dist/index.js +627 -622
  6. package/dist/lib/commands.js +15 -11
  7. package/dist/shared/components/ActivityEntry.js +5 -5
  8. package/dist/shared/components/CollectionBrowserView.js +516 -503
  9. package/dist/shared/components/ItemEditForm.js +3471 -3465
  10. package/dist/shared/components/JobsTray.js +76 -61
  11. package/dist/shared/components/MyWorkView.js +133 -126
  12. package/dist/shared/components/NotificationBell.js +322 -289
  13. package/dist/shared/components/RecordCompare.js +38 -40
  14. package/dist/shared/components/RecordReadView.js +119 -119
  15. package/dist/shared/components/TipLayer.js +56 -41
  16. package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
  17. package/dist/shared/components/integrations/console/SignalCard.js +40 -40
  18. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
  19. package/dist/shared/components/integrations/console/drill/status.js +23 -18
  20. package/dist/shared/components/item-edit/InlineGridField.js +45 -45
  21. package/dist/shared/components/item-edit/InlineTableField.js +750 -749
  22. package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
  23. package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
  24. package/dist/shared/components/item-edit/RecordInsights.js +86 -86
  25. package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
  26. package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
  27. package/dist/shared/components/item-edit/header-path-preview.js +46 -34
  28. package/dist/shared/components/item-edit/related-missing.js +75 -19
  29. package/dist/shared/components/notifications/DeliveryChips.js +1 -2
  30. package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
  31. package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
  32. package/dist/shared/components/panels/BackgroundMove.js +242 -0
  33. package/dist/shared/components/panels/MoveAdvisory.js +204 -0
  34. package/dist/shared/components/panels/PipelinePanel.js +1459 -1220
  35. package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
  36. package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
  37. package/dist/shared/components/profile/DayTimeline.js +145 -140
  38. package/dist/shared/components/profile/PersonAccess.js +679 -383
  39. package/dist/shared/components/profile/PersonActivity.js +404 -427
  40. package/dist/shared/components/profile/PersonDidPanel.js +248 -134
  41. package/dist/shared/components/profile/PersonProfile.js +33 -32
  42. package/dist/shared/components/profile/journey-view.js +166 -0
  43. package/dist/shared/lib/activity-sentence.js +319 -236
  44. package/dist/shared/lib/commands.js +18 -14
  45. package/dist/shared/lib/error-hints.js +1 -1
  46. package/dist/shared/lib/job-failure-text.js +12 -0
  47. package/dist/shared/lib/jobs-tray.js +60 -41
  48. package/dist/shared/lib/move-failure.js +19 -0
  49. package/dist/shared/lib/obligation-banner.js +22 -21
  50. package/dist/shared/lib/partner-failure.js +83 -0
  51. package/dist/shared/lib/prefetch.js +73 -73
  52. package/dist/shared/lib/replay-checkout.js +18 -13
  53. package/dist/shared/lib/replay-context.js +90 -77
  54. package/dist/shared/lib/replay-idle.js +21 -0
  55. package/dist/shared/lib/replay-socket.js +21 -17
  56. package/dist/shared/lib/rum.js +56 -51
  57. package/dist/shared/lib/safe-error.js +17 -13
  58. package/dist/shared/lib/stale-chunk.js +69 -26
  59. package/dist/shared/lib/system-collections.js +20 -0
  60. package/package.json +1 -1
@@ -1,77 +1,86 @@
1
- import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
- import { useQuery as b } from "@tanstack/react-query";
3
- import { Loader2 as x, Check as f, ChevronDown as g, ChevronUp as y, AlertCircle as N, Timer as w, Download as C, X as _ } from "lucide-react";
4
- import { useState as v, useEffect as $ } from "react";
5
- import { createPortal as q } from "react-dom";
6
- import { useOptionalNivaroClient as J, useNavigation as D } from "../context.js";
7
- import { clock as F } from "../lib/background-runs.js";
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 });
16
- const m = s.some((a) => a.status === "running" || a.status === "queued"), { data: i } = b({
1
+ import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
+ import { useQuery as N } from "@tanstack/react-query";
3
+ import { Loader2 as f, AlertCircle as v, CircleSlash as k, Check as g, ChevronDown as w, ChevronUp as C, Timer as _, Download as q, X as J } from "lucide-react";
4
+ import { useState as b, useEffect as D } from "react";
5
+ import { createPortal as F } from "react-dom";
6
+ import { useOptionalNivaroClient as T, useNavigation as $ } from "../context.js";
7
+ import { clock as E } from "../lib/background-runs.js";
8
+ import { get as M, post as O } from "../lib/commands.js";
9
+ import { jobFailureText as S } from "../lib/job-failure-text.js";
10
+ import { useTrayJobs as U, seedJobs as H, trayHeadline as L, dismissFinishedJobs as R, dismissJob as z, applyJobUpdate as A } from "../lib/jobs-tray.js";
11
+ import { useLiveEvent as B } from "../lib/live.js";
12
+ import { cn as I } from "../lib/utils.js";
13
+ import { queueStanding as K } from "./imports/run-parts.js";
14
+ function re() {
15
+ const e = T(), o = $(), s = U(), [l, d] = b(!0);
16
+ B("job:progress", (a) => A(a), { includeOwn: !0 });
17
+ const m = s.some((a) => a.status === "running" || a.status === "queued"), { data: i } = N({
17
18
  queryKey: ["jobs-tray-seed"],
18
19
  enabled: !!e,
19
20
  staleTime: 0,
20
21
  refetchInterval: m ? 2e4 : !1,
21
- queryFn: () => e.request(T("/my-jobs")).then((a) => a.data ?? []).catch(() => [])
22
+ queryFn: () => e.request(M("/my-jobs")).then((a) => a.data ?? []).catch(() => [])
22
23
  });
23
- if ($(() => {
24
- i && O(i);
24
+ if (D(() => {
25
+ i && H(i);
25
26
  }, [i]), s.length === 0 || typeof document > "u") return null;
26
- 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
- return q(
28
- /* @__PURE__ */ o(
27
+ const c = s.filter((a) => a.status === "running" || a.status === "queued").length, p = s.length - c, n = L(s), u = (a) => o.navigate ? o.navigate(a) : window.location.assign(a);
28
+ return F(
29
+ /* @__PURE__ */ r(
29
30
  "div",
30
31
  {
31
32
  "data-jobs-tray": s.length,
33
+ "data-jobs-tray-tone": n.tone,
32
34
  "data-nvr-dock-aware": !0,
33
35
  "data-nvr-recording-hide": !0,
34
36
  className: "fixed bottom-4 left-1/2 z-[110] w-[min(420px,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-slate-200 bg-white text-slate-700 shadow-xl dark:border-[#334155] dark:bg-[#1e293b] dark:text-slate-200",
35
37
  children: [
36
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2 px-3 py-2", children: [
37
- r > 0 ? /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-nvr-cyan" }) : /* @__PURE__ */ t(f, { className: "h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }),
38
- /* @__PURE__ */ t(
38
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2 px-3 py-2", children: [
39
+ n.tone === "running" ? /* @__PURE__ */ t(f, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-nvr-cyan" }) : n.tone === "failed" ? /* @__PURE__ */ t(v, { className: "h-3.5 w-3.5 shrink-0 text-rose-500" }) : n.tone === "cancelled" ? /* @__PURE__ */ t(k, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }),
40
+ /* @__PURE__ */ r(
39
41
  "button",
40
42
  {
41
43
  type: "button",
42
- onClick: () => c((a) => !a),
43
- className: "min-w-0 flex-1 text-left text-[12.5px] font-medium",
44
+ onClick: () => d((a) => !a),
45
+ className: "min-w-0 flex-1 truncate text-left text-[12.5px] font-medium",
44
46
  "aria-expanded": l,
45
- children: r > 0 ? `${r} job${r === 1 ? "" : "s"} running` : `${n} job${n === 1 ? "" : "s"} finished`
47
+ "data-jobs-tray-head": !0,
48
+ children: [
49
+ n.text,
50
+ n.note && /* @__PURE__ */ r("span", { className: "font-normal text-rose-600 dark:text-rose-300", children: [
51
+ " · ",
52
+ n.note
53
+ ] })
54
+ ]
46
55
  }
47
56
  ),
48
- n > 0 && /* @__PURE__ */ t(
57
+ p > 0 && /* @__PURE__ */ t(
49
58
  "button",
50
59
  {
51
60
  type: "button",
52
- onClick: U,
61
+ onClick: R,
53
62
  "data-jobs-tray-clear": !0,
54
63
  className: "text-[11px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100",
55
- children: "Clear finished"
64
+ children: c > 0 ? "Clear finished" : "Clear"
56
65
  }
57
66
  ),
58
67
  /* @__PURE__ */ t(
59
68
  "button",
60
69
  {
61
70
  type: "button",
62
- onClick: () => c((a) => !a),
71
+ onClick: () => d((a) => !a),
63
72
  "aria-label": l ? "Collapse" : "Expand",
64
73
  className: "flex h-6 w-6 items-center justify-center rounded hover:bg-black/5 dark:hover:bg-white/10",
65
- children: l ? /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(y, { className: "h-3.5 w-3.5" })
74
+ children: l ? /* @__PURE__ */ t(w, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(C, { className: "h-3.5 w-3.5" })
66
75
  }
67
76
  )
68
77
  ] }),
69
78
  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,
79
+ P,
71
80
  {
72
81
  job: a,
73
82
  onOpen: u,
74
- onCancel: e && a.cancel_path ? (h) => e.request(E(h)).then(() => {
83
+ onCancel: e && a.cancel_path ? (h) => e.request(O(h)).then(() => {
75
84
  }) : void 0
76
85
  },
77
86
  a.key
@@ -82,35 +91,41 @@ function ee() {
82
91
  document.body
83
92
  );
84
93
  }
85
- function B({
94
+ function P({
86
95
  job: e,
87
- onOpen: d,
96
+ onOpen: o,
88
97
  onCancel: s
89
98
  }) {
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(
99
+ const [l, d] = b("idle"), m = e.status === "completed", i = e.status === "error", c = e.status === "queued", p = e.status === "canceled", 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, y = typeof n.phase == "string" ? n.phase : null, x = c ? K(
91
100
  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" ? (
101
+ ) : i ? (
102
+ // Read, never shown as stored: a job's error is written for the log (lib/job-failure-text).
103
+ S(e.error)
104
+ ) : m ? e.outcome : p ? (
105
+ // An import's cancel sends no outcome: the row still says what happened.
106
+ e.outcome || "Cancelled"
107
+ ) : e.kind === "background-run" ? (
93
108
  // #2759 — a slow read the server is finishing: say how long it usually takes.
94
- Number(n.expected_ms) >= 1e3 ? `Usually takes about ${F(Number(n.expected_ms))}` : "Running on the server"
95
- ) : [k, h != null ? `${a} of ${u}` : null].filter(Boolean).join(" · ") || null;
96
- return /* @__PURE__ */ o(
109
+ Number(n.expected_ms) >= 1e3 ? `Usually takes about ${E(Number(n.expected_ms))}` : "Running on the server"
110
+ ) : [y, h != null ? `${a} of ${u}` : null].filter(Boolean).join(" · ") || null;
111
+ return /* @__PURE__ */ r(
97
112
  "li",
98
113
  {
99
114
  "data-job": e.key,
100
115
  "data-job-status": e.status,
101
116
  className: "flex items-start gap-2.5 px-3 py-2",
102
117
  children: [
103
- /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: i ? /* @__PURE__ */ t(N, { className: "h-3.5 w-3.5 text-rose-500" }) : m ? /* @__PURE__ */ t(f, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" }) : r ? /* @__PURE__ */ t(w, { className: "h-3.5 w-3.5 text-slate-400" }) : /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5 animate-spin text-nvr-cyan" }) }),
104
- /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
118
+ /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: i ? /* @__PURE__ */ t(v, { className: "h-3.5 w-3.5 text-rose-500" }) : m ? /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" }) : p ? /* @__PURE__ */ t(k, { className: "h-3.5 w-3.5 text-slate-400" }) : c ? /* @__PURE__ */ t(_, { className: "h-3.5 w-3.5 text-slate-400" }) : /* @__PURE__ */ t(f, { className: "h-3.5 w-3.5 animate-spin text-nvr-cyan" }) }),
119
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
105
120
  /* @__PURE__ */ t("p", { className: "truncate text-[12.5px] font-medium", children: e.label }),
106
- p && /* @__PURE__ */ t(
121
+ x && /* @__PURE__ */ t(
107
122
  "p",
108
123
  {
109
- className: z(
124
+ className: I(
110
125
  "line-clamp-2 text-[11px]",
111
126
  i ? "text-rose-600 dark:text-rose-300" : "text-slate-500 dark:text-slate-400"
112
127
  ),
113
- children: p
128
+ children: x
114
129
  }
115
130
  ),
116
131
  e.status === "running" && h != null && /* @__PURE__ */ t("div", { className: "mt-1 h-1 overflow-hidden rounded-full bg-slate-100 dark:bg-[#334155]", children: /* @__PURE__ */ t(
@@ -120,15 +135,15 @@ function B({
120
135
  style: { width: `${h}%` }
121
136
  }
122
137
  ) }),
123
- (e.file_id || e.href) && (e.status === "completed" || e.status === "error") && /* @__PURE__ */ o("div", { className: "mt-1 flex items-center gap-2", children: [
124
- e.file_id && m && /* @__PURE__ */ o(
138
+ (e.file_id || e.href) && (e.status === "completed" || e.status === "error") && /* @__PURE__ */ r("div", { className: "mt-1 flex items-center gap-2", children: [
139
+ e.file_id && m && /* @__PURE__ */ r(
125
140
  "a",
126
141
  {
127
142
  href: `/api/files/${e.file_id}?download=1`,
128
143
  "data-job-download": !0,
129
144
  className: "inline-flex items-center gap-1 rounded-full border border-nvr-cyan/50 bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
130
145
  children: [
131
- /* @__PURE__ */ t(C, { className: "h-3 w-3" }),
146
+ /* @__PURE__ */ t(q, { className: "h-3 w-3" }),
132
147
  "Download"
133
148
  ]
134
149
  }
@@ -137,18 +152,18 @@ function B({
137
152
  "button",
138
153
  {
139
154
  type: "button",
140
- onClick: () => d(e.href),
155
+ onClick: () => o(e.href),
141
156
  className: "text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
142
157
  children: "Details"
143
158
  }
144
159
  )
145
160
  ] }),
146
- e.status === "running" && e.cancel_path && s && /* @__PURE__ */ o("div", { className: "mt-1 flex items-center gap-2", children: [
161
+ e.status === "running" && e.cancel_path && s && /* @__PURE__ */ r("div", { className: "mt-1 flex items-center gap-2", children: [
147
162
  e.href && /* @__PURE__ */ t(
148
163
  "button",
149
164
  {
150
165
  type: "button",
151
- onClick: () => d(e.href),
166
+ onClick: () => o(e.href),
152
167
  className: "text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
153
168
  children: "Open"
154
169
  }
@@ -160,9 +175,9 @@ function B({
160
175
  "data-job-cancel": !0,
161
176
  disabled: l === "asking",
162
177
  onClick: () => {
163
- c("asking"), s(e.cancel_path).then(
164
- () => c("idle"),
165
- () => c("failed")
178
+ d("asking"), s(e.cancel_path).then(
179
+ () => d("idle"),
180
+ () => d("failed")
166
181
  );
167
182
  },
168
183
  className: "text-[11px] text-slate-500 underline-offset-2 hover:text-rose-600 hover:underline disabled:opacity-50 dark:text-slate-400 dark:hover:text-rose-300",
@@ -171,11 +186,11 @@ function B({
171
186
  ),
172
187
  l === "failed" && /* @__PURE__ */ t("span", { className: "text-[11px] text-rose-600 dark:text-rose-300", children: "Could not cancel" })
173
188
  ] }),
174
- r && e.href && /* @__PURE__ */ t(
189
+ c && e.href && /* @__PURE__ */ t(
175
190
  "button",
176
191
  {
177
192
  type: "button",
178
- onClick: () => d(e.href),
193
+ onClick: () => o(e.href),
179
194
  className: "mt-0.5 text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
180
195
  children: "Details"
181
196
  }
@@ -185,11 +200,11 @@ function B({
185
200
  "button",
186
201
  {
187
202
  type: "button",
188
- onClick: () => L(e.key),
203
+ onClick: () => z(e.key),
189
204
  "aria-label": "Dismiss",
190
205
  "data-job-dismiss": !0,
191
206
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded hover:bg-black/5 dark:hover:bg-white/10",
192
- children: /* @__PURE__ */ t(_, { className: "h-3 w-3" })
207
+ children: /* @__PURE__ */ t(J, { className: "h-3 w-3" })
193
208
  }
194
209
  )
195
210
  ]
@@ -197,5 +212,5 @@ function B({
197
212
  );
198
213
  }
199
214
  export {
200
- ee as JobsTray
215
+ re as JobsTray
201
216
  };