@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.
Files changed (205) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -0
  2. package/lib/app/app/Advertisement/index.js +125 -92
  3. package/lib/app/app/Banner/index.d.ts +6 -0
  4. package/lib/app/app/Banner/index.js +6 -0
  5. package/lib/app/app/Features/Gamification/Question.d.ts +4 -0
  6. package/lib/app/app/Features/Gamification/Question.js +79 -50
  7. package/lib/app/app/Features/Gamification/QuestionAdvertisement.d.ts +6 -0
  8. package/lib/app/app/Features/Gamification/QuestionAdvertisement.js +46 -0
  9. package/lib/app/app/Features/Gamification/Tabs.js +12 -12
  10. package/lib/app/app/Features/Gamification/index.d.ts +3 -0
  11. package/lib/app/app/Features/Gamification/index.js +56 -52
  12. package/lib/app/app/Features/index.d.ts +1 -0
  13. package/lib/app/app/Features/index.js +6 -4
  14. package/lib/app/app/InApp/index.d.ts +1 -0
  15. package/lib/app/app/InApp/index.js +44 -17
  16. package/lib/app/app/Insight/index.d.ts +3 -0
  17. package/lib/app/app/Insight/index.js +33 -30
  18. package/lib/app/app/Layout/index.d.ts +17 -0
  19. package/lib/app/app/Layout/index.js +105 -0
  20. package/lib/app/app/Layout/styles.d.ts +12 -0
  21. package/lib/app/app/Layout/styles.js +64 -0
  22. package/lib/app/app/Notifications/Onboarding/Notification/styles.d.ts +7 -1
  23. package/lib/app/app/Notifications/styles.d.ts +18 -2
  24. package/lib/app/app/index.d.ts +1 -0
  25. package/lib/app/app/index.js +91 -85
  26. package/lib/app/app/story/index.js +56 -58
  27. package/lib/app/app/story/promotion/index.js +31 -36
  28. package/lib/app/app/story/promotion/styles.d.ts +3 -1
  29. package/lib/app/app/story/promotion/video.js +63 -81
  30. package/lib/app/app/story/promotion-notification/styles.d.ts +3 -1
  31. package/lib/app/app/story/styles.d.ts +5 -1
  32. package/lib/app/app/story/styles.js +36 -16
  33. package/lib/app/app/story/video.d.ts +5 -1
  34. package/lib/app/app/story/video.js +70 -33
  35. package/lib/app/app/useApp.d.ts +1 -2
  36. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +7 -1
  37. package/lib/app/masters/BetPack/BetPackContent/index.js +175 -187
  38. package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +84 -84
  39. package/lib/app/masters/BetPack/BetPackOverlay/styles.d.ts +14 -2
  40. package/lib/app/masters/Features/Gamification/Question.js +19 -17
  41. package/lib/app/masters/Notifications/Onboarding/Notification/styles.d.ts +7 -1
  42. package/lib/app/masters/Notifications/styles.d.ts +18 -2
  43. package/lib/app/masters/masters.d.ts +4 -1
  44. package/lib/app/masters/useMastersApp.d.ts +1 -1
  45. package/lib/app/tgl/styles.d.ts +3 -1
  46. package/lib/app/{tvos → webos/Advertisement}/AdvertisementUI.d.ts +7 -1
  47. package/lib/app/webos/Advertisement/AdvertisementUI.js +63 -0
  48. package/lib/app/{tvos/Advertisement.d.ts → webos/Advertisement/index.d.ts} +3 -1
  49. package/lib/app/webos/Advertisement/index.js +119 -0
  50. package/lib/app/webos/ExposedPauseAd/PauseAd.d.ts +15 -0
  51. package/lib/app/webos/ExposedPauseAd/PauseAd.js +93 -0
  52. package/lib/app/webos/ExposedPauseAd/styles.d.ts +12 -0
  53. package/lib/app/webos/ExposedPauseAd/styles.js +64 -0
  54. package/lib/app/webos/Question/index.d.ts +9 -0
  55. package/lib/app/webos/Question/index.js +56 -0
  56. package/lib/app/webos/index.d.ts +24 -0
  57. package/lib/app/webos/index.js +65 -0
  58. package/lib/app/webos/story.d.ts +9 -0
  59. package/lib/app/webos/story.js +74 -0
  60. package/lib/app/webos/styles.js +4 -0
  61. package/lib/app/webos/ui/Layout/index.js +78 -0
  62. package/lib/app/{tvos → webos}/ui/Layout/styles.js +25 -25
  63. package/lib/app/webos/ui/Sidebar/PromoAction.d.ts +7 -0
  64. package/lib/app/webos/ui/Sidebar/PromoAction.js +63 -0
  65. package/lib/app/{tvos → webos}/ui/Sidebar/index.d.ts +6 -0
  66. package/lib/app/webos/ui/Sidebar/index.js +176 -0
  67. package/lib/app/{tvos → webos}/ui/Sidebar/styles.d.ts +7 -3
  68. package/lib/app/{tvos → webos}/ui/Sidebar/styles.js +175 -170
  69. package/lib/app/webos/ui/insight/index.d.ts +9 -0
  70. package/lib/app/webos/ui/insight/index.js +100 -0
  71. package/lib/app/webos/ui/insight/styles.d.ts +12 -0
  72. package/lib/app/webos/ui/insight/styles.js +51 -0
  73. package/lib/app/webos/useTvButton.d.ts +9 -0
  74. package/lib/app/webos/useTvButton.js +23 -0
  75. package/lib/assets/style.css +1 -1
  76. package/lib/hooks/analytics.d.ts +14 -0
  77. package/lib/hooks/showIn.d.ts +9 -0
  78. package/lib/hooks/useKeyboardNavigation.d.ts +15 -0
  79. package/lib/hooks/useKeyboardNavigation.js +74 -0
  80. package/lib/index-T1iiS0ZO.js +17 -0
  81. package/lib/ui/advertisement/banner/index.d.ts +3 -0
  82. package/lib/ui/advertisement/banner/index.js +29 -17
  83. package/lib/ui/advertisement/banner/styles.d.ts +5 -1
  84. package/lib/ui/advertisement/index.d.ts +4 -1
  85. package/lib/ui/advertisement/index.js +56 -44
  86. package/lib/ui/advertisement/notification/index.d.ts +2 -0
  87. package/lib/ui/advertisement/notification/index.js +50 -34
  88. package/lib/ui/advertisement/notification/lower-third/index.d.ts +2 -0
  89. package/lib/ui/advertisement/notification/lower-third/index.js +42 -26
  90. package/lib/ui/advertisement/notification/lower-third/styles.d.ts +11 -0
  91. package/lib/ui/advertisement/notification/lower-third/styles.js +39 -24
  92. package/lib/ui/advertisement/notification/styles.d.ts +18 -1
  93. package/lib/ui/advertisement/notification/styles.js +48 -33
  94. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.d.ts +2 -2
  95. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +1 -1
  96. package/lib/ui/advertisement/overlay/index.d.ts +4 -1
  97. package/lib/ui/advertisement/overlay/index.js +135 -77
  98. package/lib/ui/gamification/detail/header/index.d.ts +2 -0
  99. package/lib/ui/gamification/detail/header/index.js +19 -16
  100. package/lib/ui/gamification/detail/header/styles.d.ts +15 -3
  101. package/lib/ui/gamification/detail/header/styles.js +1 -1
  102. package/lib/ui/gamification/detail/sponsor/index.d.ts +1 -0
  103. package/lib/ui/gamification/detail/sponsor/index.js +25 -13
  104. package/lib/ui/gamification/invite-link/styles.d.ts +14 -2
  105. package/lib/ui/gamification/leaderboard/list-item/styles.d.ts +7 -1
  106. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.d.ts +14 -2
  107. package/lib/ui/gamification/onboarding/styles.d.ts +10 -2
  108. package/lib/ui/gamification/points/styles.d.ts +7 -1
  109. package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.d.ts +48 -0
  110. package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.js +94 -0
  111. package/lib/ui/gamification/question/inapp/notification/AdNotification/index.d.ts +9 -0
  112. package/lib/ui/gamification/question/inapp/notification/AdNotification/index.js +99 -0
  113. package/lib/ui/gamification/question/inapp/notification/AdNotification/styles.d.ts +42 -0
  114. package/lib/ui/gamification/question/inapp/notification/AdNotification/styles.js +117 -0
  115. package/lib/ui/gamification/question/inapp/notification/NotificationMedia/index.js +9 -8
  116. package/lib/ui/gamification/question/inapp/notification/styles.d.ts +7 -1
  117. package/lib/ui/gamification/question/inapp/onboarding/index.js +12 -12
  118. package/lib/ui/gamification/question/inapp/onboarding/styles.d.ts +18 -2
  119. package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +9 -9
  120. package/lib/ui/gamification/question/inapp/prediction-result/frames/styles.d.ts +7 -1
  121. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/content.d.ts +5 -0
  122. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/content.js +49 -0
  123. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/index.d.ts +12 -0
  124. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/index.js +56 -0
  125. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/lines.d.ts +1 -0
  126. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/lines.js +34 -0
  127. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step1.d.ts +1 -0
  128. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step1.js +19 -0
  129. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step2.d.ts +4 -0
  130. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step2.js +34 -0
  131. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step3.d.ts +7 -0
  132. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/step3.js +43 -0
  133. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/styles.d.ts +9 -0
  134. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/styles.js +20 -0
  135. package/lib/ui/gamification/question/inapp/prediction-result-ad/index.d.ts +10 -0
  136. package/lib/ui/gamification/question/inapp/prediction-result-ad/index.js +20 -0
  137. package/lib/ui/gamification/question/inapp/prediction-result-ad/styles.d.ts +11 -0
  138. package/lib/ui/gamification/question/inapp/prediction-result-ad/styles.js +34 -0
  139. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +38 -5
  140. package/lib/ui/gamification/question/notification/styles.d.ts +14 -2
  141. package/lib/ui/gamification/question/styles.d.ts +26 -4
  142. package/lib/ui/gamification/vote/alert/styles.d.ts +7 -1
  143. package/lib/ui/gamification/vote/feedback/styles.d.ts +19 -2
  144. package/lib/ui/gamification/vote/feedbackAlert/index.d.ts +9 -0
  145. package/lib/ui/gamification/vote/feedbackAlert/index.js +11 -0
  146. package/lib/ui/gamification/vote/feedbackAlert/styles.d.ts +11 -0
  147. package/lib/ui/gamification/vote/feedbackAlert/styles.js +30 -0
  148. package/lib/ui/gamification/vote/index.d.ts +3 -1
  149. package/lib/ui/gamification/vote/index.js +160 -130
  150. package/lib/ui/gamification/vote/insight-details/index.js +8 -7
  151. package/lib/ui/gamification/vote/insight-details/styles.d.ts +7 -1
  152. package/lib/ui/gamification/vote/styles.d.ts +29 -4
  153. package/lib/ui/gamification/vote/vote-option/index.d.ts +3 -0
  154. package/lib/ui/gamification/vote/vote-option/index.js +72 -64
  155. package/lib/ui/gamification/vote/vote-option/styles.d.ts +7 -1
  156. package/lib/ui/gamification/vote/win-bar/styles.d.ts +19 -2
  157. package/lib/ui/icons/index.d.ts +1 -0
  158. package/lib/ui/icons/index.js +80 -79
  159. package/lib/ui/modal/index.js +12 -17
  160. package/lib/ui/questions/insight/index.d.ts +4 -1
  161. package/lib/ui/questions/insight/index.js +29 -26
  162. package/lib/ui/questions/twitter/account/styles.d.ts +7 -1
  163. package/lib/ui/questions/twitter/index.d.ts +1 -0
  164. package/lib/ui/questions/twitter/index.js +27 -19
  165. package/lib/ui/theme/constants.d.ts +2 -0
  166. package/lib/ui/theme/constants.js +2 -0
  167. package/lib/ui/theme/masters-theme.js +1 -0
  168. package/lib/ui/theme/utils.d.ts +10 -0
  169. package/lib/ui/theme/utils.js +77 -0
  170. package/lib/ui/video-player/index.d.ts +10 -2
  171. package/lib/ui/video-player/index.js +189 -110
  172. package/lib/ui/video-player/styles.d.ts +36 -0
  173. package/lib/ui/video-player/styles.js +59 -11
  174. package/lib/utils/common.d.ts +6 -0
  175. package/lib/utils/createDemo.d.ts +12 -0
  176. package/lib/utils/debug/components/bypassLogin.d.ts +6 -0
  177. package/lib/utils/debug/components/copyLogs.d.ts +1 -0
  178. package/lib/utils/debug/components/developer.d.ts +14 -0
  179. package/lib/utils/debug/components/envToggle.d.ts +6 -0
  180. package/lib/utils/debug/components/eventInput.d.ts +8 -0
  181. package/lib/utils/debug/components/sdkKey.d.ts +6 -0
  182. package/lib/utils/debug/components/styles.d.ts +1 -0
  183. package/lib/utils/debug/index.d.ts +36 -0
  184. package/lib/utils/debug/storage.d.ts +14 -0
  185. package/lib/utils/decorators/container.d.ts +6 -0
  186. package/lib/utils/decorators/container.js +5 -5
  187. package/lib/utils/decorators/masters.d.ts +2 -0
  188. package/lib/utils/decorators/styles.d.ts +2 -0
  189. package/lib/utils/login.d.ts +3 -0
  190. package/lib/utils/storage.d.ts +14 -0
  191. package/package.json +27 -20
  192. package/lib/app/tvos/Advertisement.js +0 -88
  193. package/lib/app/tvos/AdvertisementUI.js +0 -40
  194. package/lib/app/tvos/index.d.ts +0 -16
  195. package/lib/app/tvos/index.js +0 -23
  196. package/lib/app/tvos/story.d.ts +0 -6
  197. package/lib/app/tvos/story.js +0 -34
  198. package/lib/app/tvos/styles.js +0 -4
  199. package/lib/app/tvos/ui/Layout/index.js +0 -76
  200. package/lib/app/tvos/ui/Sidebar/PromoAction.d.ts +0 -2
  201. package/lib/app/tvos/ui/Sidebar/PromoAction.js +0 -62
  202. package/lib/app/tvos/ui/Sidebar/index.js +0 -114
  203. /package/lib/app/{tvos → webos}/styles.d.ts +0 -0
  204. /package/lib/app/{tvos → webos}/ui/Layout/index.d.ts +0 -0
  205. /package/lib/app/{tvos → webos}/ui/Layout/styles.d.ts +0 -0
@@ -1,114 +1,193 @@
1
- import { jsxs as k, jsx as a } from "react/jsx-runtime";
2
- import { cx as C } from "@linaria/core";
3
- import { useRef as U, useState as p, useCallback as w, useEffect as O } from "react";
4
- import { eventBus as F } from "@streamlayer/sdk-web-interfaces";
5
- import { SvgIcon as T } from "../icons/index.js";
6
- import { Loader as A } from "../loader/index.js";
7
- import { Container as B, ToggleIconPause as N, HideControls as q, Player as z, Poster as D, Control as H } from "./styles.js";
8
- const G = (s) => {
9
- for (const r of s)
10
- r.isIntersecting ? r.target instanceof HTMLVideoElement && r.target.autoplay && r.target.play() : r.target instanceof HTMLVideoElement && !r.target.paused && r.target.pause();
11
- }, I = new IntersectionObserver(G, { threshold: 0.5 }), v = /* @__PURE__ */ new Set(), J = (s) => {
12
- I.observe(s), v.add(s);
13
- }, K = (s) => {
14
- I.unobserve(s), v.delete(s);
15
- }, Q = () => {
16
- for (const s of v)
17
- s instanceof HTMLVideoElement && !s.paused && s.pause();
18
- }, R = ({
19
- poster: s,
20
- source: r,
21
- aspectRatio: y,
22
- controlVideo: n,
23
- onPlay: f,
24
- onPause: m,
25
- autoPlay: x,
26
- hideControls: b,
27
- className: M
28
- }) => {
29
- const t = U(null), [d, o] = p(!1), [h, L] = p(!1), [E, c] = p(!0), P = w(() => {
30
- n == null || n({ muted: !0 });
31
- }, [n]), l = w(() => {
32
- n == null || n({ muted: !1 });
33
- }, [n]), S = (e) => {
34
- e.stopPropagation();
35
- const i = t == null ? void 0 : t.current;
36
- if (i) {
37
- if (d)
38
- i.pause();
39
- else {
40
- const u = t == null ? void 0 : t.current;
41
- if (!u)
42
- return;
43
- Q(), u.play().catch((g) => console.log(g)), c(!1);
44
- }
45
- F.emit("interactions", {
46
- action: "tap",
47
- payload: {}
48
- });
49
- }
50
- }, j = () => {
51
- var e;
52
- (e = t == null ? void 0 : t.current) == null || e.load(), c(!0);
53
- };
54
- return O(() => {
55
- const e = t == null ? void 0 : t.current;
56
- return () => {
57
- e && (e.paused || l());
58
- };
59
- }, [l]), O(() => {
60
- const e = t.current;
61
- return e ? (J(e), () => K(e)) : () => {
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
- }, []), /* @__PURE__ */ k(
64
- B,
65
- {
66
- onClick: b ? void 0 : S,
67
- "data-a": "intr",
68
- className: C(d && N, b && q, M),
69
- style: y ? { aspectRatio: y } : {},
70
- children: [
71
- /* @__PURE__ */ a(
72
- z,
73
- {
74
- ref: t,
75
- src: r,
76
- autoPlay: x,
77
- onPlay: () => {
78
- P(), o(!0), c(!1), f == null || f();
79
- },
80
- onError: async (e) => {
81
- try {
82
- if (e.target instanceof HTMLVideoElement) {
83
- L(!0);
84
- const u = await (await fetch(e.target.src)).blob(), g = URL.createObjectURL(u);
85
- e.target.src = g;
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
- } catch (i) {
88
- console.error("video fallback fetch failed", i), o(!0), c(!0);
89
- } finally {
90
- L(!1);
91
- }
92
- },
93
- onPause: () => {
94
- l(), o(!1), m == null || m();
95
- },
96
- onEnded: () => {
97
- l(), o(!1), j();
98
- },
99
- style: { visibility: E ? "hidden" : "visible" },
100
- controls: !1,
101
- playsInline: !0
102
- }
103
- ),
104
- /* @__PURE__ */ a(D, { src: s, style: { visibility: E ? "visible" : "hidden" } }),
105
- !b && !h && /* @__PURE__ */ a(H, { children: d ? /* @__PURE__ */ a(T, { name: "icon-pause" }) : /* @__PURE__ */ a(T, { name: "icon-play" }) }),
106
- h && /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(A, {}) })
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
- R as VideoPlayer,
113
- Q as pauseAllVideos
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 e = /* @__PURE__ */ s("div")({
2
+ const I = /* @__PURE__ */ s("div")({
3
3
  name: "Container",
4
4
  class: "c1bgb86j",
5
5
  propsAsIs: !1
6
- }), a = /* @__PURE__ */ s("video")({
6
+ }), m = /* @__PURE__ */ s("video")({
7
7
  name: "Player",
8
8
  class: "p6703cq",
9
9
  propsAsIs: !1
10
- }), n = /* @__PURE__ */ s("img")({
10
+ }), b = /* @__PURE__ */ s("img")({
11
11
  name: "Poster",
12
12
  class: "p12ow7zo",
13
13
  propsAsIs: !1
14
- }), l = /* @__PURE__ */ s("div")({
14
+ }), A = /* @__PURE__ */ s("div")({
15
15
  name: "Control",
16
16
  class: "cdpal9o",
17
17
  propsAsIs: !1
18
- }), t = "t1xke4ml", r = "h1yzxv57";
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
- e as Container,
21
- l as Control,
22
- r as HideControls,
23
- a as Player,
24
- n as Poster,
25
- t as ToggleIconPause
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,6 @@
1
+ import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
+ import { DeveloperStorage } from '../../storage';
3
+ export declare const BypassLogin: React.FC<{
4
+ sdk: StreamLayerSDK;
5
+ storage: DeveloperStorage;
6
+ }>;
@@ -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,6 @@
1
+ import { DeveloperStorage } from '../../storage';
2
+ export declare const EnvToggle: React.FC<{
3
+ env: 'production' | 'development';
4
+ setEnv: any;
5
+ storage: DeveloperStorage;
6
+ }>;
@@ -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,6 @@
1
+ import { DeveloperStorage } from '../../storage';
2
+ export declare const SdkKey: React.FC<{
3
+ storage: DeveloperStorage;
4
+ sdkKey: string;
5
+ setSdkKey: (sdkKey: string) => void;
6
+ }>;
@@ -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 i } from "../../ui/theme/masters.js";
4
- import { BGContainer as m, AppContainer as c } from "./styles.js";
5
- const l = (r, t) => /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(r, {}) }), p = (r, t) => {
6
- const o = t.globals.theme || "light";
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(m, { children: /* @__PURE__ */ e(r, {}) }), u = (r) => /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(r, {}) }) }) });
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
+ import { StoryFn } from '@storybook/react';
2
+ export declare const useMastersFiles: (Story: StoryFn) => import("react/jsx-runtime").JSX.Element;
@@ -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,3 @@
1
+ export declare const requestLoginCode: (host: string, phone: string) => Promise<boolean>;
2
+ export declare const register: (host: string, phone: string) => Promise<boolean>;
3
+ export declare const login: (host: string, phone: string, code: string) => Promise<any>;
@@ -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
+ }