@streamlayer/react-ui 0.41.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,18 +1,16 @@
1
- import { jsx as s, jsxs as d } from "react/jsx-runtime";
2
- import { styled as n } from "@linaria/react";
3
- import { useState as p, useCallback as y, useMemo as o } from "react";
4
- import { Vote as x } from "../../../gamification/vote/index.js";
5
- import { VoteHeader as h } from "../../../gamification/vote/vote-header/index.js";
6
- import "@streamlayer/sdk-web-types";
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";
5
+ import { Vote as h } from "../../../gamification/vote/index.js";
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 = n.div`
14
- position: absolute;
15
- top: 0;
13
+ const T = x.div`
16
14
  background: var(--color-transparent-item);
17
15
  width: 100%;
18
16
  height: 100%;
@@ -21,67 +19,51 @@ const b = n.div`
21
19
  align-items: center;
22
20
  justify-content: flex-start;
23
21
  flex-direction: column;
24
-
25
- > div {
26
- width: 100%;
27
- background: #000;
28
- animation: slide-in 0.3s ease-in;
29
- }
30
-
31
- @keyframes slide-in {
32
- from {
33
- transform: translateX(-100%);
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);
22
+ `, I = ({ openedQuestion: r, closeQuestion: l, vote: o }) => {
23
+ var m;
24
+ const [f, i] = p(!1);
25
+ g(
26
+ (t) => {
27
+ i(t);
46
28
  },
47
- [a]
29
+ [i]
48
30
  );
49
- const i = o(
50
- () => t == null ? void 0 : t.answers.find((r) => r.youVoted === !0),
51
- [t]
52
- ), f = o(
53
- () => !!(t != null && t.answers.find((r) => r.correct === !0)),
54
- [t]
31
+ const c = s(
32
+ () => r == null ? void 0 : r.answers.find((t) => t.youVoted === !0),
33
+ [r]
34
+ ), y = s(
35
+ () => !!(r != null && r.answers.find((t) => t.correct === !0)),
36
+ [r]
55
37
  );
56
- return t ? /* @__PURE__ */ s(b, { children: /* @__PURE__ */ d("div", { children: [
57
- /* @__PURE__ */ s(h, { close: e, type: t.type }),
58
- /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
59
- x,
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(
41
+ h,
60
42
  {
61
- title: t.subject,
62
- feedbackMessages: (c = t.options) == null ? void 0 : c.options.value,
63
- questionType: t.type,
64
- questionId: t.id,
65
- questionAnswered: !!i,
66
- questionAnsweredCorrectly: i == null ? void 0 : i.correct,
67
- options: t.answers.map((r) => ({
68
- id: r.id,
69
- title: r.text,
70
- icon: r.icon,
71
- type: t.type,
72
- correct: r.correct,
73
- percentage: r.percentage,
74
- answered: r.youVoted,
75
- disabled: !!i || t.marketClosed || l,
76
- questionAnswered: !!i,
77
- hasCorrectAnswer: f,
78
- points: r.points,
79
- onVote: m
43
+ title: r.subject,
44
+ feedbackMessages: (m = r.options) == null ? void 0 : m.options.value,
45
+ questionType: r.type,
46
+ questionId: r.id,
47
+ questionAnswered: !!c,
48
+ questionAnsweredCorrectly: c == null ? void 0 : c.correct,
49
+ options: r.answers.map((t) => ({
50
+ id: t.id,
51
+ title: t.text,
52
+ icon: t.icon,
53
+ type: r.type,
54
+ correct: t.correct,
55
+ percentage: t.percentage,
56
+ answered: t.youVoted,
57
+ disabled: !!c || r.marketClosed || f,
58
+ questionAnswered: !!c,
59
+ hasCorrectAnswer: y,
60
+ points: t.points,
61
+ onVote: o
80
62
  }))
81
63
  }
82
- ) })
83
- ] }) }) : null;
64
+ )
65
+ ] });
84
66
  };
85
67
  export {
86
- M as Question
68
+ I as Question
87
69
  };
@@ -1,11 +1,13 @@
1
- import { jsxs as m, Fragment as p, jsx as t } from "react/jsx-runtime";
2
- import { useStore as i } from "@nanostores/react";
3
- import { Question as e } from "./Question.js";
4
- import { Tabs as s } from "./Tabs.js";
5
- import "@linaria/react";
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
+ import { Tabs as l } from "./Tabs.js";
6
8
  import "react";
7
- import "../../../gamification/vote/index.js";
8
9
  import "@streamlayer/sdk-web-types";
10
+ import "../../../gamification/vote/index.js";
9
11
  import "../../../../index-7045fbb2.js";
10
12
  import "../../../gamification/vote/components/voting-option/styles.js";
11
13
  import "../../../gamification/vote/styles.js";
@@ -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 g = ({
47
+ const u = e(a)`
48
+ position: absolute;
49
+ inset: 0;
50
+ top: var(--header-height);
51
+ background: var(--color-neutrals-white);
52
+ z-index: 3;
53
+ `, po = ({
47
54
  gamification: o
48
55
  }) => {
49
- const r = i(o.openedQuestion);
56
+ const { loading: i, data: t } = n(o.openedQuestion);
50
57
  return /* @__PURE__ */ m(p, { children: [
51
- r && /* @__PURE__ */ t(
52
- e,
58
+ (i || t) && /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(
59
+ d,
53
60
  {
54
61
  closeQuestion: o.closeQuestion,
55
62
  vote: o.submitAnswer,
56
- openedQuestion: r
63
+ openedQuestion: t
57
64
  }
58
- ),
59
- !r && /* @__PURE__ */ t(s, { gamification: o })
65
+ ) }),
66
+ /* @__PURE__ */ r(s, { "data-nav": "true", children: /* @__PURE__ */ r(l, { gamification: o }) })
60
67
  ] });
61
68
  };
62
69
  export {
63
- g as GamificationOverlay
70
+ po 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 cr = ({ 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
+ 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
- cr as ActiveFeature
61
+ hr as ActiveFeature
61
62
  };
@@ -1,14 +1,14 @@
1
- import { jsx as t, jsxs as e } from "react/jsx-runtime";
2
- import { StreamLayerThemeProvider as u } from "../theme/index.js";
3
- import { mastersVariables as f } from "../theme/masters.js";
4
- import { ActiveFeature as v } from "./Features/index.js";
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 S, SDKScrollContainer as h } from "./styles.js";
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 B } from "../navigation/button/FeaturedGroups.js";
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 F = ({ sdk: o }) => {
75
- const [, i] = k(o);
76
- return /* @__PURE__ */ t(v, { feature: i, sdk: o });
77
- }, zr = ({ sdk: o, overlays: i, children: p, event: n }) => {
78
- const { sdkEnabled: m, sdkReady: s, activeOverlay: r, activateAndLoadOverlay: d, enableSdk: l, disableSdk: c } = b(
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(u, { style: { height: "100%" }, children: /* @__PURE__ */ e(S, { className: f, children: [
83
- m && /* @__PURE__ */ t(
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__ */ e(h, { "data-nav": m.toString(), children: [
92
- /* @__PURE__ */ t("div", { style: { display: !m || r === A ? "block" : "none" }, children: p && p({ enableSdk: l, disableSdk: c }) }),
93
- /* @__PURE__ */ t("div", { style: { display: r === a ? "block" : "none" }, children: i && r === a && i[r] }),
94
- m && r === B && /* @__PURE__ */ t(F, { sdk: o })
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
- zr as MastersApp
112
+ Hr as MastersApp
100
113
  };
@@ -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
  };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const ShowIn: React.FC<{
3
+ children: React.ReactNode | React.ReactNode[];
4
+ style?: React.CSSProperties;
5
+ className?: string;
6
+ }>;
@@ -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.1s 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.41.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.0"
76
+ "@streamlayer/react": "^0.24.2"
77
77
  }
78
78
  }