@streamlayer/react 1.8.6 → 1.9.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.
- package/lib/app/provider.d.ts +1 -0
- package/lib/app/useStreamLayerApp.d.ts +2 -1
- package/lib/cjs/index2.js +33 -33
- package/lib/cjs/useStreamLayerApp2.js +6 -6
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/masters.js +35 -35
- package/lib/dist/es/gamification-feature2.js +65 -63
- package/lib/dist/es/masters.js +1593 -1581
- package/lib/dist/style.css +1 -1
- package/lib/es/index2.js +1526 -1520
- package/lib/es/useStreamLayerApp2.js +356 -348
- package/lib/style.css +1 -1
- package/package.json +13 -13
|
@@ -1,121 +1,123 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { C as y, M as
|
|
3
|
-
import { useRef as K, useState as w, useEffect as
|
|
4
|
-
const j = (
|
|
1
|
+
import { jsx as s, jsxs as g, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { C as y, M as $, s as I, u as l, T as L, S as M, a as D, p as T, k as E, O as A, m as h, l as F, c as O, b as P, d as R, e as V, f as Q, n as q, g as H } from "./masters.js";
|
|
3
|
+
import { useRef as K, useState as w, 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
|
-
|
|
7
|
-
top:
|
|
8
|
-
...
|
|
6
|
+
e.current && window.scrollTo({
|
|
7
|
+
top: e.current.offsetTop - r,
|
|
8
|
+
...o
|
|
9
9
|
});
|
|
10
|
-
}, B = /* @__PURE__ */
|
|
10
|
+
}, B = /* @__PURE__ */ I("div")({
|
|
11
11
|
name: "InviteFriendsContainer",
|
|
12
12
|
class: "i1c9dygq",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
15
|
-
deepLink:
|
|
14
|
+
}), W = ({
|
|
15
|
+
deepLink: e
|
|
16
16
|
}) => /* @__PURE__ */ s(B, {
|
|
17
|
-
children: /* @__PURE__ */ s(
|
|
18
|
-
inviteLink:
|
|
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__ */
|
|
22
|
+
}), _ = /* @__PURE__ */ I("div")({
|
|
23
23
|
name: "InviteLinkContainer",
|
|
24
24
|
class: "i1odbhm4",
|
|
25
25
|
propsAsIs: !1
|
|
26
26
|
}), z = ({
|
|
27
|
-
gamification:
|
|
27
|
+
gamification: e,
|
|
28
28
|
scrollNode: t,
|
|
29
|
-
scrollStore:
|
|
29
|
+
scrollStore: o
|
|
30
30
|
}) => {
|
|
31
31
|
const r = K(null), {
|
|
32
32
|
data: n,
|
|
33
33
|
hasMore: i,
|
|
34
|
-
loading:
|
|
35
|
-
key:
|
|
36
|
-
} =
|
|
34
|
+
loading: c,
|
|
35
|
+
key: p
|
|
36
|
+
} = l(e.leaderboardList.$store), {
|
|
37
37
|
data: a
|
|
38
|
-
} =
|
|
39
|
-
return !n.length && !
|
|
38
|
+
} = l(e.deepLink.$store), [d, m] = L(r);
|
|
39
|
+
return !n.length && !c ? /* @__PURE__ */ s(W, {
|
|
40
40
|
deepLink: a
|
|
41
|
-
}) : /* @__PURE__ */
|
|
42
|
-
children: [/* @__PURE__ */ s(
|
|
41
|
+
}) : /* @__PURE__ */ g(k, {
|
|
42
|
+
children: [/* @__PURE__ */ s(M, {
|
|
43
43
|
items: n,
|
|
44
44
|
scrollNode: t,
|
|
45
|
-
scrollStore:
|
|
46
|
-
fetchMore:
|
|
45
|
+
scrollStore: o,
|
|
46
|
+
fetchMore: e.leaderboardList.fetchMore,
|
|
47
47
|
hasMore: i,
|
|
48
|
-
openItemDetail:
|
|
49
|
-
currentUserId:
|
|
50
|
-
},
|
|
48
|
+
openItemDetail: e.openUser,
|
|
49
|
+
currentUserId: e.currentUserId.get()
|
|
50
|
+
}, p), a && /* @__PURE__ */ s(_, {
|
|
51
51
|
ref: r,
|
|
52
|
-
children: /* @__PURE__ */ s(
|
|
53
|
-
onClick: () =>
|
|
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
|
-
},
|
|
60
|
-
const { sdk:
|
|
61
|
-
return /* @__PURE__ */ s(
|
|
62
|
-
},
|
|
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 [
|
|
65
|
-
return
|
|
66
|
-
const n =
|
|
64
|
+
const [o, r] = w(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
|
-
}, [
|
|
73
|
-
},
|
|
74
|
-
const { tabsShown:
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
|
|
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] = w(h.HOME), [, N] = U(), { sdkInDesktopView: S, screen: x } = l(c, { keys: ["sdkInDesktopView"] }), C = (u) => {
|
|
75
|
+
N(() => {
|
|
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
|
-
|
|
81
|
-
if (
|
|
82
|
-
|
|
80
|
+
v(() => o.subscribe((u) => {
|
|
81
|
+
if (u.scrollPosition === 0) {
|
|
82
|
+
o.setKey("tabsShown", !0);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
}), [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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:
|
|
95
|
+
top: f
|
|
94
96
|
},
|
|
95
|
-
children: /* @__PURE__ */ s(R, { activePage:
|
|
97
|
+
children: /* @__PURE__ */ s(R, { activePage: d, toggleActivePage: C })
|
|
96
98
|
}
|
|
97
99
|
),
|
|
98
|
-
|
|
99
|
-
/* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(
|
|
100
|
-
/* @__PURE__ */ s(
|
|
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
|
-
|
|
104
|
+
d === h.LEADERBOARD && /* @__PURE__ */ s(H, { children: /* @__PURE__ */ s(z, { scrollStore: o, scrollNode: r, gamification: e }) })
|
|
103
105
|
] });
|
|
104
|
-
},
|
|
105
|
-
gamification:
|
|
106
|
+
}, oe = ({
|
|
107
|
+
gamification: e,
|
|
106
108
|
scrollStore: t,
|
|
107
|
-
className:
|
|
109
|
+
className: o,
|
|
108
110
|
appNode: r,
|
|
109
111
|
scrollNode: n,
|
|
110
112
|
responsiveStore: i
|
|
111
|
-
}) => /* @__PURE__ */ s(
|
|
113
|
+
}) => /* @__PURE__ */ s(X, {
|
|
112
114
|
appNode: r,
|
|
113
115
|
scrollStore: t,
|
|
114
116
|
scrollNode: n,
|
|
115
|
-
className:
|
|
116
|
-
gamification:
|
|
117
|
+
className: o,
|
|
118
|
+
gamification: e,
|
|
117
119
|
responsiveStore: i
|
|
118
120
|
});
|
|
119
121
|
export {
|
|
120
|
-
|
|
122
|
+
oe as default
|
|
121
123
|
};
|