saha-ui 1.22.4 → 1.22.5
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/DragDrop/DebugOverlay.d.ts.map +1 -1
- package/dist/components/DragDrop/DebugOverlay.js +147 -77
- package/dist/components/DragDrop/DragDropContext.d.ts.map +1 -1
- package/dist/components/DragDrop/DragDropContext.js +164 -124
- package/dist/components/DragDrop/DragOverlay.d.ts.map +1 -1
- package/dist/components/DragDrop/DragOverlay.js +15 -14
- package/dist/components/DragDrop/SelectionManager.d.ts.map +1 -1
- package/dist/components/DragDrop/SelectionManager.js +62 -55
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +302 -273
- package/dist/components/VideoPlayer/Controls.d.ts +2 -1
- package/dist/components/VideoPlayer/Controls.d.ts.map +1 -1
- package/dist/components/VideoPlayer/Controls.js +66 -63
- package/dist/components/VideoPlayer/VideoPlayer.types.d.ts +17 -1
- package/dist/components/VideoPlayer/VideoPlayer.types.d.ts.map +1 -1
- package/dist/components/VideoPlayer/index.d.ts.map +1 -1
- package/dist/components/VideoPlayer/index.js +298 -167
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,83 +1,114 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { videoElementVariants as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
sources:
|
|
8
|
-
poster:
|
|
9
|
-
thumbnail:
|
|
10
|
-
captions:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsxs as g, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as w, useState as s, useEffect as m } from "react";
|
|
3
|
+
import { cn as k } from "../../lib/utils.js";
|
|
4
|
+
import { videoElementVariants as Me, playButtonVariants as Ce, controlBarVariants as Ie, videoPlayerVariants as Ne } from "./VideoPlayer.styles.js";
|
|
5
|
+
import De from "./Controls.js";
|
|
6
|
+
const Re = ({
|
|
7
|
+
sources: y,
|
|
8
|
+
poster: ee,
|
|
9
|
+
thumbnail: te,
|
|
10
|
+
captions: M,
|
|
11
|
+
crossOrigin: ne,
|
|
12
|
+
className: re,
|
|
13
|
+
autoplay: oe = !1,
|
|
14
|
+
loop: ce = !1,
|
|
15
|
+
muted: ae = !1,
|
|
16
|
+
controls: ie = !1,
|
|
17
|
+
onPlay: V,
|
|
18
|
+
onPause: q,
|
|
19
|
+
variant: se = "default",
|
|
20
|
+
size: ue = "md",
|
|
21
|
+
title: U = "",
|
|
22
|
+
loadStrategy: F = "native",
|
|
23
|
+
...le
|
|
22
24
|
}) => {
|
|
23
|
-
const a =
|
|
24
|
-
|
|
25
|
-
const e = () => {
|
|
26
|
-
typeof document > "u" || oe(!!document.fullscreenElement);
|
|
27
|
-
};
|
|
28
|
-
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
29
|
-
}, []), v(() => {
|
|
25
|
+
const a = w(null), h = w(null), [l, K] = s(!1), [O, $] = s(0), [C, z] = s(0), [de, E] = s(1), [W, P] = s(!!ae), [me, fe] = s(1), [I, f] = s(!0), [L, ve] = s(0), [pe, T] = s(!1), [H, N] = s(!1), [D, ye] = s(null), [he, Q] = s(!1), R = w(null), [be, ge] = s(0), v = w(null), u = w(null), j = ee || te || null;
|
|
26
|
+
m(() => {
|
|
30
27
|
const e = a.current;
|
|
31
28
|
if (!e) return;
|
|
29
|
+
try {
|
|
30
|
+
const x = !!(typeof document < "u" && document.pictureInPictureEnabled && typeof e.requestPictureInPicture == "function");
|
|
31
|
+
Q(x);
|
|
32
|
+
} catch {
|
|
33
|
+
Q(!1);
|
|
34
|
+
}
|
|
32
35
|
const t = () => {
|
|
33
|
-
if (
|
|
36
|
+
if (!j && !D)
|
|
34
37
|
try {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
38
|
+
const x = e.videoWidth || 1280, _ = e.videoHeight || 720, S = document.createElement("canvas");
|
|
39
|
+
S.width = x, S.height = _;
|
|
40
|
+
const Z = S.getContext("2d");
|
|
41
|
+
if (Z) {
|
|
42
|
+
Z.drawImage(e, 0, 0, x, _);
|
|
43
|
+
const Se = S.toDataURL("image/jpeg", 0.8);
|
|
44
|
+
ye(Se);
|
|
42
45
|
}
|
|
43
46
|
} catch {
|
|
44
47
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
z(e.duration || 0);
|
|
49
|
+
}, r = () => T(!0), n = () => T(!1), c = () => T(!1), i = () => T(!0), d = () => $(e.currentTime || 0), J = () => {
|
|
50
|
+
K(!0), V?.();
|
|
51
|
+
}, X = () => {
|
|
52
|
+
K(!1), q?.();
|
|
53
|
+
}, Y = () => {
|
|
54
|
+
E(e.volume ?? 0), P(!!e.muted);
|
|
51
55
|
};
|
|
52
|
-
return e.addEventListener("loadedmetadata", t), e.addEventListener("timeupdate",
|
|
53
|
-
e.removeEventListener("loadedmetadata", t), e.removeEventListener("timeupdate",
|
|
56
|
+
return e.addEventListener("loadedmetadata", t), e.addEventListener("timeupdate", d), e.addEventListener("play", J), e.addEventListener("pause", X), e.addEventListener("volumechange", Y), e.addEventListener("waiting", r), e.addEventListener("playing", n), e.addEventListener("canplay", c), e.addEventListener("stalled", i), E(e.volume ?? 1), P(!!e.muted), z(e.duration || 0), () => {
|
|
57
|
+
e.removeEventListener("loadedmetadata", t), e.removeEventListener("timeupdate", d), e.removeEventListener("play", J), e.removeEventListener("pause", X), e.removeEventListener("volumechange", Y), e.removeEventListener("waiting", r), e.removeEventListener("playing", n), e.removeEventListener("canplay", c), e.removeEventListener("stalled", i);
|
|
54
58
|
};
|
|
55
59
|
}, [
|
|
60
|
+
L,
|
|
61
|
+
V,
|
|
56
62
|
q,
|
|
57
|
-
|
|
58
|
-
S,
|
|
59
|
-
N,
|
|
63
|
+
j,
|
|
60
64
|
D
|
|
61
|
-
]),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (!
|
|
65
|
-
|
|
65
|
+
]), m(() => {
|
|
66
|
+
if (F !== "fetch") return;
|
|
67
|
+
const e = a.current;
|
|
68
|
+
if (!e) return;
|
|
69
|
+
let t = !1, r = null;
|
|
70
|
+
return (async () => {
|
|
71
|
+
const c = y[L]?.src;
|
|
72
|
+
if (c)
|
|
73
|
+
try {
|
|
74
|
+
const i = await fetch(c, { mode: "cors" });
|
|
75
|
+
if (!i.ok) throw new Error(`Failed to fetch video: ${i.status}`);
|
|
76
|
+
const d = await i.blob();
|
|
77
|
+
if (t) return;
|
|
78
|
+
r = URL.createObjectURL(d), R.current = r, e.src = r, e.load();
|
|
79
|
+
} catch (i) {
|
|
80
|
+
console.error("fetch+attach video failed:", i);
|
|
81
|
+
}
|
|
82
|
+
})(), () => {
|
|
83
|
+
if (t = !0, r) {
|
|
84
|
+
try {
|
|
85
|
+
URL.revokeObjectURL(r);
|
|
86
|
+
} catch {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
R.current === r && (R.current = null);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}, [F, L, y]), m(() => () => {
|
|
93
|
+
u.current && window.clearTimeout(u.current), v.current && window.clearTimeout(v.current);
|
|
94
|
+
}, []), m(() => {
|
|
95
|
+
if (!l) {
|
|
96
|
+
f(!0), u.current && window.clearTimeout(u.current);
|
|
66
97
|
return;
|
|
67
98
|
}
|
|
68
|
-
|
|
69
|
-
() =>
|
|
99
|
+
f(!0), u.current && window.clearTimeout(u.current), u.current = window.setTimeout(
|
|
100
|
+
() => f(!1),
|
|
70
101
|
2500
|
|
71
102
|
);
|
|
72
|
-
}, [
|
|
73
|
-
const
|
|
103
|
+
}, [l]);
|
|
104
|
+
const p = (e) => {
|
|
74
105
|
const t = a.current;
|
|
75
106
|
if (t)
|
|
76
107
|
try {
|
|
77
|
-
t.currentTime = Math.max(0, Math.min(e, t.duration || e)),
|
|
108
|
+
t.currentTime = Math.max(0, Math.min(e, t.duration || e)), $(t.currentTime || 0);
|
|
78
109
|
} catch {
|
|
79
110
|
}
|
|
80
|
-
},
|
|
111
|
+
}, b = async () => {
|
|
81
112
|
const e = a.current;
|
|
82
113
|
if (e)
|
|
83
114
|
if (e.paused)
|
|
@@ -87,68 +118,136 @@ const Te = ({
|
|
|
87
118
|
}
|
|
88
119
|
else
|
|
89
120
|
e.pause();
|
|
90
|
-
},
|
|
121
|
+
}, A = (e) => {
|
|
91
122
|
const t = a.current;
|
|
92
|
-
t && (t.volume = Math.max(0, Math.min(1, e)),
|
|
93
|
-
},
|
|
123
|
+
t && (t.volume = Math.max(0, Math.min(1, e)), E(t.volume), t.volume === 0 && (t.muted = !0), P(!!t.muted));
|
|
124
|
+
}, G = () => {
|
|
94
125
|
const e = a.current;
|
|
95
|
-
e && (e.muted = !e.muted, !e.muted && e.volume === 0 && (e.volume = 0.2,
|
|
96
|
-
},
|
|
126
|
+
e && (e.muted = !e.muted, !e.muted && e.volume === 0 && (e.volume = 0.2, E(0.2)), P(!!e.muted));
|
|
127
|
+
}, we = (e) => {
|
|
97
128
|
const t = a.current;
|
|
98
|
-
t && (t.playbackRate = e,
|
|
99
|
-
},
|
|
129
|
+
t && (t.playbackRate = e, fe(e));
|
|
130
|
+
}, B = async () => {
|
|
100
131
|
try {
|
|
101
132
|
if (typeof document > "u") return;
|
|
102
|
-
document.fullscreenElement ? await document.exitFullscreen() :
|
|
133
|
+
document.fullscreenElement ? (await document.exitFullscreen(), N(!1)) : h.current && (await h.current.requestFullscreen(), N(!0));
|
|
103
134
|
} catch {
|
|
104
135
|
}
|
|
105
|
-
}
|
|
136
|
+
};
|
|
137
|
+
m(() => {
|
|
138
|
+
const e = () => {
|
|
139
|
+
N(!!document.fullscreenElement);
|
|
140
|
+
};
|
|
141
|
+
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
142
|
+
}, []);
|
|
143
|
+
const ke = async () => {
|
|
106
144
|
const e = a.current;
|
|
107
145
|
if (!(!e || typeof document > "u"))
|
|
108
146
|
try {
|
|
109
|
-
|
|
110
|
-
|
|
147
|
+
const t = document;
|
|
148
|
+
if (!!!(e.currentSrc || e.src || e.srcObject)) {
|
|
149
|
+
console.warn("No video source available for Picture-in-Picture", {
|
|
150
|
+
currentSrc: e.currentSrc,
|
|
151
|
+
src: e.src,
|
|
152
|
+
srcObject: e.srcObject
|
|
153
|
+
});
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if ((e.readyState ?? 0) < 1) {
|
|
157
|
+
console.warn(
|
|
158
|
+
"Video not ready for Picture-in-Picture (readyState < HAVE_METADATA)",
|
|
159
|
+
{ readyState: e.readyState }
|
|
160
|
+
);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (t.pictureInPictureEnabled && typeof e.requestPictureInPicture == "function") {
|
|
164
|
+
t.pictureInPictureElement ? await t.exitPictureInPicture() : await e.requestPictureInPicture();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const n = e;
|
|
168
|
+
if (typeof n.webkitSupportsPresentationMode == "function" && typeof n.webkitSetPresentationMode == "function")
|
|
169
|
+
try {
|
|
170
|
+
n.webkitPresentationMode === "picture-in-picture" ? n.webkitSetPresentationMode("inline") : n.webkitSetPresentationMode("picture-in-picture");
|
|
171
|
+
return;
|
|
172
|
+
} catch (c) {
|
|
173
|
+
console.error("webkitSetPresentationMode failed:", c);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
console.warn("Picture-in-Picture is not supported in this environment");
|
|
177
|
+
} catch (t) {
|
|
178
|
+
console.error("requestPictureInPicture failed:", t);
|
|
111
179
|
}
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
() =>
|
|
180
|
+
}, Ee = () => {
|
|
181
|
+
f(!0), l && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(
|
|
182
|
+
() => f(!1),
|
|
115
183
|
2500
|
|
116
184
|
));
|
|
117
185
|
};
|
|
118
|
-
|
|
186
|
+
m(() => {
|
|
187
|
+
const e = h.current;
|
|
188
|
+
if (!e) return;
|
|
189
|
+
const t = () => {
|
|
190
|
+
try {
|
|
191
|
+
const r = document.body.style.cursor || "", n = document.documentElement.style.cursor || "", c = window.getComputedStyle(document.body).cursor || "", i = window.getComputedStyle(document.documentElement).cursor || "", d = r || n || c || i || "";
|
|
192
|
+
/^grab(?:bing)?$|^grabbing$|^move$/i.test(d) && (document.body.style.cursor = "", document.documentElement.style.cursor = "");
|
|
193
|
+
} catch {
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
return e.addEventListener("pointerdown", t), e.addEventListener("mouseenter", t), e.addEventListener("click", t), () => {
|
|
197
|
+
e.removeEventListener("pointerdown", t), e.removeEventListener("mouseenter", t), e.removeEventListener("click", t);
|
|
198
|
+
};
|
|
199
|
+
}, []), m(() => {
|
|
200
|
+
try {
|
|
201
|
+
const r = document.body.style.cursor || "", n = document.documentElement.style.cursor || "", c = window.getComputedStyle(document.body).cursor || "", i = window.getComputedStyle(document.documentElement).cursor || "";
|
|
202
|
+
/^grab(?:bing)?$|^grabbing$|^move$/i.test(
|
|
203
|
+
r || n || c || i || ""
|
|
204
|
+
) && (document.body.style.cursor = "", document.documentElement.style.cursor = "");
|
|
205
|
+
} catch {
|
|
206
|
+
}
|
|
207
|
+
const e = h.current;
|
|
208
|
+
if (!e) return;
|
|
209
|
+
const t = e.style.cursor;
|
|
210
|
+
return e.style.cursor = "auto", () => {
|
|
211
|
+
try {
|
|
212
|
+
e.style.cursor = t || "";
|
|
213
|
+
} catch {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
}, []), m(() => {
|
|
119
218
|
const e = (t) => {
|
|
120
219
|
if (!a.current) return;
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const
|
|
220
|
+
const r = document.activeElement?.tagName || "";
|
|
221
|
+
if (r === "INPUT" || r === "TEXTAREA") return;
|
|
222
|
+
const n = a.current;
|
|
124
223
|
switch (t.code) {
|
|
125
224
|
case "Space":
|
|
126
225
|
case "KeyK":
|
|
127
|
-
t.preventDefault(),
|
|
226
|
+
t.preventDefault(), b();
|
|
128
227
|
break;
|
|
129
228
|
case "ArrowRight":
|
|
130
|
-
|
|
229
|
+
p((n.currentTime || 0) + 5);
|
|
131
230
|
break;
|
|
132
231
|
case "ArrowLeft":
|
|
133
|
-
|
|
232
|
+
p((n.currentTime || 0) - 5);
|
|
134
233
|
break;
|
|
135
234
|
case "KeyL":
|
|
136
|
-
|
|
235
|
+
p((n.currentTime || 0) + 10);
|
|
137
236
|
break;
|
|
138
237
|
case "KeyJ":
|
|
139
|
-
|
|
238
|
+
p((n.currentTime || 0) - 10);
|
|
140
239
|
break;
|
|
141
240
|
case "ArrowUp":
|
|
142
|
-
|
|
241
|
+
A(Math.min(1, (n.volume || 0) + 0.05));
|
|
143
242
|
break;
|
|
144
243
|
case "ArrowDown":
|
|
145
|
-
|
|
244
|
+
A(Math.max(0, (n.volume || 0) - 0.05));
|
|
146
245
|
break;
|
|
147
246
|
case "KeyF":
|
|
148
|
-
|
|
247
|
+
B();
|
|
149
248
|
break;
|
|
150
249
|
case "KeyM":
|
|
151
|
-
|
|
250
|
+
G();
|
|
152
251
|
break;
|
|
153
252
|
case "Digit0":
|
|
154
253
|
case "Digit1":
|
|
@@ -160,100 +259,101 @@ const Te = ({
|
|
|
160
259
|
case "Digit7":
|
|
161
260
|
case "Digit8":
|
|
162
261
|
case "Digit9": {
|
|
163
|
-
const
|
|
164
|
-
d
|
|
262
|
+
const i = parseInt(t.code.replace("Digit", ""), 10) / 10, d = (n.duration || 0) * i;
|
|
263
|
+
p(d);
|
|
165
264
|
break;
|
|
166
265
|
}
|
|
167
266
|
}
|
|
168
267
|
};
|
|
169
268
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
170
269
|
}, []);
|
|
171
|
-
const
|
|
270
|
+
const Pe = (e) => {
|
|
172
271
|
const t = a.current;
|
|
173
272
|
if (!t) return;
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
const
|
|
273
|
+
const r = !t.paused, n = t.currentTime || 0;
|
|
274
|
+
ve(e), t.pause(), t.src = y[e].src, t.load();
|
|
275
|
+
const c = () => {
|
|
177
276
|
try {
|
|
178
|
-
t.currentTime = Math.min(
|
|
277
|
+
t.currentTime = Math.min(n, t.duration || n);
|
|
179
278
|
} catch {
|
|
180
279
|
}
|
|
181
|
-
|
|
182
|
-
}), t.removeEventListener("loadedmetadata",
|
|
280
|
+
r && t.play().catch(() => {
|
|
281
|
+
}), t.removeEventListener("loadedmetadata", c);
|
|
183
282
|
};
|
|
184
|
-
t.addEventListener("loadedmetadata",
|
|
185
|
-
},
|
|
186
|
-
if (
|
|
283
|
+
t.addEventListener("loadedmetadata", c);
|
|
284
|
+
}, Le = C ? O / C * 100 : 0, Te = (e) => {
|
|
285
|
+
if (ge(e), v.current && (window.clearTimeout(v.current), v.current = null), e <= 0) return;
|
|
187
286
|
const t = a.current;
|
|
188
287
|
if (!t) return;
|
|
189
|
-
const
|
|
190
|
-
|
|
288
|
+
const r = (t.duration || 0) - (t.currentTime || 0), n = Math.min(e * 60 * 1e3, r * 1e3);
|
|
289
|
+
v.current = window.setTimeout(() => {
|
|
191
290
|
t.pause();
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
return /* @__PURE__ */
|
|
291
|
+
}, n);
|
|
292
|
+
}, xe = y.map((e) => e.qualityLabel || "Auto");
|
|
293
|
+
return /* @__PURE__ */ g(
|
|
195
294
|
"div",
|
|
196
295
|
{
|
|
197
|
-
ref:
|
|
198
|
-
className:
|
|
199
|
-
|
|
296
|
+
ref: h,
|
|
297
|
+
className: k(
|
|
298
|
+
Ne({ variant: se, size: ue }),
|
|
200
299
|
"relative bg-black overflow-hidden rounded-2xl",
|
|
201
|
-
|
|
300
|
+
re
|
|
202
301
|
),
|
|
203
|
-
onMouseMove:
|
|
302
|
+
onMouseMove: Ee,
|
|
204
303
|
onMouseLeave: () => {
|
|
205
|
-
|
|
304
|
+
l && f(!1);
|
|
206
305
|
},
|
|
207
|
-
...
|
|
306
|
+
...le,
|
|
208
307
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
(
|
|
308
|
+
/* @__PURE__ */ o("div", { className: "absolute inset-0 bg-gradient-to-b from-black/40 via-black/0 to-black/70 pointer-events-none" }),
|
|
309
|
+
(U || H) && /* @__PURE__ */ g(
|
|
211
310
|
"div",
|
|
212
311
|
{
|
|
213
|
-
className:
|
|
312
|
+
className: k(
|
|
214
313
|
"pointer-events-none absolute left-0 right-0 top-0 flex items-center justify-between px-4 py-3 text-sm md:text-base",
|
|
215
314
|
"bg-gradient-to-b from-black/60 via-black/30 to-transparent text-white",
|
|
216
|
-
|
|
315
|
+
I || !l ? "opacity-100" : "opacity-0",
|
|
217
316
|
"transition-opacity duration-200"
|
|
218
317
|
),
|
|
219
318
|
children: [
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ o("div", { className: "pointer-events-auto font-semibold truncate max-w-[80%]", children: U }),
|
|
320
|
+
/* @__PURE__ */ o(
|
|
222
321
|
"button",
|
|
223
322
|
{
|
|
224
323
|
className: "pointer-events-auto flex h-8 w-8 items-center justify-center rounded-full bg-black/40 border border-white/10",
|
|
225
324
|
"aria-label": "More info",
|
|
226
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ o("span", { className: "text-lg leading-none", children: "i" })
|
|
227
326
|
}
|
|
228
327
|
)
|
|
229
328
|
]
|
|
230
329
|
}
|
|
231
330
|
),
|
|
232
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ o("div", { style: { width: "100%", aspectRatio: "16/9" }, className: "bg-black", children: /* @__PURE__ */ g(
|
|
233
332
|
"video",
|
|
234
333
|
{
|
|
235
334
|
ref: a,
|
|
236
|
-
className:
|
|
237
|
-
|
|
335
|
+
className: k(
|
|
336
|
+
Me(),
|
|
238
337
|
"relative z-0 h-full w-full object-cover cursor-pointer"
|
|
239
338
|
),
|
|
240
|
-
|
|
339
|
+
crossOrigin: ne || void 0,
|
|
340
|
+
poster: j || D || void 0,
|
|
241
341
|
preload: "metadata",
|
|
242
|
-
loop:
|
|
342
|
+
loop: ce,
|
|
243
343
|
playsInline: !0,
|
|
244
|
-
muted:
|
|
245
|
-
autoPlay:
|
|
246
|
-
controls:
|
|
344
|
+
muted: W,
|
|
345
|
+
autoPlay: oe,
|
|
346
|
+
controls: ie || !1,
|
|
247
347
|
controlsList: "nodownload noplaybackrate noremoteplayback",
|
|
248
|
-
disablePictureInPicture: !0,
|
|
249
348
|
onContextMenu: (e) => e.preventDefault(),
|
|
250
|
-
onClick:
|
|
251
|
-
onDoubleClick:
|
|
349
|
+
onClick: b,
|
|
350
|
+
onDoubleClick: B,
|
|
252
351
|
children: [
|
|
253
|
-
|
|
254
|
-
|
|
352
|
+
y.map((e, t) => /* @__PURE__ */ o("source", { src: e.src, type: e.type }, e.src + t)),
|
|
353
|
+
M?.map((e, t) => /* @__PURE__ */ o(
|
|
255
354
|
"track",
|
|
256
355
|
{
|
|
356
|
+
kind: e.kind || "captions",
|
|
257
357
|
src: e.src,
|
|
258
358
|
srcLang: e.srclang,
|
|
259
359
|
label: e.label,
|
|
@@ -265,70 +365,101 @@ const Te = ({
|
|
|
265
365
|
]
|
|
266
366
|
}
|
|
267
367
|
) }),
|
|
268
|
-
|
|
368
|
+
pe && /* @__PURE__ */ o("div", { className: "absolute inset-0 z-30 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-14 h-14 rounded-full bg-black/60", children: /* @__PURE__ */ g(
|
|
369
|
+
"svg",
|
|
370
|
+
{
|
|
371
|
+
className: "w-8 h-8 animate-spin text-white",
|
|
372
|
+
viewBox: "0 0 24 24",
|
|
373
|
+
fill: "none",
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ o(
|
|
376
|
+
"circle",
|
|
377
|
+
{
|
|
378
|
+
cx: "12",
|
|
379
|
+
cy: "12",
|
|
380
|
+
r: "10",
|
|
381
|
+
stroke: "currentColor",
|
|
382
|
+
strokeWidth: "4",
|
|
383
|
+
strokeOpacity: "0.25"
|
|
384
|
+
}
|
|
385
|
+
),
|
|
386
|
+
/* @__PURE__ */ o(
|
|
387
|
+
"path",
|
|
388
|
+
{
|
|
389
|
+
d: "M22 12a10 10 0 00-10-10",
|
|
390
|
+
stroke: "currentColor",
|
|
391
|
+
strokeWidth: "4",
|
|
392
|
+
strokeLinecap: "round"
|
|
393
|
+
}
|
|
394
|
+
)
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
) }) }),
|
|
398
|
+
!l && /* @__PURE__ */ g(
|
|
269
399
|
"div",
|
|
270
400
|
{
|
|
271
401
|
role: "button",
|
|
272
402
|
tabIndex: 0,
|
|
273
|
-
onClick:
|
|
403
|
+
onClick: b,
|
|
274
404
|
onKeyDown: (e) => {
|
|
275
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
405
|
+
(e.key === "Enter" || e.key === " ") && b();
|
|
276
406
|
},
|
|
277
407
|
className: "absolute inset-0 z-20 flex items-center justify-center cursor-pointer",
|
|
278
408
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ o("div", { className: "absolute inset-0 bg-black/35" }),
|
|
410
|
+
/* @__PURE__ */ o("div", { className: k(Ce(), "shadow-xl"), children: /* @__PURE__ */ o("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ o("path", { d: "M8 5v14l11-7z", fill: "currentColor" }) }) })
|
|
281
411
|
]
|
|
282
412
|
}
|
|
283
413
|
),
|
|
284
|
-
|
|
414
|
+
l && !I && /* @__PURE__ */ o("div", { className: "pointer-events-none absolute left-0 right-0 bottom-0 h-0.5 bg-white/20", children: /* @__PURE__ */ o(
|
|
285
415
|
"div",
|
|
286
416
|
{
|
|
287
417
|
className: "h-full bg-red-600",
|
|
288
|
-
style: { width: `${
|
|
418
|
+
style: { width: `${Le}%` }
|
|
289
419
|
}
|
|
290
420
|
) }),
|
|
291
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ o(
|
|
292
422
|
"div",
|
|
293
423
|
{
|
|
294
|
-
className:
|
|
295
|
-
|
|
424
|
+
className: k(
|
|
425
|
+
Ie(),
|
|
296
426
|
"pointer-events-none absolute inset-x-0 bottom-0 pb-2 pt-8",
|
|
297
427
|
"bg-gradient-to-t from-black/80 via-black/40 to-transparent",
|
|
298
428
|
"transition-opacity duration-200",
|
|
299
|
-
|
|
429
|
+
I || !l ? "opacity-100" : "opacity-0"
|
|
300
430
|
),
|
|
301
|
-
children: /* @__PURE__ */
|
|
302
|
-
|
|
431
|
+
children: /* @__PURE__ */ o("div", { className: "pointer-events-auto px-3 md:px-4", children: /* @__PURE__ */ o(
|
|
432
|
+
De,
|
|
303
433
|
{
|
|
304
|
-
playing:
|
|
305
|
-
onTogglePlay:
|
|
306
|
-
currentTime:
|
|
307
|
-
duration:
|
|
308
|
-
onSeek:
|
|
309
|
-
muted:
|
|
310
|
-
volume:
|
|
311
|
-
onChangeVolume:
|
|
312
|
-
onToggleMute:
|
|
313
|
-
captions: !!(
|
|
434
|
+
playing: l,
|
|
435
|
+
onTogglePlay: b,
|
|
436
|
+
currentTime: O,
|
|
437
|
+
duration: C,
|
|
438
|
+
onSeek: p,
|
|
439
|
+
muted: W,
|
|
440
|
+
volume: de,
|
|
441
|
+
onChangeVolume: A,
|
|
442
|
+
onToggleMute: G,
|
|
443
|
+
captions: !!(M && M.length),
|
|
314
444
|
onToggleCaptions: () => {
|
|
315
445
|
const e = a.current;
|
|
316
446
|
if (e)
|
|
317
447
|
for (let t = 0; t < e.textTracks.length; t++) {
|
|
318
|
-
const
|
|
319
|
-
|
|
448
|
+
const r = e.textTracks[t];
|
|
449
|
+
r.mode = r.mode === "showing" ? "disabled" : "showing";
|
|
320
450
|
}
|
|
321
451
|
},
|
|
322
|
-
fullscreen:
|
|
323
|
-
onToggleFullscreen:
|
|
324
|
-
onTogglePip:
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
452
|
+
fullscreen: H,
|
|
453
|
+
onToggleFullscreen: B,
|
|
454
|
+
onTogglePip: ke,
|
|
455
|
+
pipSupported: he,
|
|
456
|
+
playbackRate: me,
|
|
457
|
+
onPlaybackRateChange: we,
|
|
458
|
+
qualities: xe,
|
|
459
|
+
qualityIndex: L,
|
|
460
|
+
onQualityChange: Pe,
|
|
461
|
+
sleepTimerMinutes: be,
|
|
462
|
+
onChangeSleepTimer: Te
|
|
332
463
|
}
|
|
333
464
|
) })
|
|
334
465
|
}
|
|
@@ -337,8 +468,8 @@ const Te = ({
|
|
|
337
468
|
}
|
|
338
469
|
);
|
|
339
470
|
};
|
|
340
|
-
|
|
471
|
+
Re.displayName = "VideoPlayer";
|
|
341
472
|
export {
|
|
342
|
-
|
|
343
|
-
|
|
473
|
+
Re as VideoPlayer,
|
|
474
|
+
Re as default
|
|
344
475
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -213,7 +213,7 @@ export type { RadioProps, RadioGroupProps, RadioOption, } from './components/Rad
|
|
|
213
213
|
export type { SwitchProps } from './components/Switch/Switch.types';
|
|
214
214
|
export type { CheckboxProps, CheckboxGroupProps, CheckboxOption, } from './components/Checkbox/Checkbox.types';
|
|
215
215
|
export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps, CollapsibleCompactProps, CollapsibleVariant, CollapsibleAnimation, } from './components/Collapsible/Collapsible.types';
|
|
216
|
-
export type { DragDropContextProps, EnhancedDragDropContextProps, DroppableContainerProps, DraggableItemProps, DragHandleProps, DragOverlayProps,
|
|
216
|
+
export type { DragDropContextProps, EnhancedDragDropContextProps, DroppableContainerProps, DraggableItemProps, DragHandleProps, DragOverlayProps, DraggableItem as DraggableItemType, DragPosition, DragAxis, DragSensor, DropEffect, DragStartEvent, DragMoveEvent, DragOverEvent, DropEvent, DragCancelEvent, SelectionState, HistoryState, UndoRedoConfig, MultiDragConfig, VirtualizationConfig, VirtualItem, DragLock, CollaborationConfig, AutoScrollConfig, NestedDragConstraints, SnapToGridConfig, BoundingConstraints, CollisionDetectionConfig, DragAnalytics, DebugConfig, DragDropPlugin, TreeItem as DragDropTreeItem, } from './components/DragDrop';
|
|
217
217
|
export type { DataTableProps, DataTableCompactProps, DataTableVariant, DataTableSize, DataTableStriped, ColumnDef, SortingState, ColumnFilter, ColumnFiltersState, VisibilityState, RowSelectionState, PaginationState, TableInstance, Row, Column, Cell, SortDirection as DataTableSortDirection, } from './components/DataTable/DataTable.types';
|
|
218
218
|
export type { FormProps, FormCompactProps, FormFieldProps, FormItemProps, FormLabelProps, FormControlProps, FormDescriptionProps, FormMessageProps, FormSectionProps, FormActionsProps, FormVariant, FormSize, FormLayout, FormFieldConfig, } from './components/Form/Form.types';
|
|
219
219
|
export type { SelectProps, SelectOption, } from './components/Select/Select.types';
|