@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,14 +1,14 @@
1
- import { jsx as t, jsxs as a, Fragment as L } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as a, Fragment as F } from "react/jsx-runtime";
2
2
  import { useQueryClient as ae, useQuery as V } from "@tanstack/react-query";
3
- import { Loader2 as ie, X as U, ChevronRight as le } from "lucide-react";
4
- import { memo as de, useState as k, useMemo as W } from "react";
3
+ import { Loader2 as ie, X as H, ChevronRight as le } from "lucide-react";
4
+ import { memo as de, useState as k, useMemo as U } from "react";
5
5
  import { useNivaroClient as oe } from "../../context.js";
6
- import { get as Y, patch as ce, del as pe, post as ue } from "../../lib/commands.js";
7
- import { titleCase as G, cn as me, toLocalDateString as xe } from "../../lib/utils.js";
8
- import { NumberDraftInput as he } from "../ui/number-draft-input.js";
9
- import { useAddendumO2M as be, useAddendumView as fe } from "./AddendumFieldContext.js";
10
- import { useO2MStaging as ye } from "./O2MStagingContext.js";
11
- const ge = /* @__PURE__ */ new Set([
6
+ import { getActiveLayout as ce, get as W, patch as pe, del as ue, post as me } from "../../lib/commands.js";
7
+ import { titleCase as Y, cn as xe, toLocalDateString as he } from "../../lib/utils.js";
8
+ import { NumberDraftInput as be } from "../ui/number-draft-input.js";
9
+ import { useAddendumO2M as fe, useAddendumView as ye } from "./AddendumFieldContext.js";
10
+ import { useO2MStaging as ge } from "./O2MStagingContext.js";
11
+ const Ne = /* @__PURE__ */ new Set([
12
12
  "alias",
13
13
  "o2m",
14
14
  "m2m",
@@ -16,7 +16,7 @@ const ge = /* @__PURE__ */ new Set([
16
16
  "presentation",
17
17
  "group",
18
18
  "divider"
19
- ]), Ie = de(function({
19
+ ]), Ke = de(function({
20
20
  relatedCollection: l,
21
21
  manyField: c,
22
22
  parentId: m,
@@ -24,21 +24,21 @@ const ge = /* @__PURE__ */ new Set([
24
24
  parentFieldKey: Z,
25
25
  emptyLabel: q
26
26
  }) {
27
- var H;
28
- const f = oe(), P = ae(), x = ye(), d = m === "new", B = be()[Z ?? ""] ?? [], [S, C] = k(null), [Q, _] = k({}), [E, w] = k(!1), [R, y] = k({}), [g, $] = k(!1), N = fe(), { data: u } = V({
27
+ var z;
28
+ const f = oe(), P = ae(), x = ge(), d = m === "new", B = fe()[Z ?? ""] ?? [], [S, C] = k(null), [Q, _] = k({}), [E, w] = k(!1), [R, y] = k({}), [g, $] = k(!1), N = ye(), { data: u } = V({
29
29
  queryKey: ["active-layout", l, b ?? null],
30
30
  queryFn: () => f.request(
31
- Y("/collection-layouts/active", {
31
+ ce({
32
32
  collection: l,
33
33
  ...b ? { slug: b } : {}
34
34
  })
35
35
  ).then((e) => e.data).catch(() => null),
36
36
  staleTime: 6e4,
37
37
  enabled: !!b
38
- }), T = b ? ((H = u == null ? void 0 : u.layout) == null ? void 0 : H.id) ?? null : null, { data: ee = [] } = V({
38
+ }), T = b ? ((z = u == null ? void 0 : u.layout) == null ? void 0 : z.id) ?? null : null, { data: ee = [] } = V({
39
39
  queryKey: ["field-config", l, T],
40
40
  queryFn: () => f.request(
41
- Y(
41
+ W(
42
42
  `/field-config/${l}`,
43
43
  T ? { layout_id: String(T) } : void 0
44
44
  )
@@ -48,19 +48,19 @@ const ge = /* @__PURE__ */ new Set([
48
48
  }), { data: v = [], isLoading: te } = V({
49
49
  queryKey: ["o2m-rows", l, c, m],
50
50
  queryFn: () => f.request(
51
- Y(`/items/${l}`, {
51
+ W(`/items/${l}`, {
52
52
  filter: JSON.stringify({ [c]: { _eq: m } }),
53
53
  limit: 200
54
54
  })
55
55
  ).then((e) => e.data ?? []),
56
56
  enabled: !d,
57
57
  staleTime: 3e4
58
- }), J = d && x ? x.getPendingRows(l, c) : [], o = ee.filter(
59
- (e) => !e.hidden && !ge.has(e.type) && e.field !== c && e.field !== "id"
60
- ), A = W(
58
+ }), G = d && x ? x.getPendingRows(l, c) : [], o = ee.filter(
59
+ (e) => !e.hidden && !Ne.has(e.type) && e.field !== c && e.field !== "id"
60
+ ), A = U(
61
61
  () => ((u == null ? void 0 : u.groups) ?? []).filter((e) => e.type === "section").sort((e, r) => e.sort - r.sort),
62
62
  [u]
63
- ), h = W(() => {
63
+ ), h = U(() => {
64
64
  if (!A.length) return null;
65
65
  const e = /* @__PURE__ */ new Map();
66
66
  for (const r of o) {
@@ -69,16 +69,16 @@ const ge = /* @__PURE__ */ new Set([
69
69
  }
70
70
  return e;
71
71
  }, [o, A]);
72
- async function X(e) {
72
+ async function J(e) {
73
73
  $(!0);
74
74
  try {
75
- await f.request(ce(`/items/${l}/${e}`, Q)), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), C(null);
75
+ await f.request(pe(`/items/${l}/${e}`, Q)), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), C(null);
76
76
  } catch {
77
77
  } finally {
78
78
  $(!1);
79
79
  }
80
80
  }
81
- async function z() {
81
+ async function L() {
82
82
  if (d && x) {
83
83
  x.queueRow(l, c, { ...R }), w(!1), y({});
84
84
  return;
@@ -86,7 +86,7 @@ const ge = /* @__PURE__ */ new Set([
86
86
  $(!0);
87
87
  try {
88
88
  await f.request(
89
- ue(`/items/${l}`, { ...R, [c]: m })
89
+ me(`/items/${l}`, { ...R, [c]: m })
90
90
  ), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), w(!1), y({});
91
91
  } catch {
92
92
  } finally {
@@ -95,7 +95,7 @@ const ge = /* @__PURE__ */ new Set([
95
95
  }
96
96
  async function re(e) {
97
97
  try {
98
- await f.request(pe(`/items/${l}/${e}`)), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] });
98
+ await f.request(ue(`/items/${l}/${e}`)), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] });
99
99
  } catch {
100
100
  }
101
101
  }
@@ -105,7 +105,7 @@ const ge = /* @__PURE__ */ new Set([
105
105
  return /* @__PURE__ */ t("span", { className: r ? "text-emerald-600" : "text-slate-400", children: r ? "Yes" : "No" });
106
106
  if (e.type === "datetime" || e.type === "date")
107
107
  try {
108
- return /* @__PURE__ */ t("span", { children: xe(r) });
108
+ return /* @__PURE__ */ t("span", { children: he(r) });
109
109
  } catch {
110
110
  }
111
111
  return /* @__PURE__ */ t("span", { className: "truncate", children: String(r) });
@@ -121,7 +121,7 @@ const ge = /* @__PURE__ */ new Set([
121
121
  className: "h-4 w-4"
122
122
  }
123
123
  ) : e.type === "integer" || e.type === "bigInteger" || e.type === "float" || e.type === "decimal" ? /* @__PURE__ */ t(
124
- he,
124
+ be,
125
125
  {
126
126
  bare: !0,
127
127
  type: "number",
@@ -155,7 +155,7 @@ const ge = /* @__PURE__ */ new Set([
155
155
  }
156
156
  );
157
157
  }
158
- function F(e, r, n, s, i) {
158
+ function X(e, r, n, s, i) {
159
159
  const j = (h == null ? void 0 : h.get(null)) ?? [];
160
160
  return /* @__PURE__ */ a("div", { className: "border border-slate-200 rounded-lg bg-white overflow-hidden", children: [
161
161
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 bg-slate-50", children: [
@@ -184,7 +184,7 @@ const ge = /* @__PURE__ */ new Set([
184
184
  ] }),
185
185
  /* @__PURE__ */ a("div", { className: "p-3 space-y-4", children: [
186
186
  j.length > 0 && /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2", children: j.map((p) => /* @__PURE__ */ a("div", { children: [
187
- /* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: p.label ?? G(p.field) }),
187
+ /* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: p.label ?? Y(p.field) }),
188
188
  K(p, e, r)
189
189
  ] }, p.field)) }),
190
190
  A.map((p) => {
@@ -192,7 +192,7 @@ const ge = /* @__PURE__ */ new Set([
192
192
  return D.length ? /* @__PURE__ */ a("div", { children: [
193
193
  /* @__PURE__ */ t("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-slate-400 mb-2 pb-1 border-b border-slate-100", children: p.label }),
194
194
  /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2", children: D.map((M) => /* @__PURE__ */ a("div", { children: [
195
- /* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: M.label ?? G(M.field) }),
195
+ /* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: M.label ?? Y(M.field) }),
196
196
  K(M, e, r)
197
197
  ] }, M.field)) })
198
198
  ] }, p.key) : null;
@@ -205,7 +205,7 @@ const ge = /* @__PURE__ */ new Set([
205
205
  }
206
206
  if (!d && te)
207
207
  return /* @__PURE__ */ t("div", { className: "py-3 text-center text-[12px] text-slate-400", children: /* @__PURE__ */ t(ie, { className: "h-4 w-4 animate-spin inline" }) });
208
- const se = d ? J : v, O = !!h && A.length > 0;
208
+ const se = d ? G : v, O = !!h && A.length > 0;
209
209
  return (
210
210
  // The flat grid shows every displayable child column (a wide legacy table
211
211
  // has dozens) — it scrolls inside its card rather than running off a
@@ -218,14 +218,14 @@ const ge = /* @__PURE__ */ new Set([
218
218
  "th",
219
219
  {
220
220
  className: "px-3 py-2 text-left font-medium text-slate-500 text-[11px]",
221
- children: e.label ?? G(e.field)
221
+ children: e.label ?? Y(e.field)
222
222
  },
223
223
  e.field
224
224
  )),
225
225
  /* @__PURE__ */ t("th", { className: "w-16" })
226
226
  ] }) }),
227
227
  /* @__PURE__ */ a("tbody", { children: [
228
- d && J.map((e, r) => /* @__PURE__ */ a("tr", { className: "border-b border-slate-100 bg-amber-50/40", children: [
228
+ d && G.map((e, r) => /* @__PURE__ */ a("tr", { className: "border-b border-slate-100 bg-amber-50/40", children: [
229
229
  /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: /* @__PURE__ */ t("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Pending" }) }),
230
230
  o.map((n) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600", children: I(n, e[n.field]) }, n.field)),
231
231
  /* @__PURE__ */ t("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ t(
@@ -234,7 +234,7 @@ const ge = /* @__PURE__ */ new Set([
234
234
  type: "button",
235
235
  onClick: () => x == null ? void 0 : x.removeRow(l, c, r),
236
236
  className: "rounded p-0.5 text-slate-400 hover:text-red-500",
237
- children: /* @__PURE__ */ t(U, { className: "h-3 w-3" })
237
+ children: /* @__PURE__ */ t(H, { className: "h-3 w-3" })
238
238
  }
239
239
  ) })
240
240
  ] }, r)),
@@ -243,7 +243,7 @@ const ge = /* @__PURE__ */ new Set([
243
243
  return /* @__PURE__ */ a(
244
244
  "tr",
245
245
  {
246
- className: me(
246
+ className: xe(
247
247
  "border-b border-slate-100",
248
248
  r % 2 === 0 ? "bg-white" : "bg-slate-50/50"
249
249
  ),
@@ -253,13 +253,13 @@ const ge = /* @__PURE__ */ new Set([
253
253
  Q,
254
254
  (j, p) => _((D) => ({ ...D, [j]: p }))
255
255
  ) : I(i, e[i.field]) }, i.field)),
256
- /* @__PURE__ */ t("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-1 justify-end", children: s ? /* @__PURE__ */ a(L, { children: [
256
+ /* @__PURE__ */ t("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-1 justify-end", children: s ? /* @__PURE__ */ a(F, { children: [
257
257
  /* @__PURE__ */ t(
258
258
  "button",
259
259
  {
260
260
  type: "button",
261
261
  disabled: g,
262
- onClick: () => X(n),
262
+ onClick: () => J(n),
263
263
  className: "rounded px-1.5 py-0.5 bg-nvr-cyan text-white text-[11px] font-medium hover:brightness-110 disabled:opacity-50",
264
264
  children: g ? "…" : "Save"
265
265
  }
@@ -273,7 +273,7 @@ const ge = /* @__PURE__ */ new Set([
273
273
  children: "Cancel"
274
274
  }
275
275
  )
276
- ] }) : /* @__PURE__ */ a(L, { children: [
276
+ ] }) : /* @__PURE__ */ a(F, { children: [
277
277
  /* @__PURE__ */ t(
278
278
  "button",
279
279
  {
@@ -291,7 +291,7 @@ const ge = /* @__PURE__ */ new Set([
291
291
  type: "button",
292
292
  onClick: () => re(e.id),
293
293
  className: "rounded p-0.5 text-slate-400 hover:text-red-500",
294
- children: /* @__PURE__ */ t(U, { className: "h-3 w-3" })
294
+ children: /* @__PURE__ */ t(H, { className: "h-3 w-3" })
295
295
  }
296
296
  )
297
297
  ] }) }) })
@@ -333,7 +333,7 @@ const ge = /* @__PURE__ */ new Set([
333
333
  {
334
334
  type: "button",
335
335
  disabled: g,
336
- onClick: z,
336
+ onClick: L,
337
337
  className: "rounded px-1.5 py-0.5 bg-nvr-cyan text-white text-[11px] font-medium hover:brightness-110 disabled:opacity-50",
338
338
  children: g ? "…" : "Add"
339
339
  }
@@ -361,17 +361,17 @@ const ge = /* @__PURE__ */ new Set([
361
361
  ) })
362
362
  ] })
363
363
  ] }),
364
- S && O && (v.find((r) => String(r.id) === S) ? /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3", children: F(
364
+ S && O && (v.find((r) => String(r.id) === S) ? /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3", children: X(
365
365
  Q,
366
366
  (r, n) => _((s) => ({ ...s, [r]: n })),
367
- () => X(S),
367
+ () => J(S),
368
368
  () => C(null),
369
369
  "Edit Row"
370
370
  ) }) : null),
371
- E && O && /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3", children: F(
371
+ E && O && /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3", children: X(
372
372
  R,
373
373
  (e, r) => y((n) => ({ ...n, [e]: r })),
374
- z,
374
+ L,
375
375
  () => {
376
376
  w(!1), y({});
377
377
  },
@@ -390,5 +390,5 @@ const ge = /* @__PURE__ */ new Set([
390
390
  );
391
391
  });
392
392
  export {
393
- Ie as InlineGridField
393
+ Ke as InlineGridField
394
394
  };