@streamlayer/react 1.6.0 → 1.8.0

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