@nivaro/react 0.3.111 → 0.3.113

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 (77) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +207 -3
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3133 -2954
  6. package/dist/shared/components/CollectionImportBanner.js +135 -0
  7. package/dist/shared/components/ItemEditForm.js +2235 -2218
  8. package/dist/shared/components/JobsTray.js +54 -47
  9. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  10. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  11. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  12. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  14. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  15. package/dist/shared/components/cbv/ColumnHeaderMenu.js +130 -0
  16. package/dist/shared/components/cbv/column-totals.js +163 -0
  17. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  18. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  19. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  20. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  21. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  22. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  23. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  24. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  25. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  26. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  27. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  28. package/dist/shared/components/item-edit/InlineTableField.js +3002 -2825
  29. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  30. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  31. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  32. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  33. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  34. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  35. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  36. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  37. package/dist/shared/components/item-edit/UserChip.js +262 -239
  38. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  39. package/dist/shared/components/item-edit/grid-search.js +375 -0
  40. package/dist/shared/components/item-edit/render-stability.js +61 -54
  41. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  42. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  43. package/dist/shared/components/ops-report/drill.js +97 -97
  44. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  45. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  46. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  47. package/dist/shared/components/panels/CommentPanel.js +265 -252
  48. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  49. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  50. package/dist/shared/components/panels/PipelinePanel.js +1440 -1397
  51. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  52. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  53. package/dist/shared/components/panels/StandInReason.js +69 -0
  54. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  55. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  56. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  57. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  58. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  59. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  60. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  61. package/dist/shared/components/profile/PersonHeader.js +29 -29
  62. package/dist/shared/components/profile/PersonProfile.js +30 -28
  63. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  64. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  65. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  66. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  67. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  68. package/dist/shared/lib/activity-sentence.js +224 -178
  69. package/dist/shared/lib/collection-import-banner.js +27 -0
  70. package/dist/shared/lib/crash-report.js +112 -0
  71. package/dist/shared/lib/export-runs.js +99 -0
  72. package/dist/shared/lib/jobs-tray.js +89 -67
  73. package/dist/shared/lib/list-link.js +76 -69
  74. package/dist/shared/lib/nav-trail.js +180 -76
  75. package/dist/shared/lib/query-keys.js +26 -0
  76. package/dist/shared/lib/view-as.js +16 -11
  77. package/package.json +1 -1
@@ -0,0 +1,69 @@
1
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
+ import { ArrowUpRight as u } from "lucide-react";
3
+ import { useNavigation as h } from "../../context.js";
4
+ import { cn as c } from "../../lib/utils.js";
5
+ function y(e) {
6
+ return new Set(((e == null ? void 0 : e.people) ?? []).map((i) => String(i.id).toUpperCase()));
7
+ }
8
+ function g({ className: e }) {
9
+ return /* @__PURE__ */ a(
10
+ "span",
11
+ {
12
+ "data-stand-in-mark": "",
13
+ className: c(
14
+ "shrink-0 rounded border border-slate-300 px-1 text-[10px] font-medium leading-tight text-slate-500 dark:border-slate-600 dark:text-slate-400",
15
+ e
16
+ ),
17
+ "data-tip": "Nobody is assigned to this step. The record is in their queue, but only the step’s owners can move it.",
18
+ children: "stand-in"
19
+ }
20
+ );
21
+ }
22
+ function v({
23
+ reason: e,
24
+ className: i,
25
+ onNavigate: s
26
+ }) {
27
+ const r = h(), d = e.why_unassigned.values ?? [], n = e.matrix_href ? r.consoleUrl ? r.consoleUrl(e.matrix_href) : e.matrix_href : null, l = !!n && /^https?:\/\//.test(n);
28
+ return /* @__PURE__ */ o(
29
+ "div",
30
+ {
31
+ "data-owners-stand-in": e.why_unassigned.kind,
32
+ className: c("space-y-0.5 text-[11.5px] leading-snug", i),
33
+ children: [
34
+ /* @__PURE__ */ a(
35
+ "p",
36
+ {
37
+ className: "text-slate-600 dark:text-slate-300",
38
+ "data-stand-in-why": "unassigned",
39
+ "data-tip": d.length > 0 ? d.map((t) => `${t.label}: ${t.value}`).join(" · ") : void 0,
40
+ children: e.why_unassigned.sentence
41
+ }
42
+ ),
43
+ /* @__PURE__ */ a("p", { className: "text-slate-500 dark:text-slate-400", "data-stand-in-why": "person", children: e.why_this_person.sentence }),
44
+ e.detail && /* @__PURE__ */ a("p", { className: "text-slate-500 dark:text-slate-400", "data-stand-in-why": "detail", children: e.detail }),
45
+ n && /* @__PURE__ */ o(
46
+ "a",
47
+ {
48
+ href: n,
49
+ ...l ? { target: "_blank", rel: "noreferrer" } : {},
50
+ onClick: (t) => {
51
+ s == null || s(), !(l || t.metaKey || t.ctrlKey || t.shiftKey) && (t.preventDefault(), r.navigate(n));
52
+ },
53
+ "data-stand-in-matrix": "",
54
+ className: "inline-flex items-center gap-0.5 rounded pt-0.5 font-medium text-nvr-navy underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:text-nvr-cyan",
55
+ children: [
56
+ "Open owner matrix",
57
+ /* @__PURE__ */ a(u, { className: "h-3 w-3", "aria-hidden": !0 })
58
+ ]
59
+ }
60
+ )
61
+ ]
62
+ }
63
+ );
64
+ }
65
+ export {
66
+ g as StandInMark,
67
+ v as StandInReasonLines,
68
+ y as standInIds
69
+ };
@@ -1,13 +1,14 @@
1
1
  import { jsx as l, jsxs as m } from "react/jsx-runtime";
2
- import { useQuery as P } from "@tanstack/react-query";
3
- import { Loader2 as q, ChevronRight as F, X as $, Search as R } from "lucide-react";
4
- import { useState as k, useRef as E, useLayoutEffect as z, useEffect as K } from "react";
5
- import { createPortal as Q } from "react-dom";
6
- import { useNivaroClient as M } from "../../context.js";
2
+ import { useQuery as q } from "@tanstack/react-query";
3
+ import { Loader2 as E, ChevronRight as P, X as R, Search as z } from "lucide-react";
4
+ import { useState as k, useRef as M, useLayoutEffect as K, useEffect as Q } from "react";
5
+ import { createPortal as T } from "react-dom";
6
+ import { useNivaroClient as F } from "../../context.js";
7
7
  import { get as O } from "../../lib/commands.js";
8
+ import { queryKeys as S } from "../../lib/query-keys.js";
8
9
  import { titleCase as _ } from "../../lib/utils.js";
9
- import { Popover as T, PopoverTrigger as B, PopoverContent as H } from "../ui/popover.js";
10
- function W({
10
+ import { Popover as B, PopoverTrigger as H, PopoverContent as W } from "../ui/popover.js";
11
+ function X({
11
12
  collection: t,
12
13
  fields: u,
13
14
  relations: f,
@@ -17,12 +18,12 @@ function W({
17
18
  onClear: p,
18
19
  placeholder: r
19
20
  }) {
20
- const [i, n] = k(!1), [c, a] = k(""), b = E(null), y = E(null), [g, v] = k(null);
21
- z(() => {
21
+ const [i, n] = k(!1), [c, a] = k(""), y = M(null), b = M(null), [g, v] = k(null);
22
+ K(() => {
22
23
  if (!i) return;
23
24
  const o = () => {
24
25
  var N;
25
- const x = (N = b.current) == null ? void 0 : N.getBoundingClientRect();
26
+ const x = (N = y.current) == null ? void 0 : N.getBoundingClientRect();
26
27
  if (!x) return;
27
28
  const L = Math.min(x.left, window.innerWidth - 288 - 8), C = Math.min(x.bottom + 4, window.innerHeight - 60);
28
29
  v({ top: C, left: Math.max(8, L) });
@@ -30,12 +31,12 @@ function W({
30
31
  return o(), window.addEventListener("scroll", o, !0), window.addEventListener("resize", o), () => {
31
32
  window.removeEventListener("scroll", o, !0), window.removeEventListener("resize", o);
32
33
  };
33
- }, [i]), K(() => {
34
+ }, [i]), Q(() => {
34
35
  if (!i) return;
35
36
  const o = (x) => {
36
37
  var L, C, N;
37
38
  const w = x.target;
38
- (L = b.current) != null && L.contains(w) || (C = y.current) != null && C.contains(w) || (N = w.closest) != null && N.call(w, "[data-radix-popper-content-wrapper]") || n(!1);
39
+ (L = y.current) != null && L.contains(w) || (C = b.current) != null && C.contains(w) || (N = w.closest) != null && N.call(w, "[data-radix-popper-content-wrapper]") || n(!1);
39
40
  };
40
41
  return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
41
42
  }, [i]);
@@ -45,7 +46,7 @@ function W({
45
46
  "button",
46
47
  {
47
48
  type: "button",
48
- ref: b,
49
+ ref: y,
49
50
  onClick: () => n((o) => !o),
50
51
  className: `flex h-8 w-full items-center justify-between gap-1.5 rounded-md border border-slate-200 bg-white text-[13px] text-slate-700 hover:border-slate-300 ${d && p ? "pl-2.5 pr-8" : "px-2.5"}`,
51
52
  children: [
@@ -56,7 +57,7 @@ function W({
56
57
  children: h || d || r || "Select field…"
57
58
  }
58
59
  ),
59
- /* @__PURE__ */ l(F, { className: "h-3.5 w-3.5 text-slate-400 shrink-0" })
60
+ /* @__PURE__ */ l(P, { className: "h-3.5 w-3.5 text-slate-400 shrink-0" })
60
61
  ]
61
62
  }
62
63
  ),
@@ -68,19 +69,19 @@ function W({
68
69
  o.stopPropagation(), p();
69
70
  },
70
71
  className: "absolute right-2 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
71
- children: /* @__PURE__ */ l($, { className: "h-3 w-3" })
72
+ children: /* @__PURE__ */ l(R, { className: "h-3 w-3" })
72
73
  }
73
74
  ),
74
- i && g && Q(
75
+ i && g && T(
75
76
  /* @__PURE__ */ l(
76
77
  "div",
77
78
  {
78
- ref: y,
79
+ ref: b,
79
80
  style: { position: "fixed", top: g.top, left: g.left },
80
81
  className: "z-50 w-72 rounded-xl border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card",
81
82
  children: /* @__PURE__ */ m("div", { className: "p-2", children: [
82
83
  /* @__PURE__ */ m("div", { className: "relative mb-1.5", children: [
83
- /* @__PURE__ */ l(R, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
84
+ /* @__PURE__ */ l(z, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
84
85
  /* @__PURE__ */ l(
85
86
  "input",
86
87
  {
@@ -93,7 +94,7 @@ function W({
93
94
  ] }),
94
95
  /* @__PURE__ */ m("div", { className: "max-h-72 overflow-y-auto", children: [
95
96
  e.map((o) => /* @__PURE__ */ l(
96
- S,
97
+ $,
97
98
  {
98
99
  field: o,
99
100
  collection: t,
@@ -116,19 +117,19 @@ function W({
116
117
  )
117
118
  ] });
118
119
  }
119
- function X({
120
+ function A({
120
121
  relatedCollection: t,
121
122
  pathPrefix: u,
122
123
  labelPrefix: f,
123
124
  onSelect: d
124
125
  }) {
125
- const h = M(), { data: s, isLoading: p } = P({
126
- queryKey: ["collection-meta", t],
126
+ const h = F(), { data: s, isLoading: p } = q({
127
+ queryKey: S.collectionMeta(t),
127
128
  queryFn: () => h.request(O(`/collections/${t}`)).then((n) => n.data)
128
129
  });
129
130
  if (p)
130
131
  return /* @__PURE__ */ m("div", { className: "py-2 text-[12px] text-slate-400 flex items-center gap-2 px-2", children: [
131
- /* @__PURE__ */ l(q, { className: "h-3.5 w-3.5 animate-spin" }),
132
+ /* @__PURE__ */ l(E, { className: "h-3.5 w-3.5 animate-spin" }),
132
133
  "Loading…"
133
134
  ] });
134
135
  const r = [...((s == null ? void 0 : s.fields) ?? []).filter((n) => !n.hidden)].sort(
@@ -136,7 +137,7 @@ function X({
136
137
  ), i = (s == null ? void 0 : s.relations) ?? [];
137
138
  return /* @__PURE__ */ m("div", { className: "max-h-64 overflow-y-auto", children: [
138
139
  r.map((n) => /* @__PURE__ */ l(
139
- S,
140
+ $,
140
141
  {
141
142
  field: n,
142
143
  collection: t,
@@ -151,7 +152,7 @@ function X({
151
152
  r.length === 0 && /* @__PURE__ */ l("div", { className: "px-2 py-1.5 text-[12px] text-slate-400", children: "No fields" })
152
153
  ] });
153
154
  }
154
- function ee({
155
+ function ne({
155
156
  collection: t,
156
157
  value: u,
157
158
  valueLabel: f,
@@ -159,8 +160,8 @@ function ee({
159
160
  onClear: h,
160
161
  placeholder: s
161
162
  }) {
162
- const p = M(), { data: r, isLoading: i } = P({
163
- queryKey: ["collection-meta", t],
163
+ const p = F(), { data: r, isLoading: i } = q({
164
+ queryKey: S.collectionMeta(t),
164
165
  queryFn: () => p.request(O(`/collections/${t}`)).then((a) => a.data),
165
166
  enabled: !!t
166
167
  });
@@ -168,12 +169,12 @@ function ee({
168
169
  return /* @__PURE__ */ l("div", { className: "flex h-8 items-center rounded-md border border-slate-200 bg-slate-50 px-2.5 text-[12px] text-slate-400", children: "No collection bound" });
169
170
  if (i)
170
171
  return /* @__PURE__ */ m("div", { className: "flex h-8 items-center gap-2 rounded-md border border-slate-200 bg-slate-50 px-2.5 text-[12px] text-slate-400", children: [
171
- /* @__PURE__ */ l(q, { className: "h-3.5 w-3.5 animate-spin" }),
172
+ /* @__PURE__ */ l(E, { className: "h-3.5 w-3.5 animate-spin" }),
172
173
  "Loading fields…"
173
174
  ] });
174
175
  const n = ((r == null ? void 0 : r.fields) ?? []).filter((a) => !a.hidden), c = (r == null ? void 0 : r.relations) ?? [];
175
176
  return /* @__PURE__ */ l(
176
- W,
177
+ X,
177
178
  {
178
179
  collection: t,
179
180
  fields: n,
@@ -186,7 +187,7 @@ function ee({
186
187
  }
187
188
  );
188
189
  }
189
- function S({
190
+ function $({
190
191
  field: t,
191
192
  collection: u,
192
193
  relations: f,
@@ -201,13 +202,13 @@ function S({
201
202
  (e) => e.many_collection === u && e.many_field === t.field && e.junction_field !== null && e.one_collection
202
203
  ) ?? null, a = !n && !c ? f.find(
203
204
  (e) => e.one_collection === u && e.one_field === t.field && e.junction_field !== null && e.many_collection
204
- ) ?? null : null, b = c ?? a, y = !n && !b ? f.find(
205
+ ) ?? null : null, y = c ?? a, b = !n && !y ? f.find(
205
206
  (e) => e.one_collection === u && e.one_field === t.field && e.junction_field === null && e.many_collection
206
207
  ) ?? null : null, g = a ? f.find(
207
208
  (e) => e.many_collection === a.many_collection && e.many_field === a.junction_field && e.one_collection
208
- ) ?? null : null, v = (n == null ? void 0 : n.one_collection) ?? (c == null ? void 0 : c.one_collection) ?? (g == null ? void 0 : g.one_collection) ?? (a == null ? void 0 : a.many_collection) ?? (y == null ? void 0 : y.many_collection) ?? null, j = n ? "M2O" : b ? "M2M" : y ? "O2M" : null;
209
- return v ? /* @__PURE__ */ m(T, { open: r, onOpenChange: i, children: [
210
- /* @__PURE__ */ l(B, { asChild: !0, children: /* @__PURE__ */ m(
209
+ ) ?? null : null, v = (n == null ? void 0 : n.one_collection) ?? (c == null ? void 0 : c.one_collection) ?? (g == null ? void 0 : g.one_collection) ?? (a == null ? void 0 : a.many_collection) ?? (b == null ? void 0 : b.many_collection) ?? null, j = n ? "M2O" : y ? "M2M" : b ? "O2M" : null;
210
+ return v ? /* @__PURE__ */ m(B, { open: r, onOpenChange: i, children: [
211
+ /* @__PURE__ */ l(H, { asChild: !0, children: /* @__PURE__ */ m(
211
212
  "button",
212
213
  {
213
214
  type: "button",
@@ -216,12 +217,12 @@ function S({
216
217
  children: [
217
218
  /* @__PURE__ */ l("span", { className: "flex-1", children: _(t.field) }),
218
219
  j && /* @__PURE__ */ l("span", { className: "rounded px-1 py-0.5 text-[10px] font-medium bg-slate-100 text-slate-500", children: j }),
219
- /* @__PURE__ */ l(F, { className: "h-3.5 w-3.5 text-slate-400 shrink-0" })
220
+ /* @__PURE__ */ l(P, { className: "h-3.5 w-3.5 text-slate-400 shrink-0" })
220
221
  ]
221
222
  }
222
223
  ) }),
223
- /* @__PURE__ */ m(H, { side: "right", align: "start", sideOffset: 4, className: "w-56 p-1", children: [
224
- (n || b) && /* @__PURE__ */ l(
224
+ /* @__PURE__ */ m(W, { side: "right", align: "start", sideOffset: 4, className: "w-56 p-1", children: [
225
+ (n || y) && /* @__PURE__ */ l(
225
226
  "button",
226
227
  {
227
228
  type: "button",
@@ -238,7 +239,7 @@ function S({
238
239
  }
239
240
  ),
240
241
  /* @__PURE__ */ l(
241
- X,
242
+ A,
242
243
  {
243
244
  relatedCollection: v,
244
245
  pathPrefix: [...d, t.field],
@@ -266,6 +267,6 @@ function S({
266
267
  );
267
268
  }
268
269
  export {
269
- ee as CollectionFieldPicker,
270
- W as FieldPicker
270
+ ne as CollectionFieldPicker,
271
+ X as FieldPicker
271
272
  };