@nivaro/react 0.3.46 → 0.3.48
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 +248 -16
- package/dist/index.js +679 -659
- package/dist/shared/components/CollectionBrowserView.js +813 -826
- package/dist/shared/components/ErrorNotice.js +169 -0
- package/dist/shared/components/ErrorSurface.js +23 -17
- package/dist/shared/components/ListLoadError.js +8 -29
- package/dist/shared/components/LoadErrorNote.js +38 -21
- package/dist/shared/components/QueryErrorState.js +8 -11
- package/dist/shared/components/ReportView.js +1320 -1291
- package/dist/shared/components/chat/ChannelArchive.js +60 -60
- package/dist/shared/components/chat/ChannelExtras.js +74 -74
- package/dist/shared/components/chat/ChatPanel.js +368 -367
- package/dist/shared/components/command-center/PeekPanel.js +33 -32
- package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
- package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
- package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
- package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
- package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
- package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
- package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
- package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
- package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
- package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
- package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
- package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
- package/dist/shared/components/import/ImportFromFileButton.js +61 -60
- package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
- package/dist/shared/components/imports/NewImportDialog.js +29 -28
- package/dist/shared/components/imports/RunDetailSheet.js +63 -63
- package/dist/shared/components/item-edit/FieldRow.js +329 -329
- package/dist/shared/components/item-edit/InlineTableField.js +898 -898
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
- package/dist/shared/components/item-edit/PlanGrid.js +220 -221
- package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
- package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
- package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
- package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
- package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
- package/dist/shared/components/panels/SlaClock.js +35 -36
- package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
- package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
- package/dist/shared/components/profile/AgentsPanel.js +73 -72
- package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
- package/dist/shared/components/support/SupportRequestDialog.js +85 -81
- package/dist/shared/components/support/SupportView.js +94 -87
- package/dist/shared/lib/autofill-poll.js +21 -18
- package/dist/shared/lib/error-actions.js +85 -0
- package/dist/shared/lib/error-message.js +223 -82
- package/dist/shared/lib/error-toast.js +71 -13
- package/dist/shared/lib/safe-error.js +136 -38
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as C, useQuery as f, useMutation as v } from "@tanstack/react-query";
|
|
3
|
-
import { History as
|
|
3
|
+
import { History as M, Archive as W } from "lucide-react";
|
|
4
4
|
import { useState as k } from "react";
|
|
5
5
|
import { toast as m } from "sonner";
|
|
6
6
|
import { useNivaroClient as g } from "../../context.js";
|
|
7
|
-
import { get as N, put as
|
|
7
|
+
import { get as N, put as H, post as q } from "../../lib/commands.js";
|
|
8
|
+
import { userErrorMessage as B } from "../../lib/safe-error.js";
|
|
8
9
|
import { cn as w, formatRelative as $ } from "../../lib/utils.js";
|
|
9
10
|
import { Skeleton as p } from "../ui/skeleton.js";
|
|
10
11
|
function b(s, i) {
|
|
11
|
-
|
|
12
|
-
return ((t = s == null ? void 0 : s.response) == null ? void 0 : t.error) ?? i;
|
|
12
|
+
return B(s, i);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ee({
|
|
15
15
|
channelId: s,
|
|
16
16
|
channelName: i,
|
|
17
|
-
suggestedAt:
|
|
17
|
+
suggestedAt: a
|
|
18
18
|
}) {
|
|
19
19
|
const d = g(), o = C(), r = v({
|
|
20
20
|
mutationFn: (c) => d.request(q(`/chat/channels/${s}/archive-suggestion`, { action: c })),
|
|
@@ -29,12 +29,12 @@ function Y({
|
|
|
29
29
|
className: "flex flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-slate-200 bg-slate-50 px-3 py-2 dark:border-border dark:bg-muted/40",
|
|
30
30
|
"data-chat-archive-suggestion": !0,
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */ e(
|
|
32
|
+
/* @__PURE__ */ e(W, { className: "h-3.5 w-3.5 shrink-0 text-slate-500", strokeWidth: 2 }),
|
|
33
33
|
/* @__PURE__ */ n("p", { className: "min-w-0 flex-1 text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
34
34
|
"#",
|
|
35
35
|
i,
|
|
36
36
|
" has been quiet. Archive it for everyone (it closes for all members), or keep it open. Suggested ",
|
|
37
|
-
$(
|
|
37
|
+
$(a),
|
|
38
38
|
"."
|
|
39
39
|
] }),
|
|
40
40
|
/* @__PURE__ */ n("span", { className: "flex shrink-0 gap-1.5", children: [
|
|
@@ -65,54 +65,54 @@ function Y({
|
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
const i = s.user_name ?? "Someone",
|
|
68
|
+
function O(s) {
|
|
69
|
+
const i = s.user_name ?? "Someone", a = s.by_name ?? "someone";
|
|
70
70
|
switch (s.kind) {
|
|
71
71
|
case "joined":
|
|
72
72
|
return `${i} joined`;
|
|
73
73
|
case "left":
|
|
74
74
|
return `${i} left`;
|
|
75
75
|
case "added":
|
|
76
|
-
return `${
|
|
76
|
+
return `${a} added ${i}${s.note ? ` (${s.note})` : ""}`;
|
|
77
77
|
case "removed":
|
|
78
|
-
return `${
|
|
78
|
+
return `${a} removed ${i}`;
|
|
79
79
|
case "auto_joined":
|
|
80
80
|
return `${i} joined by default role`;
|
|
81
81
|
case "bulk_added":
|
|
82
|
-
return `${
|
|
82
|
+
return `${a} added ${s.count ?? 0} people (${s.note ?? "a group"})`;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
function T({ events: s, showChannel: i }) {
|
|
86
|
-
return /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border", children: s.map((
|
|
86
|
+
return /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border", children: s.map((a) => /* @__PURE__ */ n(
|
|
87
87
|
"li",
|
|
88
88
|
{
|
|
89
89
|
className: "flex items-baseline gap-2 px-2 py-1.5 text-[12px]",
|
|
90
|
-
"data-chat-membership-event":
|
|
90
|
+
"data-chat-membership-event": a.kind,
|
|
91
91
|
children: [
|
|
92
92
|
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 text-slate-700 dark:text-slate-200", children: [
|
|
93
93
|
i && /* @__PURE__ */ n("span", { className: "mr-1.5 font-medium text-slate-900 dark:text-slate-50", children: [
|
|
94
94
|
"#",
|
|
95
|
-
|
|
95
|
+
a.channel_name ?? a.channel
|
|
96
96
|
] }),
|
|
97
|
-
|
|
97
|
+
O(a)
|
|
98
98
|
] }),
|
|
99
99
|
/* @__PURE__ */ e(
|
|
100
100
|
"span",
|
|
101
101
|
{
|
|
102
102
|
className: "shrink-0 text-[11px] text-slate-500 dark:text-slate-400",
|
|
103
|
-
"data-tip": new Date(
|
|
104
|
-
children: $(
|
|
103
|
+
"data-tip": new Date(a.at).toLocaleString(),
|
|
104
|
+
children: $(a.at)
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
]
|
|
108
108
|
},
|
|
109
|
-
|
|
109
|
+
a.id
|
|
110
110
|
)) });
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const
|
|
112
|
+
function te({ channelId: s, border: i }) {
|
|
113
|
+
const a = g(), [d, o] = k(!1), { data: r, isLoading: c, isError: l } = f({
|
|
114
114
|
queryKey: ["nvr-chat-membership-history", s],
|
|
115
|
-
queryFn: () =>
|
|
115
|
+
queryFn: () => a.request(N(`/chat/channels/${s}/membership-history`)).then((h) => h.data ?? []),
|
|
116
116
|
enabled: d,
|
|
117
117
|
staleTime: 3e4
|
|
118
118
|
});
|
|
@@ -125,7 +125,7 @@ function Z({ channelId: s, border: i }) {
|
|
|
125
125
|
"aria-expanded": d,
|
|
126
126
|
className: "inline-flex items-center gap-1 text-[11.5px] font-medium text-slate-600 hover:text-slate-900 dark:text-slate-300 dark:hover:text-white",
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */ e(
|
|
128
|
+
/* @__PURE__ */ e(M, { className: "h-3.5 w-3.5" }),
|
|
129
129
|
" ",
|
|
130
130
|
d ? "Hide who joined and left" : "Who joined and left"
|
|
131
131
|
]
|
|
@@ -140,19 +140,19 @@ function Z({ channelId: s, border: i }) {
|
|
|
140
140
|
function A({
|
|
141
141
|
title: s,
|
|
142
142
|
note: i,
|
|
143
|
-
children:
|
|
143
|
+
children: a
|
|
144
144
|
}) {
|
|
145
145
|
return /* @__PURE__ */ n("section", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
|
|
146
146
|
/* @__PURE__ */ n("div", { className: "mb-3 flex items-baseline justify-between gap-3", children: [
|
|
147
147
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: s }),
|
|
148
148
|
i && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: i })
|
|
149
149
|
] }),
|
|
150
|
-
|
|
150
|
+
a
|
|
151
151
|
] });
|
|
152
152
|
}
|
|
153
153
|
function F({ rows: s, empty: i }) {
|
|
154
|
-
const
|
|
155
|
-
mutationFn: (r) =>
|
|
154
|
+
const a = g(), d = C(), o = v({
|
|
155
|
+
mutationFn: (r) => a.request(q(`/chat/channels/${r}/archive-suggestion`, { action: "keep" })),
|
|
156
156
|
onSuccess: () => void d.invalidateQueries({ queryKey: ["nvr-chat-archive-overview"] }),
|
|
157
157
|
onError: (r) => m.error(b(r, "Could not keep that channel open"))
|
|
158
158
|
});
|
|
@@ -175,35 +175,35 @@ function F({ rows: s, empty: i }) {
|
|
|
175
175
|
)
|
|
176
176
|
] }, r.id)) });
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ae() {
|
|
179
179
|
var j, K, E, P, Q;
|
|
180
|
-
const s = g(), i = C(),
|
|
180
|
+
const s = g(), i = C(), a = f({
|
|
181
181
|
queryKey: ["nvr-chat-archive-overview"],
|
|
182
|
-
queryFn: () => s.request(N("/chat/admin/archive-overview")).then((
|
|
182
|
+
queryFn: () => s.request(N("/chat/admin/archive-overview")).then((t) => t.data),
|
|
183
183
|
staleTime: 3e4
|
|
184
|
-
}), [d, o] = k(null), r = (j =
|
|
185
|
-
|
|
184
|
+
}), [d, o] = k(null), r = (j = a.data) == null ? void 0 : j.idle_days, c = d ?? (r === void 0 ? "" : String(r)), l = d === null || d.trim() === "" ? null : Number(d), h = l !== null && (!Number.isInteger(l) || l < 0 || l > 3650), S = (t) => {
|
|
185
|
+
t ? i.setQueryData(["nvr-chat-archive-overview"], t) : i.invalidateQueries({ queryKey: ["nvr-chat-archive-overview"] });
|
|
186
186
|
}, _ = v({
|
|
187
|
-
mutationFn: (
|
|
188
|
-
onSuccess: (
|
|
189
|
-
S(
|
|
187
|
+
mutationFn: (t) => s.request(H("/chat/admin/archive-settings", { idle_days: t })).then((D) => D.data),
|
|
188
|
+
onSuccess: (t) => {
|
|
189
|
+
S(t), o(null), m.success("Saved");
|
|
190
190
|
},
|
|
191
|
-
onError: (
|
|
191
|
+
onError: (t) => m.error(b(t, "Could not save"))
|
|
192
192
|
}), y = v({
|
|
193
193
|
mutationFn: () => s.request(
|
|
194
194
|
q("/chat/admin/archive-suggest-now")
|
|
195
|
-
).then((
|
|
196
|
-
onSuccess: (
|
|
197
|
-
S(
|
|
198
|
-
|
|
195
|
+
).then((t) => t.data),
|
|
196
|
+
onSuccess: (t) => {
|
|
197
|
+
S(t.overview), m.success(
|
|
198
|
+
t.suggested === 0 ? "No quiet channels found" : `${t.suggested} ${t.suggested === 1 ? "suggestion" : "suggestions"} sent`
|
|
199
199
|
);
|
|
200
200
|
},
|
|
201
|
-
onError: (
|
|
201
|
+
onError: (t) => m.error(b(t, "Could not run the check"))
|
|
202
202
|
}), [u, L] = k(30), x = f({
|
|
203
203
|
queryKey: ["nvr-chat-membership-history-all", u],
|
|
204
204
|
queryFn: () => s.request(
|
|
205
205
|
N("/chat/admin/membership-history", { days: u })
|
|
206
|
-
).then((
|
|
206
|
+
).then((t) => t.data ?? []),
|
|
207
207
|
staleTime: 3e4
|
|
208
208
|
});
|
|
209
209
|
return /* @__PURE__ */ n("div", { className: "space-y-4", "data-chat-channels-admin": !0, children: [
|
|
@@ -223,7 +223,7 @@ function ee() {
|
|
|
223
223
|
min: 0,
|
|
224
224
|
max: 3650,
|
|
225
225
|
value: c,
|
|
226
|
-
onChange: (
|
|
226
|
+
onChange: (t) => o(t.target.value),
|
|
227
227
|
"aria-invalid": h || void 0,
|
|
228
228
|
className: w(
|
|
229
229
|
"h-7 w-16 rounded-md border bg-white px-2 text-[12px] tabular-nums outline-none focus:border-nvr-cyan dark:bg-card",
|
|
@@ -255,20 +255,20 @@ function ee() {
|
|
|
255
255
|
}
|
|
256
256
|
)
|
|
257
257
|
] }),
|
|
258
|
-
|
|
258
|
+
a.isLoading ? /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
|
|
259
259
|
/* @__PURE__ */ e(p, { className: "h-4 w-2/3" }),
|
|
260
260
|
/* @__PURE__ */ e(p, { className: "h-4 w-1/2" })
|
|
261
|
-
] }) :
|
|
261
|
+
] }) : a.isError ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Could not load the channel lists." }) : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
262
262
|
/* @__PURE__ */ n("div", { children: [
|
|
263
263
|
/* @__PURE__ */ n("p", { className: "mb-1 text-[12px] font-medium text-slate-600 dark:text-slate-300", children: [
|
|
264
264
|
"Waiting on the owner (",
|
|
265
|
-
((K =
|
|
265
|
+
((K = a.data) == null ? void 0 : K.suggested.length) ?? 0,
|
|
266
266
|
")"
|
|
267
267
|
] }),
|
|
268
268
|
/* @__PURE__ */ e(
|
|
269
269
|
F,
|
|
270
270
|
{
|
|
271
|
-
rows: ((E =
|
|
271
|
+
rows: ((E = a.data) == null ? void 0 : E.suggested) ?? [],
|
|
272
272
|
empty: "No archive suggestions are waiting."
|
|
273
273
|
}
|
|
274
274
|
)
|
|
@@ -276,13 +276,13 @@ function ee() {
|
|
|
276
276
|
/* @__PURE__ */ n("div", { children: [
|
|
277
277
|
/* @__PURE__ */ n("p", { className: "mb-1 text-[12px] font-medium text-slate-600 dark:text-slate-300", children: [
|
|
278
278
|
"Archived (",
|
|
279
|
-
((P =
|
|
279
|
+
((P = a.data) == null ? void 0 : P.archived.length) ?? 0,
|
|
280
280
|
")"
|
|
281
281
|
] }),
|
|
282
282
|
/* @__PURE__ */ e(
|
|
283
283
|
F,
|
|
284
284
|
{
|
|
285
|
-
rows: ((Q =
|
|
285
|
+
rows: ((Q = a.data) == null ? void 0 : Q.archived) ?? [],
|
|
286
286
|
empty: "No channels are archived. Archived channels stay searchable and can be reopened in their settings."
|
|
287
287
|
}
|
|
288
288
|
)
|
|
@@ -292,22 +292,22 @@ function ee() {
|
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
294
|
/* @__PURE__ */ n(A, { title: "Membership changes", note: "Who joined, left, was added or removed", children: [
|
|
295
|
-
/* @__PURE__ */ e("div", { className: "mb-2 flex gap-1", children: [7, 30, 90].map((
|
|
295
|
+
/* @__PURE__ */ e("div", { className: "mb-2 flex gap-1", children: [7, 30, 90].map((t) => /* @__PURE__ */ n(
|
|
296
296
|
"button",
|
|
297
297
|
{
|
|
298
298
|
type: "button",
|
|
299
|
-
onClick: () => L(
|
|
300
|
-
"aria-pressed": u ===
|
|
299
|
+
onClick: () => L(t),
|
|
300
|
+
"aria-pressed": u === t,
|
|
301
301
|
className: w(
|
|
302
302
|
"h-6 rounded-md px-2 text-[11.5px] font-medium",
|
|
303
|
-
u ===
|
|
303
|
+
u === t ? "bg-slate-100 text-slate-900 dark:bg-muted dark:text-slate-50" : "text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100"
|
|
304
304
|
),
|
|
305
305
|
children: [
|
|
306
|
-
|
|
306
|
+
t,
|
|
307
307
|
" days"
|
|
308
308
|
]
|
|
309
309
|
},
|
|
310
|
-
|
|
310
|
+
t
|
|
311
311
|
)) }),
|
|
312
312
|
x.isLoading ? /* @__PURE__ */ e(p, { className: "h-16 w-full" }) : x.isError ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Could not load membership changes." }) : (x.data ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "py-2 text-[12px] text-slate-500 dark:text-slate-400", children: [
|
|
313
313
|
"No joins or leaves in the last ",
|
|
@@ -318,8 +318,8 @@ function ee() {
|
|
|
318
318
|
] });
|
|
319
319
|
}
|
|
320
320
|
export {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
ee as ArchiveSuggestionBanner,
|
|
322
|
+
ae as ChannelsAdminTab,
|
|
323
|
+
te as MembershipHistory,
|
|
324
|
+
O as eventText
|
|
325
325
|
};
|