@m4l/gclick 0.16.0 → 0.17.0

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.
Files changed (58) hide show
  1. package/components/CameraStream/defaults/DefaultPhaseStreaming.d.ts +2 -2
  2. package/components/CameraStream/defaults/DefaultPhaseStreaming.d.ts.map +1 -1
  3. package/components/CameraStream/defaults/DefaultPhaseStreaming.js +23 -21
  4. package/components/CameraStream/types.d.ts +9 -0
  5. package/components/CameraStream/types.d.ts.map +1 -1
  6. package/components/VideoPlayer/VideoPlayer.d.ts +4 -1
  7. package/components/VideoPlayer/VideoPlayer.d.ts.map +1 -1
  8. package/components/VideoPlayer/VideoPlayer.js +28 -25
  9. package/components/VideoPlayer/VideoPlayer.styles.d.ts +7 -1
  10. package/components/VideoPlayer/VideoPlayer.styles.d.ts.map +1 -1
  11. package/components/VideoPlayer/VideoPlayer.styles.js +72 -10
  12. package/components/VideoPlayer/VideojsDefaultSkin.styles.d.ts +8 -0
  13. package/components/VideoPlayer/VideojsDefaultSkin.styles.d.ts.map +1 -0
  14. package/components/VideoPlayer/{VideojsSkin.styles.js → VideojsDefaultSkin.styles.js} +478 -248
  15. package/components/VideoPlayer/VideojsMinimalSkin.styles.d.ts +8 -0
  16. package/components/VideoPlayer/VideojsMinimalSkin.styles.d.ts.map +1 -0
  17. package/components/VideoPlayer/VideojsMinimalSkin.styles.js +1561 -0
  18. package/components/VideoPlayer/constants.d.ts +33 -0
  19. package/components/VideoPlayer/constants.d.ts.map +1 -1
  20. package/components/VideoPlayer/constants.js +20 -4
  21. package/components/VideoPlayer/hlsConfig.d.ts +21 -11
  22. package/components/VideoPlayer/hlsConfig.d.ts.map +1 -1
  23. package/components/VideoPlayer/hlsConfig.js +28 -21
  24. package/components/VideoPlayer/index.d.ts +2 -2
  25. package/components/VideoPlayer/index.d.ts.map +1 -1
  26. package/components/VideoPlayer/player.factory.d.ts +3 -3
  27. package/components/VideoPlayer/player.factory.d.ts.map +1 -1
  28. package/components/VideoPlayer/slots/VideoPlayerSlots.d.ts +1 -1
  29. package/components/VideoPlayer/subcomponents/GclickVideoSkin.d.ts +5 -2
  30. package/components/VideoPlayer/subcomponents/GclickVideoSkin.d.ts.map +1 -1
  31. package/components/VideoPlayer/subcomponents/GclickVideoSkin.js +34 -178
  32. package/components/VideoPlayer/subcomponents/VideoPlayerStage.d.ts +4 -3
  33. package/components/VideoPlayer/subcomponents/VideoPlayerStage.d.ts.map +1 -1
  34. package/components/VideoPlayer/subcomponents/VideoPlayerStage.js +43 -42
  35. package/components/VideoPlayer/subcomponents/skin/VideoControlBar.d.ts +6 -0
  36. package/components/VideoPlayer/subcomponents/skin/VideoControlBar.d.ts.map +1 -0
  37. package/components/VideoPlayer/subcomponents/skin/VideoControlBar.js +87 -0
  38. package/components/VideoPlayer/subcomponents/skin/VideoErrorDialog.d.ts +9 -0
  39. package/components/VideoPlayer/subcomponents/skin/VideoErrorDialog.d.ts.map +1 -0
  40. package/components/VideoPlayer/subcomponents/skin/VideoErrorDialog.js +17 -0
  41. package/components/VideoPlayer/subcomponents/skin/VideoInputBindings.d.ts +11 -0
  42. package/components/VideoPlayer/subcomponents/skin/VideoInputBindings.d.ts.map +1 -0
  43. package/components/VideoPlayer/subcomponents/skin/VideoInputBindings.js +19 -0
  44. package/components/VideoPlayer/subcomponents/skin/VideoSettingsMenu.d.ts +9 -0
  45. package/components/VideoPlayer/subcomponents/skin/VideoSettingsMenu.d.ts.map +1 -0
  46. package/components/VideoPlayer/subcomponents/skin/VideoSettingsMenu.js +48 -0
  47. package/components/VideoPlayer/subcomponents/skin/primitives.d.ts +81 -0
  48. package/components/VideoPlayer/subcomponents/skin/primitives.d.ts.map +1 -0
  49. package/components/VideoPlayer/subcomponents/skin/primitives.js +142 -0
  50. package/components/VideoPlayer/subcomponents/skin/skinVariant.d.ts +19 -0
  51. package/components/VideoPlayer/subcomponents/skin/skinVariant.d.ts.map +1 -0
  52. package/components/VideoPlayer/subcomponents/skin/skinVariant.js +23 -0
  53. package/components/VideoPlayer/types.d.ts +25 -6
  54. package/components/VideoPlayer/types.d.ts.map +1 -1
  55. package/index.js +123 -122
  56. package/package.json +4 -4
  57. package/components/VideoPlayer/VideojsSkin.styles.d.ts +0 -9
  58. package/components/VideoPlayer/VideojsSkin.styles.d.ts.map +0 -1
@@ -1,50 +1,51 @@
1
1
  import { jsx as r } from "@emotion/react/jsx-runtime";
2
- import { useRef as v, useMemo as R } from "react";
3
- import { selectStreamType as C } from "@videojs/react";
4
- import { HlsVideo as g } from "@videojs/react/media/hls-video";
5
- import { HLS_CROSS_ORIGIN as L, HLS_PREFER_PLAYBACK as H } from "../constants.js";
6
- import { buildCredentialedHlsConfig as I } from "../hlsConfig.js";
7
- import { StreamPlayer as i } from "../player.factory.js";
8
- import { resolveIsLive as V } from "../utils.js";
9
- import { usePlayerControl as _ } from "../hooks/usePlayerControl.js";
10
- import { usePlayerEvents as h } from "../hooks/usePlayerEvents.js";
11
- import { VideoPlayerRootStyled as k } from "../slots/VideoPlayerSlots.js";
12
- import { GclickVideoSkin as E } from "./GclickVideoSkin.js";
13
- function Y({
14
- src: m,
15
- poster: s,
16
- className: l,
2
+ import { useRef as v, useMemo as C } from "react";
3
+ import { selectStreamType as g } from "@videojs/react";
4
+ import { HlsJsVideo as L } from "@videojs/react/media/hlsjs-video";
5
+ import { HLS_CROSS_ORIGIN as H, HLS_PREFER_PLAYBACK as I } from "../constants.js";
6
+ import { buildCredentialedHlsConfig as V } from "../hlsConfig.js";
7
+ import { StreamPlayer as m } from "../player.factory.js";
8
+ import { resolveIsLive as _ } from "../utils.js";
9
+ import { usePlayerControl as h } from "../hooks/usePlayerControl.js";
10
+ import { usePlayerEvents as E } from "../hooks/usePlayerEvents.js";
11
+ import { VideoPlayerRootStyled as O } from "../slots/VideoPlayerSlots.js";
12
+ import { GclickVideoSkin as k } from "./GclickVideoSkin.js";
13
+ function N({
14
+ src: s,
15
+ poster: l,
16
+ variant: o,
17
+ className: n,
17
18
  controlRef: a,
18
- onReady: n,
19
- onPlay: f,
20
- onPause: p,
21
- onEnded: u,
22
- onWaiting: d,
23
- onError: c,
24
- onDurationChange: y
19
+ onReady: f,
20
+ onPlay: p,
21
+ onPause: u,
22
+ onEnded: d,
23
+ onWaiting: c,
24
+ onError: y,
25
+ onDurationChange: S
25
26
  }) {
26
- const e = i.usePlayer(), P = i.usePlayer(C), o = V(P?.streamType, e.state.duration), t = v(null), S = R(() => I(), []);
27
- return _(a, e, t), h(e, {
28
- onReady: n,
29
- onPlay: f,
30
- onPause: p,
31
- onEnded: u,
32
- onWaiting: d,
33
- onError: c,
34
- onDurationChange: y
27
+ const e = m.usePlayer(), P = m.usePlayer(g), t = _(P?.streamType, e.state.duration), i = v(null), R = C(() => V(I), []);
28
+ return h(a, e, i), E(e, {
29
+ onReady: f,
30
+ onPlay: p,
31
+ onPause: u,
32
+ onEnded: d,
33
+ onWaiting: c,
34
+ onError: y,
35
+ onDurationChange: S
35
36
  }), /* @__PURE__ */ r(
36
- k,
37
+ O,
37
38
  {
38
- className: l,
39
- "data-stream-type": o ? "live" : "vod",
40
- children: /* @__PURE__ */ r(E, { poster: s, isLive: o, children: /* @__PURE__ */ r(
41
- g,
39
+ ownerState: { variant: o },
40
+ className: n,
41
+ "data-stream-type": t ? "live" : "vod",
42
+ children: /* @__PURE__ */ r(k, { poster: l, isLive: t, variant: o, children: /* @__PURE__ */ r(
43
+ L,
42
44
  {
43
- ref: t,
44
- src: m,
45
- preferPlayback: H,
46
- crossOrigin: L,
47
- config: S,
45
+ ref: i,
46
+ src: s,
47
+ crossOrigin: H,
48
+ config: R,
48
49
  autoPlay: !0,
49
50
  muted: !0,
50
51
  playsInline: !0
@@ -54,5 +55,5 @@ function Y({
54
55
  );
55
56
  }
56
57
  export {
57
- Y as VideoPlayerStage
58
+ N as VideoPlayerStage
58
59
  };
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ /** The full control bar for the current stream type. */
3
+ export declare function VideoControlBar({ isLive }: {
4
+ isLive: boolean;
5
+ }): ReactNode;
6
+ //# sourceMappingURL=VideoControlBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VideoControlBar.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/skin/VideoControlBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAuMvC,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAW1E"}
@@ -0,0 +1,87 @@
1
+ import { jsx as e, jsxs as i, Fragment as h } from "@emotion/react/jsx-runtime";
2
+ import { Controls as f, Tooltip as b, PlayButton as v, LiveButton as B, SeekButton as d, TimeSlider as _, Slider as r, Time as l, AirPlayButton as y, CastButton as P, PiPButton as I, FullscreenButton as g, Popover as m, VolumeSlider as k, MuteButton as T } from "@videojs/react";
3
+ import { RestartIcon as V, PlayIcon as x, PauseIcon as E, AirPlayEnterIcon as S, AirPlayExitIcon as C, PipEnterIcon as F, PipExitIcon as R, FullscreenEnterIcon as A, FullscreenExitIcon as M, VolumeOffIcon as w, VolumeLowIcon as j, VolumeHighIcon as H } from "@videojs/react/icons";
4
+ import { cx as N, TooltipButton as o, SkinButton as n, SkipButtonContent as u, SEEK_TIME as p } from "./primitives.js";
5
+ import { useSkinClasses as c } from "./skinVariant.js";
6
+ import { VideoSettingsMenu as O } from "./VideoSettingsMenu.js";
7
+ function D() {
8
+ const { surface: a } = c(), t = /* @__PURE__ */ i(T, { className: "media-button--mute", render: /* @__PURE__ */ e(n, {}), children: [
9
+ /* @__PURE__ */ e(w, { className: "media-icon media-icon--volume-off" }),
10
+ /* @__PURE__ */ e(j, { className: "media-icon media-icon--volume-low" }),
11
+ /* @__PURE__ */ e(H, { className: "media-icon media-icon--volume-high" })
12
+ ] });
13
+ return /* @__PURE__ */ i(m.Root, { openOnHover: !0, delay: 200, closeDelay: 100, side: "top", children: [
14
+ /* @__PURE__ */ e(m.Trigger, { render: t }),
15
+ /* @__PURE__ */ e(m.Popup, { className: N(a, "media-popover media-popover--volume"), children: /* @__PURE__ */ i(k.Root, { className: "media-slider", orientation: "vertical", thumbAlignment: "edge", children: [
16
+ /* @__PURE__ */ e(r.Track, { className: "media-slider__track", children: /* @__PURE__ */ e(r.Fill, { className: "media-slider__fill" }) }),
17
+ /* @__PURE__ */ e(r.Thumb, { className: "media-slider__thumb media-slider__thumb--persistent" })
18
+ ] }) })
19
+ ] });
20
+ }
21
+ function K({ isLive: a }) {
22
+ return /* @__PURE__ */ i("div", { className: "media-button-group", children: [
23
+ /* @__PURE__ */ e(o, { children: /* @__PURE__ */ i(v, { className: "media-button--play", render: /* @__PURE__ */ e(n, {}), children: [
24
+ /* @__PURE__ */ e(V, { className: "media-icon media-icon--restart" }),
25
+ /* @__PURE__ */ e(x, { className: "media-icon media-icon--play" }),
26
+ /* @__PURE__ */ e(E, { className: "media-icon media-icon--pause" })
27
+ ] }) }),
28
+ a ? /* @__PURE__ */ e(B, { className: "media-button media-button--subtle media-button--live" }) : /* @__PURE__ */ i(h, { children: [
29
+ /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(d, { seconds: -p, className: "media-button--seek", render: /* @__PURE__ */ e(n, {}), children: /* @__PURE__ */ e(u, { direction: "back" }) }) }),
30
+ /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(d, { seconds: p, className: "media-button--seek", render: /* @__PURE__ */ e(n, {}), children: /* @__PURE__ */ e(u, { direction: "forward" }) }) })
31
+ ] })
32
+ ] });
33
+ }
34
+ function q({ isLive: a }) {
35
+ const { groupedTime: t } = c();
36
+ if (a)
37
+ return /* @__PURE__ */ e("div", { className: "media-time-controls", "aria-hidden": "true" });
38
+ const s = /* @__PURE__ */ i(_.Root, { className: "media-slider", children: [
39
+ /* @__PURE__ */ i(r.Track, { className: "media-slider__track", children: [
40
+ /* @__PURE__ */ e(r.Fill, { className: "media-slider__fill" }),
41
+ /* @__PURE__ */ e(r.Buffer, { className: "media-slider__buffer" })
42
+ ] }),
43
+ /* @__PURE__ */ e(r.Thumb, { className: "media-slider__thumb" })
44
+ ] });
45
+ return t ? /* @__PURE__ */ i("div", { className: "media-time-controls", children: [
46
+ s,
47
+ /* @__PURE__ */ i("div", { className: "media-time-group", children: [
48
+ /* @__PURE__ */ e(l.Value, { type: "current", className: "media-time media-time--current" }),
49
+ /* @__PURE__ */ e("span", { className: "media-time-separator", children: "/" }),
50
+ /* @__PURE__ */ e(l.Value, { type: "duration", className: "media-time media-time--duration" })
51
+ ] })
52
+ ] }) : /* @__PURE__ */ i("div", { className: "media-time-controls", children: [
53
+ /* @__PURE__ */ e(l.Value, { type: "current", className: "media-time" }),
54
+ s,
55
+ /* @__PURE__ */ e(l.Value, { type: "duration", className: "media-time" })
56
+ ] });
57
+ }
58
+ function z({ isLive: a }) {
59
+ return /* @__PURE__ */ i("div", { className: "media-button-group", children: [
60
+ /* @__PURE__ */ e(O, { isLive: a }),
61
+ /* @__PURE__ */ e(D, {}),
62
+ /* @__PURE__ */ e(o, { children: /* @__PURE__ */ i(y, { className: "media-button--airplay", render: /* @__PURE__ */ e(n, {}), children: [
63
+ /* @__PURE__ */ e(S, { className: "media-icon media-icon--airplay-enter" }),
64
+ /* @__PURE__ */ e(C, { className: "media-icon media-icon--airplay-exit" })
65
+ ] }) }),
66
+ /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(P, { className: "media-button--cast", render: /* @__PURE__ */ e(n, {}) }) }),
67
+ /* @__PURE__ */ e(o, { children: /* @__PURE__ */ i(I, { className: "media-button--pip", render: /* @__PURE__ */ e(n, {}), children: [
68
+ /* @__PURE__ */ e(F, { className: "media-icon media-icon--pip-enter" }),
69
+ /* @__PURE__ */ e(R, { className: "media-icon media-icon--pip-exit" })
70
+ ] }) }),
71
+ /* @__PURE__ */ e(o, { children: /* @__PURE__ */ i(g, { className: "media-button--fullscreen", render: /* @__PURE__ */ e(n, {}), children: [
72
+ /* @__PURE__ */ e(A, { className: "media-icon media-icon--fullscreen-enter" }),
73
+ /* @__PURE__ */ e(M, { className: "media-icon media-icon--fullscreen-exit" })
74
+ ] }) })
75
+ ] });
76
+ }
77
+ function X({ isLive: a }) {
78
+ const { surface: t } = c();
79
+ return /* @__PURE__ */ e(f.Root, { className: N(t, "media-controls"), children: /* @__PURE__ */ i(b.Provider, { children: [
80
+ /* @__PURE__ */ e(K, { isLive: a }),
81
+ /* @__PURE__ */ e(q, { isLive: a }),
82
+ /* @__PURE__ */ e(z, { isLive: a })
83
+ ] }) });
84
+ }
85
+ export {
86
+ X as VideoControlBar
87
+ };
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Playback error dialog, styled entirely by the official skin.
4
+ *
5
+ * Extracted from the skin root because it is an overlay with its own lifecycle
6
+ * and has nothing to do with the control bar it used to sit next to.
7
+ */
8
+ export declare function VideoErrorDialog(): ReactNode;
9
+ //# sourceMappingURL=VideoErrorDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VideoErrorDialog.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/skin/VideoErrorDialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,CAmB5C"}
@@ -0,0 +1,17 @@
1
+ import { jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
2
+ import { ErrorDialog as o, AlertDialog as e } from "@videojs/react";
3
+ import { cx as s } from "./primitives.js";
4
+ import { useSkinClasses as m } from "./skinVariant.js";
5
+ function d() {
6
+ const { surface: a } = m();
7
+ return /* @__PURE__ */ r(o.Root, { children: /* @__PURE__ */ r(e.Popup, { className: "media-error", children: /* @__PURE__ */ i("div", { className: s("media-error__dialog", a), children: [
8
+ /* @__PURE__ */ i("div", { className: "media-error__content", children: [
9
+ /* @__PURE__ */ r(e.Title, { className: "media-error__title", children: "Something went wrong." }),
10
+ /* @__PURE__ */ r(o.Description, { className: "media-error__description" })
11
+ ] }),
12
+ /* @__PURE__ */ r("div", { className: "media-error__actions", children: /* @__PURE__ */ r(e.Close, { className: "media-button media-button--primary", children: "OK" }) })
13
+ ] }) }) });
14
+ }
15
+ export {
16
+ d as VideoErrorDialog
17
+ };
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Keyboard and pointer bindings for the player.
4
+ *
5
+ * These are declarative configuration rather than chrome, so they live apart
6
+ * from the control bar. Since beta.25 the vendor's buttons advertise these same
7
+ * shortcuts through `Tooltip.Shortcut`, so the bindings are now discoverable
8
+ * instead of hidden — keep the two in sync when adding one.
9
+ */
10
+ export declare function VideoInputBindings(): ReactNode;
11
+ //# sourceMappingURL=VideoInputBindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VideoInputBindings.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/skin/VideoInputBindings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,SAAS,CAe9C"}
@@ -0,0 +1,19 @@
1
+ import { jsxs as n, Fragment as r, jsx as e } from "@emotion/react/jsx-runtime";
2
+ import { Hotkey as t, Gesture as o } from "@videojs/react";
3
+ function c() {
4
+ return /* @__PURE__ */ n(r, { children: [
5
+ /* @__PURE__ */ e(t, { keys: "Space", action: "togglePaused" }),
6
+ /* @__PURE__ */ e(t, { keys: "k", action: "togglePaused" }),
7
+ /* @__PURE__ */ e(t, { keys: "m", action: "toggleMuted" }),
8
+ /* @__PURE__ */ e(t, { keys: "f", action: "toggleFullscreen" }),
9
+ /* @__PURE__ */ e(t, { keys: "i", action: "togglePictureInPicture" }),
10
+ /* @__PURE__ */ e(t, { keys: "ArrowUp", action: "volumeStep", value: 0.05 }),
11
+ /* @__PURE__ */ e(t, { keys: "ArrowDown", action: "volumeStep", value: -0.05 }),
12
+ /* @__PURE__ */ e(o, { type: "tap", action: "togglePaused", pointer: "mouse", region: "center" }),
13
+ /* @__PURE__ */ e(o, { type: "tap", action: "toggleControls", pointer: "touch" }),
14
+ /* @__PURE__ */ e(o, { type: "doubletap", action: "toggleFullscreen", region: "center" })
15
+ ] });
16
+ }
17
+ export {
18
+ c as VideoInputBindings
19
+ };
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Renders the settings button and its menu, or nothing when the current stream
4
+ * exposes neither quality levels nor playback rates.
5
+ */
6
+ export declare function VideoSettingsMenu({ isLive }: {
7
+ isLive: boolean;
8
+ }): ReactNode;
9
+ //# sourceMappingURL=VideoSettingsMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VideoSettingsMenu.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/skin/VideoSettingsMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBvC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAuD5E"}
@@ -0,0 +1,48 @@
1
+ import { jsxs as s, jsx as a } from "@emotion/react/jsx-runtime";
2
+ import { useQualityOptions as u, usePlaybackRateOptions as m, Menu as i } from "@videojs/react";
3
+ import { GearIcon as p, QualityIcon as d, SpeedIcon as y } from "@videojs/react/icons";
4
+ import { SkinButton as b, cx as g, MENU_PANEL as v, MENU_GROUP as N, SettingsSubmenu as o } from "./primitives.js";
5
+ import { useSkinClasses as h } from "./skinVariant.js";
6
+ function Q({ isLive: c }) {
7
+ const { surface: r } = h(), e = u(), t = m(), n = e?.state.availability === "available", l = !c && t?.state.availability === "available";
8
+ return !n && !l ? null : /* @__PURE__ */ s(i.Root, { side: "top", align: "center", children: [
9
+ /* @__PURE__ */ a(
10
+ i.Trigger,
11
+ {
12
+ "aria-label": "Settings",
13
+ className: "media-button--settings",
14
+ render: /* @__PURE__ */ a(b, {}),
15
+ children: /* @__PURE__ */ a(p, { className: "media-icon media-icon--settings" })
16
+ }
17
+ ),
18
+ /* @__PURE__ */ a(i.Content, { className: g(r, "media-popover media-menu media-menu--settings"), children: /* @__PURE__ */ a(i.View, { className: v, children: /* @__PURE__ */ s("div", { className: N, children: [
19
+ n ? /* @__PURE__ */ a(
20
+ o,
21
+ {
22
+ type: "quality",
23
+ title: "Quality",
24
+ icon: /* @__PURE__ */ a(d, { className: "media-icon" }),
25
+ ariaLabel: "Quality",
26
+ options: e.options,
27
+ value: e.value,
28
+ onValueChange: e.setValue
29
+ }
30
+ ) : null,
31
+ l ? /* @__PURE__ */ a(
32
+ o,
33
+ {
34
+ type: "playback-rate",
35
+ title: "Speed",
36
+ icon: /* @__PURE__ */ a(y, { className: "media-icon" }),
37
+ ariaLabel: "Playback rate",
38
+ options: t.options,
39
+ value: t.value,
40
+ onValueChange: t.setValue
41
+ }
42
+ ) : null
43
+ ] }) }) })
44
+ ] });
45
+ }
46
+ export {
47
+ Q as VideoSettingsMenu
48
+ };
@@ -0,0 +1,81 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ /** Class strings the vendor stylesheet keys off, named once instead of inline. */
3
+ export declare const ICON_BUTTON = "media-button media-button--subtle media-button--icon";
4
+ export declare const MENU_ITEM = "media-menu__item";
5
+ export declare const MENU_GROUP = "media-menu__group";
6
+ export declare const MENU_PANEL = "media-menu__panel";
7
+ /** Join the truthy class fragments (avoids depending on the lib's internal `cn`). */
8
+ export declare function cx(...parts: Array<string | false | undefined>): string;
9
+ /** Bare icon button styled by the official skin (`media-button--icon`). */
10
+ export declare const SkinButton: import('react').ForwardRefExoticComponent<{
11
+ className?: string;
12
+ } & import('react').RefAttributes<HTMLButtonElement>>;
13
+ /**
14
+ * A control wrapped in the skin's tooltip.
15
+ *
16
+ * Every button in the bar needs the same `Tooltip.Root` / `Trigger` / `Popup`
17
+ * trio; inlining it repeated the block once per control, which is how the bar
18
+ * ended up with six identical copies before this refactor.
19
+ *
20
+ * `Tooltip.Label` and `Tooltip.Shortcut` take no props on purpose: they read the
21
+ * linked trigger's tooltip context, which the vendor's own buttons populate with
22
+ * their label AND their keyboard shortcut. So routing every control through here
23
+ * surfaces the hotkeys the player already binds — until beta.25 they worked but
24
+ * were advertised nowhere.
25
+ */
26
+ export declare function TooltipButton({ children }: {
27
+ children: ReactElement;
28
+ }): ReactNode;
29
+ /** Chevron used by submenu triggers and the "back" row of a submenu panel. */
30
+ export declare function MenuChevron({ flipped }: {
31
+ flipped?: boolean;
32
+ }): ReactNode;
33
+ /** One selectable option, the shape every v10 `use*Options` hook returns. */
34
+ export interface SkinMenuOption {
35
+ value: string;
36
+ label: string;
37
+ disabled: boolean;
38
+ /** Quality only: the rendition tier, rendered as a superscript. */
39
+ tier?: string | undefined;
40
+ /** Quality only: a short badge such as `HD`. */
41
+ badge?: string | undefined;
42
+ }
43
+ /**
44
+ * Radio list for a settings submenu.
45
+ *
46
+ * All four v10 option hooks (`usePlaybackRateOptions`, `useQualityOptions`,
47
+ * `useAudioTrackOptions`, `useCaptionsOptions`) expose the very same
48
+ * `{ value, options, setValue }` contract, so one component renders any of them.
49
+ * We currently mount quality and playback rate; wiring another is passing a
50
+ * different hook's result here.
51
+ */
52
+ export declare function MenuRadioOptions({ ariaLabel, options, value, onValueChange, }: {
53
+ ariaLabel: string;
54
+ options: SkinMenuOption[];
55
+ value: string;
56
+ onValueChange: (next: string) => void;
57
+ }): ReactNode;
58
+ /**
59
+ * A settings submenu: trigger row showing the current value, then its panel.
60
+ */
61
+ export declare function SettingsSubmenu({ type, title, icon, ariaLabel, options, value, onValueChange, }: {
62
+ type: 'playback-rate' | 'quality' | 'audio-track' | 'captions';
63
+ title: string;
64
+ icon: ReactNode;
65
+ ariaLabel: string;
66
+ options: SkinMenuOption[];
67
+ value: string;
68
+ onValueChange: (next: string) => void;
69
+ }): ReactNode;
70
+ /** Seconds the skip-forward / skip-back buttons jump (VOD only). */
71
+ export declare const SEEK_TIME = 10;
72
+ /**
73
+ * Skip button for either direction.
74
+ *
75
+ * Back and forward differ only by the sign of the jump and a mirrored icon, so
76
+ * both are derived from `direction` rather than written twice.
77
+ */
78
+ export declare function SkipButtonContent({ direction }: {
79
+ direction: 'back' | 'forward';
80
+ }): ReactNode;
81
+ //# sourceMappingURL=primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/skin/primitives.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBtE,kFAAkF;AAClF,eAAO,MAAM,WAAW,yDAAyD,CAAC;AAClF,eAAO,MAAM,SAAS,qBAAqB,CAAC;AAC5C,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAC9C,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAE9C,qFAAqF;AACrF,wBAAgB,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,GAAG,MAAM,CAEtE;AAED,2EAA2E;AAC3E,eAAO,MAAM,UAAU;gBAA+C,MAAM;qDAI3E,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,GAAG,SAAS,CAWjF;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,EAAE,OAAe,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAMjF;AAED,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,OAAO,EACP,KAAK,EACL,aAAa,GACd,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,GAAG,SAAS,CA+BZ;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EACP,KAAK,EACL,aAAa,GACd,EAAE;IACD,IAAI,EAAE,eAAe,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,GAAG,SAAS,CAkCZ;AAED,oEAAoE;AACpE,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,CAS7F"}
@@ -0,0 +1,142 @@
1
+ import { jsxs as i, jsx as e } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as N } from "react";
3
+ import { Tooltip as s, Menu as c } from "@videojs/react";
4
+ import { SeekIcon as h, ChevronIcon as b, CheckIcon as f } from "@videojs/react/icons";
5
+ import { useSkinClasses as k } from "./skinVariant.js";
6
+ const I = "media-button media-button--subtle media-button--icon", d = "media-menu__item", S = "media-menu__group", g = "media-menu__panel";
7
+ function o(...a) {
8
+ return a.filter(Boolean).join(" ");
9
+ }
10
+ const U = N(
11
+ function({ className: t, ...m }, r) {
12
+ return /* @__PURE__ */ e("button", { ref: r, type: "button", className: o(I, t), ...m });
13
+ }
14
+ );
15
+ function x({ children: a }) {
16
+ const { surface: t } = k();
17
+ return /* @__PURE__ */ i(s.Root, { side: "top", children: [
18
+ /* @__PURE__ */ e(s.Trigger, { render: a }),
19
+ /* @__PURE__ */ i(s.Popup, { className: o(t, "media-tooltip"), children: [
20
+ /* @__PURE__ */ e(s.Label, {}),
21
+ /* @__PURE__ */ e(s.Shortcut, { className: "media-tooltip__kbd" })
22
+ ] })
23
+ ] });
24
+ }
25
+ function l({ flipped: a = !1 }) {
26
+ return /* @__PURE__ */ e(
27
+ b,
28
+ {
29
+ className: o("media-icon media-menu__chevron", a && "media-icon--flipped")
30
+ }
31
+ );
32
+ }
33
+ function M({
34
+ ariaLabel: a,
35
+ options: t,
36
+ value: m,
37
+ onValueChange: r
38
+ }) {
39
+ return /* @__PURE__ */ e(
40
+ c.RadioGroup,
41
+ {
42
+ className: S,
43
+ value: m,
44
+ onValueChange: r,
45
+ "aria-label": a,
46
+ children: t.map((n) => /* @__PURE__ */ i(
47
+ c.RadioItem,
48
+ {
49
+ className: d,
50
+ value: n.value,
51
+ disabled: n.disabled,
52
+ children: [
53
+ /* @__PURE__ */ i("span", { children: [
54
+ n.label,
55
+ n.tier ? /* @__PURE__ */ e("sup", { className: "media-menu__tier", children: n.tier }) : null
56
+ ] }),
57
+ n.badge ? /* @__PURE__ */ e("span", { className: "media-badge", children: n.badge }) : null,
58
+ /* @__PURE__ */ e(
59
+ c.ItemIndicator,
60
+ {
61
+ checked: n.value === m,
62
+ forceMount: !0,
63
+ className: "media-menu__indicator",
64
+ children: /* @__PURE__ */ e(f, { className: "media-icon" })
65
+ }
66
+ )
67
+ ]
68
+ },
69
+ n.value
70
+ ))
71
+ }
72
+ );
73
+ }
74
+ function O({
75
+ type: a,
76
+ title: t,
77
+ icon: m,
78
+ ariaLabel: r,
79
+ options: n,
80
+ value: u,
81
+ onValueChange: _
82
+ }) {
83
+ return /* @__PURE__ */ i(c.Root, { children: [
84
+ /* @__PURE__ */ e(
85
+ c.Trigger,
86
+ {
87
+ type: a,
88
+ className: o(d, "media-menu__item--submenu"),
89
+ render: (p) => /* @__PURE__ */ i("div", { ...p, children: [
90
+ m,
91
+ /* @__PURE__ */ e("span", { children: t }),
92
+ /* @__PURE__ */ i("span", { className: "media-menu__hint", children: [
93
+ /* @__PURE__ */ e(c.ItemValue, { className: "media-menu__hint-label" }),
94
+ /* @__PURE__ */ e(l, {})
95
+ ] })
96
+ ] })
97
+ }
98
+ ),
99
+ /* @__PURE__ */ i(c.Content, { className: g, children: [
100
+ /* @__PURE__ */ i(c.Back, { className: "media-menu__back", children: [
101
+ /* @__PURE__ */ e(l, { flipped: !0 }),
102
+ t
103
+ ] }),
104
+ /* @__PURE__ */ e(c.Separator, { className: "media-menu__separator" }),
105
+ /* @__PURE__ */ e(
106
+ M,
107
+ {
108
+ ariaLabel: r,
109
+ options: n,
110
+ value: u,
111
+ onValueChange: _
112
+ }
113
+ )
114
+ ] })
115
+ ] });
116
+ }
117
+ const E = 10;
118
+ function j({ direction: a }) {
119
+ return /* @__PURE__ */ i("span", { className: "media-icon__container", children: [
120
+ /* @__PURE__ */ e(
121
+ h,
122
+ {
123
+ className: o("media-icon media-icon--seek", a === "back" && "media-icon--flipped")
124
+ }
125
+ ),
126
+ /* @__PURE__ */ e("span", { className: "media-icon__label", children: E })
127
+ ] });
128
+ }
129
+ export {
130
+ I as ICON_BUTTON,
131
+ S as MENU_GROUP,
132
+ d as MENU_ITEM,
133
+ g as MENU_PANEL,
134
+ l as MenuChevron,
135
+ M as MenuRadioOptions,
136
+ E as SEEK_TIME,
137
+ O as SettingsSubmenu,
138
+ U as SkinButton,
139
+ j as SkipButtonContent,
140
+ x as TooltipButton,
141
+ o as cx
142
+ };
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import { VIDEO_PLAYER_SKIN_CLASSES } from '../../constants';
3
+ import { VideoPlayerVariant } from '../../types';
4
+ /** Class names the vendor's stylesheet keys off for the active variant. */
5
+ export type SkinClasses = (typeof VIDEO_PLAYER_SKIN_CLASSES)[VideoPlayerVariant];
6
+ /** Makes the active variant's class names available to the whole skin subtree. */
7
+ export declare function SkinVariantProvider({ variant, children, }: {
8
+ variant: VideoPlayerVariant;
9
+ children: ReactNode;
10
+ }): ReactNode;
11
+ /**
12
+ * Read the active variant's class names.
13
+ *
14
+ * Defaults to the full chrome, so a skin piece rendered outside the provider
15
+ * (a focused unit test, for instance) still behaves like the default skin
16
+ * instead of losing its classes.
17
+ */
18
+ export declare function useSkinClasses(): SkinClasses;
19
+ //# sourceMappingURL=skinVariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skinVariant.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/skin/skinVariant.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAyB,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAgBtD,2EAA2E;AAC3E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAMjF,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,SAAS,CASZ;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
@@ -0,0 +1,23 @@
1
+ import { jsx as i } from "@emotion/react/jsx-runtime";
2
+ import { useMemo as u, createContext as a, useContext as S } from "react";
3
+ import { VIDEO_PLAYER_SKIN_CLASSES as t, VIDEO_PLAYER_VARIANTS as o } from "../../constants.js";
4
+ const n = a(
5
+ t[o.default]
6
+ );
7
+ function l({
8
+ variant: e,
9
+ children: r
10
+ }) {
11
+ const s = u(
12
+ () => t[e] ?? t[o.default],
13
+ [e]
14
+ );
15
+ return /* @__PURE__ */ i(n, { value: s, children: r });
16
+ }
17
+ function x() {
18
+ return S(n);
19
+ }
20
+ export {
21
+ l as SkinVariantProvider,
22
+ x as useSkinClasses
23
+ };