@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.
Files changed (39) hide show
  1. package/lib/cjs/advertisement.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/insight.js +1 -1
  4. package/lib/cjs/notification.js +1 -1
  5. package/lib/cjs/pause-ad.js +1 -1
  6. package/lib/cjs/points.js +1 -1
  7. package/lib/cjs/provider.js +14 -14
  8. package/lib/cjs/useStreamLayerApp2.js +1 -1
  9. package/lib/classic/cjs/advertisement.js +1 -1
  10. package/lib/classic/cjs/index.js +1 -1
  11. package/lib/classic/cjs/insight.js +1 -1
  12. package/lib/classic/cjs/notification.js +1 -1
  13. package/lib/classic/cjs/pause-ad.js +1 -1
  14. package/lib/classic/cjs/points.js +1 -1
  15. package/lib/classic/cjs/provider.js +9 -9
  16. package/lib/classic/cjs/useStreamLayerApp2.js +1 -1
  17. package/lib/classic/es/advertisement.js +2 -3
  18. package/lib/classic/es/index.js +9 -10
  19. package/lib/classic/es/insight.js +6 -7
  20. package/lib/classic/es/notification.js +2 -3
  21. package/lib/classic/es/pause-ad.js +34 -35
  22. package/lib/classic/es/points.js +2 -3
  23. package/lib/classic/es/provider.js +2066 -2062
  24. package/lib/classic/es/useStreamLayerApp2.js +1 -1
  25. package/lib/dist/cjs/gamification-feature2.js +1 -1
  26. package/lib/dist/cjs/index.js +1 -1
  27. package/lib/dist/cjs/masters.js +22 -22
  28. package/lib/dist/es/gamification-feature2.js +71 -72
  29. package/lib/dist/es/index.js +6 -7
  30. package/lib/dist/es/masters.js +3089 -3074
  31. package/lib/es/advertisement.js +2 -3
  32. package/lib/es/index.js +9 -10
  33. package/lib/es/insight.js +6 -7
  34. package/lib/es/notification.js +2 -3
  35. package/lib/es/pause-ad.js +34 -35
  36. package/lib/es/points.js +2 -3
  37. package/lib/es/provider.js +2035 -2020
  38. package/lib/es/useStreamLayerApp2.js +1 -1
  39. 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, a, t) => {
12
- const o = a >= C.lg && a < C.xl ? 75 : 52;
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 - o,
15
- ...t
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: a, onClick: t }) => /* @__PURE__ */ s(Y, { "data-a": "intr", onClick: t, "data-selected": a, children: /* @__PURE__ */ s(Z, { "data-a": "intr", children: e }) }), ee = ({ activePage: e = "home", toggleActivePage: a }) => /* @__PURE__ */ s(J, { children: /* @__PURE__ */ p(X, { "data-position": e === "home" ? "left" : "right", children: [
36
- /* @__PURE__ */ s($, { title: "Home", active: e === "home", onClick: () => a(
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: () => a(
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
- }), te = () => b, ae = /* @__PURE__ */ r(te())({
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
- }), oe = /* @__PURE__ */ r("div")({
62
+ }), ne = /* @__PURE__ */ r("div")({
64
63
  name: "Title",
65
64
  class: "tj6cq7w",
66
65
  propsAsIs: !1
67
- }), ne = /* @__PURE__ */ r("div")({
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: a, onClick: t, className: o }) => {
76
- const [n] = M({
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: n(t), className: o, children: [
84
- /* @__PURE__ */ s(ae, { name: "icon-friends" }),
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(oe, { children: e }),
87
- /* @__PURE__ */ s(ne, { children: a })
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: a,
126
- name: t,
127
- userId: o,
128
- points: n,
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": o, style: d, children: [
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
- a ? /* @__PURE__ */ s(me, { alt: "leaderboard-item-avatar", src: a }) : /* @__PURE__ */ s(ue, { children: L(t || "") }),
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: t || "" }),
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(n) })
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: a,
148
- openItemDetail: t,
149
- fetchMore: o,
150
- scrollNode: n,
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 && t(l);
156
- }, [t]);
154
+ l && a(l);
155
+ }, [a]);
157
156
  return /* @__PURE__ */ s(_, {
158
- loadMore: o,
157
+ loadMore: n,
159
158
  initialLoad: !1,
160
159
  hasMore: i,
161
160
  useWindow: !1,
162
- getScrollParent: () => n.current,
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: !!a && a === c.userId
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: a,
191
- scrollStore: t
189
+ scrollNode: t,
190
+ scrollStore: a
192
191
  }) => {
193
- const o = W(null), {
194
- data: n,
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(o);
201
- return !n.length && !d ? /* @__PURE__ */ s($e, {
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: n,
206
- scrollNode: a,
207
- scrollStore: t,
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: o,
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: a }) => {
223
- const { sdk: t } = R(), o = m(e);
224
- return /* @__PURE__ */ s(F, { openQuestion: a, questions: o.data, controlVideo: t == null ? void 0 : t.controlVideoPlayer });
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 a;
227
- const [t, o] = S(void 0);
225
+ var t;
226
+ const [a, n] = S(void 0);
228
227
  return f(() => {
229
- const n = e.$store.subscribe((i) => {
230
- i && o(i);
228
+ const o = e.$store.subscribe((i) => {
229
+ i && n(i);
231
230
  });
232
231
  return () => {
233
- n();
232
+ o();
234
233
  };
235
- }, [e]), /* @__PURE__ */ s(z, { loading: !(t != null && t.summary), ...t == null ? void 0 : t.summary, successRate: (a = t == null ? void 0 : t.percentage) == null ? void 0 : a.correct });
236
- }, xe = ({ gamification: e, className: a, scrollStore: t, scrollNode: o, appNode: n, style: i, responsiveStore: d }) => {
237
- const { tabsShown: c } = m(t, { keys: ["tabsShown"] }), l = m(e.friendsTabEnabled), [u, I] = S(v.HOME), [, N] = B(), { sdkInDesktopView: A, screen: w } = m(d, { keys: ["sdkInDesktopView"] }), x = (h) => {
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 = n.current) == null ? void 0 : k.getBoundingClientRect().y) || 0) < 0 && G(n, w.size, { behavior: "instant" });
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(() => t.subscribe((h) => {
242
+ f(() => a.subscribe((h) => {
244
243
  if (h.scrollPosition === 0) {
245
- t.setKey("tabsShown", !0);
244
+ a.setKey("tabsShown", !0);
246
245
  return;
247
246
  }
248
- d.get().sdkInDesktopView ? t.setKey("tabsShown", h.scrollDirection === "backward") : t.setKey("tabsShown", h.scrollDirection === "forward");
249
- }), [t, d]), f(() => {
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(a, "SL-Tabs", "sl-hide-on-modal"), style: i, children: [
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: t, scrollNode: o, gamification: e }) })
266
+ u === v.LEADERBOARD && /* @__PURE__ */ s(Q, { children: /* @__PURE__ */ s(Se, { scrollStore: a, scrollNode: n, gamification: e }) })
268
267
  ] });
269
- }, Ue = ({
268
+ }, Be = ({
270
269
  gamification: e,
271
- scrollStore: a,
272
- className: t,
273
- appNode: o,
274
- scrollNode: n,
270
+ scrollStore: t,
271
+ className: a,
272
+ appNode: n,
273
+ scrollNode: o,
275
274
  responsiveStore: i
276
275
  }) => /* @__PURE__ */ s(xe, {
277
- appNode: o,
278
- scrollStore: a,
279
- scrollNode: n,
280
- className: t,
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
- Ue as default
284
+ Be as default
286
285
  };
@@ -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 L, o as y, r as n, i as P, q as c } from "./masters.js";
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
- L as MastersStreamLayerProvider,
12
- y as MastersStreamLayerSDKReact,
13
- n as StreamLayerLogin,
14
- P as StreamLayerSDKPoints,
15
- c as useStreamLayer
10
+ p as MastersStreamLayerProvider,
11
+ L as MastersStreamLayerSDKReact,
12
+ y as StreamLayerLogin,
13
+ n as StreamLayerSDKPoints,
14
+ P as useStreamLayer
16
15
  };