@streamlayer/react-ui 0.51.0 → 0.52.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.
- package/lib/index.js +32 -30
- package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
- package/lib/ui/app/Features/FeatureProvider.js +6 -10
- package/lib/ui/app/Features/Gamification/Question.js +3 -2
- package/lib/ui/app/Features/Gamification/index.d.ts +1 -0
- package/lib/ui/app/Features/Gamification/index.js +16 -18
- package/lib/ui/app/Features/Highlights/index.d.ts +1 -0
- package/lib/ui/app/Features/Highlights/index.js +15 -11
- package/lib/ui/app/Features/index.d.ts +1 -0
- package/lib/ui/app/Features/index.js +12 -8
- package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +1 -0
- package/lib/ui/app/Navigation/MastersNavigation/index.js +10 -10
- package/lib/ui/app/masters.d.ts +1 -2
- package/lib/ui/app/masters.js +30 -33
- package/lib/ui/app/styles.js +14 -7
- package/lib/ui/app/useMastersApp.d.ts +4 -4
- package/lib/ui/app/useMastersApp.js +17 -17
- package/lib/ui/demo/DemoPoints.js +5 -3
- package/lib/ui/demo/Gamification.js +16 -15
- package/lib/ui/demo/Highlights.js +3 -2
- package/lib/ui/demo/components/Insight.d.ts +1 -0
- package/lib/ui/demo/components/Insight.js +10 -9
- package/lib/ui/demo/components/Insights.d.ts +1 -0
- package/lib/ui/demo/components/Insights.js +7 -7
- package/lib/ui/demo/components/Question.js +8 -7
- package/lib/ui/demo/components/index.js +15 -14
- package/lib/ui/demo/index.js +3 -2
- package/lib/ui/gamification/detailed-insight/index.d.ts +1 -0
- package/lib/ui/gamification/detailed-insight/index.js +14 -13
- package/lib/ui/gamification/insight-list/index.d.ts +1 -0
- package/lib/ui/gamification/insight-list/index.js +4 -4
- package/lib/ui/gamification/points/index.js +11 -9
- package/lib/ui/gamification/vote/index.js +40 -40
- package/lib/ui/gamification/vote/styles.js +5 -5
- package/lib/ui/gamification/vote/vote-option/index.d.ts +3 -1
- package/lib/ui/gamification/vote/vote-option/index.js +57 -36
- package/lib/ui/gamification/vote/vote-option/styles.js +7 -5
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +13 -12
- package/lib/ui/theme/index.js +2 -2
- package/lib/ui/theme/masters.js +3 -2
- package/lib/ui/theme/theme.d.ts +4 -0
- package/lib/ui/theme/theme.js +24 -19
- package/package.json +13 -13
package/lib/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { QuestionInApp as
|
|
2
|
-
import { Login as
|
|
3
|
-
import { Onboarding as
|
|
4
|
-
import { ActivePages as
|
|
5
|
-
import { LeaderboardItemDetail as
|
|
6
|
-
import { Question as
|
|
7
|
-
import { QuestionList as
|
|
8
|
-
import { UserStatistics as
|
|
9
|
-
import { Vote as
|
|
10
|
-
import { Demo as $
|
|
11
|
-
import { Points as
|
|
12
|
-
import { StreamLayerThemeProvider as
|
|
13
|
-
import { ThemeVariables as
|
|
1
|
+
import { QuestionInApp as jr } from "./ui/notifications/notification/question-inapp/index.js";
|
|
2
|
+
import { Login as qr } from "./ui/login/index.js";
|
|
3
|
+
import { Onboarding as zr } from "./ui/gamification/onboarding/index.js";
|
|
4
|
+
import { ActivePages as Er, Tab as Fr, Tabs as Gr } from "./ui/gamification/tabs/index.js";
|
|
5
|
+
import { LeaderboardItemDetail as Jr } from "./ui/gamification/leaderboard-item-detail/index.js";
|
|
6
|
+
import { Question as Mr } from "./ui/gamification/question/index.js";
|
|
7
|
+
import { QuestionList as Rr } from "./ui/gamification/question/list/index.js";
|
|
8
|
+
import { UserStatistics as Xr } from "./ui/gamification/user-statistics/index.js";
|
|
9
|
+
import { Vote as Zr } from "./ui/gamification/vote/index.js";
|
|
10
|
+
import { Demo as $r } from "./ui/demo/index.js";
|
|
11
|
+
import { Points as oo } from "./ui/gamification/points/index.js";
|
|
12
|
+
import { StreamLayerThemeProvider as mo } from "./ui/theme/index.js";
|
|
13
|
+
import { ThemeVariables as io, resetCss as eo, theme as so, themeStr as fo } from "./ui/theme/theme.js";
|
|
14
14
|
import "react/jsx-runtime";
|
|
15
15
|
import "react";
|
|
16
16
|
import "./icon-exit-d3f9fc80.js";
|
|
@@ -50,6 +50,7 @@ import "./ui/gamification/user-statistics/components/rank/styles.js";
|
|
|
50
50
|
import "./ui/gamification/user-statistics/components/statistic/index.js";
|
|
51
51
|
import "./ui/gamification/user-statistics/components/statistic/styles.js";
|
|
52
52
|
import "./ui/gamification/user-statistics/styles.js";
|
|
53
|
+
import "./ui/app/styles.js";
|
|
53
54
|
import "./ui/gamification/vote/feedback/index.js";
|
|
54
55
|
import "./ui/gamification/vote/feedback/styles.js";
|
|
55
56
|
import "./ui/gamification/vote/styles.js";
|
|
@@ -96,21 +97,22 @@ import "./ui/gamification/points/styles.js";
|
|
|
96
97
|
import "./ui/theme/breakpoints.js";
|
|
97
98
|
import "@linaria/core";
|
|
98
99
|
export {
|
|
99
|
-
|
|
100
|
-
$
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
100
|
+
Er as ActivePages,
|
|
101
|
+
$r as Demo,
|
|
102
|
+
Jr as LeaderboardItemDetail,
|
|
103
|
+
qr as Login,
|
|
104
|
+
zr as Onboarding,
|
|
105
|
+
oo as Points,
|
|
106
|
+
Mr as Question,
|
|
107
|
+
jr as QuestionInApp,
|
|
108
|
+
Rr as QuestionList,
|
|
109
|
+
mo as StreamLayerThemeProvider,
|
|
110
|
+
Fr as Tab,
|
|
111
|
+
Gr as Tabs,
|
|
112
|
+
io as ThemeVariables,
|
|
113
|
+
Xr as UserStatistics,
|
|
114
|
+
Zr as Vote,
|
|
115
|
+
eo as resetCss,
|
|
116
|
+
so as theme,
|
|
117
|
+
fo as themeStr
|
|
116
118
|
};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { FeatureStatus as
|
|
4
|
-
const c = ({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
children: n
|
|
8
|
-
}) => {
|
|
9
|
-
const d = e(i.status), { slStreamId: r } = e(o.sdkStore);
|
|
10
|
-
return r != null && r.loading ? /* @__PURE__ */ t("div", { children: "event is loading..." }) : r != null && r.data ? d !== u.Ready ? /* @__PURE__ */ t("div", { children: "wait feature..." }) : n : /* @__PURE__ */ t("div", { children: "event is forbidden..." });
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as i } from "@nanostores/react";
|
|
3
|
+
import { FeatureStatus as f } from "@streamlayer/sdk-web-interfaces";
|
|
4
|
+
const c = ({ feature: o, sdk: n, children: d, className: t }) => {
|
|
5
|
+
const u = i(o.status), { slStreamId: r } = i(n.sdkStore);
|
|
6
|
+
return r != null && r.loading ? /* @__PURE__ */ e("div", { className: t, children: "event is loading..." }) : r != null && r.data ? u !== f.Ready ? /* @__PURE__ */ e("div", { className: t, children: "wait feature..." }) : d : /* @__PURE__ */ e("div", { className: t, children: "event is forbidden..." });
|
|
11
7
|
};
|
|
12
8
|
export {
|
|
13
9
|
c as FeatureProvider
|
|
@@ -8,6 +8,7 @@ import "../../../gamification/constants.js";
|
|
|
8
8
|
import "../../../gamification/detail/header/styles.js";
|
|
9
9
|
import "../../../icons/index.js";
|
|
10
10
|
import "react";
|
|
11
|
+
import "../../styles.js";
|
|
11
12
|
import "../../../gamification/vote/feedback/index.js";
|
|
12
13
|
import "../../../gamification/vote/feedback/styles.js";
|
|
13
14
|
import "../../../gamification/vote/styles.js";
|
|
@@ -27,7 +28,7 @@ const x = l.div`
|
|
|
27
28
|
align-items: center;
|
|
28
29
|
justify-content: flex-start;
|
|
29
30
|
flex-direction: column;
|
|
30
|
-
`,
|
|
31
|
+
`, D = ({ openedQuestion: r, closeQuestion: m, vote: i }) => {
|
|
31
32
|
var o;
|
|
32
33
|
return /* @__PURE__ */ p(x, { children: [
|
|
33
34
|
/* @__PURE__ */ t(f, { close: m, type: (r == null ? void 0 : r.type) || c.UNSET }),
|
|
@@ -36,5 +37,5 @@ const x = l.div`
|
|
|
36
37
|
] });
|
|
37
38
|
};
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
D as Question
|
|
40
41
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { SDKScrollContainer as
|
|
5
|
-
import { ShowIn as
|
|
6
|
-
import { Question as
|
|
7
|
-
import { Tabs as
|
|
1
|
+
import { jsxs as p, Fragment as e, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { styled as n } from "@linaria/react";
|
|
3
|
+
import { useStore as s } from "@nanostores/react";
|
|
4
|
+
import { SDKScrollContainer as l } from "../../styles.js";
|
|
5
|
+
import { ShowIn as d } from "../../../show-in/index.js";
|
|
6
|
+
import { Question as u } from "./Question.js";
|
|
7
|
+
import { Tabs as a } from "./Tabs.js";
|
|
8
8
|
import "@streamlayer/sdk-web-types";
|
|
9
9
|
import "../../../gamification/detail/header/index.js";
|
|
10
10
|
import "../../../gamification/constants.js";
|
|
@@ -52,28 +52,26 @@ import "../../../gamification/user-statistics/components/rank/styles.js";
|
|
|
52
52
|
import "../../../gamification/user-statistics/components/statistic/index.js";
|
|
53
53
|
import "../../../gamification/user-statistics/components/statistic/styles.js";
|
|
54
54
|
import "../../../gamification/user-statistics/styles.js";
|
|
55
|
-
const
|
|
55
|
+
const c = n(d)`
|
|
56
56
|
position: absolute;
|
|
57
57
|
inset: 0;
|
|
58
58
|
top: var(--header-height);
|
|
59
59
|
background: var(--color-neutrals-white);
|
|
60
60
|
z-index: 3;
|
|
61
|
-
`,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
(i || t) && /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(
|
|
67
|
-
a,
|
|
61
|
+
`, fo = ({ gamification: o, className: t }) => {
|
|
62
|
+
const { loading: m, data: i } = s(o.openedQuestion);
|
|
63
|
+
return /* @__PURE__ */ p(e, { children: [
|
|
64
|
+
(m || i) && /* @__PURE__ */ r(c, { className: t, children: /* @__PURE__ */ r(
|
|
65
|
+
u,
|
|
68
66
|
{
|
|
69
67
|
closeQuestion: o.closeQuestion,
|
|
70
68
|
vote: o.submitAnswer,
|
|
71
|
-
openedQuestion:
|
|
69
|
+
openedQuestion: i
|
|
72
70
|
}
|
|
73
71
|
) }),
|
|
74
|
-
/* @__PURE__ */ r(
|
|
72
|
+
/* @__PURE__ */ r(l, { className: t, "data-nav": "true", style: { display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ r(a, { gamification: o }) })
|
|
75
73
|
] });
|
|
76
74
|
};
|
|
77
75
|
export {
|
|
78
|
-
|
|
76
|
+
fo as GamificationOverlay
|
|
79
77
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { Insight as
|
|
4
|
-
import { Insights as
|
|
1
|
+
import { jsxs as e, Fragment as m, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as p } from "@nanostores/react";
|
|
3
|
+
import { Insight as s } from "../../../demo/components/Insight.js";
|
|
4
|
+
import { Insights as n } from "../../../demo/components/Insights.js";
|
|
5
5
|
import "../../../gamification/detailed-insight/index.js";
|
|
6
6
|
import "../../../gamification/common-header/index.js";
|
|
7
7
|
import "../../../../icon-exit-d3f9fc80.js";
|
|
@@ -13,13 +13,17 @@ import "../../../gamification/insight/index.js";
|
|
|
13
13
|
import "@streamlayer/sdk-web-types";
|
|
14
14
|
import "../../../gamification/insight/styles.js";
|
|
15
15
|
import "../../../gamification/insight-list/styles.js";
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
const O = ({
|
|
17
|
+
highlights: o,
|
|
18
|
+
className: r
|
|
19
|
+
}) => {
|
|
20
|
+
const t = p(o.openedInsight);
|
|
21
|
+
return /* @__PURE__ */ e(m, { children: [
|
|
22
|
+
!t && o.insights && /* @__PURE__ */ i(n, { className: r, highlights: o, store: o.insights.getStore() }),
|
|
23
|
+
t && /* @__PURE__ */ i(
|
|
24
|
+
s,
|
|
22
25
|
{
|
|
26
|
+
className: r,
|
|
23
27
|
openedInsight: t,
|
|
24
28
|
closeHighlights: o.closeFeature,
|
|
25
29
|
closeInsight: o.closeHighlight
|
|
@@ -28,5 +32,5 @@ const y = ({ highlights: o }) => {
|
|
|
28
32
|
] });
|
|
29
33
|
};
|
|
30
34
|
export {
|
|
31
|
-
|
|
35
|
+
O as HighlightsOverlay
|
|
32
36
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { FeatureType as
|
|
4
|
-
import { FeatureProvider as
|
|
5
|
-
import { GamificationOverlay as
|
|
6
|
-
import { HighlightsOverlay as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as e } from "react";
|
|
3
|
+
import { FeatureType as m } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { FeatureProvider as p } from "./FeatureProvider.js";
|
|
5
|
+
import { GamificationOverlay as n } from "./Gamification/index.js";
|
|
6
|
+
import { HighlightsOverlay as g } from "./Highlights/index.js";
|
|
7
7
|
import "@nanostores/react";
|
|
8
8
|
import "@streamlayer/sdk-web-interfaces";
|
|
9
9
|
import "@linaria/react";
|
|
@@ -64,7 +64,11 @@ import "../../gamification/insight-list/index.js";
|
|
|
64
64
|
import "../../gamification/insight/index.js";
|
|
65
65
|
import "../../gamification/insight/styles.js";
|
|
66
66
|
import "../../gamification/insight-list/styles.js";
|
|
67
|
-
const
|
|
67
|
+
const Ir = ({
|
|
68
|
+
sdk: i,
|
|
69
|
+
feature: r,
|
|
70
|
+
className: t
|
|
71
|
+
}) => e(() => r ? r.featureConfig.get().type === m.GAMES ? /* @__PURE__ */ o(p, { className: t, sdk: i, feature: r, children: /* @__PURE__ */ o(n, { className: t, gamification: r, sdk: i }) }) : r.featureConfig.get().type === m.HIGHLIGHTS ? /* @__PURE__ */ o(p, { className: t, sdk: i, feature: r, children: /* @__PURE__ */ o(g, { className: t, highlights: r, sdk: i }) }) : null : null, [i, r]);
|
|
68
72
|
export {
|
|
69
|
-
|
|
73
|
+
Ir as ActiveFeature
|
|
70
74
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ChannelsButton as
|
|
3
|
-
import { FeaturedGroupsButton as
|
|
4
|
-
import { LeaderBoardButton as
|
|
5
|
-
import { Navigation as
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ChannelsButton as u, ChannelsButtonId as i } from "../../../navigation/button/Channels.js";
|
|
3
|
+
import { FeaturedGroupsButton as s, FeaturedGroupsButtonId as n } from "../../../navigation/button/FeaturedGroups.js";
|
|
4
|
+
import { LeaderBoardButton as e, LeaderBoardButtonId as m } from "../../../navigation/button/LeaderBoard.js";
|
|
5
|
+
import { Navigation as B } from "../../../navigation/masters.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
7
|
import "../../../icons/index.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "../../../navigation/button/index.js";
|
|
10
10
|
import "../../../navigation/button/styles.js";
|
|
11
11
|
import "../../../navigation/index.js";
|
|
12
|
-
const
|
|
13
|
-
/* @__PURE__ */ r(
|
|
12
|
+
const G = ({ activeOverlay: o, setActiveOverlay: t, sdkReady: p, className: d }) => /* @__PURE__ */ a(B, { className: d, children: [
|
|
13
|
+
/* @__PURE__ */ r(u, { active: o === i, onClick: () => t(i) }),
|
|
14
14
|
/* @__PURE__ */ r(
|
|
15
|
-
|
|
15
|
+
s,
|
|
16
16
|
{
|
|
17
17
|
active: o === n,
|
|
18
18
|
disabled: !p,
|
|
@@ -22,7 +22,7 @@ const F = ({ activeOverlay: o, setActiveOverlay: t, sdkReady: p }) => /* @__PURE
|
|
|
22
22
|
}
|
|
23
23
|
),
|
|
24
24
|
/* @__PURE__ */ r(
|
|
25
|
-
|
|
25
|
+
e,
|
|
26
26
|
{
|
|
27
27
|
active: o === m,
|
|
28
28
|
onClick: () => t(m)
|
|
@@ -33,5 +33,5 @@ export {
|
|
|
33
33
|
i as ChannelsButtonId,
|
|
34
34
|
n as FeaturedGroupsButtonId,
|
|
35
35
|
m as LeaderBoardButtonId,
|
|
36
|
-
|
|
36
|
+
G as MastersNavigation
|
|
37
37
|
};
|
package/lib/ui/app/masters.d.ts
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
3
|
export type Overlays = {};
|
|
4
4
|
export type MastersAppChildrenProps = {
|
|
5
|
-
enableSdk: () => void;
|
|
5
|
+
enableSdk: (event: string) => void;
|
|
6
6
|
disableSdk: () => void;
|
|
7
7
|
};
|
|
8
8
|
export type MastersAppProps = {
|
|
9
9
|
sdk: StreamLayerSDK;
|
|
10
|
-
event: string;
|
|
11
10
|
overlays?: Overlays;
|
|
12
11
|
children: (methods: MastersAppChildrenProps) => React.ReactNode;
|
|
13
12
|
};
|
package/lib/ui/app/masters.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { resetCss as e } from "../theme/theme.js";
|
|
3
3
|
import { ActiveFeature as v } from "./Features/index.js";
|
|
4
4
|
import { MastersNavigation as S } from "./Navigation/MastersNavigation/index.js";
|
|
5
|
-
import { SDKContainer as y, SDKScrollContainer as
|
|
6
|
-
import { useMastersApp as
|
|
7
|
-
import { useSdkFeature as
|
|
8
|
-
import { ChannelsButtonId as
|
|
9
|
-
import { LeaderBoardButtonId as
|
|
10
|
-
import { FeaturedGroupsButtonId as
|
|
11
|
-
import "../theme/theme.js";
|
|
5
|
+
import { SDKContainer as y, SDKScrollContainer as a } from "./styles.js";
|
|
6
|
+
import { useMastersApp as k } from "./useMastersApp.js";
|
|
7
|
+
import { useSdkFeature as b } from "./useSdkFeature.js";
|
|
8
|
+
import { ChannelsButtonId as A } from "../navigation/button/Channels.js";
|
|
9
|
+
import { LeaderBoardButtonId as n } from "../navigation/button/LeaderBoard.js";
|
|
10
|
+
import { FeaturedGroupsButtonId as B } from "../navigation/button/FeaturedGroups.js";
|
|
12
11
|
import "@linaria/core";
|
|
13
12
|
import "../theme/constants.js";
|
|
14
13
|
import "react";
|
|
@@ -78,42 +77,40 @@ import "../navigation/masters.js";
|
|
|
78
77
|
import "../navigation/index.js";
|
|
79
78
|
import "../navigation/button/index.js";
|
|
80
79
|
import "../navigation/button/styles.js";
|
|
81
|
-
const
|
|
82
|
-
const [,
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
},
|
|
85
|
-
const { sdkEnabled:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
);
|
|
89
|
-
return /* @__PURE__ */ r(f, { style: { height: "100%" }, children: /* @__PURE__ */ u(y, { children: [
|
|
90
|
-
i && /* @__PURE__ */ r(
|
|
80
|
+
const C = ({ sdk: r, className: m }) => {
|
|
81
|
+
const [, p] = b(r);
|
|
82
|
+
return /* @__PURE__ */ i(v, { className: m, feature: p, sdk: r });
|
|
83
|
+
}, Wt = ({ sdk: r, overlays: m, children: p }) => {
|
|
84
|
+
const { sdkEnabled: o, sdkReady: s, activeOverlay: t, activateAndLoadOverlay: d, enableSdk: l, disableSdk: c } = k(r);
|
|
85
|
+
return /* @__PURE__ */ f(y, { children: [
|
|
86
|
+
o && /* @__PURE__ */ i(
|
|
91
87
|
S,
|
|
92
88
|
{
|
|
93
|
-
sdkReady:
|
|
89
|
+
sdkReady: s,
|
|
94
90
|
activeOverlay: t,
|
|
95
|
-
|
|
91
|
+
className: e,
|
|
92
|
+
setActiveOverlay: (u) => d("", u)
|
|
96
93
|
}
|
|
97
94
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
95
|
+
/* @__PURE__ */ i(
|
|
96
|
+
a,
|
|
100
97
|
{
|
|
101
|
-
"data-nav":
|
|
102
|
-
style: { display: !
|
|
98
|
+
"data-nav": o.toString(),
|
|
99
|
+
style: { display: !o || t === A ? "block" : "none" },
|
|
103
100
|
children: p && p({ enableSdk: l, disableSdk: c })
|
|
104
101
|
}
|
|
105
102
|
),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
|
|
103
|
+
/* @__PURE__ */ i(
|
|
104
|
+
a,
|
|
108
105
|
{
|
|
109
|
-
"data-nav":
|
|
110
|
-
style: { display: t ===
|
|
111
|
-
children: m && t ===
|
|
106
|
+
"data-nav": o.toString(),
|
|
107
|
+
style: { display: t === n ? "block" : "none" },
|
|
108
|
+
children: m && t === n && m[t]
|
|
112
109
|
}
|
|
113
110
|
),
|
|
114
|
-
|
|
115
|
-
] })
|
|
111
|
+
o && t === B && /* @__PURE__ */ i(C, { className: e, sdk: r })
|
|
112
|
+
] });
|
|
116
113
|
};
|
|
117
114
|
export {
|
|
118
|
-
|
|
115
|
+
Wt as MastersApp
|
|
119
116
|
};
|
package/lib/ui/app/styles.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const i =
|
|
1
|
+
import { styled as t } from "@linaria/react";
|
|
2
|
+
const i = t.div`
|
|
3
3
|
height: 100%;
|
|
4
4
|
background: transparent;
|
|
5
5
|
font-family: var(--font-regular);
|
|
6
6
|
position: relative;
|
|
7
|
-
|
|
7
|
+
min-width: 324px;
|
|
8
|
+
`, r = t.div`
|
|
9
|
+
width: 100%;
|
|
8
10
|
overflow-y: auto;
|
|
9
11
|
height: 100%;
|
|
10
12
|
transition: transform;
|
|
@@ -15,17 +17,22 @@ const i = n.div`
|
|
|
15
17
|
height: calc(100% - var(--header-height));
|
|
16
18
|
transform: translateY(var(--header-height));
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
|
|
21
|
+
&[data-question-header='true'] {
|
|
22
|
+
height: calc(100% - var(--question-headers-height));
|
|
23
|
+
transform: translateY(var(--question-headers-height));
|
|
24
|
+
}
|
|
25
|
+
`, a = t.div`
|
|
19
26
|
display: flex;
|
|
20
27
|
flex-direction: column;
|
|
21
28
|
padding: var(--container-padding);
|
|
22
29
|
gap: var(--container-padding);
|
|
23
|
-
`,
|
|
30
|
+
`, e = t(a)`
|
|
24
31
|
background-color: var(--color-neutrals-white);
|
|
25
32
|
`;
|
|
26
33
|
export {
|
|
27
34
|
i as SDKContainer,
|
|
28
|
-
|
|
35
|
+
a as SDKContentContainer,
|
|
29
36
|
r as SDKScrollContainer,
|
|
30
|
-
|
|
37
|
+
e as SDKWhiteContainer
|
|
31
38
|
};
|
|
@@ -6,16 +6,16 @@ import { AvailableOverlays } from './Navigation/MastersNavigation';
|
|
|
6
6
|
* - On activate Channels or Leaderboard button, the SDK is disabled and the FG+ overlay is closed.
|
|
7
7
|
* - On sdk status change, if sdk disabled (f.e some errors occurred), the SDK is disabled and the FG+ overlay is closed.
|
|
8
8
|
* @param sdk - The StreamLayerSDK instance to use.
|
|
9
|
-
* @param event - The name of the event to create a session for.
|
|
10
9
|
* @returns An object containing various functions and state values for managing the SDK and app overlays.
|
|
11
10
|
* @returns disableSdk - A function that disables the SDK and closes the FG+ overlay.
|
|
12
11
|
* @returns enableSdk - A function that initializes the SDK and opens the FG+ overlay.
|
|
12
|
+
* With event (The id of the event to create a session for.) as a parameter.
|
|
13
13
|
*/
|
|
14
|
-
export declare const useMastersApp: (sdk: StreamLayerSDK
|
|
14
|
+
export declare const useMastersApp: (sdk: StreamLayerSDK) => {
|
|
15
15
|
sdkEnabled: boolean;
|
|
16
16
|
sdkReady: boolean;
|
|
17
17
|
activeOverlay: any;
|
|
18
|
-
activateAndLoadOverlay: (overlay: AvailableOverlays) => void;
|
|
19
|
-
enableSdk: () => void;
|
|
18
|
+
activateAndLoadOverlay: (event: string, overlay: AvailableOverlays) => void;
|
|
19
|
+
enableSdk: (event: string) => void;
|
|
20
20
|
disableSdk: () => void;
|
|
21
21
|
};
|
|
@@ -3,7 +3,7 @@ import { useState as u, useCallback as f, useEffect as S } from "react";
|
|
|
3
3
|
import { FeatureType as b } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import { ChannelsButtonId as l } from "../navigation/button/Channels.js";
|
|
6
|
-
import { FeaturedGroupsButtonId as
|
|
6
|
+
import { FeaturedGroupsButtonId as o } from "../navigation/button/FeaturedGroups.js";
|
|
7
7
|
import "../navigation/button/LeaderBoard.js";
|
|
8
8
|
import "../navigation/masters.js";
|
|
9
9
|
import "@linaria/react";
|
|
@@ -11,34 +11,34 @@ import "../icons/index.js";
|
|
|
11
11
|
import "../navigation/button/index.js";
|
|
12
12
|
import "../navigation/button/styles.js";
|
|
13
13
|
import "../navigation/index.js";
|
|
14
|
-
const R = (
|
|
15
|
-
const [m, n] = u(!1),
|
|
16
|
-
(
|
|
17
|
-
p(
|
|
14
|
+
const R = (t) => {
|
|
15
|
+
const [m, n] = u(!1), a = d(t.status) === "ready", [i, p] = u(o), s = f(
|
|
16
|
+
(e, r) => {
|
|
17
|
+
p(r), r === o ? (e && t.createEventSession(e), t.openFeature(b.GAMES)) : t.closeFeature();
|
|
18
18
|
},
|
|
19
|
-
[
|
|
19
|
+
[t]
|
|
20
20
|
);
|
|
21
21
|
return S(() => {
|
|
22
|
-
!
|
|
23
|
-
}, [
|
|
22
|
+
!a && i === o && (p(l), t.closeFeature());
|
|
23
|
+
}, [a, i, t]), {
|
|
24
24
|
sdkEnabled: m,
|
|
25
|
-
sdkReady:
|
|
26
|
-
activeOverlay:
|
|
27
|
-
activateAndLoadOverlay:
|
|
28
|
-
enableSdk: () => {
|
|
29
|
-
|
|
25
|
+
sdkReady: a,
|
|
26
|
+
activeOverlay: i,
|
|
27
|
+
activateAndLoadOverlay: s,
|
|
28
|
+
enableSdk: (e) => {
|
|
29
|
+
t.initializeApp().then(({ enabled: r, err: c }) => {
|
|
30
30
|
if (n(!0), c) {
|
|
31
|
-
|
|
31
|
+
s(e, l);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
if (
|
|
35
|
-
|
|
34
|
+
if (r) {
|
|
35
|
+
s(e, o);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
},
|
|
40
40
|
disableSdk: () => {
|
|
41
|
-
n(!1),
|
|
41
|
+
n(!1), t.disableApp();
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
};
|
|
@@ -3,12 +3,14 @@ import { FeatureType as s } from "@streamlayer/sdk-web-types";
|
|
|
3
3
|
import { useStore as p } from "@nanostores/react";
|
|
4
4
|
import { styled as u } from "@linaria/react";
|
|
5
5
|
import { Points as a } from "../gamification/points/index.js";
|
|
6
|
+
import "../theme/theme.js";
|
|
7
|
+
import "@linaria/core";
|
|
8
|
+
import "../theme/constants.js";
|
|
6
9
|
import "../../utils/common.js";
|
|
7
10
|
import "../gamification/points/styles.js";
|
|
8
11
|
import "../icons/index.js";
|
|
9
12
|
import "react";
|
|
10
13
|
import "../theme/breakpoints.js";
|
|
11
|
-
import "../theme/constants.js";
|
|
12
14
|
const d = u.div`
|
|
13
15
|
position: fixed;
|
|
14
16
|
top: 0;
|
|
@@ -17,10 +19,10 @@ const d = u.div`
|
|
|
17
19
|
var m, i, e, n;
|
|
18
20
|
const t = p(o);
|
|
19
21
|
return ((i = (m = t.data) == null ? void 0 : m.summary) == null ? void 0 : i.points) === void 0 ? null : /* @__PURE__ */ r(d, { children: ((n = (e = t.data) == null ? void 0 : e.summary) == null ? void 0 : n.points) && /* @__PURE__ */ r(a, { points: t.data.summary.points }) });
|
|
20
|
-
},
|
|
22
|
+
}, A = ({ sdk: o }) => {
|
|
21
23
|
const t = o.getFeature(s.GAMES);
|
|
22
24
|
return t != null && t.userSummary ? /* @__PURE__ */ r(f, { store: t.userSummary.getStore() }) : null;
|
|
23
25
|
};
|
|
24
26
|
export {
|
|
25
|
-
|
|
27
|
+
A as DemoPoints
|
|
26
28
|
};
|