@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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +207 -3
- package/dist/index.js +745 -728
- package/dist/shared/components/CollectionBrowserView.js +3133 -2954
- package/dist/shared/components/CollectionImportBanner.js +135 -0
- package/dist/shared/components/ItemEditForm.js +2235 -2218
- package/dist/shared/components/JobsTray.js +54 -47
- package/dist/shared/components/ViewAsPersonButton.js +109 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
- package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
- package/dist/shared/components/bulk/bulk-field-options.js +20 -19
- package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
- package/dist/shared/components/cbv/ColumnHeaderMenu.js +130 -0
- package/dist/shared/components/cbv/column-totals.js +163 -0
- package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
- package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
- package/dist/shared/components/collections-directory/directory-data.js +70 -58
- package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
- package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
- package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
- package/dist/shared/components/item-edit/FieldRow.js +248 -246
- package/dist/shared/components/item-edit/InlineGridField.js +34 -33
- package/dist/shared/components/item-edit/InlineTableField.js +3002 -2825
- package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
- package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
- package/dist/shared/components/item-edit/PlanGrid.js +2 -1
- package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
- package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
- package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
- package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
- package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
- package/dist/shared/components/item-edit/UserChip.js +262 -239
- package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
- package/dist/shared/components/item-edit/grid-search.js +375 -0
- package/dist/shared/components/item-edit/render-stability.js +61 -54
- package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
- package/dist/shared/components/ops-report/DigestSections.js +163 -144
- package/dist/shared/components/ops-report/drill.js +97 -97
- package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
- package/dist/shared/components/panels/AddendumPanel.js +92 -91
- package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
- package/dist/shared/components/panels/CommentPanel.js +265 -252
- package/dist/shared/components/panels/OwnersSlot.js +47 -35
- package/dist/shared/components/panels/PipelineInsight.js +186 -0
- package/dist/shared/components/panels/PipelinePanel.js +1440 -1397
- package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
- package/dist/shared/components/panels/RevisionsPanel.js +261 -260
- package/dist/shared/components/panels/StandInReason.js +69 -0
- package/dist/shared/components/pipeline/FieldPicker.js +41 -40
- package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
- package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
- package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
- package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
- package/dist/shared/components/profile/PersonHeader.js +29 -29
- package/dist/shared/components/profile/PersonProfile.js +30 -28
- package/dist/shared/components/profile/SlowScreensCard.js +286 -0
- package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
- package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
- package/dist/shared/components/support/TicketDetailSheet.js +25 -16
- package/dist/shared/components/support/TicketSlowScreens.js +32 -0
- package/dist/shared/lib/activity-sentence.js +224 -178
- package/dist/shared/lib/collection-import-banner.js +27 -0
- package/dist/shared/lib/crash-report.js +112 -0
- package/dist/shared/lib/export-runs.js +99 -0
- package/dist/shared/lib/jobs-tray.js +89 -67
- package/dist/shared/lib/list-link.js +76 -69
- package/dist/shared/lib/nav-trail.js +180 -76
- package/dist/shared/lib/query-keys.js +26 -0
- package/dist/shared/lib/view-as.js +16 -11
- package/package.json +1 -1
|
@@ -1,46 +1,57 @@
|
|
|
1
|
-
import { useQueryClient as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { toast as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { get as
|
|
6
|
-
const
|
|
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
|
|
12
|
-
const t =
|
|
13
|
-
return
|
|
14
|
-
queryKey:
|
|
15
|
-
queryFn: () => t.request(
|
|
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
|
|
19
|
-
const e =
|
|
20
|
-
return
|
|
21
|
-
queryKey:
|
|
22
|
-
queryFn: () => e.request(
|
|
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 =
|
|
30
|
-
return
|
|
31
|
-
queryKey:
|
|
40
|
+
const o = l();
|
|
41
|
+
return u({
|
|
42
|
+
queryKey: v.summary(t),
|
|
32
43
|
queryFn: () => o.request(
|
|
33
|
-
|
|
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
|
|
51
|
+
const S = "nvr_collections_usage", K = 12;
|
|
41
52
|
function _() {
|
|
42
53
|
try {
|
|
43
|
-
const t = JSON.parse(localStorage.getItem(
|
|
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(
|
|
64
|
+
localStorage.setItem(S, JSON.stringify({ recent: o, counts: r }));
|
|
54
65
|
} catch {
|
|
55
66
|
}
|
|
56
67
|
}
|
|
57
|
-
function
|
|
58
|
-
const [t] =
|
|
68
|
+
function V() {
|
|
69
|
+
const [t] = R(_);
|
|
59
70
|
return t;
|
|
60
71
|
}
|
|
61
|
-
function
|
|
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
|
|
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
|
|
76
|
-
function
|
|
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
|
|
99
|
-
const e =
|
|
100
|
-
queryKey:
|
|
101
|
-
queryFn: () => e.request(
|
|
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 =
|
|
118
|
+
}), s = w(Promise.resolve()), C = I(() => {
|
|
108
119
|
var a;
|
|
109
|
-
return
|
|
110
|
-
}, [r.data]), A =
|
|
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(
|
|
123
|
+
const i = o.getQueryData(f);
|
|
113
124
|
if (!i)
|
|
114
|
-
return
|
|
115
|
-
const
|
|
116
|
-
if (!p && i.items.length >=
|
|
117
|
-
return
|
|
118
|
-
const
|
|
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 !==
|
|
131
|
+
items: p ? i.items.filter((n) => n.path !== g) : [...i.items, { label: c, path: g, group: null }]
|
|
121
132
|
};
|
|
122
|
-
o.setQueryData(
|
|
133
|
+
o.setQueryData(f, h);
|
|
123
134
|
const d = s.current.then(async () => {
|
|
124
135
|
try {
|
|
125
136
|
await e.request(
|
|
126
|
-
|
|
127
|
-
nav_favorites:
|
|
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:
|
|
143
|
+
nav_favorite_groups: h.groups
|
|
133
144
|
})
|
|
134
|
-
),
|
|
145
|
+
), y.success(
|
|
135
146
|
p ? `Removed ${c} from your favorites` : `Added ${c} to your favorites`
|
|
136
147
|
);
|
|
137
148
|
} catch {
|
|
138
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
};
|