@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.
- package/lib/app/app.d.ts +3 -1
- package/lib/app/provider.d.ts +1 -0
- package/lib/cjs/app.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +176 -12
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +9 -164
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +17 -0
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -0
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +64 -56
- package/lib/dist/es/gamification-feature.js +1 -1
- package/lib/dist/es/gamification-feature2.js +115 -0
- package/lib/dist/es/index.js +7 -5
- package/lib/dist/es/masters.js +11066 -10876
- package/lib/dist/index.d.ts +15 -13
- package/lib/dist/style.css +1 -1
- package/lib/es/app.js +916 -11
- package/lib/es/gamification-feature.js +1 -1
- package/lib/es/gamification-feature2.js +4 -0
- package/lib/es/index.js +6 -14
- package/lib/es/index2.js +23584 -74
- package/lib/es/masters.js +1 -1
- package/lib/es/masters2.js +704 -23031
- package/lib/es/points.js +29 -32
- package/lib/es/useStreamLayerApp.js +3 -36
- package/lib/es/useStreamLayerApp2.js +20507 -0
- package/lib/index.d.ts +1 -1
- package/lib/masters.d.ts +2 -1
- package/lib/style.css +1 -1
- package/package.json +13 -13
- package/lib/cjs/index3.js +0 -1
- package/lib/es/index3.js +0 -246
|
@@ -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
|
+
};
|
package/lib/dist/es/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
s as MastersStreamLayerProvider,
|
|
6
|
+
m as MastersStreamLayerSDKReact,
|
|
7
|
+
o as StreamLayerLogin,
|
|
8
|
+
i as StreamLayerSDKPoints
|
|
7
9
|
};
|