@streamlayer/react 1.14.8 → 1.15.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.
- package/lib/app/bet-pack.d.ts +1 -11
- package/lib/cjs/advertisement.js +2 -2
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/index2.js +3 -3
- package/lib/cjs/masters2.js +2 -2
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +13 -13
- package/lib/cjs/useStreamLayerApp2.js +9 -9
- package/lib/classic/app/bet-pack.d.ts +1 -11
- package/lib/classic/cjs/advertisement.js +2 -2
- package/lib/classic/cjs/bet-pack.js +1 -1
- package/lib/classic/cjs/index2.js +3 -3
- package/lib/classic/cjs/masters2.js +2 -2
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +10 -10
- package/lib/classic/cjs/useStreamLayerApp2.js +9 -9
- package/lib/classic/es/advertisement.js +5 -5
- package/lib/classic/es/bet-pack.js +16 -11
- package/lib/classic/es/index2.js +198 -194
- package/lib/classic/es/masters2.js +18 -18
- package/lib/classic/es/notification.js +49 -48
- package/lib/classic/es/points.js +18 -12
- package/lib/classic/es/provider.js +405 -390
- package/lib/classic/es/useStreamLayerApp2.js +535 -515
- package/lib/classic/masters.d.ts +1 -2
- package/lib/classic/style.css +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +32 -32
- package/lib/dist/es/gamification-feature2.js +91 -89
- package/lib/dist/es/index.js +7 -8
- package/lib/dist/es/masters.js +3114 -3067
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +5 -5
- package/lib/es/bet-pack.js +16 -11
- package/lib/es/index2.js +198 -194
- package/lib/es/masters2.js +18 -18
- package/lib/es/notification.js +49 -48
- package/lib/es/points.js +18 -12
- package/lib/es/provider.js +405 -390
- package/lib/es/useStreamLayerApp2.js +535 -515
- package/lib/masters.d.ts +1 -2
- package/lib/style.css +1 -1
- package/package.json +14 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s, jsxs as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { s as c, m as Y, a as m, A as N, i as V, F as a2, n as l2, o as d2, p as c2, q as p2, g as C2, H as u2, r as m2, t as f2, v as h2, x as j, w as P, l as
|
|
3
|
-
import { useRef as I, useState as _, useEffect as v, createContext as k2, useContext as n2, lazy as w2, useMemo as
|
|
4
|
-
import {
|
|
2
|
+
import { s as c, m as Y, a as m, A as N, i as V, F as a2, n as l2, o as d2, p as c2, q as p2, g as C2, H as u2, r as m2, t as f2, v as h2, x as j, w as P, l as A, k as X, I as g2, y as v2, B as E2, e as L2, N as w, C as M, D as S2, E as _2, G as T2, R as N2, J as b, K as z, L as J, M as e2, c as F, O as I2, Q as b2, S as R2, T as A2, U as y2 } from "./provider.js";
|
|
3
|
+
import { useRef as I, useState as _, useEffect as v, createContext as k2, useContext as n2, lazy as w2, useMemo as y, Suspense as x2, forwardRef as D2, useLayoutEffect as F2, useCallback as $, Component as O2 } from "react";
|
|
4
|
+
import { n as B2 } from "./index2.js";
|
|
5
5
|
import { Q as V2, S as k } from "./useStreamLayerApp2.js";
|
|
6
6
|
const $2 = /* @__PURE__ */ c("div")({
|
|
7
7
|
name: "SDKContainer",
|
|
@@ -215,7 +215,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
215
215
|
})
|
|
216
216
|
});
|
|
217
217
|
}, o0 = w2(() => import("./gamification-feature2.js")), r0 = ({ sdk: n, feature: e, className: t }) => {
|
|
218
|
-
const i =
|
|
218
|
+
const i = y(() => e && e.featureConfig.get().type === k.GAMES ? /* @__PURE__ */ s(Q2, { className: t, sdk: n, feature: e, children: /* @__PURE__ */ s(o0, { className: t, gamification: e }) }) : null, [n, e, t]);
|
|
219
219
|
return /* @__PURE__ */ s(
|
|
220
220
|
x2,
|
|
221
221
|
{
|
|
@@ -247,7 +247,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
247
247
|
}), p0 = "hlc2pcy", C0 = D2(({
|
|
248
248
|
className: n
|
|
249
249
|
}, e) => /* @__PURE__ */ h(l0, {
|
|
250
|
-
className:
|
|
250
|
+
className: A(n, p0),
|
|
251
251
|
children: [/* @__PURE__ */ s(d0, {
|
|
252
252
|
children: /* @__PURE__ */ h(c0, {
|
|
253
253
|
children: [/* @__PURE__ */ s(X, {
|
|
@@ -344,7 +344,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
344
344
|
sdk: a
|
|
345
345
|
}) => {
|
|
346
346
|
var r, d, l, C, u, p, f;
|
|
347
|
-
const E = m(i.friends.getStore()), [S, D] = _(void 0), L =
|
|
347
|
+
const E = m(i.friends.getStore()), [S, D] = _(void 0), L = y(() => {
|
|
348
348
|
var T, R;
|
|
349
349
|
const G = a.getInviter();
|
|
350
350
|
return G ? (R = (T = E.data) == null ? void 0 : T.find(({
|
|
@@ -390,7 +390,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
390
390
|
inviterName: L
|
|
391
391
|
})
|
|
392
392
|
});
|
|
393
|
-
},
|
|
393
|
+
}, A0 = ({
|
|
394
394
|
sdk: n,
|
|
395
395
|
notification: e,
|
|
396
396
|
saveHeight: t,
|
|
@@ -399,7 +399,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
399
399
|
responsiveStore: a
|
|
400
400
|
}) => {
|
|
401
401
|
var r;
|
|
402
|
-
const d = I(null), l = e.data.onboarding, [C, u] = _(l == null ? void 0 : l.instantOpen), p = n.getFeature(k.GAMES), f =
|
|
402
|
+
const d = I(null), l = e.data.onboarding, [C, u] = _(l == null ? void 0 : l.instantOpen), p = n.getFeature(k.GAMES), f = y(() => H == null ? void 0 : H.map(({
|
|
403
403
|
graphicSrc: L
|
|
404
404
|
}) => L), []), {
|
|
405
405
|
screen: E
|
|
@@ -457,7 +457,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
457
457
|
})
|
|
458
458
|
})]
|
|
459
459
|
});
|
|
460
|
-
},
|
|
460
|
+
}, y0 = () => P, k0 = /* @__PURE__ */ c(y0())({
|
|
461
461
|
name: "Container",
|
|
462
462
|
class: "c1f0y7nw",
|
|
463
463
|
propsAsIs: !0
|
|
@@ -530,7 +530,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
530
530
|
hiding: e.hiding,
|
|
531
531
|
...e.data.question,
|
|
532
532
|
mastersApp: !0
|
|
533
|
-
}) : e.type === w.ONBOARDING ? /* @__PURE__ */ s(
|
|
533
|
+
}) : e.type === w.ONBOARDING ? /* @__PURE__ */ s(A0, {
|
|
534
534
|
style: {
|
|
535
535
|
height: e.hiding ? 0 : l
|
|
536
536
|
},
|
|
@@ -576,7 +576,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
576
576
|
behavior: "smooth"
|
|
577
577
|
}), e(null);
|
|
578
578
|
},
|
|
579
|
-
className:
|
|
579
|
+
className: A(p && $0, "sl-pill-button")
|
|
580
580
|
}), E.current);
|
|
581
581
|
}, P0 = ({
|
|
582
582
|
sdk: n,
|
|
@@ -587,7 +587,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
587
587
|
appNode: a,
|
|
588
588
|
scrollStore: r
|
|
589
589
|
}) => {
|
|
590
|
-
const [d] = _(n.getNotificationsStore()), l = m(d), [C, u] = _(null), p =
|
|
590
|
+
const [d] = _(n.getNotificationsStore()), l = m(d), [C, u] = _(null), p = y(() => n.getActiveNotification(), [n, l]);
|
|
591
591
|
return v(() => {
|
|
592
592
|
p && L2.emit("notification", {
|
|
593
593
|
action: "rendered",
|
|
@@ -744,7 +744,7 @@ const $2 = /* @__PURE__ */ c("div")({
|
|
|
744
744
|
`}${z.intermediate("xl", "lg")`
|
|
745
745
|
--header-offset: 0px;
|
|
746
746
|
`}`;
|
|
747
|
-
const z0 = "m1ojpy2l", K0 = ({ children: n, style: e }) => /* @__PURE__ */ s("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ s("div", { className:
|
|
747
|
+
const z0 = "m1ojpy2l", K0 = ({ children: n, style: e }) => /* @__PURE__ */ s("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ s("div", { className: A("masters-theme", z0), style: e, children: n }) }), q0 = ({ sdk: n, className: e }) => {
|
|
748
748
|
const [, t] = I2(n);
|
|
749
749
|
return /* @__PURE__ */ s(r0, { className: e, feature: t, sdk: n });
|
|
750
750
|
}, Q0 = ({ sdk: n, className: e, appNode: t, responsiveStore: i, useContainer: o }) => {
|
|
@@ -777,8 +777,8 @@ const z0 = "m1ojpy2l", K0 = ({ children: n, style: e }) => /* @__PURE__ */ s("di
|
|
|
777
777
|
});
|
|
778
778
|
}, [n]), J(t, { enabled: !0, event: "click", listener: e2 }), v(() => {
|
|
779
779
|
import("./gamification-feature2.js");
|
|
780
|
-
}, []), /* @__PURE__ */ h($2, { className:
|
|
781
|
-
/* @__PURE__ */ s(C0, { className:
|
|
780
|
+
}, []), /* @__PURE__ */ h($2, { className: A("SDKContainer", !e && H2), ref: t, children: [
|
|
781
|
+
/* @__PURE__ */ s(C0, { className: A(F), ref: a }),
|
|
782
782
|
/* @__PURE__ */ h(P2, { className: "sl-hide-on-modal", ref: d, children: [
|
|
783
783
|
C && /* @__PURE__ */ s(
|
|
784
784
|
P0,
|
|
@@ -806,7 +806,7 @@ const z0 = "m1ojpy2l", K0 = ({ children: n, style: e }) => /* @__PURE__ */ s("di
|
|
|
806
806
|
] })
|
|
807
807
|
] });
|
|
808
808
|
}, Y0 = ({ sdk: n, betPack: e, useContainer: t }) => {
|
|
809
|
-
const [i, o] = _(e), a = !!m(n.userId()), r =
|
|
809
|
+
const [i, o] = _(e), a = !!m(n.userId()), r = y(() => ({ sdk: n }), [n]), d = $(() => {
|
|
810
810
|
o(!1);
|
|
811
811
|
const l = n == null ? void 0 : n.getFeature(k.GAMES);
|
|
812
812
|
l == null || l.closeQuestion();
|
|
@@ -844,8 +844,8 @@ const z0 = "m1ojpy2l", K0 = ({ children: n, style: e }) => /* @__PURE__ */ s("di
|
|
|
844
844
|
betPack: n,
|
|
845
845
|
useContainer: e
|
|
846
846
|
}) => {
|
|
847
|
-
const { sdk: t, status: i } = n2(
|
|
848
|
-
return i ===
|
|
847
|
+
const { sdk: t, status: i } = n2(A2);
|
|
848
|
+
return i === y2.UNSET ? (console.error("Wrap app in `StreamLayerProvider`"), null) : t ? /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(K0, { style: { height: "100%" }, children: /* @__PURE__ */ s(Y0, { sdk: t, betPack: n, useContainer: e }) }) }) : null;
|
|
849
849
|
};
|
|
850
850
|
class o1 extends O2 {
|
|
851
851
|
constructor(e) {
|
|
@@ -18,11 +18,11 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
18
18
|
name: "MediaImgRounded",
|
|
19
19
|
class: "myx3xoi",
|
|
20
20
|
propsAsIs: !0
|
|
21
|
-
}), te = () => $,
|
|
21
|
+
}), te = () => $, ie = /* @__PURE__ */ s(te())({
|
|
22
22
|
name: "MediaImgCentered",
|
|
23
23
|
class: "m1bwv0gx",
|
|
24
24
|
propsAsIs: !0
|
|
25
|
-
}),
|
|
25
|
+
}), oe = () => $, ae = /* @__PURE__ */ s(oe())({
|
|
26
26
|
name: "MediaImgInsight",
|
|
27
27
|
class: "mntjanp",
|
|
28
28
|
propsAsIs: !0
|
|
@@ -34,22 +34,22 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
34
34
|
[m.UNSET]: N,
|
|
35
35
|
[m.NONE]: N,
|
|
36
36
|
[m.ROUNDED]: ne,
|
|
37
|
-
[m.CENTERED]:
|
|
37
|
+
[m.CENTERED]: ie,
|
|
38
38
|
[m.TRANSPARENT]: X
|
|
39
39
|
}, b = ({
|
|
40
40
|
src: t,
|
|
41
|
-
imageMode:
|
|
42
|
-
withVideo:
|
|
41
|
+
imageMode: i = m.UNSET,
|
|
42
|
+
withVideo: o,
|
|
43
43
|
fromInsight: a
|
|
44
44
|
}) => {
|
|
45
|
-
if (
|
|
45
|
+
if (i === m.NONE)
|
|
46
46
|
return null;
|
|
47
|
-
const n = a ? ae : re[
|
|
47
|
+
const n = a ? ae : re[i];
|
|
48
48
|
return /* @__PURE__ */ c(n, {
|
|
49
49
|
children: [/* @__PURE__ */ e("img", {
|
|
50
50
|
src: t,
|
|
51
51
|
alt: ""
|
|
52
|
-
}),
|
|
52
|
+
}), o && /* @__PURE__ */ e(ce, {
|
|
53
53
|
children: /* @__PURE__ */ e(u, {
|
|
54
54
|
name: "icon-play"
|
|
55
55
|
})
|
|
@@ -95,7 +95,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
95
95
|
name: "Container",
|
|
96
96
|
class: "ccvukea",
|
|
97
97
|
propsAsIs: !1
|
|
98
|
-
}), ye = ({ image: t, tweet:
|
|
98
|
+
}), ye = ({ image: t, tweet: i, account: o, accountVerified: a, body: n, title: d }) => {
|
|
99
99
|
var l;
|
|
100
100
|
return /* @__PURE__ */ c($e, { children: [
|
|
101
101
|
d && /* @__PURE__ */ e(ve, { children: /* @__PURE__ */ e(he, { children: d }) }),
|
|
@@ -103,38 +103,38 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
103
103
|
L,
|
|
104
104
|
{
|
|
105
105
|
image: t,
|
|
106
|
-
name: (l =
|
|
107
|
-
userName:
|
|
106
|
+
name: (l = i == null ? void 0 : i.meta) == null ? void 0 : l.accountName,
|
|
107
|
+
userName: o,
|
|
108
108
|
verified: a,
|
|
109
|
-
createdTweet:
|
|
109
|
+
createdTweet: i == null ? void 0 : i.date
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
112
|
/* @__PURE__ */ e(Ae, { children: O(n) })
|
|
113
113
|
] });
|
|
114
|
-
}, fe = ({ title: t, questionType:
|
|
114
|
+
}, fe = ({ title: t, questionType: i, questionTypeData: o }) => /* @__PURE__ */ c(M, { children: [
|
|
115
115
|
/* @__PURE__ */ e(
|
|
116
116
|
R,
|
|
117
117
|
{
|
|
118
|
-
questionTypeData:
|
|
119
|
-
questionType:
|
|
118
|
+
questionTypeData: o,
|
|
119
|
+
questionType: i,
|
|
120
120
|
questionStatus: K.UNSET
|
|
121
121
|
}
|
|
122
122
|
),
|
|
123
123
|
t && /* @__PURE__ */ e(pe, { children: t })
|
|
124
124
|
] }), ge = ({ tweet: t }) => t ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ye, { ...t, controlVideo: () => {
|
|
125
|
-
} }) }) : null, Te = ({ action: t, questionType:
|
|
125
|
+
} }) }) : null, Te = ({ action: t, questionType: i, inApp: o, insight: a, tweet: n }) => {
|
|
126
126
|
var d;
|
|
127
|
-
const l = B[
|
|
128
|
-
if (!l || !
|
|
127
|
+
const l = B[i], r = P[i];
|
|
128
|
+
if (!l || !o || !o.notification)
|
|
129
129
|
return null;
|
|
130
|
-
const { title: p, image: I, imageMode: v } =
|
|
130
|
+
const { title: p, image: I, imageMode: v } = o.notification;
|
|
131
131
|
let h = I;
|
|
132
|
-
|
|
133
|
-
const f =
|
|
134
|
-
return /* @__PURE__ */ e(de, { className: "SL_InApp", onClick: t, children: /* @__PURE__ */ c(le, { style: h ? {} : { paddingLeft: "1.5rem" }, children: [
|
|
132
|
+
i === A.TWEET && n != null && n.tweetMedia && (h = n.tweetMedia.image), v === m.NONE && (h = "");
|
|
133
|
+
const f = o.useMediaFromContent && (a == null ? void 0 : a.image), T = i === A.TWEET && ((d = n == null ? void 0 : n.tweetMedia) == null ? void 0 : d.video) || i === A.FACTOID && (a == null ? void 0 : a.video);
|
|
134
|
+
return /* @__PURE__ */ e(de, { "data-a": "intr", className: "SL_InApp", onClick: t, children: /* @__PURE__ */ c(le, { style: h ? {} : { paddingLeft: "1.5rem" }, children: [
|
|
135
135
|
h && !f && /* @__PURE__ */ e(b, { src: h, imageMode: v, withVideo: !!T }),
|
|
136
136
|
f && /* @__PURE__ */ e(b, { src: f, fromInsight: !0, withVideo: !!T }),
|
|
137
|
-
|
|
137
|
+
i === A.TWEET ? /* @__PURE__ */ e(ge, { tweet: n }) : /* @__PURE__ */ e(fe, { questionTypeData: l, questionType: i, title: p }),
|
|
138
138
|
/* @__PURE__ */ e(me, { name: "inapp-button", children: r || "Open" }),
|
|
139
139
|
/* @__PURE__ */ e(Ie, { name: "chevronRight" })
|
|
140
140
|
] }) });
|
|
@@ -176,15 +176,16 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
176
176
|
propsAsIs: !1
|
|
177
177
|
}), je = ({
|
|
178
178
|
open: t,
|
|
179
|
-
close:
|
|
180
|
-
...
|
|
179
|
+
close: i,
|
|
180
|
+
...o
|
|
181
181
|
}) => {
|
|
182
182
|
var a, n;
|
|
183
183
|
return /* @__PURE__ */ c(
|
|
184
184
|
ke,
|
|
185
185
|
{
|
|
186
|
+
"data-a": "intr",
|
|
186
187
|
onClick: () => {
|
|
187
|
-
t == null || t(),
|
|
188
|
+
t == null || t(), o && (o.instantOpen = !0);
|
|
188
189
|
},
|
|
189
190
|
children: [
|
|
190
191
|
/* @__PURE__ */ c(Ne, { children: [
|
|
@@ -200,10 +201,10 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
200
201
|
/* @__PURE__ */ c(Se, { children: [
|
|
201
202
|
/* @__PURE__ */ c(Ee, { children: [
|
|
202
203
|
/* @__PURE__ */ e(Ce, { name: "icon-trophy-solid" }),
|
|
203
|
-
(a =
|
|
204
|
+
(a = o == null ? void 0 : o.titleCard) == null ? void 0 : a.title
|
|
204
205
|
] }),
|
|
205
206
|
/* @__PURE__ */ c(xe, { children: [
|
|
206
|
-
/* @__PURE__ */ e("span", { children: (n =
|
|
207
|
+
/* @__PURE__ */ e("span", { children: (n = o == null ? void 0 : o.titleCard) == null ? void 0 : n.subtitle }),
|
|
207
208
|
/* @__PURE__ */ e(Me, { name: "inapp-button", children: "Play Now" })
|
|
208
209
|
] })
|
|
209
210
|
] }),
|
|
@@ -211,7 +212,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
211
212
|
qe,
|
|
212
213
|
{
|
|
213
214
|
close: (d) => {
|
|
214
|
-
d == null || d.stopPropagation(),
|
|
215
|
+
d == null || d.stopPropagation(), i == null || i();
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
218
|
)
|
|
@@ -248,8 +249,8 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
248
249
|
propsAsIs: !1
|
|
249
250
|
}), Ve = ({
|
|
250
251
|
step: t,
|
|
251
|
-
children:
|
|
252
|
-
answer:
|
|
252
|
+
children: i,
|
|
253
|
+
answer: o,
|
|
253
254
|
state: a = "pending"
|
|
254
255
|
}) => {
|
|
255
256
|
const [n, d] = y(0), [l] = y(() => new ResizeObserver((p) => {
|
|
@@ -272,7 +273,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
272
273
|
minWidth: `${n}px`
|
|
273
274
|
},
|
|
274
275
|
children: /* @__PURE__ */ e(Qe, {
|
|
275
|
-
children:
|
|
276
|
+
children: i
|
|
276
277
|
}, t)
|
|
277
278
|
}), /* @__PURE__ */ e(Ue, {
|
|
278
279
|
ref: r,
|
|
@@ -280,7 +281,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
280
281
|
children: /* @__PURE__ */ c("div", {
|
|
281
282
|
children: [/* @__PURE__ */ e(Le, {
|
|
282
283
|
name: "icon-check"
|
|
283
|
-
}), "Your Pick: ",
|
|
284
|
+
}), "Your Pick: ", o]
|
|
284
285
|
})
|
|
285
286
|
})]
|
|
286
287
|
});
|
|
@@ -332,16 +333,16 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
332
333
|
name: "Caption",
|
|
333
334
|
class: "c1c8xjus",
|
|
334
335
|
propsAsIs: !1
|
|
335
|
-
}),
|
|
336
|
+
}), is = /* @__PURE__ */ s("div")({
|
|
336
337
|
name: "Title",
|
|
337
338
|
class: "t1d1uekn",
|
|
338
339
|
propsAsIs: !1
|
|
339
|
-
}),
|
|
340
|
+
}), os = ({
|
|
340
341
|
title: t
|
|
341
342
|
}) => /* @__PURE__ */ c(ns, {
|
|
342
343
|
children: [/* @__PURE__ */ e(ts, {
|
|
343
344
|
children: "Results for"
|
|
344
|
-
}), /* @__PURE__ */ e(
|
|
345
|
+
}), /* @__PURE__ */ e(is, {
|
|
345
346
|
children: t
|
|
346
347
|
})]
|
|
347
348
|
}), j = /* @__PURE__ */ s("div")({
|
|
@@ -412,11 +413,11 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
412
413
|
2: 4e3,
|
|
413
414
|
3: 4e3,
|
|
414
415
|
4: 4e3
|
|
415
|
-
}, hs = ({ close: t, action:
|
|
416
|
+
}, hs = ({ close: t, action: i, setStep: o, votedAnswer: a, correct: n, correctAnswerTitle: d, questionTitle: l, step: r }) => {
|
|
416
417
|
if (x(() => {
|
|
417
|
-
if (
|
|
418
|
+
if (o) {
|
|
418
419
|
const I = setTimeout(() => {
|
|
419
|
-
S[r + 1] && (n || r < 3) ?
|
|
420
|
+
S[r + 1] && (n || r < 3) ? o(r + 1) : t == null || t();
|
|
420
421
|
}, S[r]);
|
|
421
422
|
return () => {
|
|
422
423
|
I && clearTimeout(I);
|
|
@@ -424,26 +425,26 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
424
425
|
}
|
|
425
426
|
return () => {
|
|
426
427
|
};
|
|
427
|
-
}, [
|
|
428
|
+
}, [o, r, t, n]), r === 1)
|
|
428
429
|
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(ss, {}) }) });
|
|
429
430
|
let p = "pending";
|
|
430
|
-
return (r === 3 || r === 4) && (p = n ? "correct" : "incorrect"), /* @__PURE__ */ e(w, { onClick: () =>
|
|
431
|
+
return (r === 3 || r === 4) && (p = n ? "correct" : "incorrect"), /* @__PURE__ */ e(w, { "data-a": "intr", onClick: () => i == null ? void 0 : i(), children: /* @__PURE__ */ c(q, { children: [
|
|
431
432
|
r !== 1 && /* @__PURE__ */ e(He, {}, r),
|
|
432
433
|
/* @__PURE__ */ c(Ve, { state: p, step: r, answer: (a == null ? void 0 : a.title) || "unknown", children: [
|
|
433
|
-
r === 2 && /* @__PURE__ */ e(
|
|
434
|
+
r === 2 && /* @__PURE__ */ e(os, { title: l || "unknown" }),
|
|
434
435
|
r === 3 && n && /* @__PURE__ */ e(ls, {}),
|
|
435
436
|
r === 3 && !n && /* @__PURE__ */ e(ds, { title: d || "unknown" }),
|
|
436
437
|
r === 4 && /* @__PURE__ */ e(vs, { points: (a == null ? void 0 : a.points) || 0 })
|
|
437
438
|
] })
|
|
438
439
|
] }) });
|
|
439
|
-
}, As = ({ close: t, action:
|
|
440
|
+
}, As = ({ close: t, action: i, votedAnswer: o, correct: a, correctAnswerTitle: n, questionTitle: d }) => {
|
|
440
441
|
const [l, r] = y(1);
|
|
441
442
|
return /* @__PURE__ */ e(
|
|
442
443
|
hs,
|
|
443
444
|
{
|
|
444
445
|
close: t,
|
|
445
|
-
action:
|
|
446
|
-
votedAnswer:
|
|
446
|
+
action: i,
|
|
447
|
+
votedAnswer: o,
|
|
447
448
|
correct: a,
|
|
448
449
|
correctAnswerTitle: n,
|
|
449
450
|
questionTitle: d,
|
|
@@ -457,7 +458,7 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
457
458
|
class: "n1i4h28u",
|
|
458
459
|
propsAsIs: !1
|
|
459
460
|
}), ys = (t) => /* @__PURE__ */ e($s, { children: /* @__PURE__ */ e(As, { ...t }) }), fs = ({ sdk: t }) => {
|
|
460
|
-
const [
|
|
461
|
+
const [i] = y(t.getNotificationsStore()), o = V(i), a = t.getFeature(Z.GAMES), n = E(() => t.getActiveNotification(), [t, o]);
|
|
461
462
|
return x(() => {
|
|
462
463
|
n && F.emit("notification", {
|
|
463
464
|
action: "rendered",
|
|
@@ -475,8 +476,8 @@ const $ = /* @__PURE__ */ s("div")({
|
|
|
475
476
|
}
|
|
476
477
|
) : null : n && n.type === k.ONBOARDING ? n.data.onboarding ? /* @__PURE__ */ e(je, { open: a == null ? void 0 : a.openFeature, close: n.close, ...n.data.onboarding }) : null : n && /* @__PURE__ */ e(Te, { ...n.data, action: n.action });
|
|
477
478
|
}, bs = ({ theme: t }) => {
|
|
478
|
-
const
|
|
479
|
-
return
|
|
479
|
+
const i = W(), o = G(), a = Y();
|
|
480
|
+
return i && (a.appNotification || a.onboardingNotification) ? a.app && !a.onboardingNotification ? null : /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(_, { customTheme: t ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ e(fs, { sdk: i }) }) }) : null;
|
|
480
481
|
};
|
|
481
482
|
export {
|
|
482
483
|
bs as StreamLayerSDKNotification,
|
package/lib/classic/es/points.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useEffect as d } from "react";
|
|
3
|
-
import { s as a, k as h, c as y, d as S, a as f, F as
|
|
3
|
+
import { s as a, k as h, c as y, d as S, a as f, F as p, e as r, u as v, b as k, h as g } from "./provider.js";
|
|
4
4
|
import { S as b } from "./useStreamLayerApp2.js";
|
|
5
5
|
const A = /* @__PURE__ */ a("div")({
|
|
6
6
|
name: "PointsContainer",
|
|
@@ -33,23 +33,29 @@ const A = /* @__PURE__ */ a("div")({
|
|
|
33
33
|
/* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(S, { value: s }) })
|
|
34
34
|
] })
|
|
35
35
|
] }), j = ({ gamification: s }) => {
|
|
36
|
-
const e = s.userSummary.$store, [
|
|
36
|
+
const e = s.userSummary.$store, [n, m] = u(0);
|
|
37
37
|
return d(() => {
|
|
38
|
-
const
|
|
39
|
-
var
|
|
40
|
-
(
|
|
38
|
+
const o = e.subscribe((i) => {
|
|
39
|
+
var c;
|
|
40
|
+
(c = i == null ? void 0 : i.summary) != null && c.points && m(i.summary.points);
|
|
41
41
|
});
|
|
42
42
|
return () => {
|
|
43
|
-
|
|
43
|
+
o();
|
|
44
44
|
};
|
|
45
|
-
}, [e]), /* @__PURE__ */ t(C, { points:
|
|
46
|
-
const
|
|
47
|
-
|
|
45
|
+
}, [e]), /* @__PURE__ */ t(C, { points: n, onClick: () => {
|
|
46
|
+
const o = s.status.get();
|
|
47
|
+
o === p.Suspended ? (s.openFeature(), r.emit("app", {
|
|
48
48
|
action: "open",
|
|
49
49
|
payload: {}
|
|
50
|
-
})
|
|
50
|
+
}), r.emit("interactions", {
|
|
51
|
+
action: "tap",
|
|
52
|
+
payload: {}
|
|
53
|
+
})) : o === p.Ready && (s.closeFeature(!1), r.emit("app", {
|
|
51
54
|
action: "close",
|
|
52
55
|
payload: {}
|
|
56
|
+
}), r.emit("interactions", {
|
|
57
|
+
action: "tap",
|
|
58
|
+
payload: {}
|
|
53
59
|
}));
|
|
54
60
|
} });
|
|
55
61
|
}, M = ({ sdk: s }) => {
|
|
@@ -58,8 +64,8 @@ const A = /* @__PURE__ */ a("div")({
|
|
|
58
64
|
const e = s.getFeature(b.GAMES);
|
|
59
65
|
return e ? /* @__PURE__ */ t(j, { gamification: e }) : null;
|
|
60
66
|
}, K = ({ theme: s }) => {
|
|
61
|
-
const e = v(),
|
|
62
|
-
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(g, { customTheme: s ??
|
|
67
|
+
const e = v(), n = k();
|
|
68
|
+
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(g, { customTheme: s ?? n.theme, themeMode: n.themeMode, children: /* @__PURE__ */ t(M, { sdk: e }) }) }) : null;
|
|
63
69
|
};
|
|
64
70
|
export {
|
|
65
71
|
K as StreamLayerSDKPoints
|