@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 { 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";
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 g } from "../../../gamification/vote/vote-header/index.js";
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 b = y.div`
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
- > div {
24
- width: 100%;
25
- background: #000;
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
- m(t);
27
+ i(t);
33
28
  },
34
- [m]
29
+ [i]
35
30
  );
36
- const i = s(
31
+ const c = s(
37
32
  () => r == null ? void 0 : r.answers.find((t) => t.youVoted === !0),
38
33
  [r]
39
- ), f = s(
34
+ ), y = s(
40
35
  () => !!(r != null && r.answers.find((t) => t.correct === !0)),
41
36
  [r]
42
37
  );
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(
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: (o = r.options) == null ? void 0 : o.options.value,
44
+ feedbackMessages: (m = r.options) == null ? void 0 : m.options.value,
50
45
  questionType: r.type,
51
46
  questionId: r.id,
52
- questionAnswered: !!i,
53
- questionAnsweredCorrectly: i == null ? void 0 : i.correct,
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: !!i || r.marketClosed || e,
63
- questionAnswered: !!i,
64
- hasCorrectAnswer: f,
57
+ disabled: !!c || r.marketClosed || f,
58
+ questionAnswered: !!c,
59
+ hasCorrectAnswer: y,
65
60
  points: t.points,
66
- onVote: a
61
+ onVote: o
67
62
  }))
68
63
  }
69
- ) })
70
- ] }) }) : null;
64
+ )
65
+ ] });
71
66
  };
72
67
  export {
73
- M as Question
68
+ I as Question
74
69
  };
@@ -1,13 +1,13 @@
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";
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 d = p(s)`
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
- `, mo = ({
53
+ `, po = ({
54
54
  gamification: o
55
55
  }) => {
56
- const t = e(o.openedQuestion);
57
- return /* @__PURE__ */ i(m, { children: [
58
- t && /* @__PURE__ */ r(d, { children: /* @__PURE__ */ r(
59
- u,
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(n, { "data-nav": "true", children: /* @__PURE__ */ r(l, { gamification: o }) })
66
+ /* @__PURE__ */ r(s, { "data-nav": "true", children: /* @__PURE__ */ r(l, { gamification: o }) })
67
67
  ] });
68
68
  };
69
69
  export {
70
- mo as GamificationOverlay
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: var(--color-white);
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
- `, l = t.div`
32
+ `, d = t.div`
32
33
  padding: 14px 12px 14px 16px;
33
34
  display: flex;
34
35
  align-items: center;
35
- `, r = t.img`
36
+ `, l = t.img`
36
37
  width: 24px;
37
38
  height: 24px;
38
39
  margin-right: 12px;
39
- `, d = t.div`
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
- `, p = t.div`
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
- l as Feedback,
58
- p as FeedbackDescription,
59
- r as FeedbackIcon,
60
- d as FeedbackTitle,
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 n, jsx as o } from "react/jsx-runtime";
2
- import { QuestionTypeData as i } from "../../constants.js";
3
- import { Container as p, QuestionTypeWrap as s, QuestionTypeIcon as m, QuestionTypeTitle as c, CloseButton as l, CloseIcon as a } from "./styles.js";
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 Q = ({ type: t, close: r }) => {
9
- const e = i[t];
10
- return e ? /* @__PURE__ */ n(p, { children: [
11
- /* @__PURE__ */ n(s, { children: [
12
- /* @__PURE__ */ o(m, { name: e.iconName }),
13
- /* @__PURE__ */ o(c, { children: e.label })
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__ */ o(l, { onClick: r, children: /* @__PURE__ */ o(a, { name: "icon-cross" }) })
16
- ] }) : null;
15
+ /* @__PURE__ */ e(s, { onClick: i, children: /* @__PURE__ */ e(a, { name: "icon-cross" }) })
16
+ ] });
17
17
  };
18
18
  export {
19
- Q as VoteHeader
19
+ b as VoteHeader
20
20
  };
@@ -7,7 +7,7 @@ const n = r.div`
7
7
  opacity: 1;
8
8
  max-height: 500px;
9
9
 
10
- animation: containerShowIn 0.5s ease-out;
10
+ animation: containerShowIn 0.1s ease-out;
11
11
 
12
12
  @keyframes containerShowIn {
13
13
  0% {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.42.0",
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.1",
31
- "@streamlayer/sdk-web": "^0.28.3",
32
- "@streamlayer/sdk-web-anonymous-auth": "^0.10.12",
33
- "@streamlayer/sdk-web-api": "^0.0.6",
34
- "@streamlayer/sdk-web-core": "^0.15.0",
35
- "@streamlayer/sdk-web-features": "^0.10.6",
36
- "@streamlayer/sdk-web-interfaces": "^0.18.4",
37
- "@streamlayer/sdk-web-notifications": "^0.10.3",
38
- "@streamlayer/sdk-web-storage": "^0.3.6",
39
- "@streamlayer/sdk-web-types": "^0.16.4"
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.1"
76
+ "@streamlayer/react": "^0.24.2"
77
77
  }
78
78
  }