@streamlayer/react 1.21.1 → 1.21.2
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/cjs/advertisement.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +14 -14
- package/lib/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +9 -9
- package/lib/classic/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/es/advertisement.js +2 -3
- package/lib/classic/es/index.js +9 -10
- package/lib/classic/es/insight.js +6 -7
- package/lib/classic/es/notification.js +2 -3
- package/lib/classic/es/pause-ad.js +34 -35
- package/lib/classic/es/points.js +2 -3
- package/lib/classic/es/provider.js +2066 -2062
- package/lib/classic/es/useStreamLayerApp2.js +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 +22 -22
- package/lib/dist/es/gamification-feature2.js +71 -72
- package/lib/dist/es/index.js +6 -7
- package/lib/dist/es/masters.js +3089 -3074
- package/lib/es/advertisement.js +2 -3
- package/lib/es/index.js +9 -10
- package/lib/es/insight.js +6 -7
- package/lib/es/notification.js +2 -3
- package/lib/es/pause-ad.js +34 -35
- package/lib/es/points.js +2 -3
- package/lib/es/provider.js +2035 -2020
- package/lib/es/useStreamLayerApp2.js +1 -1
- package/package.json +14 -15
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as p, Fragment as y } from "react/jsx-runtime";
|
|
2
2
|
import { A as C, s as r, B as b, f as M, I as D, a as L, b as T, M as E, u as m, T as P, p as R, k as F, z, c as B, l as U, d as O, S as j, m as q, e as H, n as V, g as Q } from "./masters.js";
|
|
3
|
-
import "@nanostores/react";
|
|
4
3
|
import { useCallback as K, useRef as W, useState as S, useEffect as f } from "react";
|
|
5
4
|
import "nanostores";
|
|
6
5
|
import "react-countdown-circle-timer";
|
|
@@ -8,11 +7,11 @@ import "react-dom";
|
|
|
8
7
|
import "react-countup";
|
|
9
8
|
import "lodash.throttle";
|
|
10
9
|
import _ from "react-infinite-scroller";
|
|
11
|
-
const G = (e,
|
|
12
|
-
const
|
|
10
|
+
const G = (e, t, a) => {
|
|
11
|
+
const n = t >= C.lg && t < C.xl ? 75 : 52;
|
|
13
12
|
e.current && window.scrollTo({
|
|
14
|
-
top: e.current.offsetTop -
|
|
15
|
-
...
|
|
13
|
+
top: e.current.offsetTop - n,
|
|
14
|
+
...a
|
|
16
15
|
});
|
|
17
16
|
}, J = /* @__PURE__ */ r("div")({
|
|
18
17
|
name: "Container",
|
|
@@ -32,8 +31,8 @@ const G = (e, a, t) => {
|
|
|
32
31
|
propsAsIs: !1
|
|
33
32
|
});
|
|
34
33
|
var v = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(v || {});
|
|
35
|
-
const $ = ({ title: e, active:
|
|
36
|
-
/* @__PURE__ */ s($, { title: "Home", active: e === "home", onClick: () =>
|
|
34
|
+
const $ = ({ title: e, active: t, onClick: a }) => /* @__PURE__ */ s(Y, { "data-a": "intr", onClick: a, "data-selected": t, children: /* @__PURE__ */ s(Z, { "data-a": "intr", children: e }) }), ee = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ s(J, { children: /* @__PURE__ */ p(X, { "data-position": e === "home" ? "left" : "right", children: [
|
|
35
|
+
/* @__PURE__ */ s($, { title: "Home", active: e === "home", onClick: () => t(
|
|
37
36
|
"home"
|
|
38
37
|
/* HOME */
|
|
39
38
|
) }),
|
|
@@ -42,7 +41,7 @@ const $ = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-
|
|
|
42
41
|
{
|
|
43
42
|
title: "Friends",
|
|
44
43
|
active: e === "leaderboard",
|
|
45
|
-
onClick: () =>
|
|
44
|
+
onClick: () => t(
|
|
46
45
|
"leaderboard"
|
|
47
46
|
/* LEADERBOARD */
|
|
48
47
|
)
|
|
@@ -52,7 +51,7 @@ const $ = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-
|
|
|
52
51
|
name: "Container",
|
|
53
52
|
class: "c1ux29ft",
|
|
54
53
|
propsAsIs: !1
|
|
55
|
-
}),
|
|
54
|
+
}), ae = () => b, te = /* @__PURE__ */ r(ae())({
|
|
56
55
|
name: "FriendsIcon",
|
|
57
56
|
class: "f10ncfg2",
|
|
58
57
|
propsAsIs: !0
|
|
@@ -60,11 +59,11 @@ const $ = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-
|
|
|
60
59
|
name: "Content",
|
|
61
60
|
class: "c1yc07bd",
|
|
62
61
|
propsAsIs: !1
|
|
63
|
-
}),
|
|
62
|
+
}), ne = /* @__PURE__ */ r("div")({
|
|
64
63
|
name: "Title",
|
|
65
64
|
class: "tj6cq7w",
|
|
66
65
|
propsAsIs: !1
|
|
67
|
-
}),
|
|
66
|
+
}), oe = /* @__PURE__ */ r("div")({
|
|
68
67
|
name: "Description",
|
|
69
68
|
class: "d1ag78xo",
|
|
70
69
|
propsAsIs: !1
|
|
@@ -72,19 +71,19 @@ const $ = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-
|
|
|
72
71
|
name: "ArrowInviteIcon",
|
|
73
72
|
class: "awohrz6",
|
|
74
73
|
propsAsIs: !0
|
|
75
|
-
}), le = ({ title: e, description:
|
|
76
|
-
const [
|
|
74
|
+
}), le = ({ title: e, description: t, onClick: a, className: n }) => {
|
|
75
|
+
const [o] = M({
|
|
77
76
|
type: "invitation",
|
|
78
77
|
action: "sent",
|
|
79
78
|
payload: {
|
|
80
79
|
from: D.TITLE_CARD
|
|
81
80
|
}
|
|
82
81
|
});
|
|
83
|
-
return /* @__PURE__ */ p(se, { "data-a": "intr", onClick:
|
|
84
|
-
/* @__PURE__ */ s(
|
|
82
|
+
return /* @__PURE__ */ p(se, { "data-a": "intr", onClick: o(a), className: n, children: [
|
|
83
|
+
/* @__PURE__ */ s(te, { name: "icon-friends" }),
|
|
85
84
|
/* @__PURE__ */ p(re, { children: [
|
|
86
|
-
/* @__PURE__ */ s(
|
|
87
|
-
/* @__PURE__ */ s(
|
|
85
|
+
/* @__PURE__ */ s(ne, { children: e }),
|
|
86
|
+
/* @__PURE__ */ s(oe, { children: t })
|
|
88
87
|
] }),
|
|
89
88
|
/* @__PURE__ */ s(ce, { name: "icon-copy" })
|
|
90
89
|
] });
|
|
@@ -122,50 +121,50 @@ const $ = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-
|
|
|
122
121
|
propsAsIs: !0
|
|
123
122
|
}), be = ({
|
|
124
123
|
friendsRank: e,
|
|
125
|
-
avatar:
|
|
126
|
-
name:
|
|
127
|
-
userId:
|
|
128
|
-
points:
|
|
124
|
+
avatar: t,
|
|
125
|
+
name: a,
|
|
126
|
+
userId: n,
|
|
127
|
+
points: o,
|
|
129
128
|
isCurrentUser: i,
|
|
130
129
|
style: d
|
|
131
|
-
}) => /* @__PURE__ */ p(de, { "data-name":
|
|
130
|
+
}) => /* @__PURE__ */ p(de, { "data-name": n, style: d, children: [
|
|
132
131
|
/* @__PURE__ */ s(pe, { children: e || 0 }),
|
|
133
132
|
/* @__PURE__ */ p(he, { children: [
|
|
134
|
-
|
|
133
|
+
t ? /* @__PURE__ */ s(me, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ s(ue, { children: L(a || "") }),
|
|
135
134
|
/* @__PURE__ */ p(ve, { children: [
|
|
136
|
-
/* @__PURE__ */ s(Ie, { children:
|
|
135
|
+
/* @__PURE__ */ s(Ie, { children: a || "" }),
|
|
137
136
|
i && /* @__PURE__ */ s(fe, { name: "icon-star" })
|
|
138
137
|
] })
|
|
139
138
|
] }),
|
|
140
|
-
/* @__PURE__ */ s("div", { children: T(
|
|
139
|
+
/* @__PURE__ */ s("div", { children: T(o) })
|
|
141
140
|
] }), Ae = /* @__PURE__ */ r("div")({
|
|
142
141
|
name: "Container",
|
|
143
142
|
class: "c16btbfp",
|
|
144
143
|
propsAsIs: !1
|
|
145
144
|
}), ke = ({
|
|
146
145
|
items: e,
|
|
147
|
-
currentUserId:
|
|
148
|
-
openItemDetail:
|
|
149
|
-
fetchMore:
|
|
150
|
-
scrollNode:
|
|
146
|
+
currentUserId: t,
|
|
147
|
+
openItemDetail: a,
|
|
148
|
+
fetchMore: n,
|
|
149
|
+
scrollNode: o,
|
|
151
150
|
hasMore: i
|
|
152
151
|
}) => {
|
|
153
152
|
const d = K((c) => {
|
|
154
153
|
const l = c.target.getAttribute("data-name");
|
|
155
|
-
l &&
|
|
156
|
-
}, [
|
|
154
|
+
l && a(l);
|
|
155
|
+
}, [a]);
|
|
157
156
|
return /* @__PURE__ */ s(_, {
|
|
158
|
-
loadMore:
|
|
157
|
+
loadMore: n,
|
|
159
158
|
initialLoad: !1,
|
|
160
159
|
hasMore: i,
|
|
161
160
|
useWindow: !1,
|
|
162
|
-
getScrollParent: () =>
|
|
161
|
+
getScrollParent: () => o.current,
|
|
163
162
|
children: /* @__PURE__ */ s(Ae, {
|
|
164
163
|
"data-a": "intr",
|
|
165
164
|
onClick: d,
|
|
166
165
|
children: e.map((c) => /* @__PURE__ */ s(be, {
|
|
167
166
|
...c,
|
|
168
|
-
isCurrentUser: !!
|
|
167
|
+
isCurrentUser: !!t && t === c.userId
|
|
169
168
|
}, c.userId))
|
|
170
169
|
})
|
|
171
170
|
});
|
|
@@ -187,30 +186,30 @@ const $ = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-
|
|
|
187
186
|
propsAsIs: !1
|
|
188
187
|
}), Se = ({
|
|
189
188
|
gamification: e,
|
|
190
|
-
scrollNode:
|
|
191
|
-
scrollStore:
|
|
189
|
+
scrollNode: t,
|
|
190
|
+
scrollStore: a
|
|
192
191
|
}) => {
|
|
193
|
-
const
|
|
194
|
-
data:
|
|
192
|
+
const n = W(null), {
|
|
193
|
+
data: o,
|
|
195
194
|
hasMore: i,
|
|
196
195
|
loading: d,
|
|
197
196
|
key: c
|
|
198
197
|
} = m(e.leaderboardList.$store), {
|
|
199
198
|
data: l
|
|
200
|
-
} = m(e.deepLink.$store), [u, I] = P(
|
|
201
|
-
return !
|
|
199
|
+
} = m(e.deepLink.$store), [u, I] = P(n);
|
|
200
|
+
return !o.length && !d ? /* @__PURE__ */ s($e, {
|
|
202
201
|
deepLink: l
|
|
203
202
|
}) : /* @__PURE__ */ p(y, {
|
|
204
203
|
children: [/* @__PURE__ */ s(ke, {
|
|
205
|
-
items:
|
|
206
|
-
scrollNode:
|
|
207
|
-
scrollStore:
|
|
204
|
+
items: o,
|
|
205
|
+
scrollNode: t,
|
|
206
|
+
scrollStore: a,
|
|
208
207
|
fetchMore: e.leaderboardList.fetchMore,
|
|
209
208
|
hasMore: i,
|
|
210
209
|
openItemDetail: e.openUser,
|
|
211
210
|
currentUserId: e.currentUserId.get()
|
|
212
211
|
}, c), l && /* @__PURE__ */ s(ye, {
|
|
213
|
-
ref:
|
|
212
|
+
ref: n,
|
|
214
213
|
children: /* @__PURE__ */ s(le, {
|
|
215
214
|
"data-a": "intr",
|
|
216
215
|
onClick: () => u(l),
|
|
@@ -219,38 +218,38 @@ const $ = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-
|
|
|
219
218
|
})
|
|
220
219
|
}), I]
|
|
221
220
|
});
|
|
222
|
-
}, Ne = ({ store: e, openQuestion:
|
|
223
|
-
const { sdk:
|
|
224
|
-
return /* @__PURE__ */ s(F, { openQuestion:
|
|
221
|
+
}, Ne = ({ store: e, openQuestion: t }) => {
|
|
222
|
+
const { sdk: a } = R(), n = m(e);
|
|
223
|
+
return /* @__PURE__ */ s(F, { openQuestion: t, questions: n.data, controlVideo: a == null ? void 0 : a.controlVideoPlayer });
|
|
225
224
|
}, we = ({ userSummary: e }) => {
|
|
226
|
-
var
|
|
227
|
-
const [
|
|
225
|
+
var t;
|
|
226
|
+
const [a, n] = S(void 0);
|
|
228
227
|
return f(() => {
|
|
229
|
-
const
|
|
230
|
-
i &&
|
|
228
|
+
const o = e.$store.subscribe((i) => {
|
|
229
|
+
i && n(i);
|
|
231
230
|
});
|
|
232
231
|
return () => {
|
|
233
|
-
|
|
232
|
+
o();
|
|
234
233
|
};
|
|
235
|
-
}, [e]), /* @__PURE__ */ s(z, { loading: !(
|
|
236
|
-
}, xe = ({ gamification: e, className:
|
|
237
|
-
const { tabsShown: c } = m(
|
|
234
|
+
}, [e]), /* @__PURE__ */ s(z, { loading: !(a != null && a.summary), ...a == null ? void 0 : a.summary, successRate: (t = a == null ? void 0 : a.percentage) == null ? void 0 : t.correct });
|
|
235
|
+
}, xe = ({ gamification: e, className: t, scrollStore: a, scrollNode: n, appNode: o, style: i, responsiveStore: d }) => {
|
|
236
|
+
const { tabsShown: c } = m(a, { keys: ["tabsShown"] }), l = m(e.friendsTabEnabled), [u, I] = S(v.HOME), [, N] = B(), { sdkInDesktopView: A, screen: w } = m(d, { keys: ["sdkInDesktopView"] }), x = (h) => {
|
|
238
237
|
N(() => {
|
|
239
238
|
var k;
|
|
240
|
-
I(h), A === !1 && (((k =
|
|
239
|
+
I(h), A === !1 && (((k = o.current) == null ? void 0 : k.getBoundingClientRect().y) || 0) < 0 && G(o, w.size, { behavior: "instant" });
|
|
241
240
|
});
|
|
242
241
|
};
|
|
243
|
-
f(() =>
|
|
242
|
+
f(() => a.subscribe((h) => {
|
|
244
243
|
if (h.scrollPosition === 0) {
|
|
245
|
-
|
|
244
|
+
a.setKey("tabsShown", !0);
|
|
246
245
|
return;
|
|
247
246
|
}
|
|
248
|
-
d.get().sdkInDesktopView ?
|
|
249
|
-
}), [
|
|
247
|
+
d.get().sdkInDesktopView ? a.setKey("tabsShown", h.scrollDirection === "backward") : a.setKey("tabsShown", h.scrollDirection === "forward");
|
|
248
|
+
}), [a, d]), f(() => {
|
|
250
249
|
l || I(v.HOME);
|
|
251
250
|
}, [l]);
|
|
252
251
|
let g = "0px";
|
|
253
|
-
return A ? g = c ? "0px" : "calc(0px - var(--header-height))" : g = c ? "var(--header-height)" : "0px", /* @__PURE__ */ p(U, { className: O(
|
|
252
|
+
return A ? g = c ? "0px" : "calc(0px - var(--header-height))" : g = c ? "var(--header-height)" : "0px", /* @__PURE__ */ p(U, { className: O(t, "SL-Tabs", "sl-hide-on-modal"), style: i, children: [
|
|
254
253
|
l && /* @__PURE__ */ s(
|
|
255
254
|
j,
|
|
256
255
|
{
|
|
@@ -264,23 +263,23 @@ const $ = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-
|
|
|
264
263
|
/* @__PURE__ */ s(q, { children: /* @__PURE__ */ s(H, { children: /* @__PURE__ */ s(we, { userSummary: e.userSummary }) }) }),
|
|
265
264
|
/* @__PURE__ */ s(V, { style: { flex: 1 }, children: /* @__PURE__ */ s(Ne, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
|
|
266
265
|
] }),
|
|
267
|
-
u === v.LEADERBOARD && /* @__PURE__ */ s(Q, { children: /* @__PURE__ */ s(Se, { scrollStore:
|
|
266
|
+
u === v.LEADERBOARD && /* @__PURE__ */ s(Q, { children: /* @__PURE__ */ s(Se, { scrollStore: a, scrollNode: n, gamification: e }) })
|
|
268
267
|
] });
|
|
269
|
-
},
|
|
268
|
+
}, Be = ({
|
|
270
269
|
gamification: e,
|
|
271
|
-
scrollStore:
|
|
272
|
-
className:
|
|
273
|
-
appNode:
|
|
274
|
-
scrollNode:
|
|
270
|
+
scrollStore: t,
|
|
271
|
+
className: a,
|
|
272
|
+
appNode: n,
|
|
273
|
+
scrollNode: o,
|
|
275
274
|
responsiveStore: i
|
|
276
275
|
}) => /* @__PURE__ */ s(xe, {
|
|
277
|
-
appNode:
|
|
278
|
-
scrollStore:
|
|
279
|
-
scrollNode:
|
|
280
|
-
className:
|
|
276
|
+
appNode: n,
|
|
277
|
+
scrollStore: t,
|
|
278
|
+
scrollNode: o,
|
|
279
|
+
className: a,
|
|
281
280
|
gamification: e,
|
|
282
281
|
responsiveStore: i
|
|
283
282
|
});
|
|
284
283
|
export {
|
|
285
|
-
|
|
284
|
+
Be as default
|
|
286
285
|
};
|
package/lib/dist/es/index.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "lodash.throttle";
|
|
3
3
|
import "react";
|
|
4
|
-
import "@nanostores/react";
|
|
5
4
|
import "nanostores";
|
|
6
|
-
import { h as S, j as
|
|
5
|
+
import { h as S, j as p, o as L, r as y, i as n, q as P } from "./masters.js";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
9
8
|
export {
|
|
10
9
|
S as BetPackStandalone,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
p as MastersStreamLayerProvider,
|
|
11
|
+
L as MastersStreamLayerSDKReact,
|
|
12
|
+
y as StreamLayerLogin,
|
|
13
|
+
n as StreamLayerSDKPoints,
|
|
14
|
+
P as useStreamLayer
|
|
16
15
|
};
|