@streamlayer/react-ui 1.26.1 → 1.27.1

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
@@ -10,6 +10,7 @@ export type StreamLayerSDKAdvertisementProps = {
10
10
  layoutMode?: 'cover' | 'side-by-side';
11
11
  skipAutoClose?: boolean;
12
12
  externalAd?: boolean;
13
+ muted?: boolean;
13
14
  };
14
15
  export declare const StreamLayerSDKAdvertisement: React.FC<StreamLayerSDKAdvertisementProps & {
15
16
  sdk: StreamLayerSDK;
@@ -1,133 +1,166 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { cx as b } from "@linaria/core";
3
- import { styled as L } from "@linaria/react";
4
- import { useAnalyticsListener as P } from "../../../hooks/analytics.js";
5
- import { useState as w, useEffect as E, useRef as I } from "react";
6
- import { useStore as S } from "@streamlayer/react-polyfills";
7
- import { eventBus as h } from "@streamlayer/sdk-web-interfaces";
8
- import { FeatureType as T, NotificationPromotionMode as U, PromotionType as N } from "@streamlayer/sdk-web-types";
9
- import { AdvertisementUI as V } from "../../../ui/advertisement/index.js";
10
- const W = /* @__PURE__ */ L("div")({
1
+ import { jsx as n, jsxs as z } from "react/jsx-runtime";
2
+ import { cx as K } from "@linaria/core";
3
+ import { styled as J } from "@linaria/react";
4
+ import { useAnalyticsListener as X } from "../../../hooks/analytics.js";
5
+ import { useState as Y, useEffect as Z, useRef as Q } from "react";
6
+ import { useStore as u } from "@streamlayer/react-polyfills";
7
+ import { eventBus as q } from "@streamlayer/sdk-web-interfaces";
8
+ import { FeatureType as tt, AdUnit as et, NotificationPromotionMode as rt, PromotionType as ot } from "@streamlayer/sdk-web-types";
9
+ import { StreamLayerSDKBannerProvider as at } from "../Banner/index.js";
10
+ import { AdvertisementUI as it } from "../../../ui/advertisement/index.js";
11
+ import { useAdvertisementBackground as nt } from "../../../ui/theme/utils.js";
12
+ const H = /* @__PURE__ */ J("div")({
11
13
  name: "AdvertisementUIWrap",
12
14
  class: "aa6pjif",
13
15
  propsAsIs: !1
14
- }), k = (o) => {
15
- const t = o.target;
16
- if (t instanceof HTMLAnchorElement && t.target === "_blank") {
17
- const r = t.getAttribute("data-promo-id") || "", i = t.getAttribute("data-promo-type") || N.UNSET;
18
- t.getAttribute("data-a") === "button" && h.emit("advertisement", {
16
+ }), st = (a) => {
17
+ const r = a.target;
18
+ if (r instanceof HTMLAnchorElement && r.target === "_blank") {
19
+ const o = r.getAttribute("data-promo-id") || "", i = r.getAttribute("data-promo-type") || ot.UNSET;
20
+ r.getAttribute("data-a") === "button" && q.emit("advertisement", {
19
21
  action: "buttonSelect",
20
22
  payload: {
21
- id: r,
23
+ id: o,
22
24
  type: i
23
25
  }
24
- }), t.getAttribute("data-a") === "banner" && h.emit("advertisement", {
26
+ }), r.getAttribute("data-a") === "banner" && q.emit("advertisement", {
25
27
  action: "bannerSelect",
26
28
  payload: {
27
- id: r,
29
+ id: o,
28
30
  type: i
29
31
  }
30
32
  });
31
33
  }
32
- }, j = ({
33
- gamification: o,
34
- layoutMode: t,
35
- skipAutoClose: r,
36
- skipTypeCheck: i,
37
- sidebar: s,
38
- banner: d,
39
- notification: c,
40
- isMobileScreen: u,
41
- persistent: p,
42
- externalAd: f,
43
- controlVideo: v
34
+ }, dt = ({
35
+ gamification: a,
36
+ advertisement: r,
37
+ layoutMode: o,
38
+ skipAutoClose: i,
39
+ skipTypeCheck: p,
40
+ sidebar: m,
41
+ banner: s,
42
+ notification: l,
43
+ isMobileScreen: c,
44
+ persistent: f,
45
+ containerId: v,
46
+ externalAd: g,
47
+ controlVideo: y,
48
+ muted: b
44
49
  }) => {
45
- var y, g, A;
46
- const m = I(null), e = S(o.advertisement.$store);
47
- P(m, {
48
- enabled: !!e.data,
50
+ var A, U, S, h, I, L, P, E, k, w, T, N, W, D, V, j, x, B, F, M, R;
51
+ const d = Q(null), t = u(r.$store), e = u(a.openedQuestion.$store);
52
+ X(d, {
53
+ enabled: !!t.data,
49
54
  event: "click",
50
- listener: k
55
+ listener: st
51
56
  });
52
- const l = !d && !s;
53
- if (e.data === void 0 || !p && e.isViewed)
57
+ const O = ((S = (U = (A = t.data) == null ? void 0 : A.question) == null ? void 0 : U.backgroundImage) == null ? void 0 : S.landscapeUrl) || ((I = (h = t.data) == null ? void 0 : h.promotion) == null ? void 0 : I.backgroundImageLandscapeUrl), _ = ((E = (P = (L = t.data) == null ? void 0 : L.question) == null ? void 0 : P.backgroundImage) == null ? void 0 : E.portraitUrl) || ((w = (k = t.data) == null ? void 0 : k.promotion) == null ? void 0 : w.backgroundImagePortraitUrl), $ = nt({
58
+ containerId: v,
59
+ landscapeUrl: O,
60
+ portraitUrl: _
61
+ });
62
+ if (((T = e == null ? void 0 : e.attributes) == null ? void 0 : T.adUnit) === et.STANDART && ((D = (W = (N = e == null ? void 0 : e.attributes) == null ? void 0 : N.adPromotion) == null ? void 0 : W.banner) != null && D.imageUrl))
63
+ return s ? /* @__PURE__ */ n(H, {
64
+ ref: d,
65
+ style: {
66
+ height: "100%"
67
+ },
68
+ className: K("SL-AdvertisementUIWrap", c && "mobile-view"),
69
+ children: /* @__PURE__ */ n(at, {
70
+ cardId: e.id,
71
+ promotion: {
72
+ ...(V = e == null ? void 0 : e.attributes) == null ? void 0 : V.adPromotion,
73
+ adUnit: (j = e == null ? void 0 : e.attributes) == null ? void 0 : j.adUnit
74
+ }
75
+ })
76
+ }) : null;
77
+ const C = !s && !m;
78
+ if (t.data === void 0 || !f && t.isViewed)
54
79
  return null;
55
- const n = ((A = (g = (y = e == null ? void 0 : e.data) == null ? void 0 : y.notification) == null ? void 0 : g.promotion) == null ? void 0 : A.mode) === U.LOWER_THIRD;
56
- return /* @__PURE__ */ a(W, {
57
- ref: m,
80
+ const G = ((F = (B = (x = t == null ? void 0 : t.data) == null ? void 0 : x.notification) == null ? void 0 : B.promotion) == null ? void 0 : F.mode) === rt.LOWER_THIRD;
81
+ return /* @__PURE__ */ z(H, {
82
+ ref: d,
58
83
  style: {
59
- height: l ? "auto" : "100%"
84
+ height: C ? "auto" : "100%"
60
85
  },
61
- className: b("SL-AdvertisementUIWrap", u && "mobile-view", n && "SL-AdvertisementUIWrap--lower-third"),
62
- children: /* @__PURE__ */ a(V, {
63
- skipTypeCheck: i,
64
- sidebar: s,
65
- banner: d,
66
- advertisement: e.data,
67
- advertisementPaused: e.isPaused,
68
- togglePause: e.togglePause,
69
- close: e.close,
70
- externalAd: f ? e.externalAd : void 0,
71
- markAsViewed: o.advertisement.markAsViewed,
72
- open: o.advertisement.open,
73
- layoutMode: t,
74
- isNotification: c,
75
- skipAutoClose: r,
76
- controlVideo: v
77
- })
86
+ className: K("SL-AdvertisementUIWrap", c && "mobile-view", G && "SL-AdvertisementUIWrap--lower-third"),
87
+ children: [!l && $, /* @__PURE__ */ n(it, {
88
+ skipTypeCheck: p,
89
+ sidebar: m,
90
+ banner: s,
91
+ advertisement: t.data,
92
+ advertisementPaused: !!t.isPaused,
93
+ togglePause: t.togglePause,
94
+ isEventFired: t.isEventFired,
95
+ toggleMute: t.toggleMute,
96
+ fireEvent: t.fireEvent,
97
+ close: t.close,
98
+ externalAd: g ? t.externalAd : void 0,
99
+ markAsViewed: (M = a.advertisement) == null ? void 0 : M.markAsViewed,
100
+ open: (R = a.advertisement) == null ? void 0 : R.open,
101
+ layoutMode: o,
102
+ isNotification: l,
103
+ skipAutoClose: i,
104
+ controlVideo: y,
105
+ muted: b
106
+ })]
78
107
  });
79
- }, B = ({
80
- sdk: o,
81
- sidebar: t,
82
- externalAd: r,
108
+ }, Ut = ({
109
+ sdk: a,
110
+ sidebar: r,
111
+ externalAd: o,
83
112
  banner: i,
84
- skipAutoClose: s,
85
- skipTypeCheck: d,
86
- layoutMode: c,
87
- isMobileScreen: u,
88
- persistent: p,
89
- notification: f
113
+ skipAutoClose: p,
114
+ skipTypeCheck: m,
115
+ layoutMode: s,
116
+ isMobileScreen: l,
117
+ persistent: c,
118
+ notification: f,
119
+ muted: v
90
120
  }) => {
91
- const v = S(o.featuresList.getStore()), [m, e] = w(!r);
92
- if (E(() => {
93
- if (r) {
94
- const n = document.createElement("script");
95
- n.async = !0, n.src = "https://imasdk.googleapis.com/pal/sdkloader/pal.js", document.body.appendChild(n), n.onload = () => {
96
- e(!0);
121
+ const g = u(a.featuresList.getStore()), [y, b] = Y(!o), d = u(a.options);
122
+ if (Z(() => {
123
+ if (o) {
124
+ const e = document.createElement("script");
125
+ e.async = !0, e.src = "https://imasdk.googleapis.com/pal/sdkloader/pal.js", document.body.appendChild(e), e.onload = () => {
126
+ b(!0);
97
127
  };
98
128
  }
99
- }, [r]), t && i)
100
- return /* @__PURE__ */ a("div", {
129
+ }, [o]), r && i)
130
+ return /* @__PURE__ */ n("div", {
101
131
  style: {
102
132
  color: "red"
103
133
  },
104
134
  children: "define either sidebar or banner, not both."
105
135
  });
106
- if (i && r)
107
- return /* @__PURE__ */ a("div", {
136
+ if (i && o)
137
+ return /* @__PURE__ */ n("div", {
108
138
  style: {
109
139
  color: "red"
110
140
  },
111
141
  children: "externalAd is not supported with banner"
112
142
  });
113
- if (!v)
143
+ if (!g)
114
144
  return null;
115
- const l = o.getFeature(T.GAMES);
116
- return !l || r && !m ? null : /* @__PURE__ */ a(j, {
117
- gamification: l,
118
- sidebar: t,
145
+ const t = a.getFeature(tt.GAMES);
146
+ return !t || o && !y ? null : /* @__PURE__ */ n(dt, {
147
+ gamification: t,
148
+ advertisement: t.advertisement,
149
+ sidebar: r,
119
150
  banner: i,
120
- layoutMode: c,
121
- isMobileScreen: u,
122
- persistent: p,
151
+ layoutMode: s,
152
+ isMobileScreen: l,
153
+ persistent: c,
123
154
  notification: f,
124
- skipTypeCheck: d,
125
- skipAutoClose: s,
126
- externalAd: r,
127
- controlVideo: o.controlVideoPlayer
155
+ skipTypeCheck: m,
156
+ skipAutoClose: p,
157
+ externalAd: o,
158
+ controlVideo: a.controlVideoPlayer,
159
+ containerId: d.containerId,
160
+ muted: v
128
161
  });
129
162
  };
130
163
  export {
131
- W as AdvertisementUIWrap,
132
- B as StreamLayerSDKAdvertisement
164
+ H as AdvertisementUIWrap,
165
+ Ut as StreamLayerSDKAdvertisement
133
166
  };
@@ -0,0 +1,6 @@
1
+ import { Promotion } from '@streamlayer/sdk-web-types';
2
+ export declare const StreamLayerSDKBannerProvider: React.FC<{
3
+ promotion: Promotion;
4
+ cardId: string;
5
+ direction?: 'top' | 'bottom';
6
+ }>;
@@ -0,0 +1,6 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Banner as n } from "../../../ui/advertisement/banner/index.js";
3
+ const a = ({ cardId: r, promotion: o, direction: t = "bottom" }) => /* @__PURE__ */ e(n, { promotion: o, promotionId: r, direction: t, hiding: !1 });
4
+ export {
5
+ a as StreamLayerSDKBannerProvider
6
+ };
@@ -1,8 +1,12 @@
1
1
  import { Gamification } from '@streamlayer/feature-gamification';
2
+ import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
2
3
  export declare const Question: React.FC<{
3
4
  gamification: Gamification;
5
+ sdk: StreamLayerSDK;
4
6
  hideSponsor?: boolean;
5
7
  className?: string;
6
8
  skipAutoClose?: boolean;
7
9
  hideHeader?: boolean;
10
+ muted?: boolean;
11
+ webos?: boolean;
8
12
  }>;
@@ -1,75 +1,104 @@
1
- import { jsxs as y, jsx as e } from "react/jsx-runtime";
2
- import { styled as v } from "@linaria/react";
3
- import { useAppContext as T } from "../../useAppContext.js";
4
- import { useStore as d } from "@streamlayer/react-polyfills";
5
- import { QuestionType as V } from "@streamlayer/sdk-web-types";
6
- import { VoteHeader as h } from "../../../../ui/gamification/detail/header/index.js";
7
- import { Sponsor as x } from "../../../../ui/gamification/detail/sponsor/index.js";
8
- import { Vote as S, VoteSkeleton as g } from "../../../../ui/gamification/vote/index.js";
9
- import { InsightDetails as q } from "../../../../ui/gamification/vote/insight-details/index.js";
10
- import { TwitterDetails as D } from "../../../../ui/gamification/vote/twitter-details/index.js";
11
- const w = /* @__PURE__ */ v("div")({
1
+ import { jsxs as E, jsx as e } from "react/jsx-runtime";
2
+ import { styled as M } from "@linaria/react";
3
+ import { useAppContext as W } from "../../useAppContext.js";
4
+ import { useState as X } from "react";
5
+ import { useStore as u } from "@streamlayer/react-polyfills";
6
+ import { QuestionType as L, AdUnit as Y } from "@streamlayer/sdk-web-types";
7
+ import { VoteHeader as Z } from "../../../../ui/gamification/detail/header/index.js";
8
+ import { Sponsor as _ } from "../../../../ui/gamification/detail/sponsor/index.js";
9
+ import { Vote as k, VoteSkeleton as F } from "../../../../ui/gamification/vote/index.js";
10
+ import { InsightDetails as Q } from "../../../../ui/gamification/vote/insight-details/index.js";
11
+ import { TwitterDetails as tt } from "../../../../ui/gamification/vote/twitter-details/index.js";
12
+ import { useAdvertisementBackground as ot } from "../../../../ui/theme/utils.js";
13
+ import { QuestionAdvertisement as rt } from "./QuestionAdvertisement.js";
14
+ const N = /* @__PURE__ */ M("div")({
12
15
  name: "QuestionContainer",
13
16
  class: "q14ckf9e",
14
17
  propsAsIs: !1
15
- }), A = ({
16
- openedQuestion: t
18
+ }), st = ({
19
+ openedQuestion: t,
20
+ muted: n,
21
+ webos: c
17
22
  }) => {
18
- var r, s;
23
+ var a, i;
19
24
  const {
20
- sdk: o
21
- } = T();
22
- return ((r = t == null ? void 0 : t.attributes) == null ? void 0 : r.attributes.case) === "insight" ? /* @__PURE__ */ e(q, {
25
+ sdk: r
26
+ } = W();
27
+ return ((a = t == null ? void 0 : t.attributes) == null ? void 0 : a.attributes.case) === "insight" ? /* @__PURE__ */ e(Q, {
23
28
  ...t.attributes.attributes.value,
24
- controlVideo: o == null ? void 0 : o.controlVideoPlayer
25
- }) : ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "tweet" ? /* @__PURE__ */ e(D, {
29
+ muted: n,
30
+ controlVideo: r == null ? void 0 : r.controlVideoPlayer,
31
+ webos: c
32
+ }) : ((i = t == null ? void 0 : t.attributes) == null ? void 0 : i.attributes.case) === "tweet" ? /* @__PURE__ */ e(tt, {
26
33
  ...t.attributes.attributes.value,
27
- controlVideo: o == null ? void 0 : o.controlVideoPlayer
34
+ muted: n,
35
+ controlVideo: r == null ? void 0 : r.controlVideoPlayer
28
36
  }) : null;
29
- }, C = ({
37
+ }, et = ({
30
38
  extendedQuestion: t,
31
- vote: o,
32
- close: r
39
+ vote: n,
40
+ close: c,
41
+ webos: r
33
42
  }) => {
34
43
  const {
35
- loading: s,
44
+ loading: a,
36
45
  data: i
37
46
  } = t;
38
- return i ? /* @__PURE__ */ e(S, {
39
- vote: o,
40
- close: r,
47
+ return i ? /* @__PURE__ */ e(k, {
48
+ webos: r,
49
+ vote: n,
50
+ close: c,
41
51
  openedQuestion: i,
42
- isLoading: !!s
43
- }) : /* @__PURE__ */ e(g, {});
44
- }, z = ({
52
+ isLoading: !!a
53
+ }) : /* @__PURE__ */ e(F, {});
54
+ }, Tt = ({
45
55
  gamification: t,
46
- skipAutoClose: o,
47
- hideSponsor: r,
48
- className: s,
49
- hideHeader: i
56
+ sdk: n,
57
+ muted: c,
58
+ skipAutoClose: r,
59
+ hideSponsor: a,
60
+ className: i,
61
+ hideHeader: O,
62
+ webos: d
50
63
  }) => {
51
- var u, c, m, p, f;
52
- const n = d(t.openedQuestion.$store), l = d(t.openedQuestion.$extendedStore);
53
- if (!n)
64
+ var A, S, T, v, b, y, U, V, x, D, g, q, C, w, j, H, I, P, $;
65
+ const s = u(t.openedQuestion.$store), o = u(t.openedQuestion.$extendedStore), [R, z] = X(!1), B = u(n.options), m = ((A = s == null ? void 0 : s.attributes) == null ? void 0 : A.type) === L.FACTOID, l = (S = s == null ? void 0 : s.attributes) == null ? void 0 : S.backgroundImage, p = (T = o.data) == null ? void 0 : T.backgroundImage, G = m ? l == null ? void 0 : l.landscapeUrl : p == null ? void 0 : p.landscapeUrl, J = m ? l == null ? void 0 : l.portraitUrl : p == null ? void 0 : p.portraitUrl, f = ot({
66
+ containerId: B.containerId,
67
+ landscapeUrl: G,
68
+ portraitUrl: J
69
+ });
70
+ if (!s)
54
71
  return null;
55
- const a = n.type, b = ((c = (u = l.data) == null ? void 0 : u.options) == null ? void 0 : c.options.case) === "factoid" ? l.data.options.options.value.closeTimer : void 0;
56
- return /* @__PURE__ */ y(w, {
57
- className: s,
58
- children: [!i && /* @__PURE__ */ e(h, {
59
- closeTimer: o ? void 0 : b,
72
+ const h = s.type, K = ((b = (v = o.data) == null ? void 0 : v.options) == null ? void 0 : b.options.case) === "factoid" ? o.data.options.options.value.closeTimer : void 0;
73
+ return ((y = o.data) == null ? void 0 : y.adUnit) === Y.STANDART && !R ? /* @__PURE__ */ E(N, {
74
+ className: i,
75
+ children: [f, /* @__PURE__ */ e(rt, {
76
+ id: o.data.id,
77
+ hasBanner: !!((V = (U = o.data.promotion) == null ? void 0 : U.banner) != null && V.imageUrl),
78
+ setAdShowed: z,
79
+ sponsorLogo: ((g = (D = (x = o.data) == null ? void 0 : x.promotion) == null ? void 0 : D.sponsor) == null ? void 0 : g.logo) || ((C = (q = o.data) == null ? void 0 : q.sponsorship) == null ? void 0 : C.logo) || ""
80
+ })]
81
+ }) : /* @__PURE__ */ E(N, {
82
+ className: i,
83
+ children: [f, !O && /* @__PURE__ */ e(Z, {
84
+ closeTimer: r ? void 0 : K,
60
85
  close: t.closeQuestion,
61
- type: ((m = n.attributes) == null ? void 0 : m.type) || V.UNSET
62
- }), a === "question" && /* @__PURE__ */ e(C, {
86
+ type: ((w = s.attributes) == null ? void 0 : w.type) || L.UNSET,
87
+ webos: d
88
+ }), h === "question" && /* @__PURE__ */ e(et, {
89
+ webos: d,
63
90
  vote: t.submitAnswer,
64
91
  close: t.closeQuestion,
65
- extendedQuestion: l
66
- }), a !== "question" && /* @__PURE__ */ e(A, {
67
- openedQuestion: n
68
- }), !r && /* @__PURE__ */ e(x, {
69
- sponsorLogo: (f = (p = l.data) == null ? void 0 : p.sponsorship) == null ? void 0 : f.logo
92
+ extendedQuestion: o
93
+ }), h !== "question" && /* @__PURE__ */ e(st, {
94
+ muted: c,
95
+ openedQuestion: s,
96
+ webos: d
97
+ }), !a && /* @__PURE__ */ e(_, {
98
+ sponsorLogo: ((I = (H = (j = o.data) == null ? void 0 : j.promotion) == null ? void 0 : H.sponsor) == null ? void 0 : I.logo) || (($ = (P = o.data) == null ? void 0 : P.sponsorship) == null ? void 0 : $.logo)
70
99
  })]
71
100
  });
72
101
  };
73
102
  export {
74
- z as Question
103
+ Tt as Question
75
104
  };
@@ -0,0 +1,6 @@
1
+ export declare const QuestionAdvertisement: React.FC<{
2
+ id: string;
3
+ hasBanner: boolean;
4
+ sponsorLogo: string;
5
+ setAdShowed: (flag: boolean) => void;
6
+ }>;
@@ -0,0 +1,46 @@
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { styled as t } from "@linaria/react";
3
+ import { useRef as u, useEffect as a } from "react";
4
+ import { eventBus as c } from "@streamlayer/sdk-web-interfaces";
5
+ const d = /* @__PURE__ */ t("div")({
6
+ name: "QuestionAdvertisementContainer",
7
+ class: "qwludgs",
8
+ propsAsIs: !1
9
+ }), l = /* @__PURE__ */ t("div")({
10
+ name: "QuestionAdvertisementText",
11
+ class: "qvce6pv",
12
+ propsAsIs: !1
13
+ }), p = /* @__PURE__ */ t("div")({
14
+ name: "QuestionAdvertisementImage",
15
+ class: "qsid7hx",
16
+ propsAsIs: !1
17
+ }), x = ({
18
+ sponsorLogo: i,
19
+ id: s,
20
+ hasBanner: n,
21
+ setAdShowed: o
22
+ }) => {
23
+ const r = u();
24
+ return a(() => (r.current = setTimeout(() => {
25
+ o(!0), n && c.emit("poll", {
26
+ action: "bannerOpened",
27
+ payload: {
28
+ questionId: s
29
+ }
30
+ });
31
+ }, 5e3), () => {
32
+ clearTimeout(r.current);
33
+ }), [o, s, n]), /* @__PURE__ */ m(d, {
34
+ children: [/* @__PURE__ */ e(l, {
35
+ children: "PRESENTED BY"
36
+ }), /* @__PURE__ */ e(p, {
37
+ children: /* @__PURE__ */ e("img", {
38
+ src: i,
39
+ alt: "ad-sponsor-logo"
40
+ })
41
+ })]
42
+ });
43
+ };
44
+ export {
45
+ x as QuestionAdvertisement
46
+ };
@@ -1,31 +1,31 @@
1
- import { jsxs as f, jsx as e, Fragment as D } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as e, Fragment as D } from "react/jsx-runtime";
2
2
  import { cx as C } from "@linaria/core";
3
3
  import { TabsContainer as S, TabsNavContainer as E, SDKSummaryContainer as v, UserSummaryContainer as A, SDKContentContainer as I, LeaderboardContainer as L } from "../../styles.js";
4
4
  import { scrollIntoAppView as P } from "../../../useSdkScroll.js";
5
- import { useState as V, useEffect as l } from "react";
6
- import { useStore as c, useTransition as K } from "@streamlayer/react-polyfills";
5
+ import { useState as V, useEffect as f } from "react";
6
+ import { useStore as d, useTransition as K } from "@streamlayer/react-polyfills";
7
7
  import { ActivePages as n, Tabs as F } from "../../../../ui/gamification/tabs/index.js";
8
8
  import { Leaderboard as O } from "./Leaderboard.js";
9
9
  import { QuestionsList as H } from "./QuestionsList.js";
10
10
  import { UserSummary as M } from "./UserSummary.js";
11
- const W = ({ gamification: s, className: w, scrollStore: t, scrollNode: y, appNode: d, style: k, responsiveStore: i }) => {
12
- const { tabsShown: u } = c(t, { keys: ["tabsShown"] }), o = c(s.friendsTabEnabled), [a, b] = V(n.HOME), [, T] = K(), { sdkInDesktopView: h, screen: g } = c(i, { keys: ["sdkInDesktopView"] }), x = (r) => {
11
+ const W = ({ gamification: s, className: w, scrollStore: t, scrollNode: y, appNode: c, style: k, responsiveStore: i }) => {
12
+ const { tabsShown: u } = d(t, { keys: ["tabsShown"] }), o = d(s.friendsTabEnabled), [a, h] = V(n.HOME), [, T] = K(), { sdkInDesktopView: l, screen: g } = d(i, { keys: ["sdkInDesktopView"] }), x = (r) => {
13
13
  T(() => {
14
- var p;
15
- b(r), h === !1 && (((p = d.current) == null ? void 0 : p.getBoundingClientRect().y) || 0) < 0 && P(d, g.size, { behavior: "instant" });
14
+ var b;
15
+ h(r), l === !1 && (((b = c.current) == null ? void 0 : b.getBoundingClientRect().y) || 0) < 0 && P(c, g.size, { behavior: "instant" });
16
16
  });
17
17
  };
18
- l(() => t.subscribe((r) => {
18
+ f(() => t.subscribe((r) => {
19
19
  if (r.scrollPosition === 0) {
20
20
  t.setKey("tabsShown", !0);
21
21
  return;
22
22
  }
23
23
  i.get().sdkInDesktopView ? t.setKey("tabsShown", r.scrollDirection === "backward") : t.setKey("tabsShown", r.scrollDirection === "forward");
24
- }), [t, i]), l(() => {
25
- o || b(n.HOME);
24
+ }), [t, i]), f(() => {
25
+ o || h(n.HOME);
26
26
  }, [o]);
27
27
  let m = "0px";
28
- return h ? m = u ? "0px" : "calc(0px - var(--header-height))" : m = u ? "var(--header-height)" : "0px", /* @__PURE__ */ f(S, { className: C(w, "SL-Tabs"), style: k, children: [
28
+ return l ? m = u ? "0px" : "calc(0px - var(--header-height))" : m = u ? "var(--header-height)" : "0px", /* @__PURE__ */ p(S, { className: C(w, "SL-Tabs", "sl-hide-on-modal"), style: k, children: [
29
29
  o && /* @__PURE__ */ e(
30
30
  E,
31
31
  {
@@ -35,7 +35,7 @@ const W = ({ gamification: s, className: w, scrollStore: t, scrollNode: y, appNo
35
35
  children: /* @__PURE__ */ e(F, { activePage: a, toggleActivePage: x })
36
36
  }
37
37
  ),
38
- a === n.HOME && /* @__PURE__ */ f(D, { children: [
38
+ a === n.HOME && /* @__PURE__ */ p(D, { children: [
39
39
  /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(M, { userSummary: s.userSummary }) }) }),
40
40
  /* @__PURE__ */ e(I, { style: { flex: 1 }, children: /* @__PURE__ */ e(H, { openQuestion: s.openQuestion, store: s.feedList.getStore() }) })
41
41
  ] }),
@@ -2,6 +2,7 @@ import { AppNodeRef, ScrollNodeRef } from '../../..';
2
2
  import { ResponsiveStore } from '../../../useSdkResponsive';
3
3
  import { ScrollStore } from '../../../useSdkScroll';
4
4
  import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
5
+ import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
5
6
  export declare const GamificationOverlay: React.FC<{
6
7
  gamification: GamificationClass;
7
8
  className?: string;
@@ -16,7 +17,9 @@ export declare const GamificationOverlay: React.FC<{
16
17
  */
17
18
  export declare const GamificationOverlayStandalone: React.FC<{
18
19
  gamification: GamificationClass;
20
+ sdk: StreamLayerSDK;
19
21
  className?: string;
20
22
  responsiveStore: ResponsiveStore;
21
23
  appNode: AppNodeRef;
24
+ muted?: boolean;
22
25
  }>;