@streamlayer/react-ui 0.98.1 → 0.100.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/assets/style.css +1 -1
- package/lib/hooks/showIn.js +45 -0
- package/lib/{index-jRXrW6ie.js → index-Bicco-Aq.js} +1 -1
- package/lib/{index-z0QjLiEL.js → index-CZvwzN5o.js} +1 -1
- package/lib/index.js +4 -8
- package/lib/ui/app/Features/Gamification/Friends.js +10 -23
- package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +1 -2
- package/lib/ui/app/Features/Gamification/Leaderboard.js +37 -54
- package/lib/ui/app/Features/Gamification/Question.js +33 -65
- package/lib/ui/app/Features/Gamification/QuestionsList.js +8 -34
- package/lib/ui/app/Features/Gamification/Tabs.d.ts +1 -2
- package/lib/ui/app/Features/Gamification/Tabs.js +30 -97
- package/lib/ui/app/Features/Gamification/UserSummary.js +12 -21
- package/lib/ui/app/Features/Gamification/gamification-feature.js +2 -93
- package/lib/ui/app/Features/Gamification/index.d.ts +1 -2
- package/lib/ui/app/Features/Gamification/index.js +68 -143
- package/lib/ui/app/Features/index.d.ts +1 -2
- package/lib/ui/app/Features/index.js +20 -109
- package/lib/ui/app/Navigation/MastersNavigation/index.js +16 -22
- package/lib/ui/app/Navigation/index.js +9 -12
- package/lib/ui/app/Notifications/Onboarding/Notification/index.js +13 -16
- package/lib/ui/app/Notifications/Onboarding/Notification/styles.js +18 -20
- package/lib/ui/app/Notifications/Onboarding/index.js +45 -72
- package/lib/ui/app/Notifications/index.js +96 -148
- package/lib/ui/app/Notifications/styles.js +10 -15
- package/lib/ui/app/Points/index.js +18 -26
- package/lib/ui/app/masters.js +71 -190
- package/lib/ui/app/useClipboardCopy.js +11 -15
- package/lib/ui/app/useMastersApp.js +34 -44
- package/lib/ui/app/useSdkResponsive.js +18 -19
- package/lib/ui/app/useSdkScroll.js +28 -26
- package/lib/ui/button/index.js +3 -4
- package/lib/ui/gamification/copyNotification/index.js +5 -7
- package/lib/ui/gamification/detail/header/index.js +15 -18
- package/lib/ui/gamification/detail/header/styles.js +12 -14
- package/lib/ui/gamification/detail/sponsor/index.js +2 -3
- package/lib/ui/gamification/insight/index.js +5 -6
- package/lib/ui/gamification/insight-list/index.js +3 -6
- package/lib/ui/gamification/invite-link/index.js +11 -17
- package/lib/ui/gamification/invite-link/styles.js +13 -15
- package/lib/ui/gamification/leaderboard/index.js +21 -28
- package/lib/ui/gamification/leaderboard/list-item/index.d.ts +0 -1
- package/lib/ui/gamification/leaderboard/list-item/index.js +17 -20
- package/lib/ui/gamification/leaderboard/list-item/styles.js +16 -18
- package/lib/ui/gamification/leaderboard/static.js +34 -31
- package/lib/ui/gamification/leaderboard/styles.js +1 -1
- package/lib/ui/gamification/onboarding/index.js +51 -73
- package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -11
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +3 -2
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +17 -20
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +2 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +21 -11
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +21 -30
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +22 -24
- package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +5 -7
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +2 -3
- package/lib/ui/gamification/onboarding/styles.js +14 -17
- package/lib/ui/gamification/points/index.js +9 -15
- package/lib/ui/gamification/points/styles.js +12 -14
- package/lib/ui/gamification/question/index.d.ts +1 -3
- package/lib/ui/gamification/question/index.js +29 -34
- package/lib/ui/gamification/question/insight/index.d.ts +0 -1
- package/lib/ui/gamification/question/insight/index.js +7 -15
- package/lib/ui/gamification/question/list/index.js +20 -57
- package/lib/ui/gamification/question/notification/index.js +22 -35
- package/lib/ui/gamification/question/notification/insight/index.js +12 -17
- package/lib/ui/gamification/question/notification/pill/index.js +7 -9
- package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +11 -12
- package/lib/ui/gamification/question/notification/prediction-result/index.js +45 -51
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +23 -26
- package/lib/ui/gamification/question/notification/styles.js +17 -19
- package/lib/ui/gamification/question/notification/tweet/index.js +8 -18
- package/lib/ui/gamification/question/styles.js +32 -34
- package/lib/ui/gamification/question/twitter/index.d.ts +0 -1
- package/lib/ui/gamification/question/twitter/index.js +8 -20
- package/lib/ui/gamification/question/twitter/styles.js +4 -6
- package/lib/ui/gamification/tabs/index.js +6 -7
- package/lib/ui/gamification/user-statistics/components/rank/index.js +4 -5
- package/lib/ui/gamification/user-statistics/components/statistic/index.js +0 -1
- package/lib/ui/gamification/user-statistics/index.js +2 -6
- package/lib/ui/gamification/vote/alert/index.d.ts +8 -0
- package/lib/ui/gamification/vote/alert/index.js +11 -0
- package/lib/ui/gamification/vote/{expired-alert → alert}/styles.js +7 -7
- package/lib/ui/gamification/vote/feedback/index.js +29 -33
- package/lib/ui/gamification/vote/feedback/styles.js +20 -23
- package/lib/ui/gamification/vote/index.d.ts +1 -0
- package/lib/ui/gamification/vote/index.js +123 -117
- package/lib/ui/gamification/vote/insight-details/index.js +9 -16
- package/lib/ui/gamification/vote/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/styles.js +14 -8
- package/lib/ui/gamification/vote/twitter-details/index.js +7 -17
- package/lib/ui/gamification/vote/vote-option/index.js +38 -41
- package/lib/ui/gamification/vote/vote-option/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/vote-option/styles.js +35 -32
- package/lib/ui/gamification/vote/win-bar/index.js +29 -37
- package/lib/ui/gamification/vote/win-bar/styles.js +16 -19
- package/lib/ui/login/demo.d.ts +1 -0
- package/lib/ui/login/demo.js +5 -17
- package/lib/ui/login/index.js +29 -35
- package/lib/ui/modal/index.js +31 -32
- package/lib/ui/navigation/button/Channels.js +5 -8
- package/lib/ui/navigation/button/FeaturedGroups.js +3 -6
- package/lib/ui/navigation/button/LeaderBoard.js +8 -11
- package/lib/ui/navigation/button/index.js +10 -11
- package/lib/ui/navigation/masters.js +2 -3
- package/lib/ui/questions/insight/index.js +14 -19
- package/lib/ui/questions/twitter/account/index.js +13 -15
- package/lib/ui/questions/twitter/account/styles.js +14 -16
- package/lib/ui/questions/twitter/index.js +31 -38
- package/lib/ui/show-in/index.d.ts +1 -0
- package/lib/ui/show-in/index.js +12 -10
- package/lib/ui/skeleton/index.js +3 -4
- package/lib/ui/theme/index.js +3 -5
- package/lib/ui/video-player/index.js +44 -38
- package/lib/utils/createDemo.js +18 -28
- package/lib/utils/debug/components/copyLogs.js +2 -3
- package/lib/utils/debug/components/developer.js +20 -24
- package/lib/utils/debug/components/eventInput.js +9 -10
- package/lib/utils/debug/components/sdkKey.js +9 -10
- package/lib/utils/debug/index.js +17 -28
- package/lib/utils/debug/storage.js +32 -14
- package/lib/utils/decorators/container.js +5 -9
- package/lib/utils/storage.js +32 -14
- package/package.json +25 -26
- package/lib/ui/gamification/vote/expired-alert/index.d.ts +0 -7
- package/lib/ui/gamification/vote/expired-alert/index.js +0 -13
- /package/lib/{index-uEuzH3jr.js → index-xuotMAFm.js} +0 -0
- /package/lib/{styles_z07sl8-w40geAFS.js → styles_z07sl8-l0sNRNKZ.js} +0 -0
- /package/lib/ui/gamification/vote/{expired-alert → alert}/styles.d.ts +0 -0
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
2
|
import { SDKScrollContainer as o } from "../../app/styles.js";
|
|
3
|
+
import { ShowIn as n } from "../../show-in/index.js";
|
|
3
4
|
const l = /* @__PURE__ */ s("div")({
|
|
4
5
|
name: "Container",
|
|
5
6
|
class: "c14ielyq",
|
|
6
7
|
propsAsIs: !1
|
|
7
|
-
}),
|
|
8
|
+
}), t = () => o, i = /* @__PURE__ */ s(t())({
|
|
8
9
|
name: "QuestionScrollContainer",
|
|
9
10
|
class: "q1tlqx57",
|
|
10
11
|
propsAsIs: !0
|
|
11
|
-
}),
|
|
12
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
12
13
|
name: "Content",
|
|
13
14
|
class: "c1hq58md",
|
|
14
15
|
propsAsIs: !1
|
|
15
|
-
}),
|
|
16
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
16
17
|
name: "Title",
|
|
17
18
|
class: "t1c8nxcx",
|
|
18
19
|
propsAsIs: !1
|
|
19
|
-
}),
|
|
20
|
+
}), C = /* @__PURE__ */ s("div")({
|
|
20
21
|
name: "Options",
|
|
21
22
|
class: "oiozuc3",
|
|
22
23
|
propsAsIs: !1
|
|
24
|
+
}), e = () => n, A = /* @__PURE__ */ s(e())({
|
|
25
|
+
name: "AlertContainer",
|
|
26
|
+
class: "apnc44r",
|
|
27
|
+
propsAsIs: !0
|
|
23
28
|
});
|
|
24
29
|
export {
|
|
30
|
+
A as AlertContainer,
|
|
25
31
|
l as Container,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
p as Content,
|
|
33
|
+
C as Options,
|
|
34
|
+
i as QuestionScrollContainer,
|
|
35
|
+
m as Title
|
|
30
36
|
};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { TwitterContent as
|
|
3
|
-
import { Container as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "../../../icons/index.js";
|
|
8
|
-
import "@linaria/react";
|
|
9
|
-
import "../../../video-player/styles.js";
|
|
10
|
-
import "../../../questions/twitter/account/index.js";
|
|
11
|
-
import "../../../../utils/common.js";
|
|
12
|
-
import "../../../questions/twitter/account/styles.js";
|
|
13
|
-
import "../../../questions/twitter/styles.js";
|
|
14
|
-
const C = (t) => /* @__PURE__ */ r(m, { children: [
|
|
15
|
-
t.title && /* @__PURE__ */ i(e, { children: t.title }),
|
|
16
|
-
/* @__PURE__ */ i(o, { ...t, isDetail: !0 })
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { TwitterContent as r } from "../../../questions/twitter/index.js";
|
|
3
|
+
import { Container as o, Quote as n } from "./styles.js";
|
|
4
|
+
const a = (t) => /* @__PURE__ */ i(o, { children: [
|
|
5
|
+
t.title && /* @__PURE__ */ e(n, { children: t.title }),
|
|
6
|
+
/* @__PURE__ */ e(r, { ...t, isDetail: !0 })
|
|
17
7
|
] });
|
|
18
8
|
export {
|
|
19
|
-
|
|
9
|
+
a as TwitterDetails
|
|
20
10
|
};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as j, useLayoutEffect as U } from "react";
|
|
3
|
-
import { QuestionImages as a, QuestionType as o, QuestionStatus as
|
|
4
|
-
import { AnimatedCounter as
|
|
5
|
-
import { IconDefault as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[a.CENTERED]: (t) => /* @__PURE__ */ e(y, { alt: "option-icon", src: t }),
|
|
11
|
-
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
|
|
12
|
-
[a.ROUNDED]: (t) => /* @__PURE__ */ e(W, { alt: "option-icon", src: t }),
|
|
3
|
+
import { QuestionImages as a, QuestionType as o, QuestionStatus as p } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { AnimatedCounter as W } from "../../../animated-counter/index.js";
|
|
5
|
+
import { IconDefault as $, IconContainer as y, IconWrap as F, IconCircle as M, ButtonContainer as z, ButtonPctWrap as G, ButtonPct as H, ButtonBody as J, Title as K, Pts as X, Indicators as Y, CheckIcon as Z, Percentage as _ } from "./styles.js";
|
|
6
|
+
const h = {
|
|
7
|
+
[a.CENTERED]: (t) => /* @__PURE__ */ e($, { alt: "option-icon", src: t }),
|
|
8
|
+
[a.TRANSPARENT]: (t) => /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(F, { style: { backgroundImage: `url(${t})` } }) }),
|
|
9
|
+
[a.ROUNDED]: (t) => /* @__PURE__ */ e(M, { alt: "option-icon", src: t }),
|
|
13
10
|
[a.NONE]: () => null,
|
|
14
11
|
[a.UNSET]: () => null
|
|
15
|
-
},
|
|
12
|
+
}, q = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
|
|
16
13
|
if (t === o.POLL && r)
|
|
17
14
|
return "correct";
|
|
18
15
|
if (t === o.PREDICTION) {
|
|
@@ -22,14 +19,14 @@ const E = {
|
|
|
22
19
|
return "correct";
|
|
23
20
|
}
|
|
24
21
|
return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
|
|
25
|
-
},
|
|
22
|
+
}, tt = ({
|
|
26
23
|
questionType: t,
|
|
27
24
|
questionVoted: c,
|
|
28
25
|
correct: n,
|
|
29
26
|
hasCorrectAnswer: r,
|
|
30
27
|
questionStatus: i
|
|
31
|
-
}) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i ===
|
|
32
|
-
var
|
|
28
|
+
}) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === p.RESOLVED && n : !1, ct = (t) => {
|
|
29
|
+
var S;
|
|
33
30
|
const {
|
|
34
31
|
// option props
|
|
35
32
|
id: c,
|
|
@@ -40,58 +37,58 @@ const E = {
|
|
|
40
37
|
// extra props
|
|
41
38
|
onVote: w,
|
|
42
39
|
markThatVoted: A,
|
|
43
|
-
onPercentsAnimated:
|
|
44
|
-
youSelected:
|
|
40
|
+
onPercentsAnimated: f,
|
|
41
|
+
youSelected: E,
|
|
45
42
|
questionVoted: s,
|
|
46
43
|
imageMode: C,
|
|
47
44
|
answerTimeExpired: O,
|
|
48
|
-
questionStatus:
|
|
45
|
+
questionStatus: P,
|
|
49
46
|
isLoading: g,
|
|
50
47
|
questionType: d,
|
|
51
48
|
correct: k,
|
|
52
49
|
hasCorrectAnswer: v,
|
|
53
50
|
votedAfterQuestionClosed: x,
|
|
54
|
-
enteredAnActiveQuestion:
|
|
55
|
-
marketClosed:
|
|
56
|
-
} = t, [L,
|
|
51
|
+
enteredAnActiveQuestion: R,
|
|
52
|
+
marketClosed: I
|
|
53
|
+
} = t, [L, T] = j(0), m = q(t), B = tt({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: v, questionStatus: P }), u = I && d === o.PREDICTION, N = s || u, Q = d === o.PREDICTION && !s && !I, V = s && !E && m !== "incorrect";
|
|
57
54
|
return U(() => {
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
T(0), requestAnimationFrame(() => {
|
|
56
|
+
T(i);
|
|
60
57
|
});
|
|
61
58
|
}, [i]), /* @__PURE__ */ l(
|
|
62
59
|
z,
|
|
63
60
|
{
|
|
64
61
|
value: c,
|
|
65
|
-
"data-selected":
|
|
66
|
-
"data-answer-state":
|
|
67
|
-
disabled: s || g || O || u && !
|
|
62
|
+
"data-selected": E,
|
|
63
|
+
"data-answer-state": m,
|
|
64
|
+
disabled: s || g || O || u && !R || u && R && x,
|
|
68
65
|
"data-is-not-checked": V,
|
|
69
66
|
onClick: (b) => {
|
|
70
67
|
A(
|
|
71
|
-
d === o.PREDICTION ?
|
|
68
|
+
d === o.PREDICTION ? I : P === p.RESOLVED
|
|
72
69
|
), w(b);
|
|
73
70
|
},
|
|
74
71
|
children: [
|
|
75
|
-
/* @__PURE__ */ e(
|
|
76
|
-
|
|
72
|
+
/* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
|
|
73
|
+
H,
|
|
77
74
|
{
|
|
78
|
-
"data-answer-state":
|
|
79
|
-
style: { width: `${
|
|
75
|
+
"data-answer-state": m,
|
|
76
|
+
style: { width: `${N ? L : 0}%` },
|
|
80
77
|
onTransitionEnd: () => {
|
|
81
|
-
u ||
|
|
78
|
+
u || f == null || f();
|
|
82
79
|
}
|
|
83
80
|
}
|
|
84
|
-
),
|
|
85
|
-
/* @__PURE__ */ l(
|
|
86
|
-
n && C && ((
|
|
87
|
-
/* @__PURE__ */ e(
|
|
88
|
-
|
|
81
|
+
) }),
|
|
82
|
+
/* @__PURE__ */ l(J, { children: [
|
|
83
|
+
n && C && ((S = h[C]) == null ? void 0 : S.call(h, n)),
|
|
84
|
+
/* @__PURE__ */ e(K, { children: r }),
|
|
85
|
+
Q && /* @__PURE__ */ l("div", { children: [
|
|
89
86
|
D,
|
|
90
|
-
/* @__PURE__ */ e(
|
|
87
|
+
/* @__PURE__ */ e(X, { children: "pts" })
|
|
91
88
|
] }),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
/* @__PURE__ */ e(
|
|
89
|
+
N && /* @__PURE__ */ l(Y, { children: [
|
|
90
|
+
B && /* @__PURE__ */ e(Z, { name: "selected" }),
|
|
91
|
+
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(W, { value: i, suffix: "%" }) })
|
|
95
92
|
] })
|
|
96
93
|
] })
|
|
97
94
|
]
|
|
@@ -99,5 +96,5 @@ const E = {
|
|
|
99
96
|
);
|
|
100
97
|
};
|
|
101
98
|
export {
|
|
102
|
-
|
|
99
|
+
ct as VotingOption
|
|
103
100
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const ButtonContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const ButtonPctWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
4
|
export declare const ButtonPct: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
5
|
export declare const ButtonBody: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
5
6
|
export declare const IconContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,72 +1,75 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
2
|
import { SvgIcon as o } from "../../../icons/index.js";
|
|
3
|
-
|
|
4
|
-
import "react";
|
|
5
|
-
const I = /* @__PURE__ */ s("button")({
|
|
3
|
+
const r = /* @__PURE__ */ s("button")({
|
|
6
4
|
name: "ButtonContainer",
|
|
7
5
|
class: "b1b6dl8t",
|
|
8
6
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
10
|
-
name: "
|
|
7
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
8
|
+
name: "ButtonPctWrap",
|
|
11
9
|
class: "b4iik8i",
|
|
12
10
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
14
|
-
name: "
|
|
11
|
+
}), I = /* @__PURE__ */ s("div")({
|
|
12
|
+
name: "ButtonPct",
|
|
15
13
|
class: "b1gq1lnf",
|
|
16
14
|
propsAsIs: !1
|
|
17
|
-
}),
|
|
15
|
+
}), i = /* @__PURE__ */ s("span")({
|
|
16
|
+
name: "ButtonBody",
|
|
17
|
+
class: "b1j65z51",
|
|
18
|
+
propsAsIs: !1
|
|
19
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
18
20
|
name: "IconContainer",
|
|
19
|
-
class: "
|
|
21
|
+
class: "i19tpfua",
|
|
20
22
|
propsAsIs: !1
|
|
21
23
|
}), u = /* @__PURE__ */ s("div")({
|
|
22
24
|
name: "IconWrap",
|
|
23
|
-
class: "
|
|
25
|
+
class: "i1tubmma",
|
|
24
26
|
propsAsIs: !1
|
|
25
27
|
}), n = /* @__PURE__ */ s("img")({
|
|
26
28
|
name: "Icon",
|
|
27
|
-
class: "
|
|
29
|
+
class: "i1grrgwj",
|
|
28
30
|
propsAsIs: !1
|
|
29
|
-
}), t = () => n,
|
|
31
|
+
}), t = () => n, f = /* @__PURE__ */ s(t())({
|
|
30
32
|
name: "IconDefault",
|
|
31
|
-
class: "
|
|
33
|
+
class: "ibemyq8",
|
|
32
34
|
propsAsIs: !0
|
|
33
|
-
}), a = () => n,
|
|
35
|
+
}), a = () => n, A = /* @__PURE__ */ s(a())({
|
|
34
36
|
name: "IconCircle",
|
|
35
|
-
class: "
|
|
37
|
+
class: "i1dceht",
|
|
36
38
|
propsAsIs: !0
|
|
37
|
-
}),
|
|
39
|
+
}), d = /* @__PURE__ */ s("span")({
|
|
38
40
|
name: "Title",
|
|
39
|
-
class: "
|
|
41
|
+
class: "t116q4vq",
|
|
40
42
|
propsAsIs: !1
|
|
41
43
|
}), B = /* @__PURE__ */ s("span")({
|
|
42
44
|
name: "Indicators",
|
|
43
|
-
class: "
|
|
45
|
+
class: "i17ajcu2",
|
|
44
46
|
propsAsIs: !1
|
|
45
|
-
}),
|
|
47
|
+
}), b = /* @__PURE__ */ s("span")({
|
|
46
48
|
name: "Pts",
|
|
47
|
-
class: "
|
|
49
|
+
class: "pu9kmlb",
|
|
48
50
|
propsAsIs: !1
|
|
49
|
-
}),
|
|
51
|
+
}), C = /* @__PURE__ */ s("span")({
|
|
50
52
|
name: "Percentage",
|
|
51
|
-
class: "
|
|
53
|
+
class: "p1j2j0s0",
|
|
52
54
|
propsAsIs: !1
|
|
53
55
|
}), c = () => o, P = /* @__PURE__ */ s(c())({
|
|
54
56
|
name: "CheckIcon",
|
|
55
|
-
class: "
|
|
57
|
+
class: "c1mzj1sj",
|
|
56
58
|
propsAsIs: !0
|
|
57
59
|
});
|
|
58
60
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
i as ButtonBody,
|
|
62
|
+
r as ButtonContainer,
|
|
63
|
+
I as ButtonPct,
|
|
64
|
+
l as ButtonPctWrap,
|
|
62
65
|
P as CheckIcon,
|
|
63
66
|
n as Icon,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
A as IconCircle,
|
|
68
|
+
m as IconContainer,
|
|
69
|
+
f as IconDefault,
|
|
67
70
|
u as IconWrap,
|
|
68
71
|
B as Indicators,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
C as Percentage,
|
|
73
|
+
b as Pts,
|
|
74
|
+
d as Title
|
|
72
75
|
};
|
|
@@ -1,55 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import { AnimatedCounter as
|
|
4
|
-
import { Timer as
|
|
5
|
-
import { ShowInContainer as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import "../../../icons/index.js";
|
|
12
|
-
import "../../../show-in/index.js";
|
|
13
|
-
import "@linaria/core";
|
|
14
|
-
const F = ({
|
|
15
|
-
title: e,
|
|
16
|
-
points: o,
|
|
17
|
-
isPlayingTimer: m,
|
|
18
|
-
isTimer: a,
|
|
1
|
+
import { jsx as n, jsxs as e, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as i } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { AnimatedCounter as s } from "../../../animated-counter/index.js";
|
|
4
|
+
import { Timer as I } from "../../../timer/index.js";
|
|
5
|
+
import { ShowInContainer as f, WinBarContainer as p, Content as u, Title as O, WinIcon as T, Points as j, PointsCount as x, PointsUnits as y } from "./styles.js";
|
|
6
|
+
const b = ({
|
|
7
|
+
title: o,
|
|
8
|
+
points: t,
|
|
9
|
+
isPlayingTimer: a,
|
|
10
|
+
isTimer: m,
|
|
19
11
|
animatePoints: c,
|
|
20
|
-
questionType:
|
|
12
|
+
questionType: r,
|
|
21
13
|
timerDuration: d,
|
|
22
14
|
votedInCurrentRender: l,
|
|
23
|
-
percentsAnimated:
|
|
24
|
-
onTimerExpired:
|
|
25
|
-
}) => /* @__PURE__ */
|
|
26
|
-
|
|
15
|
+
percentsAnimated: h,
|
|
16
|
+
onTimerExpired: C
|
|
17
|
+
}) => /* @__PURE__ */ n(
|
|
18
|
+
f,
|
|
27
19
|
{
|
|
28
|
-
enabled:
|
|
29
|
-
animate:
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
|
|
20
|
+
enabled: r === i.PREDICTION && l,
|
|
21
|
+
animate: h,
|
|
22
|
+
children: /* @__PURE__ */ e(
|
|
23
|
+
p,
|
|
32
24
|
{
|
|
33
25
|
style: {
|
|
34
|
-
justifyContent:
|
|
26
|
+
justifyContent: r === i.PREDICTION ? "center" : "space-between"
|
|
35
27
|
},
|
|
36
28
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ e(u, { children: [
|
|
30
|
+
o && /* @__PURE__ */ n(O, { children: o }),
|
|
31
|
+
t !== void 0 && r !== i.POLL && /* @__PURE__ */ e(P, { children: [
|
|
32
|
+
/* @__PURE__ */ n(T, { name: "icon-trophy" }),
|
|
33
|
+
/* @__PURE__ */ e(j, { children: [
|
|
34
|
+
/* @__PURE__ */ n(x, { children: c ? /* @__PURE__ */ n(s, { value: t, delay: 0.3 }) : t }),
|
|
35
|
+
/* @__PURE__ */ n(y, { children: "PTS" })
|
|
44
36
|
] })
|
|
45
37
|
] })
|
|
46
38
|
] }),
|
|
47
|
-
|
|
39
|
+
m && r !== i.PREDICTION && /* @__PURE__ */ n(I, { isPlaying: a, onTimerExpired: C, duration: d })
|
|
48
40
|
]
|
|
49
41
|
}
|
|
50
42
|
)
|
|
51
43
|
}
|
|
52
44
|
);
|
|
53
45
|
export {
|
|
54
|
-
|
|
46
|
+
b as WinBar
|
|
55
47
|
};
|
|
@@ -1,49 +1,46 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
2
|
import { SvgIcon as n } from "../../../icons/index.js";
|
|
3
3
|
import { GrowingShowIn as o } from "../../../show-in/index.js";
|
|
4
|
-
|
|
5
|
-
import "react";
|
|
6
|
-
import "@linaria/core";
|
|
7
|
-
const t = () => o, m = /* @__PURE__ */ s(t())({
|
|
4
|
+
const t = () => o, c = /* @__PURE__ */ s(t())({
|
|
8
5
|
name: "ShowInContainer",
|
|
9
6
|
class: "sie6cqo",
|
|
10
7
|
propsAsIs: !0
|
|
11
|
-
}),
|
|
8
|
+
}), r = /* @__PURE__ */ s("div")({
|
|
12
9
|
name: "WinBarContainer",
|
|
13
10
|
class: "wgizw4u",
|
|
14
11
|
propsAsIs: !1
|
|
15
|
-
}),
|
|
12
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
16
13
|
name: "Content",
|
|
17
14
|
class: "c1l3ucjp",
|
|
18
15
|
propsAsIs: !1
|
|
19
|
-
}),
|
|
16
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
20
17
|
name: "Title",
|
|
21
18
|
class: "tx7j799",
|
|
22
19
|
propsAsIs: !1
|
|
23
|
-
}),
|
|
20
|
+
}), a = () => n, I = /* @__PURE__ */ s(a())({
|
|
24
21
|
name: "WinIcon",
|
|
25
22
|
class: "w4lwuj0",
|
|
26
23
|
propsAsIs: !0
|
|
27
|
-
}),
|
|
24
|
+
}), f = /* @__PURE__ */ s("div")({
|
|
28
25
|
name: "Points",
|
|
29
26
|
class: "po9i64o",
|
|
30
27
|
propsAsIs: !1
|
|
31
|
-
}),
|
|
28
|
+
}), w = /* @__PURE__ */ s("span")({
|
|
32
29
|
name: "PointsCount",
|
|
33
30
|
class: "pe5g05h",
|
|
34
31
|
propsAsIs: !1
|
|
35
|
-
}),
|
|
32
|
+
}), A = /* @__PURE__ */ s("span")({
|
|
36
33
|
name: "PointsUnits",
|
|
37
34
|
class: "p1hdtpmb",
|
|
38
35
|
propsAsIs: !1
|
|
39
36
|
});
|
|
40
37
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
l as Content,
|
|
39
|
+
f as Points,
|
|
40
|
+
w as PointsCount,
|
|
41
|
+
A as PointsUnits,
|
|
42
|
+
c as ShowInContainer,
|
|
43
|
+
m as Title,
|
|
44
|
+
r as WinBarContainer,
|
|
45
|
+
I as WinIcon
|
|
49
46
|
};
|
package/lib/ui/login/demo.d.ts
CHANGED
package/lib/ui/login/demo.js
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useStore as
|
|
2
|
+
import { useStore as e } from "@nanostores/react";
|
|
3
3
|
import "@streamlayer/sdk-web-anonymous-auth";
|
|
4
|
-
import { Login as
|
|
5
|
-
|
|
6
|
-
import "react-auth-code-input";
|
|
7
|
-
import "react-phone-number-input";
|
|
8
|
-
import "../timer/index.js";
|
|
9
|
-
import "@linaria/react";
|
|
10
|
-
import "react-countdown-circle-timer";
|
|
11
|
-
import "../theme/constants.js";
|
|
12
|
-
import "../../utils/login.js";
|
|
13
|
-
import "@connectrpc/connect";
|
|
14
|
-
import "@connectrpc/connect-web";
|
|
15
|
-
import "@streamlayer/sl-eslib/users/users_connect";
|
|
16
|
-
import "./styles.js";
|
|
17
|
-
const j = ({ sdk: o }) => m(o.getUserStore()).data ? /* @__PURE__ */ r("button", { onClick: o.logout, children: "logout" }) : /* @__PURE__ */ r(n, { login: async (i) => {
|
|
4
|
+
import { Login as i } from "./index.js";
|
|
5
|
+
const c = ({ sdk: o }) => e(o.getUserStore()).data ? /* @__PURE__ */ r("button", { onClick: o.logout, children: "logout" }) : /* @__PURE__ */ r(i, { login: async (n) => {
|
|
18
6
|
try {
|
|
19
|
-
await o.authorizationBypass("streamlayer:streamlayer",
|
|
7
|
+
await o.authorizationBypass("streamlayer:streamlayer", n);
|
|
20
8
|
} catch (t) {
|
|
21
9
|
throw console.log("login err", t), t;
|
|
22
10
|
}
|
|
23
11
|
}, anonymousLogin: o.anonymousAuthorization, host: o.host });
|
|
24
12
|
export {
|
|
25
|
-
|
|
13
|
+
c as LoginComponent
|
|
26
14
|
};
|
package/lib/ui/login/index.js
CHANGED
|
@@ -1,60 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as a } from "react";
|
|
3
3
|
import w from "react-auth-code-input";
|
|
4
4
|
import P, { isValidPhoneNumber as F, formatPhoneNumberIntl as v } from "react-phone-number-input";
|
|
5
5
|
import { Timer as D } from "../timer/index.js";
|
|
6
6
|
import { requestLoginCode as I, register as k, login as S } from "../../utils/login.js";
|
|
7
|
-
import { Panel as q, Form as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import "@connectrpc/connect";
|
|
12
|
-
import "@connectrpc/connect-web";
|
|
13
|
-
import "@streamlayer/sl-eslib/users/users_connect";
|
|
14
|
-
const O = ({ login: s, anonymousLogin: h, host: c }) => {
|
|
15
|
-
const [n, g] = a(""), [i, b] = a(""), [l, f] = a(""), y = async (o) => {
|
|
16
|
-
o.preventDefault();
|
|
7
|
+
import { Panel as q, Form as m, FormTitle as p, FormDescription as d, FormInputContainer as x, FormSubmit as s, Digits as E } from "./styles.js";
|
|
8
|
+
const z = ({ login: h, anonymousLogin: u, host: c }) => {
|
|
9
|
+
const [o, g] = a(""), [i, b] = a(""), [l, f] = a(""), y = async (t) => {
|
|
10
|
+
t.preventDefault();
|
|
17
11
|
try {
|
|
18
|
-
const
|
|
12
|
+
const n = o.replaceAll("+", "");
|
|
19
13
|
try {
|
|
20
|
-
await I(c,
|
|
14
|
+
await I(c, n);
|
|
21
15
|
} catch {
|
|
22
|
-
await k(c,
|
|
16
|
+
await k(c, n);
|
|
23
17
|
}
|
|
24
|
-
b(
|
|
25
|
-
} catch (
|
|
26
|
-
window.alert(
|
|
18
|
+
b(n);
|
|
19
|
+
} catch (n) {
|
|
20
|
+
window.alert(n);
|
|
27
21
|
}
|
|
28
|
-
}, C = async (
|
|
29
|
-
if (
|
|
22
|
+
}, C = async (t) => {
|
|
23
|
+
if (t.preventDefault(), i && l)
|
|
30
24
|
try {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
} catch (
|
|
34
|
-
window.alert(
|
|
25
|
+
const n = await S(c, i, l);
|
|
26
|
+
n && h ? await h(n) : console.log("token", n);
|
|
27
|
+
} catch (n) {
|
|
28
|
+
window.alert(n);
|
|
35
29
|
}
|
|
36
30
|
};
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
!i && /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ r(q, { children: [
|
|
32
|
+
!i && /* @__PURE__ */ r("div", { children: [
|
|
33
|
+
/* @__PURE__ */ r(m, { onSubmit: y, children: [
|
|
40
34
|
/* @__PURE__ */ e(p, { children: "Enter your phone number" }),
|
|
41
35
|
/* @__PURE__ */ e(d, { children: "Enter your phone up for number to log in or sign an account." }),
|
|
42
|
-
/* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(P, { value:
|
|
43
|
-
/* @__PURE__ */ e(
|
|
36
|
+
/* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(P, { value: o, onChange: (t) => g(`${t}`) }) }),
|
|
37
|
+
/* @__PURE__ */ e(s, { disabled: !F(o), type: "submit", children: "request code" })
|
|
44
38
|
] }),
|
|
45
|
-
|
|
39
|
+
u && /* @__PURE__ */ e(s, { style: { display: "block", margin: "auto" }, onClick: u, children: "anonymous login" })
|
|
46
40
|
] }),
|
|
47
|
-
i && /* @__PURE__ */
|
|
41
|
+
i && /* @__PURE__ */ r(m, { onSubmit: C, children: [
|
|
48
42
|
/* @__PURE__ */ e(p, { children: "Enter Verification Code" }),
|
|
49
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ r(d, { children: [
|
|
50
44
|
"Please enter the verification code ",
|
|
51
45
|
/* @__PURE__ */ e("br", {}),
|
|
52
46
|
"sent to ",
|
|
53
|
-
/* @__PURE__ */ e("b", { children: v(
|
|
47
|
+
/* @__PURE__ */ e("b", { children: v(o) })
|
|
54
48
|
] }),
|
|
55
49
|
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(w, { autoFocus: !0, allowedCharacters: "numeric", length: 4, onChange: f }) }),
|
|
56
|
-
/* @__PURE__ */ e(
|
|
57
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ e(s, { disabled: l.length !== 4, type: "submit", children: "login" }),
|
|
51
|
+
/* @__PURE__ */ r(d, { children: [
|
|
58
52
|
"Didn't get 59 the code? ",
|
|
59
53
|
/* @__PURE__ */ e("br", {}),
|
|
60
54
|
"Resend Code in",
|
|
@@ -64,5 +58,5 @@ const O = ({ login: s, anonymousLogin: h, host: c }) => {
|
|
|
64
58
|
] });
|
|
65
59
|
};
|
|
66
60
|
export {
|
|
67
|
-
|
|
61
|
+
z as Login
|
|
68
62
|
};
|