@streamlayer/react-ui 1.26.1 → 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
@@ -0,0 +1,14 @@
1
+ import { EventBusData } from '@streamlayer/sdk-web-interfaces';
2
+ type Arguments<T> = T extends (...args: infer U) => void ? U : never;
3
+ export declare const useAnalyticsHandle: (options: EventBusData) => (<T extends Function>(callback?: T) => (...args: Arguments<T>) => any)[];
4
+ export declare const newTabLinkListener: (event: Event) => void;
5
+ type AnalyticHookRef = React.MutableRefObject<HTMLElement | null>;
6
+ type AnalyticListener = (event: Event, ref: AnalyticHookRef) => void;
7
+ type AnalyticsHookOptions = {
8
+ enabled: boolean;
9
+ event: 'click' | 'scrollend' | 'tap';
10
+ useDomNode?: boolean;
11
+ listener: AnalyticListener;
12
+ };
13
+ export declare const useAnalyticsListener: (ref: AnalyticHookRef, options: AnalyticsHookOptions) => void;
14
+ export {};
@@ -0,0 +1,9 @@
1
+ export type AnimationOptions = {
2
+ delay: number;
3
+ };
4
+ export declare const useHideTransition: () => {
5
+ runAnimation: (options?: AnimationOptions) => void;
6
+ onAnimationEnd: () => void;
7
+ hiding: boolean;
8
+ finished: boolean;
9
+ };
@@ -0,0 +1,15 @@
1
+ import { DependencyList } from 'react';
2
+ interface KeyboardNavigationOptions {
3
+ containerSelector: string;
4
+ getElements?: (container: HTMLElement) => HTMLElement[];
5
+ onEscape: () => void;
6
+ onEnter?: (element: HTMLElement, index: number) => void;
7
+ initialFocusPriority?: 'close-btn' | 'first' | number;
8
+ enabled?: boolean;
9
+ dependencies?: DependencyList;
10
+ resetFocusOn?: unknown[];
11
+ }
12
+ export declare const useKeyboardNavigation: (options: KeyboardNavigationOptions) => {
13
+ focusedIndex: import('react').MutableRefObject<number>;
14
+ };
15
+ export {};
@@ -0,0 +1,74 @@
1
+ import { useRef as m, useEffect as D } from "react";
2
+ const R = (g) => {
3
+ const {
4
+ containerSelector: y,
5
+ getElements: A,
6
+ onEscape: v,
7
+ onEnter: a,
8
+ initialFocusPriority: l = "close-btn",
9
+ enabled: E = !0,
10
+ dependencies: h = [],
11
+ resetFocusOn: f = []
12
+ } = g, t = m(0), d = m(!1), k = m(f);
13
+ return f.some((o, p) => o !== k.current[p]) && (d.current = !1, k.current = f), D(() => {
14
+ if (!E) return;
15
+ const o = document.querySelector(y);
16
+ if (!o) return;
17
+ const b = A || ((e) => Array.from(e.querySelectorAll("button")).filter((r) => !r.disabled));
18
+ let n = b(o);
19
+ (() => {
20
+ var e, c, r;
21
+ if (n.length !== 0) {
22
+ if (d.current) {
23
+ const s = document.activeElement;
24
+ if (n.includes(s))
25
+ return;
26
+ }
27
+ if (l === "close-btn") {
28
+ const s = o.querySelector('[data-close-btn="true"]');
29
+ if (s) {
30
+ const i = n.indexOf(s);
31
+ t.current = i !== -1 ? i : 0, s.focus();
32
+ } else
33
+ t.current = 0, (e = n[t.current]) == null || e.focus();
34
+ } else l === "first" ? (t.current = 0, (c = n[t.current]) == null || c.focus()) : typeof l == "number" && (t.current = Math.min(l, n.length - 1), (r = n[t.current]) == null || r.focus());
35
+ d.current = !0;
36
+ }
37
+ })();
38
+ const w = (e) => {
39
+ var s, i;
40
+ if (!o) return;
41
+ n = b(o);
42
+ const c = n.length;
43
+ if (c === 0) return;
44
+ const r = e.keyCode;
45
+ if (["ArrowDown", "ArrowRight"].includes(e.key) || r === 40 || r === 39) {
46
+ t.current = (t.current + 1) % c, (s = n[t.current]) == null || s.focus(), e.preventDefault();
47
+ return;
48
+ }
49
+ if (["ArrowUp", "ArrowLeft"].includes(e.key) || r === 38 || r === 37) {
50
+ t.current = (t.current - 1 + c) % c, (i = n[t.current]) == null || i.focus(), e.preventDefault();
51
+ return;
52
+ }
53
+ if (e.key === "Enter" || r === 13 || e.key === " ") {
54
+ const u = n[t.current];
55
+ if (!u) return;
56
+ const F = document.activeElement;
57
+ if (!n.includes(F))
58
+ return;
59
+ a ? a(u, t.current) : (u.tagName === "BUTTON" || u.tagName, u.click()), e.preventDefault();
60
+ return;
61
+ }
62
+ if (e.key === "Escape" || e.key === "Backspace" || e.code === "Back" || r === 10009) {
63
+ v(), e.preventDefault();
64
+ return;
65
+ }
66
+ };
67
+ return window.addEventListener("keydown", w), () => {
68
+ window.removeEventListener("keydown", w);
69
+ };
70
+ }, [E, y, l, v, a, ...h, ...f]), { focusedIndex: t };
71
+ };
72
+ export {
73
+ R as useKeyboardNavigation
74
+ };
@@ -0,0 +1,17 @@
1
+ import { useCallback as r, useSyncExternalStore as y } from "react";
2
+ function f(e, t, u) {
3
+ let n = new Set(t).add(void 0);
4
+ return e.listen((i, s, l) => {
5
+ n.has(l) && u(i, s, l);
6
+ });
7
+ }
8
+ function S(e, t = {}) {
9
+ let u = r(
10
+ (i) => t.keys ? f(e, t.keys, i) : e.listen(i),
11
+ [t.keys, e]
12
+ ), n = e.get.bind(e);
13
+ return y(u, n, n);
14
+ }
15
+ export {
16
+ S as u
17
+ };
@@ -1,7 +1,10 @@
1
+ import { Advertisement } from '@streamlayer/feature-gamification';
1
2
  import { PromotionOptions } from '@streamlayer/sdk-web-types';
2
3
  export declare const Banner: React.FC<{
3
4
  promotion: PromotionOptions;
4
5
  promotionId: string;
5
6
  direction?: 'top' | 'bottom';
6
7
  hiding?: boolean;
8
+ isEventFired: Advertisement['isEventFired'];
9
+ fireEvent: Advertisement['fireEvent'];
7
10
  }>;
@@ -1,28 +1,40 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { SlideIn as o } from "../../slide-in/index.js";
3
- import { BannerContainer as m, BannerLink as s } from "./styles.js";
4
- const B = ({ promotion: n, promotionId: i, hiding: l, direction: d = "bottom" }) => {
5
- var e, t;
6
- if (!((e = n.additionalBanner) != null && e.imageUrl))
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useEffect as f } from "react";
3
+ import { eventBus as u } from "@streamlayer/sdk-web-interfaces";
4
+ import { AdUnit as h } from "@streamlayer/sdk-web-types";
5
+ import { SlideIn as p } from "../../slide-in/index.js";
6
+ import { BannerContainer as y, BannerLink as g } from "./styles.js";
7
+ const x = ({ promotion: t, promotionId: l, hiding: n, isEventFired: r, fireEvent: d, direction: c = "bottom" }) => {
8
+ const s = (t == null ? void 0 : t.adUnit) === h.STANDART, a = s ? t.banner : t.additionalBanner;
9
+ if (f(() => {
10
+ a != null && a.imageUrl && t.type && l && (r != null && r("banner-showed") || (u.emit("advertisement", {
11
+ action: "bannerShown",
12
+ payload: {
13
+ id: l,
14
+ type: t.type
15
+ }
16
+ }), d == null || d("banner-showed")));
17
+ }, [a == null ? void 0 : a.imageUrl, d, r, t.type, l]), !(a != null && a.imageUrl))
7
18
  return null;
8
- let a = (t = n.additionalBanner) == null ? void 0 : t.url;
9
- return a && a.indexOf("http") !== 0 && (a = `https://${a}`), /* @__PURE__ */ r(o, { direction: d, hiding: l, children: /* @__PURE__ */ r(m, { className: "BannerContainer", children: /* @__PURE__ */ r(
10
- s,
19
+ let e = a == null ? void 0 : a.url;
20
+ return e && e.indexOf("http") !== 0 && (e = `https://${e}`), /* @__PURE__ */ m(p, { direction: c, hiding: n, children: /* @__PURE__ */ m(y, { className: "BannerContainer", "data-is-ad": s, children: /* @__PURE__ */ m(
21
+ g,
11
22
  {
12
- as: a ? "a" : "span",
23
+ as: e ? "a" : "span",
13
24
  className: "BannerLink",
14
- href: a,
25
+ href: e,
15
26
  style: {
16
- backgroundImage: `url(${n.additionalBanner.imageUrl})`,
17
- cursor: a ? "pointer" : "default"
27
+ backgroundImage: `url(${a.imageUrl})`,
28
+ cursor: e ? "pointer" : "default"
18
29
  },
19
- "data-promo-id": i,
20
- "data-promo-type": n.type,
30
+ "data-promo-id": l,
31
+ "data-promo-type": t.type,
21
32
  "data-a": "banner",
22
- target: "_blank"
33
+ target: "_blank",
34
+ "data-is-ad": s
23
35
  }
24
36
  ) }) });
25
37
  };
26
38
  export {
27
- B as Banner
39
+ x as Banner
28
40
  };
@@ -1,2 +1,6 @@
1
1
  export declare const BannerContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
- export declare const BannerLink: any;
2
+ export declare const BannerLink: {
3
+ __wyw_meta: unknown;
4
+ } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLAnchorElement> & import('react').AnchorHTMLAttributes<HTMLAnchorElement> & Record<never, unknown> & {
5
+ as?: React.ElementType;
6
+ }>;
@@ -16,5 +16,8 @@ export declare const AdvertisementUI: React.FC<{
16
16
  externalAd?: Advertisement['externalAd'];
17
17
  controlVideo: ControlVideoCb;
18
18
  advertisementPaused: boolean;
19
- togglePause: (flag: boolean) => void;
19
+ muted?: boolean;
20
+ togglePause?: (flag: boolean) => void;
21
+ isEventFired: Advertisement['isEventFired'];
22
+ fireEvent: Advertisement['fireEvent'];
20
23
  }>;
@@ -1,69 +1,81 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as I } from "react/jsx-runtime";
2
2
  import { PromotionType as f } from "@streamlayer/sdk-web-types";
3
- import { Banner as G } from "./banner/index.js";
4
- import { Notification as S } from "./notification/index.js";
3
+ import { Banner as h } from "./banner/index.js";
4
+ import { Notification as n } from "./notification/index.js";
5
5
  import { Overlay as E } from "./overlay/index.js";
6
- import { Sidebar as q } from "./sidebar/index.js";
7
- import { OverlayContainer as O } from "./overlay/styles.js";
8
- const M = (i) => (i == null ? void 0 : i.type) === f.INGAME_IAB11_LBAR || (i == null ? void 0 : i.type) === f.INGAME_IAB21_LBAR, R = (i) => (i == null ? void 0 : i.type) === f.INGAME_IAB11_SIDEBAR || (i == null ? void 0 : i.type) === f.INGAME_IAB21_SIDEBAR, a = (i) => (i == null ? void 0 : i.type) === f.INGAME_IAB11 || (i == null ? void 0 : i.type) === f.INGAME_IAB21, P = ({
6
+ import { Sidebar as C } from "./sidebar/index.js";
7
+ import { OverlayContainer as L } from "./overlay/styles.js";
8
+ const O = (i) => (i == null ? void 0 : i.type) === f.INGAME_IAB11_LBAR || (i == null ? void 0 : i.type) === f.INGAME_IAB21_LBAR, a = (i) => (i == null ? void 0 : i.type) === f.INGAME_IAB11_SIDEBAR || (i == null ? void 0 : i.type) === f.INGAME_IAB21_SIDEBAR, t = (i) => (i == null ? void 0 : i.type) === f.INGAME_IAB11 || (i == null ? void 0 : i.type) === f.INGAME_IAB21, H = ({
9
9
  advertisement: i,
10
- close: l,
11
- skipTypeCheck: y,
12
- skipAutoClose: c,
13
- layoutMode: h = "side-by-side",
14
- sidebar: u,
15
- isNotification: o,
10
+ close: u,
11
+ skipTypeCheck: _,
12
+ skipAutoClose: N,
13
+ layoutMode: D = "side-by-side",
14
+ sidebar: y,
15
+ isNotification: R,
16
16
  banner: A,
17
- markAsViewed: B,
18
- open: I,
19
- externalAd: _,
20
- controlVideo: N,
21
- advertisementPaused: n,
22
- togglePause: t
23
- }) => i.promotion ? o && i.notification ? /* @__PURE__ */ r(
24
- S,
17
+ markAsViewed: M,
18
+ open: r,
19
+ externalAd: c,
20
+ controlVideo: G,
21
+ advertisementPaused: o,
22
+ togglePause: S,
23
+ isEventFired: l,
24
+ fireEvent: B,
25
+ muted: q
26
+ }) => i.promotion ? R && i.notification ? /* @__PURE__ */ I(
27
+ n,
25
28
  {
26
- open: () => I == null ? void 0 : I({ fromNotification: !0 }),
29
+ open: () => r == null ? void 0 : r({ fromNotification: !0 }),
27
30
  notification: i.notification,
28
- promotionId: i.question.id
31
+ promotionId: i.question.id,
32
+ close: u
29
33
  }
30
- ) : !u && !A && (y || a(i.promotion)) ? /* @__PURE__ */ r(O, { className: "PromoOverlayContainer", children: /* @__PURE__ */ r(
34
+ ) : !y && !A && (_ || t(i.promotion)) ? /* @__PURE__ */ I(L, { className: "PromoOverlayContainer", children: /* @__PURE__ */ I(
31
35
  E,
32
36
  {
33
- markAsViewed: B,
37
+ markAsViewed: M,
34
38
  promotionId: i.question.id,
35
39
  promotion: i.promotion,
36
- onClose: l,
37
- open: I,
38
- skipAutoClose: c,
39
- externalAd: _,
40
- controlVideo: N,
41
- advertisementPaused: n,
42
- togglePause: t
40
+ onClose: u,
41
+ open: r,
42
+ skipAutoClose: N,
43
+ externalAd: c,
44
+ controlVideo: G,
45
+ advertisementPaused: o,
46
+ togglePause: S,
47
+ isEventFired: l,
48
+ fireEvent: B,
49
+ muted: q
43
50
  }
44
- ) }) : u && (y || M(i.promotion) || R(i.promotion)) ? /* @__PURE__ */ r(q, { className: "PromoSidebarContainer", direction: u, hiding: !1, children: /* @__PURE__ */ r(
51
+ ) }) : y && (_ || O(i.promotion) || a(i.promotion) || c) ? /* @__PURE__ */ I(C, { className: "PromoSidebarContainer", direction: y, hiding: !1, children: /* @__PURE__ */ I(
45
52
  E,
46
53
  {
47
- markAsViewed: B,
54
+ markAsViewed: M,
48
55
  promotionId: i.question.id,
49
56
  promotion: i.promotion,
50
- externalAd: _,
51
- onClose: l,
52
- open: I,
53
- controlVideo: N,
54
- skipAutoClose: c,
55
- advertisementPaused: n,
56
- togglePause: t
57
+ externalAd: c,
58
+ onClose: u,
59
+ open: r,
60
+ controlVideo: G,
61
+ skipAutoClose: N,
62
+ advertisementPaused: o,
63
+ togglePause: S,
64
+ isEventFired: l,
65
+ fireEvent: B,
66
+ muted: q
57
67
  }
58
- ) }) : A && M(i.promotion) ? /* @__PURE__ */ r(
59
- G,
68
+ ) }) : A && O(i.promotion) ? /* @__PURE__ */ I(
69
+ h,
60
70
  {
61
71
  promotionId: i.question.id,
62
72
  hiding: !1,
63
73
  promotion: i.promotion,
64
- direction: A
74
+ direction: A,
75
+ isEventFired: l,
76
+ fireEvent: B
65
77
  }
66
78
  ) : null : null;
67
79
  export {
68
- P as AdvertisementUI
80
+ H as AdvertisementUI
69
81
  };
@@ -9,4 +9,6 @@ export declare const Notification: React.FC<{
9
9
  direction?: 'left' | 'right';
10
10
  hiding?: boolean;
11
11
  open?: () => void;
12
+ close?: () => void;
13
+ webos?: boolean;
12
14
  }>;
@@ -1,41 +1,57 @@
1
- import { jsx as i, jsxs as d } from "react/jsx-runtime";
2
- import { NotificationPromotionImagePosition as r, NotificationEnabled as T, NotificationPromotionMode as h, NotificationSponsorLogoMode as C, CtaIconMode as O } from "@streamlayer/sdk-web-types";
3
- import { SlideIn as f } from "../../slide-in/index.js";
4
- import { LowerThirdNotification as E } from "./lower-third/index.js";
5
- import { MediaImgFit as I, MediaImgCentered as L, MediaImgBottom as S, MediaImgSolid as _, MediaImgMiddle as R, NotificationContainer as P, Logo as b, NotificationContent as A, Body as D, Title as x, Text as y, Button as F, CtaIcon as j, StyledChevronRight as k } from "./styles.js";
6
- const v = {
7
- [r.UNSET]: I,
8
- [r.FIT]: I,
9
- [r.CENTERED]: L,
10
- [r.BOTTOM]: S,
11
- [r.SOLID]: _,
12
- [r.MIDDLE]: R
13
- }, w = ({ src: e, imagePosition: n }) => {
14
- const m = v[n];
15
- return /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i("img", { src: e, alt: "" }) });
16
- }, z = ({ notification: e, open: n, promotionId: m, hiding: N, direction: a = "left" }) => {
17
- if (!e || !e.promotion || e.enabled !== T.NOTIFICATION_ENABLED)
1
+ import { jsx as i, jsxs as m } from "react/jsx-runtime";
2
+ import { withFocusable as N } from "../../../app/webos/useTvButton.js";
3
+ import { NotificationPromotionImagePosition as n, NotificationEnabled as E, NotificationPromotionMode as L, NotificationSponsorLogoMode as S, CtaIconMode as _ } from "@streamlayer/sdk-web-types";
4
+ import { SlideIn as D } from "../../slide-in/index.js";
5
+ import { LowerThirdNotification as R } from "./lower-third/index.js";
6
+ import { MediaImgFit as I, MediaImgCentered as P, MediaImgBottom as b, MediaImgSolid as A, MediaImgMiddle as F, NotificationContainer as u, Logo as x, NotificationContent as k, Body as y, Title as W, Text as j, CtaIcon as v, StyledChevronRight as G, DismissButton as H, OpenButton as U } from "./styles.js";
7
+ const q = {
8
+ [n.UNSET]: I,
9
+ [n.FIT]: I,
10
+ [n.CENTERED]: P,
11
+ [n.BOTTOM]: b,
12
+ [n.SOLID]: A,
13
+ [n.MIDDLE]: F
14
+ }, z = ({ src: r, imagePosition: e }) => {
15
+ const c = q[e];
16
+ return /* @__PURE__ */ i(c, { children: /* @__PURE__ */ i("img", { src: r, alt: "" }) });
17
+ }, J = N(H), K = N(U), w = ({ notification: r, open: e, promotionId: c, hiding: p, direction: g = "left", close: d, webos: t }) => {
18
+ if (!r || !r.promotion || r.enabled !== E.NOTIFICATION_ENABLED)
18
19
  return null;
19
- if (e.promotion.mode === h.LOWER_THIRD)
20
- return /* @__PURE__ */ i(E, { notification: e, open: n });
21
- const { title: t, body: l, image: s, promotion: g } = e, { sponsorLogo: c, sponsorLogoMode: p, imagePosition: M, ctaButton: o } = g;
22
- return /* @__PURE__ */ i(f, { className: "SL_Rich_Notification", direction: a, hiding: N, children: /* @__PURE__ */ d(P, { onClick: n, children: [
23
- p !== C.NOTIFICATION_SPONSOR_LOGO_NONE && c && /* @__PURE__ */ i(b, { children: /* @__PURE__ */ i("img", { src: c, alt: t }) }),
24
- /* @__PURE__ */ d(A, { children: [
25
- /* @__PURE__ */ i(w, { src: s, imagePosition: M }),
26
- /* @__PURE__ */ d(D, { children: [
27
- t && /* @__PURE__ */ i(x, { children: t }),
28
- l && /* @__PURE__ */ i(y, { children: l })
20
+ if (r.promotion.mode === L.LOWER_THIRD)
21
+ return /* @__PURE__ */ i(R, { notification: r, open: e, close: d, webos: t });
22
+ const { title: l, body: s, image: h, promotion: C } = r, { sponsorLogo: a, sponsorLogoMode: O, imagePosition: M, ctaButton: o } = C, T = (f) => {
23
+ f.stopPropagation(), d == null || d();
24
+ };
25
+ return /* @__PURE__ */ i(D, { className: "SL_Rich_Notification", direction: g, hiding: p, children: /* @__PURE__ */ m(u, { onClick: t ? () => {
26
+ } : e, children: [
27
+ O !== S.NOTIFICATION_SPONSOR_LOGO_NONE && a && /* @__PURE__ */ i(x, { children: /* @__PURE__ */ i("img", { src: a, alt: l }) }),
28
+ /* @__PURE__ */ m(k, { children: [
29
+ /* @__PURE__ */ i(z, { src: h, imagePosition: M }),
30
+ /* @__PURE__ */ m(y, { children: [
31
+ l && /* @__PURE__ */ i(W, { children: l }),
32
+ s && /* @__PURE__ */ i(j, { children: s })
29
33
  ] }),
30
- /* @__PURE__ */ d(F, { name: "promo-button", style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color }, children: [
31
- (o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === O.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(j, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
32
- (o == null ? void 0 : o.label) || "Open"
33
- ] }),
34
- /* @__PURE__ */ i(k, { name: "chevronRight" })
34
+ t && /* @__PURE__ */ i(J, { webos: !0, onClick: T, children: "Dismiss" }),
35
+ /* @__PURE__ */ m(
36
+ K,
37
+ {
38
+ webos: t,
39
+ autoFocus: !0,
40
+ onClick: t ? e : () => {
41
+ },
42
+ name: "promo-button",
43
+ style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color },
44
+ children: [
45
+ (o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === _.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(v, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
46
+ (o == null ? void 0 : o.label) || "Open"
47
+ ]
48
+ }
49
+ ),
50
+ /* @__PURE__ */ i(G, { name: "chevronRight" })
35
51
  ] })
36
52
  ] }) });
37
53
  };
38
54
  export {
39
- z as Notification,
40
- w as NotificationMedia
55
+ w as Notification,
56
+ z as NotificationMedia
41
57
  };
@@ -6,4 +6,6 @@ export declare const NotificationMedia: React.FC<{
6
6
  export declare const LowerThirdNotification: React.FC<{
7
7
  notification?: QuestionNotification;
8
8
  open?: () => void;
9
+ close?: () => void;
10
+ webos?: boolean;
9
11
  }>;
@@ -1,37 +1,53 @@
1
- import { jsx as i, jsxs as r, Fragment as g } from "react/jsx-runtime";
2
- import { NotificationPromotionImagePosition as d, NotificationEnabled as O, NotificationSponsorLogoMode as T, CtaIconMode as h } from "@streamlayer/sdk-web-types";
3
- import { MediaImgBottom as t, MediaImgMiddle as p, NotificationContainer as C, NotificationContent as M, Body as L, Title as f, Text as _, Footer as b, Logo as A, Vector as E, Button as P, CtaIcon as x } from "./styles.js";
4
- const S = {
5
- [d.BOTTOM]: t,
6
- [d.MIDDLE]: p
7
- }, F = ({ src: e, imagePosition: c }) => {
8
- const n = S[c] || t;
9
- return /* @__PURE__ */ i(n, { children: /* @__PURE__ */ i("img", { src: e, alt: "" }) });
10
- }, j = ({ notification: e, open: c }) => {
11
- if (!e || !e.promotion || e.enabled !== O.NOTIFICATION_ENABLED)
1
+ import { jsx as i, jsxs as e, Fragment as m } from "react/jsx-runtime";
2
+ import { withFocusable as C } from "../../../../app/webos/useTvButton.js";
3
+ import { NotificationPromotionImagePosition as N, NotificationEnabled as t, NotificationSponsorLogoMode as _, CtaIconMode as I } from "@streamlayer/sdk-web-types";
4
+ import { MediaImgBottom as a, MediaImgMiddle as f, NotificationContainer as L, NotificationContent as A, Body as S, Title as E, Text as P, Footer as x, Logo as D, Vector as F, CtaIcon as O, OpenButton as h, DismissButton as k } from "./styles.js";
5
+ const R = {
6
+ [N.BOTTOM]: a,
7
+ [N.MIDDLE]: f
8
+ }, w = ({ src: r, imagePosition: n }) => {
9
+ const l = R[n] || a;
10
+ return /* @__PURE__ */ i(l, { children: /* @__PURE__ */ i("img", { src: r, alt: "" }) });
11
+ }, y = C(k), j = C(h), q = ({ notification: r, open: n, close: l, webos: c }) => {
12
+ if (!r || !r.promotion || r.enabled !== t.NOTIFICATION_ENABLED)
12
13
  return null;
13
- const { title: n, body: l, image: s, promotion: m } = e, { sponsorLogo: a, sponsorLogoMode: N, imagePosition: I, ctaButton: o } = m;
14
- return /* @__PURE__ */ r(C, { className: "SL_Lower_Third_Notification", onClick: c, children: [
15
- /* @__PURE__ */ r(M, { children: [
16
- /* @__PURE__ */ i(F, { src: s, imagePosition: I }),
17
- /* @__PURE__ */ r(L, { children: [
18
- n && /* @__PURE__ */ i(f, { children: n }),
19
- l && /* @__PURE__ */ i(_, { children: l })
14
+ const { title: s, body: d, image: T, promotion: p } = r, { sponsorLogo: g, sponsorLogoMode: M, imagePosition: b, ctaButton: o } = p;
15
+ return /* @__PURE__ */ e(L, { className: "SL_Lower_Third_Notification", onClick: c ? void 0 : n, children: [
16
+ /* @__PURE__ */ e(A, { children: [
17
+ /* @__PURE__ */ i(w, { src: T, imagePosition: b }),
18
+ /* @__PURE__ */ e(S, { children: [
19
+ s && /* @__PURE__ */ i(E, { children: s }),
20
+ d && /* @__PURE__ */ i(P, { children: d })
20
21
  ] })
21
22
  ] }),
22
- /* @__PURE__ */ r(b, { children: [
23
- N !== T.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ r(g, { children: [
24
- /* @__PURE__ */ i(A, { children: /* @__PURE__ */ i("img", { src: a, alt: n }) }),
25
- /* @__PURE__ */ i(E, {})
23
+ /* @__PURE__ */ e(x, { children: [
24
+ M !== _.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ e(m, { children: [
25
+ /* @__PURE__ */ i(D, { children: /* @__PURE__ */ i("img", { src: g, alt: s }) }),
26
+ /* @__PURE__ */ i(F, {})
26
27
  ] }),
27
- /* @__PURE__ */ r(P, { name: "promo-button", style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color }, children: [
28
- (o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === h.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(x, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
28
+ c ? /* @__PURE__ */ e(m, { children: [
29
+ /* @__PURE__ */ i(y, { webos: !0, onClick: l, children: "Dismiss" }),
30
+ /* @__PURE__ */ e(
31
+ j,
32
+ {
33
+ webos: !0,
34
+ autoFocus: !0,
35
+ style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color },
36
+ onClick: n,
37
+ children: [
38
+ (o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === I.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(O, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
39
+ (o == null ? void 0 : o.label) || "Open"
40
+ ]
41
+ }
42
+ )
43
+ ] }) : /* @__PURE__ */ e(h, { name: "promo-button", style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color }, children: [
44
+ (o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === I.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(O, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
29
45
  (o == null ? void 0 : o.label) || "Open"
30
46
  ] })
31
47
  ] })
32
48
  ] });
33
49
  };
34
50
  export {
35
- j as LowerThirdNotification,
36
- F as NotificationMedia
51
+ q as LowerThirdNotification,
52
+ w as NotificationMedia
37
53
  };
@@ -14,3 +14,14 @@ export declare const Logo: import('@linaria/react').StyledComponent<import('reac
14
14
  export declare const Footer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
15
15
  export declare const Vector: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
16
16
  export declare const NotificationContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
17
+ export declare const TVButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
18
+ export declare const DismissButton: {
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 OpenButton: {
24
+ __wyw_meta: unknown;
25
+ } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
26
+ as?: React.ElementType;
27
+ }>;