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