@nivaro/react 0.3.110 → 0.3.112

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 +170 -2
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3097 -2972
  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/TipLayer.js +61 -54
  10. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  11. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  12. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  13. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  14. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  15. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  16. package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
  17. package/dist/shared/components/cbv/column-totals.js +66 -0
  18. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  19. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  20. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  21. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  22. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  23. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  24. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  25. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  26. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  27. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  28. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  29. package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
  30. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  31. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  32. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  33. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  34. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  35. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  36. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  37. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  38. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  39. package/dist/shared/components/item-edit/grid-search.js +345 -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/BlockedMove.js +73 -0
  48. package/dist/shared/components/panels/CommentPanel.js +265 -252
  49. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  50. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  51. package/dist/shared/components/panels/PipelinePanel.js +1573 -1475
  52. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  53. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  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
@@ -1,36 +1,37 @@
1
- import { useQueryClient as B } from "@tanstack/react-query";
2
- import { useState as d, useRef as F, useEffect as G, useCallback as x } from "react";
3
- import { useNivaroClient as H } from "../../context.js";
4
- import { get as J, patch as L } from "../../lib/commands.js";
5
- import { useUnsavedWork as M } from "../../lib/unsaved-work.js";
6
- import { quickFiltersEqual as V, quickFilterProblems as X, cleanQuickFilters as Y, mergeQuickFilters as _ } from "./config.js";
7
- let Z = 0;
8
- const T = () => `qf${++Z}`;
9
- function oe({
1
+ import { useQueryClient as z } from "@tanstack/react-query";
2
+ import { useState as d, useRef as F, useEffect as B, useCallback as x } from "react";
3
+ import { useNivaroClient as G } from "../../context.js";
4
+ import { get as H, patch as J } from "../../lib/commands.js";
5
+ import { queryKeys as L } from "../../lib/query-keys.js";
6
+ import { useUnsavedWork as V } from "../../lib/unsaved-work.js";
7
+ import { quickFiltersEqual as X, quickFilterProblems as Y, cleanQuickFilters as Z, mergeQuickFilters as _ } from "./config.js";
8
+ let A = 0;
9
+ const T = () => `qf${++A}`;
10
+ function ie({
10
11
  collection: m,
11
- filters: b,
12
- onApplied: y
12
+ filters: v,
13
+ onApplied: b
13
14
  }) {
14
- const u = B(), q = H(), [C, k] = d(!1), [g, a] = d([]), [h, l] = d("idle"), [j, Q] = d(null), [D, f] = d(null), [N, w] = d(!1), p = F([]), v = F(null);
15
- G(
15
+ const u = z(), Q = G(), [C, k] = d(!1), [g, a] = d([]), [h, l] = d("idle"), [j, p] = d(null), [D, f] = d(null), [N, w] = d(!1), q = F([]), y = F(null);
16
+ B(
16
17
  () => () => {
17
- v.current && window.clearTimeout(v.current);
18
+ y.current && window.clearTimeout(y.current);
18
19
  },
19
20
  []
20
21
  );
21
- const I = g.map((e) => e.def), E = C && !V(I, p.current), $ = g.filter((e) => X(e.def, I).length > 0).length;
22
- M(E, "Quick filter changes");
23
- const O = x(
22
+ const I = g.map((e) => e.def), E = C && !X(I, q.current), $ = g.filter((e) => Y(e.def, I).length > 0).length;
23
+ V(E, "Quick filter changes");
24
+ const K = x(
24
25
  (e = {}) => {
25
- p.current = b, a(b.map((r) => ({ id: T(), def: { ...r }, isNew: !1 }))), k(!0), Q(null), l("idle"), f(null), w(!!e.adding || b.length === 0);
26
+ q.current = v, a(v.map((r) => ({ id: T(), def: { ...r }, isNew: !1 }))), k(!0), p(null), l("idle"), f(null), w(!!e.adding || v.length === 0);
26
27
  },
27
- [b]
28
- ), S = x(() => {
29
- k(!1), Q(null), f(null), w(!1), h === "error" && l("idle");
30
- }, [h]), K = (e) => {
28
+ [v]
29
+ ), O = x(() => {
30
+ k(!1), p(null), f(null), w(!1), h === "error" && l("idle");
31
+ }, [h]), S = (e) => {
31
32
  const r = T();
32
33
  a((t) => [...t, { id: r, def: e, isNew: !0 }]), w(!1), f(r);
33
- }, P = (e, r) => a(
34
+ }, M = (e, r) => a(
34
35
  (t) => t.map((n) => {
35
36
  if (n.id !== e) return n;
36
37
  const o = { ...n.def, ...r };
@@ -38,36 +39,36 @@ function oe({
38
39
  r[c] === void 0 && delete o[c];
39
40
  return { ...n, def: o };
40
41
  })
41
- ), R = (e) => {
42
+ ), P = (e) => {
42
43
  a((r) => r.filter((t) => t.id !== e)), D === e && f(null);
43
- }, U = (e, r) => a((t) => {
44
+ }, R = (e, r) => a((t) => {
44
45
  const n = t.findIndex((i) => i.id === e), o = n + r;
45
46
  if (n < 0 || o < 0 || o >= t.length) return t;
46
47
  const c = [...t], [s] = c.splice(n, 1);
47
48
  return c.splice(o, 0, s), c;
48
- }), W = (e, r) => a((t) => {
49
+ }), U = (e, r) => a((t) => {
49
50
  const n = t.findIndex((i) => i.id === e), o = t.findIndex((i) => i.id === r);
50
51
  if (n < 0 || o < 0 || n === o) return t;
51
52
  const c = [...t], [s] = c.splice(n, 1);
52
53
  return c.splice(o, 0, s), c;
53
- }), z = x(async () => {
54
+ }), W = x(async () => {
54
55
  var c;
55
- const e = Y(g.map((s) => s.def)), r = p.current, t = ["cbv-collection-meta", m], n = u.getQueryData(t);
56
+ const e = Z(g.map((s) => s.def)), r = q.current, t = ["cbv-collection-meta", m], n = u.getQueryData(t);
56
57
  u.setQueryData(
57
58
  t,
58
59
  (s) => s && { ...s, browser_config: _(s.browser_config, e) }
59
- ), k(!1), f(null), w(!1), Q(null), l("saving"), v.current && window.clearTimeout(v.current);
60
- const o = y == null ? void 0 : y(e, r);
60
+ ), k(!1), f(null), w(!1), p(null), l("saving"), y.current && window.clearTimeout(y.current);
61
+ const o = b == null ? void 0 : b(e, r);
61
62
  try {
62
- const s = await q.request(J(`/collections/${m}`)), i = _(((c = s.data) == null ? void 0 : c.browser_config) ?? null, e);
63
- await q.request(L(`/collections/${m}`, { browser_config: i })), p.current = e, u.setQueryData(t, {
63
+ const s = await Q.request(H(`/collections/${m}`)), i = _(((c = s.data) == null ? void 0 : c.browser_config) ?? null, e);
64
+ await Q.request(J(`/collections/${m}`, { browser_config: i })), q.current = e, u.setQueryData(t, {
64
65
  ...s.data ?? n ?? {},
65
66
  browser_config: i
66
- }), u.invalidateQueries({ queryKey: ["collection-meta", m] }), l("saved"), v.current = window.setTimeout(() => l("idle"), 3e3);
67
+ }), u.invalidateQueries({ queryKey: L.collectionMeta(m) }), l("saved"), y.current = window.setTimeout(() => l("idle"), 3e3);
67
68
  } catch (s) {
68
- u.setQueryData(t, n), o == null || o(), k(!0), l("error"), Q(s);
69
+ u.setQueryData(t, n), o == null || o(), k(!0), l("error"), p(s);
69
70
  }
70
- }, [q, m, g, y, u]);
71
+ }, [Q, m, g, b, u]);
71
72
  return {
72
73
  editing: C,
73
74
  draft: g,
@@ -80,16 +81,16 @@ function oe({
80
81
  setOpenId: f,
81
82
  adding: N,
82
83
  setAdding: w,
83
- start: O,
84
- cancel: S,
85
- add: K,
86
- update: P,
87
- remove: R,
88
- move: U,
89
- reorder: W,
90
- save: z
84
+ start: K,
85
+ cancel: O,
86
+ add: S,
87
+ update: M,
88
+ remove: P,
89
+ move: R,
90
+ reorder: U,
91
+ save: W
91
92
  };
92
93
  }
93
94
  export {
94
- oe as useQuickFilterEditing
95
+ ie as useQuickFilterEditing
95
96
  };
@@ -11,7 +11,8 @@ import { RelationCombobox as ee } from "../item-edit/RelationCombobox.js";
11
11
  import { SimpleSelect as F } from "../ui/SimpleSelect.js";
12
12
  import { Sheet as te, SheetContent as ae, SheetTitle as K, SheetDescription as R, SheetHeader as re } from "../ui/sheet.js";
13
13
  import { isSupportContextFile as b } from "./support-context.js";
14
- import { TicketTraffic as se } from "./TicketTraffic.js";
14
+ import { TicketSlowScreens as se } from "./TicketSlowScreens.js";
15
+ import { TicketTraffic as ne } from "./TicketTraffic.js";
15
16
  import { STATUS_TONE as P } from "./types.js";
16
17
  const D = [
17
18
  { value: "open", label: "Open" },
@@ -27,20 +28,20 @@ function k(s) {
27
28
  minute: "2-digit"
28
29
  }) : "";
29
30
  }
30
- function ne({ status: s, label: c }) {
31
+ function le({ status: s, label: d }) {
31
32
  var l;
32
33
  return /* @__PURE__ */ a(
33
34
  "span",
34
35
  {
35
36
  "data-ticket-status": s,
36
37
  className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${P[s] ?? P.open}`,
37
- children: c ?? ((l = D.find((i) => i.value === s)) == null ? void 0 : l.label) ?? s
38
+ children: d ?? ((l = D.find((i) => i.value === s)) == null ? void 0 : l.label) ?? s
38
39
  }
39
40
  );
40
41
  }
41
- function ve({
42
+ function we({
42
43
  ticketId: s,
43
- onOpenChange: c
44
+ onOpenChange: d
44
45
  }) {
45
46
  const l = G(), i = H(), { apiBase: Q } = M(), { urlFor: j, open: A } = J(), p = V(), [m, v] = q(""), [N, U] = q(null), o = Y(
46
47
  s != null && Number.isSafeInteger(s) && s > 0 ? `ticket:${s}` : null
@@ -68,7 +69,7 @@ function ve({
68
69
  mutationFn: () => l.request(C(`/support/tickets/${s}/claim`)),
69
70
  onSuccess: x,
70
71
  onError: h
71
- }), d = f({
72
+ }), c = f({
72
73
  mutationFn: (t) => l.request(X(`/support/tickets/${s}`, t)),
73
74
  onSuccess: x,
74
75
  onError: h
@@ -79,7 +80,7 @@ function ve({
79
80
  },
80
81
  onError: h
81
82
  });
82
- return /* @__PURE__ */ a(te, { open: s != null, onOpenChange: c, children: /* @__PURE__ */ a(
83
+ return /* @__PURE__ */ a(te, { open: s != null, onOpenChange: d, children: /* @__PURE__ */ a(
83
84
  ae,
84
85
  {
85
86
  side: "right",
@@ -95,7 +96,7 @@ function ve({
95
96
  "#",
96
97
  e.id
97
98
  ] }),
98
- /* @__PURE__ */ a(ne, { status: e.status, label: e.status_label }),
99
+ /* @__PURE__ */ a(le, { status: e.status, label: e.status_label }),
99
100
  e.priority === "urgent" && /* @__PURE__ */ a("span", { className: "rounded bg-red-500/10 px-1.5 py-px text-[10px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" })
100
101
  ] }),
101
102
  /* @__PURE__ */ a(K, { className: "text-left text-[16px] font-semibold leading-snug text-slate-900 dark:text-slate-100", children: e.title }),
@@ -179,7 +180,7 @@ function ve({
179
180
  F,
180
181
  {
181
182
  value: e.status,
182
- onChange: (t) => d.mutate({ status: t }),
183
+ onChange: (t) => c.mutate({ status: t }),
183
184
  options: D,
184
185
  ariaLabel: "Status",
185
186
  className: "mt-1"
@@ -192,7 +193,7 @@ function ve({
192
193
  F,
193
194
  {
194
195
  value: e.category_id != null ? String(e.category_id) : "",
195
- onChange: (t) => d.mutate({ category_id: t ? Number(t) : null }),
196
+ onChange: (t) => c.mutate({ category_id: t ? Number(t) : null }),
196
197
  options: [
197
198
  { value: "", label: "No type" },
198
199
  ...O.map((t) => ({ value: String(t.id), label: t.name }))
@@ -209,7 +210,7 @@ function ve({
209
210
  {
210
211
  collection: "nivaro_users",
211
212
  value: e.assignee,
212
- onChange: (t) => d.mutate({ assignee: t ? String(t) : null }),
213
+ onChange: (t) => c.mutate({ assignee: t ? String(t) : null }),
213
214
  placeholder: "Nobody yet"
214
215
  }
215
216
  ) })
@@ -272,7 +273,15 @@ function ve({
272
273
  ) }, n.id)) });
273
274
  })()
274
275
  ] }),
275
- e.can.work && /* @__PURE__ */ a(se, { ticketId: e.id }),
276
+ e.can.work && /* @__PURE__ */ a(ne, { ticketId: e.id }),
277
+ /* @__PURE__ */ a(
278
+ se,
279
+ {
280
+ userId: e.created_by,
281
+ name: e.requester_name,
282
+ text: `${e.title} ${e.description ?? ""}`
283
+ }
284
+ ),
276
285
  /* @__PURE__ */ r("section", { "data-ticket-thread": !0, children: [
277
286
  /* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Conversation" }),
278
287
  e.thread.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No replies yet." }) : /* @__PURE__ */ a("ul", { className: "space-y-2.5", children: e.thread.map((t) => /* @__PURE__ */ r(
@@ -328,7 +337,7 @@ function ve({
328
337
  {
329
338
  type: "button",
330
339
  "data-ticket-cancel": !0,
331
- onClick: () => d.mutate({ status: "cancelled" }),
340
+ onClick: () => c.mutate({ status: "cancelled" }),
332
341
  className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
333
342
  children: "Withdraw request"
334
343
  }
@@ -338,7 +347,7 @@ function ve({
338
347
  {
339
348
  type: "button",
340
349
  "data-ticket-reopen": !0,
341
- onClick: () => d.mutate({ status: "open" }),
350
+ onClick: () => c.mutate({ status: "open" }),
342
351
  className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
343
352
  children: "Reopen"
344
353
  }
@@ -378,6 +387,6 @@ function ve({
378
387
  ) });
379
388
  }
380
389
  export {
381
- ne as StatusPill,
382
- ve as TicketDetailSheet
390
+ le as StatusPill,
391
+ we as TicketDetailSheet
383
392
  };
@@ -0,0 +1,32 @@
1
+ import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
+ import { Gauge as a } from "lucide-react";
3
+ import { useState as m } from "react";
4
+ import { useItemEditAuth as p } from "../../context.js";
5
+ import { SlowScreensCard as d, looksLikeSlowness as f } from "../profile/SlowScreensCard.js";
6
+ function v({
7
+ userId: r,
8
+ name: t,
9
+ text: i
10
+ }) {
11
+ const e = p(), n = f(i), [c, l] = m(n);
12
+ if (!(e != null && e.isAdmin) || !r) return null;
13
+ const o = (t == null ? void 0 : t.split(" ")[0]) ?? null;
14
+ return c ? /* @__PURE__ */ s("div", { "data-ticket-slow-screens": n ? "auto" : "asked", children: /* @__PURE__ */ s(d, { userId: r, name: o, compact: !0 }) }) : /* @__PURE__ */ u(
15
+ "button",
16
+ {
17
+ type: "button",
18
+ onClick: () => l(!0),
19
+ "data-ticket-slow-screens-open": !0,
20
+ className: "inline-flex items-center gap-1.5 text-[12px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
21
+ children: [
22
+ /* @__PURE__ */ s(a, { className: "h-3.5 w-3.5" }),
23
+ "Show ",
24
+ o ? `${o}’s` : "their",
25
+ " slowest screens"
26
+ ]
27
+ }
28
+ );
29
+ }
30
+ export {
31
+ v as TicketSlowScreens
32
+ };