@streamlayer/react-ui 0.42.0 → 0.42.1
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useState as p, useCallback as
|
|
1
|
+
import { jsxs as e, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { styled as x } from "@linaria/react";
|
|
3
|
+
import { useState as p, useCallback as g, useMemo as s } from "react";
|
|
4
|
+
import { QuestionType as b } from "@streamlayer/sdk-web-types";
|
|
4
5
|
import { Vote as h } from "../../../gamification/vote/index.js";
|
|
5
|
-
import { VoteHeader as
|
|
6
|
-
import "@streamlayer/sdk-web-types";
|
|
6
|
+
import { VoteHeader as C } from "../../../gamification/vote/vote-header/index.js";
|
|
7
7
|
import "../../../../index-7045fbb2.js";
|
|
8
8
|
import "../../../gamification/vote/components/voting-option/styles.js";
|
|
9
9
|
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
|
|
13
|
+
const T = x.div`
|
|
14
14
|
background: var(--color-transparent-item);
|
|
15
15
|
width: 100%;
|
|
16
16
|
height: 100%;
|
|
@@ -19,38 +19,33 @@ const b = y.div`
|
|
|
19
19
|
align-items: center;
|
|
20
20
|
justify-content: flex-start;
|
|
21
21
|
flex-direction: column;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
`, M = ({ openedQuestion: r, closeQuestion: l, vote: a }) => {
|
|
28
|
-
var o;
|
|
29
|
-
const [e, m] = p(!1);
|
|
30
|
-
x(
|
|
22
|
+
`, I = ({ openedQuestion: r, closeQuestion: l, vote: o }) => {
|
|
23
|
+
var m;
|
|
24
|
+
const [f, i] = p(!1);
|
|
25
|
+
g(
|
|
31
26
|
(t) => {
|
|
32
|
-
|
|
27
|
+
i(t);
|
|
33
28
|
},
|
|
34
|
-
[
|
|
29
|
+
[i]
|
|
35
30
|
);
|
|
36
|
-
const
|
|
31
|
+
const c = s(
|
|
37
32
|
() => r == null ? void 0 : r.answers.find((t) => t.youVoted === !0),
|
|
38
33
|
[r]
|
|
39
|
-
),
|
|
34
|
+
), y = s(
|
|
40
35
|
() => !!(r != null && r.answers.find((t) => t.correct === !0)),
|
|
41
36
|
[r]
|
|
42
37
|
);
|
|
43
|
-
return
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
38
|
+
return /* @__PURE__ */ e(T, { children: [
|
|
39
|
+
/* @__PURE__ */ a(C, { close: l, type: (r == null ? void 0 : r.type) || b.UNSET }),
|
|
40
|
+
r && /* @__PURE__ */ a(
|
|
46
41
|
h,
|
|
47
42
|
{
|
|
48
43
|
title: r.subject,
|
|
49
|
-
feedbackMessages: (
|
|
44
|
+
feedbackMessages: (m = r.options) == null ? void 0 : m.options.value,
|
|
50
45
|
questionType: r.type,
|
|
51
46
|
questionId: r.id,
|
|
52
|
-
questionAnswered: !!
|
|
53
|
-
questionAnsweredCorrectly:
|
|
47
|
+
questionAnswered: !!c,
|
|
48
|
+
questionAnsweredCorrectly: c == null ? void 0 : c.correct,
|
|
54
49
|
options: r.answers.map((t) => ({
|
|
55
50
|
id: t.id,
|
|
56
51
|
title: t.text,
|
|
@@ -59,16 +54,16 @@ const b = y.div`
|
|
|
59
54
|
correct: t.correct,
|
|
60
55
|
percentage: t.percentage,
|
|
61
56
|
answered: t.youVoted,
|
|
62
|
-
disabled: !!
|
|
63
|
-
questionAnswered: !!
|
|
64
|
-
hasCorrectAnswer:
|
|
57
|
+
disabled: !!c || r.marketClosed || f,
|
|
58
|
+
questionAnswered: !!c,
|
|
59
|
+
hasCorrectAnswer: y,
|
|
65
60
|
points: t.points,
|
|
66
|
-
onVote:
|
|
61
|
+
onVote: o
|
|
67
62
|
}))
|
|
68
63
|
}
|
|
69
|
-
)
|
|
70
|
-
] })
|
|
64
|
+
)
|
|
65
|
+
] });
|
|
71
66
|
};
|
|
72
67
|
export {
|
|
73
|
-
|
|
68
|
+
I as Question
|
|
74
69
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { SDKScrollContainer as
|
|
5
|
-
import { ShowIn as
|
|
6
|
-
import { Question as
|
|
1
|
+
import { jsxs as m, Fragment as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { styled as e } from "@linaria/react";
|
|
3
|
+
import { useStore as n } from "@nanostores/react";
|
|
4
|
+
import { SDKScrollContainer as s } from "../../styles.js";
|
|
5
|
+
import { ShowIn as a } from "../../../show-in/index.js";
|
|
6
|
+
import { Question as d } from "./Question.js";
|
|
7
7
|
import { Tabs as l } from "./Tabs.js";
|
|
8
8
|
import "react";
|
|
9
|
-
import "../../../gamification/vote/index.js";
|
|
10
9
|
import "@streamlayer/sdk-web-types";
|
|
10
|
+
import "../../../gamification/vote/index.js";
|
|
11
11
|
import "../../../../index-7045fbb2.js";
|
|
12
12
|
import "../../../gamification/vote/components/voting-option/styles.js";
|
|
13
13
|
import "../../../gamification/vote/styles.js";
|
|
@@ -44,28 +44,28 @@ import "../../../button/styles.js";
|
|
|
44
44
|
import "../../../gamification/question/styles.js";
|
|
45
45
|
import "../../../gamification/question/list/styles.js";
|
|
46
46
|
import "./UserSummary.js";
|
|
47
|
-
const
|
|
47
|
+
const u = e(a)`
|
|
48
48
|
position: absolute;
|
|
49
49
|
inset: 0;
|
|
50
50
|
top: var(--header-height);
|
|
51
51
|
background: var(--color-neutrals-white);
|
|
52
52
|
z-index: 3;
|
|
53
|
-
`,
|
|
53
|
+
`, po = ({
|
|
54
54
|
gamification: o
|
|
55
55
|
}) => {
|
|
56
|
-
const t =
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
t && /* @__PURE__ */ r(
|
|
59
|
-
|
|
56
|
+
const { loading: i, data: t } = n(o.openedQuestion);
|
|
57
|
+
return /* @__PURE__ */ m(p, { children: [
|
|
58
|
+
(i || t) && /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(
|
|
59
|
+
d,
|
|
60
60
|
{
|
|
61
61
|
closeQuestion: o.closeQuestion,
|
|
62
62
|
vote: o.submitAnswer,
|
|
63
63
|
openedQuestion: t
|
|
64
64
|
}
|
|
65
65
|
) }),
|
|
66
|
-
/* @__PURE__ */ r(
|
|
66
|
+
/* @__PURE__ */ r(s, { "data-nav": "true", children: /* @__PURE__ */ r(l, { gamification: o }) })
|
|
67
67
|
] });
|
|
68
68
|
};
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
po as GamificationOverlay
|
|
71
71
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { styled as t } from "@linaria/react";
|
|
2
2
|
const e = t.div`
|
|
3
3
|
padding: 16px;
|
|
4
|
-
color:
|
|
4
|
+
color: #fff;
|
|
5
|
+
background: #000;
|
|
5
6
|
font-weight: 700;
|
|
6
7
|
font-size: 14px;
|
|
7
8
|
|
|
@@ -28,22 +29,22 @@ const e = t.div`
|
|
|
28
29
|
display: flex;
|
|
29
30
|
justify-content: center;
|
|
30
31
|
align-items: center;
|
|
31
|
-
`,
|
|
32
|
+
`, d = t.div`
|
|
32
33
|
padding: 14px 12px 14px 16px;
|
|
33
34
|
display: flex;
|
|
34
35
|
align-items: center;
|
|
35
|
-
`,
|
|
36
|
+
`, l = t.img`
|
|
36
37
|
width: 24px;
|
|
37
38
|
height: 24px;
|
|
38
39
|
margin-right: 12px;
|
|
39
|
-
`,
|
|
40
|
+
`, p = t.div`
|
|
40
41
|
overflow: hidden;
|
|
41
42
|
text-overflow: ellipsis;
|
|
42
43
|
white-space: nowrap;
|
|
43
44
|
font-size: 16;
|
|
44
45
|
font-weight: 700;
|
|
45
46
|
margin-bottom: 10px;
|
|
46
|
-
`,
|
|
47
|
+
`, r = t.div`
|
|
47
48
|
display: -webkit-box;
|
|
48
49
|
-webkit-box-orient: vertical;
|
|
49
50
|
-webkit-line-clamp: 4;
|
|
@@ -54,10 +55,10 @@ const e = t.div`
|
|
|
54
55
|
`;
|
|
55
56
|
export {
|
|
56
57
|
e as Container,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
d as Feedback,
|
|
59
|
+
r as FeedbackDescription,
|
|
60
|
+
l as FeedbackIcon,
|
|
61
|
+
p as FeedbackTitle,
|
|
61
62
|
a as Loader,
|
|
62
63
|
n as Options,
|
|
63
64
|
o as Title
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { QuestionTypeData as
|
|
3
|
-
import { Container as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionTypeData as t } from "../../constants.js";
|
|
3
|
+
import { Container as m, QuestionTypeWrap as c, QuestionTypeIcon as l, QuestionTypeTitle as p, CloseButton as s, CloseIcon as a } from "./styles.js";
|
|
4
4
|
import "@streamlayer/sdk-web-types";
|
|
5
5
|
import "@linaria/react";
|
|
6
6
|
import "../../../icons/index.js";
|
|
7
7
|
import "react";
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
8
|
+
const b = ({ type: n, close: i }) => {
|
|
9
|
+
const o = t[n];
|
|
10
|
+
return /* @__PURE__ */ r(m, { children: [
|
|
11
|
+
/* @__PURE__ */ r(c, { children: [
|
|
12
|
+
(o == null ? void 0 : o.iconName) && /* @__PURE__ */ e(l, { name: o.iconName }),
|
|
13
|
+
(o == null ? void 0 : o.label) && /* @__PURE__ */ e(p, { children: o.label })
|
|
14
14
|
] }),
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
] })
|
|
15
|
+
/* @__PURE__ */ e(s, { onClick: i, children: /* @__PURE__ */ e(a, { name: "icon-cross" }) })
|
|
16
|
+
] });
|
|
17
17
|
};
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
b as VoteHeader
|
|
20
20
|
};
|
package/lib/ui/show-in/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@streamlayer/sl-eslib": "^5.52.0",
|
|
30
|
-
"@streamlayer/feature-gamification": "^0.18.
|
|
31
|
-
"@streamlayer/sdk-web": "^0.28.
|
|
32
|
-
"@streamlayer/sdk-web-anonymous-auth": "^0.10.
|
|
33
|
-
"@streamlayer/sdk-web-api": "^0.0.
|
|
34
|
-
"@streamlayer/sdk-web-core": "^0.15.
|
|
35
|
-
"@streamlayer/sdk-web-features": "^0.10.
|
|
36
|
-
"@streamlayer/sdk-web-interfaces": "^0.18.
|
|
37
|
-
"@streamlayer/sdk-web-notifications": "^0.10.
|
|
38
|
-
"@streamlayer/sdk-web-storage": "^0.3.
|
|
39
|
-
"@streamlayer/sdk-web-types": "^0.16.
|
|
30
|
+
"@streamlayer/feature-gamification": "^0.18.2",
|
|
31
|
+
"@streamlayer/sdk-web": "^0.28.4",
|
|
32
|
+
"@streamlayer/sdk-web-anonymous-auth": "^0.10.13",
|
|
33
|
+
"@streamlayer/sdk-web-api": "^0.0.7",
|
|
34
|
+
"@streamlayer/sdk-web-core": "^0.15.1",
|
|
35
|
+
"@streamlayer/sdk-web-features": "^0.10.7",
|
|
36
|
+
"@streamlayer/sdk-web-interfaces": "^0.18.5",
|
|
37
|
+
"@streamlayer/sdk-web-notifications": "^0.10.4",
|
|
38
|
+
"@streamlayer/sdk-web-storage": "^0.3.7",
|
|
39
|
+
"@streamlayer/sdk-web-types": "^0.16.5"
|
|
40
40
|
},
|
|
41
41
|
"nx": {
|
|
42
42
|
"implicitDependencies": [
|
|
@@ -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.2"
|
|
77
77
|
}
|
|
78
78
|
}
|