@streamlayer/react-ui 0.41.0 → 0.42.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/ui/app/Features/Gamification/Question.js +38 -51
- package/lib/ui/app/Features/Gamification/index.js +22 -15
- package/lib/ui/app/Features/index.js +5 -4
- package/lib/ui/app/masters.js +33 -20
- package/lib/ui/show-in/index.d.ts +6 -0
- package/lib/ui/show-in/index.js +36 -0
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useState as p, useCallback as
|
|
4
|
-
import { Vote as
|
|
5
|
-
import { VoteHeader as
|
|
1
|
+
import { jsx as c, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { styled as y } from "@linaria/react";
|
|
3
|
+
import { useState as p, useCallback as x, useMemo as s } from "react";
|
|
4
|
+
import { Vote as h } from "../../../gamification/vote/index.js";
|
|
5
|
+
import { VoteHeader as g } from "../../../gamification/vote/vote-header/index.js";
|
|
6
6
|
import "@streamlayer/sdk-web-types";
|
|
7
7
|
import "../../../../index-7045fbb2.js";
|
|
8
8
|
import "../../../gamification/vote/components/voting-option/styles.js";
|
|
@@ -10,9 +10,7 @@ import "../../../gamification/vote/styles.js";
|
|
|
10
10
|
import "../../../gamification/constants.js";
|
|
11
11
|
import "../../../gamification/vote/vote-header/styles.js";
|
|
12
12
|
import "../../../icons/index.js";
|
|
13
|
-
const b =
|
|
14
|
-
position: absolute;
|
|
15
|
-
top: 0;
|
|
13
|
+
const b = y.div`
|
|
16
14
|
background: var(--color-transparent-item);
|
|
17
15
|
width: 100%;
|
|
18
16
|
height: 100%;
|
|
@@ -25,58 +23,47 @@ const b = n.div`
|
|
|
25
23
|
> div {
|
|
26
24
|
width: 100%;
|
|
27
25
|
background: #000;
|
|
28
|
-
animation: slide-in 0.3s ease-in;
|
|
29
26
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
to {
|
|
37
|
-
transform: translateX(0);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
`, M = ({ openedQuestion: t, closeQuestion: e, vote: m }) => {
|
|
41
|
-
var c;
|
|
42
|
-
const [l, a] = p(!1);
|
|
43
|
-
y(
|
|
44
|
-
(r) => {
|
|
45
|
-
a(r);
|
|
27
|
+
`, M = ({ openedQuestion: r, closeQuestion: l, vote: a }) => {
|
|
28
|
+
var o;
|
|
29
|
+
const [e, m] = p(!1);
|
|
30
|
+
x(
|
|
31
|
+
(t) => {
|
|
32
|
+
m(t);
|
|
46
33
|
},
|
|
47
|
-
[
|
|
34
|
+
[m]
|
|
48
35
|
);
|
|
49
|
-
const i =
|
|
50
|
-
() =>
|
|
51
|
-
[
|
|
52
|
-
), f =
|
|
53
|
-
() => !!(
|
|
54
|
-
[
|
|
36
|
+
const i = s(
|
|
37
|
+
() => r == null ? void 0 : r.answers.find((t) => t.youVoted === !0),
|
|
38
|
+
[r]
|
|
39
|
+
), f = s(
|
|
40
|
+
() => !!(r != null && r.answers.find((t) => t.correct === !0)),
|
|
41
|
+
[r]
|
|
55
42
|
);
|
|
56
|
-
return
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
43
|
+
return r ? /* @__PURE__ */ c(b, { children: /* @__PURE__ */ d("div", { children: [
|
|
44
|
+
/* @__PURE__ */ c(g, { close: l, type: r.type }),
|
|
45
|
+
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
46
|
+
h,
|
|
60
47
|
{
|
|
61
|
-
title:
|
|
62
|
-
feedbackMessages: (
|
|
63
|
-
questionType:
|
|
64
|
-
questionId:
|
|
48
|
+
title: r.subject,
|
|
49
|
+
feedbackMessages: (o = r.options) == null ? void 0 : o.options.value,
|
|
50
|
+
questionType: r.type,
|
|
51
|
+
questionId: r.id,
|
|
65
52
|
questionAnswered: !!i,
|
|
66
53
|
questionAnsweredCorrectly: i == null ? void 0 : i.correct,
|
|
67
|
-
options:
|
|
68
|
-
id:
|
|
69
|
-
title:
|
|
70
|
-
icon:
|
|
71
|
-
type:
|
|
72
|
-
correct:
|
|
73
|
-
percentage:
|
|
74
|
-
answered:
|
|
75
|
-
disabled: !!i ||
|
|
54
|
+
options: r.answers.map((t) => ({
|
|
55
|
+
id: t.id,
|
|
56
|
+
title: t.text,
|
|
57
|
+
icon: t.icon,
|
|
58
|
+
type: r.type,
|
|
59
|
+
correct: t.correct,
|
|
60
|
+
percentage: t.percentage,
|
|
61
|
+
answered: t.youVoted,
|
|
62
|
+
disabled: !!i || r.marketClosed || e,
|
|
76
63
|
questionAnswered: !!i,
|
|
77
64
|
hasCorrectAnswer: f,
|
|
78
|
-
points:
|
|
79
|
-
onVote:
|
|
65
|
+
points: t.points,
|
|
66
|
+
onVote: a
|
|
80
67
|
}))
|
|
81
68
|
}
|
|
82
69
|
) })
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
1
|
+
import { jsxs as i, Fragment as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { styled as p } from "@linaria/react";
|
|
3
|
+
import { useStore as e } from "@nanostores/react";
|
|
4
|
+
import { SDKScrollContainer as n } from "../../styles.js";
|
|
5
|
+
import { ShowIn as s } from "../../../show-in/index.js";
|
|
6
|
+
import { Question as u } from "./Question.js";
|
|
7
|
+
import { Tabs as l } from "./Tabs.js";
|
|
6
8
|
import "react";
|
|
7
9
|
import "../../../gamification/vote/index.js";
|
|
8
10
|
import "@streamlayer/sdk-web-types";
|
|
@@ -13,7 +15,6 @@ import "../../../gamification/vote/vote-header/index.js";
|
|
|
13
15
|
import "../../../gamification/constants.js";
|
|
14
16
|
import "../../../gamification/vote/vote-header/styles.js";
|
|
15
17
|
import "../../../icons/index.js";
|
|
16
|
-
import "../../styles.js";
|
|
17
18
|
import "../../../gamification/tabs/index.js";
|
|
18
19
|
import "../../../gamification/tabs/styles.js";
|
|
19
20
|
import "./Leaderboard.js";
|
|
@@ -43,22 +44,28 @@ import "../../../button/styles.js";
|
|
|
43
44
|
import "../../../gamification/question/styles.js";
|
|
44
45
|
import "../../../gamification/question/list/styles.js";
|
|
45
46
|
import "./UserSummary.js";
|
|
46
|
-
const
|
|
47
|
+
const d = p(s)`
|
|
48
|
+
position: absolute;
|
|
49
|
+
inset: 0;
|
|
50
|
+
top: var(--header-height);
|
|
51
|
+
background: var(--color-neutrals-white);
|
|
52
|
+
z-index: 3;
|
|
53
|
+
`, mo = ({
|
|
47
54
|
gamification: o
|
|
48
55
|
}) => {
|
|
49
|
-
const
|
|
50
|
-
return /* @__PURE__ */ m
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
const t = e(o.openedQuestion);
|
|
57
|
+
return /* @__PURE__ */ i(m, { children: [
|
|
58
|
+
t && /* @__PURE__ */ r(d, { children: /* @__PURE__ */ r(
|
|
59
|
+
u,
|
|
53
60
|
{
|
|
54
61
|
closeQuestion: o.closeQuestion,
|
|
55
62
|
vote: o.submitAnswer,
|
|
56
|
-
openedQuestion:
|
|
63
|
+
openedQuestion: t
|
|
57
64
|
}
|
|
58
|
-
),
|
|
59
|
-
|
|
65
|
+
) }),
|
|
66
|
+
/* @__PURE__ */ r(n, { "data-nav": "true", children: /* @__PURE__ */ r(l, { gamification: o }) })
|
|
60
67
|
] });
|
|
61
68
|
};
|
|
62
69
|
export {
|
|
63
|
-
|
|
70
|
+
mo as GamificationOverlay
|
|
64
71
|
};
|
|
@@ -6,8 +6,10 @@ import { GamificationOverlay as e } from "./Gamification/index.js";
|
|
|
6
6
|
import { HighlightsOverlay as n } from "./Highlights/index.js";
|
|
7
7
|
import "@nanostores/react";
|
|
8
8
|
import "@streamlayer/sdk-web-interfaces";
|
|
9
|
-
import "./Gamification/Question.js";
|
|
10
9
|
import "@linaria/react";
|
|
10
|
+
import "../styles.js";
|
|
11
|
+
import "../../show-in/index.js";
|
|
12
|
+
import "./Gamification/Question.js";
|
|
11
13
|
import "../../gamification/vote/index.js";
|
|
12
14
|
import "../../../index-7045fbb2.js";
|
|
13
15
|
import "../../gamification/vote/components/voting-option/styles.js";
|
|
@@ -17,7 +19,6 @@ import "../../gamification/constants.js";
|
|
|
17
19
|
import "../../gamification/vote/vote-header/styles.js";
|
|
18
20
|
import "../../icons/index.js";
|
|
19
21
|
import "./Gamification/Tabs.js";
|
|
20
|
-
import "../styles.js";
|
|
21
22
|
import "../../gamification/tabs/index.js";
|
|
22
23
|
import "../../gamification/tabs/styles.js";
|
|
23
24
|
import "./Gamification/Leaderboard.js";
|
|
@@ -55,7 +56,7 @@ import "../../gamification/insight-list/index.js";
|
|
|
55
56
|
import "../../gamification/insight/index.js";
|
|
56
57
|
import "../../gamification/insight/styles.js";
|
|
57
58
|
import "../../gamification/insight-list/styles.js";
|
|
58
|
-
const
|
|
59
|
+
const hr = ({ sdk: i, feature: r }) => p(() => r ? r.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ t(m, { sdk: i, feature: r, children: /* @__PURE__ */ t(e, { gamification: r, sdk: i }) }) : r.featureConfig.get().type === o.HIGHLIGHTS ? /* @__PURE__ */ t(m, { sdk: i, feature: r, children: /* @__PURE__ */ t(n, { highlights: r, sdk: i }) }) : null : null, [i, r]);
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
+
hr as ActiveFeature
|
|
61
62
|
};
|
package/lib/ui/app/masters.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { StreamLayerThemeProvider as
|
|
3
|
-
import { mastersVariables as
|
|
4
|
-
import { ActiveFeature as
|
|
1
|
+
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { StreamLayerThemeProvider as f } from "../theme/index.js";
|
|
3
|
+
import { mastersVariables as v } from "../theme/masters.js";
|
|
4
|
+
import { ActiveFeature as S } from "./Features/index.js";
|
|
5
5
|
import { MastersNavigation as y } from "./Navigation/MastersNavigation/index.js";
|
|
6
|
-
import { SDKContainer as
|
|
6
|
+
import { SDKContainer as h, SDKScrollContainer as e } from "./styles.js";
|
|
7
7
|
import { useMastersApp as b } from "./useMastersApp.js";
|
|
8
8
|
import { useSdkFeature as k } from "./useSdkFeature.js";
|
|
9
9
|
import { ChannelsButtonId as A } from "../navigation/button/Channels.js";
|
|
10
10
|
import { LeaderBoardButtonId as a } from "../navigation/button/LeaderBoard.js";
|
|
11
|
-
import { FeaturedGroupsButtonId as
|
|
11
|
+
import { FeaturedGroupsButtonId as g } from "../navigation/button/FeaturedGroups.js";
|
|
12
12
|
import "../theme/theme.js";
|
|
13
13
|
import "@linaria/core";
|
|
14
14
|
import "../theme/constants.js";
|
|
@@ -18,8 +18,9 @@ import "./Features/FeatureProvider.js";
|
|
|
18
18
|
import "@nanostores/react";
|
|
19
19
|
import "@streamlayer/sdk-web-interfaces";
|
|
20
20
|
import "./Features/Gamification/index.js";
|
|
21
|
-
import "./Features/Gamification/Question.js";
|
|
22
21
|
import "@linaria/react";
|
|
22
|
+
import "../show-in/index.js";
|
|
23
|
+
import "./Features/Gamification/Question.js";
|
|
23
24
|
import "../gamification/vote/index.js";
|
|
24
25
|
import "../../index-7045fbb2.js";
|
|
25
26
|
import "../gamification/vote/components/voting-option/styles.js";
|
|
@@ -71,16 +72,16 @@ import "../navigation/masters.js";
|
|
|
71
72
|
import "../navigation/index.js";
|
|
72
73
|
import "../navigation/button/index.js";
|
|
73
74
|
import "../navigation/button/styles.js";
|
|
74
|
-
const
|
|
75
|
-
const [,
|
|
76
|
-
return /* @__PURE__ */ t(
|
|
77
|
-
},
|
|
78
|
-
const { sdkEnabled:
|
|
75
|
+
const B = ({ sdk: o }) => {
|
|
76
|
+
const [, m] = k(o);
|
|
77
|
+
return /* @__PURE__ */ t(S, { feature: m, sdk: o });
|
|
78
|
+
}, Hr = ({ sdk: o, overlays: m, children: p, event: n }) => {
|
|
79
|
+
const { sdkEnabled: i, sdkReady: s, activeOverlay: r, activateAndLoadOverlay: d, enableSdk: l, disableSdk: c } = b(
|
|
79
80
|
o,
|
|
80
81
|
n
|
|
81
82
|
);
|
|
82
|
-
return /* @__PURE__ */ t(
|
|
83
|
-
|
|
83
|
+
return /* @__PURE__ */ t(f, { style: { height: "100%" }, children: /* @__PURE__ */ u(h, { className: v, children: [
|
|
84
|
+
i && /* @__PURE__ */ t(
|
|
84
85
|
y,
|
|
85
86
|
{
|
|
86
87
|
sdkReady: s,
|
|
@@ -88,13 +89,25 @@ const F = ({ sdk: o }) => {
|
|
|
88
89
|
setActiveOverlay: d
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
/* @__PURE__ */ t(
|
|
93
|
+
e,
|
|
94
|
+
{
|
|
95
|
+
"data-nav": i.toString(),
|
|
96
|
+
style: { display: !i || r === A ? "block" : "none" },
|
|
97
|
+
children: p && p({ enableSdk: l, disableSdk: c })
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ t(
|
|
101
|
+
e,
|
|
102
|
+
{
|
|
103
|
+
"data-nav": i.toString(),
|
|
104
|
+
style: { display: r === a ? "block" : "none" },
|
|
105
|
+
children: m && r === a && m[r]
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
i && r === g && /* @__PURE__ */ t(B, { sdk: o })
|
|
96
109
|
] }) });
|
|
97
110
|
};
|
|
98
111
|
export {
|
|
99
|
-
|
|
112
|
+
Hr as MastersApp
|
|
100
113
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { styled as r } from "@linaria/react";
|
|
3
|
+
const n = r.div`
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
width: 100%;
|
|
6
|
+
transform: scale(1);
|
|
7
|
+
opacity: 1;
|
|
8
|
+
max-height: 500px;
|
|
9
|
+
|
|
10
|
+
animation: containerShowIn 0.5s ease-out;
|
|
11
|
+
|
|
12
|
+
@keyframes containerShowIn {
|
|
13
|
+
0% {
|
|
14
|
+
transform: scale(0);
|
|
15
|
+
opacity: 0;
|
|
16
|
+
max-height: 0;
|
|
17
|
+
}
|
|
18
|
+
80% {
|
|
19
|
+
opacity: 0;
|
|
20
|
+
transform: scale(0.9);
|
|
21
|
+
max-height: 500px;
|
|
22
|
+
}
|
|
23
|
+
85% {
|
|
24
|
+
transform: scale(0.9);
|
|
25
|
+
max-height: 500px;
|
|
26
|
+
}
|
|
27
|
+
100% {
|
|
28
|
+
transform: scale(1);
|
|
29
|
+
opacity: 1;
|
|
30
|
+
max-height: 500px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`, m = ({ children: t, style: a, className: o }) => /* @__PURE__ */ e(n, { style: a, className: o, children: t });
|
|
34
|
+
export {
|
|
35
|
+
m as ShowIn
|
|
36
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"vite-plugin-svgr": "^4.1.0",
|
|
74
74
|
"vite-svg-loader": "^4.0.0",
|
|
75
75
|
"vite-tsconfig-paths": "^4.2.1",
|
|
76
|
-
"@streamlayer/react": "^0.24.
|
|
76
|
+
"@streamlayer/react": "^0.24.1"
|
|
77
77
|
}
|
|
78
78
|
}
|