@streamlayer/react-ui 1.22.4 → 1.22.5
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.
- package/lib/app/masters/Features/Gamification/index.d.ts +1 -0
- package/lib/app/masters/Features/Gamification/index.js +36 -30
- package/lib/app/masters/Features/index.d.ts +1 -0
- package/lib/app/masters/Features/index.js +13 -12
- package/lib/app/masters/Notifications/index.d.ts +1 -0
- package/lib/app/masters/Notifications/index.js +97 -94
- package/lib/app/masters/Points/index.js +16 -25
- package/lib/app/masters/masters.d.ts +1 -0
- package/lib/app/masters/masters.js +71 -60
- package/lib/app/masters/story/index.d.ts +0 -1
- package/lib/app/masters/story/index.js +25 -37
- package/lib/app/masters/styles.d.ts +1 -0
- package/lib/app/masters/styles.js +16 -15
- package/lib/app/masters/useSdkResponsive.js +20 -19
- package/lib/app/masters/useSdkScroll.d.ts +1 -1
- package/lib/app/masters/useSdkScroll.js +33 -33
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
- package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
- package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
- package/lib/ui/modal/index.d.ts +1 -0
- package/lib/ui/modal/index.js +36 -31
- package/lib/ui/questions/insight/index.js +24 -16
- package/lib/ui/questions/insight/styles.d.ts +1 -0
- package/lib/ui/questions/insight/styles.js +14 -13
- package/lib/ui/theme/constants.d.ts +2 -0
- package/lib/ui/theme/constants.js +6 -4
- package/lib/ui/theme/masters-theme.js +6 -2
- package/lib/ui/theme/theme.js +3 -0
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +29 -28
- package/package.json +15 -15
|
@@ -1,49 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useHideTransition as
|
|
4
|
-
import { useStore as
|
|
5
|
-
import { ModalPortal as
|
|
6
|
-
import { ShowIn as
|
|
7
|
-
import { Question as
|
|
8
|
-
import { Tabs as
|
|
9
|
-
const
|
|
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
|
-
}),
|
|
13
|
+
}), C = ({
|
|
14
14
|
gamification: o,
|
|
15
|
-
className:
|
|
16
|
-
}) => /* @__PURE__ */
|
|
17
|
-
className:
|
|
15
|
+
className: n
|
|
16
|
+
}) => /* @__PURE__ */ t(S, {
|
|
17
|
+
className: n,
|
|
18
18
|
gamification: o
|
|
19
|
-
}),
|
|
19
|
+
}), I = `
|
|
20
|
+
.SDKContainer {
|
|
21
|
+
position: static !important;
|
|
22
|
+
}
|
|
23
|
+
`, G = ({
|
|
20
24
|
gamification: o,
|
|
21
|
-
responsiveStore:
|
|
22
|
-
|
|
25
|
+
responsiveStore: n,
|
|
26
|
+
useContainer: e,
|
|
27
|
+
className: s,
|
|
23
28
|
appNode: r
|
|
24
29
|
}) => {
|
|
25
|
-
const
|
|
30
|
+
const a = i(o.openedQuestion.$store), {
|
|
26
31
|
sdkInDesktopView: m
|
|
27
|
-
} =
|
|
32
|
+
} = i(n, {
|
|
28
33
|
keys: ["sdkInDesktopView"]
|
|
29
34
|
}), {
|
|
30
|
-
hiding:
|
|
31
|
-
onAnimationEnd:
|
|
32
|
-
} =
|
|
33
|
-
return !r.current || !
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
48
|
-
|
|
53
|
+
C as GamificationOverlay,
|
|
54
|
+
G as GamificationOverlayStandalone
|
|
49
55
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { lazy as
|
|
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
|
|
5
|
-
import { GamificationOverlayStandalone as
|
|
6
|
-
const
|
|
7
|
-
const n =
|
|
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
|
-
|
|
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
|
-
},
|
|
16
|
-
|
|
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:
|
|
18
|
+
responsiveStore: l,
|
|
19
19
|
className: t,
|
|
20
|
-
appNode:
|
|
20
|
+
appNode: n,
|
|
21
|
+
useContainer: i,
|
|
21
22
|
gamification: e
|
|
22
23
|
}
|
|
23
24
|
) : null;
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
v as ActiveFeature,
|
|
27
|
+
F as StandaloneFeature
|
|
27
28
|
};
|
|
@@ -1,159 +1,162 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useMastersContext as
|
|
4
|
-
import { scrollIntoAppView as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { r as
|
|
7
|
-
import { useStore as
|
|
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
|
|
10
|
-
import { QuestionTypeData as
|
|
11
|
-
import { Notification as
|
|
12
|
-
import { PredictionResult as
|
|
13
|
-
import { Onboarding as
|
|
14
|
-
import { HiddenContainer as
|
|
15
|
-
const
|
|
16
|
-
const [t,
|
|
17
|
-
|
|
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
|
-
|
|
20
|
-
var
|
|
21
|
-
const o = (
|
|
22
|
-
o &&
|
|
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 =
|
|
25
|
-
|
|
24
|
+
const r = N((o) => {
|
|
25
|
+
c(o);
|
|
26
26
|
}, []);
|
|
27
|
-
return [
|
|
28
|
-
},
|
|
27
|
+
return [e, t, r];
|
|
28
|
+
}, F = ({
|
|
29
29
|
sdk: n,
|
|
30
30
|
notification: t,
|
|
31
|
-
appNode:
|
|
32
|
-
responsiveStore:
|
|
31
|
+
appNode: c,
|
|
32
|
+
responsiveStore: u
|
|
33
33
|
}) => {
|
|
34
|
-
var
|
|
34
|
+
var h, d;
|
|
35
35
|
const {
|
|
36
|
-
sdk:
|
|
37
|
-
} =
|
|
38
|
-
return t.type ===
|
|
39
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
41
|
+
children: /* @__PURE__ */ l(V, {
|
|
42
42
|
...t
|
|
43
43
|
})
|
|
44
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ f(H, {
|
|
45
45
|
style: {
|
|
46
46
|
height: t.hiding ? 0 : o
|
|
47
47
|
},
|
|
48
48
|
hiding: t.hiding,
|
|
49
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ l(Q, {
|
|
50
50
|
style: {
|
|
51
51
|
height: "100%"
|
|
52
52
|
},
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ l(V, {
|
|
54
54
|
...t,
|
|
55
|
-
controlVideo:
|
|
55
|
+
controlVideo: e == null ? void 0 : e.controlVideoPlayer
|
|
56
56
|
})
|
|
57
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ l(U, {}, t.id)]
|
|
58
58
|
})]
|
|
59
|
-
}) : t.type ===
|
|
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:
|
|
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 ===
|
|
68
|
+
}) : t.type === g.ONBOARDING ? /* @__PURE__ */ l(A, {
|
|
69
69
|
style: {
|
|
70
70
|
height: t.hiding ? 0 : o
|
|
71
71
|
},
|
|
72
|
-
saveHeight:
|
|
72
|
+
saveHeight: s,
|
|
73
73
|
sdk: n,
|
|
74
74
|
notification: t,
|
|
75
|
-
appNode:
|
|
76
|
-
responsiveStore:
|
|
75
|
+
appNode: c,
|
|
76
|
+
responsiveStore: u
|
|
77
77
|
}) : null;
|
|
78
|
-
},
|
|
78
|
+
}, L = "p1co32q0", M = ({
|
|
79
79
|
pill: n,
|
|
80
80
|
setPill: t,
|
|
81
|
-
appNode:
|
|
82
|
-
headerNode:
|
|
83
|
-
scrollNode:
|
|
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
|
|
88
|
+
var I, k;
|
|
88
89
|
const {
|
|
89
|
-
screen:
|
|
90
|
-
} =
|
|
90
|
+
screen: h
|
|
91
|
+
} = y(r, {
|
|
91
92
|
keys: ["screen"]
|
|
92
93
|
}), {
|
|
93
|
-
tabsShown:
|
|
94
|
-
scrollPosition:
|
|
95
|
-
} =
|
|
94
|
+
tabsShown: d,
|
|
95
|
+
scrollPosition: m
|
|
96
|
+
} = y(o, {
|
|
96
97
|
keys: ["tabsShown", "scrollPosition"]
|
|
97
98
|
});
|
|
98
|
-
|
|
99
|
-
r.get().sdkInDesktopView
|
|
100
|
-
}, [
|
|
101
|
-
const
|
|
102
|
-
return !n || !
|
|
103
|
-
title: n.type ===
|
|
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
|
|
106
|
-
r.get().sdkInDesktopView ? (
|
|
106
|
+
var w;
|
|
107
|
+
r.get().sdkInDesktopView ? (w = e.current) == null || w.scrollTo({
|
|
107
108
|
top: 0,
|
|
108
109
|
behavior: "smooth"
|
|
109
|
-
}) :
|
|
110
|
+
}) : E(e, h.size, {
|
|
110
111
|
behavior: "smooth"
|
|
111
112
|
}), t(null);
|
|
112
113
|
},
|
|
113
|
-
className:
|
|
114
|
-
}),
|
|
115
|
-
},
|
|
114
|
+
className: T(d && L, "sl-pill-button")
|
|
115
|
+
}), i.current);
|
|
116
|
+
}, ot = ({
|
|
116
117
|
sdk: n,
|
|
117
118
|
headerNode: t,
|
|
118
|
-
scrollNode:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
scrollNode: c,
|
|
120
|
+
useContainer: u,
|
|
121
|
+
responsiveStore: e,
|
|
122
|
+
appNode: r,
|
|
123
|
+
scrollStore: o
|
|
122
124
|
}) => {
|
|
123
|
-
const [
|
|
124
|
-
return
|
|
125
|
-
|
|
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:
|
|
129
|
-
questionType:
|
|
130
|
+
questionId: i.data.questionId,
|
|
131
|
+
questionType: i.data.questionType
|
|
130
132
|
}
|
|
131
133
|
});
|
|
132
|
-
}, [
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
}, [
|
|
137
|
-
|
|
138
|
-
}, [
|
|
139
|
-
children: [!
|
|
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:
|
|
143
|
+
appNode: r,
|
|
142
144
|
sdk: n,
|
|
143
|
-
notification:
|
|
144
|
-
responsiveStore:
|
|
145
|
-
}),
|
|
146
|
-
pill:
|
|
147
|
-
setPill:
|
|
148
|
-
appNode:
|
|
149
|
-
notification:
|
|
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:
|
|
152
|
-
scrollStore:
|
|
153
|
-
|
|
153
|
+
scrollNode: c,
|
|
154
|
+
scrollStore: o,
|
|
155
|
+
useContainer: u,
|
|
156
|
+
responsiveStore: e
|
|
154
157
|
})]
|
|
155
158
|
});
|
|
156
159
|
};
|
|
157
160
|
export {
|
|
158
|
-
|
|
161
|
+
ot as SDKNotifications
|
|
159
162
|
};
|
|
@@ -1,34 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import {
|
|
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
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
const i =
|
|
11
|
-
var
|
|
12
|
-
(
|
|
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
|
-
}, [
|
|
18
|
-
|
|
19
|
-
|
|
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 =
|
|
30
|
-
return t ? /* @__PURE__ */
|
|
20
|
+
const t = r.getFeature(p.GAMES);
|
|
21
|
+
return t ? /* @__PURE__ */ n(a, { gamification: t }) : null;
|
|
31
22
|
};
|
|
32
23
|
export {
|
|
33
|
-
|
|
24
|
+
b as StreamLayerSDKPoints
|
|
34
25
|
};
|
|
@@ -1,90 +1,101 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { SDKContainer as
|
|
4
|
-
import { useSdkScroll as
|
|
5
|
-
import { useSdkFeature as
|
|
6
|
-
import { useAnalyticsListener as
|
|
7
|
-
import { useState as
|
|
8
|
-
import { useStore as
|
|
9
|
-
import { FeatureType as
|
|
10
|
-
import { resetCss as
|
|
11
|
-
import { BetPackOverlay as
|
|
12
|
-
import { ActiveFeature as
|
|
13
|
-
import { SDKHeader as
|
|
14
|
-
import { SDKNotifications as
|
|
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
|
|
17
|
-
import { StreamLayerMastersThemeProvider as
|
|
18
|
-
const
|
|
19
|
-
const [,
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
|
|
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
|
-
|
|
28
|
+
useContainer: m,
|
|
29
|
+
responsiveStore: l,
|
|
29
30
|
className: t,
|
|
30
|
-
appNode:
|
|
31
|
-
feature:
|
|
31
|
+
appNode: r,
|
|
32
|
+
feature: s,
|
|
32
33
|
sdk: e
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
+
a
|
|
35
36
|
) : null;
|
|
36
37
|
}) : null;
|
|
37
|
-
},
|
|
38
|
-
const t =
|
|
39
|
-
return
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
return
|
|
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(
|
|
46
|
+
e.openFeature(b.GAMES);
|
|
46
47
|
});
|
|
47
48
|
});
|
|
48
|
-
}, [e]),
|
|
49
|
+
}, [e]), F(r, { enabled: !0, event: "click", listener: N }), v(() => {
|
|
49
50
|
import("./Features/Gamification/gamification-feature.js");
|
|
50
|
-
}, []), /* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
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:
|
|
58
|
-
headerNode:
|
|
59
|
-
appNode:
|
|
58
|
+
scrollNode: s,
|
|
59
|
+
headerNode: c,
|
|
60
|
+
appNode: r,
|
|
60
61
|
scrollStore: i,
|
|
61
|
-
responsiveStore:
|
|
62
|
+
responsiveStore: a,
|
|
63
|
+
useContainer: t
|
|
62
64
|
}
|
|
63
65
|
),
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
},
|
|
69
|
-
const [
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
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__ */
|
|
75
|
-
|
|
76
|
-
|
|
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:
|
|
90
|
+
onEvent: ({ type: o }) => o === "slOpenGameCenter" ? i() : () => {
|
|
80
91
|
},
|
|
81
92
|
close: () => i()
|
|
82
93
|
}
|
|
83
94
|
),
|
|
84
|
-
!
|
|
95
|
+
!l && /* @__PURE__ */ n(j, { sdk: e, useContainer: r })
|
|
85
96
|
] });
|
|
86
97
|
};
|
|
87
98
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
te as MastersApp,
|
|
100
|
+
ne as StreamLayerMastersThemeProvider
|
|
90
101
|
};
|