@hydralms/components 0.1.0 → 0.1.1
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/components.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +442 -110
- package/dist/modules/CoursePlayer/CoursePlayer.d.ts +2 -0
- package/dist/modules/CoursePlayer/types.d.ts +59 -0
- package/dist/modules/FlashcardLab/FlashcardLab.d.ts +2 -0
- package/dist/modules/FlashcardLab/types.d.ts +55 -0
- package/dist/modules/QuizModule/QuizModule.d.ts +2 -0
- package/dist/modules/QuizModule/types.d.ts +54 -0
- package/dist/modules/index.d.ts +6 -0
- package/dist/provider/HydraProvider.d.ts +1 -1
- package/dist/sections.cjs +1 -1
- package/dist/sections.js +261 -291
- package/dist/table-BrS5cDQu.js +2510 -0
- package/dist/table-D6AkBBEo.cjs +1 -0
- package/dist/ui/alert-dialog.d.ts +14 -8
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/tabs.d.ts +15 -5
- package/dist/ui/tooltip.d.ts +12 -5
- package/dist/video/index.d.ts +6 -1
- package/dist/video/types.d.ts +167 -0
- package/dist/video/video-bookmark.d.ts +2 -0
- package/dist/video/video-chapter-list.d.ts +2 -0
- package/dist/video/video-playlist-item.d.ts +2 -0
- package/dist/video/video-thumbnail-card.d.ts +2 -0
- package/dist/video/video-transcript.d.ts +2 -0
- package/package.json +133 -24
- package/dist/table-CW4_BYny.js +0 -9869
- package/dist/table-DSBBqb9X.cjs +0 -56
package/dist/index.js
CHANGED
|
@@ -1,159 +1,491 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { A as
|
|
3
|
-
import { jsx as
|
|
4
|
-
|
|
1
|
+
import { c as l, f as g, a as h, P as N } from "./table-BrS5cDQu.js";
|
|
2
|
+
import { A as Z, b as J, d as K, e as O, g as W, h as X, i as Y, j as _, k as S, l as ee, m as ae, n as te, o as re, p as se, q as ie, B as le, r as oe, C as ne, s as de, t as ce, u as me, v as ue, w as fe, x as xe, y as pe, z as ge, D as he, E as be, F as ve, G as Ne, H as ye, I as Ce, J as Te, K as ze, L as we, M as De, N as Ae, O as je, Q as ke, R as Ve, S as Ie, T as Re, U as Be, V as Fe, W as Pe, X as He, Y as Le, Z as Me, _ as $e, $ as Ee, a0 as Qe, a1 as Ue, a2 as qe, a3 as Ge, a4 as Ze, a5 as Je, a6 as Ke, a7 as Oe, a8 as We, a9 as Xe, aa as Ye, ab as _e, ac as Se, ad as ea, ae as aa, af as ta, ag as ra, ah as sa, ai as ia, aj as la, ak as oa, al as na, am as da, an as ca, ao as ma } from "./table-BrS5cDQu.js";
|
|
3
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { Clock as y, Play as p, Video as C, Bookmark as T, Pencil as z, Trash2 as w, CheckCircle2 as D, Circle as A } from "lucide-react";
|
|
5
|
+
import { useRef as v, useEffect as j } from "react";
|
|
6
|
+
const B = ({
|
|
7
|
+
entries: a,
|
|
8
|
+
currentTime: r = 0,
|
|
9
|
+
onSeek: t,
|
|
10
|
+
readOnly: s = !1,
|
|
11
|
+
maxHeight: n = "400px",
|
|
12
|
+
className: c,
|
|
13
|
+
style: i
|
|
14
|
+
}) => {
|
|
15
|
+
const m = v(null), d = v(null), b = a.reduce(
|
|
16
|
+
(u, x, f) => x.time <= r ? f : u,
|
|
17
|
+
-1
|
|
18
|
+
);
|
|
19
|
+
return j(() => {
|
|
20
|
+
d.current && m.current && d.current.scrollIntoView({
|
|
21
|
+
behavior: "smooth",
|
|
22
|
+
block: "nearest"
|
|
23
|
+
});
|
|
24
|
+
}, [b]), a.length === 0 ? /* @__PURE__ */ o(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: l(
|
|
28
|
+
"flex flex-col items-center justify-center gap-2 rounded-md border border-border bg-muted p-6",
|
|
29
|
+
c
|
|
30
|
+
),
|
|
31
|
+
style: i,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ e(y, { size: 20, className: "text-muted-foreground" }),
|
|
34
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "No transcript available" })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
) : /* @__PURE__ */ e(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: m,
|
|
41
|
+
className: l(
|
|
42
|
+
"overflow-y-auto rounded-md border border-border",
|
|
43
|
+
c
|
|
44
|
+
),
|
|
45
|
+
style: { maxHeight: n, ...i },
|
|
46
|
+
children: a.map((u, x) => {
|
|
47
|
+
const f = x === b;
|
|
48
|
+
return /* @__PURE__ */ o(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref: f ? d : void 0,
|
|
52
|
+
className: l(
|
|
53
|
+
"flex gap-3 px-3 py-2 text-sm transition-colors",
|
|
54
|
+
f && "bg-primary/10",
|
|
55
|
+
!s && t && "cursor-pointer hover:bg-muted"
|
|
56
|
+
),
|
|
57
|
+
onClick: () => !s && (t == null ? void 0 : t(u.time)),
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
"span",
|
|
61
|
+
{
|
|
62
|
+
className: l(
|
|
63
|
+
"shrink-0 font-mono text-xs tabular-nums pt-0.5",
|
|
64
|
+
f ? "text-primary font-medium" : "text-muted-foreground"
|
|
65
|
+
),
|
|
66
|
+
children: g(Math.floor(u.time))
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
70
|
+
u.speaker && /* @__PURE__ */ o("span", { className: "mr-1 font-semibold text-foreground", children: [
|
|
71
|
+
u.speaker,
|
|
72
|
+
":"
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ e(
|
|
75
|
+
"span",
|
|
76
|
+
{
|
|
77
|
+
className: f ? "text-foreground" : "text-muted-foreground",
|
|
78
|
+
children: u.text
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] })
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
x
|
|
85
|
+
);
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}, F = ({
|
|
90
|
+
chapters: a,
|
|
91
|
+
currentTime: r = 0,
|
|
92
|
+
onSeek: t,
|
|
93
|
+
className: s,
|
|
94
|
+
style: n
|
|
95
|
+
}) => {
|
|
96
|
+
const c = a.reduce(
|
|
97
|
+
(i, m, d) => m.time <= r ? d : i,
|
|
98
|
+
-1
|
|
99
|
+
);
|
|
100
|
+
return /* @__PURE__ */ e(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: l(
|
|
104
|
+
"divide-y divide-border rounded-md border border-border",
|
|
105
|
+
s
|
|
106
|
+
),
|
|
107
|
+
style: n,
|
|
108
|
+
children: a.map((i, m) => {
|
|
109
|
+
const d = m === c;
|
|
110
|
+
return /* @__PURE__ */ o(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
className: l(
|
|
114
|
+
"flex items-center gap-3 p-3 transition-colors",
|
|
115
|
+
d && "bg-primary/10",
|
|
116
|
+
t && "cursor-pointer hover:bg-muted"
|
|
117
|
+
),
|
|
118
|
+
onClick: () => t == null ? void 0 : t(i.time),
|
|
119
|
+
children: [
|
|
120
|
+
i.thumbnail ? /* @__PURE__ */ o(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
className: "relative shrink-0 w-16 overflow-hidden rounded",
|
|
124
|
+
style: { aspectRatio: "16/9" },
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ e(
|
|
127
|
+
"img",
|
|
128
|
+
{
|
|
129
|
+
src: i.thumbnail,
|
|
130
|
+
alt: i.title,
|
|
131
|
+
className: "size-full object-cover"
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
d && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40", children: /* @__PURE__ */ e(p, { size: 14, className: "ml-px text-white" }) })
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
) : /* @__PURE__ */ e(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
className: l(
|
|
141
|
+
"flex shrink-0 items-center justify-center size-8 rounded-full",
|
|
142
|
+
d ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"
|
|
143
|
+
),
|
|
144
|
+
children: /* @__PURE__ */ e("span", { className: "text-xs font-semibold", children: m + 1 })
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
148
|
+
/* @__PURE__ */ e(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
className: l(
|
|
152
|
+
"truncate text-sm font-medium",
|
|
153
|
+
d ? "text-primary" : "text-foreground"
|
|
154
|
+
),
|
|
155
|
+
children: i.title
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ o("div", { className: "mt-0.5 flex items-center gap-2", children: [
|
|
159
|
+
/* @__PURE__ */ e("span", { className: "font-mono text-xs tabular-nums text-muted-foreground", children: g(Math.floor(i.time)) }),
|
|
160
|
+
i.duration != null && i.duration > 0 && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: h(i.duration) })
|
|
161
|
+
] })
|
|
162
|
+
] })
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
m
|
|
166
|
+
);
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}, P = ({
|
|
171
|
+
poster: a,
|
|
172
|
+
title: r,
|
|
173
|
+
duration: t,
|
|
174
|
+
progress: s,
|
|
175
|
+
onClick: n,
|
|
176
|
+
className: c,
|
|
177
|
+
style: i
|
|
178
|
+
}) => /* @__PURE__ */ o(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
className: l(
|
|
182
|
+
"group overflow-hidden rounded-lg border border-border transition-colors",
|
|
183
|
+
n && "cursor-pointer hover:border-primary/50 hover:shadow-sm",
|
|
184
|
+
c
|
|
185
|
+
),
|
|
186
|
+
style: i,
|
|
187
|
+
onClick: n,
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ o("div", { className: "relative overflow-hidden", style: { aspectRatio: "16/9" }, children: [
|
|
190
|
+
a ? /* @__PURE__ */ e(
|
|
191
|
+
"img",
|
|
192
|
+
{
|
|
193
|
+
src: a,
|
|
194
|
+
alt: r,
|
|
195
|
+
className: "size-full object-cover transition-transform duration-300 group-hover:scale-105"
|
|
196
|
+
}
|
|
197
|
+
) : /* @__PURE__ */ e("div", { className: "flex size-full items-center justify-center bg-muted", children: /* @__PURE__ */ e(C, { size: 32, className: "text-muted-foreground" }) }),
|
|
198
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/0 transition-colors group-hover:bg-black/20", children: /* @__PURE__ */ e("div", { className: "flex size-10 items-center justify-center rounded-full bg-black/60 opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ e(p, { size: 20, className: "ml-0.5 text-white" }) }) }),
|
|
199
|
+
t != null && t > 0 && /* @__PURE__ */ e("span", { className: "absolute bottom-2 right-2 rounded bg-black/75 px-1.5 py-0.5 text-xs font-medium tabular-nums text-white", children: h(t) })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e("h4", { className: "truncate text-sm font-medium text-foreground", children: r }) }),
|
|
202
|
+
s != null && s >= 0 && /* @__PURE__ */ e("div", { className: "px-3 pb-3", children: /* @__PURE__ */ e(
|
|
203
|
+
N,
|
|
204
|
+
{
|
|
205
|
+
value: s,
|
|
206
|
+
size: "sm",
|
|
207
|
+
variant: s >= 100 ? "success" : "default"
|
|
208
|
+
}
|
|
209
|
+
) })
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
), H = ({
|
|
213
|
+
bookmark: a,
|
|
214
|
+
onSeek: r,
|
|
215
|
+
onDelete: t,
|
|
216
|
+
onEdit: s,
|
|
217
|
+
className: n,
|
|
218
|
+
style: c
|
|
219
|
+
}) => /* @__PURE__ */ o(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
className: l(
|
|
223
|
+
"flex items-start gap-3 rounded-md border border-border p-3",
|
|
224
|
+
n
|
|
225
|
+
),
|
|
226
|
+
style: c,
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-center size-8 rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ e(T, { size: 16 }) }),
|
|
229
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
230
|
+
/* @__PURE__ */ e(
|
|
231
|
+
"button",
|
|
232
|
+
{
|
|
233
|
+
type: "button",
|
|
234
|
+
className: l(
|
|
235
|
+
"font-mono text-xs font-medium tabular-nums",
|
|
236
|
+
r ? "cursor-pointer text-primary hover:underline" : "text-muted-foreground"
|
|
237
|
+
),
|
|
238
|
+
onClick: () => r == null ? void 0 : r(a.time),
|
|
239
|
+
disabled: !r,
|
|
240
|
+
children: g(Math.floor(a.time))
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
a.note && /* @__PURE__ */ e("p", { className: "mt-0.5 text-sm text-foreground", children: a.note }),
|
|
244
|
+
a.createdAt && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: new Date(a.createdAt).toLocaleDateString() })
|
|
245
|
+
] }),
|
|
246
|
+
(s || t) && /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
247
|
+
s && /* @__PURE__ */ e(
|
|
248
|
+
"button",
|
|
249
|
+
{
|
|
250
|
+
type: "button",
|
|
251
|
+
className: "inline-flex items-center justify-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
252
|
+
"aria-label": "Edit bookmark",
|
|
253
|
+
onClick: () => s(a.id),
|
|
254
|
+
children: /* @__PURE__ */ e(z, { size: 14 })
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
t && /* @__PURE__ */ e(
|
|
258
|
+
"button",
|
|
259
|
+
{
|
|
260
|
+
type: "button",
|
|
261
|
+
className: "inline-flex items-center justify-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive",
|
|
262
|
+
"aria-label": "Delete bookmark",
|
|
263
|
+
onClick: () => t(a.id),
|
|
264
|
+
children: /* @__PURE__ */ e(w, { size: 14 })
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
] })
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
), L = ({
|
|
271
|
+
thumbnail: a,
|
|
272
|
+
title: r,
|
|
273
|
+
duration: t,
|
|
274
|
+
status: s = "unwatched",
|
|
275
|
+
isActive: n = !1,
|
|
276
|
+
index: c,
|
|
277
|
+
onClick: i,
|
|
278
|
+
className: m,
|
|
279
|
+
style: d
|
|
280
|
+
}) => /* @__PURE__ */ o(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
className: l(
|
|
284
|
+
"flex items-center gap-3 rounded-md px-3 py-2 transition-colors",
|
|
285
|
+
n && "bg-primary/10",
|
|
286
|
+
i && "cursor-pointer hover:bg-muted",
|
|
287
|
+
m
|
|
288
|
+
),
|
|
289
|
+
style: d,
|
|
290
|
+
onClick: i,
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-center size-6", children: s === "completed" ? /* @__PURE__ */ e("span", { className: "text-success", children: /* @__PURE__ */ e(D, { size: 18 }) }) : n ? /* @__PURE__ */ e("span", { className: "text-primary", children: /* @__PURE__ */ e(p, { size: 16, className: "ml-px" }) }) : c != null ? /* @__PURE__ */ e("span", { className: "text-xs font-medium tabular-nums text-muted-foreground", children: c }) : /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: /* @__PURE__ */ e(A, { size: 16 }) }) }),
|
|
293
|
+
a && /* @__PURE__ */ o(
|
|
294
|
+
"div",
|
|
295
|
+
{
|
|
296
|
+
className: "relative shrink-0 w-16 overflow-hidden rounded",
|
|
297
|
+
style: { aspectRatio: "16/9" },
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ e(
|
|
300
|
+
"img",
|
|
301
|
+
{
|
|
302
|
+
src: a,
|
|
303
|
+
alt: r,
|
|
304
|
+
className: l(
|
|
305
|
+
"size-full object-cover",
|
|
306
|
+
s === "completed" && "opacity-60"
|
|
307
|
+
)
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
n && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40", children: /* @__PURE__ */ e(p, { size: 12, className: "ml-px text-white" }) })
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
315
|
+
/* @__PURE__ */ e(
|
|
316
|
+
"div",
|
|
317
|
+
{
|
|
318
|
+
className: l(
|
|
319
|
+
"truncate text-sm",
|
|
320
|
+
n ? "font-medium text-primary" : "text-foreground",
|
|
321
|
+
s === "completed" && !n && "text-muted-foreground"
|
|
322
|
+
),
|
|
323
|
+
children: r
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
t != null && t > 0 && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: h(t) })
|
|
327
|
+
] })
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
function M({
|
|
5
332
|
children: a,
|
|
6
|
-
colorMode:
|
|
333
|
+
colorMode: r = "dark",
|
|
7
334
|
className: t,
|
|
8
|
-
style:
|
|
335
|
+
style: s
|
|
9
336
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ e(
|
|
11
338
|
"div",
|
|
12
339
|
{
|
|
13
|
-
className: `hydra-root${
|
|
14
|
-
style:
|
|
340
|
+
className: `hydra-root${r === "dark" ? " dark" : ""}${t ? ` ${t}` : ""}`,
|
|
341
|
+
style: s,
|
|
15
342
|
children: a
|
|
16
343
|
}
|
|
17
344
|
);
|
|
18
345
|
}
|
|
19
|
-
function
|
|
346
|
+
function $({
|
|
20
347
|
className: a,
|
|
21
|
-
...
|
|
348
|
+
...r
|
|
22
349
|
}) {
|
|
23
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ e(
|
|
24
351
|
"span",
|
|
25
352
|
{
|
|
26
353
|
"data-slot": "avatar",
|
|
27
|
-
className:
|
|
354
|
+
className: l(
|
|
28
355
|
"relative flex size-9 shrink-0 overflow-hidden rounded-full",
|
|
29
356
|
a
|
|
30
357
|
),
|
|
31
|
-
...
|
|
358
|
+
...r
|
|
32
359
|
}
|
|
33
360
|
);
|
|
34
361
|
}
|
|
35
|
-
function
|
|
362
|
+
function E({
|
|
36
363
|
className: a,
|
|
37
|
-
onError:
|
|
364
|
+
onError: r,
|
|
38
365
|
...t
|
|
39
366
|
}) {
|
|
40
|
-
return /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ e(
|
|
41
368
|
"img",
|
|
42
369
|
{
|
|
43
370
|
"data-slot": "avatar-image",
|
|
44
|
-
className:
|
|
45
|
-
onError:
|
|
371
|
+
className: l("aspect-square size-full object-cover", a),
|
|
372
|
+
onError: r,
|
|
46
373
|
...t
|
|
47
374
|
}
|
|
48
375
|
);
|
|
49
376
|
}
|
|
50
|
-
function
|
|
377
|
+
function Q({
|
|
51
378
|
className: a,
|
|
52
|
-
...
|
|
379
|
+
...r
|
|
53
380
|
}) {
|
|
54
|
-
return /* @__PURE__ */
|
|
381
|
+
return /* @__PURE__ */ e(
|
|
55
382
|
"span",
|
|
56
383
|
{
|
|
57
384
|
"data-slot": "avatar-fallback",
|
|
58
|
-
className:
|
|
385
|
+
className: l(
|
|
59
386
|
"bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-xs font-medium",
|
|
60
387
|
a
|
|
61
388
|
),
|
|
62
|
-
...
|
|
389
|
+
...r
|
|
63
390
|
}
|
|
64
391
|
);
|
|
65
392
|
}
|
|
66
|
-
function
|
|
67
|
-
return /* @__PURE__ */
|
|
393
|
+
function U({ className: a, ...r }) {
|
|
394
|
+
return /* @__PURE__ */ e(
|
|
68
395
|
"div",
|
|
69
396
|
{
|
|
70
397
|
"data-slot": "skeleton",
|
|
71
|
-
className:
|
|
72
|
-
...
|
|
398
|
+
className: l("bg-muted animate-pulse rounded-md", a),
|
|
399
|
+
...r
|
|
73
400
|
}
|
|
74
401
|
);
|
|
75
402
|
}
|
|
76
403
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
404
|
+
Z as Alert,
|
|
405
|
+
J as AlertDescription,
|
|
406
|
+
K as AlertDialog,
|
|
407
|
+
O as AlertDialogAction,
|
|
408
|
+
W as AlertDialogBackdrop,
|
|
409
|
+
X as AlertDialogCancel,
|
|
410
|
+
Y as AlertDialogContent,
|
|
411
|
+
_ as AlertDialogDescription,
|
|
412
|
+
S as AlertDialogFooter,
|
|
413
|
+
ee as AlertDialogHeader,
|
|
414
|
+
ae as AlertDialogPortal,
|
|
415
|
+
te as AlertDialogTitle,
|
|
416
|
+
re as AlertDialogTrigger,
|
|
417
|
+
se as AlertTitle,
|
|
418
|
+
ie as AssessmentToolbar,
|
|
419
|
+
$ as Avatar,
|
|
420
|
+
Q as AvatarFallback,
|
|
421
|
+
E as AvatarImage,
|
|
422
|
+
le as Badge,
|
|
423
|
+
oe as Button,
|
|
424
|
+
ne as Card,
|
|
425
|
+
de as CardAction,
|
|
426
|
+
ce as CardContent,
|
|
427
|
+
me as CardDescription,
|
|
428
|
+
ue as CardFooter,
|
|
429
|
+
fe as CardHeader,
|
|
430
|
+
xe as CardTitle,
|
|
431
|
+
pe as Choice,
|
|
432
|
+
ge as ConfirmDialog,
|
|
433
|
+
he as ContentBlock,
|
|
434
|
+
be as CurriculumItemRow,
|
|
435
|
+
ve as CurriculumTree,
|
|
436
|
+
Ne as DueDateDisplay,
|
|
437
|
+
ye as EmptyState,
|
|
438
|
+
Ce as Essay,
|
|
439
|
+
Te as FeedbackBanner,
|
|
440
|
+
ze as FileUploadZone,
|
|
441
|
+
we as FillInTheBlank,
|
|
442
|
+
De as Flashcard,
|
|
443
|
+
Ae as FlashcardDeck,
|
|
444
|
+
je as GradeIndicator,
|
|
445
|
+
M as HydraProvider,
|
|
446
|
+
ke as Input,
|
|
447
|
+
Ve as LearningObjectIcon,
|
|
448
|
+
Ie as LikertScale,
|
|
449
|
+
Re as MultipleChoice,
|
|
450
|
+
Be as PostCard,
|
|
451
|
+
N as Progress,
|
|
452
|
+
Fe as ProgressRing,
|
|
453
|
+
Pe as QuestionNavigator,
|
|
454
|
+
He as QuestionRenderer,
|
|
455
|
+
Le as SearchInput,
|
|
456
|
+
Me as Separator,
|
|
457
|
+
U as Skeleton,
|
|
458
|
+
$e as StarRating,
|
|
459
|
+
Ee as StatCard,
|
|
460
|
+
Qe as StatusBadge,
|
|
461
|
+
Ue as Table,
|
|
462
|
+
qe as TableBody,
|
|
463
|
+
Ge as TableCaption,
|
|
464
|
+
Ze as TableCell,
|
|
465
|
+
Je as TableFooter,
|
|
466
|
+
Ke as TableHead,
|
|
467
|
+
Oe as TableHeader,
|
|
468
|
+
We as TableRow,
|
|
469
|
+
Xe as Tabs,
|
|
470
|
+
Ye as TabsContent,
|
|
471
|
+
_e as TabsList,
|
|
472
|
+
Se as TabsTrigger,
|
|
473
|
+
ea as Textarea,
|
|
474
|
+
aa as TimerDisplay,
|
|
475
|
+
ta as Tooltip,
|
|
476
|
+
ra as TooltipContent,
|
|
477
|
+
sa as TooltipTrigger,
|
|
478
|
+
ia as TrueFalse,
|
|
479
|
+
la as UserAvatar,
|
|
480
|
+
H as VideoBookmark,
|
|
481
|
+
F as VideoChapterList,
|
|
482
|
+
oa as VideoPlayer,
|
|
483
|
+
L as VideoPlaylistItem,
|
|
484
|
+
P as VideoThumbnailCard,
|
|
485
|
+
B as VideoTranscript,
|
|
486
|
+
na as alertVariants,
|
|
487
|
+
da as badgeVariants,
|
|
488
|
+
ca as buttonVariants,
|
|
489
|
+
l as cn,
|
|
490
|
+
ma as progressVariants
|
|
159
491
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CoursePlayerProps } from './types';
|
|
2
|
+
export declare function CoursePlayer({ courseTitle, curriculum, progress, items, initialItemUid, onItemComplete, onItemChange, sidebarCollapsed, readOnly, className, style, }: CoursePlayerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CurriculumItem, CurriculumItemProgress } from '../../curriculum/types';
|
|
2
|
+
import { LessonBlock } from '../../content/types';
|
|
3
|
+
import { QuestionData } from '../../questions/types';
|
|
4
|
+
/**
|
|
5
|
+
* CoursePlayer — a complete course consumption shell with sidebar and content panel.
|
|
6
|
+
*
|
|
7
|
+
* Renders a collapsible CourseOutline sidebar alongside a content panel that
|
|
8
|
+
* switches between LessonPage, LecturePlayer, or PracticeQuiz based on the
|
|
9
|
+
* active item type. Includes a bottom bar with progress and navigation.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <CoursePlayer
|
|
13
|
+
* courseTitle="Introduction to React"
|
|
14
|
+
* curriculum={curriculum}
|
|
15
|
+
* items={courseItems}
|
|
16
|
+
* onItemComplete={(uid) => markComplete(uid)}
|
|
17
|
+
* />
|
|
18
|
+
*/
|
|
19
|
+
export interface CoursePlayerProps {
|
|
20
|
+
/** Course title displayed in the sidebar header */
|
|
21
|
+
courseTitle: string;
|
|
22
|
+
/** Hierarchical curriculum structure for the sidebar */
|
|
23
|
+
curriculum: CurriculumItem[];
|
|
24
|
+
/** User's progress data for completion indicators */
|
|
25
|
+
progress?: CurriculumItemProgress[];
|
|
26
|
+
/** Content data for each leaf curriculum item */
|
|
27
|
+
items: CoursePlayerItem[];
|
|
28
|
+
/** UID of the initially active item */
|
|
29
|
+
initialItemUid?: string;
|
|
30
|
+
/** Called when the user marks a content item as complete */
|
|
31
|
+
onItemComplete?: (itemUid: string) => void;
|
|
32
|
+
/** Called when the active item changes (user navigates) */
|
|
33
|
+
onItemChange?: (itemUid: string) => void;
|
|
34
|
+
/** Whether the sidebar starts collapsed. @default false */
|
|
35
|
+
sidebarCollapsed?: boolean;
|
|
36
|
+
/** When true, disables all interactive elements */
|
|
37
|
+
readOnly?: boolean;
|
|
38
|
+
/** CSS class name for the root element */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Inline styles for the root element */
|
|
41
|
+
style?: React.CSSProperties;
|
|
42
|
+
}
|
|
43
|
+
export type CoursePlayerItem = {
|
|
44
|
+
uid: string;
|
|
45
|
+
type: "lesson";
|
|
46
|
+
title: string;
|
|
47
|
+
blocks: LessonBlock[];
|
|
48
|
+
} | {
|
|
49
|
+
uid: string;
|
|
50
|
+
type: "video";
|
|
51
|
+
title: string;
|
|
52
|
+
src: string;
|
|
53
|
+
poster?: string;
|
|
54
|
+
} | {
|
|
55
|
+
uid: string;
|
|
56
|
+
type: "quiz";
|
|
57
|
+
title: string;
|
|
58
|
+
questions: QuestionData[];
|
|
59
|
+
};
|