@nivaro/react 0.3.45 → 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 +290 -23
- package/dist/index.js +679 -659
- package/dist/shared/components/BaseMap.js +149 -103
- 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/CommandCenterView.js +313 -69
- package/dist/shared/components/command-center/Customize.js +353 -0
- package/dist/shared/components/command-center/Header.js +279 -53
- package/dist/shared/components/command-center/KioskLinks.js +198 -0
- package/dist/shared/components/command-center/PeekPanel.js +144 -3
- package/dist/shared/components/command-center/announce.js +13 -0
- package/dist/shared/components/command-center/board-prefs.js +99 -0
- package/dist/shared/components/command-center/freshness.js +29 -0
- package/dist/shared/components/command-center/layout.js +56 -0
- package/dist/shared/components/command-center/panels/AttentionPanel.js +132 -3
- package/dist/shared/components/command-center/panels/Banner.js +75 -0
- package/dist/shared/components/command-center/panels/BoardSettings.js +224 -0
- package/dist/shared/components/command-center/panels/FeedPanel.js +145 -29
- package/dist/shared/components/command-center/panels/FlowPanel.js +154 -56
- package/dist/shared/components/command-center/panels/ForecastPanel.js +244 -3
- package/dist/shared/components/command-center/panels/MapLegend.js +266 -0
- package/dist/shared/components/command-center/panels/MapPanel.js +216 -66
- package/dist/shared/components/command-center/panels/PartnersPanel.js +49 -3
- package/dist/shared/components/command-center/panels/PeoplePanel.js +258 -40
- package/dist/shared/components/command-center/panels/RegionPicker.js +88 -3
- package/dist/shared/components/command-center/panels/SystemPanel.js +158 -38
- package/dist/shared/components/command-center/panels/ThroughputPanel.js +307 -3
- package/dist/shared/components/command-center/panels/TimeBar.js +227 -6
- package/dist/shared/components/command-center/panels/TrafficPanel.js +12 -8
- package/dist/shared/components/command-center/panels/WorkloadPanel.js +82 -3
- package/dist/shared/components/command-center/panels/attention-actions.js +267 -0
- package/dist/shared/components/command-center/panels/map-shared.js +95 -0
- package/dist/shared/components/command-center/panels/registry.js +87 -19
- package/dist/shared/components/command-center/shell-hooks.js +118 -0
- package/dist/shared/components/command-center/shortcuts.js +37 -0
- package/dist/shared/components/command-center/theme.js +39 -21
- package/dist/shared/components/command-center/time.js +52 -0
- package/dist/shared/components/command-center/url-state.js +54 -0
- package/dist/shared/components/command-center/work-links.js +32 -0
- 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/monitoring/TrafficMiniMap.js +111 -70
- 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,113 +1,116 @@
|
|
|
1
1
|
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Search as
|
|
4
|
-
import { useId as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
2
|
+
import { useQueryClient as Pe } from "@tanstack/react-query";
|
|
3
|
+
import { Search as Ee, Upload as Te, Plus as de, History as ce, Pencil as Ae, EyeOff as Re, Send as Ve, Archive as Ie, Trash2 as Le } from "lucide-react";
|
|
4
|
+
import { useId as Oe, useState as c, useRef as k, useEffect as H } from "react";
|
|
5
|
+
import { toast as T } from "sonner";
|
|
6
|
+
import { useNivaroClient as Ue, useApiFetchConfig as He, useItemEditAuth as qe } from "../../../context.js";
|
|
7
|
+
import { userErrorMessage as A } from "../../../lib/safe-error.js";
|
|
7
8
|
import { Button as n } from "../../ui/button.js";
|
|
8
|
-
import { Input as
|
|
9
|
-
import { modalHostOf as
|
|
10
|
-
import { useHelpVideoLibrary as
|
|
11
|
-
import { HelpVideoEditor as
|
|
12
|
-
import { canRecord as
|
|
13
|
-
import { useHelpVideoRecording as
|
|
9
|
+
import { Input as ze } from "../../ui/input.js";
|
|
10
|
+
import { modalHostOf as Be } from "../../ui/popover.js";
|
|
11
|
+
import { useHelpVideoLibrary as Fe, helpVideoApi as C, helpVideoKeys as y, helpVideoError as ue } from "../api.js";
|
|
12
|
+
import { HelpVideoEditor as Ke } from "../editor/HelpVideoEditor.js";
|
|
13
|
+
import { canRecord as Qe } from "../recorder/HelpVideoRecorder.js";
|
|
14
|
+
import { useHelpVideoRecording as je, RECORDING_BUSY as Me } from "../recorder/HelpVideoRecordingProvider.js";
|
|
14
15
|
import { useHelpVideoUpload as Ge } from "../upload/HelpVideoUpload.js";
|
|
15
|
-
import { emptyCopy as
|
|
16
|
-
import { HelpVideoSheet as
|
|
17
|
-
import { momentFromParams as
|
|
18
|
-
import { LearningPathsPanel as
|
|
19
|
-
import { PurgeVideoDialog as
|
|
20
|
-
import { RECORD_UNSUPPORTED as
|
|
21
|
-
const
|
|
16
|
+
import { emptyCopy as he, progressLabel as Ye, isGettingReady as Je, formatDuration as Xe, showingLabel as me } from "../viewer/format.js";
|
|
17
|
+
import { HelpVideoSheet as Ze } from "../viewer/HelpVideoSheet.js";
|
|
18
|
+
import { momentFromParams as We } from "../viewer/moments.js";
|
|
19
|
+
import { LearningPathsPanel as et } from "./LearningPathsPanel.js";
|
|
20
|
+
import { PurgeVideoDialog as tt } from "./PurgeVideoDialog.js";
|
|
21
|
+
import { RECORD_UNSUPPORTED as at } from "../recorder/RecorderStatus.js";
|
|
22
|
+
const rt = {
|
|
22
23
|
published: "Published",
|
|
23
24
|
draft: "Drafts",
|
|
24
25
|
archived: "Archived",
|
|
25
26
|
paths: "Paths"
|
|
26
|
-
},
|
|
27
|
-
function
|
|
28
|
-
watchId:
|
|
29
|
-
editId:
|
|
30
|
-
onWatch:
|
|
27
|
+
}, q = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan motion-reduce:transition-none";
|
|
28
|
+
function $t({
|
|
29
|
+
watchId: z,
|
|
30
|
+
editId: B,
|
|
31
|
+
onWatch: F,
|
|
31
32
|
onEdit: f,
|
|
32
|
-
headerExtra:
|
|
33
|
-
watchAt:
|
|
34
|
-
watchChapter:
|
|
33
|
+
headerExtra: pe,
|
|
34
|
+
watchAt: fe = null,
|
|
35
|
+
watchChapter: be = null
|
|
35
36
|
}) {
|
|
36
|
-
var
|
|
37
|
-
const N =
|
|
38
|
-
|
|
39
|
-
const e = window.setTimeout(() =>
|
|
37
|
+
var ae, re, se, ie, oe, le, ne;
|
|
38
|
+
const N = Ue(), b = Pe(), { apiBase: ge } = He(), xe = ge.replace(/\/api$/, ""), $ = Qe(), K = We(fe, be), Q = Oe(), [R, ye] = c(""), [S, Ne] = c(""), [g, we] = c(), [w, ve] = c("published"), D = je(), V = Ge({ onDone: (e) => f(e.id) }), [ke, j] = c(!1), [M, h] = c(null), [v, _] = c(() => /* @__PURE__ */ new Set()), { isAdmin: Ce } = qe(), [I, L] = c(null), [G, Y] = c(() => /* @__PURE__ */ new Set()), P = k(null), x = k(null), J = k(null), X = k(null), m = k(null);
|
|
39
|
+
H(() => {
|
|
40
|
+
const e = window.setTimeout(() => Ne(R.trim()), 300);
|
|
40
41
|
return () => window.clearTimeout(e);
|
|
41
|
-
}, [
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
}, [
|
|
42
|
+
}, [R]);
|
|
43
|
+
const E = w === "paths", O = E ? "published" : w, i = Fe({ search: S || void 0, category: g, status: O }), u = !!((ae = i.data) != null && ae.can_author), Z = ((re = i.data) == null ? void 0 : re.data.length) ?? 0, W = ((se = i.data) == null ? void 0 : se.total) ?? 0, $e = (((ie = i.data) == null ? void 0 : ie.data) ?? []).map((e) => e.id).join(",");
|
|
44
|
+
if (H(() => {
|
|
45
|
+
ee();
|
|
46
|
+
}, [$e]), H(() => {
|
|
46
47
|
h(null);
|
|
47
|
-
}, [S, g, w]),
|
|
48
|
-
return /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ t(
|
|
49
|
-
function
|
|
48
|
+
}, [S, g, w]), B)
|
|
49
|
+
return /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ t(Ke, { videoId: B, onClose: () => f(null) }) });
|
|
50
|
+
function ee() {
|
|
50
51
|
var r;
|
|
51
52
|
const e = x.current;
|
|
52
53
|
if (!e || !m.current || m.current.querySelector(`[data-hv-card="${e.gone}"]`)) return;
|
|
53
|
-
x.current = null, (r = (e.next ? m.current.querySelector(`[data-hv-purge="${e.next}"]`) : null) ??
|
|
54
|
+
x.current = null, (r = (e.next ? m.current.querySelector(`[data-hv-purge="${e.next}"]`) : null) ?? J.current) == null || r.focus();
|
|
54
55
|
}
|
|
55
|
-
const
|
|
56
|
+
const Se = async (e) => {
|
|
56
57
|
var p;
|
|
57
|
-
const s = ((p = i.data) == null ? void 0 : p.data) ?? [], r = s.findIndex((d) => d.id === e.id),
|
|
58
|
+
const s = ((p = i.data) == null ? void 0 : p.data) ?? [], r = s.findIndex((d) => d.id === e.id), o = s[r + 1] ?? s[r - 1];
|
|
58
59
|
try {
|
|
59
|
-
await C(N).purge(e.id),
|
|
60
|
+
await C(N).purge(e.id), T.success(`"${e.title}" deleted`);
|
|
60
61
|
} catch (d) {
|
|
61
|
-
const
|
|
62
|
-
if (!((
|
|
63
|
-
return (
|
|
62
|
+
const l = ue(d);
|
|
63
|
+
if (!((l == null ? void 0 : l.status) === 404 && l.code === "HELP_VIDEO_NOT_FOUND"))
|
|
64
|
+
return (l == null ? void 0 : l.code) === "HELP_VIDEO_NOT_ARCHIVED" && b.invalidateQueries({ queryKey: y.all }), { ok: !1, message: `It could not be deleted. ${A(d, "")}` };
|
|
64
65
|
}
|
|
65
|
-
return x.current = { gone: e.id, next: (
|
|
66
|
+
return x.current = { gone: e.id, next: (o == null ? void 0 : o.id) ?? null }, L(null), b.invalidateQueries({ queryKey: y.all }).then(
|
|
66
67
|
() => window.setTimeout(() => {
|
|
67
68
|
var d;
|
|
68
69
|
x.current && (x.current = null, (d = P.current) != null && d.isConnected && P.current.focus());
|
|
69
70
|
}, 0)
|
|
70
71
|
), { ok: !0 };
|
|
71
|
-
},
|
|
72
|
+
}, De = async (e) => {
|
|
72
73
|
var s;
|
|
73
74
|
if (!G.has(e.id)) {
|
|
74
|
-
h(null),
|
|
75
|
+
h(null), Y((r) => new Set(r).add(e.id));
|
|
75
76
|
try {
|
|
76
|
-
await C(N).dismissStale(e.id),
|
|
77
|
+
await C(N).dismissStale(e.id), T.success(`The note on "${e.title}" was dismissed`), b.invalidateQueries({ queryKey: y.all });
|
|
77
78
|
} catch (r) {
|
|
78
|
-
((s =
|
|
79
|
+
((s = ue(r)) == null ? void 0 : s.code) === "HELP_VIDEO_NOT_STALE" ? b.invalidateQueries({ queryKey: y.all }) : h(
|
|
80
|
+
`The note on "${e.title}" could not be dismissed. ${A(r, "")}`
|
|
81
|
+
);
|
|
79
82
|
} finally {
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
+
Y((r) => {
|
|
84
|
+
const o = new Set(r);
|
|
85
|
+
return o.delete(e.id), o;
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
|
-
},
|
|
89
|
+
}, te = async (e, s) => {
|
|
87
90
|
if (v.has(e.id)) return;
|
|
88
|
-
h(null), _((
|
|
91
|
+
h(null), _((o) => new Set(o).add(e.id));
|
|
89
92
|
const r = e.title || "Untitled video";
|
|
90
93
|
try {
|
|
91
|
-
s === "draft" ? await C(N).unpublish(e.id) : await C(N).publish(e.id, !1),
|
|
94
|
+
s === "draft" ? await C(N).unpublish(e.id) : await C(N).publish(e.id, !1), T.success(
|
|
92
95
|
s === "draft" ? `"${r}" is back in Drafts — viewers no longer see it` : `"${r}" is published again`
|
|
93
96
|
), b.invalidateQueries({ queryKey: y.all });
|
|
94
|
-
} catch (
|
|
97
|
+
} catch (o) {
|
|
95
98
|
h(
|
|
96
|
-
`"${r}" could not be ${s === "draft" ? "unpublished" : "published again"}. ${
|
|
99
|
+
`"${r}" could not be ${s === "draft" ? "unpublished" : "published again"}. ${A(o, "")}`
|
|
97
100
|
);
|
|
98
101
|
} finally {
|
|
99
|
-
_((
|
|
100
|
-
const p = new Set(
|
|
102
|
+
_((o) => {
|
|
103
|
+
const p = new Set(o);
|
|
101
104
|
return p.delete(e.id), p;
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
|
-
},
|
|
107
|
+
}, _e = async (e) => {
|
|
105
108
|
if (!v.has(e.id)) {
|
|
106
109
|
h(null), _((s) => new Set(s).add(e.id));
|
|
107
110
|
try {
|
|
108
|
-
await C(N).archive(e.id),
|
|
111
|
+
await C(N).archive(e.id), T.success(`"${e.title}" archived`), b.invalidateQueries({ queryKey: y.all });
|
|
109
112
|
} catch (s) {
|
|
110
|
-
h(`"${e.title}" could not be archived. ${s
|
|
113
|
+
h(`"${e.title}" could not be archived. ${A(s, "")}`);
|
|
111
114
|
} finally {
|
|
112
115
|
_((s) => {
|
|
113
116
|
const r = new Set(s);
|
|
@@ -121,18 +124,18 @@ function kt({
|
|
|
121
124
|
/* @__PURE__ */ t("h1", { className: "text-[16px] font-semibold", children: "Videos" }),
|
|
122
125
|
/* @__PURE__ */ a("div", { className: "relative min-w-[180px] flex-1 basis-full sm:basis-auto sm:max-w-[320px]", children: [
|
|
123
126
|
/* @__PURE__ */ t(
|
|
124
|
-
|
|
127
|
+
Ee,
|
|
125
128
|
{
|
|
126
129
|
"aria-hidden": "true",
|
|
127
130
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"
|
|
128
131
|
}
|
|
129
132
|
),
|
|
130
133
|
/* @__PURE__ */ t(
|
|
131
|
-
|
|
134
|
+
ze,
|
|
132
135
|
{
|
|
133
136
|
type: "search",
|
|
134
|
-
value:
|
|
135
|
-
onChange: (e) =>
|
|
137
|
+
value: R,
|
|
138
|
+
onChange: (e) => ye(e.target.value),
|
|
136
139
|
placeholder: "Search videos",
|
|
137
140
|
"aria-label": "Search videos",
|
|
138
141
|
className: "h-8 pl-8 text-[13px]",
|
|
@@ -147,25 +150,25 @@ function kt({
|
|
|
147
150
|
{
|
|
148
151
|
type: "button",
|
|
149
152
|
"aria-pressed": w === e,
|
|
150
|
-
onClick: () =>
|
|
151
|
-
className: `rounded-md px-2.5 py-1 text-[12.5px] transition-colors ${
|
|
153
|
+
onClick: () => ve(e),
|
|
154
|
+
className: `rounded-md px-2.5 py-1 text-[12.5px] transition-colors ${q} ${w === e ? "bg-nvr-cyan/10 font-medium" : "hover:bg-muted"}`,
|
|
152
155
|
"data-hv-status-tab": e,
|
|
153
|
-
children:
|
|
156
|
+
children: rt[e]
|
|
154
157
|
},
|
|
155
158
|
e
|
|
156
159
|
))
|
|
157
160
|
] }),
|
|
158
161
|
/* @__PURE__ */ a("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
159
|
-
|
|
162
|
+
pe,
|
|
160
163
|
u && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
161
|
-
!$ && /* @__PURE__ */ t("p", { id:
|
|
164
|
+
!$ && /* @__PURE__ */ t("p", { id: Q, className: "max-w-[260px] text-[12px] text-muted-foreground", children: at }),
|
|
162
165
|
/* @__PURE__ */ a(
|
|
163
166
|
n,
|
|
164
167
|
{
|
|
165
168
|
size: "sm",
|
|
166
169
|
variant: "outline",
|
|
167
|
-
onClick:
|
|
168
|
-
disabled:
|
|
170
|
+
onClick: V.pick,
|
|
171
|
+
disabled: V.busy,
|
|
169
172
|
"data-hv-upload": !0,
|
|
170
173
|
children: [
|
|
171
174
|
/* @__PURE__ */ t(Te, { className: "h-4 w-4" }),
|
|
@@ -177,14 +180,14 @@ function kt({
|
|
|
177
180
|
n,
|
|
178
181
|
{
|
|
179
182
|
size: "sm",
|
|
180
|
-
onClick: () =>
|
|
183
|
+
onClick: () => j(
|
|
181
184
|
!D.start({ onDone: (e) => f(e.id), from: m.current })
|
|
182
185
|
),
|
|
183
186
|
disabled: !$,
|
|
184
|
-
"aria-describedby": $ ? void 0 :
|
|
187
|
+
"aria-describedby": $ ? void 0 : Q,
|
|
185
188
|
"data-hv-record": !0,
|
|
186
189
|
children: [
|
|
187
|
-
/* @__PURE__ */ t(
|
|
190
|
+
/* @__PURE__ */ t(de, { className: "h-4 w-4" }),
|
|
188
191
|
" Record a video"
|
|
189
192
|
]
|
|
190
193
|
}
|
|
@@ -192,61 +195,61 @@ function kt({
|
|
|
192
195
|
] })
|
|
193
196
|
] })
|
|
194
197
|
] }),
|
|
195
|
-
!
|
|
198
|
+
!E && !!((oe = i.data) != null && oe.categories.length) && /* @__PURE__ */ t("div", { className: "flex shrink-0 flex-wrap gap-1 px-5 pt-3", children: [void 0, ...i.data.categories].map((e) => /* @__PURE__ */ t(
|
|
196
199
|
"button",
|
|
197
200
|
{
|
|
198
201
|
type: "button",
|
|
199
202
|
"aria-pressed": g === e,
|
|
200
|
-
onClick: () =>
|
|
201
|
-
className: `rounded-full border px-2.5 py-0.5 text-[12px] transition-colors ${
|
|
203
|
+
onClick: () => we(e),
|
|
204
|
+
className: `rounded-full border px-2.5 py-0.5 text-[12px] transition-colors ${q} ${g === e ? "border-nvr-cyan bg-nvr-cyan/10" : "border-border hover:bg-muted"}`,
|
|
202
205
|
children: e ?? "All"
|
|
203
206
|
},
|
|
204
207
|
e ?? "all"
|
|
205
208
|
)) }),
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
ke && D.active && /* @__PURE__ */ t("p", { role: "status", className: "mx-5 mt-3 text-[13px] text-rose-700 dark:text-rose-300", children: Me }),
|
|
210
|
+
M && /* @__PURE__ */ t(
|
|
208
211
|
"p",
|
|
209
212
|
{
|
|
210
213
|
role: "alert",
|
|
211
214
|
className: "mx-5 mt-3 rounded-md border border-rose-200 bg-rose-50 px-3 py-2 text-[13px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200",
|
|
212
215
|
"data-hv-archive-error": !0,
|
|
213
|
-
children:
|
|
216
|
+
children: M
|
|
214
217
|
}
|
|
215
218
|
),
|
|
216
|
-
|
|
219
|
+
E && u && /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-y-auto p-5", children: /* @__PURE__ */ t(et, {}) }),
|
|
217
220
|
/* @__PURE__ */ a(
|
|
218
221
|
"div",
|
|
219
222
|
{
|
|
220
|
-
ref:
|
|
223
|
+
ref: J,
|
|
221
224
|
tabIndex: -1,
|
|
222
225
|
className: "min-h-0 flex-1 overflow-y-auto p-5 focus:outline-none",
|
|
223
226
|
"data-hv-list": !0,
|
|
224
|
-
hidden:
|
|
227
|
+
hidden: E && u,
|
|
225
228
|
children: [
|
|
226
229
|
i.isLoading && /* @__PURE__ */ t("p", { className: "text-[13px] text-muted-foreground", children: "Loading…" }),
|
|
227
230
|
i.isError && /* @__PURE__ */ t("p", { role: "alert", className: "mb-3 text-[13px] text-rose-700 dark:text-rose-300", children: "Videos could not be loaded. Try again in a moment." }),
|
|
228
231
|
i.data && !i.data.data.length && !i.isError && /* @__PURE__ */ a("div", { className: "space-y-2", "data-hv-empty": !0, children: [
|
|
229
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] text-muted-foreground", children:
|
|
230
|
-
|
|
232
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] text-muted-foreground", children: he({ search: S, category: g, status: O, canAuthor: u }).text }),
|
|
233
|
+
he({ search: S, category: g, status: O, canAuthor: u }).offerRecord && $ && /* @__PURE__ */ a(
|
|
231
234
|
n,
|
|
232
235
|
{
|
|
233
236
|
size: "sm",
|
|
234
237
|
variant: "outline",
|
|
235
|
-
onClick: () =>
|
|
238
|
+
onClick: () => j(
|
|
236
239
|
!D.start({ onDone: (e) => f(e.id), from: m.current })
|
|
237
240
|
),
|
|
238
241
|
children: [
|
|
239
|
-
/* @__PURE__ */ t(
|
|
242
|
+
/* @__PURE__ */ t(de, { className: "h-4 w-4" }),
|
|
240
243
|
" Record one"
|
|
241
244
|
]
|
|
242
245
|
}
|
|
243
246
|
)
|
|
244
247
|
] }),
|
|
245
248
|
/* @__PURE__ */ t("ul", { className: "grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(240px,1fr))]", children: (((le = i.data) == null ? void 0 : le.data) ?? []).map((e) => {
|
|
246
|
-
var
|
|
247
|
-
const s =
|
|
249
|
+
var l;
|
|
250
|
+
const s = Ye(e), r = Je(e), o = ((l = e.published) == null ? void 0 : l.edits.chapters.length) ?? 0, p = !!e.published && e.required && !s.done && !r, d = [
|
|
248
251
|
e.category,
|
|
249
|
-
|
|
252
|
+
o > 1 ? `${o} chapters` : null,
|
|
250
253
|
e.published ? e.status === "draft" ? "Unpublished" : r ? "Getting ready" : s.text : "Draft"
|
|
251
254
|
].filter(Boolean).join(" · ");
|
|
252
255
|
return /* @__PURE__ */ a(
|
|
@@ -259,22 +262,22 @@ function kt({
|
|
|
259
262
|
"button",
|
|
260
263
|
{
|
|
261
264
|
type: "button",
|
|
262
|
-
className: `block w-full text-left ${
|
|
263
|
-
onClick: (
|
|
264
|
-
|
|
265
|
+
className: `block w-full text-left ${q}`,
|
|
266
|
+
onClick: (U) => {
|
|
267
|
+
X.current = U.currentTarget, e.published ? F(e.id) : f(e.id);
|
|
265
268
|
},
|
|
266
269
|
children: [
|
|
267
270
|
/* @__PURE__ */ a("div", { className: "relative aspect-video bg-slate-100 dark:bg-slate-800", children: [
|
|
268
271
|
e.poster_url && /* @__PURE__ */ t(
|
|
269
272
|
"img",
|
|
270
273
|
{
|
|
271
|
-
src: `${
|
|
274
|
+
src: `${xe}${e.poster_url}`,
|
|
272
275
|
alt: "",
|
|
273
276
|
className: "h-full w-full object-cover",
|
|
274
277
|
loading: "lazy"
|
|
275
278
|
}
|
|
276
279
|
),
|
|
277
|
-
!r && e.published && /* @__PURE__ */ t("span", { className: "absolute bottom-1.5 right-1.5 rounded bg-[#0f172a]/80 px-1.5 py-0.5 text-[11px] tabular-nums text-white", children:
|
|
280
|
+
!r && e.published && /* @__PURE__ */ t("span", { className: "absolute bottom-1.5 right-1.5 rounded bg-[#0f172a]/80 px-1.5 py-0.5 text-[11px] tabular-nums text-white", children: Xe(e.duration_ms) }),
|
|
278
281
|
e.my_progress && !s.done && e.my_progress.percent > 0 && /* @__PURE__ */ t("span", { className: "absolute inset-x-0 bottom-0 h-1 bg-black/20", children: /* @__PURE__ */ t(
|
|
279
282
|
"span",
|
|
280
283
|
{
|
|
@@ -299,7 +302,7 @@ function kt({
|
|
|
299
302
|
title: e.stale.detail,
|
|
300
303
|
"data-hv-stale": e.stale.kind,
|
|
301
304
|
children: [
|
|
302
|
-
/* @__PURE__ */ t(
|
|
305
|
+
/* @__PURE__ */ t(ce, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
303
306
|
/* @__PURE__ */ a("span", { className: "line-clamp-2", children: [
|
|
304
307
|
"May be out of date",
|
|
305
308
|
u ? `: ${e.stale.detail}` : ""
|
|
@@ -317,12 +320,12 @@ function kt({
|
|
|
317
320
|
{
|
|
318
321
|
size: "sm",
|
|
319
322
|
variant: "ghost",
|
|
320
|
-
onClick: () => void
|
|
323
|
+
onClick: () => void De(e),
|
|
321
324
|
disabled: G.has(e.id),
|
|
322
325
|
"aria-label": `Dismiss the out-of-date note on ${e.title || "Untitled video"}`,
|
|
323
326
|
"data-hv-stale-dismiss": e.id,
|
|
324
327
|
children: [
|
|
325
|
-
/* @__PURE__ */ t(
|
|
328
|
+
/* @__PURE__ */ t(ce, { className: "h-3.5 w-3.5" }),
|
|
326
329
|
" Dismiss"
|
|
327
330
|
]
|
|
328
331
|
}
|
|
@@ -335,7 +338,7 @@ function kt({
|
|
|
335
338
|
onClick: () => f(e.id),
|
|
336
339
|
"data-hv-edit": e.id,
|
|
337
340
|
children: [
|
|
338
|
-
/* @__PURE__ */ t(
|
|
341
|
+
/* @__PURE__ */ t(Ae, { className: "h-3.5 w-3.5" }),
|
|
339
342
|
" Edit"
|
|
340
343
|
]
|
|
341
344
|
}
|
|
@@ -345,12 +348,12 @@ function kt({
|
|
|
345
348
|
{
|
|
346
349
|
size: "sm",
|
|
347
350
|
variant: "ghost",
|
|
348
|
-
onClick: () => void
|
|
351
|
+
onClick: () => void te(e, "draft"),
|
|
349
352
|
disabled: v.has(e.id),
|
|
350
353
|
"data-tip": "Back to Drafts: viewers stop seeing it until you publish it again",
|
|
351
354
|
"data-hv-unpublish": e.id,
|
|
352
355
|
children: [
|
|
353
|
-
/* @__PURE__ */ t(
|
|
356
|
+
/* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5" }),
|
|
354
357
|
" Unpublish"
|
|
355
358
|
]
|
|
356
359
|
}
|
|
@@ -360,12 +363,12 @@ function kt({
|
|
|
360
363
|
{
|
|
361
364
|
size: "sm",
|
|
362
365
|
variant: "ghost",
|
|
363
|
-
onClick: () => void
|
|
366
|
+
onClick: () => void te(e, "published"),
|
|
364
367
|
disabled: v.has(e.id),
|
|
365
368
|
"data-tip": "Put the last published version back for viewers",
|
|
366
369
|
"data-hv-republish": e.id,
|
|
367
370
|
children: [
|
|
368
|
-
/* @__PURE__ */ t(
|
|
371
|
+
/* @__PURE__ */ t(Ve, { className: "h-3.5 w-3.5" }),
|
|
369
372
|
" Publish again"
|
|
370
373
|
]
|
|
371
374
|
}
|
|
@@ -375,28 +378,28 @@ function kt({
|
|
|
375
378
|
{
|
|
376
379
|
size: "sm",
|
|
377
380
|
variant: "ghost",
|
|
378
|
-
onClick: () => void
|
|
381
|
+
onClick: () => void _e(e),
|
|
379
382
|
disabled: v.has(e.id),
|
|
380
383
|
"data-hv-archive": e.id,
|
|
381
384
|
children: [
|
|
382
|
-
/* @__PURE__ */ t(
|
|
385
|
+
/* @__PURE__ */ t(Ie, { className: "h-3.5 w-3.5" }),
|
|
383
386
|
" Archive"
|
|
384
387
|
]
|
|
385
388
|
}
|
|
386
389
|
),
|
|
387
|
-
|
|
390
|
+
Ce && e.status === "archived" && /* @__PURE__ */ a(
|
|
388
391
|
n,
|
|
389
392
|
{
|
|
390
393
|
size: "sm",
|
|
391
394
|
variant: "ghost",
|
|
392
395
|
className: "text-rose-700 hover:text-rose-800 dark:text-rose-300 dark:hover:text-rose-200",
|
|
393
|
-
onClick: (
|
|
394
|
-
P.current =
|
|
396
|
+
onClick: (U) => {
|
|
397
|
+
P.current = U.currentTarget, L(e);
|
|
395
398
|
},
|
|
396
399
|
"aria-label": `Delete permanently: ${e.title || "Untitled video"}`,
|
|
397
400
|
"data-hv-purge": e.id,
|
|
398
401
|
children: [
|
|
399
|
-
/* @__PURE__ */ t(
|
|
402
|
+
/* @__PURE__ */ t(Le, { className: "h-3.5 w-3.5" }),
|
|
400
403
|
" Delete permanently"
|
|
401
404
|
]
|
|
402
405
|
}
|
|
@@ -419,39 +422,39 @@ function kt({
|
|
|
419
422
|
children: i.isFetchingNextPage ? "Loading…" : "Show more"
|
|
420
423
|
}
|
|
421
424
|
),
|
|
422
|
-
|
|
425
|
+
me(Z, W) && /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", "aria-live": "polite", children: me(Z, W) })
|
|
423
426
|
] })
|
|
424
427
|
]
|
|
425
428
|
}
|
|
426
429
|
),
|
|
427
|
-
|
|
428
|
-
|
|
430
|
+
I && /* @__PURE__ */ t(
|
|
431
|
+
tt,
|
|
429
432
|
{
|
|
430
|
-
title:
|
|
431
|
-
container:
|
|
432
|
-
onConfirm: () =>
|
|
433
|
-
onClose: () =>
|
|
433
|
+
title: I.title || "Untitled video",
|
|
434
|
+
container: Be((ne = m.current) == null ? void 0 : ne.firstElementChild),
|
|
435
|
+
onConfirm: () => Se(I),
|
|
436
|
+
onClose: () => L(null),
|
|
434
437
|
restoreFocus: () => {
|
|
435
438
|
var e;
|
|
436
|
-
x.current ?
|
|
439
|
+
x.current ? ee() : (e = P.current) == null || e.focus();
|
|
437
440
|
}
|
|
438
441
|
}
|
|
439
442
|
),
|
|
440
443
|
/* @__PURE__ */ t(
|
|
441
|
-
|
|
444
|
+
Ze,
|
|
442
445
|
{
|
|
443
|
-
videoId:
|
|
444
|
-
open: !!
|
|
445
|
-
onOpenChange: (e) => !e &&
|
|
446
|
-
returnFocusRef:
|
|
447
|
-
startAtMs:
|
|
448
|
-
startChapterId:
|
|
446
|
+
videoId: z,
|
|
447
|
+
open: !!z,
|
|
448
|
+
onOpenChange: (e) => !e && F(null),
|
|
449
|
+
returnFocusRef: X,
|
|
450
|
+
startAtMs: K.atMs,
|
|
451
|
+
startChapterId: K.chapterId
|
|
449
452
|
}
|
|
450
453
|
),
|
|
451
454
|
D.fallback,
|
|
452
|
-
|
|
455
|
+
V.ui
|
|
453
456
|
] });
|
|
454
457
|
}
|
|
455
458
|
export {
|
|
456
|
-
|
|
459
|
+
$t as HelpVideoLibrary
|
|
457
460
|
};
|