@streamlayer/react-ui 1.22.4 → 1.22.6

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 (34) hide show
  1. package/lib/app/masters/Features/Gamification/index.d.ts +1 -0
  2. package/lib/app/masters/Features/Gamification/index.js +36 -30
  3. package/lib/app/masters/Features/index.d.ts +1 -0
  4. package/lib/app/masters/Features/index.js +13 -12
  5. package/lib/app/masters/Notifications/index.d.ts +1 -0
  6. package/lib/app/masters/Notifications/index.js +97 -94
  7. package/lib/app/masters/Points/index.js +16 -25
  8. package/lib/app/masters/masters.d.ts +1 -0
  9. package/lib/app/masters/masters.js +71 -60
  10. package/lib/app/masters/story/index.d.ts +0 -1
  11. package/lib/app/masters/story/index.js +25 -37
  12. package/lib/app/masters/styles.d.ts +1 -0
  13. package/lib/app/masters/styles.js +16 -15
  14. package/lib/app/masters/useSdkResponsive.js +20 -19
  15. package/lib/app/masters/useSdkScroll.d.ts +1 -1
  16. package/lib/app/masters/useSdkScroll.js +33 -33
  17. package/lib/assets/style.css +1 -1
  18. package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
  19. package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
  20. package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
  21. package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
  22. package/lib/ui/modal/index.d.ts +1 -0
  23. package/lib/ui/modal/index.js +36 -31
  24. package/lib/ui/questions/insight/index.js +24 -16
  25. package/lib/ui/questions/insight/styles.d.ts +1 -0
  26. package/lib/ui/questions/insight/styles.js +14 -13
  27. package/lib/ui/questions/twitter/index.js +54 -58
  28. package/lib/ui/theme/constants.d.ts +2 -0
  29. package/lib/ui/theme/constants.js +6 -4
  30. package/lib/ui/theme/masters-theme.js +6 -2
  31. package/lib/ui/theme/theme.js +3 -0
  32. package/lib/ui/video-player/index.d.ts +1 -0
  33. package/lib/ui/video-player/index.js +76 -60
  34. package/package.json +15 -15
@@ -14,4 +14,5 @@ export declare const GamificationOverlayStandalone: React.FC<{
14
14
  className?: string;
15
15
  responsiveStore: ResponsiveStore;
16
16
  appNode: AppNodeRef;
17
+ useContainer?: boolean;
17
18
  }>;
@@ -1,49 +1,55 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { styled as u } from "@linaria/react";
3
- import { useHideTransition as c } from "../../../../hooks/showIn.js";
4
- import { useStore as t } from "@streamlayer/react-polyfills";
5
- import { ModalPortal as d } from "../../../../ui/modal/index.js";
6
- import { ShowIn as l } from "../../../../ui/show-in/index.js";
7
- import { Question as f } from "./Question.js";
8
- import { Tabs as k } from "./Tabs.js";
9
- const h = () => l, y = /* @__PURE__ */ u(h())({
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { styled as l } from "@linaria/react";
3
+ import { useHideTransition as d } from "../../../../hooks/showIn.js";
4
+ import { useStore as i } from "@streamlayer/react-polyfills";
5
+ import { ModalPortal as f } from "../../../../ui/modal/index.js";
6
+ import { ShowIn as u } from "../../../../ui/show-in/index.js";
7
+ import { Question as y } from "./Question.js";
8
+ import { Tabs as S } from "./Tabs.js";
9
+ const k = () => u, h = /* @__PURE__ */ l(k())({
10
10
  name: "OpenedContainer",
11
11
  class: "o1seszvt",
12
12
  propsAsIs: !0
13
- }), A = ({
13
+ }), C = ({
14
14
  gamification: o,
15
- className: e
16
- }) => /* @__PURE__ */ n(k, {
17
- className: e,
15
+ className: n
16
+ }) => /* @__PURE__ */ t(S, {
17
+ className: n,
18
18
  gamification: o
19
- }), D = ({
19
+ }), I = `
20
+ .SDKContainer {
21
+ position: static !important;
22
+ }
23
+ `, G = ({
20
24
  gamification: o,
21
- responsiveStore: e,
22
- className: i,
25
+ responsiveStore: n,
26
+ useContainer: e,
27
+ className: s,
23
28
  appNode: r
24
29
  }) => {
25
- const s = t(o.openedQuestion.$store), {
30
+ const a = i(o.openedQuestion.$store), {
26
31
  sdkInDesktopView: m
27
- } = t(e, {
32
+ } = i(n, {
28
33
  keys: ["sdkInDesktopView"]
29
34
  }), {
30
- hiding: a,
31
- onAnimationEnd: p
32
- } = c();
33
- return !r.current || !s ? null : /* @__PURE__ */ n(d, {
35
+ hiding: p,
36
+ onAnimationEnd: c
37
+ } = d();
38
+ return !r.current || !a ? null : /* @__PURE__ */ t(f, {
34
39
  container: r,
35
- useContainer: !m,
36
- children: /* @__PURE__ */ n(y, {
37
- className: i,
38
- hiding: a,
39
- onAnimationEnd: p,
40
- children: /* @__PURE__ */ n(f, {
40
+ useContainer: typeof e == "boolean" ? !e : !m,
41
+ staticStyles: typeof e == "boolean" ? I : "",
42
+ children: /* @__PURE__ */ t(h, {
43
+ className: s,
44
+ hiding: p,
45
+ onAnimationEnd: c,
46
+ children: /* @__PURE__ */ t(y, {
41
47
  gamification: o
42
48
  })
43
49
  })
44
50
  });
45
51
  };
46
52
  export {
47
- A as GamificationOverlay,
48
- D as GamificationOverlayStandalone
53
+ C as GamificationOverlay,
54
+ G as GamificationOverlayStandalone
49
55
  };
@@ -15,4 +15,5 @@ export declare const StandaloneFeature: React.FC<{
15
15
  appNode: AppNodeRef;
16
16
  responsiveStore: ResponsiveStore;
17
17
  className?: string;
18
+ useContainer?: boolean;
18
19
  }>;
@@ -1,27 +1,28 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { lazy as l, useMemo as a, Suspense as m } from "react";
2
+ import { lazy as a, useMemo as m, Suspense as u } from "react";
3
3
  import { FeatureType as o } from "@streamlayer/sdk-web-types";
4
- import { FeatureProvider as u } from "./FeatureProvider.js";
5
- import { GamificationOverlayStandalone as f } from "./Gamification/index.js";
6
- const c = l(() => import("./Gamification/gamification-feature.js")), h = ({ sdk: e, feature: t, className: i }) => {
7
- const n = a(() => t && t.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(u, { className: i, sdk: e, feature: t, children: /* @__PURE__ */ r(c, { className: i, gamification: t }) }) : null, [e, t, i]);
4
+ import { FeatureProvider as f } from "./FeatureProvider.js";
5
+ import { GamificationOverlayStandalone as c } from "./Gamification/index.js";
6
+ const p = a(() => import("./Gamification/gamification-feature.js")), v = ({ sdk: e, feature: t, className: i }) => {
7
+ const n = m(() => t && t.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(f, { className: i, sdk: e, feature: t, children: /* @__PURE__ */ r(p, { className: i, gamification: t }) }) : null, [e, t, i]);
8
8
  return /* @__PURE__ */ r(
9
- m,
9
+ u,
10
10
  {
11
11
  fallback: /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
12
12
  children: n
13
13
  }
14
14
  );
15
- }, v = ({ feature: e, className: t, appNode: i, responsiveStore: n }) => e && e.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(
16
- f,
15
+ }, F = ({ feature: e, className: t, useContainer: i, appNode: n, responsiveStore: l }) => e && e.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(
16
+ c,
17
17
  {
18
- responsiveStore: n,
18
+ responsiveStore: l,
19
19
  className: t,
20
- appNode: i,
20
+ appNode: n,
21
+ useContainer: i,
21
22
  gamification: e
22
23
  }
23
24
  ) : null;
24
25
  export {
25
- h as ActiveFeature,
26
- v as StandaloneFeature
26
+ v as ActiveFeature,
27
+ F as StandaloneFeature
27
28
  };
@@ -9,4 +9,5 @@ export declare const SDKNotifications: React.FC<{
9
9
  headerNode: HeaderNodeRef;
10
10
  scrollStore: ScrollStore;
11
11
  responsiveStore: ResponsiveStore;
12
+ useContainer?: boolean;
12
13
  }>;
@@ -1,159 +1,162 @@
1
- import { jsxs as g, Fragment as V, jsx as c } from "react/jsx-runtime";
2
- import { cx as D } from "@linaria/core";
3
- import { useMastersContext as T } from "../useMastersContext.js";
4
- import { scrollIntoAppView as q } from "../useSdkScroll.js";
5
- import { useState as f, useMemo as E, useEffect as h, useRef as O, useCallback as w } from "react";
6
- import { r as b } from "../../../index-DALxy-8N.js";
7
- import { useStore as p } from "@streamlayer/react-polyfills";
1
+ import { jsxs as f, Fragment as D, jsx as l } from "react/jsx-runtime";
2
+ import { cx as T } from "@linaria/core";
3
+ import { useMastersContext as q } from "../useMastersContext.js";
4
+ import { scrollIntoAppView as E } from "../useSdkScroll.js";
5
+ import { useState as p, useMemo as O, useEffect as a, useRef as b, useCallback as N } from "react";
6
+ import { r as R } from "../../../index-DALxy-8N.js";
7
+ import { useStore as y } from "@streamlayer/react-polyfills";
8
8
  import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
9
- import { NotificationType as a } from "@streamlayer/sdk-web-notifications";
10
- import { QuestionTypeData as R } from "../../../ui/gamification/constants.js";
11
- import { Notification as N } from "../../../ui/gamification/question/notification/index.js";
12
- import { PredictionResult as P } from "../../../ui/gamification/question/notification/prediction-result/index.js";
13
- import { Onboarding as x } from "./Onboarding/index.js";
14
- import { HiddenContainer as A, Container as B, InnerContainer as H, NotificationRefreshing as Q, Pill as U } from "./styles.js";
15
- const j = (n) => {
16
- const [t, u] = f(0), i = O(null), l = w((o) => {
17
- i.current = o;
9
+ import { NotificationType as g } from "@streamlayer/sdk-web-notifications";
10
+ import { QuestionTypeData as P } from "../../../ui/gamification/constants.js";
11
+ import { Notification as V } from "../../../ui/gamification/question/notification/index.js";
12
+ import { PredictionResult as x } from "../../../ui/gamification/question/notification/prediction-result/index.js";
13
+ import { Onboarding as A } from "./Onboarding/index.js";
14
+ import { HiddenContainer as B, Container as H, InnerContainer as Q, NotificationRefreshing as U, Pill as j } from "./styles.js";
15
+ const z = (n) => {
16
+ const [t, c] = p(0), u = b(null), e = N((o) => {
17
+ u.current = o;
18
18
  }, []);
19
- h(() => {
20
- var d;
21
- const o = (d = i.current) == null ? void 0 : d.getBoundingClientRect();
22
- o && u(o.height);
19
+ a(() => {
20
+ var s;
21
+ const o = (s = u.current) == null ? void 0 : s.getBoundingClientRect();
22
+ o && c(o.height);
23
23
  }, [n]);
24
- const r = w((o) => {
25
- u(o);
24
+ const r = N((o) => {
25
+ c(o);
26
26
  }, []);
27
- return [l, t, r];
28
- }, z = ({
27
+ return [e, t, r];
28
+ }, F = ({
29
29
  sdk: n,
30
30
  notification: t,
31
- appNode: u,
32
- responsiveStore: i
31
+ appNode: c,
32
+ responsiveStore: u
33
33
  }) => {
34
- var m, s;
34
+ var h, d;
35
35
  const {
36
- sdk: l
37
- } = T(), [r, o, d] = j(t.id);
38
- return t.type === a.QUESTION ? /* @__PURE__ */ g(V, {
39
- children: [/* @__PURE__ */ c(A, {
36
+ sdk: e
37
+ } = q(), [r, o, s] = z(t.id);
38
+ return t.type === g.QUESTION ? /* @__PURE__ */ f(D, {
39
+ children: [/* @__PURE__ */ l(B, {
40
40
  ref: r,
41
- children: /* @__PURE__ */ c(N, {
41
+ children: /* @__PURE__ */ l(V, {
42
42
  ...t
43
43
  })
44
- }), /* @__PURE__ */ g(B, {
44
+ }), /* @__PURE__ */ f(H, {
45
45
  style: {
46
46
  height: t.hiding ? 0 : o
47
47
  },
48
48
  hiding: t.hiding,
49
- children: [/* @__PURE__ */ c(H, {
49
+ children: [/* @__PURE__ */ l(Q, {
50
50
  style: {
51
51
  height: "100%"
52
52
  },
53
- children: /* @__PURE__ */ c(N, {
53
+ children: /* @__PURE__ */ l(V, {
54
54
  ...t,
55
- controlVideo: l == null ? void 0 : l.controlVideoPlayer
55
+ controlVideo: e == null ? void 0 : e.controlVideoPlayer
56
56
  })
57
- }), /* @__PURE__ */ c(Q, {}, t.id)]
57
+ }), /* @__PURE__ */ l(U, {}, t.id)]
58
58
  })]
59
- }) : t.type === a.QUESTION_RESOLVED && ((s = (m = t.data) == null ? void 0 : m.question) != null && s.predictionResult) ? /* @__PURE__ */ c(P, {
59
+ }) : t.type === g.QUESTION_RESOLVED && ((d = (h = t.data) == null ? void 0 : h.question) != null && d.predictionResult) ? /* @__PURE__ */ l(x, {
60
60
  style: {
61
61
  height: t.hiding ? 0 : o
62
62
  },
63
- saveHeight: d,
63
+ saveHeight: s,
64
64
  close: t.close,
65
65
  hiding: t.hiding,
66
66
  ...t.data.question,
67
67
  mastersApp: !0
68
- }) : t.type === a.ONBOARDING ? /* @__PURE__ */ c(x, {
68
+ }) : t.type === g.ONBOARDING ? /* @__PURE__ */ l(A, {
69
69
  style: {
70
70
  height: t.hiding ? 0 : o
71
71
  },
72
- saveHeight: d,
72
+ saveHeight: s,
73
73
  sdk: n,
74
74
  notification: t,
75
- appNode: u,
76
- responsiveStore: i
75
+ appNode: c,
76
+ responsiveStore: u
77
77
  }) : null;
78
- }, F = "p1co32q0", L = ({
78
+ }, L = "p1co32q0", M = ({
79
79
  pill: n,
80
80
  setPill: t,
81
- appNode: u,
82
- headerNode: i,
83
- scrollNode: l,
81
+ appNode: c,
82
+ headerNode: u,
83
+ scrollNode: e,
84
84
  responsiveStore: r,
85
- scrollStore: o
85
+ scrollStore: o,
86
+ useContainer: s
86
87
  }) => {
87
- var y, I;
88
+ var I, k;
88
89
  const {
89
- screen: d
90
- } = p(r, {
90
+ screen: h
91
+ } = y(r, {
91
92
  keys: ["screen"]
92
93
  }), {
93
- tabsShown: m,
94
- scrollPosition: s
95
- } = p(o, {
94
+ tabsShown: d,
95
+ scrollPosition: m
96
+ } = y(o, {
96
97
  keys: ["tabsShown", "scrollPosition"]
97
98
  });
98
- h(() => {
99
- r.get().sdkInDesktopView ? s < 50 && t(null) : s > -50 && t(null);
100
- }, [s, r, t]);
101
- const e = r.get().sdkInDesktopView ? u : i;
102
- return !n || !e.current ? null : b.createPortal(/* @__PURE__ */ c(U, {
103
- title: n.type === a.QUESTION_RESOLVED ? "Prediction result" : `New ${((I = R[(y = n.data) == null ? void 0 : y.questionType]) == null ? void 0 : I.label) || "notification"}`,
99
+ a(() => {
100
+ r.get().sdkInDesktopView || s ? m < 50 && t(null) : m > -50 && t(null);
101
+ }, [m, r, t, s]);
102
+ const i = r.get().sdkInDesktopView ? c : u;
103
+ return !n || !i.current ? null : R.createPortal(/* @__PURE__ */ l(j, {
104
+ title: n.type === g.QUESTION_RESOLVED ? "Prediction result" : `New ${((k = P[(I = n.data) == null ? void 0 : I.questionType]) == null ? void 0 : k.label) || "notification"}`,
104
105
  onClick: () => {
105
- var k;
106
- r.get().sdkInDesktopView ? (k = l.current) == null || k.scrollTo({
106
+ var w;
107
+ r.get().sdkInDesktopView ? (w = e.current) == null || w.scrollTo({
107
108
  top: 0,
108
109
  behavior: "smooth"
109
- }) : q(u, d.size, {
110
+ }) : E(e, h.size, {
110
111
  behavior: "smooth"
111
112
  }), t(null);
112
113
  },
113
- className: D(m && F, "sl-pill-button")
114
- }), e.current);
115
- }, it = ({
114
+ className: T(d && L, "sl-pill-button")
115
+ }), i.current);
116
+ }, ot = ({
116
117
  sdk: n,
117
118
  headerNode: t,
118
- scrollNode: u,
119
- responsiveStore: i,
120
- appNode: l,
121
- scrollStore: r
119
+ scrollNode: c,
120
+ useContainer: u,
121
+ responsiveStore: e,
122
+ appNode: r,
123
+ scrollStore: o
122
124
  }) => {
123
- const [o] = f(n.getNotificationsStore()), d = p(o), [m, s] = f(null), e = E(() => n.getActiveNotification(), [n, d]);
124
- return h(() => {
125
- e && C.emit("notification", {
125
+ const [s] = p(n.getNotificationsStore()), h = y(s), [d, m] = p(null), i = O(() => n.getActiveNotification(), [n, h]);
126
+ return a(() => {
127
+ i && C.emit("notification", {
126
128
  action: "rendered",
127
129
  payload: {
128
- questionId: e.data.questionId,
129
- questionType: e.data.questionType
130
+ questionId: i.data.questionId,
131
+ questionType: i.data.questionType
130
132
  }
131
133
  });
132
- }, [e]), h(() => {
133
- e && (i.get().sdkInDesktopView || i.get().sdkInView) && (!i.get().sdkInDesktopView && i.get().sdkInView && s(e), i.get().sdkInDesktopView && window.requestAnimationFrame(() => {
134
- r.get().scrollPosition !== 0 && s(e);
134
+ }, [i]), a(() => {
135
+ i && (e.get().sdkInDesktopView || e.get().sdkInView) && (!e.get().sdkInDesktopView && e.get().sdkInView && m(i), e.get().sdkInDesktopView && window.requestAnimationFrame(() => {
136
+ o.get().scrollPosition !== 0 && m(i);
135
137
  }));
136
- }, [e]), h(() => {
137
- e || s(null);
138
- }, [e]), /* @__PURE__ */ g(V, {
139
- children: [!m && e && /* @__PURE__ */ c(z, {
138
+ }, [i]), a(() => {
139
+ i || m(null);
140
+ }, [i]), /* @__PURE__ */ f(D, {
141
+ children: [!d && i && /* @__PURE__ */ l(F, {
140
142
  headerNode: t,
141
- appNode: l,
143
+ appNode: r,
142
144
  sdk: n,
143
- notification: e,
144
- responsiveStore: i
145
- }), m && /* @__PURE__ */ c(L, {
146
- pill: m,
147
- setPill: s,
148
- appNode: l,
149
- notification: e,
145
+ notification: i,
146
+ responsiveStore: e
147
+ }), d && /* @__PURE__ */ l(M, {
148
+ pill: d,
149
+ setPill: m,
150
+ appNode: r,
151
+ notification: i,
150
152
  headerNode: t,
151
- scrollNode: u,
152
- scrollStore: r,
153
- responsiveStore: i
153
+ scrollNode: c,
154
+ scrollStore: o,
155
+ useContainer: u,
156
+ responsiveStore: e
154
157
  })]
155
158
  });
156
159
  };
157
160
  export {
158
- it as SDKNotifications
161
+ ot as SDKNotifications
159
162
  };
@@ -1,34 +1,25 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useState as a, useEffect as c } from "react";
3
- import { useStore as l } from "@streamlayer/react-polyfills";
4
- import { FeatureStatus as u, eventBus as n } from "@streamlayer/sdk-web-interfaces";
5
- import { FeatureType as f } from "@streamlayer/sdk-web-types";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { useState as m, useEffect as f } from "react";
3
+ import { useStore as c } from "@streamlayer/react-polyfills";
4
+ import { FeatureType as p } from "@streamlayer/sdk-web-types";
6
5
  import { Points as S } from "../../../ui/gamification/points/index.js";
7
- const y = ({ gamification: e }) => {
8
- const s = e.userSummary.$store, [t, p] = a(0);
9
- return c(() => {
10
- const i = s.subscribe((r) => {
11
- var o;
12
- (o = r == null ? void 0 : r.summary) != null && o.points && p(r.summary.points);
6
+ const a = ({ gamification: r }) => {
7
+ const o = r.userSummary.$store, [t, u] = m(0);
8
+ return f(() => {
9
+ const i = o.subscribe((e) => {
10
+ var s;
11
+ (s = e == null ? void 0 : e.summary) != null && s.points && u(e.summary.points);
13
12
  });
14
13
  return () => {
15
14
  i();
16
15
  };
17
- }, [s]), /* @__PURE__ */ m(S, { points: t, onClick: () => {
18
- e.status.get() === u.Suspended ? (e.openFeature(), n.emit("app", {
19
- action: "open",
20
- payload: {}
21
- })) : e.status.get() === u.Ready && (e.closeFeature(!1), n.emit("app", {
22
- action: "close",
23
- payload: {}
24
- }));
25
- } });
26
- }, k = ({ sdk: e }) => {
27
- if (!l(e.featuresList.getStore()))
16
+ }, [o]), /* @__PURE__ */ n(S, { points: t });
17
+ }, b = ({ sdk: r }) => {
18
+ if (!c(r.featuresList.getStore()))
28
19
  return null;
29
- const t = e.getFeature(f.GAMES);
30
- return t ? /* @__PURE__ */ m(y, { gamification: t }) : null;
20
+ const t = r.getFeature(p.GAMES);
21
+ return t ? /* @__PURE__ */ n(a, { gamification: t }) : null;
31
22
  };
32
23
  export {
33
- k as StreamLayerSDKPoints
24
+ b as StreamLayerSDKPoints
34
25
  };
@@ -8,5 +8,6 @@ export type MastersAppChildrenProps = {
8
8
  export type MastersAppProps = {
9
9
  sdk: StreamLayerSDK;
10
10
  betPack?: boolean;
11
+ useContainer?: boolean;
11
12
  };
12
13
  export declare const MastersApp: React.FC<MastersAppProps>;
@@ -1,90 +1,101 @@
1
- import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import { cx as A } from "@linaria/core";
3
- import { SDKContainer as N, SDKScrollContainer as b } from "./styles.js";
4
- import { useSdkScroll as h } from "./useSdkScroll.js";
5
- import { useSdkFeature as x } from "../useSdkFeature.js";
6
- import { useAnalyticsListener as d, newTabLinkListener as v } from "../../hooks/analytics.js";
7
- import { useState as y, useMemo as C, useCallback as P, useRef as p, useEffect as S } from "react";
8
- import { useStore as m } from "@streamlayer/react-polyfills";
9
- import { FeatureType as F } from "@streamlayer/sdk-web-types";
10
- import { resetCss as u } from "../../ui/theme/theme.js";
11
- import { BetPackOverlay as E } from "./BetPack/index.js";
12
- import { ActiveFeature as L, StandaloneFeature as M } from "./Features/index.js";
13
- import { SDKHeader as B } from "./Header/index.js";
14
- import { SDKNotifications as I } from "./Notifications/index.js";
1
+ import { jsxs as p, jsx as n } from "react/jsx-runtime";
2
+ import { cx as d } from "@linaria/core";
3
+ import { SDKContainer as A, mobileSdkContainer as h, SDKScrollContainer as x } from "./styles.js";
4
+ import { useSdkScroll as y } from "./useSdkScroll.js";
5
+ import { useSdkFeature as P } from "../useSdkFeature.js";
6
+ import { useAnalyticsListener as F, newTabLinkListener as N } from "../../hooks/analytics.js";
7
+ import { useState as C, useMemo as E, useCallback as L, useRef as S, useEffect as v } from "react";
8
+ import { useStore as u } from "@streamlayer/react-polyfills";
9
+ import { FeatureType as b } from "@streamlayer/sdk-web-types";
10
+ import { resetCss as f } from "../../ui/theme/theme.js";
11
+ import { BetPackOverlay as M } from "./BetPack/index.js";
12
+ import { ActiveFeature as B, StandaloneFeature as D } from "./Features/index.js";
13
+ import { SDKHeader as I } from "./Header/index.js";
14
+ import { SDKNotifications as K } from "./Notifications/index.js";
15
15
  import { MastersContext as g } from "./useMastersContext.js";
16
- import { useSdkResponsive as D } from "./useSdkResponsive.js";
17
- import { StreamLayerMastersThemeProvider as re } from "../../ui/theme/masters.js";
18
- const K = ({ sdk: e, className: t }) => {
19
- const [, n] = x(e);
20
- return /* @__PURE__ */ o(L, { className: t, feature: n, sdk: e });
21
- }, w = ({ sdk: e, className: t, appNode: n, responsiveStore: c }) => {
22
- const l = m(e.featuresList.getStore());
23
- return l ? Array.from(l, (s) => {
24
- const a = e.getFeature(s);
25
- return a ? /* @__PURE__ */ o(
26
- M,
16
+ import { useSdkResponsive as w } from "./useSdkResponsive.js";
17
+ import { StreamLayerMastersThemeProvider as ne } from "../../ui/theme/masters.js";
18
+ const G = ({ sdk: e, className: t }) => {
19
+ const [, r] = P(e);
20
+ return /* @__PURE__ */ n(B, { className: t, feature: r, sdk: e });
21
+ }, O = ({ sdk: e, className: t, appNode: r, responsiveStore: l, useContainer: m }) => {
22
+ const c = u(e.featuresList.getStore());
23
+ return c ? Array.from(c, (a) => {
24
+ const s = e.getFeature(a);
25
+ return s ? /* @__PURE__ */ n(
26
+ D,
27
27
  {
28
- responsiveStore: c,
28
+ useContainer: m,
29
+ responsiveStore: l,
29
30
  className: t,
30
- appNode: n,
31
- feature: a,
31
+ appNode: r,
32
+ feature: s,
32
33
  sdk: e
33
34
  },
34
- s
35
+ a
35
36
  ) : null;
36
37
  }) : null;
37
- }, G = (e) => {
38
- const t = p(null);
39
- return d(t, { enabled: !0, event: "click", listener: v }), /* @__PURE__ */ o(E, { ref: t, ...e });
40
- }, O = ({ sdk: e }) => {
41
- const t = p(null), n = m(e.status), c = m(e.sdkStore.slStreamId), l = p(null), [s] = D(t), [a, i] = h(t, s), r = n === "ready" && !!c.data;
42
- return S(() => {
38
+ }, R = (e) => {
39
+ const t = S(null);
40
+ return F(t, { enabled: !0, event: "click", listener: N }), /* @__PURE__ */ n(M, { ref: t, ...e });
41
+ }, j = ({ sdk: e, useContainer: t }) => {
42
+ const r = S(null), l = u(e.status), m = u(e.sdkStore.slStreamId), c = S(null), [a] = w(r), [s, i] = y(r, a, t), o = l === "ready" && !!m.data;
43
+ return v(() => {
43
44
  window.requestAnimationFrame(() => {
44
45
  e.initializeApp().then(() => {
45
- e.openFeature(F.GAMES);
46
+ e.openFeature(b.GAMES);
46
47
  });
47
48
  });
48
- }, [e]), d(t, { enabled: !0, event: "click", listener: v }), S(() => {
49
+ }, [e]), F(r, { enabled: !0, event: "click", listener: N }), v(() => {
49
50
  import("./Features/Gamification/gamification-feature.js");
50
- }, []), /* @__PURE__ */ f(N, { ref: t, children: [
51
- /* @__PURE__ */ o(B, { className: A(u), ref: l }),
52
- /* @__PURE__ */ f(b, { className: "sl-hide-on-modal", ref: a, children: [
53
- r && /* @__PURE__ */ o(
54
- I,
51
+ }, []), /* @__PURE__ */ p(A, { className: d("SDKContainer", !t && h), ref: r, children: [
52
+ /* @__PURE__ */ n(I, { className: d(f), ref: c }),
53
+ /* @__PURE__ */ p(x, { className: "sl-hide-on-modal", ref: s, children: [
54
+ o && /* @__PURE__ */ n(
55
+ K,
55
56
  {
56
57
  sdk: e,
57
- scrollNode: a,
58
- headerNode: l,
59
- appNode: t,
58
+ scrollNode: s,
59
+ headerNode: c,
60
+ appNode: r,
60
61
  scrollStore: i,
61
- responsiveStore: s
62
+ responsiveStore: a,
63
+ useContainer: t
62
64
  }
63
65
  ),
64
- r && /* @__PURE__ */ o(K, { className: u, sdk: e }),
65
- r && /* @__PURE__ */ o(w, { responsiveStore: s, appNode: t, className: u, sdk: e })
66
+ o && /* @__PURE__ */ n(G, { className: f, sdk: e }),
67
+ o && /* @__PURE__ */ n(
68
+ O,
69
+ {
70
+ responsiveStore: a,
71
+ appNode: r,
72
+ className: f,
73
+ sdk: e,
74
+ useContainer: t
75
+ }
76
+ )
66
77
  ] })
67
78
  ] });
68
- }, k = ({ sdk: e, betPack: t }) => {
69
- const [n, c] = y(t), s = !!m(e.userId()), a = C(() => ({ sdk: e }), [e]), i = P(() => {
70
- c(!1);
71
- const r = e == null ? void 0 : e.getFeature(F.GAMES);
72
- r == null || r.closeQuestion();
79
+ }, te = ({ sdk: e, betPack: t, useContainer: r }) => {
80
+ const [l, m] = C(t), a = !!u(e.userId()), s = E(() => ({ sdk: e }), [e]), i = L(() => {
81
+ m(!1);
82
+ const o = e == null ? void 0 : e.getFeature(b.GAMES);
83
+ o == null || o.closeQuestion();
73
84
  }, [e]);
74
- return /* @__PURE__ */ f(g.Provider, { value: a, children: [
75
- n && s && /* @__PURE__ */ o(
76
- G,
85
+ return /* @__PURE__ */ p(g.Provider, { value: s, children: [
86
+ l && a && /* @__PURE__ */ n(
87
+ R,
77
88
  {
78
89
  sdk: e,
79
- onEvent: ({ type: r }) => r === "slOpenGameCenter" ? i() : () => {
90
+ onEvent: ({ type: o }) => o === "slOpenGameCenter" ? i() : () => {
80
91
  },
81
92
  close: () => i()
82
93
  }
83
94
  ),
84
- !n && /* @__PURE__ */ o(O, { sdk: e })
95
+ !l && /* @__PURE__ */ n(j, { sdk: e, useContainer: r })
85
96
  ] });
86
97
  };
87
98
  export {
88
- k as MastersApp,
89
- re as StreamLayerMastersThemeProvider
99
+ te as MastersApp,
100
+ ne as StreamLayerMastersThemeProvider
90
101
  };
@@ -1,4 +1,3 @@
1
1
  export declare const MastersStory: React.FC<{
2
- settings?: boolean;
3
2
  betPack?: boolean;
4
3
  }>;