@nivaro/react 0.3.46 → 0.3.47
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,44 +1,45 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { AlertCircle as N, RotateCw as
|
|
2
|
+
import { useQueryClient as C, useQuery as I } from "@tanstack/react-query";
|
|
3
|
+
import { AlertCircle as N, RotateCw as O } from "lucide-react";
|
|
4
4
|
import { useState as d } from "react";
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
5
|
+
import { toast as F } from "sonner";
|
|
6
|
+
import { useNivaroClient as q } from "../../../context.js";
|
|
7
|
+
import { userErrorMessage as _ } from "../../../lib/safe-error.js";
|
|
7
8
|
import { Button as c } from "../../ui/button.js";
|
|
8
9
|
import { Skeleton as g } from "../../ui/skeleton.js";
|
|
9
|
-
import { helpVideoApi as
|
|
10
|
+
import { helpVideoApi as w, helpVideoKeys as z, helpVideoError as M } from "../api.js";
|
|
10
11
|
import { DownloadMenu as j } from "../viewer/DownloadMenu.js";
|
|
11
|
-
import { renderLabel as K, whenSaved as
|
|
12
|
-
import { UnsavedNote as
|
|
12
|
+
import { renderLabel as K, whenSaved as y } from "./publish.js";
|
|
13
|
+
import { UnsavedNote as P } from "./UnsavedNote.js";
|
|
13
14
|
const m = "rounded-full px-2 py-0.5 text-[11px] font-medium";
|
|
14
|
-
function
|
|
15
|
+
function re({
|
|
15
16
|
video: a,
|
|
16
|
-
onRerecord:
|
|
17
|
-
onRestored:
|
|
17
|
+
onRerecord: k,
|
|
18
|
+
onRestored: E,
|
|
18
19
|
beforeChange: u,
|
|
19
|
-
conflict:
|
|
20
|
-
onReload:
|
|
20
|
+
conflict: V = !1,
|
|
21
|
+
onReload: D = () => {
|
|
21
22
|
}
|
|
22
23
|
}) {
|
|
23
|
-
const p =
|
|
24
|
+
const p = q(), R = C(), [f, i] = d(null), [L, o] = d(!1), [h, x] = d(null), s = I({
|
|
24
25
|
queryKey: ["help-videos", "versions", a.id],
|
|
25
|
-
queryFn: () =>
|
|
26
|
-
}),
|
|
27
|
-
i(null), o(!1), (await
|
|
28
|
-
})).ok ?
|
|
29
|
-
},
|
|
26
|
+
queryFn: () => w(p).versions(a.id)
|
|
27
|
+
}), S = async () => {
|
|
28
|
+
i(null), o(!1), (await y(u, async () => {
|
|
29
|
+
})).ok ? k() : o(!0);
|
|
30
|
+
}, $ = async (e, n) => {
|
|
30
31
|
var v;
|
|
31
32
|
i(null), o(!1), x(e);
|
|
32
33
|
try {
|
|
33
|
-
if (!(await
|
|
34
|
+
if (!(await y(u, () => w(p).restore(a.id, e))).ok) {
|
|
34
35
|
o(!0);
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
F.success(`Version ${n} copied into a new draft`), R.invalidateQueries({ queryKey: z.one(a.id) }), s.refetch(), E();
|
|
38
39
|
} catch (l) {
|
|
39
|
-
const b = (v =
|
|
40
|
+
const b = (v = M(l)) == null ? void 0 : v.code;
|
|
40
41
|
i(
|
|
41
|
-
b === "HELP_VIDEO_VERSION_FILES_REMOVED" ? `Version ${n} couldn't be restored: its files were removed by retention.` : `Version ${n} couldn't be restored. ${l
|
|
42
|
+
b === "HELP_VIDEO_VERSION_FILES_REMOVED" ? `Version ${n} couldn't be restored: its files were removed by retention.` : `Version ${n} couldn't be restored. ${_(l, "")}`
|
|
42
43
|
), b === "HELP_VIDEO_VERSION_FILES_REMOVED" && s.refetch();
|
|
43
44
|
} finally {
|
|
44
45
|
x(null);
|
|
@@ -63,14 +64,14 @@ function Z({
|
|
|
63
64
|
size: "sm",
|
|
64
65
|
variant: "outline",
|
|
65
66
|
className: "h-8",
|
|
66
|
-
onClick: () => void
|
|
67
|
+
onClick: () => void S(),
|
|
67
68
|
"data-hv-rerecord": !0,
|
|
68
69
|
children: "Re-record"
|
|
69
70
|
}
|
|
70
71
|
)
|
|
71
72
|
] })
|
|
72
73
|
] }),
|
|
73
|
-
|
|
74
|
+
L && /* @__PURE__ */ r(P, { conflict: V, onReload: D, "data-hv-versions-note": !0 }),
|
|
74
75
|
/* @__PURE__ */ r("div", { role: "status", "aria-live": "polite", children: f && /* @__PURE__ */ t(
|
|
75
76
|
"p",
|
|
76
77
|
{
|
|
@@ -90,7 +91,7 @@ function Z({
|
|
|
90
91
|
/* @__PURE__ */ r(N, { className: "h-4 w-4", "aria-hidden": !0 }),
|
|
91
92
|
/* @__PURE__ */ t("span", { children: [
|
|
92
93
|
"The versions couldn't load. ",
|
|
93
|
-
s.error
|
|
94
|
+
_(s.error, "")
|
|
94
95
|
] }),
|
|
95
96
|
/* @__PURE__ */ t(
|
|
96
97
|
c,
|
|
@@ -100,7 +101,7 @@ function Z({
|
|
|
100
101
|
className: "h-7",
|
|
101
102
|
onClick: () => void s.refetch(),
|
|
102
103
|
children: [
|
|
103
|
-
/* @__PURE__ */ r(
|
|
104
|
+
/* @__PURE__ */ r(O, { className: "!size-3.5" }),
|
|
104
105
|
" Try again"
|
|
105
106
|
]
|
|
106
107
|
}
|
|
@@ -156,7 +157,7 @@ function Z({
|
|
|
156
157
|
variant: "ghost",
|
|
157
158
|
className: "h-8",
|
|
158
159
|
disabled: h !== null,
|
|
159
|
-
onClick: () => void
|
|
160
|
+
onClick: () => void $(e.id, e.version),
|
|
160
161
|
"aria-label": `Restore version ${e.version}`,
|
|
161
162
|
"data-hv-restore": e.version,
|
|
162
163
|
children: h === e.id ? "Restoring…" : "Restore"
|
|
@@ -169,5 +170,5 @@ function Z({
|
|
|
169
170
|
] });
|
|
170
171
|
}
|
|
171
172
|
export {
|
|
172
|
-
|
|
173
|
+
re as VersionsTab
|
|
173
174
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as U, useQuery as P } from "@tanstack/react-query";
|
|
3
3
|
import { Users as K } from "lucide-react";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as E, useRef as i } from "react";
|
|
5
5
|
import { useItemEditAuth as Q, useNivaroClient as O } from "../../../context.js";
|
|
6
6
|
import { get as j } from "../../../lib/commands.js";
|
|
7
|
+
import { userErrorMessage as z } from "../../../lib/safe-error.js";
|
|
7
8
|
import { Button as x } from "../../ui/button.js";
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { helpVideoApi as
|
|
10
|
-
import { RemovableChip as
|
|
11
|
-
const b = ["help-videos", "author-roles"],
|
|
12
|
-
function
|
|
13
|
-
const { isAdmin: m } = Q(), p = O(), h = U(), [f, L] =
|
|
9
|
+
import { Popover as S, PopoverTrigger as B, PopoverContent as D } from "../../ui/popover.js";
|
|
10
|
+
import { helpVideoApi as k, helpVideoKeys as F } from "../api.js";
|
|
11
|
+
import { RemovableChip as V, PickerCombo as _ } from "../editor/PickerCombo.js";
|
|
12
|
+
const b = ["help-videos", "author-roles"], q = "text-[12.5px] text-muted-foreground", C = "flex items-center justify-between gap-2 rounded-md border border-rose-200 bg-rose-50 px-2.5 py-1.5 text-[12.5px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200";
|
|
13
|
+
function re() {
|
|
14
|
+
const { isAdmin: m } = Q(), p = O(), h = U(), [f, L] = E(!1), [N, v] = E(null), s = i(null), l = i([]), R = i(Promise.resolve()), c = i(0), y = i(0), d = P({
|
|
14
15
|
queryKey: b,
|
|
15
16
|
enabled: m && f,
|
|
16
17
|
queryFn: async () => {
|
|
17
|
-
const e = await
|
|
18
|
+
const e = await k(p).authorRoles();
|
|
18
19
|
return s.current = e, e;
|
|
19
20
|
}
|
|
20
21
|
}), o = P({
|
|
@@ -34,9 +35,9 @@ function Z() {
|
|
|
34
35
|
R.current = R.current.then(async () => {
|
|
35
36
|
if (y.current === n)
|
|
36
37
|
try {
|
|
37
|
-
await
|
|
38
|
+
await k(p).setAuthorRoles(r), s.current = r, h.invalidateQueries({ queryKey: F.all });
|
|
38
39
|
} catch (g) {
|
|
39
|
-
y.current += 1, v(`That change was not saved. ${g
|
|
40
|
+
y.current += 1, v(`That change was not saved. ${z(g, "")}`);
|
|
40
41
|
}
|
|
41
42
|
}).finally(() => {
|
|
42
43
|
c.current -= 1, c.current === 0 && s.current && (l.current = s.current, h.setQueryData(b, s.current));
|
|
@@ -45,26 +46,26 @@ function Z() {
|
|
|
45
46
|
c.current === 0 && (l.current = u);
|
|
46
47
|
const T = (e) => o.isPending ? "Remove role" : `Remove ${w(e)}`;
|
|
47
48
|
return /* @__PURE__ */ a(
|
|
48
|
-
|
|
49
|
+
S,
|
|
49
50
|
{
|
|
50
51
|
open: f,
|
|
51
52
|
onOpenChange: (e) => {
|
|
52
53
|
L(e), e || v(null);
|
|
53
54
|
},
|
|
54
55
|
children: [
|
|
55
|
-
/* @__PURE__ */ t(
|
|
56
|
+
/* @__PURE__ */ t(B, { asChild: !0, children: /* @__PURE__ */ a(x, { size: "sm", variant: "outline", "data-hv-author-roles": !0, children: [
|
|
56
57
|
/* @__PURE__ */ t(K, { className: "mr-1 h-4 w-4", "aria-hidden": !0 }),
|
|
57
58
|
" Who can record"
|
|
58
59
|
] }) }),
|
|
59
|
-
/* @__PURE__ */ a(
|
|
60
|
+
/* @__PURE__ */ a(D, { align: "end", className: "w-[min(320px,calc(100vw-2rem))] space-y-3 text-[13px]", children: [
|
|
60
61
|
/* @__PURE__ */ t("p", { className: "text-muted-foreground", children: "Administrators can always record and edit videos. Add roles to let their members do it too." }),
|
|
61
|
-
d.isPending ? /* @__PURE__ */ t("p", { className:
|
|
62
|
+
d.isPending ? /* @__PURE__ */ t("p", { className: q, role: "status", children: "Loading…" }) : d.isError ? /* @__PURE__ */ a("div", { className: C, role: "alert", children: [
|
|
62
63
|
/* @__PURE__ */ t("span", { children: "The roles that can record could not be loaded." }),
|
|
63
64
|
/* @__PURE__ */ t(x, { size: "sm", variant: "outline", onClick: () => void d.refetch(), children: "Try again" })
|
|
64
65
|
] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
65
|
-
u.length === 0 && /* @__PURE__ */ t("span", { className:
|
|
66
|
+
u.length === 0 && /* @__PURE__ */ t("span", { className: q, children: "No roles added yet." }),
|
|
66
67
|
u.map((e) => /* @__PURE__ */ t(
|
|
67
|
-
|
|
68
|
+
V,
|
|
68
69
|
{
|
|
69
70
|
"data-hv-author-role": e,
|
|
70
71
|
removeLabel: T(e),
|
|
@@ -74,7 +75,7 @@ function Z() {
|
|
|
74
75
|
e
|
|
75
76
|
)),
|
|
76
77
|
/* @__PURE__ */ t(
|
|
77
|
-
|
|
78
|
+
_,
|
|
78
79
|
{
|
|
79
80
|
ariaLabel: "Add a role",
|
|
80
81
|
placeholder: "Add a role",
|
|
@@ -95,5 +96,5 @@ function Z() {
|
|
|
95
96
|
);
|
|
96
97
|
}
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
re as AuthorRolesButton
|
|
99
100
|
};
|