@streamlayer/react-ui 0.91.1 → 0.92.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/index-keh7OLCY.js +67 -0
- package/lib/ui/app/Features/Gamification/Friends.d.ts +2 -1
- package/lib/ui/app/Features/Gamification/Friends.js +6 -6
- package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +3 -2
- package/lib/ui/app/Features/Gamification/Leaderboard.js +26 -24
- package/lib/ui/app/Features/Gamification/Question.js +1 -1
- package/lib/ui/app/Features/Gamification/Tabs.d.ts +7 -2
- package/lib/ui/app/Features/Gamification/Tabs.js +35 -28
- package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -1
- package/lib/ui/app/Features/Gamification/index.d.ts +6 -2
- package/lib/ui/app/Features/Gamification/index.js +81 -44
- package/lib/ui/app/Features/index.d.ts +6 -2
- package/lib/ui/app/Features/index.js +13 -11
- package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +3 -2
- package/lib/ui/app/Navigation/MastersNavigation/index.js +34 -30
- package/lib/ui/app/Navigation/index.js +6 -7
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -1
- package/lib/ui/app/Notifications/Onboarding/index.js +53 -46
- package/lib/ui/app/Notifications/index.d.ts +6 -2
- package/lib/ui/app/Notifications/index.js +114 -90
- package/lib/ui/app/masters.d.ts +7 -0
- package/lib/ui/app/masters.js +67 -51
- package/lib/ui/app/useClipboardCopy.d.ts +2 -1
- package/lib/ui/app/useMastersApp.js +15 -14
- package/lib/ui/app/useSdkResponsive.d.ts +14 -0
- package/lib/ui/app/useSdkResponsive.js +46 -0
- package/lib/ui/app/useSdkScroll.d.ts +3 -1
- package/lib/ui/app/useSdkScroll.js +28 -85
- package/lib/ui/gamification/leaderboard/static.d.ts +2 -1
- package/lib/ui/gamification/onboarding/index.d.ts +4 -0
- package/lib/ui/gamification/onboarding/index.js +56 -40
- package/lib/ui/gamification/onboarding/invitingUser/index.d.ts +7 -0
- package/lib/ui/gamification/onboarding/invitingUser/index.js +16 -0
- package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +5 -0
- package/lib/ui/gamification/onboarding/invitingUser/styles.js +24 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +2 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +1 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.d.ts +2 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +18 -12
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.d.ts +7 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +10 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.d.ts +5 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.js +24 -0
- package/lib/ui/gamification/vote/index.js +43 -43
- package/lib/ui/gamification/vote/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/styles.js +17 -11
- package/lib/ui/gamification/vote/vote-option/index.js +20 -20
- package/lib/ui/navigation/button/LeaderBoard.js +5 -6
- package/lib/ui/navigation/index.js +6 -7
- package/lib/ui/navigation/masters.js +3 -5
- package/lib/ui/questions/insight/index.js +24 -25
- package/lib/utils/createDemo.js +12 -13
- package/lib/utils/debug/components/copyLogs.js +10 -9
- package/package.json +11 -11
- package/lib/LeaderBoard_fzzlxb-w40geAFS.js +0 -1
- package/lib/index_ej4hfx-w40geAFS.js +0 -1
- package/lib/masters_m6itlr-w40geAFS.js +0 -1
- package/lib/utils/useStreamLayerApp.js +0 -25
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { HeaderNodeRef, type AppNodeRef } from '../../../../app/masters';
|
|
2
3
|
import { icons } from '../../../../icons';
|
|
3
4
|
export type OnboardingInviteCardProps = {
|
|
4
|
-
|
|
5
|
+
renderToNode: AppNodeRef | HeaderNodeRef;
|
|
5
6
|
inviteLink?: string;
|
|
6
7
|
inviteCardTitle?: string;
|
|
7
8
|
inviteCardSubtext?: string;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { SvgIcon as
|
|
3
|
-
import { Container as
|
|
1
|
+
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { SvgIcon as a } from "../../../../icons/index.js";
|
|
3
|
+
import { Container as h, Content as s, Title as p, RulesList as C, RulesItem as R, RuleIcon as u, RuleText as x, TermsButton as T } from "./styles.js";
|
|
4
4
|
import "@linaria/react";
|
|
5
5
|
import "react";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const k = ({
|
|
7
|
+
rules: e,
|
|
8
|
+
rulesTitle: t,
|
|
9
|
+
termsText: i,
|
|
10
|
+
primaryColor: d,
|
|
11
|
+
openTerms: l
|
|
12
|
+
}) => /* @__PURE__ */ r(h, { children: [
|
|
13
|
+
/* @__PURE__ */ r(s, { children: [
|
|
14
|
+
/* @__PURE__ */ n(p, { children: t }),
|
|
15
|
+
/* @__PURE__ */ n(C, { children: e == null ? void 0 : e.map(({ label: m, icon: o }, c) => /* @__PURE__ */ r(R, { children: [
|
|
16
|
+
o && /* @__PURE__ */ n(u, { style: { backgroundColor: d }, children: /* @__PURE__ */ n(a, { name: o, "data-icon": o }) }),
|
|
17
|
+
/* @__PURE__ */ n(x, { children: m })
|
|
18
|
+
] }, c)) })
|
|
13
19
|
] }),
|
|
14
|
-
/* @__PURE__ */ n(
|
|
20
|
+
i && /* @__PURE__ */ n(T, { onClick: l, children: "See Terms and Conditions" })
|
|
15
21
|
] });
|
|
16
22
|
export {
|
|
17
|
-
|
|
23
|
+
k as OnboardingRules
|
|
18
24
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Container as o, Content as t, Title as l, ScrollingText as c } from "./styles.js";
|
|
3
|
+
import "@linaria/react";
|
|
4
|
+
const h = ({ termsTitle: n, termsText: e }) => /* @__PURE__ */ r(o, { children: /* @__PURE__ */ i(t, { children: [
|
|
5
|
+
/* @__PURE__ */ r(l, { children: n }),
|
|
6
|
+
/* @__PURE__ */ r(c, { children: e })
|
|
7
|
+
] }) });
|
|
8
|
+
export {
|
|
9
|
+
h as OnboardingTerms
|
|
10
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
+
export declare const ScrollingText: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
const t = /* @__PURE__ */ s("div")({
|
|
3
|
+
name: "Container",
|
|
4
|
+
class: "cj0g35h",
|
|
5
|
+
propsAsIs: !1
|
|
6
|
+
}), e = /* @__PURE__ */ s("div")({
|
|
7
|
+
name: "Content",
|
|
8
|
+
class: "c1xkhrbn",
|
|
9
|
+
propsAsIs: !1
|
|
10
|
+
}), o = /* @__PURE__ */ s("div")({
|
|
11
|
+
name: "Title",
|
|
12
|
+
class: "tifzb8b",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
15
|
+
name: "ScrollingText",
|
|
16
|
+
class: "stduw5c",
|
|
17
|
+
propsAsIs: !1
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
t as Container,
|
|
21
|
+
e as Content,
|
|
22
|
+
l as ScrollingText,
|
|
23
|
+
o as Title
|
|
24
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as m, jsxs as N, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { QuestionType as c, QuestionStatus as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Container as Z, Content as _, Title as $, Options as Q } from "./styles.js";
|
|
1
|
+
import { jsx as m, jsxs as N, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useEffect as J, useCallback as p, useMemo as f } from "react";
|
|
3
|
+
import { QuestionType as c, QuestionStatus as C } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { ExpiredAlert as K } from "./expired-alert/index.js";
|
|
5
|
+
import { Feedback as U } from "./feedback/index.js";
|
|
6
|
+
import { QuestionScrollContainer as X, Container as Z, Content as _, Title as $, Options as Q } from "./styles.js";
|
|
8
7
|
import { VotingOption as tt } from "./vote-option/index.js";
|
|
9
8
|
import { WinBar as rt } from "./win-bar/index.js";
|
|
10
|
-
import "@linaria/react";
|
|
11
9
|
import "../../icons/index.js";
|
|
10
|
+
import "@linaria/react";
|
|
12
11
|
import "./expired-alert/styles.js";
|
|
13
12
|
import "./feedback/styles.js";
|
|
13
|
+
import "../../app/styles.js";
|
|
14
14
|
import "../../animated-counter/index.js";
|
|
15
15
|
import "react-countup";
|
|
16
16
|
import "./vote-option/styles.js";
|
|
@@ -18,86 +18,86 @@ import "../../timer/index.js";
|
|
|
18
18
|
import "react-countdown-circle-timer";
|
|
19
19
|
import "../../theme/constants.js";
|
|
20
20
|
import "./win-bar/styles.js";
|
|
21
|
-
const wt = ({ openedQuestion: t, isLoading:
|
|
21
|
+
const wt = ({ openedQuestion: t, isLoading: I, vote: w, close: v }) => {
|
|
22
22
|
var g, k;
|
|
23
|
-
const P = t.subject,
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const P = t.subject, s = t.type, o = t.status, V = (g = t.options) == null ? void 0 : g.options, d = t.marketClosed, [R, b] = E(!1), [y, L] = E(!1), [T, O] = E(!0), [n, M] = E(!1), [x, q] = E(""), h = t == null ? void 0 : t.id;
|
|
24
|
+
J(() => {
|
|
25
|
+
s === c.PREDICTION ? d && O(!1) : o === C.RESOLVED && O(!1);
|
|
26
26
|
}, []);
|
|
27
27
|
const j = p((e) => {
|
|
28
28
|
L(e), b(!0);
|
|
29
29
|
}, []), D = p(
|
|
30
30
|
async (e) => {
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
q(
|
|
31
|
+
if (h) {
|
|
32
|
+
const u = e.currentTarget.value;
|
|
33
|
+
q(u), await w(h, u);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
[
|
|
36
|
+
[h, q, w]
|
|
37
37
|
), B = p(() => {
|
|
38
38
|
M(!0), setTimeout(v, 3e3);
|
|
39
39
|
}, [v]), r = f(
|
|
40
40
|
() => t == null ? void 0 : t.answers.find((e) => e.youVoted === !0),
|
|
41
41
|
[t]
|
|
42
|
-
),
|
|
42
|
+
), a = f(
|
|
43
43
|
() => !!(t != null && t.answers.find((e) => e.correct === !0)),
|
|
44
44
|
[t]
|
|
45
45
|
), i = f(
|
|
46
46
|
() => t == null ? void 0 : t.answers.find((e) => e.correct === !0),
|
|
47
47
|
[t]
|
|
48
48
|
), W = f(() => t ? t.answers.map((e) => {
|
|
49
|
-
var
|
|
49
|
+
var u;
|
|
50
50
|
return {
|
|
51
51
|
...e,
|
|
52
52
|
questionVoted: !!r,
|
|
53
53
|
youSelected: x === e.id,
|
|
54
|
-
isLoading:
|
|
55
|
-
hasCorrectAnswer:
|
|
54
|
+
isLoading: I,
|
|
55
|
+
hasCorrectAnswer: a,
|
|
56
56
|
questionType: t.type,
|
|
57
57
|
answerTimeExpired: n,
|
|
58
58
|
questionStatus: o,
|
|
59
|
-
imageMode: (
|
|
59
|
+
imageMode: (u = t.appearance) == null ? void 0 : u.images,
|
|
60
60
|
onVote: D
|
|
61
61
|
};
|
|
62
62
|
}) : [], [
|
|
63
|
-
|
|
63
|
+
a,
|
|
64
64
|
n,
|
|
65
|
-
|
|
65
|
+
I,
|
|
66
66
|
t,
|
|
67
67
|
r,
|
|
68
68
|
o,
|
|
69
69
|
D,
|
|
70
70
|
x
|
|
71
|
-
]), F =
|
|
72
|
-
if (
|
|
71
|
+
]), F = V && (V.case === "trivia" || V.case === "prediction") ? V.value : void 0, l = o === C.RESOLVED && s === c.TRIVIA && !r && !T, S = s === c.TRIVIA && y && R && T, A = f(() => s === c.PREDICTION ? !!(r && !a || r && a && (i != null && i.youVoted)) : !0, [s, r, a, i]), Y = f(() => {
|
|
72
|
+
if (s === c.PREDICTION && r && (!a || a && (i != null && i.youVoted)))
|
|
73
73
|
return r.points;
|
|
74
74
|
if (!(l || n))
|
|
75
|
-
return o ===
|
|
75
|
+
return o === C.RESOLVED ? 0 : r ? r.correct ? r.points : 0 : i == null ? void 0 : i.points;
|
|
76
76
|
}, [
|
|
77
77
|
n,
|
|
78
78
|
r,
|
|
79
79
|
i,
|
|
80
80
|
o,
|
|
81
81
|
l,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
]), H = f(() =>
|
|
85
|
-
return /* @__PURE__ */ m(
|
|
82
|
+
s,
|
|
83
|
+
a
|
|
84
|
+
]), H = f(() => s === c.PREDICTION && r ? a ? a && (i != null && i.youVoted) ? "You won" : "" : "To win" : l || n ? "Time expired" : s === c.POLL ? "Time remaining" : r ? "You won" : "To win", [n, s, r, l, a, i]), z = r || l || S || s === c.TRIVIA && o === C.RESOLVED && T;
|
|
85
|
+
return /* @__PURE__ */ m(X, { children: /* @__PURE__ */ m(Z, { children: /* @__PURE__ */ N(_, { children: [
|
|
86
86
|
/* @__PURE__ */ m(
|
|
87
|
-
|
|
87
|
+
U,
|
|
88
88
|
{
|
|
89
89
|
feedbackMessages: F,
|
|
90
90
|
questionVoted: !!r,
|
|
91
91
|
questionVotedCorrectly: r == null ? void 0 : r.correct,
|
|
92
|
-
questionType:
|
|
93
|
-
hasCorrectAnswer:
|
|
92
|
+
questionType: s,
|
|
93
|
+
hasCorrectAnswer: a,
|
|
94
94
|
questionStatus: o,
|
|
95
95
|
showExpiredNotification: l,
|
|
96
96
|
showClosedNotificationTrivia: S,
|
|
97
97
|
votedInCurrentRender: R,
|
|
98
|
-
votedAfterQuestionClosed:
|
|
99
|
-
enteredAnActiveQuestion:
|
|
100
|
-
marketClosed:
|
|
98
|
+
votedAfterQuestionClosed: y,
|
|
99
|
+
enteredAnActiveQuestion: T,
|
|
100
|
+
marketClosed: d
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
103
|
A && /* @__PURE__ */ m(
|
|
@@ -107,27 +107,27 @@ const wt = ({ openedQuestion: t, isLoading: C, vote: w, close: v }) => {
|
|
|
107
107
|
points: Y,
|
|
108
108
|
onTimerExpired: B,
|
|
109
109
|
questionType: t.type,
|
|
110
|
-
isTimer: !
|
|
110
|
+
isTimer: !I,
|
|
111
111
|
isPlayingTimer: !r,
|
|
112
|
-
timerDuration:
|
|
112
|
+
timerDuration: z ? 0 : Number(((k = t == null ? void 0 : t.appearance) == null ? void 0 : k.autoHideInterval) || "30")
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
115
|
n ? /* @__PURE__ */ m(
|
|
116
|
-
|
|
116
|
+
K,
|
|
117
117
|
{
|
|
118
118
|
title: "More to come...",
|
|
119
119
|
description: "Watch for additional enhanced stream interactive experience."
|
|
120
120
|
}
|
|
121
|
-
) : /* @__PURE__ */ N(
|
|
121
|
+
) : /* @__PURE__ */ N(G, { children: [
|
|
122
122
|
/* @__PURE__ */ m($, { style: A ? {} : { marginTop: 0 }, children: P }),
|
|
123
123
|
/* @__PURE__ */ m(Q, { children: W.map((e) => /* @__PURE__ */ m(
|
|
124
124
|
tt,
|
|
125
125
|
{
|
|
126
126
|
...e,
|
|
127
127
|
markThatVoted: j,
|
|
128
|
-
votedAfterQuestionClosed:
|
|
129
|
-
enteredAnActiveQuestion:
|
|
130
|
-
marketClosed:
|
|
128
|
+
votedAfterQuestionClosed: y,
|
|
129
|
+
enteredAnActiveQuestion: T,
|
|
130
|
+
marketClosed: d
|
|
131
131
|
},
|
|
132
132
|
e.id
|
|
133
133
|
)) })
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const QuestionScrollContainer: any;
|
|
3
4
|
export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
5
|
export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
6
|
export declare const Options: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
|
|
2
|
+
import { SDKScrollContainer as o } from "../../app/styles.js";
|
|
3
|
+
const l = /* @__PURE__ */ s("div")({
|
|
3
4
|
name: "Container",
|
|
4
5
|
class: "c14ielyq",
|
|
5
6
|
propsAsIs: !1
|
|
6
|
-
}), o = /* @__PURE__ */ s(
|
|
7
|
+
}), n = () => o, a = /* @__PURE__ */ s(n())({
|
|
8
|
+
name: "QuestionScrollContainer",
|
|
9
|
+
class: "q1tlqx57",
|
|
10
|
+
propsAsIs: !0
|
|
11
|
+
}), c = /* @__PURE__ */ s("div")({
|
|
7
12
|
name: "Content",
|
|
8
|
-
class: "
|
|
13
|
+
class: "c1hq58md",
|
|
9
14
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
15
|
+
}), i = /* @__PURE__ */ s("div")({
|
|
11
16
|
name: "Title",
|
|
12
|
-
class: "
|
|
17
|
+
class: "t1c8nxcx",
|
|
13
18
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
19
|
+
}), r = /* @__PURE__ */ s("div")({
|
|
15
20
|
name: "Options",
|
|
16
|
-
class: "
|
|
21
|
+
class: "oiozuc3",
|
|
17
22
|
propsAsIs: !1
|
|
18
23
|
});
|
|
19
24
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
l as Container,
|
|
26
|
+
c as Content,
|
|
27
|
+
r as Options,
|
|
28
|
+
a as QuestionScrollContainer,
|
|
29
|
+
i as Title
|
|
24
30
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { QuestionImages as a, QuestionType as i, QuestionStatus as
|
|
2
|
+
import { QuestionImages as a, QuestionType as i, QuestionStatus as T } from "@streamlayer/sdk-web-types";
|
|
3
3
|
import { AnimatedCounter as P } from "../../../animated-counter/index.js";
|
|
4
4
|
import { IconDefault as B, IconContainer as V, IconWrap as b, IconCircle as j, ButtonContainer as U, ButtonPct as $, ButtonBody as M, Title as W, Pts as y, Indicators as z, CheckIcon as F, Percentage as G } from "./styles.js";
|
|
5
5
|
import "react-countup";
|
|
@@ -28,51 +28,51 @@ const f = {
|
|
|
28
28
|
correct: n,
|
|
29
29
|
hasCorrectAnswer: r,
|
|
30
30
|
questionStatus: o
|
|
31
|
-
}) => t === i.TRIVIA ? c && n : t === i.PREDICTION ? c && n && r || o ===
|
|
32
|
-
var
|
|
31
|
+
}) => t === i.TRIVIA ? c && n : t === i.PREDICTION ? c && n && r || o === T.RESOLVED && n : !1, rt = (t) => {
|
|
32
|
+
var R;
|
|
33
33
|
const {
|
|
34
34
|
// option props
|
|
35
35
|
id: c,
|
|
36
36
|
icon: n,
|
|
37
37
|
text: r,
|
|
38
38
|
percentageDecimal: o,
|
|
39
|
-
points:
|
|
39
|
+
points: D,
|
|
40
40
|
// extra props
|
|
41
|
-
onVote:
|
|
42
|
-
markThatVoted:
|
|
43
|
-
youSelected:
|
|
41
|
+
onVote: S,
|
|
42
|
+
markThatVoted: w,
|
|
43
|
+
youSelected: h,
|
|
44
44
|
questionVoted: s,
|
|
45
45
|
imageMode: C,
|
|
46
|
-
answerTimeExpired:
|
|
47
|
-
questionStatus:
|
|
46
|
+
answerTimeExpired: O,
|
|
47
|
+
questionStatus: E,
|
|
48
48
|
isLoading: g,
|
|
49
49
|
questionType: d,
|
|
50
50
|
correct: A,
|
|
51
51
|
hasCorrectAnswer: k,
|
|
52
52
|
votedAfterQuestionClosed: v,
|
|
53
|
-
enteredAnActiveQuestion:
|
|
54
|
-
marketClosed:
|
|
55
|
-
} = t, I = H(t), x = J({ questionType: d, questionVoted: s, correct: A, hasCorrectAnswer: k, questionStatus:
|
|
53
|
+
enteredAnActiveQuestion: p,
|
|
54
|
+
marketClosed: u
|
|
55
|
+
} = t, I = H(t), x = J({ questionType: d, questionVoted: s, correct: A, hasCorrectAnswer: k, questionStatus: E }), m = u && d === i.PREDICTION, N = s || m, L = d === i.PREDICTION && !s && !u;
|
|
56
56
|
return /* @__PURE__ */ l(
|
|
57
57
|
U,
|
|
58
58
|
{
|
|
59
59
|
value: c,
|
|
60
|
-
"data-selected":
|
|
60
|
+
"data-selected": h,
|
|
61
61
|
"data-answer-state": I,
|
|
62
|
-
disabled: s || g ||
|
|
63
|
-
"data-is-not-checked": s && !
|
|
62
|
+
disabled: s || g || O || m && !p || m && p && v,
|
|
63
|
+
"data-is-not-checked": s && !h && I !== "incorrect",
|
|
64
64
|
onClick: (Q) => {
|
|
65
|
-
|
|
66
|
-
d === i.PREDICTION ?
|
|
67
|
-
),
|
|
65
|
+
w(
|
|
66
|
+
d === i.PREDICTION ? u : E === T.RESOLVED
|
|
67
|
+
), S(Q);
|
|
68
68
|
},
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ e($, { "data-answer-state": I, style: { width: `${N ? o : 0}%` } }),
|
|
71
71
|
/* @__PURE__ */ l(M, { children: [
|
|
72
|
-
n && C && ((
|
|
72
|
+
n && C && ((R = f[C]) == null ? void 0 : R.call(f, n)),
|
|
73
73
|
/* @__PURE__ */ e(W, { children: r }),
|
|
74
74
|
L && /* @__PURE__ */ l("div", { children: [
|
|
75
|
-
/* @__PURE__ */ e(P, { value:
|
|
75
|
+
/* @__PURE__ */ e(P, { value: D }),
|
|
76
76
|
/* @__PURE__ */ e(y, { children: "pts" })
|
|
77
77
|
] }),
|
|
78
78
|
N && /* @__PURE__ */ l(z, { children: [
|
|
@@ -2,26 +2,25 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { styled as e } from "@linaria/react";
|
|
3
3
|
import { SvgIcon as a } from "../../icons/index.js";
|
|
4
4
|
import { Button as d } from "./index.js";
|
|
5
|
-
import "../../../LeaderBoard_fzzlxb-w40geAFS.js";
|
|
6
5
|
import "react";
|
|
7
6
|
import "./styles.js";
|
|
8
|
-
const n = () => a,
|
|
7
|
+
const n = () => a, c = /* @__PURE__ */ e(n())({
|
|
9
8
|
name: "ButtonIcon",
|
|
10
9
|
class: "b180jd7l",
|
|
11
10
|
propsAsIs: !0
|
|
12
|
-
}),
|
|
11
|
+
}), b = "leaderboard", u = (o) => {
|
|
13
12
|
var t;
|
|
14
13
|
return /* @__PURE__ */ r(d, {
|
|
15
14
|
...o,
|
|
16
15
|
label: "Leader Board",
|
|
17
16
|
id: "leaderboard",
|
|
18
|
-
icon: /* @__PURE__ */ r(
|
|
17
|
+
icon: /* @__PURE__ */ r(c, {
|
|
19
18
|
name: "icon-btn-leaderboard",
|
|
20
19
|
"data-selected": (t = o.active) == null ? void 0 : t.toString()
|
|
21
20
|
})
|
|
22
21
|
});
|
|
23
22
|
};
|
|
24
23
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
u as LeaderBoardButton,
|
|
25
|
+
b as LeaderBoardButtonId
|
|
27
26
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { styled as r } from "@linaria/react";
|
|
3
|
-
import "../../index_ej4hfx-w40geAFS.js";
|
|
4
3
|
const n = /* @__PURE__ */ r("div")({
|
|
5
4
|
name: "Buttons",
|
|
6
5
|
class: "b6tbwuy",
|
|
7
6
|
propsAsIs: !1
|
|
8
|
-
}),
|
|
7
|
+
}), i = ({
|
|
9
8
|
children: t,
|
|
10
|
-
className:
|
|
11
|
-
}) => /* @__PURE__ */
|
|
12
|
-
className:
|
|
9
|
+
className: s
|
|
10
|
+
}) => /* @__PURE__ */ o(n, {
|
|
11
|
+
className: s,
|
|
13
12
|
children: t
|
|
14
13
|
});
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
i as Navigation
|
|
17
16
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { styled as o } from "@linaria/react";
|
|
2
|
-
import { Navigation as
|
|
3
|
-
import "../../masters_m6itlr-w40geAFS.js";
|
|
2
|
+
import { Navigation as a } from "./index.js";
|
|
4
3
|
import "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
const i = () => t, n = /* @__PURE__ */ o(i())({
|
|
4
|
+
const t = () => a, p = /* @__PURE__ */ o(t())({
|
|
7
5
|
name: "Navigation",
|
|
8
6
|
class: "n19lpak2",
|
|
9
7
|
propsAsIs: !0
|
|
10
8
|
});
|
|
11
9
|
export {
|
|
12
|
-
|
|
10
|
+
p as Navigation
|
|
13
11
|
};
|
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { VideoPlayer as
|
|
4
|
-
import { isValidDate as
|
|
5
|
-
import { Container as
|
|
1
|
+
import { jsxs as h, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as f } from "react";
|
|
3
|
+
import { VideoPlayer as g } from "../../video-player/index.js";
|
|
4
|
+
import { isValidDate as D, formatDate as c, formatTime as v } from "../../../utils/common.js";
|
|
5
|
+
import { Container as b, DateWrap as x, Image as C, Content as T, Title as j, Description as y } from "./styles.js";
|
|
6
6
|
import "../../icons/index.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "../../video-player/styles.js";
|
|
9
|
-
const
|
|
10
|
-
created:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
isPickHistory: h,
|
|
9
|
+
const E = ({
|
|
10
|
+
created: o,
|
|
11
|
+
title: e,
|
|
12
|
+
isPickHistory: u,
|
|
14
13
|
instantView: r,
|
|
15
14
|
notification: d
|
|
16
15
|
}) => {
|
|
17
|
-
const l =
|
|
18
|
-
if (
|
|
19
|
-
const p = new Date(
|
|
20
|
-
if (
|
|
16
|
+
const l = f(() => {
|
|
17
|
+
if (o) {
|
|
18
|
+
const p = new Date(o);
|
|
19
|
+
if (D(p))
|
|
21
20
|
return {
|
|
22
|
-
date:
|
|
23
|
-
time:
|
|
21
|
+
date: c(p),
|
|
22
|
+
time: v(p)
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
return null;
|
|
27
|
-
}, [
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
l && /* @__PURE__ */
|
|
26
|
+
}, [o]);
|
|
27
|
+
return /* @__PURE__ */ h(b, { children: [
|
|
28
|
+
l && /* @__PURE__ */ h(x, { children: [
|
|
30
29
|
l.date,
|
|
31
30
|
" · ",
|
|
32
31
|
l.time
|
|
33
32
|
] }),
|
|
34
|
-
(r == null ? void 0 : r.video) && /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
33
|
+
(r == null ? void 0 : r.video) && /* @__PURE__ */ m(g, { source: r.video.url, poster: r.video.thumbnailUrl }),
|
|
34
|
+
(r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ m(C, { src: r == null ? void 0 : r.image }),
|
|
35
|
+
/* @__PURE__ */ h(T, { children: [
|
|
36
|
+
/* @__PURE__ */ m(j, { children: u ? e : r == null ? void 0 : r.heading }),
|
|
37
|
+
/* @__PURE__ */ m(y, { children: u ? d == null ? void 0 : d.body : r == null ? void 0 : r.body })
|
|
39
38
|
] })
|
|
40
39
|
] });
|
|
41
40
|
};
|
|
42
41
|
export {
|
|
43
|
-
|
|
42
|
+
E as InsightContent
|
|
44
43
|
};
|
package/lib/utils/createDemo.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as g, Fragment as y } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as u, useState as i, useEffect as E } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useStreamLayerApp as l } from "@streamlayer/react/useStreamLayerApp";
|
|
4
|
+
import { anonymous as D } from "@streamlayer/sdk-web-anonymous-auth";
|
|
5
|
+
import { Developer as w } from "./debug/components/developer.js";
|
|
6
|
+
import { DeveloperStorage as x } from "./storage.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "./debug/components/bypassLogin.js";
|
|
9
9
|
import "./debug/components/copyLogs.js";
|
|
@@ -14,36 +14,35 @@ import "@nanostores/react";
|
|
|
14
14
|
import "@streamlayer/sdk-web-core";
|
|
15
15
|
import "./debug/components/sdkKey.js";
|
|
16
16
|
import "@streamlayer/sdk-web-storage";
|
|
17
|
-
import "@streamlayer/sdk-web";
|
|
18
17
|
function K({
|
|
19
18
|
Component: o,
|
|
20
19
|
Story: r,
|
|
21
20
|
args: n,
|
|
22
21
|
autoEnable: a
|
|
23
22
|
}) {
|
|
24
|
-
const
|
|
23
|
+
const s = u(() => new x(), []), [p, f] = i(s.getEnv()), [c, v] = i(s.getSdkKey() || "set-sdk-key"), [m, k] = i(s.getEvent() || ""), S = u(() => {
|
|
25
24
|
const d = /* @__PURE__ */ new Set();
|
|
26
|
-
return d.add(
|
|
27
|
-
}, []), t =
|
|
25
|
+
return d.add(D), d;
|
|
26
|
+
}, []), t = l(c, S, p === "production", a);
|
|
28
27
|
return E(() => {
|
|
29
|
-
|
|
28
|
+
m && t && t.createEventSession(m);
|
|
30
29
|
}, [t]), /* @__PURE__ */ g(y, { children: [
|
|
31
30
|
t ? /* @__PURE__ */ e(o, { Story: r, sdk: t, args: n }) : /* @__PURE__ */ e("div", { children: "wait sdk..." }),
|
|
32
31
|
/* @__PURE__ */ e(
|
|
33
|
-
|
|
32
|
+
w,
|
|
34
33
|
{
|
|
35
34
|
sdk: t,
|
|
36
35
|
sdkKey: c,
|
|
37
36
|
setSdkKey: v,
|
|
38
37
|
env: p,
|
|
39
38
|
setEnv: f,
|
|
40
|
-
event:
|
|
39
|
+
event: m,
|
|
41
40
|
setEvent: k
|
|
42
41
|
}
|
|
43
42
|
)
|
|
44
43
|
] });
|
|
45
44
|
}
|
|
46
|
-
function
|
|
45
|
+
function O(o, r = !0) {
|
|
47
46
|
return {
|
|
48
47
|
decorators: [
|
|
49
48
|
(n) => /* @__PURE__ */ e(K, { Story: n, Component: o, autoEnable: r })
|
|
@@ -51,5 +50,5 @@ function P(o, r = !0) {
|
|
|
51
50
|
};
|
|
52
51
|
}
|
|
53
52
|
export {
|
|
54
|
-
|
|
53
|
+
O as createDemo
|
|
55
54
|
};
|