@streamlayer/react-ui 1.26.0 → 1.27.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.
- package/lib/app/app/Advertisement/index.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +125 -92
- package/lib/app/app/Banner/index.d.ts +6 -0
- package/lib/app/app/Banner/index.js +6 -0
- package/lib/app/app/Features/Gamification/Question.d.ts +4 -0
- package/lib/app/app/Features/Gamification/Question.js +79 -50
- package/lib/app/app/Features/Gamification/QuestionAdvertisement.d.ts +6 -0
- package/lib/app/app/Features/Gamification/QuestionAdvertisement.js +46 -0
- package/lib/app/app/Features/Gamification/Tabs.js +12 -12
- package/lib/app/app/Features/Gamification/index.d.ts +3 -0
- package/lib/app/app/Features/Gamification/index.js +56 -52
- package/lib/app/app/Features/index.d.ts +1 -0
- package/lib/app/app/Features/index.js +6 -4
- package/lib/app/app/InApp/index.d.ts +1 -0
- package/lib/app/app/InApp/index.js +44 -17
- package/lib/app/app/Insight/index.d.ts +3 -0
- package/lib/app/app/Insight/index.js +33 -30
- package/lib/app/app/Layout/index.d.ts +17 -0
- package/lib/app/app/Layout/index.js +105 -0
- package/lib/app/app/Layout/styles.d.ts +12 -0
- package/lib/app/app/Layout/styles.js +64 -0
- package/lib/app/app/Notifications/Onboarding/Notification/styles.d.ts +7 -1
- package/lib/app/app/Notifications/styles.d.ts +18 -2
- package/lib/app/app/index.d.ts +1 -0
- package/lib/app/app/index.js +91 -85
- package/lib/app/app/story/index.js +56 -58
- package/lib/app/app/story/promotion/index.js +31 -36
- package/lib/app/app/story/promotion/styles.d.ts +3 -1
- package/lib/app/app/story/promotion/video.js +63 -81
- package/lib/app/app/story/promotion-notification/styles.d.ts +3 -1
- package/lib/app/app/story/styles.d.ts +5 -1
- package/lib/app/app/story/styles.js +36 -16
- package/lib/app/app/story/video.d.ts +5 -1
- package/lib/app/app/story/video.js +70 -33
- package/lib/app/app/useApp.d.ts +1 -2
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +7 -1
- package/lib/app/masters/BetPack/BetPackContent/index.js +175 -187
- package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +84 -84
- package/lib/app/masters/BetPack/BetPackOverlay/styles.d.ts +14 -2
- package/lib/app/masters/Features/Gamification/Question.js +19 -17
- package/lib/app/masters/Notifications/Onboarding/Notification/styles.d.ts +7 -1
- package/lib/app/masters/Notifications/styles.d.ts +18 -2
- package/lib/app/masters/masters.d.ts +4 -1
- package/lib/app/masters/useMastersApp.d.ts +1 -1
- package/lib/app/tgl/styles.d.ts +3 -1
- package/lib/app/{tvos → webos/Advertisement}/AdvertisementUI.d.ts +7 -1
- package/lib/app/webos/Advertisement/AdvertisementUI.js +63 -0
- package/lib/app/{tvos/Advertisement.d.ts → webos/Advertisement/index.d.ts} +3 -1
- package/lib/app/webos/Advertisement/index.js +119 -0
- package/lib/app/webos/ExposedPauseAd/PauseAd.d.ts +15 -0
- package/lib/app/webos/ExposedPauseAd/PauseAd.js +93 -0
- package/lib/app/webos/ExposedPauseAd/styles.d.ts +12 -0
- package/lib/app/webos/ExposedPauseAd/styles.js +64 -0
- package/lib/app/webos/Question/index.d.ts +9 -0
- package/lib/app/webos/Question/index.js +56 -0
- package/lib/app/webos/index.d.ts +24 -0
- package/lib/app/webos/index.js +65 -0
- package/lib/app/webos/story.d.ts +9 -0
- package/lib/app/webos/story.js +74 -0
- package/lib/app/webos/styles.js +4 -0
- package/lib/app/webos/ui/Layout/index.js +78 -0
- package/lib/app/{tvos → webos}/ui/Layout/styles.js +25 -25
- package/lib/app/webos/ui/Sidebar/PromoAction.d.ts +7 -0
- package/lib/app/webos/ui/Sidebar/PromoAction.js +63 -0
- package/lib/app/{tvos → webos}/ui/Sidebar/index.d.ts +6 -0
- package/lib/app/webos/ui/Sidebar/index.js +176 -0
- package/lib/app/{tvos → webos}/ui/Sidebar/styles.d.ts +7 -3
- package/lib/app/{tvos → webos}/ui/Sidebar/styles.js +175 -170
- package/lib/app/webos/ui/insight/index.d.ts +9 -0
- package/lib/app/webos/ui/insight/index.js +100 -0
- package/lib/app/webos/ui/insight/styles.d.ts +12 -0
- package/lib/app/webos/ui/insight/styles.js +51 -0
- package/lib/app/webos/useTvButton.d.ts +9 -0
- package/lib/app/webos/useTvButton.js +23 -0
- package/lib/assets/style.css +1 -1
- package/lib/hooks/analytics.d.ts +14 -0
- package/lib/hooks/showIn.d.ts +9 -0
- package/lib/hooks/useKeyboardNavigation.d.ts +15 -0
- package/lib/hooks/useKeyboardNavigation.js +74 -0
- package/lib/index-T1iiS0ZO.js +17 -0
- package/lib/ui/advertisement/banner/index.d.ts +3 -0
- package/lib/ui/advertisement/banner/index.js +29 -17
- package/lib/ui/advertisement/banner/styles.d.ts +5 -1
- package/lib/ui/advertisement/index.d.ts +4 -1
- package/lib/ui/advertisement/index.js +56 -44
- package/lib/ui/advertisement/notification/index.d.ts +2 -0
- package/lib/ui/advertisement/notification/index.js +50 -34
- package/lib/ui/advertisement/notification/lower-third/index.d.ts +2 -0
- package/lib/ui/advertisement/notification/lower-third/index.js +42 -26
- package/lib/ui/advertisement/notification/lower-third/styles.d.ts +11 -0
- package/lib/ui/advertisement/notification/lower-third/styles.js +39 -24
- package/lib/ui/advertisement/notification/styles.d.ts +18 -1
- package/lib/ui/advertisement/notification/styles.js +48 -33
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.d.ts +2 -2
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +1 -1
- package/lib/ui/advertisement/overlay/index.d.ts +4 -1
- package/lib/ui/advertisement/overlay/index.js +135 -77
- package/lib/ui/gamification/detail/header/index.d.ts +2 -0
- package/lib/ui/gamification/detail/header/index.js +19 -16
- package/lib/ui/gamification/detail/header/styles.d.ts +15 -3
- package/lib/ui/gamification/detail/header/styles.js +1 -1
- package/lib/ui/gamification/detail/sponsor/index.d.ts +1 -0
- package/lib/ui/gamification/detail/sponsor/index.js +25 -13
- package/lib/ui/gamification/invite-link/styles.d.ts +14 -2
- package/lib/ui/gamification/leaderboard/list-item/styles.d.ts +7 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.d.ts +14 -2
- package/lib/ui/gamification/onboarding/styles.d.ts +10 -2
- package/lib/ui/gamification/points/styles.d.ts +7 -1
- package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.d.ts +48 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.js +94 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/index.d.ts +9 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/index.js +99 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/styles.d.ts +42 -0
- package/lib/ui/gamification/question/inapp/notification/AdNotification/styles.js +117 -0
- package/lib/ui/gamification/question/inapp/notification/NotificationMedia/index.js +9 -8
- package/lib/ui/gamification/question/inapp/notification/styles.d.ts +7 -1
- package/lib/ui/gamification/question/inapp/onboarding/index.js +12 -12
- package/lib/ui/gamification/question/inapp/onboarding/styles.d.ts +18 -2
- package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +9 -9
- package/lib/ui/gamification/question/inapp/prediction-result/frames/styles.d.ts +7 -1
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/content.d.ts +5 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/content.js +49 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/index.d.ts +12 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/index.js +56 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/lines.d.ts +1 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/lines.js +34 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step1.d.ts +1 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step1.js +19 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step2.d.ts +4 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step2.js +34 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step3.d.ts +7 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step3.js +43 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/styles.d.ts +9 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/styles.js +20 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/index.d.ts +10 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/index.js +20 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/styles.d.ts +11 -0
- package/lib/ui/gamification/question/inapp/prediction-result-ad/styles.js +34 -0
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +38 -5
- package/lib/ui/gamification/question/notification/styles.d.ts +14 -2
- package/lib/ui/gamification/question/styles.d.ts +26 -4
- package/lib/ui/gamification/vote/alert/styles.d.ts +7 -1
- package/lib/ui/gamification/vote/feedback/styles.d.ts +19 -2
- package/lib/ui/gamification/vote/feedbackAlert/index.d.ts +9 -0
- package/lib/ui/gamification/vote/feedbackAlert/index.js +11 -0
- package/lib/ui/gamification/vote/feedbackAlert/styles.d.ts +11 -0
- package/lib/ui/gamification/vote/feedbackAlert/styles.js +30 -0
- package/lib/ui/gamification/vote/index.d.ts +3 -1
- package/lib/ui/gamification/vote/index.js +160 -130
- package/lib/ui/gamification/vote/insight-details/index.js +8 -7
- package/lib/ui/gamification/vote/insight-details/styles.d.ts +7 -1
- package/lib/ui/gamification/vote/styles.d.ts +29 -4
- package/lib/ui/gamification/vote/vote-option/index.d.ts +3 -0
- package/lib/ui/gamification/vote/vote-option/index.js +72 -64
- package/lib/ui/gamification/vote/vote-option/styles.d.ts +7 -1
- package/lib/ui/gamification/vote/win-bar/styles.d.ts +19 -2
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +80 -79
- package/lib/ui/modal/index.js +12 -17
- package/lib/ui/questions/insight/index.d.ts +4 -1
- package/lib/ui/questions/insight/index.js +29 -26
- package/lib/ui/questions/twitter/account/styles.d.ts +7 -1
- package/lib/ui/questions/twitter/index.d.ts +1 -0
- package/lib/ui/questions/twitter/index.js +27 -19
- package/lib/ui/theme/constants.d.ts +2 -0
- package/lib/ui/theme/constants.js +2 -0
- package/lib/ui/theme/masters-theme.js +1 -0
- package/lib/ui/theme/utils.d.ts +10 -0
- package/lib/ui/theme/utils.js +77 -0
- package/lib/ui/video-player/index.d.ts +10 -2
- package/lib/ui/video-player/index.js +189 -110
- package/lib/ui/video-player/styles.d.ts +36 -0
- package/lib/ui/video-player/styles.js +59 -11
- package/lib/utils/common.d.ts +6 -0
- package/lib/utils/createDemo.d.ts +12 -0
- package/lib/utils/debug/components/bypassLogin.d.ts +6 -0
- package/lib/utils/debug/components/copyLogs.d.ts +1 -0
- package/lib/utils/debug/components/developer.d.ts +14 -0
- package/lib/utils/debug/components/envToggle.d.ts +6 -0
- package/lib/utils/debug/components/eventInput.d.ts +8 -0
- package/lib/utils/debug/components/sdkKey.d.ts +6 -0
- package/lib/utils/debug/components/styles.d.ts +1 -0
- package/lib/utils/debug/index.d.ts +36 -0
- package/lib/utils/debug/storage.d.ts +14 -0
- package/lib/utils/decorators/container.d.ts +6 -0
- package/lib/utils/decorators/container.js +5 -5
- package/lib/utils/decorators/masters.d.ts +2 -0
- package/lib/utils/decorators/styles.d.ts +2 -0
- package/lib/utils/login.d.ts +3 -0
- package/lib/utils/storage.d.ts +14 -0
- package/package.json +27 -20
- package/lib/app/tvos/Advertisement.js +0 -88
- package/lib/app/tvos/AdvertisementUI.js +0 -40
- package/lib/app/tvos/index.d.ts +0 -16
- package/lib/app/tvos/index.js +0 -23
- package/lib/app/tvos/story.d.ts +0 -6
- package/lib/app/tvos/story.js +0 -34
- package/lib/app/tvos/styles.js +0 -4
- package/lib/app/tvos/ui/Layout/index.js +0 -76
- package/lib/app/tvos/ui/Sidebar/PromoAction.d.ts +0 -2
- package/lib/app/tvos/ui/Sidebar/PromoAction.js +0 -62
- package/lib/app/tvos/ui/Sidebar/index.js +0 -114
- /package/lib/app/{tvos → webos}/styles.d.ts +0 -0
- /package/lib/app/{tvos → webos}/ui/Layout/index.d.ts +0 -0
- /package/lib/app/{tvos → webos}/ui/Layout/styles.d.ts +0 -0
|
@@ -1,114 +1,193 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { SvgIcon as
|
|
6
|
-
import { Loader as
|
|
7
|
-
import { Container as
|
|
8
|
-
const
|
|
9
|
-
for (const
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
for (const
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
1
|
+
import { jsxs as N, jsx as t, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import { cx as Z } from "@linaria/core";
|
|
3
|
+
import { withFocusable as re } from "../../app/webos/useTvButton.js";
|
|
4
|
+
import { forwardRef as se, useRef as W, useState as L, useEffect as v, useCallback as T } from "react";
|
|
5
|
+
import { SvgIcon as C } from "../icons/index.js";
|
|
6
|
+
import { Loader as ne } from "../loader/index.js";
|
|
7
|
+
import { ToggleIconPause as ce, HideControls as ie, Player as oe, Poster as ae, Control as P, Container as fe, VideoControls as ue, PauseIcon as le, PlayIcon as me, MuteIcon as de, WebOSIconButtonPlay as Y, WebOSIconButtonPause as be, WebOSIconButtonMute as ge, WebOSIconButtonUnmute as he } from "./styles.js";
|
|
8
|
+
const pe = (r) => {
|
|
9
|
+
for (const s of r)
|
|
10
|
+
s.isIntersecting ? s.target instanceof HTMLVideoElement && s.target.autoplay && s.target.play() : s.target instanceof HTMLVideoElement && !s.target.paused && s.target.pause();
|
|
11
|
+
}, _ = new IntersectionObserver(pe, { threshold: 0.5 }), A = /* @__PURE__ */ new Set(), ve = (r) => {
|
|
12
|
+
_.observe(r), A.add(r);
|
|
13
|
+
}, Ce = (r) => {
|
|
14
|
+
_.unobserve(r), A.delete(r);
|
|
15
|
+
}, Se = () => {
|
|
16
|
+
for (const r of A)
|
|
17
|
+
r instanceof HTMLVideoElement && !r.paused && r.pause();
|
|
18
|
+
};
|
|
19
|
+
function Ie(...r) {
|
|
20
|
+
return T(
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
(s) => {
|
|
23
|
+
for (const c of r)
|
|
24
|
+
c !== null && (typeof c == "function" ? c(s) : c && (c.current = s));
|
|
25
|
+
},
|
|
26
|
+
// Re-run the callback if the array of refs changes
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
[...r]
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
const Oe = re(fe), Le = ({ loading: r, autoPlay: s, played: c, playing: o, isMuted: l, unmute: m, mute: d, togglePlaying: f }) => !r && !s && !c ? /* @__PURE__ */ t(P, { children: o ? /* @__PURE__ */ t(C, { name: "icon-pause" }) : /* @__PURE__ */ t(C, { name: "icon-play" }) }) : c ? /* @__PURE__ */ N(ue, { children: [
|
|
32
|
+
o ? /* @__PURE__ */ t(le, { onClick: f }) : /* @__PURE__ */ t(me, { onClick: f }),
|
|
33
|
+
/* @__PURE__ */ t(de, { className: Z(!l && "muted"), onClick: l ? m : d })
|
|
34
|
+
] }) : null, Te = ({ loading: r, autoPlay: s, playMuted: c, playing: o, played: l, isMutedMediaVideo: m, unmute: d, mute: f, isMuted: g }) => /* @__PURE__ */ N(te, { children: [
|
|
35
|
+
!r && !(s && c) && /* @__PURE__ */ t(P, { "data-control-btn": "true", children: o ? /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(C, { name: "icon-play" }) }) : l ? /* @__PURE__ */ t(be, { children: /* @__PURE__ */ t(C, { name: "icon-pause" }) }) : /* @__PURE__ */ t(Y, { name: "icon-play", "data-control-icon": "true" }) }),
|
|
36
|
+
!r && s && c && m !== void 0 && /* @__PURE__ */ t(P, { children: m ? /* @__PURE__ */ t(ge, { onClick: g ? d : f, children: /* @__PURE__ */ t(C, { name: "iconMute" }) }) : /* @__PURE__ */ t(he, { onClick: g ? d : f, children: /* @__PURE__ */ t(C, { name: "iconUnMute" }) }) })
|
|
37
|
+
] }), Pe = se(
|
|
38
|
+
({
|
|
39
|
+
poster: r,
|
|
40
|
+
source: s,
|
|
41
|
+
aspectRatio: c,
|
|
42
|
+
controlVideo: o,
|
|
43
|
+
onReplay: l,
|
|
44
|
+
onPlay: m,
|
|
45
|
+
onPause: d,
|
|
46
|
+
onEnd: f,
|
|
47
|
+
onRender: g,
|
|
48
|
+
onMute: x,
|
|
49
|
+
onQuartile: u,
|
|
50
|
+
autoPlay: S,
|
|
51
|
+
playMuted: k,
|
|
52
|
+
className: $,
|
|
53
|
+
muted: I,
|
|
54
|
+
webos: B
|
|
55
|
+
}, V) => {
|
|
56
|
+
const n = W(null), R = Ie(n, V), E = W(!1), j = W(!1), b = W(/* @__PURE__ */ new Set()), [D, K] = L(!1), [w, y] = L(!1), [M, z] = L(!1), [G, H] = L(!0), [q, F] = L(k);
|
|
57
|
+
v(() => {
|
|
58
|
+
s && (F(k), K(!1));
|
|
59
|
+
}, [s]);
|
|
60
|
+
const p = T(() => {
|
|
61
|
+
o == null || o({ muted: !1 });
|
|
62
|
+
}, [o]), J = T(() => {
|
|
63
|
+
o == null || o({ muted: !0 });
|
|
64
|
+
}, [o]), O = T((e) => {
|
|
65
|
+
e == null || e.stopPropagation(), n.current && (n.current.muted = !0), F(!0);
|
|
66
|
+
}, []), U = T((e) => {
|
|
67
|
+
e == null || e.stopPropagation(), n.current && (n.current.muted = !1), F(!1);
|
|
68
|
+
}, []);
|
|
69
|
+
v(() => {
|
|
70
|
+
I !== void 0 && (I ? O() : U());
|
|
71
|
+
}, [O, I, U]);
|
|
72
|
+
const X = (e) => {
|
|
73
|
+
var h;
|
|
74
|
+
(h = e.stopPropagation) == null || h.call(e);
|
|
75
|
+
const i = n == null ? void 0 : n.current;
|
|
76
|
+
if (i)
|
|
77
|
+
if (w)
|
|
78
|
+
i.pause();
|
|
79
|
+
else {
|
|
80
|
+
const a = n == null ? void 0 : n.current;
|
|
81
|
+
if (!a)
|
|
82
|
+
return;
|
|
83
|
+
Se(), a.play().catch((ee) => console.log(ee)), H(!1);
|
|
84
|
+
}
|
|
85
|
+
}, Q = () => {
|
|
86
|
+
var e;
|
|
87
|
+
(e = n == null ? void 0 : n.current) == null || e.load(), H(!0);
|
|
62
88
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
return v(() => () => {
|
|
90
|
+
p();
|
|
91
|
+
}, [p]), v(() => {
|
|
92
|
+
const e = n.current;
|
|
93
|
+
return e ? (j.current = e.muted, F(e.muted), ve(e), () => {
|
|
94
|
+
Ce(e);
|
|
95
|
+
}) : () => {
|
|
96
|
+
};
|
|
97
|
+
}, []), v(() => {
|
|
98
|
+
g == null || g();
|
|
99
|
+
}, [g]), v(() => {
|
|
100
|
+
b.current.clear(), E.current = !1;
|
|
101
|
+
}, [s]), /* @__PURE__ */ N(
|
|
102
|
+
Oe,
|
|
103
|
+
{
|
|
104
|
+
webos: B,
|
|
105
|
+
onClick: S ? void 0 : X,
|
|
106
|
+
"data-a": "intr",
|
|
107
|
+
autoFocus: !0,
|
|
108
|
+
options: { focusKey: "video-play-btn" },
|
|
109
|
+
className: Z(w && ce, S && ie, $),
|
|
110
|
+
style: c ? { aspectRatio: c } : {},
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ t(
|
|
113
|
+
oe,
|
|
114
|
+
{
|
|
115
|
+
ref: R,
|
|
116
|
+
src: s,
|
|
117
|
+
autoPlay: S,
|
|
118
|
+
onPlay: () => {
|
|
119
|
+
K(!0), E.current && (l == null || l(), b.current.clear()), y(!0), H(!1), m == null || m(), k ? O() : J();
|
|
120
|
+
},
|
|
121
|
+
onTimeUpdate: (e) => {
|
|
122
|
+
const i = e.target.duration, h = e.target.currentTime;
|
|
123
|
+
if (i && h) {
|
|
124
|
+
const a = Math.floor(h / i * 100);
|
|
125
|
+
a >= 25 && a < 50 && !b.current.has(25) ? (u == null || u(25), b.current.add(25)) : a >= 50 && a < 75 && !b.current.has(50) ? (u == null || u(50), b.current.add(50)) : a >= 75 && !b.current.has(75) && (u == null || u(75), b.current.add(75));
|
|
86
126
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
127
|
+
},
|
|
128
|
+
onVolumeChange: (e) => {
|
|
129
|
+
const i = e.target.muted;
|
|
130
|
+
j.current !== i && (x == null || x(i), j.current = i, (i !== I || I === void 0) && (i ? p() : J()));
|
|
131
|
+
},
|
|
132
|
+
onError: async (e) => {
|
|
133
|
+
try {
|
|
134
|
+
if (e.target instanceof HTMLVideoElement) {
|
|
135
|
+
z(!0);
|
|
136
|
+
const h = await (await fetch(e.target.src)).blob(), a = URL.createObjectURL(h);
|
|
137
|
+
e.target.src = a;
|
|
138
|
+
}
|
|
139
|
+
} catch (i) {
|
|
140
|
+
console.error("video fallback fetch failed", i), y(!0), H(!0);
|
|
141
|
+
} finally {
|
|
142
|
+
z(!1), p();
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
onPause: () => {
|
|
146
|
+
y(!1), d == null || d(), p();
|
|
147
|
+
},
|
|
148
|
+
onEnded: () => {
|
|
149
|
+
y(!1), E.current = !0, Q(), f == null || f(), p();
|
|
150
|
+
},
|
|
151
|
+
style: { visibility: G ? "hidden" : "visible" },
|
|
152
|
+
controls: !1,
|
|
153
|
+
playsInline: !0
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ t(ae, { src: r, style: { visibility: G ? "visible" : "hidden" } }),
|
|
157
|
+
!B && /* @__PURE__ */ t(
|
|
158
|
+
Le,
|
|
159
|
+
{
|
|
160
|
+
loading: M,
|
|
161
|
+
autoPlay: S,
|
|
162
|
+
played: D,
|
|
163
|
+
playing: w,
|
|
164
|
+
isMuted: q,
|
|
165
|
+
unmute: U,
|
|
166
|
+
mute: O,
|
|
167
|
+
togglePlaying: X
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
B && /* @__PURE__ */ t(
|
|
171
|
+
Te,
|
|
172
|
+
{
|
|
173
|
+
loading: M,
|
|
174
|
+
autoPlay: S,
|
|
175
|
+
playMuted: k,
|
|
176
|
+
playing: w,
|
|
177
|
+
played: D,
|
|
178
|
+
isMutedMediaVideo: q,
|
|
179
|
+
unmute: U,
|
|
180
|
+
mute: O,
|
|
181
|
+
isMuted: q
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
M && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(ne, {}) })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
);
|
|
111
190
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
191
|
+
Pe as VideoPlayer,
|
|
192
|
+
Se as pauseAllVideos
|
|
114
193
|
};
|
|
@@ -4,3 +4,39 @@ export declare const Poster: import('@linaria/react').StyledComponent<import('re
|
|
|
4
4
|
export declare const Control: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
5
|
export declare const ToggleIconPause: import('@linaria/core').LinariaClassName;
|
|
6
6
|
export declare const HideControls: import('@linaria/core').LinariaClassName;
|
|
7
|
+
export declare const VideoControls: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
8
|
+
export declare const MuteIcon: {
|
|
9
|
+
__wyw_meta: unknown;
|
|
10
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const PauseIcon: {
|
|
14
|
+
__wyw_meta: unknown;
|
|
15
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const PlayIcon: {
|
|
19
|
+
__wyw_meta: unknown;
|
|
20
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
|
|
21
|
+
as?: React.ElementType;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const WebOSIconButtonPlay: {
|
|
24
|
+
__wyw_meta: unknown;
|
|
25
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
|
|
26
|
+
as?: React.ElementType;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const WebOSIconButtonPause: {
|
|
29
|
+
__wyw_meta: unknown;
|
|
30
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
|
|
31
|
+
as?: React.ElementType;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const WebOSIconButtonMute: {
|
|
34
|
+
__wyw_meta: unknown;
|
|
35
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
|
|
36
|
+
as?: React.ElementType;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const WebOSIconButtonUnmute: {
|
|
39
|
+
__wyw_meta: unknown;
|
|
40
|
+
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
|
|
41
|
+
as?: React.ElementType;
|
|
42
|
+
}>;
|
|
@@ -1,26 +1,74 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const I = /* @__PURE__ */ s("div")({
|
|
3
3
|
name: "Container",
|
|
4
4
|
class: "c1bgb86j",
|
|
5
5
|
propsAsIs: !1
|
|
6
|
-
}),
|
|
6
|
+
}), m = /* @__PURE__ */ s("video")({
|
|
7
7
|
name: "Player",
|
|
8
8
|
class: "p6703cq",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
10
|
+
}), b = /* @__PURE__ */ s("img")({
|
|
11
11
|
name: "Poster",
|
|
12
12
|
class: "p12ow7zo",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
14
|
+
}), A = /* @__PURE__ */ s("div")({
|
|
15
15
|
name: "Control",
|
|
16
16
|
class: "cdpal9o",
|
|
17
17
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
18
|
+
}), i = "t1xke4ml", y = "h1yzxv57", P = /* @__PURE__ */ s("div")({
|
|
19
|
+
name: "VideoControls",
|
|
20
|
+
class: "vxo8xch",
|
|
21
|
+
propsAsIs: !1
|
|
22
|
+
}), n = /* @__PURE__ */ s("button")({
|
|
23
|
+
name: "ControlBtn",
|
|
24
|
+
class: "coyuzu0",
|
|
25
|
+
propsAsIs: !1
|
|
26
|
+
}), t = () => n, x = /* @__PURE__ */ s(t())({
|
|
27
|
+
name: "MuteIcon",
|
|
28
|
+
class: "musmi9a",
|
|
29
|
+
propsAsIs: !0
|
|
30
|
+
}), e = () => n, B = /* @__PURE__ */ s(e())({
|
|
31
|
+
name: "PauseIcon",
|
|
32
|
+
class: "p1qe7rum",
|
|
33
|
+
propsAsIs: !0
|
|
34
|
+
}), c = () => n, d = /* @__PURE__ */ s(c())({
|
|
35
|
+
name: "PlayIcon",
|
|
36
|
+
class: "psevery",
|
|
37
|
+
propsAsIs: !0
|
|
38
|
+
}), o = /* @__PURE__ */ s("button")({
|
|
39
|
+
name: "WebOSIconButton",
|
|
40
|
+
class: "w1q3u7py",
|
|
41
|
+
propsAsIs: !1
|
|
42
|
+
}), a = () => o, O = /* @__PURE__ */ s(a())({
|
|
43
|
+
name: "WebOSIconButtonPlay",
|
|
44
|
+
class: "wdlqvum",
|
|
45
|
+
propsAsIs: !0
|
|
46
|
+
}), p = () => o, S = /* @__PURE__ */ s(p())({
|
|
47
|
+
name: "WebOSIconButtonPause",
|
|
48
|
+
class: "w1ylz9ea",
|
|
49
|
+
propsAsIs: !0
|
|
50
|
+
}), l = () => o, W = /* @__PURE__ */ s(l())({
|
|
51
|
+
name: "WebOSIconButtonMute",
|
|
52
|
+
class: "w1iylt55",
|
|
53
|
+
propsAsIs: !0
|
|
54
|
+
}), r = () => o, C = /* @__PURE__ */ s(r())({
|
|
55
|
+
name: "WebOSIconButtonUnmute",
|
|
56
|
+
class: "w8h4h7",
|
|
57
|
+
propsAsIs: !0
|
|
58
|
+
});
|
|
19
59
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
60
|
+
I as Container,
|
|
61
|
+
A as Control,
|
|
62
|
+
y as HideControls,
|
|
63
|
+
x as MuteIcon,
|
|
64
|
+
B as PauseIcon,
|
|
65
|
+
d as PlayIcon,
|
|
66
|
+
m as Player,
|
|
67
|
+
b as Poster,
|
|
68
|
+
i as ToggleIconPause,
|
|
69
|
+
P as VideoControls,
|
|
70
|
+
W as WebOSIconButtonMute,
|
|
71
|
+
S as WebOSIconButtonPause,
|
|
72
|
+
O as WebOSIconButtonPlay,
|
|
73
|
+
C as WebOSIconButtonUnmute
|
|
26
74
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const abbreviate: (name: string) => string;
|
|
2
|
+
export declare const formatDecimals: (value?: number) => string;
|
|
3
|
+
export declare const formatDate: (date: Date) => string;
|
|
4
|
+
export declare const formatTime: (time: Date) => string;
|
|
5
|
+
export declare const isValidDate: (date: Date) => boolean;
|
|
6
|
+
export declare const getTimeUntilNow: (date: string) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj, StoryFn } from '@storybook/react';
|
|
2
|
+
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
|
+
type Props = {
|
|
4
|
+
SDK_KEY?: string;
|
|
5
|
+
production?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type DemoStory = React.FC<Props>;
|
|
8
|
+
export declare function createDemo<T>(Component: React.FC<{
|
|
9
|
+
Story: StoryFn<T>;
|
|
10
|
+
sdk: StreamLayerSDK;
|
|
11
|
+
}>, autoEnable?: boolean): StoryObj<DemoStory>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CopyLogs: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
type DeveloperProps = {
|
|
3
|
+
sdk: StreamLayerSDK | null;
|
|
4
|
+
sdkKey: string;
|
|
5
|
+
setSdkKey?: (sdkKey: string) => void;
|
|
6
|
+
env: 'production' | 'development';
|
|
7
|
+
setEnv?: (value: 'production' | 'development') => void;
|
|
8
|
+
event: string;
|
|
9
|
+
setEvent: (event: string) => void;
|
|
10
|
+
hideAuth?: boolean;
|
|
11
|
+
standalone?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const Developer: React.FC<DeveloperProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
+
import { DeveloperStorage } from '../../storage';
|
|
3
|
+
export declare const EventInput: React.FC<{
|
|
4
|
+
sdk: StreamLayerSDK;
|
|
5
|
+
storage: DeveloperStorage;
|
|
6
|
+
event: string;
|
|
7
|
+
setEvent: (event: string) => void;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InputField: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ArgTypes } from '@storybook/react';
|
|
2
|
+
export type DebugProps = {
|
|
3
|
+
production?: boolean;
|
|
4
|
+
sdkKey?: string;
|
|
5
|
+
eventId?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const storybookOptions: {
|
|
8
|
+
args: DebugProps;
|
|
9
|
+
argTypes: ArgTypes<DebugProps>;
|
|
10
|
+
};
|
|
11
|
+
export declare const useStreamLayerDebug: (props?: DebugProps) => {
|
|
12
|
+
env: "production" | "development";
|
|
13
|
+
setEnv: import('react').Dispatch<import('react').SetStateAction<"production" | "development">>;
|
|
14
|
+
sdkKey: string;
|
|
15
|
+
setSdkKey: import('react').Dispatch<import('react').SetStateAction<string>>;
|
|
16
|
+
event: string;
|
|
17
|
+
setEvent: import('react').Dispatch<import('react').SetStateAction<string>>;
|
|
18
|
+
};
|
|
19
|
+
export type StreamLayerDebugProps = ReturnType<typeof useStreamLayerDebug>;
|
|
20
|
+
/**
|
|
21
|
+
* The `StreamLayerDebug` component is used to debug the StreamLayer SDK.
|
|
22
|
+
* It is using:
|
|
23
|
+
* - the `Developer` component to display the different debug options.
|
|
24
|
+
* - the `useStreamLayerDebug` hook to get the current debug values.
|
|
25
|
+
* - the `useStreamLayer` hook to get the StreamLayer SDK.
|
|
26
|
+
* - the `DeveloperStorage` to store the debug values.
|
|
27
|
+
*
|
|
28
|
+
* The `Developer` component includes:
|
|
29
|
+
* - the `EnvToggle` component to switch between the `production` and `development` environments.
|
|
30
|
+
* - the `SdkKeyInput` component to set the SDK key.
|
|
31
|
+
* - the `EventInput` component to set the event.
|
|
32
|
+
* - the `BypassLogin` component to bypass login.
|
|
33
|
+
*
|
|
34
|
+
* The `Developer` component can be opened by clicking on the `Debug` button in the bottom right corner of the screen.
|
|
35
|
+
*/
|
|
36
|
+
export declare const StreamLayerDebug: React.FC<StreamLayerDebugProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Storage } from '@streamlayer/sdk-web-storage';
|
|
2
|
+
export declare class DeveloperStorage extends Storage {
|
|
3
|
+
constructor();
|
|
4
|
+
setSchema: (value: string) => void;
|
|
5
|
+
getSchema: () => string | undefined;
|
|
6
|
+
setToken: (value: string) => void;
|
|
7
|
+
getToken: () => string | undefined;
|
|
8
|
+
setEvent: (value: string) => void;
|
|
9
|
+
getEvent: () => string | undefined;
|
|
10
|
+
setSdkKey: (value: string) => void;
|
|
11
|
+
getSdkKey: () => string | undefined;
|
|
12
|
+
setEnv: (value: "production" | "development") => void;
|
|
13
|
+
getEnv: () => "production" | "development";
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StoryContext, StoryFn } from '@storybook/react';
|
|
2
|
+
export declare const mastersTheme: (Story: StoryFn, _context: StoryContext) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const theme: (Story: StoryFn, context: StoryContext) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const bgContainer: (Story: StoryFn) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
/** @deprecated */
|
|
6
|
+
export declare const container: (Story: StoryFn) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { StreamLayerThemeProvider as n } from "../../ui/theme/index.js";
|
|
3
|
-
import { StreamLayerMastersThemeProvider as
|
|
4
|
-
import { BGContainer as
|
|
5
|
-
const l = (r, t) => /* @__PURE__ */ e(
|
|
6
|
-
const o = t.globals.theme || "
|
|
3
|
+
import { StreamLayerMastersThemeProvider as m } from "../../ui/theme/masters.js";
|
|
4
|
+
import { BGContainer as i, AppContainer as c } from "./styles.js";
|
|
5
|
+
const l = (r, t) => /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(r, {}) }), p = (r, t) => {
|
|
6
|
+
const o = t.globals.theme || "dark";
|
|
7
7
|
return /* @__PURE__ */ e(n, { themeMode: o, children: /* @__PURE__ */ e(r, {}) });
|
|
8
|
-
}, f = (r) => /* @__PURE__ */ e(
|
|
8
|
+
}, f = (r) => /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(r, {}) }), u = (r) => /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(r, {}) }) }) });
|
|
9
9
|
export {
|
|
10
10
|
f as bgContainer,
|
|
11
11
|
u as container,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const AppContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
|
+
export declare const BGContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Storage } from '@streamlayer/sdk-web-storage';
|
|
2
|
+
export declare class DeveloperStorage extends Storage {
|
|
3
|
+
constructor();
|
|
4
|
+
setSchema: (value: string) => void;
|
|
5
|
+
getSchema: () => string | undefined;
|
|
6
|
+
setToken: (value: string) => void;
|
|
7
|
+
getToken: () => string | undefined;
|
|
8
|
+
setEvent: (value: string) => void;
|
|
9
|
+
getEvent: () => string | undefined;
|
|
10
|
+
setSdkKey: (value: string) => void;
|
|
11
|
+
getSdkKey: () => string | undefined;
|
|
12
|
+
setEnv: (value: "production" | "development") => void;
|
|
13
|
+
getEnv: () => "production" | "development";
|
|
14
|
+
}
|