highsoft-ui 1.0.145 → 1.0.147
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/CLAUDE.md +15 -1
- package/dist/{Button-DIGyNR41.js → Button-BGsqFCRW.js} +1 -1
- package/dist/{ButtonGroup-BSQzx-sZ.js → ButtonGroup-DKfaXOeS.js} +1 -1
- package/dist/{Checkbox-wlH6EGWW.js → Checkbox-CniRhVkQ.js} +1 -1
- package/dist/{CodeBlock-DtTAC5ru.js → CodeBlock-BeseY88j.js} +5 -5
- package/dist/{CookiePolicyModal-CGRXL0wR.js → CookiePolicyModal-k89sCBEJ.js} +2 -2
- package/dist/{CopyCode-_MHQorJS.js → CopyCode-_yeXCeeq.js} +3 -3
- package/dist/{Dropdown-CVyrHJiC.js → Dropdown-B_Ib6i1c.js} +1 -1
- package/dist/{Footer-DW2asf8g.js → Footer-_P2pj3K7.js} +8 -8
- package/dist/{FooterBottom-CP0f9kYj.js → FooterBottom-CqpN8Wky.js} +1 -1
- package/dist/{FooterHelp-BxDXmtHK.js → FooterHelp-Cb5sraAE.js} +3 -3
- package/dist/{FooterLinks-BZwAVSm4.js → FooterLinks-CogdK_5Z.js} +2 -2
- package/dist/{Header-DQ1xi25C.js → Header-CVKH_INR.js} +25 -25
- package/dist/{InputGrouped-BE3zLov9.js → InputGrouped-CHGCMmsK.js} +11 -11
- package/dist/{Label-C_KZM-FN.js → Label-CgiWi1v6.js} +1 -1
- package/dist/{NewsletterSignup-CJAI81M3.js → NewsletterSignup-DrcPfdrg.js} +2 -2
- package/dist/{Notification-C2kN_ceR.js → Notification-B3skQvZE.js} +3 -3
- package/dist/{PrefPanel-BZUX1nfw.js → PrefPanel-BGw72I_D.js} +10 -10
- package/dist/{RoadmapDetails-CfayA5CZ.js → RoadmapDetails-XS0OylnP.js} +5 -5
- package/dist/{Search-Cw_e1PyF.js → Search-UPVxQliM.js} +12 -12
- package/dist/{SearchDropdown-ECOTZ1Uf.js → SearchDropdown-L_rQz1vn.js} +1 -1
- package/dist/VideoCover-DqMDvzvA.js +195 -0
- package/dist/VideoPlayer-Cq_garSg.js +455 -0
- package/dist/{VideoPlayerModal-DbP3OjSF.js → VideoPlayerModal-D1v1O2kW.js} +2 -2
- package/dist/{YoutubeModal-D_ZHayEn.js → YoutubeModal-BBYdQil8.js} +4 -2
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/CopyCode/index.js +1 -1
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/Footer/CookiePolicyModal.js +1 -1
- package/dist/components/Footer/FooterBottom.js +1 -1
- package/dist/components/Footer/FooterHelp.js +1 -1
- package/dist/components/Footer/FooterLinks.js +1 -1
- package/dist/components/Footer/YoutubeModal.js +1 -1
- package/dist/components/Footer/index.js +1 -1
- package/dist/components/Header/index.js +1 -1
- package/dist/components/InputGrouped/index.js +1 -1
- package/dist/components/Label/index.js +1 -1
- package/dist/components/Modal/ModalContactFooter.js +2 -2
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/NewsletterSignup/index.js +1 -1
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/PrefPanel/index.js +1 -1
- package/dist/components/RoadmapDetails/index.js +1 -1
- package/dist/components/Search/index.js +1 -1
- package/dist/components/SearchDropdown/index.js +1 -1
- package/dist/components/Sidebar/Sidebar.js +1 -1
- package/dist/components/VideoCover/index.js +1 -1
- package/dist/components/VideoPlayer/VideoPlayerModal.js +1 -1
- package/dist/components/VideoPlayer/index.js +1 -1
- package/dist/components/VideoPlayer/useMediaEngine.js +58 -55
- package/dist/{create-element-WbENDceu.js → create-element-CDnUGrhg.js} +1 -1
- package/dist/{esm-B0YmMAXt.js → esm-BnxclXHW.js} +121 -51
- package/dist/highsoft-ui.css +1 -1
- package/dist/lib/components/VideoCover/index.d.ts +39 -5
- package/dist/lib/components/VideoPlayer/index.d.ts +33 -1
- package/dist/lib/main.d.ts +1 -1
- package/dist/main.js +18 -18
- package/dist/{prism-light-C4xXs3Qn.js → prism-light-COlcVrfu.js} +1 -1
- package/dist/scss/variables.scss +25 -20
- package/package.json +1 -1
- package/dist/VideoCover-BN8wnHpf.js +0 -92
- package/dist/VideoPlayer-CKjq7IRq.js +0 -324
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./clsx-BWCAbrjV.js";
|
|
2
|
-
import { C as t, E as n, a as r, i, r as a } from "./esm-B0YmMAXt.js";
|
|
3
|
-
import { t as o } from "./Icon-VeXJMj8Q.js";
|
|
4
|
-
import { detectProvider as s, providerPosterUrl as c, useMediaEngine as l } from "./components/VideoPlayer/useMediaEngine.js";
|
|
5
|
-
import { forwardRef as u, useCallback as d, useEffect as f, useId as p, useImperativeHandle as m, useRef as h, useState as g } from "react";
|
|
6
|
-
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
|
-
var y = {
|
|
8
|
-
button: "_1OFWhq_button",
|
|
9
|
-
centerPlay: "_1OFWhq_centerPlay",
|
|
10
|
-
controlBar: "_1OFWhq_controlBar",
|
|
11
|
-
dragging: "_1OFWhq_dragging",
|
|
12
|
-
embed: "_1OFWhq_embed",
|
|
13
|
-
idle: "_1OFWhq_idle",
|
|
14
|
-
player: "_1OFWhq_player",
|
|
15
|
-
progress: "_1OFWhq_progress",
|
|
16
|
-
scrim: "_1OFWhq_scrim",
|
|
17
|
-
slider: "_1OFWhq_slider",
|
|
18
|
-
sliderBuffered: "_1OFWhq_sliderBuffered",
|
|
19
|
-
sliderFill: "_1OFWhq_sliderFill",
|
|
20
|
-
sliderThumb: "_1OFWhq_sliderThumb",
|
|
21
|
-
sliderTrack: "_1OFWhq_sliderTrack",
|
|
22
|
-
startCover: "_1OFWhq_startCover",
|
|
23
|
-
tapLayer: "_1OFWhq_tapLayer",
|
|
24
|
-
time: "_1OFWhq_time",
|
|
25
|
-
timeDuration: "_1OFWhq_timeDuration",
|
|
26
|
-
video: "_1OFWhq_video",
|
|
27
|
-
volumePopover: "_1OFWhq_volumePopover",
|
|
28
|
-
volumeSlider: "_1OFWhq_volumeSlider",
|
|
29
|
-
volumeWrap: "_1OFWhq_volumeWrap"
|
|
30
|
-
}, b = "var(--HS-text-brand-default-alt)", x = 2600;
|
|
31
|
-
function S(e) {
|
|
32
|
-
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
33
|
-
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = n > 0 ? String(r).padStart(2, "0") : String(r), o = String(i).padStart(2, "0");
|
|
34
|
-
return n > 0 ? `${n}:${a}:${o}` : `${a}:${o}`;
|
|
35
|
-
}
|
|
36
|
-
var C = (e) => Math.max(0, Math.min(1, e));
|
|
37
|
-
function w({ value: t, buffered: n, ariaLabel: r, ariaValueText: i, className: a, step: o = .05, onChange: s, onScrubStart: c, onScrubEnd: l }) {
|
|
38
|
-
let u = h(null), [f, p] = g(!1), m = (e) => `${C(e) * 100}%`, b = d((e) => {
|
|
39
|
-
let t = u.current;
|
|
40
|
-
if (!t) return 0;
|
|
41
|
-
let n = t.getBoundingClientRect();
|
|
42
|
-
return C((e - n.left) / n.width);
|
|
43
|
-
}, []), x = (e) => {
|
|
44
|
-
e.preventDefault(), u.current?.setPointerCapture(e.pointerId), p(!0), c?.(), s(b(e.clientX));
|
|
45
|
-
}, S = (e) => {
|
|
46
|
-
f && s(b(e.clientX));
|
|
47
|
-
}, w = (e) => {
|
|
48
|
-
f && (p(!1), l?.(), u.current?.releasePointerCapture?.(e.pointerId));
|
|
49
|
-
}, T = (e) => {
|
|
50
|
-
let n = null;
|
|
51
|
-
switch (e.key) {
|
|
52
|
-
case "ArrowRight":
|
|
53
|
-
case "ArrowUp":
|
|
54
|
-
n = t + o;
|
|
55
|
-
break;
|
|
56
|
-
case "ArrowLeft":
|
|
57
|
-
case "ArrowDown":
|
|
58
|
-
n = t - o;
|
|
59
|
-
break;
|
|
60
|
-
case "Home":
|
|
61
|
-
n = 0;
|
|
62
|
-
break;
|
|
63
|
-
case "End":
|
|
64
|
-
n = 1;
|
|
65
|
-
break;
|
|
66
|
-
default: return;
|
|
67
|
-
}
|
|
68
|
-
e.preventDefault(), e.stopPropagation(), s(C(n));
|
|
69
|
-
};
|
|
70
|
-
return /* @__PURE__ */ v("div", {
|
|
71
|
-
ref: u,
|
|
72
|
-
role: "slider",
|
|
73
|
-
tabIndex: 0,
|
|
74
|
-
"aria-label": r,
|
|
75
|
-
"aria-valuemin": 0,
|
|
76
|
-
"aria-valuemax": 100,
|
|
77
|
-
"aria-valuenow": Math.round(C(t) * 100),
|
|
78
|
-
"aria-valuetext": i,
|
|
79
|
-
className: e(y.slider, a, { [y.dragging]: f }),
|
|
80
|
-
onPointerDown: x,
|
|
81
|
-
onPointerMove: S,
|
|
82
|
-
onPointerUp: w,
|
|
83
|
-
onPointerCancel: w,
|
|
84
|
-
onKeyDown: T,
|
|
85
|
-
children: [/* @__PURE__ */ v("div", {
|
|
86
|
-
className: y.sliderTrack,
|
|
87
|
-
children: [n != null && /* @__PURE__ */ _("div", {
|
|
88
|
-
className: y.sliderBuffered,
|
|
89
|
-
style: { width: m(n) }
|
|
90
|
-
}), /* @__PURE__ */ _("div", {
|
|
91
|
-
className: y.sliderFill,
|
|
92
|
-
style: { width: m(t) }
|
|
93
|
-
})]
|
|
94
|
-
}), /* @__PURE__ */ _("span", {
|
|
95
|
-
className: y.sliderThumb,
|
|
96
|
-
style: { left: m(t) }
|
|
97
|
-
})]
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
var T = () => /* @__PURE__ */ _("svg", {
|
|
101
|
-
viewBox: "0 0 24 24",
|
|
102
|
-
"aria-hidden": "true",
|
|
103
|
-
focusable: "false",
|
|
104
|
-
children: /* @__PURE__ */ _("path", { d: "M8 5.14v13.72c0 .86.94 1.39 1.68.95l11.02-6.86a1.12 1.12 0 0 0 0-1.9L9.68 4.19A1.12 1.12 0 0 0 8 5.14Z" })
|
|
105
|
-
}), ee = () => /* @__PURE__ */ v("svg", {
|
|
106
|
-
viewBox: "0 0 24 24",
|
|
107
|
-
"aria-hidden": "true",
|
|
108
|
-
focusable: "false",
|
|
109
|
-
children: [/* @__PURE__ */ _("rect", {
|
|
110
|
-
x: "6",
|
|
111
|
-
y: "5",
|
|
112
|
-
width: "4",
|
|
113
|
-
height: "14",
|
|
114
|
-
rx: "1.6"
|
|
115
|
-
}), /* @__PURE__ */ _("rect", {
|
|
116
|
-
x: "14",
|
|
117
|
-
y: "5",
|
|
118
|
-
width: "4",
|
|
119
|
-
height: "14",
|
|
120
|
-
rx: "1.6"
|
|
121
|
-
})]
|
|
122
|
-
}), E = u(({ src: u, sources: E, poster: D, muted: O = !1, autoPlay: k = !1, loop: A = !1, playsInline: j = !0, preload: te = "metadata", aspectRatio: ne = "16 / 9", radius: re = 16, accentGradient: ie = b, "aria-label": M = "Video player", className: N, style: P }, F) => {
|
|
123
|
-
let I = s(u, !!E?.length), L = I !== "file", R = l({
|
|
124
|
-
provider: I,
|
|
125
|
-
src: u,
|
|
126
|
-
muted: O,
|
|
127
|
-
autoPlay: k,
|
|
128
|
-
loop: A
|
|
129
|
-
}), { state: z } = R, B = h(null), V = h(null), H = h(void 0), U = p(), W = d((e) => {
|
|
130
|
-
V.current = e, R.videoRef(e);
|
|
131
|
-
}, [R]);
|
|
132
|
-
m(F, () => V.current, []);
|
|
133
|
-
let [G, K] = g(!1), [q, J] = g(!1), [ae, Y] = g(!1), [oe, se] = g(!1), [ce, X] = g(void 0);
|
|
134
|
-
f(() => {
|
|
135
|
-
z.playing && se(!0);
|
|
136
|
-
}, [z.playing]), f(() => {
|
|
137
|
-
if (X(void 0), I !== "vimeo" || D || !u) return;
|
|
138
|
-
let e = !1;
|
|
139
|
-
return fetch(`https://vimeo.com/api/oembed.json?url=${encodeURIComponent(u)}&width=1280`).then((e) => e.ok ? e.json() : null).then((t) => {
|
|
140
|
-
!e && t?.thumbnail_url && X(t.thumbnail_url);
|
|
141
|
-
}).catch(() => {}), () => {
|
|
142
|
-
e = !0;
|
|
143
|
-
};
|
|
144
|
-
}, [
|
|
145
|
-
I,
|
|
146
|
-
D,
|
|
147
|
-
u
|
|
148
|
-
]), f(() => {
|
|
149
|
-
let e = () => K(document.fullscreenElement === B.current);
|
|
150
|
-
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
151
|
-
}, []);
|
|
152
|
-
let Z = d(() => {
|
|
153
|
-
J(!1), window.clearTimeout(H.current), H.current = window.setTimeout(() => J(!0), x);
|
|
154
|
-
}, []);
|
|
155
|
-
f(() => () => window.clearTimeout(H.current), []);
|
|
156
|
-
let Q = d(() => {
|
|
157
|
-
let e = B.current;
|
|
158
|
-
e && (document.fullscreenElement === e ? document.exitFullscreen().catch(() => {}) : e.requestFullscreen?.().catch(() => {}));
|
|
159
|
-
}, []), le = (e) => {
|
|
160
|
-
if (e.target.getAttribute("role") !== "slider") switch (e.key) {
|
|
161
|
-
case " ":
|
|
162
|
-
case "k":
|
|
163
|
-
e.preventDefault(), R.toggle();
|
|
164
|
-
break;
|
|
165
|
-
case "f":
|
|
166
|
-
e.preventDefault(), Q();
|
|
167
|
-
break;
|
|
168
|
-
case "m":
|
|
169
|
-
e.preventDefault(), R.toggleMute();
|
|
170
|
-
break;
|
|
171
|
-
case "ArrowRight":
|
|
172
|
-
e.preventDefault(), R.seekBy(5);
|
|
173
|
-
break;
|
|
174
|
-
case "ArrowLeft":
|
|
175
|
-
e.preventDefault(), R.seekBy(-5);
|
|
176
|
-
break;
|
|
177
|
-
default:
|
|
178
|
-
}
|
|
179
|
-
}, $ = D ?? c(I, u) ?? ce, ue = z.duration ? C(z.currentTime / z.duration) : 0, de = z.muted || z.volume === 0 ? a : z.volume < .5 ? i : r, fe = {
|
|
180
|
-
"--vp-radius": `${re}px`,
|
|
181
|
-
"--vp-gradient": ie,
|
|
182
|
-
aspectRatio: G ? void 0 : ne
|
|
183
|
-
}, pe = I === "file" ? /* @__PURE__ */ _("video", {
|
|
184
|
-
ref: W,
|
|
185
|
-
className: y.video,
|
|
186
|
-
src: E ? void 0 : u,
|
|
187
|
-
poster: D,
|
|
188
|
-
muted: O,
|
|
189
|
-
autoPlay: k,
|
|
190
|
-
loop: A,
|
|
191
|
-
playsInline: j,
|
|
192
|
-
preload: te,
|
|
193
|
-
onClick: R.toggle,
|
|
194
|
-
children: E?.map((e) => /* @__PURE__ */ _("source", {
|
|
195
|
-
src: e.src,
|
|
196
|
-
type: e.type
|
|
197
|
-
}, e.src))
|
|
198
|
-
}) : /* @__PURE__ */ _("div", {
|
|
199
|
-
ref: R.mountRef,
|
|
200
|
-
className: y.embed
|
|
201
|
-
});
|
|
202
|
-
return /* @__PURE__ */ v("div", {
|
|
203
|
-
ref: B,
|
|
204
|
-
role: "region",
|
|
205
|
-
"aria-label": M,
|
|
206
|
-
"aria-labelledby": U,
|
|
207
|
-
tabIndex: 0,
|
|
208
|
-
className: e("hsui-video-player", y.player, {
|
|
209
|
-
[y.playing]: z.playing,
|
|
210
|
-
[y.ended]: z.ended,
|
|
211
|
-
[y.idle]: q && z.playing && !ae
|
|
212
|
-
}, N),
|
|
213
|
-
style: {
|
|
214
|
-
...fe,
|
|
215
|
-
...P
|
|
216
|
-
},
|
|
217
|
-
onPointerMove: Z,
|
|
218
|
-
onPointerLeave: () => z.playing && J(!0),
|
|
219
|
-
onKeyDown: le,
|
|
220
|
-
onDoubleClick: Q,
|
|
221
|
-
children: [
|
|
222
|
-
/* @__PURE__ */ _("span", {
|
|
223
|
-
id: U,
|
|
224
|
-
className: "sr-only",
|
|
225
|
-
children: M
|
|
226
|
-
}),
|
|
227
|
-
pe,
|
|
228
|
-
L && !oe && /* @__PURE__ */ _("div", {
|
|
229
|
-
className: y.startCover,
|
|
230
|
-
"aria-hidden": "true",
|
|
231
|
-
style: $ ? { backgroundImage: `url("${$}")` } : void 0
|
|
232
|
-
}),
|
|
233
|
-
L && /* @__PURE__ */ _("button", {
|
|
234
|
-
type: "button",
|
|
235
|
-
className: y.tapLayer,
|
|
236
|
-
onClick: R.toggle,
|
|
237
|
-
"aria-label": z.playing ? "Pause" : "Play",
|
|
238
|
-
tabIndex: -1
|
|
239
|
-
}),
|
|
240
|
-
/* @__PURE__ */ _("div", {
|
|
241
|
-
className: y.scrim,
|
|
242
|
-
"aria-hidden": "true"
|
|
243
|
-
}),
|
|
244
|
-
!z.playing && /* @__PURE__ */ _("button", {
|
|
245
|
-
type: "button",
|
|
246
|
-
className: y.centerPlay,
|
|
247
|
-
onClick: R.toggle,
|
|
248
|
-
"aria-label": z.ended ? "Replay" : "Play",
|
|
249
|
-
tabIndex: -1,
|
|
250
|
-
children: /* @__PURE__ */ _(T, {})
|
|
251
|
-
}),
|
|
252
|
-
/* @__PURE__ */ v("div", {
|
|
253
|
-
className: y.controlBar,
|
|
254
|
-
children: [
|
|
255
|
-
/* @__PURE__ */ _("button", {
|
|
256
|
-
type: "button",
|
|
257
|
-
className: y.button,
|
|
258
|
-
onClick: R.toggle,
|
|
259
|
-
"aria-label": z.playing ? "Pause" : "Play",
|
|
260
|
-
children: z.playing ? /* @__PURE__ */ _(ee, {}) : /* @__PURE__ */ _(T, {})
|
|
261
|
-
}),
|
|
262
|
-
/* @__PURE__ */ v("div", {
|
|
263
|
-
className: y.volumeWrap,
|
|
264
|
-
children: [/* @__PURE__ */ _("button", {
|
|
265
|
-
type: "button",
|
|
266
|
-
className: y.button,
|
|
267
|
-
onClick: R.toggleMute,
|
|
268
|
-
"aria-label": z.muted ? "Unmute" : "Mute",
|
|
269
|
-
"aria-pressed": z.muted,
|
|
270
|
-
children: /* @__PURE__ */ _(o, {
|
|
271
|
-
name: de,
|
|
272
|
-
size: 20
|
|
273
|
-
})
|
|
274
|
-
}), /* @__PURE__ */ _("div", {
|
|
275
|
-
className: y.volumePopover,
|
|
276
|
-
children: /* @__PURE__ */ _(w, {
|
|
277
|
-
className: y.volumeSlider,
|
|
278
|
-
value: z.volume,
|
|
279
|
-
ariaLabel: "Volume",
|
|
280
|
-
ariaValueText: `${Math.round(z.volume * 100)}%`,
|
|
281
|
-
onChange: R.setVolume
|
|
282
|
-
})
|
|
283
|
-
})]
|
|
284
|
-
}),
|
|
285
|
-
/* @__PURE__ */ _("span", {
|
|
286
|
-
className: y.time,
|
|
287
|
-
children: S(z.currentTime)
|
|
288
|
-
}),
|
|
289
|
-
/* @__PURE__ */ _(w, {
|
|
290
|
-
className: y.progress,
|
|
291
|
-
value: ue,
|
|
292
|
-
buffered: z.buffered,
|
|
293
|
-
ariaLabel: "Seek",
|
|
294
|
-
ariaValueText: `${S(z.currentTime)} of ${S(z.duration)}`,
|
|
295
|
-
onChange: R.seekFraction,
|
|
296
|
-
onScrubStart: () => {
|
|
297
|
-
Y(!0), R.beginSeek();
|
|
298
|
-
},
|
|
299
|
-
onScrubEnd: () => {
|
|
300
|
-
Y(!1), R.endSeek();
|
|
301
|
-
}
|
|
302
|
-
}),
|
|
303
|
-
/* @__PURE__ */ _("span", {
|
|
304
|
-
className: e(y.time, y.timeDuration),
|
|
305
|
-
children: S(z.duration)
|
|
306
|
-
}),
|
|
307
|
-
/* @__PURE__ */ _("button", {
|
|
308
|
-
type: "button",
|
|
309
|
-
className: y.button,
|
|
310
|
-
onClick: Q,
|
|
311
|
-
"aria-label": G ? "Exit fullscreen" : "Enter fullscreen",
|
|
312
|
-
children: /* @__PURE__ */ _(o, {
|
|
313
|
-
name: G ? t : n,
|
|
314
|
-
size: 20
|
|
315
|
-
})
|
|
316
|
-
})
|
|
317
|
-
]
|
|
318
|
-
})
|
|
319
|
-
]
|
|
320
|
-
});
|
|
321
|
-
});
|
|
322
|
-
E.displayName = "VideoPlayer";
|
|
323
|
-
//#endregion
|
|
324
|
-
export { E as t };
|