@nivaro/react 0.3.111 → 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 (75) 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/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 +113 -0
  16. package/dist/shared/components/cbv/column-totals.js +66 -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 +3064 -2882
  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/ViewAsRole.js +129 -52
  38. package/dist/shared/components/item-edit/grid-search.js +345 -0
  39. package/dist/shared/components/item-edit/render-stability.js +61 -54
  40. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  41. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  42. package/dist/shared/components/ops-report/drill.js +97 -97
  43. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  44. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  45. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  46. package/dist/shared/components/panels/CommentPanel.js +265 -252
  47. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  48. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  49. package/dist/shared/components/panels/PipelinePanel.js +1529 -1492
  50. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  51. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  52. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  53. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  54. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  55. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  56. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  57. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  58. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  59. package/dist/shared/components/profile/PersonHeader.js +29 -29
  60. package/dist/shared/components/profile/PersonProfile.js +30 -28
  61. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  62. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  63. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  64. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  65. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  66. package/dist/shared/lib/activity-sentence.js +224 -178
  67. package/dist/shared/lib/collection-import-banner.js +27 -0
  68. package/dist/shared/lib/crash-report.js +112 -0
  69. package/dist/shared/lib/export-runs.js +99 -0
  70. package/dist/shared/lib/jobs-tray.js +89 -67
  71. package/dist/shared/lib/list-link.js +76 -69
  72. package/dist/shared/lib/nav-trail.js +180 -76
  73. package/dist/shared/lib/query-keys.js +26 -0
  74. package/dist/shared/lib/view-as.js +16 -11
  75. package/package.json +1 -1
@@ -4,10 +4,11 @@ import { useState as f, useMemo as J, useEffect as ee } from "react";
4
4
  import { useNivaroClient as W } from "../../context.js";
5
5
  import { get as G, post as q } from "../../lib/commands.js";
6
6
  import { useAfterIdle as te } from "../../lib/defer.js";
7
- import { hasRecordExtras as re } from "../../lib/system-collections.js";
8
- import { formatRelative as ne, formatDateTime as ae, cn as K, titleCase as ie } from "../../lib/utils.js";
9
- function de(t, r, a = !0) {
10
- const u = W(), i = a && re(t), { data: g } = S({
7
+ import { queryKeys as re } from "../../lib/query-keys.js";
8
+ import { hasRecordExtras as ne } from "../../lib/system-collections.js";
9
+ import { formatRelative as ae, formatDateTime as ie, cn as K, titleCase as de } from "../../lib/utils.js";
10
+ function oe(t, r, a = !0) {
11
+ const u = W(), i = a && ne(t), { data: p } = S({
11
12
  queryKey: ["record-integrity", t, r],
12
13
  enabled: i,
13
14
  queryFn: () => u.request(
@@ -25,9 +26,9 @@ function de(t, r, a = !0) {
25
26
  // mount / invalidation is the contract.
26
27
  refetchOnWindowFocus: !1
27
28
  });
28
- return { data: m ?? g, checking: k };
29
+ return { data: m ?? p, checking: k };
29
30
  }
30
- const oe = "nvr:own-record-writes";
31
+ const se = "nvr:own-record-writes";
31
32
  function H(t) {
32
33
  var a;
33
34
  const r = [];
@@ -39,15 +40,15 @@ function H(t) {
39
40
  }
40
41
  function Y(t) {
41
42
  t.length === 0 || typeof window > "u" || window.dispatchEvent(
42
- new CustomEvent(oe, { detail: { writes: t } })
43
+ new CustomEvent(se, { detail: { writes: t } })
43
44
  );
44
45
  }
45
- function se(t, r) {
46
+ function le(t, r) {
46
47
  var u;
47
48
  const a = r == null ? void 0 : r.find((i) => i.field === t);
48
- return ((u = a == null ? void 0 : a.label) == null ? void 0 : u.trim()) || ie(t);
49
+ return ((u = a == null ? void 0 : a.label) == null ? void 0 : u.trim()) || de(t);
49
50
  }
50
- function be(t) {
51
+ function ye(t) {
51
52
  const r = /* @__PURE__ */ new Map();
52
53
  for (const a of t ?? []) {
53
54
  const u = r.get(a.field) ?? [];
@@ -60,14 +61,14 @@ const z = {
60
61
  medium: { dot: "bg-amber-500", text: "Likely" },
61
62
  low: { dot: "bg-slate-400", text: "Manual" }
62
63
  };
63
- function ke({
64
+ function ve({
64
65
  collection: t,
65
66
  itemId: r,
66
67
  onJumpToField: a
67
68
  }) {
68
69
  var R;
69
- const u = W(), i = Z(), [g, h] = f(!1), [m, k] = f(null), { data: d, checking: E } = de(t, r), { data: y } = S({
70
- queryKey: ["field-config", t, null],
70
+ const u = W(), i = Z(), [p, h] = f(!1), [m, k] = f(null), { data: d, checking: E } = oe(t, r), { data: y } = S({
71
+ queryKey: re.fieldConfig(t, null),
71
72
  queryFn: () => u.request(G(`/field-config/${t}`)).then((l) => l.data ?? []),
72
73
  enabled: !!((R = d == null ? void 0 : d.findings) != null && R.length),
73
74
  staleTime: 6e4
@@ -108,10 +109,10 @@ function ke({
108
109
  {
109
110
  className: "text-[11px] text-amber-600/80 dark:text-amber-400/70",
110
111
  "data-integrity-checked": "stored",
111
- title: ae(d.checked_at),
112
+ title: ie(d.checked_at),
112
113
  children: [
113
114
  "checked ",
114
- ne(d.checked_at)
115
+ ae(d.checked_at)
115
116
  ]
116
117
  }
117
118
  ) : null,
@@ -121,11 +122,11 @@ function ke({
121
122
  type: "button",
122
123
  onClick: () => h((l) => !l),
123
124
  className: "ml-auto text-[11.5px] font-medium text-amber-700 underline decoration-dotted underline-offset-2 dark:text-amber-300",
124
- children: g ? "Hide" : "View"
125
+ children: p ? "Hide" : "View"
125
126
  }
126
127
  )
127
128
  ] }),
128
- g && /* @__PURE__ */ n("div", { className: "mt-1.5 space-y-1", children: d.findings.map((l, b) => /* @__PURE__ */ o("div", { children: [
129
+ p && /* @__PURE__ */ n("div", { className: "mt-1.5 space-y-1", children: d.findings.map((l, b) => /* @__PURE__ */ o("div", { children: [
129
130
  /* @__PURE__ */ o("div", { className: "flex items-baseline gap-2 text-[12px]", children: [
130
131
  /* @__PURE__ */ n(
131
132
  "button",
@@ -134,7 +135,7 @@ function ke({
134
135
  onClick: () => a == null ? void 0 : a(l.field),
135
136
  "data-integrity-field": l.field,
136
137
  className: "shrink-0 text-[11.5px] font-medium text-amber-700 underline decoration-dotted underline-offset-2 dark:text-amber-300",
137
- children: se(l.field, y)
138
+ children: le(l.field, y)
138
139
  }
139
140
  ),
140
141
  /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 text-amber-800 dark:text-amber-200/90", children: l.message }),
@@ -142,7 +143,7 @@ function ke({
142
143
  "button",
143
144
  {
144
145
  type: "button",
145
- onClick: () => k((p) => p === b ? null : b),
146
+ onClick: () => k((g) => g === b ? null : b),
146
147
  className: K(
147
148
  "shrink-0 rounded px-2 py-0.5 text-[10.5px] font-semibold transition-colors",
148
149
  m === b ? "bg-amber-200 text-amber-900 dark:bg-amber-400/30 dark:text-amber-100" : "bg-amber-600 text-white hover:bg-amber-700"
@@ -152,7 +153,7 @@ function ke({
152
153
  )
153
154
  ] }),
154
155
  m === b && /* @__PURE__ */ n(
155
- le,
156
+ ce,
156
157
  {
157
158
  collection: t,
158
159
  itemId: r,
@@ -166,26 +167,26 @@ function ke({
166
167
  }
167
168
  );
168
169
  }
169
- function le({
170
+ function ce({
170
171
  collection: t,
171
172
  itemId: r,
172
173
  finding: a,
173
174
  onApplied: u,
174
175
  onClose: i
175
176
  }) {
176
- const g = W(), h = `/config-conformance/record/${t}/${encodeURIComponent(r)}`, m = { field: a.field, rule: a.rule, message: a.message }, { data: k, isLoading: d, error: E } = S({
177
+ const p = W(), h = `/config-conformance/record/${t}/${encodeURIComponent(r)}`, m = { field: a.field, rule: a.rule, message: a.message }, { data: k, isLoading: d, error: E } = S({
177
178
  queryKey: ["integrity-proposals", t, r, a.field, a.rule],
178
- queryFn: () => g.request(q(`${h}/proposals`, m)).then((e) => e.data.proposals),
179
+ queryFn: () => p.request(q(`${h}/proposals`, m)).then((e) => e.data.proposals),
179
180
  staleTime: 6e4
180
- }), [y, L] = f([]), [v, R] = f({}), [l, b] = f(""), [p, M] = f(null), [j, D] = f(0), [T, N] = f(null), [B, X] = f(null), [_, O] = f(null), V = J(() => [...k ?? [], ...y], [k, y]);
181
+ }), [y, L] = f([]), [v, R] = f({}), [l, b] = f(""), [g, M] = f(null), [j, D] = f(0), [T, N] = f(null), [B, X] = f(null), [_, O] = f(null), V = J(() => [...k ?? [], ...y], [k, y]);
181
182
  ee(() => {
182
- if (!p || p.undo.length === 0) return;
183
+ if (!g || g.undo.length === 0) return;
183
184
  D(30);
184
185
  const e = setInterval(() => D((c) => c <= 1 ? 0 : c - 1), 1e3);
185
186
  return () => clearInterval(e);
186
- }, [p]);
187
+ }, [g]);
187
188
  const A = I({
188
- mutationFn: (e) => g.request(
189
+ mutationFn: (e) => p.request(
189
190
  q(`${h}/fix`, {
190
191
  ...m,
191
192
  proposal_id: e.id,
@@ -203,13 +204,13 @@ function le({
203
204
  },
204
205
  onError: (e) => N(F(e))
205
206
  }), P = I({
206
- mutationFn: (e) => g.request(q(`${h}/fix`, { ...m, undo: e })),
207
+ mutationFn: (e) => p.request(q(`${h}/fix`, { ...m, undo: e })),
207
208
  onSuccess: () => {
208
209
  B && Y(H(B)), M({ text: "Undone.", undo: [] }), u();
209
210
  },
210
211
  onError: (e) => N(F(e))
211
212
  }), Q = I({
212
- mutationFn: () => g.request(q(`${h}/proposals/ai`, m)).then((e) => e.data.proposal),
213
+ mutationFn: () => p.request(q(`${h}/proposals/ai`, m)).then((e) => e.data.proposal),
213
214
  onSuccess: (e) => {
214
215
  N(null), L((c) => c.some((x) => x.id === e.id) ? c : [...c, e]);
215
216
  },
@@ -223,14 +224,14 @@ function le({
223
224
  children: [
224
225
  d && /* @__PURE__ */ n("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Working out what would fix this…" }),
225
226
  E && /* @__PURE__ */ n("p", { className: "text-[11.5px] text-red-600 dark:text-red-400", children: F(E) }),
226
- p ? /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-2 text-[11.5px]", children: [
227
- /* @__PURE__ */ n("span", { className: "font-medium text-emerald-700 dark:text-emerald-400", children: p.text }),
228
- p.undo.length > 0 && j > 0 && /* @__PURE__ */ n(
227
+ g ? /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-2 text-[11.5px]", children: [
228
+ /* @__PURE__ */ n("span", { className: "font-medium text-emerald-700 dark:text-emerald-400", children: g.text }),
229
+ g.undo.length > 0 && j > 0 && /* @__PURE__ */ n(
229
230
  "button",
230
231
  {
231
232
  type: "button",
232
233
  disabled: P.isPending,
233
- onClick: () => P.mutate(p.undo),
234
+ onClick: () => P.mutate(g.undo),
234
235
  className: "rounded border border-slate-300 px-2 py-0.5 text-[11px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
235
236
  children: P.isPending ? "Undoing…" : `Undo (${j}s)`
236
237
  }
@@ -399,10 +400,10 @@ function F(t) {
399
400
  return String(((a = r == null ? void 0 : r.response) == null ? void 0 : a.error) ?? (r == null ? void 0 : r.message) ?? "Request failed");
400
401
  }
401
402
  export {
402
- oe as OWN_RECORD_WRITES_EVENT,
403
- ke as RecordIntegrityBanner,
404
- se as findingFieldLabel,
405
- be as integrityByField,
403
+ se as OWN_RECORD_WRITES_EVENT,
404
+ ve as RecordIntegrityBanner,
405
+ le as findingFieldLabel,
406
+ ye as integrityByField,
406
407
  H as ownWritesOf,
407
- de as useRecordIntegrity
408
+ oe as useRecordIntegrity
408
409
  };