@streamlayer/react-ui 0.51.0 → 0.52.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.
- package/lib/index.js +31 -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/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 +1 -0
- 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/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/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/theme/index.js +2 -2
- package/lib/ui/theme/theme.d.ts +4 -0
- package/lib/ui/theme/theme.js +20 -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 Ur } from "./ui/notifications/notification/question-inapp/index.js";
|
|
2
|
+
import { Login as kr } from "./ui/login/index.js";
|
|
3
|
+
import { Onboarding as wr } from "./ui/gamification/onboarding/index.js";
|
|
4
|
+
import { ActivePages as Br, Tab as Er, Tabs as Fr } from "./ui/gamification/tabs/index.js";
|
|
5
|
+
import { LeaderboardItemDetail as Hr } from "./ui/gamification/leaderboard-item-detail/index.js";
|
|
6
|
+
import { Question as Kr } from "./ui/gamification/question/index.js";
|
|
7
|
+
import { QuestionList as Nr } from "./ui/gamification/question/list/index.js";
|
|
8
|
+
import { UserStatistics as Wr } from "./ui/gamification/user-statistics/index.js";
|
|
9
|
+
import { Vote as Yr } from "./ui/gamification/vote/index.js";
|
|
10
|
+
import { Demo as _r } from "./ui/demo/index.js";
|
|
11
|
+
import { Points as ro } from "./ui/gamification/points/index.js";
|
|
12
|
+
import { StreamLayerThemeProvider as to } from "./ui/theme/index.js";
|
|
13
|
+
import { ThemeVariables as po, resetCss as io, theme as eo, themeStr as so } from "./ui/theme/theme.js";
|
|
14
14
|
import "react/jsx-runtime";
|
|
15
15
|
import "react";
|
|
16
16
|
import "./icon-exit-d3f9fc80.js";
|
|
@@ -96,21 +96,22 @@ import "./ui/gamification/points/styles.js";
|
|
|
96
96
|
import "./ui/theme/breakpoints.js";
|
|
97
97
|
import "@linaria/core";
|
|
98
98
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
99
|
+
Br as ActivePages,
|
|
100
|
+
_r as Demo,
|
|
101
|
+
Hr as LeaderboardItemDetail,
|
|
102
|
+
kr as Login,
|
|
103
|
+
wr as Onboarding,
|
|
104
|
+
ro as Points,
|
|
105
|
+
Kr as Question,
|
|
106
|
+
Ur as QuestionInApp,
|
|
107
|
+
Nr as QuestionList,
|
|
108
|
+
to as StreamLayerThemeProvider,
|
|
109
|
+
Er as Tab,
|
|
110
|
+
Fr as Tabs,
|
|
111
|
+
po as ThemeVariables,
|
|
112
|
+
Wr as UserStatistics,
|
|
113
|
+
Yr as Vote,
|
|
114
|
+
io as resetCss,
|
|
115
|
+
eo as theme,
|
|
116
|
+
so as themeStr
|
|
116
117
|
};
|
|
@@ -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
|
|
@@ -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
|
@@ -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
|
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { DetailedInsight as
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import { DetailedInsight as c } from "../../gamification/detailed-insight/index.js";
|
|
3
3
|
import "../../gamification/common-header/index.js";
|
|
4
4
|
import "../../../icon-exit-d3f9fc80.js";
|
|
5
5
|
import "../../gamification/common-header/styles.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
7
|
import "../../gamification/detailed-insight/styles.js";
|
|
8
|
-
const
|
|
8
|
+
const x = ({ openedInsight: o, closeHighlights: r, closeInsight: s, className: l }) => {
|
|
9
9
|
var t, a, b, n, e;
|
|
10
10
|
const i = ((t = o.options) == null ? void 0 : t.options.case) === "factoid" ? {
|
|
11
11
|
image: o.options.options.value.image,
|
|
12
12
|
body: o.options.options.value.body,
|
|
13
13
|
webLink: (a = o.options.options.value.webLink) == null ? void 0 : a.url,
|
|
14
14
|
webLinkLabel: (b = o.options.options.value.webLink) == null ? void 0 : b.label
|
|
15
|
-
} : {},
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
15
|
+
} : {}, m = o.subject || ((n = o.notification) == null ? void 0 : n.title), p = i.body || ((e = o.notification) == null ? void 0 : e.body);
|
|
16
|
+
return /* @__PURE__ */ L(
|
|
17
|
+
c,
|
|
18
18
|
{
|
|
19
|
+
className: l,
|
|
19
20
|
image: i.image,
|
|
20
|
-
title:
|
|
21
|
-
description:
|
|
21
|
+
title: m,
|
|
22
|
+
description: p,
|
|
22
23
|
webLink: i.webLink,
|
|
23
24
|
webLinkLabel: i.webLinkLabel,
|
|
24
25
|
closeInsight: s,
|
|
@@ -27,5 +28,5 @@ const j = ({ openedInsight: o, closeHighlights: r, closeInsight: s }) => {
|
|
|
27
28
|
);
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
x as Insight
|
|
31
32
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { InsightList as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as p } from "@nanostores/react";
|
|
3
|
+
import { InsightList as s } from "../../gamification/insight-list/index.js";
|
|
4
4
|
import "../../gamification/insight/index.js";
|
|
5
5
|
import "@streamlayer/sdk-web-types";
|
|
6
6
|
import "../../gamification/insight/styles.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "../../gamification/insight-list/styles.js";
|
|
9
|
-
const
|
|
10
|
-
const { data:
|
|
11
|
-
return
|
|
9
|
+
const c = ({ highlights: o, store: n, className: t }) => {
|
|
10
|
+
const { data: i } = p(n);
|
|
11
|
+
return i ? /* @__PURE__ */ r(s, { className: t, insights: i, openInsight: o.openHighlight }) : /* @__PURE__ */ r("div", { className: t, children: "wait insights..." });
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
c as Insights
|
|
15
15
|
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { jsxs as I, jsx as M } from "react/jsx-runtime";
|
|
2
|
-
import { CommonHeader as
|
|
3
|
-
import { Container as
|
|
2
|
+
import { CommonHeader as g } from "../common-header/index.js";
|
|
3
|
+
import { Container as l, Image as o, AdditionalContent as n, Title as d, Description as r, AdditionalBtn as a, LinkIcon as u } from "./styles.js";
|
|
4
4
|
import "../../../icon-exit-d3f9fc80.js";
|
|
5
5
|
import "../common-header/styles.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
|
-
const
|
|
7
|
+
const b = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTciIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNyAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBjbGFzcz0ic2MtQU5kc04ga1RWV0pFIj48cGF0aCBkPSJNNi42NjY1IDMuMTY2NjlINC45OTk4NEM0LjI2MzQ2IDMuMTY2NjkgMy42NjY1IDMuNzYzNjQgMy42NjY1IDQuNTAwMDJWMTEuNUMzLjY2NjUgMTIuMjM2NCA0LjI2MzQ2IDEyLjgzMzQgNC45OTk4NCAxMi44MzM0SDExLjk5OThDMTIuNzM2MiAxMi44MzM0IDEzLjMzMzIgMTIuMjM2NCAxMy4zMzMyIDExLjVWOS44MzMzNSIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48L3BhdGg+PHBhdGggZD0iTTEzLjMzMzUgNi4xNjY2OVYzLjE2NjY5SDEwLjMzMzUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjxwYXRoIGQ9Ik0xMy4xNjY4IDMuMzMzMzFMOC4zMzM1IDguMTY2NjUiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjwvc3ZnPgo=", L = ({
|
|
8
8
|
image: i,
|
|
9
9
|
title: j,
|
|
10
10
|
description: m,
|
|
11
11
|
webLinkLabel: z,
|
|
12
12
|
webLink: c,
|
|
13
13
|
closeHighlights: t,
|
|
14
|
-
closeInsight: N
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
closeInsight: N,
|
|
15
|
+
className: Z
|
|
16
|
+
}) => /* @__PURE__ */ I(l, { className: Z, children: [
|
|
17
|
+
/* @__PURE__ */ M(g, { close: t, comeBack: N }),
|
|
18
|
+
i && /* @__PURE__ */ M(o, { alt: "detail-insight-image", src: i }),
|
|
19
|
+
/* @__PURE__ */ I(n, { children: [
|
|
20
|
+
j && /* @__PURE__ */ M(d, { children: j }),
|
|
21
|
+
m && /* @__PURE__ */ M(r, { children: m })
|
|
21
22
|
] }),
|
|
22
|
-
c && z && /* @__PURE__ */ I(
|
|
23
|
+
c && z && /* @__PURE__ */ I(a, { href: c, target: "_blank", children: [
|
|
23
24
|
z,
|
|
24
|
-
/* @__PURE__ */ M(
|
|
25
|
+
/* @__PURE__ */ M(u, { alt: "link-icon", src: b })
|
|
25
26
|
] })
|
|
26
27
|
] });
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
L as DetailedInsight
|
|
29
30
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Insight as
|
|
3
|
-
import { Container as
|
|
2
|
+
import { Insight as n } from "../insight/index.js";
|
|
3
|
+
import { Container as i, ItemsContainer as p } from "./styles.js";
|
|
4
4
|
import "@streamlayer/sdk-web-types";
|
|
5
5
|
import "../insight/styles.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
|
-
const
|
|
7
|
+
const u = ({ insights: r, openInsight: m, className: e }) => /* @__PURE__ */ o(i, { className: e, children: /* @__PURE__ */ o(p, { children: r == null ? void 0 : r.map((t) => /* @__PURE__ */ o(n, { openInsight: m, ...t }, t.questionId)) }) });
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
u as InsightList
|
|
10
10
|
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { resetCss as r } from "../../theme/theme.js";
|
|
3
|
+
import { formatDecimals as n } from "../../../utils/common.js";
|
|
4
|
+
import { PointsContainer as m, PointsIcon as s, PointsSvg as e, PointsBody as p, PointsTitle as c, PointsValue as l } from "./styles.js";
|
|
5
|
+
import "@linaria/core";
|
|
6
|
+
import "../../theme/constants.js";
|
|
4
7
|
import "@linaria/react";
|
|
5
8
|
import "../../icons/index.js";
|
|
6
9
|
import "react";
|
|
7
10
|
import "../../theme/breakpoints.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
12
|
-
/* @__PURE__ */ o(
|
|
13
|
-
/* @__PURE__ */ o(c, { children: r(t) })
|
|
11
|
+
const T = ({ points: t }) => /* @__PURE__ */ i(m, { className: r, children: [
|
|
12
|
+
/* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e, { name: "icon-trophy" }) }),
|
|
13
|
+
/* @__PURE__ */ i(p, { children: [
|
|
14
|
+
/* @__PURE__ */ o(c, { children: "Total points" }),
|
|
15
|
+
/* @__PURE__ */ o(l, { children: n(t) })
|
|
14
16
|
] })
|
|
15
17
|
] });
|
|
16
18
|
export {
|
|
17
|
-
|
|
19
|
+
T as Points
|
|
18
20
|
};
|
package/lib/ui/theme/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { theme as o } from "./theme.js";
|
|
3
3
|
import "@linaria/core";
|
|
4
4
|
import "./constants.js";
|
|
5
|
-
const
|
|
5
|
+
const p = ({ children: r, style: m }) => /* @__PURE__ */ e("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ e("div", { className: o, style: m, children: r }) });
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
p as StreamLayerThemeProvider
|
|
8
8
|
};
|
package/lib/ui/theme/theme.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export declare const themeStr: string;
|
|
2
|
+
/**
|
|
3
|
+
* @link https://stackoverflow.com/a/65560812
|
|
4
|
+
*/
|
|
5
|
+
export declare const resetCss = "StreamLayerCSSReset";
|
|
2
6
|
export declare const theme: import("@linaria/core").LinariaClassName;
|
|
3
7
|
export declare const ThemeVariables: () => import("react/jsx-runtime").JSX.Element;
|
package/lib/ui/theme/theme.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { css as
|
|
3
|
-
import { colors as c, FONT as
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { css as l } from "@linaria/core";
|
|
3
|
+
import { colors as c, FONT as t } from "./constants.js";
|
|
4
4
|
const i = `
|
|
5
5
|
${c}
|
|
6
|
-
--font-family: ${
|
|
7
|
-
--font-regular: ${
|
|
8
|
-
--font-color: ${
|
|
9
|
-
--font-serif: ${
|
|
10
|
-
--font-weight-default: ${
|
|
6
|
+
--font-family: ${t.REGULAR};
|
|
7
|
+
--font-regular: ${t.REGULAR};
|
|
8
|
+
--font-color: ${t.COLOR};
|
|
9
|
+
--font-serif: ${t.SERIF};
|
|
10
|
+
--font-weight-default: ${t.WEIGHT_DEFAULT};
|
|
11
11
|
|
|
12
12
|
--header-height: 68px;
|
|
13
13
|
--animation-duration: 0.5s;
|
|
14
14
|
--animation-function: ease;
|
|
15
15
|
--container-padding: 16px;
|
|
16
16
|
--border-radius: 8px;
|
|
17
|
-
`, f =
|
|
17
|
+
`, f = "StreamLayerCSSReset", p = l`
|
|
18
18
|
${i}
|
|
19
|
-
`,
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
19
|
+
`, u = () => /* @__PURE__ */ e("table", { children: /* @__PURE__ */ r("table", { children: [
|
|
20
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
|
|
21
|
+
/* @__PURE__ */ e("th", { children: "name" }),
|
|
22
|
+
/* @__PURE__ */ e("th", { children: "value" })
|
|
23
23
|
] }) }),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
const n = o.trim(), [a,
|
|
24
|
+
/* @__PURE__ */ e("tbody", { children: i.split(";").map((o) => {
|
|
25
|
+
const n = o.trim(), [a, s] = n.split(":");
|
|
26
26
|
return /* @__PURE__ */ r("tr", { children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ e("td", { children: a }),
|
|
28
|
+
/* @__PURE__ */ e("td", { children: s })
|
|
29
29
|
] }, n);
|
|
30
30
|
}) })
|
|
31
31
|
] }) });
|
|
32
32
|
export {
|
|
33
|
-
|
|
34
|
-
f as
|
|
33
|
+
u as ThemeVariables,
|
|
34
|
+
f as resetCss,
|
|
35
|
+
p as theme,
|
|
35
36
|
i as themeStr
|
|
36
37
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"package.json"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@streamlayer/sl-eslib": "^5.
|
|
29
|
+
"@streamlayer/sl-eslib": "^5.53.5",
|
|
30
30
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
31
31
|
"react-window": "^1.8.9",
|
|
32
32
|
"react-window-infinite-loader": "^1.0.9",
|
|
33
|
-
"@streamlayer/feature-gamification": "^0.19.
|
|
34
|
-
"@streamlayer/sdk-web": "^0.28.
|
|
35
|
-
"@streamlayer/sdk-web-anonymous-auth": "^0.11.
|
|
36
|
-
"@streamlayer/sdk-web-api": "^0.1
|
|
37
|
-
"@streamlayer/sdk-web-core": "^0.17.
|
|
38
|
-
"@streamlayer/sdk-web-features": "^0.10.
|
|
39
|
-
"@streamlayer/sdk-web-interfaces": "^0.18.
|
|
40
|
-
"@streamlayer/sdk-web-notifications": "^0.10.
|
|
41
|
-
"@streamlayer/sdk-web-
|
|
42
|
-
"@streamlayer/sdk-web-
|
|
33
|
+
"@streamlayer/feature-gamification": "^0.19.3",
|
|
34
|
+
"@streamlayer/sdk-web": "^0.28.10",
|
|
35
|
+
"@streamlayer/sdk-web-anonymous-auth": "^0.11.5",
|
|
36
|
+
"@streamlayer/sdk-web-api": "^0.0.1",
|
|
37
|
+
"@streamlayer/sdk-web-core": "^0.17.1",
|
|
38
|
+
"@streamlayer/sdk-web-features": "^0.10.13",
|
|
39
|
+
"@streamlayer/sdk-web-interfaces": "^0.18.9",
|
|
40
|
+
"@streamlayer/sdk-web-notifications": "^0.10.8",
|
|
41
|
+
"@streamlayer/sdk-web-types": "^0.17.1",
|
|
42
|
+
"@streamlayer/sdk-web-storage": "^0.3.10"
|
|
43
43
|
},
|
|
44
44
|
"nx": {
|
|
45
45
|
"implicitDependencies": [
|
|
@@ -78,6 +78,6 @@
|
|
|
78
78
|
"vite-plugin-svgr": "^4.1.0",
|
|
79
79
|
"vite-svg-loader": "^4.0.0",
|
|
80
80
|
"vite-tsconfig-paths": "^4.2.1",
|
|
81
|
-
"@streamlayer/react": "^0.
|
|
81
|
+
"@streamlayer/react": "^0.26.0"
|
|
82
82
|
}
|
|
83
83
|
}
|