@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,46 +1,57 @@
1
- import { useQueryClient as I, useQuery as m } from "@tanstack/react-query";
2
- import { useRef as O, useMemo as R, useCallback as E, useState as F } from "react";
3
- import { toast as u } from "sonner";
4
- import { useNivaroClient as y } from "../../context.js";
5
- import { get as f, patch as w } from "../../lib/commands.js";
6
- const h = {
1
+ import { useQueryClient as F, useQuery as u } from "@tanstack/react-query";
2
+ import { useRef as w, useMemo as I, useCallback as O, useState as R } from "react";
3
+ import { toast as y } from "sonner";
4
+ import { useNivaroClient as l } from "../../context.js";
5
+ import { get as m, patch as E } from "../../lib/commands.js";
6
+ const v = {
7
7
  collections: ["collections"],
8
8
  stats: ["collections-overview-stats"],
9
+ heavyLists: ["collections-list-weight"],
9
10
  summary: (t) => ["collection-summary", t]
10
11
  };
11
- function J() {
12
- const t = y();
13
- return m({
14
- queryKey: h.collections,
15
- queryFn: () => t.request(f("/collections")).then((e) => e.data ?? [])
12
+ function D() {
13
+ const t = l();
14
+ return u({
15
+ queryKey: v.collections,
16
+ queryFn: () => t.request(m("/collections")).then((e) => e.data ?? [])
16
17
  });
17
18
  }
18
- function P(t) {
19
- const e = y();
20
- return m({
21
- queryKey: h.stats,
22
- queryFn: () => e.request(f("/collections/overview-stats")).then((o) => o.data ?? {}),
19
+ function J(t) {
20
+ const e = l();
21
+ return u({
22
+ queryKey: v.stats,
23
+ queryFn: () => e.request(m("/collections/overview-stats")).then((o) => o.data ?? {}),
23
24
  enabled: t,
24
25
  staleTime: 6e4,
25
26
  retry: !1
26
27
  });
27
28
  }
29
+ function P(t) {
30
+ const e = l();
31
+ return u({
32
+ queryKey: v.heavyLists,
33
+ queryFn: () => e.request(m("/collections/list-weight")).then((o) => o.data ?? {}),
34
+ enabled: t,
35
+ staleTime: 10 * 6e4,
36
+ retry: !1
37
+ });
38
+ }
28
39
  function x(t, e) {
29
- const o = y();
30
- return m({
31
- queryKey: h.summary(t),
40
+ const o = l();
41
+ return u({
42
+ queryKey: v.summary(t),
32
43
  queryFn: () => o.request(
33
- f(`/collections/${encodeURIComponent(t)}/summary`)
44
+ m(`/collections/${encodeURIComponent(t)}/summary`)
34
45
  ).then((r) => r.data),
35
46
  enabled: e,
36
47
  staleTime: 6e4,
37
48
  retry: !1
38
49
  });
39
50
  }
40
- const q = "nvr_collections_usage", K = 12;
51
+ const S = "nvr_collections_usage", K = 12;
41
52
  function _() {
42
53
  try {
43
- const t = JSON.parse(localStorage.getItem(q) ?? "null");
54
+ const t = JSON.parse(localStorage.getItem(S) ?? "null");
44
55
  if (t && Array.isArray(t.recent) && t.counts && typeof t.counts == "object")
45
56
  return { recent: t.recent.map(String), counts: t.counts };
46
57
  } catch {
@@ -50,15 +61,15 @@ function _() {
50
61
  function M(t) {
51
62
  const e = _(), o = [t, ...e.recent.filter((s) => s !== t)].slice(0, K), r = { ...e.counts, [t]: (e.counts[t] ?? 0) + 1 };
52
63
  try {
53
- localStorage.setItem(q, JSON.stringify({ recent: o, counts: r }));
64
+ localStorage.setItem(S, JSON.stringify({ recent: o, counts: r }));
54
65
  } catch {
55
66
  }
56
67
  }
57
- function L() {
58
- const [t] = F(_);
68
+ function V() {
69
+ const [t] = R(_);
59
70
  return t;
60
71
  }
61
- function V(t, e) {
72
+ function X(t, e) {
62
73
  try {
63
74
  const o = localStorage.getItem(t);
64
75
  return o == null ? e : JSON.parse(o);
@@ -66,14 +77,14 @@ function V(t, e) {
66
77
  return e;
67
78
  }
68
79
  }
69
- function X(t, e) {
80
+ function j(t, e) {
70
81
  try {
71
82
  localStorage.setItem(t, JSON.stringify(e));
72
83
  } catch {
73
84
  }
74
85
  }
75
- const l = ["nvr-nav-favorites"], S = 60, N = (t) => `/collections/${encodeURIComponent(t)}`;
76
- function T(t) {
86
+ const f = ["nvr-nav-favorites"], q = 60, T = (t) => `/collections/${encodeURIComponent(t)}`;
87
+ function N(t) {
77
88
  const e = /* @__PURE__ */ new Set();
78
89
  for (const o of t) {
79
90
  const r = /^\/collections\/([^/?#]+)$/.exec(o.path);
@@ -95,47 +106,47 @@ function U(t) {
95
106
  });
96
107
  return { items: o, groups: e };
97
108
  }
98
- function j(t = !0) {
99
- const e = y(), o = I(), r = m({
100
- queryKey: l,
101
- queryFn: () => e.request(f("/users/me")).then((a) => {
109
+ function G(t = !0) {
110
+ const e = l(), o = F(), r = u({
111
+ queryKey: f,
112
+ queryFn: () => e.request(m("/users/me")).then((a) => {
102
113
  var c;
103
114
  return U(((c = a.data) == null ? void 0 : c.preferences) ?? {});
104
115
  }),
105
116
  enabled: t,
106
117
  staleTime: 3e4
107
- }), s = O(Promise.resolve()), C = R(() => {
118
+ }), s = w(Promise.resolve()), C = I(() => {
108
119
  var a;
109
- return T(((a = r.data) == null ? void 0 : a.items) ?? []);
110
- }, [r.data]), A = E(
120
+ return N(((a = r.data) == null ? void 0 : a.items) ?? []);
121
+ }, [r.data]), A = O(
111
122
  (a, c) => {
112
- const i = o.getQueryData(l);
123
+ const i = o.getQueryData(f);
113
124
  if (!i)
114
- return u.error("Your favorites are still loading — try again in a moment"), Promise.resolve();
115
- const v = N(a), p = i.items.some((n) => n.path === v);
116
- if (!p && i.items.length >= S)
117
- return u.error(`Favorites hold up to ${S} pages — remove one first`), Promise.resolve();
118
- const g = {
125
+ return y.error("Your favorites are still loading — try again in a moment"), Promise.resolve();
126
+ const g = T(a), p = i.items.some((n) => n.path === g);
127
+ if (!p && i.items.length >= q)
128
+ return y.error(`Favorites hold up to ${q} pages — remove one first`), Promise.resolve();
129
+ const h = {
119
130
  ...i,
120
- items: p ? i.items.filter((n) => n.path !== v) : [...i.items, { label: c, path: v, group: null }]
131
+ items: p ? i.items.filter((n) => n.path !== g) : [...i.items, { label: c, path: g, group: null }]
121
132
  };
122
- o.setQueryData(l, g);
133
+ o.setQueryData(f, h);
123
134
  const d = s.current.then(async () => {
124
135
  try {
125
136
  await e.request(
126
- w("/users/me/preferences", {
127
- nav_favorites: g.items.map((n) => ({
137
+ E("/users/me/preferences", {
138
+ nav_favorites: h.items.map((n) => ({
128
139
  label: n.label,
129
140
  path: n.path,
130
141
  ...n.group ? { group: n.group } : {}
131
142
  })),
132
- nav_favorite_groups: g.groups
143
+ nav_favorite_groups: h.groups
133
144
  })
134
- ), u.success(
145
+ ), y.success(
135
146
  p ? `Removed ${c} from your favorites` : `Added ${c} to your favorites`
136
147
  );
137
148
  } catch {
138
- u.error("Could not save favorites"), o.invalidateQueries({ queryKey: l });
149
+ y.error("Could not save favorites"), o.invalidateQueries({ queryKey: f });
139
150
  }
140
151
  });
141
152
  return s.current = d, d;
@@ -145,15 +156,16 @@ function j(t = !0) {
145
156
  return { favorite: C, toggle: A };
146
157
  }
147
158
  export {
148
- h as DIRECTORY_KEYS,
149
- T as favoriteCollectionsOf,
150
- N as favoritePath,
151
- V as readLocal,
159
+ v as DIRECTORY_KEYS,
160
+ N as favoriteCollectionsOf,
161
+ T as favoritePath,
162
+ X as readLocal,
152
163
  M as recordCollectionOpen,
153
164
  x as useCollectionSummary,
154
- L as useCollectionUsage,
155
- J as useDirectoryCollections,
156
- j as useNavFavoriteCollections,
157
- P as useOverviewStats,
158
- X as writeLocal
165
+ V as useCollectionUsage,
166
+ D as useDirectoryCollections,
167
+ P as useHeavyListFlags,
168
+ G as useNavFavoriteCollections,
169
+ J as useOverviewStats,
170
+ j as writeLocal
159
171
  };