@streamlayer/react 1.12.1 → 1.13.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/app.d.ts +1 -0
- package/lib/app/masters.d.ts +11 -18
- package/lib/app/provider.d.ts +2 -0
- package/lib/app/useStreamLayerApp.d.ts +3 -1
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -1
- package/lib/cjs/index2.js +6 -2
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +3 -3
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +28 -162
- package/lib/cjs/useStreamLayerApp2.js +9 -9
- package/lib/classic/app/app.d.ts +1 -0
- package/lib/classic/app/masters.d.ts +11 -18
- package/lib/classic/app/provider.d.ts +2 -0
- package/lib/classic/app/useStreamLayerApp.d.ts +3 -1
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/bet-pack.js +1 -1
- package/lib/classic/cjs/gamification-feature2.js +1 -1
- package/lib/classic/cjs/index2.js +6 -2
- package/lib/classic/cjs/masters.js +1 -1
- package/lib/classic/cjs/masters2.js +3 -3
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +28 -162
- package/lib/classic/cjs/useStreamLayerApp2.js +9 -9
- package/lib/classic/es/advertisement.js +30 -30
- package/lib/classic/es/bet-pack.js +1 -1
- package/lib/classic/es/gamification-feature2.js +1 -1
- package/lib/classic/es/index.js +1 -1
- package/lib/classic/es/index2.js +1160 -1055
- package/lib/classic/es/masters.js +5 -4
- package/lib/classic/es/masters2.js +467 -580
- package/lib/classic/es/notification.js +42 -42
- package/lib/classic/es/points.js +5 -5
- package/lib/classic/es/provider.js +8535 -22157
- package/lib/classic/es/useStreamLayerApp2.js +2321 -2232
- package/lib/classic/style.css +1 -1
- package/lib/dist/cjs/gamification-feature.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 +53 -183
- package/lib/dist/es/gamification-feature.js +1 -1
- package/lib/dist/es/gamification-feature2.js +231 -77
- package/lib/dist/es/index.js +3 -2
- package/lib/dist/es/masters.js +19314 -32998
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +30 -30
- package/lib/es/bet-pack.js +1 -1
- package/lib/es/gamification-feature2.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/index2.js +1160 -1055
- package/lib/es/masters.js +5 -4
- package/lib/es/masters2.js +467 -580
- package/lib/es/notification.js +42 -42
- package/lib/es/points.js +5 -5
- package/lib/es/provider.js +8524 -22146
- package/lib/es/useStreamLayerApp2.js +2321 -2232
- package/lib/style.css +1 -1
- package/package.json +17 -15
|
@@ -1,123 +1,277 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useRef as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { a as C, s as r, Z as b, g as M, I as D, b as L, c as T, d as E, M as P, u as m, T as R, p as F, k as z, z as U, e as O, l as j, f as q, S as B, m as H, h as V, n as Q, C as K } from "./masters.js";
|
|
3
|
+
import { useCallback as W, useRef as _, useState as y, useEffect as f } from "react";
|
|
4
|
+
const Z = (e, a, n) => {
|
|
5
|
+
const o = a >= C.lg && a < C.xl ? 75 : 52;
|
|
6
6
|
e.current && window.scrollTo({
|
|
7
|
-
top: e.current.offsetTop -
|
|
8
|
-
...
|
|
7
|
+
top: e.current.offsetTop - o,
|
|
8
|
+
...n
|
|
9
9
|
});
|
|
10
|
-
},
|
|
10
|
+
}, G = /* @__PURE__ */ r("div")({
|
|
11
|
+
name: "Container",
|
|
12
|
+
class: "c115qtkr",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), J = /* @__PURE__ */ r("div")({
|
|
15
|
+
name: "STabs",
|
|
16
|
+
class: "sxnslc8",
|
|
17
|
+
propsAsIs: !1
|
|
18
|
+
}), X = /* @__PURE__ */ r("button")({
|
|
19
|
+
name: "Button",
|
|
20
|
+
class: "b1umzux0",
|
|
21
|
+
propsAsIs: !1
|
|
22
|
+
}), Y = /* @__PURE__ */ r("span")({
|
|
23
|
+
name: "Title",
|
|
24
|
+
class: "tspsaas",
|
|
25
|
+
propsAsIs: !1
|
|
26
|
+
});
|
|
27
|
+
var v = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(v || {});
|
|
28
|
+
const $ = ({ title: e, active: a, onClick: n }) => /* @__PURE__ */ s(X, { onClick: n, "data-selected": a, children: /* @__PURE__ */ s(Y, { children: e }) }), ee = ({ activePage: e = "home", toggleActivePage: a }) => /* @__PURE__ */ s(G, { children: /* @__PURE__ */ p(J, { "data-position": e === "home" ? "left" : "right", children: [
|
|
29
|
+
/* @__PURE__ */ s($, { title: "Home", active: e === "home", onClick: () => a(
|
|
30
|
+
"home"
|
|
31
|
+
/* HOME */
|
|
32
|
+
) }),
|
|
33
|
+
/* @__PURE__ */ s(
|
|
34
|
+
$,
|
|
35
|
+
{
|
|
36
|
+
title: "Friends",
|
|
37
|
+
active: e === "leaderboard",
|
|
38
|
+
onClick: () => a(
|
|
39
|
+
"leaderboard"
|
|
40
|
+
/* LEADERBOARD */
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }) }), se = /* @__PURE__ */ r("div")({
|
|
45
|
+
name: "Container",
|
|
46
|
+
class: "c1ux29ft",
|
|
47
|
+
propsAsIs: !1
|
|
48
|
+
}), ne = () => b, ae = /* @__PURE__ */ r(ne())({
|
|
49
|
+
name: "FriendsIcon",
|
|
50
|
+
class: "f10ncfg2",
|
|
51
|
+
propsAsIs: !0
|
|
52
|
+
}), re = /* @__PURE__ */ r("div")({
|
|
53
|
+
name: "Content",
|
|
54
|
+
class: "c1yc07bd",
|
|
55
|
+
propsAsIs: !1
|
|
56
|
+
}), oe = /* @__PURE__ */ r("div")({
|
|
57
|
+
name: "Title",
|
|
58
|
+
class: "tj6cq7w",
|
|
59
|
+
propsAsIs: !1
|
|
60
|
+
}), te = /* @__PURE__ */ r("div")({
|
|
61
|
+
name: "Description",
|
|
62
|
+
class: "d1ag78xo",
|
|
63
|
+
propsAsIs: !1
|
|
64
|
+
}), ie = () => b, ce = /* @__PURE__ */ r(ie())({
|
|
65
|
+
name: "ArrowInviteIcon",
|
|
66
|
+
class: "awohrz6",
|
|
67
|
+
propsAsIs: !0
|
|
68
|
+
}), le = ({ title: e, description: a, onClick: n, className: o }) => {
|
|
69
|
+
const [t] = M({
|
|
70
|
+
type: "invitation",
|
|
71
|
+
action: "sent",
|
|
72
|
+
payload: {
|
|
73
|
+
from: D.TITLE_CARD
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return /* @__PURE__ */ p(se, { onClick: t(n), className: o, children: [
|
|
77
|
+
/* @__PURE__ */ s(ae, { name: "icon-friends" }),
|
|
78
|
+
/* @__PURE__ */ p(re, { children: [
|
|
79
|
+
/* @__PURE__ */ s(oe, { children: e }),
|
|
80
|
+
/* @__PURE__ */ s(te, { children: a })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ s(ce, { name: "icon-copy" })
|
|
83
|
+
] });
|
|
84
|
+
}, de = /* @__PURE__ */ r("div")({
|
|
85
|
+
name: "Container",
|
|
86
|
+
class: "culdu4a",
|
|
87
|
+
propsAsIs: !1
|
|
88
|
+
}), pe = /* @__PURE__ */ r("div")({
|
|
89
|
+
name: "Position",
|
|
90
|
+
class: "pwf8e69",
|
|
91
|
+
propsAsIs: !1
|
|
92
|
+
}), me = /* @__PURE__ */ r("img")({
|
|
93
|
+
name: "Avatar",
|
|
94
|
+
class: "atf4yh4",
|
|
95
|
+
propsAsIs: !1
|
|
96
|
+
}), ue = /* @__PURE__ */ r("div")({
|
|
97
|
+
name: "AvatarPlaceholder",
|
|
98
|
+
class: "a1dg29ja",
|
|
99
|
+
propsAsIs: !1
|
|
100
|
+
}), he = /* @__PURE__ */ r("div")({
|
|
101
|
+
name: "Content",
|
|
102
|
+
class: "c10a68rc",
|
|
103
|
+
propsAsIs: !1
|
|
104
|
+
}), ve = /* @__PURE__ */ r("div")({
|
|
105
|
+
name: "NameContainer",
|
|
106
|
+
class: "nc4kck5",
|
|
107
|
+
propsAsIs: !1
|
|
108
|
+
}), Ie = /* @__PURE__ */ r("span")({
|
|
109
|
+
name: "Name",
|
|
110
|
+
class: "njsrqgr",
|
|
111
|
+
propsAsIs: !1
|
|
112
|
+
}), ge = () => b, fe = /* @__PURE__ */ r(ge())({
|
|
113
|
+
name: "CurrentUserBadge",
|
|
114
|
+
class: "c17uc4zr",
|
|
115
|
+
propsAsIs: !0
|
|
116
|
+
}), be = ({
|
|
117
|
+
friendsRank: e,
|
|
118
|
+
avatar: a,
|
|
119
|
+
name: n,
|
|
120
|
+
userId: o,
|
|
121
|
+
points: t,
|
|
122
|
+
isCurrentUser: i,
|
|
123
|
+
style: d
|
|
124
|
+
}) => /* @__PURE__ */ p(de, { "data-name": o, style: d, children: [
|
|
125
|
+
/* @__PURE__ */ s(pe, { children: e || 0 }),
|
|
126
|
+
/* @__PURE__ */ p(he, { children: [
|
|
127
|
+
a ? /* @__PURE__ */ s(me, { alt: "leaderboard-item-avatar", src: a }) : /* @__PURE__ */ s(ue, { children: L(n || "") }),
|
|
128
|
+
/* @__PURE__ */ p(ve, { children: [
|
|
129
|
+
/* @__PURE__ */ s(Ie, { children: n || "" }),
|
|
130
|
+
i && /* @__PURE__ */ s(fe, { name: "icon-star" })
|
|
131
|
+
] })
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ s("div", { children: T(t) })
|
|
134
|
+
] }), Ae = /* @__PURE__ */ r("div")({
|
|
135
|
+
name: "Container",
|
|
136
|
+
class: "c16btbfp",
|
|
137
|
+
propsAsIs: !1
|
|
138
|
+
}), ke = ({
|
|
139
|
+
items: e,
|
|
140
|
+
currentUserId: a,
|
|
141
|
+
openItemDetail: n,
|
|
142
|
+
fetchMore: o,
|
|
143
|
+
scrollNode: t,
|
|
144
|
+
hasMore: i
|
|
145
|
+
}) => {
|
|
146
|
+
const d = W((c) => {
|
|
147
|
+
const l = c.target.getAttribute("data-name");
|
|
148
|
+
l && n(l);
|
|
149
|
+
}, [n]);
|
|
150
|
+
return /* @__PURE__ */ s(E, {
|
|
151
|
+
loadMore: o,
|
|
152
|
+
initialLoad: !1,
|
|
153
|
+
hasMore: i,
|
|
154
|
+
useWindow: !1,
|
|
155
|
+
getScrollParent: () => t.current,
|
|
156
|
+
children: /* @__PURE__ */ s(Ae, {
|
|
157
|
+
onClick: d,
|
|
158
|
+
children: e.map((c) => /* @__PURE__ */ s(be, {
|
|
159
|
+
...c,
|
|
160
|
+
isCurrentUser: !!a && a === c.userId
|
|
161
|
+
}, c.userId))
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
}, Ce = /* @__PURE__ */ r("div")({
|
|
11
165
|
name: "InviteFriendsContainer",
|
|
12
166
|
class: "i1c9dygq",
|
|
13
167
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
168
|
+
}), $e = ({
|
|
15
169
|
deepLink: e
|
|
16
|
-
}) => /* @__PURE__ */ s(
|
|
17
|
-
children: /* @__PURE__ */ s(
|
|
170
|
+
}) => /* @__PURE__ */ s(Ce, {
|
|
171
|
+
children: /* @__PURE__ */ s(P, {
|
|
18
172
|
inviteLink: e,
|
|
19
173
|
inviteCardTitle: "It’s More Fun With Friends",
|
|
20
174
|
inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
|
|
21
175
|
})
|
|
22
|
-
}),
|
|
176
|
+
}), Se = /* @__PURE__ */ r("div")({
|
|
23
177
|
name: "InviteLinkContainer",
|
|
24
178
|
class: "i1odbhm4",
|
|
25
179
|
propsAsIs: !1
|
|
26
|
-
}),
|
|
180
|
+
}), ye = ({
|
|
27
181
|
gamification: e,
|
|
28
|
-
scrollNode:
|
|
29
|
-
scrollStore:
|
|
182
|
+
scrollNode: a,
|
|
183
|
+
scrollStore: n
|
|
30
184
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
data:
|
|
185
|
+
const o = _(null), {
|
|
186
|
+
data: t,
|
|
33
187
|
hasMore: i,
|
|
34
|
-
loading:
|
|
35
|
-
key:
|
|
36
|
-
} =
|
|
37
|
-
data:
|
|
38
|
-
} =
|
|
39
|
-
return !
|
|
40
|
-
deepLink:
|
|
41
|
-
}) : /* @__PURE__ */
|
|
42
|
-
children: [/* @__PURE__ */ s(
|
|
43
|
-
items:
|
|
44
|
-
scrollNode:
|
|
45
|
-
scrollStore:
|
|
188
|
+
loading: d,
|
|
189
|
+
key: c
|
|
190
|
+
} = m(e.leaderboardList.$store), {
|
|
191
|
+
data: l
|
|
192
|
+
} = m(e.deepLink.$store), [u, I] = R(o);
|
|
193
|
+
return !t.length && !d ? /* @__PURE__ */ s($e, {
|
|
194
|
+
deepLink: l
|
|
195
|
+
}) : /* @__PURE__ */ p(S, {
|
|
196
|
+
children: [/* @__PURE__ */ s(ke, {
|
|
197
|
+
items: t,
|
|
198
|
+
scrollNode: a,
|
|
199
|
+
scrollStore: n,
|
|
46
200
|
fetchMore: e.leaderboardList.fetchMore,
|
|
47
201
|
hasMore: i,
|
|
48
202
|
openItemDetail: e.openUser,
|
|
49
203
|
currentUserId: e.currentUserId.get()
|
|
50
|
-
},
|
|
51
|
-
ref:
|
|
52
|
-
children: /* @__PURE__ */ s(
|
|
53
|
-
onClick: () =>
|
|
204
|
+
}, c), l && /* @__PURE__ */ s(Se, {
|
|
205
|
+
ref: o,
|
|
206
|
+
children: /* @__PURE__ */ s(le, {
|
|
207
|
+
onClick: () => u(l),
|
|
54
208
|
title: "Invite Friends",
|
|
55
209
|
description: "Challenge them now!"
|
|
56
210
|
})
|
|
57
|
-
}),
|
|
211
|
+
}), I]
|
|
58
212
|
});
|
|
59
|
-
},
|
|
60
|
-
const { sdk:
|
|
61
|
-
return /* @__PURE__ */ s(
|
|
62
|
-
},
|
|
63
|
-
var
|
|
64
|
-
const [
|
|
65
|
-
return
|
|
66
|
-
const
|
|
67
|
-
i &&
|
|
213
|
+
}, Ne = ({ store: e, openQuestion: a }) => {
|
|
214
|
+
const { sdk: n } = F(), o = m(e);
|
|
215
|
+
return /* @__PURE__ */ s(z, { openQuestion: a, questions: o.data, controlVideo: n == null ? void 0 : n.controlVideoPlayer });
|
|
216
|
+
}, we = ({ userSummary: e }) => {
|
|
217
|
+
var a;
|
|
218
|
+
const [n, o] = y(void 0);
|
|
219
|
+
return f(() => {
|
|
220
|
+
const t = e.$store.subscribe((i) => {
|
|
221
|
+
i && o(i);
|
|
68
222
|
});
|
|
69
223
|
return () => {
|
|
70
|
-
|
|
224
|
+
t();
|
|
71
225
|
};
|
|
72
|
-
}, [e]), /* @__PURE__ */ s(
|
|
73
|
-
},
|
|
74
|
-
const { tabsShown:
|
|
226
|
+
}, [e]), /* @__PURE__ */ s(U, { loading: !(n != null && n.summary), ...n == null ? void 0 : n.summary, successRate: (a = n == null ? void 0 : n.percentage) == null ? void 0 : a.correct });
|
|
227
|
+
}, xe = ({ gamification: e, className: a, scrollStore: n, scrollNode: o, appNode: t, style: i, responsiveStore: d }) => {
|
|
228
|
+
const { tabsShown: c } = m(n, { keys: ["tabsShown"] }), l = m(e.friendsTabEnabled), [u, I] = y(v.HOME), [, N] = O(), { sdkInDesktopView: A, screen: w } = m(d, { keys: ["sdkInDesktopView"] }), x = (h) => {
|
|
75
229
|
N(() => {
|
|
76
|
-
var
|
|
77
|
-
|
|
230
|
+
var k;
|
|
231
|
+
I(h), A === !1 && (((k = t.current) == null ? void 0 : k.getBoundingClientRect().y) || 0) < 0 && Z(t, w.size, { behavior: "instant" });
|
|
78
232
|
});
|
|
79
233
|
};
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
|
|
234
|
+
f(() => n.subscribe((h) => {
|
|
235
|
+
if (h.scrollPosition === 0) {
|
|
236
|
+
n.setKey("tabsShown", !0);
|
|
83
237
|
return;
|
|
84
238
|
}
|
|
85
|
-
|
|
86
|
-
}), [
|
|
87
|
-
|
|
88
|
-
}, [
|
|
89
|
-
let
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
239
|
+
d.get().sdkInDesktopView ? n.setKey("tabsShown", h.scrollDirection === "backward") : n.setKey("tabsShown", h.scrollDirection === "forward");
|
|
240
|
+
}), [n, d]), f(() => {
|
|
241
|
+
l || I(v.HOME);
|
|
242
|
+
}, [l]);
|
|
243
|
+
let g = "0px";
|
|
244
|
+
return A ? g = c ? "0px" : "calc(0px - var(--header-height))" : g = c ? "var(--header-height)" : "0px", /* @__PURE__ */ p(j, { className: q(a, "SL-Tabs"), style: i, children: [
|
|
245
|
+
l && /* @__PURE__ */ s(
|
|
246
|
+
B,
|
|
93
247
|
{
|
|
94
248
|
style: {
|
|
95
|
-
top:
|
|
249
|
+
top: g
|
|
96
250
|
},
|
|
97
|
-
children: /* @__PURE__ */ s(
|
|
251
|
+
children: /* @__PURE__ */ s(ee, { activePage: u, toggleActivePage: x })
|
|
98
252
|
}
|
|
99
253
|
),
|
|
100
|
-
|
|
101
|
-
/* @__PURE__ */ s(
|
|
102
|
-
/* @__PURE__ */ s(
|
|
254
|
+
u === v.HOME && /* @__PURE__ */ p(S, { children: [
|
|
255
|
+
/* @__PURE__ */ s(H, { children: /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(we, { userSummary: e.userSummary }) }) }),
|
|
256
|
+
/* @__PURE__ */ s(Q, { style: { flex: 1 }, children: /* @__PURE__ */ s(Ne, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
|
|
103
257
|
] }),
|
|
104
|
-
|
|
258
|
+
u === v.LEADERBOARD && /* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(ye, { scrollStore: n, scrollNode: o, gamification: e }) })
|
|
105
259
|
] });
|
|
106
|
-
},
|
|
260
|
+
}, Te = ({
|
|
107
261
|
gamification: e,
|
|
108
|
-
scrollStore:
|
|
109
|
-
className:
|
|
110
|
-
appNode:
|
|
111
|
-
scrollNode:
|
|
262
|
+
scrollStore: a,
|
|
263
|
+
className: n,
|
|
264
|
+
appNode: o,
|
|
265
|
+
scrollNode: t,
|
|
112
266
|
responsiveStore: i
|
|
113
|
-
}) => /* @__PURE__ */ s(
|
|
114
|
-
appNode:
|
|
115
|
-
scrollStore:
|
|
116
|
-
scrollNode:
|
|
117
|
-
className:
|
|
267
|
+
}) => /* @__PURE__ */ s(xe, {
|
|
268
|
+
appNode: o,
|
|
269
|
+
scrollStore: a,
|
|
270
|
+
scrollNode: t,
|
|
271
|
+
className: n,
|
|
118
272
|
gamification: e,
|
|
119
273
|
responsiveStore: i
|
|
120
274
|
});
|
|
121
275
|
export {
|
|
122
|
-
|
|
276
|
+
Te as default
|
|
123
277
|
};
|
package/lib/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { B as s,
|
|
2
|
+
import { B as s, i as o, o as m, q as S, t as i, j as L, r as y } from "./masters.js";
|
|
3
3
|
import "react";
|
|
4
4
|
export {
|
|
5
5
|
s as BetPack,
|
|
@@ -7,5 +7,6 @@ export {
|
|
|
7
7
|
m as MastersStreamLayerProvider,
|
|
8
8
|
S as MastersStreamLayerSDKReact,
|
|
9
9
|
i as StreamLayerLogin,
|
|
10
|
-
L as StreamLayerSDKPoints
|
|
10
|
+
L as StreamLayerSDKPoints,
|
|
11
|
+
y as useStreamLayer
|
|
11
12
|
};
|