@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.
@@ -1,8 +1,8 @@
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";
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 = n.div`
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
- @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);
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
- [a]
34
+ [m]
48
35
  );
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]
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 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,
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: t.subject,
62
- feedbackMessages: (c = t.options) == null ? void 0 : c.options.value,
63
- questionType: t.type,
64
- questionId: t.id,
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: 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,
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: r.points,
79
- onVote: m
65
+ points: t.points,
66
+ onVote: a
80
67
  }))
81
68
  }
82
69
  ) })
@@ -1,8 +1,10 @@
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 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 g = ({
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 r = i(o.openedQuestion);
50
- return /* @__PURE__ */ m(p, { children: [
51
- r && /* @__PURE__ */ t(
52
- e,
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: r
63
+ openedQuestion: t
57
64
  }
58
- ),
59
- !r && /* @__PURE__ */ t(s, { gamification: o })
65
+ ) }),
66
+ /* @__PURE__ */ r(n, { "data-nav": "true", children: /* @__PURE__ */ r(l, { gamification: o }) })
60
67
  ] });
61
68
  };
62
69
  export {
63
- g as GamificationOverlay
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 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
  };
@@ -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.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.41.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.0"
76
+ "@streamlayer/react": "^0.24.1"
77
77
  }
78
78
  }