@streamlayer/react 1.8.6 → 1.9.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.
@@ -1,121 +1,123 @@
1
- import { jsx as s, jsxs as f, Fragment as b } from "react/jsx-runtime";
2
- import { C as y, M as x, s as k, u as d, T as L, S as D, a as M, p as $, k as T, O as A, m as g, l as E, c as F, b as P, d as R, e as V, f as O, n as Q, g as q } from "./masters.js";
3
- import { useRef as K, useState as w, useEffect as I, useTransition as U } from "react";
4
- const j = (o, t, e) => {
1
+ import { jsx as s, jsxs as g, Fragment as k } from "react/jsx-runtime";
2
+ import { N as y, M as $, s as I, u as l, T as L, S as M, C as D, p as T, k as E, O as A, m as h, l as F, c as O, a as P, b as R, d as V, e as Q, n as q, f as H } from "./masters.js";
3
+ import { useRef as K, useState as N, useEffect as v, useTransition as U } from "react";
4
+ const j = (e, t, o) => {
5
5
  const r = t >= y.lg && t < y.xl ? 75 : 52;
6
- o.current && window.scrollTo({
7
- top: o.current.offsetTop - r,
8
- ...e
6
+ e.current && window.scrollTo({
7
+ top: e.current.offsetTop - r,
8
+ ...o
9
9
  });
10
- }, B = /* @__PURE__ */ k("div")({
10
+ }, B = /* @__PURE__ */ I("div")({
11
11
  name: "InviteFriendsContainer",
12
12
  class: "i1c9dygq",
13
13
  propsAsIs: !1
14
- }), H = ({
15
- deepLink: o
14
+ }), W = ({
15
+ deepLink: e
16
16
  }) => /* @__PURE__ */ s(B, {
17
- children: /* @__PURE__ */ s(x, {
18
- inviteLink: o,
17
+ children: /* @__PURE__ */ s($, {
18
+ inviteLink: e,
19
19
  inviteCardTitle: "It’s More Fun With Friends",
20
20
  inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
21
21
  })
22
- }), _ = /* @__PURE__ */ k("div")({
22
+ }), _ = /* @__PURE__ */ I("div")({
23
23
  name: "InviteLinkContainer",
24
24
  class: "i1odbhm4",
25
25
  propsAsIs: !1
26
26
  }), z = ({
27
- gamification: o,
27
+ gamification: e,
28
28
  scrollNode: t,
29
- scrollStore: e
29
+ scrollStore: o
30
30
  }) => {
31
31
  const r = K(null), {
32
32
  data: n,
33
33
  hasMore: i,
34
- loading: l,
35
- key: u
36
- } = d(o.leaderboardList.$store), {
34
+ loading: c,
35
+ key: p
36
+ } = l(e.leaderboardList.$store), {
37
37
  data: a
38
- } = d(o.deepLink.$store), [p, m] = L(r);
39
- return !n.length && !l ? /* @__PURE__ */ s(H, {
38
+ } = l(e.deepLink.$store), [d, m] = L(r);
39
+ return !n.length && !c ? /* @__PURE__ */ s(W, {
40
40
  deepLink: a
41
- }) : /* @__PURE__ */ f(b, {
42
- children: [/* @__PURE__ */ s(D, {
41
+ }) : /* @__PURE__ */ g(k, {
42
+ children: [/* @__PURE__ */ s(M, {
43
43
  items: n,
44
44
  scrollNode: t,
45
- scrollStore: e,
46
- fetchMore: o.leaderboardList.fetchMore,
45
+ scrollStore: o,
46
+ fetchMore: e.leaderboardList.fetchMore,
47
47
  hasMore: i,
48
- openItemDetail: o.openUser,
49
- currentUserId: o.currentUserId.get()
50
- }, u), a && /* @__PURE__ */ s(_, {
48
+ openItemDetail: e.openUser,
49
+ currentUserId: e.currentUserId.get()
50
+ }, p), a && /* @__PURE__ */ s(_, {
51
51
  ref: r,
52
- children: /* @__PURE__ */ s(M, {
53
- onClick: () => p(a),
52
+ children: /* @__PURE__ */ s(D, {
53
+ onClick: () => d(a),
54
54
  title: "Invite Friends",
55
55
  description: "Challenge them now!"
56
56
  })
57
57
  }), m]
58
58
  });
59
- }, J = ({ store: o, openQuestion: t }) => {
60
- const { sdk: e } = $(), r = d(o);
61
- return /* @__PURE__ */ s(T, { openQuestion: t, questions: r.data, controlVideo: e == null ? void 0 : e.controlVideoPlayer });
62
- }, W = ({ userSummary: o }) => {
59
+ }, G = ({ store: e, openQuestion: t }) => {
60
+ const { sdk: o } = T(), r = l(e);
61
+ return /* @__PURE__ */ s(E, { openQuestion: t, questions: r.data, controlVideo: o == null ? void 0 : o.controlVideoPlayer });
62
+ }, J = ({ userSummary: e }) => {
63
63
  var t;
64
- const [e, r] = w(void 0);
65
- return I(() => {
66
- const n = o.$store.subscribe((i) => {
64
+ const [o, r] = N(void 0);
65
+ return v(() => {
66
+ const n = e.$store.subscribe((i) => {
67
67
  i && r(i);
68
68
  });
69
69
  return () => {
70
70
  n();
71
71
  };
72
- }, [o]), /* @__PURE__ */ s(A, { loading: !(e != null && e.summary), ...e == null ? void 0 : e.summary, successRate: (t = e == null ? void 0 : e.percentage) == null ? void 0 : t.correct });
73
- }, G = ({ gamification: o, className: t, scrollStore: e, scrollNode: r, appNode: n, style: i, responsiveStore: l }) => {
74
- const { tabsShown: u } = d(e, { keys: ["tabsShown"] }), [a, p] = w(g.HOME), [, m] = U(), { sdkInDesktopView: v, screen: N } = d(l, { keys: ["sdkInDesktopView"] }), C = (c) => {
75
- m(() => {
76
- var S;
77
- p(c), v === !1 && (((S = n.current) == null ? void 0 : S.getBoundingClientRect().y) || 0) < 0 && j(n, N.size, { behavior: "instant" });
72
+ }, [e]), /* @__PURE__ */ s(A, { loading: !(o != null && o.summary), ...o == null ? void 0 : o.summary, successRate: (t = o == null ? void 0 : o.percentage) == null ? void 0 : t.correct });
73
+ }, X = ({ gamification: e, className: t, scrollStore: o, scrollNode: r, appNode: n, style: i, responsiveStore: c }) => {
74
+ const { tabsShown: p } = l(o, { keys: ["tabsShown"] }), a = l(e.friendsTabEnabled), [d, m] = N(h.HOME), [, w] = U(), { sdkInDesktopView: S, screen: x } = l(c, { keys: ["sdkInDesktopView"] }), C = (u) => {
75
+ w(() => {
76
+ var b;
77
+ m(u), S === !1 && (((b = n.current) == null ? void 0 : b.getBoundingClientRect().y) || 0) < 0 && j(n, x.size, { behavior: "instant" });
78
78
  });
79
79
  };
80
- I(() => e.subscribe((c) => {
81
- if (c.scrollPosition === 0) {
82
- e.setKey("tabsShown", !0);
80
+ v(() => o.subscribe((u) => {
81
+ if (u.scrollPosition === 0) {
82
+ o.setKey("tabsShown", !0);
83
83
  return;
84
84
  }
85
- l.get().sdkInDesktopView ? e.setKey("tabsShown", c.scrollDirection === "backward") : e.setKey("tabsShown", c.scrollDirection === "forward");
86
- }), [e, l]);
87
- let h = "0px";
88
- return v ? h = u ? "0px" : "calc(0px - var(--header-height))" : h = u ? "var(--header-height)" : "0px", /* @__PURE__ */ f(E, { className: F(t, "SL-Tabs"), style: i, children: [
89
- /* @__PURE__ */ s(
85
+ c.get().sdkInDesktopView ? o.setKey("tabsShown", u.scrollDirection === "backward") : o.setKey("tabsShown", u.scrollDirection === "forward");
86
+ }), [o, c]), v(() => {
87
+ a || m(h.HOME);
88
+ }, [a]);
89
+ let f = "0px";
90
+ return S ? f = p ? "0px" : "calc(0px - var(--header-height))" : f = p ? "var(--header-height)" : "0px", /* @__PURE__ */ g(F, { className: O(t, "SL-Tabs"), style: i, children: [
91
+ a && /* @__PURE__ */ s(
90
92
  P,
91
93
  {
92
94
  style: {
93
- top: h
95
+ top: f
94
96
  },
95
- children: /* @__PURE__ */ s(R, { activePage: a, toggleActivePage: C })
97
+ children: /* @__PURE__ */ s(R, { activePage: d, toggleActivePage: C })
96
98
  }
97
99
  ),
98
- a === g.HOME && /* @__PURE__ */ f(b, { children: [
99
- /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(O, { children: /* @__PURE__ */ s(W, { userSummary: o.userSummary }) }) }),
100
- /* @__PURE__ */ s(Q, { style: { flex: 1 }, children: /* @__PURE__ */ s(J, { openQuestion: o.openQuestion, store: o.feedList.getStore() }) })
100
+ d === h.HOME && /* @__PURE__ */ g(k, { children: [
101
+ /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(Q, { children: /* @__PURE__ */ s(J, { userSummary: e.userSummary }) }) }),
102
+ /* @__PURE__ */ s(q, { style: { flex: 1 }, children: /* @__PURE__ */ s(G, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
101
103
  ] }),
102
- a === g.LEADERBOARD && /* @__PURE__ */ s(q, { children: /* @__PURE__ */ s(z, { scrollStore: e, scrollNode: r, gamification: o }) })
104
+ d === h.LEADERBOARD && /* @__PURE__ */ s(H, { children: /* @__PURE__ */ s(z, { scrollStore: o, scrollNode: r, gamification: e }) })
103
105
  ] });
104
- }, ee = ({
105
- gamification: o,
106
+ }, oe = ({
107
+ gamification: e,
106
108
  scrollStore: t,
107
- className: e,
109
+ className: o,
108
110
  appNode: r,
109
111
  scrollNode: n,
110
112
  responsiveStore: i
111
- }) => /* @__PURE__ */ s(G, {
113
+ }) => /* @__PURE__ */ s(X, {
112
114
  appNode: r,
113
115
  scrollStore: t,
114
116
  scrollNode: n,
115
- className: e,
116
- gamification: o,
117
+ className: o,
118
+ gamification: e,
117
119
  responsiveStore: i
118
120
  });
119
121
  export {
120
- ee as default
122
+ oe as default
121
123
  };
@@ -1,9 +1,9 @@
1
1
  import "react/jsx-runtime";
2
- import { i as s, j as o, o as m, h as i } from "./masters.js";
2
+ import { h as s, i as m, j as o, g as i } from "./masters.js";
3
3
  import "react";
4
4
  export {
5
5
  s as MastersStreamLayerProvider,
6
- o as MastersStreamLayerSDKReact,
7
- m as StreamLayerLogin,
6
+ m as MastersStreamLayerSDKReact,
7
+ o as StreamLayerLogin,
8
8
  i as StreamLayerSDKPoints
9
9
  };