@streamlayer/web-os 0.4.2 → 0.4.4
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/cjs/gamification-feature.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +25 -40
- package/lib/classic/cjs/classic.js +1 -1
- package/lib/classic/cjs/gamification-feature.js +1 -1
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/index2.js +1 -10
- package/lib/classic/classic.d.ts +2 -13
- package/lib/classic/core/app/app.d.ts +16 -0
- package/lib/classic/core/app/event.d.ts +6 -0
- package/lib/classic/core/app/provider.d.ts +49 -0
- package/lib/classic/core/app/useStreamLayerApp.d.ts +23 -0
- package/lib/classic/core/index.d.ts +4 -0
- package/lib/classic/es/classic.js +78 -8
- package/lib/classic/es/gamification-feature.js +638 -2
- package/lib/classic/es/index.js +157 -10
- package/lib/classic/es/index2.js +19054 -11977
- package/lib/classic/index.d.ts +2 -13
- package/lib/classic.d.ts +2 -13
- package/lib/core/app/app.d.ts +16 -0
- package/lib/core/app/event.d.ts +6 -0
- package/lib/core/app/provider.d.ts +49 -0
- package/lib/core/app/useStreamLayerApp.d.ts +23 -0
- package/lib/core/index.d.ts +4 -0
- package/lib/es/gamification-feature.js +606 -2
- package/lib/es/index.js +2 -2
- package/lib/es/index2.js +16237 -23252
- package/lib/index.d.ts +2 -13
- package/package.json +19 -20
- package/lib/cjs/gamification-feature2.js +0 -1
- package/lib/classic/cjs/classic2.js +0 -10
- package/lib/classic/cjs/gamification-feature2.js +0 -1
- package/lib/classic/cjs/gamification-feature3.js +0 -1
- package/lib/classic/cjs/index3.js +0 -1
- package/lib/classic/es/classic2.js +0 -13037
- package/lib/classic/es/gamification-feature2.js +0 -4
- package/lib/classic/es/gamification-feature3.js +0 -643
- package/lib/classic/es/index3.js +0 -14930
- package/lib/es/gamification-feature2.js +0 -608
|
@@ -1,4 +1,608 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as i, jsx as s, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { A as T, s as n, i as $, I as V, a as D, B as v, f as U, b as j, u as h, r as F, S as z, O, c as Q, R as W, D as Z, w as K, p as _, d as G, l as J, e as X, g as Y, m as ss, h as es, n as ns, C as as } from "./index2.js";
|
|
3
|
+
import "@noriginmedia/norigin-spatial-navigation";
|
|
4
|
+
import { useRef as y, useState as w, useCallback as P, useEffect as g } from "react";
|
|
5
|
+
import "react-countdown-circle-timer";
|
|
6
|
+
import { createPortal as ts } from "react-dom";
|
|
7
|
+
import "react-countup";
|
|
8
|
+
import "nanostores";
|
|
9
|
+
import "lodash.throttle";
|
|
10
|
+
import rs from "react-infinite-scroller";
|
|
11
|
+
const is = (e, a, t) => {
|
|
12
|
+
const o = a >= T.lg && a < T.xl ? 75 : 52;
|
|
13
|
+
e.current && window.scrollTo({
|
|
14
|
+
top: e.current.offsetTop - o,
|
|
15
|
+
...t
|
|
16
|
+
});
|
|
17
|
+
}, os = /* @__PURE__ */ n("div")({
|
|
18
|
+
name: "Container",
|
|
19
|
+
class: "c1zy8a",
|
|
20
|
+
propsAsIs: !1
|
|
21
|
+
}), cs = /* @__PURE__ */ n("div")({
|
|
22
|
+
name: "Title",
|
|
23
|
+
class: "t1vih9p5",
|
|
24
|
+
propsAsIs: !1
|
|
25
|
+
}), ls = /* @__PURE__ */ n("div")({
|
|
26
|
+
name: "Indicator",
|
|
27
|
+
class: "i1fbnvpb",
|
|
28
|
+
propsAsIs: !1
|
|
29
|
+
}), x = ({ indicator: e, title: a }) => /* @__PURE__ */ i(os, { children: [
|
|
30
|
+
/* @__PURE__ */ s(cs, { children: a }),
|
|
31
|
+
/* @__PURE__ */ s(ls, { children: e })
|
|
32
|
+
] }), ds = /* @__PURE__ */ n("div")({
|
|
33
|
+
name: "Container",
|
|
34
|
+
class: "ctmhwyc",
|
|
35
|
+
propsAsIs: !1
|
|
36
|
+
}), ps = /* @__PURE__ */ n("div")({
|
|
37
|
+
name: "Indicator",
|
|
38
|
+
class: "i1jri200",
|
|
39
|
+
propsAsIs: !1
|
|
40
|
+
}), ms = /* @__PURE__ */ n("div")({
|
|
41
|
+
name: "Title",
|
|
42
|
+
class: "t8s05oq",
|
|
43
|
+
propsAsIs: !1
|
|
44
|
+
}), A = ({ indicator: e, title: a }) => /* @__PURE__ */ i(ds, { children: [
|
|
45
|
+
/* @__PURE__ */ s(ps, { children: e }),
|
|
46
|
+
/* @__PURE__ */ s(ms, { children: a })
|
|
47
|
+
] }), us = /* @__PURE__ */ n("div")({
|
|
48
|
+
name: "Container",
|
|
49
|
+
class: "c1yrpn9o",
|
|
50
|
+
propsAsIs: !1
|
|
51
|
+
}), hs = /* @__PURE__ */ n("div")({
|
|
52
|
+
name: "TopInfo",
|
|
53
|
+
class: "t17fwahh",
|
|
54
|
+
propsAsIs: !1
|
|
55
|
+
}), vs = /* @__PURE__ */ n("div")({
|
|
56
|
+
name: "BottomInfo",
|
|
57
|
+
class: "by6w7e9",
|
|
58
|
+
propsAsIs: !1
|
|
59
|
+
}), Is = /* @__PURE__ */ n("div")({
|
|
60
|
+
name: "User",
|
|
61
|
+
class: "u1g7arbm",
|
|
62
|
+
propsAsIs: !1
|
|
63
|
+
}), Cs = /* @__PURE__ */ n("img")({
|
|
64
|
+
name: "Avatar",
|
|
65
|
+
class: "a1ldeata",
|
|
66
|
+
propsAsIs: !1
|
|
67
|
+
}), $s = /* @__PURE__ */ n("div")({
|
|
68
|
+
name: "UserInfo",
|
|
69
|
+
class: "u10d4koz",
|
|
70
|
+
propsAsIs: !1
|
|
71
|
+
}), As = /* @__PURE__ */ n("div")({
|
|
72
|
+
name: "UserName",
|
|
73
|
+
class: "u1q6roj0",
|
|
74
|
+
propsAsIs: !1
|
|
75
|
+
}), gs = /* @__PURE__ */ n("div")({
|
|
76
|
+
name: "UserRating",
|
|
77
|
+
class: "ui0m425",
|
|
78
|
+
propsAsIs: !1
|
|
79
|
+
}), bs = /* @__PURE__ */ n("img")({
|
|
80
|
+
name: "TrophyIcon",
|
|
81
|
+
class: "t1el3mrn",
|
|
82
|
+
propsAsIs: !1
|
|
83
|
+
}), fs = /* @__PURE__ */ n("div")({
|
|
84
|
+
name: "RtsContainer",
|
|
85
|
+
class: "r2vgnxv",
|
|
86
|
+
propsAsIs: !1
|
|
87
|
+
}), ks = /* @__PURE__ */ n("div")({
|
|
88
|
+
name: "RtsDivider",
|
|
89
|
+
class: "roqn06j",
|
|
90
|
+
propsAsIs: !1
|
|
91
|
+
}), ys = /* @__PURE__ */ n("div")({
|
|
92
|
+
name: "Rts",
|
|
93
|
+
class: "r15adx7c",
|
|
94
|
+
propsAsIs: !1
|
|
95
|
+
}), q = /* @__PURE__ */ n("div")({
|
|
96
|
+
name: "RtsIndicator",
|
|
97
|
+
class: "rv59lta",
|
|
98
|
+
propsAsIs: !1
|
|
99
|
+
}), N = /* @__PURE__ */ n("div")({
|
|
100
|
+
name: "RtsLabel",
|
|
101
|
+
class: "r55lotb",
|
|
102
|
+
propsAsIs: !1
|
|
103
|
+
}), ws = /* @__PURE__ */ n("div")({
|
|
104
|
+
name: "Divider",
|
|
105
|
+
class: "d1knfgqt",
|
|
106
|
+
propsAsIs: !1
|
|
107
|
+
}), Ss = /* @__PURE__ */ n("div")({
|
|
108
|
+
name: "Ranks",
|
|
109
|
+
class: "r1mqo824",
|
|
110
|
+
propsAsIs: !1
|
|
111
|
+
}), Ls = /* @__PURE__ */ n("div")({
|
|
112
|
+
name: "Statistics",
|
|
113
|
+
class: "sxareh6",
|
|
114
|
+
propsAsIs: !1
|
|
115
|
+
}), Ts = /* @__PURE__ */ n("div")({
|
|
116
|
+
name: "AvatarPlaceholder",
|
|
117
|
+
class: "amcu48h",
|
|
118
|
+
propsAsIs: !1
|
|
119
|
+
}), xs = /* @__PURE__ */ n("button")({
|
|
120
|
+
name: "UserAccountBtn",
|
|
121
|
+
class: "u32nfkp",
|
|
122
|
+
propsAsIs: !1
|
|
123
|
+
}), qs = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e", Ns = ({
|
|
124
|
+
loading: e,
|
|
125
|
+
hideFriendsRank: a,
|
|
126
|
+
avatar: t,
|
|
127
|
+
name: o,
|
|
128
|
+
points: r,
|
|
129
|
+
friendsRank: c,
|
|
130
|
+
rank: d,
|
|
131
|
+
streak: p,
|
|
132
|
+
correct: l,
|
|
133
|
+
incorrect: m,
|
|
134
|
+
inTop: u,
|
|
135
|
+
successRate: b
|
|
136
|
+
}) => /* @__PURE__ */ i(us, { "data-loading": e, children: [
|
|
137
|
+
/* @__PURE__ */ s(hs, { children: /* @__PURE__ */ s($, { loading: e, children: /* @__PURE__ */ i(Is, { children: [
|
|
138
|
+
/* @__PURE__ */ i(xs, { children: [
|
|
139
|
+
t && /* @__PURE__ */ s(Cs, { alt: "avatar", src: t }),
|
|
140
|
+
!t && /* @__PURE__ */ s(Ts, { children: V(o || "") })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ i($s, { children: [
|
|
143
|
+
/* @__PURE__ */ s(As, { children: o }),
|
|
144
|
+
/* @__PURE__ */ i(gs, { children: [
|
|
145
|
+
/* @__PURE__ */ i(fs, { children: [
|
|
146
|
+
/* @__PURE__ */ i(ys, { children: [
|
|
147
|
+
/* @__PURE__ */ s(bs, { alt: "rank-icon", src: qs }),
|
|
148
|
+
/* @__PURE__ */ i(q, { children: [
|
|
149
|
+
D(r),
|
|
150
|
+
/* @__PURE__ */ s(N, { children: "PTS" })
|
|
151
|
+
] })
|
|
152
|
+
] }),
|
|
153
|
+
a && /* @__PURE__ */ i(q, { children: [
|
|
154
|
+
/* @__PURE__ */ s(ks, {}),
|
|
155
|
+
d || 0,
|
|
156
|
+
/* @__PURE__ */ s(N, { children: "global rank" })
|
|
157
|
+
] })
|
|
158
|
+
] }),
|
|
159
|
+
!a && /* @__PURE__ */ i(k, { children: [
|
|
160
|
+
/* @__PURE__ */ s(ws, {}),
|
|
161
|
+
/* @__PURE__ */ i("div", { children: [
|
|
162
|
+
"TOP ",
|
|
163
|
+
u || 0,
|
|
164
|
+
"%"
|
|
165
|
+
] })
|
|
166
|
+
] })
|
|
167
|
+
] })
|
|
168
|
+
] })
|
|
169
|
+
] }) }) }),
|
|
170
|
+
/* @__PURE__ */ i(vs, { children: [
|
|
171
|
+
!a && /* @__PURE__ */ i(Ss, { children: [
|
|
172
|
+
/* @__PURE__ */ s($, { loading: e, style: { width: "100%" }, children: /* @__PURE__ */ s(x, { indicator: c || 0, title: "Friends rank" }) }),
|
|
173
|
+
/* @__PURE__ */ s($, { loading: e, style: { width: "100%" }, children: /* @__PURE__ */ s(x, { indicator: d || 0, title: "Global rank" }) })
|
|
174
|
+
] }),
|
|
175
|
+
/* @__PURE__ */ s($, { loading: e, children: /* @__PURE__ */ i(Ls, { children: [
|
|
176
|
+
/* @__PURE__ */ s(A, { indicator: p || 0, title: "Win streak" }),
|
|
177
|
+
/* @__PURE__ */ s(A, { indicator: l || 0, title: "Correct" }),
|
|
178
|
+
/* @__PURE__ */ s(A, { indicator: m || 0, title: "Incorrect" }),
|
|
179
|
+
/* @__PURE__ */ s(A, { indicator: `${b || 0}%`, title: "Succ. rate" })
|
|
180
|
+
] }) })
|
|
181
|
+
] })
|
|
182
|
+
] }), Rs = /* @__PURE__ */ n("div")({
|
|
183
|
+
name: "Container",
|
|
184
|
+
class: "c115qtkr",
|
|
185
|
+
propsAsIs: !1
|
|
186
|
+
}), Ms = /* @__PURE__ */ n("div")({
|
|
187
|
+
name: "STabs",
|
|
188
|
+
class: "sxnslc8",
|
|
189
|
+
propsAsIs: !1
|
|
190
|
+
}), Vs = /* @__PURE__ */ n("button")({
|
|
191
|
+
name: "Button",
|
|
192
|
+
class: "b1umzux0",
|
|
193
|
+
propsAsIs: !1
|
|
194
|
+
}), Ds = /* @__PURE__ */ n("span")({
|
|
195
|
+
name: "Title",
|
|
196
|
+
class: "tspsaas",
|
|
197
|
+
propsAsIs: !1
|
|
198
|
+
});
|
|
199
|
+
var C = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(C || {});
|
|
200
|
+
const R = ({ title: e, active: a, onClick: t }) => /* @__PURE__ */ s(Vs, { "data-a": "intr", onClick: t, "data-selected": a, children: /* @__PURE__ */ s(Ds, { "data-a": "intr", children: e }) }), Us = ({ activePage: e = "home", toggleActivePage: a }) => /* @__PURE__ */ s(Rs, { children: /* @__PURE__ */ i(Ms, { "data-position": e === "home" ? "left" : "right", children: [
|
|
201
|
+
/* @__PURE__ */ s(R, { title: "Home", active: e === "home", onClick: () => a(
|
|
202
|
+
"home"
|
|
203
|
+
/* HOME */
|
|
204
|
+
) }),
|
|
205
|
+
/* @__PURE__ */ s(
|
|
206
|
+
R,
|
|
207
|
+
{
|
|
208
|
+
title: "Friends",
|
|
209
|
+
active: e === "leaderboard",
|
|
210
|
+
onClick: () => a(
|
|
211
|
+
"leaderboard"
|
|
212
|
+
/* LEADERBOARD */
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
] }) }), js = /* @__PURE__ */ n("button")({
|
|
217
|
+
name: "Container",
|
|
218
|
+
class: "cpjnajb",
|
|
219
|
+
propsAsIs: !1
|
|
220
|
+
}), Fs = /* @__PURE__ */ n("div")({
|
|
221
|
+
name: "Content",
|
|
222
|
+
class: "c4m6kaz",
|
|
223
|
+
propsAsIs: !1
|
|
224
|
+
}), Ps = /* @__PURE__ */ n("span")({
|
|
225
|
+
name: "Title",
|
|
226
|
+
class: "t1h8t9cc",
|
|
227
|
+
propsAsIs: !1
|
|
228
|
+
}), Bs = () => /* @__PURE__ */ s(js, { children: /* @__PURE__ */ i(Fs, { children: [
|
|
229
|
+
/* @__PURE__ */ s(v, { name: "iconCopySuccess" }),
|
|
230
|
+
/* @__PURE__ */ s(Ps, { children: "Link Copied to Clipboard" })
|
|
231
|
+
] }) }), B = (e) => {
|
|
232
|
+
const a = y(), [t, o] = w(null), r = P(
|
|
233
|
+
async (c) => {
|
|
234
|
+
var d;
|
|
235
|
+
if (c && (d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText) {
|
|
236
|
+
a.current && (clearTimeout(a.current), o(null));
|
|
237
|
+
try {
|
|
238
|
+
await navigator.clipboard.writeText(c), e.current && (o(ts(/* @__PURE__ */ s(Bs, {}), e.current)), a.current = setTimeout(() => {
|
|
239
|
+
o(null);
|
|
240
|
+
}, 1e3));
|
|
241
|
+
} catch (p) {
|
|
242
|
+
console.error("Unable to copy to clipboard", p);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
[e]
|
|
247
|
+
);
|
|
248
|
+
return g(() => () => {
|
|
249
|
+
clearTimeout(a.current);
|
|
250
|
+
}, []), [r, t];
|
|
251
|
+
}, Es = /* @__PURE__ */ n("div")({
|
|
252
|
+
name: "Container",
|
|
253
|
+
class: "c1ux29ft",
|
|
254
|
+
propsAsIs: !1
|
|
255
|
+
}), Hs = () => v, zs = /* @__PURE__ */ n(Hs())({
|
|
256
|
+
name: "FriendsIcon",
|
|
257
|
+
class: "f10ncfg2",
|
|
258
|
+
propsAsIs: !0
|
|
259
|
+
}), Os = /* @__PURE__ */ n("div")({
|
|
260
|
+
name: "Content",
|
|
261
|
+
class: "c1yc07bd",
|
|
262
|
+
propsAsIs: !1
|
|
263
|
+
}), Qs = /* @__PURE__ */ n("div")({
|
|
264
|
+
name: "Title",
|
|
265
|
+
class: "tj6cq7w",
|
|
266
|
+
propsAsIs: !1
|
|
267
|
+
}), Ws = /* @__PURE__ */ n("div")({
|
|
268
|
+
name: "Description",
|
|
269
|
+
class: "d1ag78xo",
|
|
270
|
+
propsAsIs: !1
|
|
271
|
+
}), Zs = () => v, Ks = /* @__PURE__ */ n(Zs())({
|
|
272
|
+
name: "ArrowInviteIcon",
|
|
273
|
+
class: "awohrz6",
|
|
274
|
+
propsAsIs: !0
|
|
275
|
+
}), _s = ({ title: e, description: a, onClick: t, className: o }) => {
|
|
276
|
+
const [r] = U({
|
|
277
|
+
type: "invitation",
|
|
278
|
+
action: "sent",
|
|
279
|
+
payload: {
|
|
280
|
+
from: j.TITLE_CARD
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
return /* @__PURE__ */ i(Es, { "data-a": "intr", onClick: r(t), className: o, children: [
|
|
284
|
+
/* @__PURE__ */ s(zs, { name: "icon-friends" }),
|
|
285
|
+
/* @__PURE__ */ i(Os, { children: [
|
|
286
|
+
/* @__PURE__ */ s(Qs, { children: e }),
|
|
287
|
+
/* @__PURE__ */ s(Ws, { children: a })
|
|
288
|
+
] }),
|
|
289
|
+
/* @__PURE__ */ s(Ks, { name: "icon-copy" })
|
|
290
|
+
] });
|
|
291
|
+
}, Gs = /* @__PURE__ */ n("div")({
|
|
292
|
+
name: "Container",
|
|
293
|
+
class: "culdu4a",
|
|
294
|
+
propsAsIs: !1
|
|
295
|
+
}), Js = /* @__PURE__ */ n("div")({
|
|
296
|
+
name: "Position",
|
|
297
|
+
class: "pwf8e69",
|
|
298
|
+
propsAsIs: !1
|
|
299
|
+
}), Xs = /* @__PURE__ */ n("img")({
|
|
300
|
+
name: "Avatar",
|
|
301
|
+
class: "atf4yh4",
|
|
302
|
+
propsAsIs: !1
|
|
303
|
+
}), Ys = /* @__PURE__ */ n("div")({
|
|
304
|
+
name: "AvatarPlaceholder",
|
|
305
|
+
class: "a1dg29ja",
|
|
306
|
+
propsAsIs: !1
|
|
307
|
+
}), se = /* @__PURE__ */ n("div")({
|
|
308
|
+
name: "Content",
|
|
309
|
+
class: "c10a68rc",
|
|
310
|
+
propsAsIs: !1
|
|
311
|
+
}), ee = /* @__PURE__ */ n("div")({
|
|
312
|
+
name: "NameContainer",
|
|
313
|
+
class: "nc4kck5",
|
|
314
|
+
propsAsIs: !1
|
|
315
|
+
}), ne = /* @__PURE__ */ n("span")({
|
|
316
|
+
name: "Name",
|
|
317
|
+
class: "njsrqgr",
|
|
318
|
+
propsAsIs: !1
|
|
319
|
+
}), ae = () => v, te = /* @__PURE__ */ n(ae())({
|
|
320
|
+
name: "CurrentUserBadge",
|
|
321
|
+
class: "c17uc4zr",
|
|
322
|
+
propsAsIs: !0
|
|
323
|
+
}), re = ({
|
|
324
|
+
friendsRank: e,
|
|
325
|
+
avatar: a,
|
|
326
|
+
name: t,
|
|
327
|
+
userId: o,
|
|
328
|
+
points: r,
|
|
329
|
+
isCurrentUser: c,
|
|
330
|
+
style: d
|
|
331
|
+
}) => /* @__PURE__ */ i(Gs, { "data-name": o, style: d, children: [
|
|
332
|
+
/* @__PURE__ */ s(Js, { children: e || 0 }),
|
|
333
|
+
/* @__PURE__ */ i(se, { children: [
|
|
334
|
+
a ? /* @__PURE__ */ s(Xs, { alt: "leaderboard-item-avatar", src: a }) : /* @__PURE__ */ s(Ys, { children: V(t || "") }),
|
|
335
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
336
|
+
/* @__PURE__ */ s(ne, { children: t || "" }),
|
|
337
|
+
c && /* @__PURE__ */ s(te, { name: "icon-star" })
|
|
338
|
+
] })
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ s("div", { children: D(r) })
|
|
341
|
+
] }), ie = /* @__PURE__ */ n("div")({
|
|
342
|
+
name: "Container",
|
|
343
|
+
class: "c16btbfp",
|
|
344
|
+
propsAsIs: !1
|
|
345
|
+
}), oe = ({
|
|
346
|
+
items: e,
|
|
347
|
+
currentUserId: a,
|
|
348
|
+
openItemDetail: t,
|
|
349
|
+
fetchMore: o,
|
|
350
|
+
scrollNode: r,
|
|
351
|
+
hasMore: c
|
|
352
|
+
}) => {
|
|
353
|
+
const d = P((p) => {
|
|
354
|
+
const l = p.target.getAttribute("data-name");
|
|
355
|
+
l && t(l);
|
|
356
|
+
}, [t]);
|
|
357
|
+
return /* @__PURE__ */ s(rs, {
|
|
358
|
+
loadMore: o,
|
|
359
|
+
initialLoad: !1,
|
|
360
|
+
hasMore: c,
|
|
361
|
+
useWindow: !1,
|
|
362
|
+
getScrollParent: () => r.current,
|
|
363
|
+
children: /* @__PURE__ */ s(ie, {
|
|
364
|
+
"data-a": "intr",
|
|
365
|
+
onClick: d,
|
|
366
|
+
children: e.map((p) => /* @__PURE__ */ s(re, {
|
|
367
|
+
...p,
|
|
368
|
+
isCurrentUser: !!a && a === p.userId
|
|
369
|
+
}, p.userId))
|
|
370
|
+
})
|
|
371
|
+
});
|
|
372
|
+
}, ce = /* @__PURE__ */ n("div")({
|
|
373
|
+
name: "Container",
|
|
374
|
+
class: "c1itm4k7",
|
|
375
|
+
propsAsIs: !1
|
|
376
|
+
}), le = /* @__PURE__ */ n("div")({
|
|
377
|
+
name: "IconContainer",
|
|
378
|
+
class: "i1w4fsni",
|
|
379
|
+
propsAsIs: !1
|
|
380
|
+
}), de = () => v, pe = /* @__PURE__ */ n(de())({
|
|
381
|
+
name: "InviteGameIcon",
|
|
382
|
+
class: "i19m85r1",
|
|
383
|
+
propsAsIs: !0
|
|
384
|
+
}), me = /* @__PURE__ */ n("div")({
|
|
385
|
+
name: "Content",
|
|
386
|
+
class: "c1mbu204",
|
|
387
|
+
propsAsIs: !1
|
|
388
|
+
}), ue = /* @__PURE__ */ n("div")({
|
|
389
|
+
name: "Heading",
|
|
390
|
+
class: "h1amdqtv",
|
|
391
|
+
propsAsIs: !1
|
|
392
|
+
}), he = /* @__PURE__ */ n("div")({
|
|
393
|
+
name: "Subtext",
|
|
394
|
+
class: "s1lhlj9j",
|
|
395
|
+
propsAsIs: !1
|
|
396
|
+
}), ve = /* @__PURE__ */ n("div")({
|
|
397
|
+
name: "LinkContainer",
|
|
398
|
+
class: "l1wot35e",
|
|
399
|
+
propsAsIs: !1
|
|
400
|
+
}), Ie = /* @__PURE__ */ n("div")({
|
|
401
|
+
name: "LinkInfo",
|
|
402
|
+
class: "l1jdw39q",
|
|
403
|
+
propsAsIs: !1
|
|
404
|
+
}), Ce = /* @__PURE__ */ n("span")({
|
|
405
|
+
name: "LinkTitle",
|
|
406
|
+
class: "l1cr5mk",
|
|
407
|
+
propsAsIs: !1
|
|
408
|
+
}), $e = /* @__PURE__ */ n("span")({
|
|
409
|
+
name: "LinkAddress",
|
|
410
|
+
class: "lvi87q4",
|
|
411
|
+
propsAsIs: !1
|
|
412
|
+
}), Ae = () => v, ge = /* @__PURE__ */ n(Ae())({
|
|
413
|
+
name: "LinkIcon",
|
|
414
|
+
class: "l1pqlvw3",
|
|
415
|
+
propsAsIs: !0
|
|
416
|
+
}), be = ({
|
|
417
|
+
inviteLink: e,
|
|
418
|
+
inviteCardTitle: a,
|
|
419
|
+
inviteCardSubtext: t,
|
|
420
|
+
primaryColor: o,
|
|
421
|
+
className: r
|
|
422
|
+
}) => {
|
|
423
|
+
const c = y(null), [d, p] = B(c), [l] = U({
|
|
424
|
+
type: "invitation",
|
|
425
|
+
action: "sent",
|
|
426
|
+
payload: {
|
|
427
|
+
from: j.MENU
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
return /* @__PURE__ */ i(ce, { className: r, children: [
|
|
431
|
+
/* @__PURE__ */ s(le, { style: { backgroundColor: o }, children: /* @__PURE__ */ s(pe, { name: "invite-game-icon" }) }),
|
|
432
|
+
/* @__PURE__ */ i(me, { children: [
|
|
433
|
+
/* @__PURE__ */ s(ue, { children: a || "" }),
|
|
434
|
+
/* @__PURE__ */ s(he, { children: t || "" })
|
|
435
|
+
] }),
|
|
436
|
+
e && /* @__PURE__ */ i(ve, { ref: c, "data-a": "intr", onClick: l(() => d(e)), children: [
|
|
437
|
+
/* @__PURE__ */ i(Ie, { children: [
|
|
438
|
+
/* @__PURE__ */ s(Ce, { children: "Invite link" }),
|
|
439
|
+
/* @__PURE__ */ s($e, { children: e })
|
|
440
|
+
] }),
|
|
441
|
+
/* @__PURE__ */ s(ge, { name: "icon-copy" })
|
|
442
|
+
] }),
|
|
443
|
+
p
|
|
444
|
+
] });
|
|
445
|
+
}, fe = /* @__PURE__ */ n("div")({
|
|
446
|
+
name: "InviteFriendsContainer",
|
|
447
|
+
class: "i1c9dygq",
|
|
448
|
+
propsAsIs: !1
|
|
449
|
+
}), ke = ({
|
|
450
|
+
deepLink: e
|
|
451
|
+
}) => /* @__PURE__ */ s(fe, {
|
|
452
|
+
children: /* @__PURE__ */ s(be, {
|
|
453
|
+
inviteLink: e,
|
|
454
|
+
inviteCardTitle: "It’s More Fun With Friends",
|
|
455
|
+
inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
|
|
456
|
+
})
|
|
457
|
+
}), ye = /* @__PURE__ */ n("div")({
|
|
458
|
+
name: "InviteLinkContainer",
|
|
459
|
+
class: "i1odbhm4",
|
|
460
|
+
propsAsIs: !1
|
|
461
|
+
}), we = ({
|
|
462
|
+
gamification: e,
|
|
463
|
+
scrollNode: a,
|
|
464
|
+
scrollStore: t
|
|
465
|
+
}) => {
|
|
466
|
+
const o = y(null), {
|
|
467
|
+
data: r,
|
|
468
|
+
hasMore: c,
|
|
469
|
+
loading: d,
|
|
470
|
+
key: p
|
|
471
|
+
} = h(e.leaderboardList.$store), {
|
|
472
|
+
data: l
|
|
473
|
+
} = h(e.deepLink.$store), [m, u] = B(o);
|
|
474
|
+
return !r.length && !d ? /* @__PURE__ */ s(ke, {
|
|
475
|
+
deepLink: l
|
|
476
|
+
}) : /* @__PURE__ */ i(k, {
|
|
477
|
+
children: [/* @__PURE__ */ s(oe, {
|
|
478
|
+
items: r,
|
|
479
|
+
scrollNode: a,
|
|
480
|
+
scrollStore: t,
|
|
481
|
+
fetchMore: e.leaderboardList.fetchMore,
|
|
482
|
+
hasMore: c,
|
|
483
|
+
openItemDetail: e.openUser,
|
|
484
|
+
currentUserId: e.currentUserId.get()
|
|
485
|
+
}, p), l && /* @__PURE__ */ s(ye, {
|
|
486
|
+
ref: o,
|
|
487
|
+
children: /* @__PURE__ */ s(_s, {
|
|
488
|
+
"data-a": "intr",
|
|
489
|
+
onClick: () => m(l),
|
|
490
|
+
title: "Invite Friends",
|
|
491
|
+
description: "Challenge them now!"
|
|
492
|
+
})
|
|
493
|
+
}), u]
|
|
494
|
+
});
|
|
495
|
+
}, Se = () => F, Le = /* @__PURE__ */ n(Se())({
|
|
496
|
+
name: "Container",
|
|
497
|
+
class: "cll3md7",
|
|
498
|
+
propsAsIs: !0
|
|
499
|
+
}), Te = () => z, xe = /* @__PURE__ */ n(Te())({
|
|
500
|
+
name: "ActionBtn",
|
|
501
|
+
class: "a10g1iik",
|
|
502
|
+
propsAsIs: !0
|
|
503
|
+
}), qe = ({ questionId: e, ...a }) => /* @__PURE__ */ i(Le, { "data-a": "intr", "data-name": e, children: [
|
|
504
|
+
/* @__PURE__ */ s(O, { questionId: e, ...a }),
|
|
505
|
+
/* @__PURE__ */ s(xe, { "data-a": "intr", "data-name": e, children: "View Insight" })
|
|
506
|
+
] }), Ne = () => F, Re = /* @__PURE__ */ n(Ne())({
|
|
507
|
+
name: "Container",
|
|
508
|
+
class: "cl56x6b",
|
|
509
|
+
propsAsIs: !0
|
|
510
|
+
}), Me = /* @__PURE__ */ n("button")({
|
|
511
|
+
name: "ActionButton",
|
|
512
|
+
class: "a11pzf92",
|
|
513
|
+
propsAsIs: !1
|
|
514
|
+
}), Ve = /* @__PURE__ */ n("blockquote")({
|
|
515
|
+
name: "Quote",
|
|
516
|
+
class: "q1hbaleq",
|
|
517
|
+
propsAsIs: !1
|
|
518
|
+
}), De = ({ ...e }) => /* @__PURE__ */ i(Re, { "data-a": "intr", "data-name": e.tweetId, children: [
|
|
519
|
+
e.title && /* @__PURE__ */ s(Ve, { children: e.title }),
|
|
520
|
+
/* @__PURE__ */ s(Q, { ...e }),
|
|
521
|
+
/* @__PURE__ */ s(Me, { "data-a": "intr", "data-name": e.tweetId, children: "View Insight" })
|
|
522
|
+
] }), M = /* @__PURE__ */ n("div")({
|
|
523
|
+
name: "QuestionsContainer",
|
|
524
|
+
class: "qvghv3l",
|
|
525
|
+
propsAsIs: !1
|
|
526
|
+
}), Ue = ({ questions: e, openQuestion: a, controlVideo: t }) => e ? /* @__PURE__ */ s(M, { "data-a": "intr", onClick: (r) => {
|
|
527
|
+
const c = r.target.getAttribute("data-name");
|
|
528
|
+
c && (K(), a(c, { openedFrom: "list" }));
|
|
529
|
+
}, children: e == null ? void 0 : e.map((r) => {
|
|
530
|
+
var c, d, p;
|
|
531
|
+
if (r.type === "question" && ((c = r.attributes) == null ? void 0 : c.attributes.case) === "question") {
|
|
532
|
+
const l = r.attributes.attributes.value;
|
|
533
|
+
return /* @__PURE__ */ s(W, { ...l }, l.questionId);
|
|
534
|
+
}
|
|
535
|
+
if (r.type === "insight" && ((d = r.attributes) == null ? void 0 : d.attributes.case) === "insight") {
|
|
536
|
+
const l = r.attributes.attributes.value;
|
|
537
|
+
return /* @__PURE__ */ s(qe, { controlVideo: t, ...l }, l.questionId);
|
|
538
|
+
}
|
|
539
|
+
if (r.type === "tweet" && ((p = r.attributes) == null ? void 0 : p.attributes.case) === "tweet") {
|
|
540
|
+
const l = r.attributes.attributes.value, m = r.attributes.id;
|
|
541
|
+
return /* @__PURE__ */ s(De, { controlVideo: t, ...l, tweetId: m }, m);
|
|
542
|
+
}
|
|
543
|
+
return null;
|
|
544
|
+
}) }) : /* @__PURE__ */ s(M, { children: Array.from({ length: 5 }).map((r, c) => /* @__PURE__ */ s(Z, {}, c)) }), je = ({ store: e, openQuestion: a }) => {
|
|
545
|
+
const { sdk: t } = _(), o = h(e);
|
|
546
|
+
return /* @__PURE__ */ s(Ue, { openQuestion: a, questions: o.data, controlVideo: t == null ? void 0 : t.controlVideoPlayer });
|
|
547
|
+
}, Fe = ({ userSummary: e }) => {
|
|
548
|
+
var a;
|
|
549
|
+
const [t, o] = w(void 0);
|
|
550
|
+
return g(() => {
|
|
551
|
+
const r = e.$store.subscribe((c) => {
|
|
552
|
+
c && o(c);
|
|
553
|
+
});
|
|
554
|
+
return () => {
|
|
555
|
+
r();
|
|
556
|
+
};
|
|
557
|
+
}, [e]), /* @__PURE__ */ s(Ns, { loading: !(t != null && t.summary), ...t == null ? void 0 : t.summary, successRate: (a = t == null ? void 0 : t.percentage) == null ? void 0 : a.correct });
|
|
558
|
+
}, Pe = ({ gamification: e, className: a, scrollStore: t, scrollNode: o, appNode: r, style: c, responsiveStore: d }) => {
|
|
559
|
+
const { tabsShown: p } = h(t, { keys: ["tabsShown"] }), l = h(e.friendsTabEnabled), [m, u] = w(C.HOME), [, b] = G(), { sdkInDesktopView: S, screen: E } = h(d, { keys: ["sdkInDesktopView"] }), H = (I) => {
|
|
560
|
+
b(() => {
|
|
561
|
+
var L;
|
|
562
|
+
u(I), S === !1 && (((L = r.current) == null ? void 0 : L.getBoundingClientRect().y) || 0) < 0 && is(r, E.size, { behavior: "instant" });
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
g(() => t.subscribe((I) => {
|
|
566
|
+
if (I.scrollPosition === 0) {
|
|
567
|
+
t.setKey("tabsShown", !0);
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
d.get().sdkInDesktopView ? t.setKey("tabsShown", I.scrollDirection === "backward") : t.setKey("tabsShown", I.scrollDirection === "forward");
|
|
571
|
+
}), [t, d]), g(() => {
|
|
572
|
+
l || u(C.HOME);
|
|
573
|
+
}, [l]);
|
|
574
|
+
let f = "0px";
|
|
575
|
+
return S ? f = p ? "0px" : "calc(0px - var(--header-height))" : f = p ? "var(--header-height)" : "0px", /* @__PURE__ */ i(J, { className: X(a, "SL-Tabs", "sl-hide-on-modal"), style: c, children: [
|
|
576
|
+
l && /* @__PURE__ */ s(
|
|
577
|
+
Y,
|
|
578
|
+
{
|
|
579
|
+
style: {
|
|
580
|
+
top: f
|
|
581
|
+
},
|
|
582
|
+
children: /* @__PURE__ */ s(Us, { activePage: m, toggleActivePage: H })
|
|
583
|
+
}
|
|
584
|
+
),
|
|
585
|
+
m === C.HOME && /* @__PURE__ */ i(k, { children: [
|
|
586
|
+
/* @__PURE__ */ s(ss, { children: /* @__PURE__ */ s(es, { children: /* @__PURE__ */ s(Fe, { userSummary: e.userSummary }) }) }),
|
|
587
|
+
/* @__PURE__ */ s(ns, { style: { flex: 1 }, children: /* @__PURE__ */ s(je, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
|
|
588
|
+
] }),
|
|
589
|
+
m === C.LEADERBOARD && /* @__PURE__ */ s(as, { children: /* @__PURE__ */ s(we, { scrollStore: t, scrollNode: o, gamification: e }) })
|
|
590
|
+
] });
|
|
591
|
+
}, Ge = ({
|
|
592
|
+
gamification: e,
|
|
593
|
+
scrollStore: a,
|
|
594
|
+
className: t,
|
|
595
|
+
appNode: o,
|
|
596
|
+
scrollNode: r,
|
|
597
|
+
responsiveStore: c
|
|
598
|
+
}) => /* @__PURE__ */ s(Pe, {
|
|
599
|
+
appNode: o,
|
|
600
|
+
scrollStore: a,
|
|
601
|
+
scrollNode: r,
|
|
602
|
+
className: t,
|
|
603
|
+
gamification: e,
|
|
604
|
+
responsiveStore: c
|
|
605
|
+
});
|
|
2
606
|
export {
|
|
3
|
-
|
|
607
|
+
Ge as default
|
|
4
608
|
};
|
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import "nanostores";
|
|
2
|
+
import { j as i, q as p, k as y, o as L, t as v, v as u } from "./index2.js";
|
|
4
3
|
import "react";
|
|
4
|
+
import "nanostores";
|
|
5
5
|
import "lodash.throttle";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "react-countup";
|