@streamlayer/react-ui 1.32.3 → 1.33.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 (154) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -1
  2. package/lib/app/app/Advertisement/index.js +14 -15
  3. package/lib/app/app/Banner/index.d.ts +1 -1
  4. package/lib/app/app/Features/FeatureProvider.d.ts +2 -2
  5. package/lib/app/app/Features/Gamification/Leaderboard.d.ts +1 -1
  6. package/lib/app/app/Features/Gamification/Leaderboard.js +46 -36
  7. package/lib/app/app/Features/Gamification/Question.d.ts +2 -2
  8. package/lib/app/app/Features/Gamification/Question.js +42 -42
  9. package/lib/app/app/Features/Gamification/QuestionAdvertisement.js +19 -25
  10. package/lib/app/app/Features/Gamification/QuestionsList.d.ts +1 -1
  11. package/lib/app/app/Features/Gamification/Tabs.d.ts +1 -1
  12. package/lib/app/app/Features/Gamification/UserSummary.d.ts +1 -1
  13. package/lib/app/app/Features/Gamification/index.d.ts +2 -2
  14. package/lib/app/app/Features/Gamification/index.js +29 -28
  15. package/lib/app/app/Features/index.d.ts +2 -2
  16. package/lib/app/app/InApp/index.d.ts +1 -1
  17. package/lib/app/app/Insight/index.d.ts +2 -2
  18. package/lib/app/app/Layout/index.d.ts +1 -1
  19. package/lib/app/app/Navigation/index.d.ts +1 -1
  20. package/lib/app/app/Notifications/Onboarding/Notification/index.d.ts +2 -2
  21. package/lib/app/app/Notifications/Onboarding/index.d.ts +2 -2
  22. package/lib/app/app/Notifications/Onboarding/index.js +45 -42
  23. package/lib/app/app/Notifications/index.d.ts +1 -1
  24. package/lib/app/app/Points/index.d.ts +1 -1
  25. package/lib/app/app/index.d.ts +1 -1
  26. package/lib/app/app/story/index.js +24 -24
  27. package/lib/app/app/story/insight/index.js +14 -15
  28. package/lib/app/app/story/insight/video.js +3 -3
  29. package/lib/app/app/story/promotion/content.js +5 -5
  30. package/lib/app/app/story/promotion/index.d.ts +1 -0
  31. package/lib/app/app/story/promotion/index.js +24 -25
  32. package/lib/app/app/story/promotion/video.d.ts +0 -1
  33. package/lib/app/app/story/promotion/video.js +41 -43
  34. package/lib/app/app/story/promotion-notification/index.js +15 -16
  35. package/lib/app/app/story/promotion-notification/video.d.ts +0 -1
  36. package/lib/app/app/story/promotion-notification/video.js +22 -30
  37. package/lib/app/app/story/settings/index.js +6 -6
  38. package/lib/app/app/story/settings/login.js +1 -1
  39. package/lib/app/app/story/video.js +28 -28
  40. package/lib/app/app/useApp.d.ts +1 -1
  41. package/lib/app/app/useAppContext.d.ts +1 -1
  42. package/lib/app/login/demo.js +19 -18
  43. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +0 -1
  44. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +17 -17
  45. package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.d.ts +2 -2
  46. package/lib/app/masters/BetPack/BetPackContent/index.d.ts +1 -1
  47. package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
  48. package/lib/app/masters/BetPack/index.d.ts +1 -1
  49. package/lib/app/masters/Features/FeatureProvider.d.ts +2 -2
  50. package/lib/app/masters/Features/Gamification/Question.d.ts +1 -1
  51. package/lib/app/masters/Features/Gamification/QuestionsList.d.ts +1 -1
  52. package/lib/app/masters/Features/Gamification/Tabs.d.ts +1 -1
  53. package/lib/app/masters/Features/Gamification/UserSummary.d.ts +1 -1
  54. package/lib/app/masters/Features/Gamification/index.d.ts +1 -1
  55. package/lib/app/masters/Features/index.d.ts +2 -2
  56. package/lib/app/masters/Notifications/Onboarding/Notification/index.d.ts +2 -2
  57. package/lib/app/masters/Notifications/Onboarding/index.d.ts +2 -2
  58. package/lib/app/masters/Notifications/Onboarding/index.js +42 -39
  59. package/lib/app/masters/Notifications/index.d.ts +1 -1
  60. package/lib/app/masters/Points/index.d.ts +1 -1
  61. package/lib/app/masters/masters.d.ts +2 -1
  62. package/lib/app/masters/masters.js +34 -32
  63. package/lib/app/masters/provider.d.ts +4 -0
  64. package/lib/app/masters/provider.js +23 -0
  65. package/lib/app/masters/story/components.js +48 -52
  66. package/lib/app/masters/story/index.js +16 -15
  67. package/lib/app/masters/useMastersApp.d.ts +1 -1
  68. package/lib/app/masters/useMastersContext.d.ts +1 -1
  69. package/lib/app/tgl/index.d.ts +1 -0
  70. package/lib/app/tgl/index.js +19 -20
  71. package/lib/app/tgl/video.d.ts +0 -1
  72. package/lib/app/tgl/video.js +40 -42
  73. package/lib/app/useSdkFeature.d.ts +3 -3
  74. package/lib/app/webos/Advertisement/AdvertisementUI.d.ts +1 -1
  75. package/lib/app/webos/Advertisement/index.d.ts +1 -1
  76. package/lib/app/webos/ExposedPauseAd/PauseAd.d.ts +1 -1
  77. package/lib/app/webos/ExposedPauseAd/PauseAd.js +68 -68
  78. package/lib/app/webos/Question/index.d.ts +1 -1
  79. package/lib/app/webos/index.d.ts +1 -1
  80. package/lib/app/webos/story.js +26 -26
  81. package/lib/app/webos/ui/Sidebar/PromoAction.d.ts +1 -1
  82. package/lib/app/webos/ui/Sidebar/index.d.ts +2 -2
  83. package/lib/app/webos/ui/Sidebar/styles.js +82 -888
  84. package/lib/app/webos/ui/insight/index.d.ts +1 -1
  85. package/lib/assets/style.css +1 -1
  86. package/lib/core/app.d.ts +7 -0
  87. package/lib/core/app.js +14 -0
  88. package/lib/core/event.d.ts +6 -0
  89. package/lib/core/event.js +5 -0
  90. package/lib/core/hooks.d.ts +16 -0
  91. package/lib/core/hooks.js +8 -0
  92. package/lib/core/provider.d.ts +49 -0
  93. package/lib/core/provider.js +9 -0
  94. package/lib/hooks/analytics.d.ts +1 -1
  95. package/lib/hooks-B0Qttldg.js +99 -0
  96. package/lib/index.d.ts +0 -1
  97. package/lib/index.js +2 -4
  98. package/lib/ui/advertisement/banner/index.d.ts +3 -3
  99. package/lib/ui/advertisement/index.d.ts +1 -1
  100. package/lib/ui/advertisement/mock.d.ts +1 -1
  101. package/lib/ui/advertisement/notification/index.d.ts +1 -1
  102. package/lib/ui/advertisement/notification/lower-third/index.d.ts +1 -1
  103. package/lib/ui/advertisement/notification/lower-third/index.js +34 -30
  104. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +100 -33212
  105. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js +13 -13
  106. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.d.ts +1 -1
  107. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +63 -204
  108. package/lib/ui/advertisement/overlay/index.d.ts +2 -2
  109. package/lib/ui/close-btn/index.d.ts +1 -1
  110. package/lib/ui/gamification/constants.d.ts +1 -1
  111. package/lib/ui/gamification/detail/header/index.d.ts +1 -1
  112. package/lib/ui/gamification/insight/index.d.ts +1 -1
  113. package/lib/ui/gamification/insight-list/index.d.ts +1 -1
  114. package/lib/ui/gamification/leaderboard/list-item/index.d.ts +1 -1
  115. package/lib/ui/gamification/leaderboard/static.d.ts +1 -1
  116. package/lib/ui/gamification/onboarding/index.d.ts +2 -2
  117. package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.d.ts +2 -2
  118. package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.js +1 -1
  119. package/lib/ui/gamification/question/inapp/notification/AdNotification/index.d.ts +1 -1
  120. package/lib/ui/gamification/question/inapp/notification/NotificationMedia/index.d.ts +1 -1
  121. package/lib/ui/gamification/question/inapp/notification/index.d.ts +1 -1
  122. package/lib/ui/gamification/question/inapp/onboarding/index.d.ts +1 -1
  123. package/lib/ui/gamification/question/inapp/prediction-result/frames/index.d.ts +1 -1
  124. package/lib/ui/gamification/question/inapp/prediction-result/index.d.ts +1 -1
  125. package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/index.d.ts +1 -1
  126. package/lib/ui/gamification/question/inapp/prediction-result-ad/index.d.ts +1 -1
  127. package/lib/ui/gamification/question/index.d.ts +1 -1
  128. package/lib/ui/gamification/question/list/index.d.ts +1 -1
  129. package/lib/ui/gamification/question/notification/index.d.ts +1 -1
  130. package/lib/ui/gamification/question/notification/insight/index.d.ts +2 -2
  131. package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +1 -1
  132. package/lib/ui/gamification/question/notification/tweet/index.d.ts +1 -1
  133. package/lib/ui/gamification/vote/feedback/index.d.ts +1 -1
  134. package/lib/ui/gamification/vote/index.d.ts +1 -1
  135. package/lib/ui/gamification/vote/vote-option/index.d.ts +1 -1
  136. package/lib/ui/gamification/vote/win-bar/index.d.ts +1 -1
  137. package/lib/ui/icons/index.d.ts +198 -66
  138. package/lib/ui/navigation/button/index.d.ts +1 -1
  139. package/lib/ui/questions/insight/index.d.ts +1 -1
  140. package/lib/ui/questions/twitter/index.d.ts +1 -1
  141. package/lib/ui/video-player/index.js +26 -23
  142. package/lib/useStreamLayerApp.d.ts +23 -0
  143. package/lib/useStreamLayerApp.js +167 -0
  144. package/lib/utils/debug/components/bypassLogin.d.ts +1 -1
  145. package/lib/utils/debug/components/developer.d.ts +1 -1
  146. package/lib/utils/debug/components/eventInput.d.ts +1 -1
  147. package/lib/utils/debug/index.js +8 -8
  148. package/lib/utils/debug/storage.d.ts +1 -1
  149. package/lib/utils/storage.d.ts +1 -1
  150. package/package.json +42 -35
  151. package/lib/index-l-eyvmpL.js +0 -3758
  152. package/lib/utils/createDemo.d.ts +0 -12
  153. package/lib/utils/createDemo.js +0 -49
  154. package/lib/vast-client.min-B0NUra1B.js +0 -1060
@@ -1,4 +1,4 @@
1
- import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
1
+ import { StreamLayerSDK } from '../../../packages/sdk-web-interfaces/src/index.ts';
2
2
  export declare const AdvertisementUIWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
3
  export type StreamLayerSDKAdvertisementProps = {
4
4
  isMobileScreen?: boolean;
@@ -1,15 +1,15 @@
1
1
  import { jsx as n, jsxs as z } from "react/jsx-runtime";
2
- import { cx as K } from "@linaria/core";
2
+ import { cx as q } from "@linaria/core";
3
3
  import { styled as J } from "@linaria/react";
4
4
  import { useAnalyticsListener as X } from "../../../hooks/analytics.js";
5
5
  import { useState as Y, useEffect as Z, useRef as Q } from "react";
6
6
  import { useStore as u } from "@streamlayer/react-polyfills";
7
- import { eventBus as q } from "@streamlayer/sdk-web-interfaces";
7
+ import { eventBus as H } from "@streamlayer/sdk-web-interfaces";
8
8
  import { FeatureType as tt, AdUnit as et, NotificationPromotionMode as rt, PromotionType as ot } from "@streamlayer/sdk-web-types";
9
9
  import { StreamLayerSDKBannerProvider as at } from "../Banner/index.js";
10
10
  import { AdvertisementUI as it } from "../../../ui/advertisement/index.js";
11
11
  import { useAdvertisementBackground as nt } from "../../../ui/theme/utils.js";
12
- const H = /* @__PURE__ */ J("div")({
12
+ const M = /* @__PURE__ */ J("div")({
13
13
  name: "AdvertisementUIWrap",
14
14
  class: "aa6pjif",
15
15
  propsAsIs: !1
@@ -17,13 +17,13 @@ const H = /* @__PURE__ */ J("div")({
17
17
  const r = a.target;
18
18
  if (r instanceof HTMLAnchorElement && r.target === "_blank") {
19
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", {
20
+ r.getAttribute("data-a") === "button" && H.emit("advertisement", {
21
21
  action: "buttonSelect",
22
22
  payload: {
23
23
  id: o,
24
24
  type: i
25
25
  }
26
- }), r.getAttribute("data-a") === "banner" && q.emit("advertisement", {
26
+ }), r.getAttribute("data-a") === "banner" && H.emit("advertisement", {
27
27
  action: "bannerSelect",
28
28
  payload: {
29
29
  id: o,
@@ -47,7 +47,7 @@ const H = /* @__PURE__ */ J("div")({
47
47
  controlVideo: y,
48
48
  muted: b
49
49
  }) => {
50
- var A, U, S, h, I, L, P, E, k, w, T, N, W, D, V, j, x, B, F, M, R;
50
+ var A, U, S, h, I, L, P, E, k, w, T, N, W, D, V, j, x, B, F, R, K;
51
51
  const d = Q(null), t = u(r.$store), e = u(a.openedQuestion.$store);
52
52
  X(d, {
53
53
  enabled: !!t.data,
@@ -60,12 +60,12 @@ const H = /* @__PURE__ */ J("div")({
60
60
  portraitUrl: _
61
61
  });
62
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, {
63
+ return s ? /* @__PURE__ */ n(M, {
64
64
  ref: d,
65
65
  style: {
66
66
  height: "100%"
67
67
  },
68
- className: K("SL-AdvertisementUIWrap", c && "mobile-view"),
68
+ className: q("SL-AdvertisementUIWrap", c && "mobile-view"),
69
69
  children: /* @__PURE__ */ n(at, {
70
70
  cardId: e.id,
71
71
  promotion: {
@@ -78,12 +78,12 @@ const H = /* @__PURE__ */ J("div")({
78
78
  if (t.data === void 0 || !f && t.isViewed)
79
79
  return null;
80
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, {
81
+ return /* @__PURE__ */ z(M, {
82
82
  ref: d,
83
83
  style: {
84
84
  height: C ? "auto" : "100%"
85
85
  },
86
- className: K("SL-AdvertisementUIWrap", c && "mobile-view", G && "SL-AdvertisementUIWrap--lower-third"),
86
+ className: q("SL-AdvertisementUIWrap", c && "mobile-view", G && "SL-AdvertisementUIWrap--lower-third"),
87
87
  children: [!l && $, /* @__PURE__ */ n(it, {
88
88
  skipTypeCheck: p,
89
89
  sidebar: m,
@@ -92,12 +92,11 @@ const H = /* @__PURE__ */ J("div")({
92
92
  advertisementPaused: !!t.isPaused,
93
93
  togglePause: t.togglePause,
94
94
  isEventFired: t.isEventFired,
95
- toggleMute: t.toggleMute,
96
95
  fireEvent: t.fireEvent,
97
96
  close: t.close,
98
97
  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,
98
+ markAsViewed: (R = a.advertisement) == null ? void 0 : R.markAsViewed,
99
+ open: (K = a.advertisement) == null ? void 0 : K.open,
101
100
  layoutMode: o,
102
101
  isNotification: l,
103
102
  skipAutoClose: i,
@@ -143,7 +142,7 @@ const H = /* @__PURE__ */ J("div")({
143
142
  if (!g)
144
143
  return null;
145
144
  const t = a.getFeature(tt.GAMES);
146
- return !t || o && !y ? null : /* @__PURE__ */ n(dt, {
145
+ return !(t != null && t.advertisement) || o && !y ? null : /* @__PURE__ */ n(dt, {
147
146
  gamification: t,
148
147
  advertisement: t.advertisement,
149
148
  sidebar: r,
@@ -161,6 +160,6 @@ const H = /* @__PURE__ */ J("div")({
161
160
  });
162
161
  };
163
162
  export {
164
- H as AdvertisementUIWrap,
163
+ M as AdvertisementUIWrap,
165
164
  Ut as StreamLayerSDKAdvertisement
166
165
  };
@@ -1,4 +1,4 @@
1
- import { Promotion } from '@streamlayer/sdk-web-types';
1
+ import { Promotion } from '../../../packages/sdk-web-types/src/index.ts';
2
2
  export declare const StreamLayerSDKBannerProvider: React.FC<{
3
3
  promotion: Promotion;
4
4
  cardId: string;
@@ -1,5 +1,5 @@
1
- import { Features } from '@streamlayer/sdk-web-features';
2
- import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
1
+ import { Features } from '../../../packages/sdk-web-features/src/index.ts';
2
+ import { StreamLayerSDK } from '../../../packages/sdk-web-interfaces/src/index.ts';
3
3
  /** Here we check data, render loaders, load data and perform some side effects for the active feature */
4
4
  export declare const FeatureProvider: React.FC<{
5
5
  feature: Features;
@@ -1,6 +1,6 @@
1
1
  import { ScrollNodeRef } from '../../..';
2
2
  import { ScrollStore } from '../../../useSdkScroll';
3
- import { Gamification } from '@streamlayer/feature-gamification';
3
+ import { Gamification } from '../../../../packages/feature-gamification/src/index.ts';
4
4
  export declare const Leaderboard: React.FC<{
5
5
  gamification: Gamification;
6
6
  scrollNode: ScrollNodeRef;
@@ -1,9 +1,9 @@
1
- import { jsx as r, jsxs as f, Fragment as L } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as u, Fragment as L } from "react/jsx-runtime";
2
2
  import { styled as h } from "@linaria/react";
3
3
  import { useClipboardCopy as k } from "../../../useClipboardCopy.js";
4
- import { useRef as u } from "react";
5
- import { useStore as n } from "@streamlayer/react-polyfills";
6
- import { InviteLink as I } from "../../../../ui/gamification/invite-link/index.js";
4
+ import { useRef as I } from "react";
5
+ import { useStore as p } from "@streamlayer/react-polyfills";
6
+ import { InviteLink as b } from "../../../../ui/gamification/invite-link/index.js";
7
7
  import "react-virtualized-auto-sizer";
8
8
  import "react-window";
9
9
  import "react-window-infinite-loader";
@@ -11,47 +11,57 @@ import "@storybook/blocks";
11
11
  import "../../../../ui/icons/index.js";
12
12
  import "../../../../ui/gamification/leaderboard/list-item/styles.js";
13
13
  /* empty css */
14
- import { LeaderboardStaticList as b } from "../../../../ui/gamification/leaderboard/static.js";
14
+ import { LeaderboardStaticList as C } from "../../../../ui/gamification/leaderboard/static.js";
15
15
  import { Friends as y } from "./Friends.js";
16
- const C = /* @__PURE__ */ h("div")({
16
+ const v = /* @__PURE__ */ h("div")({
17
17
  name: "InviteLinkContainer",
18
18
  class: "i1odbhm4",
19
19
  propsAsIs: !1
20
- }), z = ({
21
- gamification: e,
22
- scrollNode: s,
23
- scrollStore: p
20
+ }), x = ({
21
+ gamification: r,
22
+ scrollNode: t,
23
+ scrollStore: o,
24
+ leaderboardList: i
24
25
  }) => {
25
- const o = u(null), {
26
- data: i,
27
- hasMore: d,
28
- loading: m,
29
- key: a
30
- } = n(e.leaderboardList.$store), {
31
- data: t
32
- } = n(e.deepLink.$store), [l, c] = k(o);
33
- return !i.length && !m ? /* @__PURE__ */ r(y, {
34
- deepLink: t
35
- }) : /* @__PURE__ */ f(L, {
36
- children: [/* @__PURE__ */ r(b, {
37
- items: i,
38
- scrollNode: s,
39
- scrollStore: p,
40
- fetchMore: e.leaderboardList.fetchMore,
41
- hasMore: d,
42
- openItemDetail: e.openUser,
43
- currentUserId: e.currentUserId.get()
44
- }, a), t && /* @__PURE__ */ r(C, {
45
- ref: o,
46
- children: /* @__PURE__ */ r(I, {
26
+ const s = I(null), {
27
+ data: d,
28
+ hasMore: m,
29
+ loading: a,
30
+ key: l
31
+ } = p(i.$store), {
32
+ data: n
33
+ } = p(r.deepLink.$store), [c, f] = k(s);
34
+ return !d.length && !a ? /* @__PURE__ */ e(y, {
35
+ deepLink: n
36
+ }) : /* @__PURE__ */ u(L, {
37
+ children: [/* @__PURE__ */ e(C, {
38
+ items: d,
39
+ scrollNode: t,
40
+ scrollStore: o,
41
+ fetchMore: i.fetchMore,
42
+ hasMore: m,
43
+ openItemDetail: r.openUser,
44
+ currentUserId: r.currentUserId.get()
45
+ }, l), n && /* @__PURE__ */ e(v, {
46
+ ref: s,
47
+ children: /* @__PURE__ */ e(b, {
47
48
  "data-a": "intr",
48
- onClick: () => l(t),
49
+ onClick: () => c(n),
49
50
  title: "Invite Friends",
50
51
  description: "Challenge them now!"
51
52
  })
52
- }), c]
53
+ }), f]
53
54
  });
54
- };
55
+ }, E = ({
56
+ gamification: r,
57
+ scrollNode: t,
58
+ scrollStore: o
59
+ }) => r.leaderboardList ? /* @__PURE__ */ e(x, {
60
+ leaderboardList: r.leaderboardList,
61
+ gamification: r,
62
+ scrollNode: t,
63
+ scrollStore: o
64
+ }) : null;
55
65
  export {
56
- z as Leaderboard
66
+ E as Leaderboard
57
67
  };
@@ -1,5 +1,5 @@
1
- import { Gamification } from '@streamlayer/feature-gamification';
2
- import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
1
+ import { Gamification } from '../../../../packages/feature-gamification/src/index.ts';
2
+ import { StreamLayerSDK } from '../../../../packages/sdk-web-interfaces/src/index.ts';
3
3
  export declare const Question: React.FC<{
4
4
  gamification: Gamification;
5
5
  sdk: StreamLayerSDK;
@@ -1,21 +1,21 @@
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";
1
+ import { jsxs as I, jsx as e } from "react/jsx-runtime";
2
+ import { styled as G } from "@linaria/react";
3
+ import { useAppContext as J } from "../../useAppContext.js";
4
+ import { useState as K } from "react";
5
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")({
6
+ import { QuestionType as P, AdUnit as M } from "@streamlayer/sdk-web-types";
7
+ import { VoteHeader as W } from "../../../../ui/gamification/detail/header/index.js";
8
+ import { Sponsor as X } from "../../../../ui/gamification/detail/sponsor/index.js";
9
+ import { Vote as Y, VoteSkeleton as Z } from "../../../../ui/gamification/vote/index.js";
10
+ import { InsightDetails as _ } from "../../../../ui/gamification/vote/insight-details/index.js";
11
+ import { TwitterDetails as k } from "../../../../ui/gamification/vote/twitter-details/index.js";
12
+ import { useAdvertisementBackground as F } from "../../../../ui/theme/utils.js";
13
+ import { QuestionAdvertisement as Q } from "./QuestionAdvertisement.js";
14
+ const $ = /* @__PURE__ */ G("div")({
15
15
  name: "QuestionContainer",
16
16
  class: "q14ckf9e",
17
17
  propsAsIs: !1
18
- }), st = ({
18
+ }), tt = ({
19
19
  openedQuestion: t,
20
20
  muted: n,
21
21
  webos: c
@@ -23,18 +23,18 @@ const N = /* @__PURE__ */ M("div")({
23
23
  var a, i;
24
24
  const {
25
25
  sdk: r
26
- } = W();
27
- return ((a = t == null ? void 0 : t.attributes) == null ? void 0 : a.attributes.case) === "insight" ? /* @__PURE__ */ e(Q, {
26
+ } = J();
27
+ return ((a = t == null ? void 0 : t.attributes) == null ? void 0 : a.attributes.case) === "insight" ? /* @__PURE__ */ e(_, {
28
28
  ...t.attributes.attributes.value,
29
29
  muted: n,
30
30
  controlVideo: r == null ? void 0 : r.controlVideoPlayer,
31
31
  webos: c
32
- }) : ((i = t == null ? void 0 : t.attributes) == null ? void 0 : i.attributes.case) === "tweet" ? /* @__PURE__ */ e(tt, {
32
+ }) : ((i = t == null ? void 0 : t.attributes) == null ? void 0 : i.attributes.case) === "tweet" ? /* @__PURE__ */ e(k, {
33
33
  ...t.attributes.attributes.value,
34
34
  muted: n,
35
35
  controlVideo: r == null ? void 0 : r.controlVideoPlayer
36
36
  }) : null;
37
- }, et = ({
37
+ }, ot = ({
38
38
  extendedQuestion: t,
39
39
  vote: n,
40
40
  close: c,
@@ -44,61 +44,61 @@ const N = /* @__PURE__ */ M("div")({
44
44
  loading: a,
45
45
  data: i
46
46
  } = t;
47
- return i ? /* @__PURE__ */ e(k, {
47
+ return i ? /* @__PURE__ */ e(Y, {
48
48
  webos: r,
49
49
  vote: n,
50
50
  close: c,
51
51
  openedQuestion: i,
52
52
  isLoading: !!a
53
- }) : /* @__PURE__ */ e(F, {});
54
- }, Tt = ({
53
+ }) : /* @__PURE__ */ e(Z, {});
54
+ }, ht = ({
55
55
  gamification: t,
56
56
  sdk: n,
57
57
  muted: c,
58
58
  skipAutoClose: r,
59
59
  hideSponsor: a,
60
60
  className: i,
61
- hideHeader: O,
61
+ hideHeader: E,
62
62
  webos: d
63
63
  }) => {
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
64
+ var A, S, T, v, b, y, U, V, x, D, g, q, C, w, j, H;
65
+ const s = u(t.openedQuestion.$store), o = u(t.openedQuestion.$extendedStore), [L, N] = K(!1), O = u(n.options), m = ((A = s == null ? void 0 : s.attributes) == null ? void 0 : A.type) === P.FACTOID, l = (S = s == null ? void 0 : s.attributes) == null ? void 0 : S.backgroundImage, p = (T = o.data) == null ? void 0 : T.backgroundImage, R = m ? l == null ? void 0 : l.landscapeUrl : p == null ? void 0 : p.landscapeUrl, z = m ? l == null ? void 0 : l.portraitUrl : p == null ? void 0 : p.portraitUrl, f = F({
66
+ containerId: O.containerId,
67
+ landscapeUrl: R,
68
+ portraitUrl: z
69
69
  });
70
70
  if (!s)
71
71
  return null;
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, {
72
+ const h = s.type, B = ((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 o.data && o.data.adUnit === M.STANDART && !L ? /* @__PURE__ */ I($, {
74
74
  className: i,
75
- children: [f, /* @__PURE__ */ e(rt, {
75
+ children: [f, /* @__PURE__ */ e(Q, {
76
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) || ""
77
+ hasBanner: !!((U = (y = o.data.promotion) == null ? void 0 : y.banner) != null && U.imageUrl),
78
+ setAdShowed: N,
79
+ sponsorLogo: ((x = (V = o.data.promotion) == null ? void 0 : V.sponsor) == null ? void 0 : x.logo) || ((D = o.data.sponsorship) == null ? void 0 : D.logo) || ""
80
80
  })]
81
- }) : /* @__PURE__ */ E(N, {
81
+ }) : /* @__PURE__ */ I($, {
82
82
  className: i,
83
- children: [f, !O && /* @__PURE__ */ e(Z, {
84
- closeTimer: r ? void 0 : K,
83
+ children: [f, !E && /* @__PURE__ */ e(W, {
84
+ closeTimer: r ? void 0 : B,
85
85
  close: t.closeQuestion,
86
- type: ((w = s.attributes) == null ? void 0 : w.type) || L.UNSET,
86
+ type: ((g = s.attributes) == null ? void 0 : g.type) || P.UNSET,
87
87
  webos: d
88
- }), h === "question" && /* @__PURE__ */ e(et, {
88
+ }), h === "question" && /* @__PURE__ */ e(ot, {
89
89
  webos: d,
90
90
  vote: t.submitAnswer,
91
91
  close: t.closeQuestion,
92
92
  extendedQuestion: o
93
- }), h !== "question" && /* @__PURE__ */ e(st, {
93
+ }), h !== "question" && /* @__PURE__ */ e(tt, {
94
94
  muted: c,
95
95
  openedQuestion: s,
96
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)
97
+ }), !a && /* @__PURE__ */ e(X, {
98
+ sponsorLogo: ((w = (C = (q = o.data) == null ? void 0 : q.promotion) == null ? void 0 : C.sponsor) == null ? void 0 : w.logo) || ((H = (j = o.data) == null ? void 0 : j.sponsorship) == null ? void 0 : H.logo)
99
99
  })]
100
100
  });
101
101
  };
102
102
  export {
103
- Tt as Question
103
+ ht as Question
104
104
  };
@@ -1,46 +1,40 @@
1
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")({
2
+ import { styled as s } from "@linaria/react";
3
+ import { useRef as u, useEffect as c } from "react";
4
+ const a = /* @__PURE__ */ s("div")({
6
5
  name: "QuestionAdvertisementContainer",
7
6
  class: "qwludgs",
8
7
  propsAsIs: !1
9
- }), l = /* @__PURE__ */ t("div")({
8
+ }), d = /* @__PURE__ */ s("div")({
10
9
  name: "QuestionAdvertisementText",
11
10
  class: "qvce6pv",
12
11
  propsAsIs: !1
13
- }), p = /* @__PURE__ */ t("div")({
12
+ }), l = /* @__PURE__ */ s("div")({
14
13
  name: "QuestionAdvertisementImage",
15
14
  class: "qsid7hx",
16
15
  propsAsIs: !1
17
- }), x = ({
18
- sponsorLogo: i,
19
- id: s,
20
- hasBanner: n,
21
- setAdShowed: o
16
+ }), A = ({
17
+ sponsorLogo: r,
18
+ id: i,
19
+ hasBanner: o,
20
+ setAdShowed: t
22
21
  }) => {
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
- });
22
+ const n = u();
23
+ return c(() => (n.current = setTimeout(() => {
24
+ t(!0);
31
25
  }, 5e3), () => {
32
- clearTimeout(r.current);
33
- }), [o, s, n]), /* @__PURE__ */ m(d, {
34
- children: [/* @__PURE__ */ e(l, {
26
+ clearTimeout(n.current);
27
+ }), [t, i, o]), /* @__PURE__ */ m(a, {
28
+ children: [/* @__PURE__ */ e(d, {
35
29
  children: "PRESENTED BY"
36
- }), /* @__PURE__ */ e(p, {
30
+ }), /* @__PURE__ */ e(l, {
37
31
  children: /* @__PURE__ */ e("img", {
38
- src: i,
32
+ src: r,
39
33
  alt: "ad-sponsor-logo"
40
34
  })
41
35
  })]
42
36
  });
43
37
  };
44
38
  export {
45
- x as QuestionAdvertisement
39
+ A as QuestionAdvertisement
46
40
  };
@@ -1,4 +1,4 @@
1
- import { Gamification } from '@streamlayer/feature-gamification';
1
+ import { Gamification } from '../../../../packages/feature-gamification/src/index.ts';
2
2
  export declare const QuestionsList: React.FC<{
3
3
  store: ReturnType<Exclude<Gamification['feedList'], undefined>['getStore']>;
4
4
  openQuestion: (questionId: string) => void;
@@ -1,7 +1,7 @@
1
1
  import { AppNodeRef, ScrollNodeRef } from '../../..';
2
2
  import { ResponsiveStore } from '../../../useSdkResponsive';
3
3
  import { ScrollStore } from '../../../useSdkScroll';
4
- import { Gamification } from '@streamlayer/feature-gamification';
4
+ import { Gamification } from '../../../../packages/feature-gamification/src/index.ts';
5
5
  export declare const Tabs: React.FC<{
6
6
  appNode: AppNodeRef;
7
7
  gamification: Gamification;
@@ -1,4 +1,4 @@
1
- import { Gamification } from '@streamlayer/feature-gamification';
1
+ import { Gamification } from '../../../../packages/feature-gamification/src/index.ts';
2
2
  export declare const UserSummary: React.FC<{
3
3
  userSummary: Exclude<Gamification['userSummary'], undefined>;
4
4
  }>;
@@ -1,8 +1,8 @@
1
1
  import { AppNodeRef, ScrollNodeRef } from '../../..';
2
2
  import { ResponsiveStore } from '../../../useSdkResponsive';
3
3
  import { ScrollStore } from '../../../useSdkScroll';
4
- import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
5
- import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
+ import { Gamification as GamificationClass } from '../../../../packages/feature-gamification/src/index.ts';
5
+ import { StreamLayerSDK } from '../../../../packages/sdk-web-interfaces/src/index.ts';
6
6
  export declare const GamificationOverlay: React.FC<{
7
7
  gamification: GamificationClass;
8
8
  className?: string;
@@ -1,45 +1,46 @@
1
- import { jsx as o, jsxs as v } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as I } from "react/jsx-runtime";
2
2
  import { cx as l } from "@linaria/core";
3
3
  import { styled as h } from "@linaria/react";
4
- import { SDKWhiteContainer as S } from "../../styles.js";
4
+ import { SDKWhiteContainer as k } from "../../styles.js";
5
5
  import { useAppContext as U } from "../../useAppContext.js";
6
6
  import { useHideTransition as Q } from "../../../../hooks/showIn.js";
7
7
  import { useStore as i } from "@streamlayer/react-polyfills";
8
- import { VoteHeader as y } from "../../../../ui/gamification/detail/header/index.js";
9
- import { UserStatistics as A } from "../../../../ui/gamification/user-statistics/index.js";
10
- import { ModalPortal as O } from "../../../../ui/modal/index.js";
11
- import { ShowIn as b } from "../../../../ui/show-in/index.js";
12
- import { Question as w } from "./Question.js";
13
- import { Tabs as D } from "./Tabs.js";
14
- const H = () => b, u = /* @__PURE__ */ h(H())({
8
+ import { createSingleStore as y } from "@streamlayer/sdk-web-interfaces";
9
+ import { VoteHeader as A } from "../../../../ui/gamification/detail/header/index.js";
10
+ import { UserStatistics as O } from "../../../../ui/gamification/user-statistics/index.js";
11
+ import { ModalPortal as b } from "../../../../ui/modal/index.js";
12
+ import { ShowIn as w } from "../../../../ui/show-in/index.js";
13
+ import { Question as D } from "./Question.js";
14
+ import { Tabs as H } from "./Tabs.js";
15
+ const R = () => w, u = /* @__PURE__ */ h(R())({
15
16
  name: "OpenedContainer",
16
17
  class: "ouvguos",
17
18
  propsAsIs: !0
18
- }), f = "t1eu4lbg", R = /* @__PURE__ */ h("div")({
19
+ }), f = "t1eu4lbg", V = /* @__PURE__ */ h("div")({
19
20
  name: "UserContainer",
20
21
  class: "uuv2xqo",
21
22
  propsAsIs: !1
22
- }), V = ({
23
+ }), j = ({
23
24
  correct: e,
24
25
  incorrect: t
25
26
  }) => {
26
27
  const n = e + t;
27
28
  return n === 0 ? 0 : Math.round(e / n * 100);
28
- }, g = ({
29
+ }, B = ({
29
30
  gamification: e,
30
31
  scrollStore: t,
31
32
  className: n,
32
33
  appNode: r,
33
34
  scrollNode: p,
34
35
  responsiveStore: a
35
- }) => /* @__PURE__ */ o(D, {
36
+ }) => /* @__PURE__ */ o(H, {
36
37
  appNode: r,
37
38
  scrollStore: t,
38
39
  scrollNode: p,
39
40
  className: n,
40
41
  gamification: e,
41
42
  responsiveStore: a
42
- }), z = ({
43
+ }), J = ({
43
44
  gamification: e,
44
45
  muted: t,
45
46
  sdk: n,
@@ -49,8 +50,8 @@ const H = () => b, u = /* @__PURE__ */ h(H())({
49
50
  }) => {
50
51
  const {
51
52
  topNavigation: c
52
- } = U(), C = i(e.openedQuestionId), x = i(e.openedQuestion.$store), s = i(e.openedUser), {
53
- sdkInDesktopView: I
53
+ } = U(), C = i(e.openedQuestionId), S = i(e.openedQuestion.$store), s = i(e.openedUser || y(void 0)), {
54
+ sdkInDesktopView: v
54
55
  } = i(a, {
55
56
  keys: ["sdkInDesktopView"]
56
57
  }), {
@@ -59,11 +60,11 @@ const H = () => b, u = /* @__PURE__ */ h(H())({
59
60
  } = Q();
60
61
  if (!C && !s)
61
62
  return null;
62
- const k = x ? /* @__PURE__ */ o(u, {
63
+ const x = S ? /* @__PURE__ */ o(u, {
63
64
  className: l(r, !c && f),
64
65
  hiding: m,
65
66
  onAnimationEnd: d,
66
- children: /* @__PURE__ */ o(w, {
67
+ children: /* @__PURE__ */ o(D, {
67
68
  muted: t,
68
69
  sdk: n,
69
70
  gamification: e
@@ -72,25 +73,25 @@ const H = () => b, u = /* @__PURE__ */ h(H())({
72
73
  className: l(r, !c && f),
73
74
  hiding: m,
74
75
  onAnimationEnd: d,
75
- children: /* @__PURE__ */ v(R, {
76
- children: [/* @__PURE__ */ o(y, {
76
+ children: /* @__PURE__ */ I(V, {
77
+ children: [/* @__PURE__ */ o(A, {
77
78
  label: "Friend's Rank",
78
79
  close: e.closeUser
79
- }), /* @__PURE__ */ o(S, {
80
- children: /* @__PURE__ */ o(A, {
80
+ }), /* @__PURE__ */ o(k, {
81
+ children: /* @__PURE__ */ o(O, {
81
82
  ...s,
82
- successRate: V(s)
83
+ successRate: j(s)
83
84
  })
84
85
  })]
85
86
  })
86
87
  }) : null;
87
- return /* @__PURE__ */ o(O, {
88
+ return /* @__PURE__ */ o(b, {
88
89
  container: p,
89
- useContainer: !I,
90
- children: k
90
+ useContainer: !v,
91
+ children: x
91
92
  });
92
93
  };
93
94
  export {
94
- g as GamificationOverlay,
95
- z as GamificationOverlayStandalone
95
+ B as GamificationOverlay,
96
+ J as GamificationOverlayStandalone
96
97
  };
@@ -1,8 +1,8 @@
1
1
  import { AppNodeRef, ScrollNodeRef } from '../..';
2
2
  import { ResponsiveStore } from '../../useSdkResponsive';
3
3
  import { ScrollStore } from '../../useSdkScroll';
4
- import { Features } from '@streamlayer/sdk-web-features';
5
- import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
+ import { Features } from '../../../packages/sdk-web-features/src/index.ts';
5
+ import { StreamLayerSDK } from '../../../packages/sdk-web-interfaces/src/index.ts';
6
6
  /** render feature by type */
7
7
  export declare const ActiveFeature: React.FC<{
8
8
  sdk: StreamLayerSDK;
@@ -1,4 +1,4 @@
1
- import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
1
+ import { StreamLayerSDK } from '../../../packages/sdk-web-interfaces/src/index.ts';
2
2
  export declare const StreamLayerSDKNotification: React.FC<{
3
3
  sdk: StreamLayerSDK;
4
4
  webos?: boolean;