@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.
- package/lib/app/advertisement.d.ts +2 -0
- package/lib/app/app.d.ts +11 -1
- package/lib/app/insight.d.ts +1 -0
- package/lib/app/points.d.ts +3 -1
- package/lib/app/provider.d.ts +4 -0
- package/lib/app/useStreamLayerApp.d.ts +3 -1
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +52 -53
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters2.js +4 -4
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +13 -13
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +73 -74
- package/lib/dist/es/gamification-feature2.js +42 -36
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +13572 -13238
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +346 -224
- package/lib/es/gamification-feature.js +1 -1
- package/lib/es/index.js +5 -4
- package/lib/es/index2.js +7739 -7637
- package/lib/es/insight.js +49 -36
- package/lib/es/masters2.js +538 -419
- package/lib/es/points.js +31 -31
- package/lib/es/useStreamLayerApp2.js +3522 -3339
- package/lib/index.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +14 -14
|
@@ -1,39 +1,45 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { M as C, s as
|
|
3
|
-
import { useRef as
|
|
4
|
-
const
|
|
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
|
-
}),
|
|
14
|
+
}), H = ({
|
|
9
15
|
deepLink: o
|
|
10
|
-
}) => /* @__PURE__ */ s(
|
|
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
|
-
}),
|
|
22
|
+
}), _ = /* @__PURE__ */ k("div")({
|
|
17
23
|
name: "InviteLinkContainer",
|
|
18
24
|
class: "i1odbhm4",
|
|
19
25
|
propsAsIs: !1
|
|
20
|
-
}),
|
|
26
|
+
}), z = ({
|
|
21
27
|
gamification: o,
|
|
22
28
|
scrollNode: t,
|
|
23
29
|
scrollStore: e
|
|
24
30
|
}) => {
|
|
25
|
-
const r =
|
|
31
|
+
const r = K(null), {
|
|
26
32
|
data: n,
|
|
27
33
|
hasMore: i,
|
|
28
34
|
loading: l,
|
|
29
|
-
key:
|
|
35
|
+
key: u
|
|
30
36
|
} = d(o.leaderboardList.$store), {
|
|
31
37
|
data: a
|
|
32
|
-
} = d(o.deepLink.$store), [
|
|
33
|
-
return !n.length && !l ? /* @__PURE__ */ s(
|
|
38
|
+
} = d(o.deepLink.$store), [p, m] = L(r);
|
|
39
|
+
return !n.length && !l ? /* @__PURE__ */ s(H, {
|
|
34
40
|
deepLink: a
|
|
35
|
-
}) : /* @__PURE__ */
|
|
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
|
-
},
|
|
50
|
+
}, u), a && /* @__PURE__ */ s(_, {
|
|
45
51
|
ref: r,
|
|
46
|
-
children: /* @__PURE__ */ s(
|
|
47
|
-
onClick: () =>
|
|
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
|
-
},
|
|
54
|
-
const { sdk: e } =
|
|
55
|
-
return /* @__PURE__ */ s(
|
|
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] =
|
|
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(
|
|
67
|
-
},
|
|
68
|
-
const { tabsShown:
|
|
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
|
|
71
|
-
|
|
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
|
|
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
|
-
|
|
90
|
+
P,
|
|
85
91
|
{
|
|
86
92
|
style: {
|
|
87
93
|
top: h
|
|
88
94
|
},
|
|
89
|
-
children: /* @__PURE__ */ s(R, { activePage: a, toggleActivePage:
|
|
95
|
+
children: /* @__PURE__ */ s(R, { activePage: a, toggleActivePage: x })
|
|
90
96
|
}
|
|
91
97
|
),
|
|
92
|
-
a ===
|
|
93
|
-
/* @__PURE__ */ s(V, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ s(
|
|
94
|
-
/* @__PURE__ */ s(
|
|
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 ===
|
|
102
|
+
a === g.LEADERBOARD && /* @__PURE__ */ s(q, { children: /* @__PURE__ */ s(z, { scrollStore: e, scrollNode: r, gamification: o }) })
|
|
97
103
|
] });
|
|
98
|
-
},
|
|
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
|
-
|
|
120
|
+
ee as default
|
|
115
121
|
};
|