@streamlayer/react-ui 0.27.0 → 0.27.2
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 +29 -28
- package/lib/ui/demo/index.js +36 -41
- package/lib/ui/theme/ThemeColors.js +15 -0
- package/lib/ui/theme/ThemeTypography.js +5 -0
- package/lib/ui/theme/constants.js +33 -5
- package/lib/ui/theme/theme.js +25 -27
- package/package.json +2 -2
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 { theme as or } from "./ui/theme/theme.js";
|
|
1
|
+
import { QuestionInApp as Vo } from "./ui/notifications/notification/question-inapp/index.js";
|
|
2
|
+
import { Login as No } from "./ui/login/index.js";
|
|
3
|
+
import { Onboarding as Uo } from "./ui/gamification/onboarding/index.js";
|
|
4
|
+
import { ActivePages as ko, Navigation as qo } from "./ui/gamification/navigation/index.js";
|
|
5
|
+
import { LeaderboardItemDetail as zo } from "./ui/gamification/leaderboard-item-detail/index.js";
|
|
6
|
+
import { Question as Co } from "./ui/gamification/question/index.js";
|
|
7
|
+
import { QuestionList as Fo } from "./ui/gamification/question-list/index.js";
|
|
8
|
+
import { UserStatistics as Ho } from "./ui/gamification/user-statistics/index.js";
|
|
9
|
+
import { Vote as Ko } from "./ui/gamification/vote/index.js";
|
|
10
|
+
import { Demo as Ro } from "./ui/demo/index.js";
|
|
11
|
+
import { Points as Xo } from "./ui/gamification/points/index.js";
|
|
12
|
+
import { StreamLayerThemeProvider as Zo } from "./ui/theme/index.js";
|
|
13
|
+
import { ThemeVariables as $o, theme as or, themeStr as rr } from "./ui/theme/theme.js";
|
|
14
14
|
import "react/jsx-runtime";
|
|
15
15
|
import "react";
|
|
16
16
|
import "./icon-exit-6a55bb8f.js";
|
|
@@ -87,23 +87,24 @@ import "./ui/gamification/insight/index.js";
|
|
|
87
87
|
import "./ui/demo/components/Insight.js";
|
|
88
88
|
import "./ui/gamification/detailed-insight/index.js";
|
|
89
89
|
import "./ui/demo/Login.js";
|
|
90
|
-
import "./ui/demo/DemoPoints.js";
|
|
91
90
|
import "./ui/gamification/points/styles.js";
|
|
92
91
|
import "./ui/icons/index.js";
|
|
93
92
|
import "@linaria/core";
|
|
94
93
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
94
|
+
ko as ActivePages,
|
|
95
|
+
Ro as Demo,
|
|
96
|
+
zo as LeaderboardItemDetail,
|
|
97
|
+
No as Login,
|
|
98
|
+
qo as Navigation,
|
|
99
|
+
Uo as Onboarding,
|
|
100
|
+
Xo as Points,
|
|
101
|
+
Co as Question,
|
|
102
|
+
Vo as QuestionInApp,
|
|
103
|
+
Fo as QuestionList,
|
|
104
|
+
Zo as StreamLayerThemeProvider,
|
|
105
|
+
$o as ThemeVariables,
|
|
106
|
+
Ho as UserStatistics,
|
|
107
|
+
Ko as Vote,
|
|
108
|
+
or as theme,
|
|
109
|
+
rr as themeStr
|
|
109
110
|
};
|
package/lib/ui/demo/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { FeatureStatus as
|
|
1
|
+
import { jsx as i, jsxs as f, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { FeatureStatus as l } from "@streamlayer/sdk-web-interfaces";
|
|
3
3
|
import { FeatureType as g } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import { AvailableFeatures as S } from "@streamlayer/sdk-web-features";
|
|
5
5
|
import { useState as b, useMemo as h, useEffect as C } from "react";
|
|
@@ -8,8 +8,7 @@ import { Notifications as F } from "../notifications/index.js";
|
|
|
8
8
|
import { GamificationComponent as w } from "./Gamification.js";
|
|
9
9
|
import { HighlightsComponent as G } from "./Highlights.js";
|
|
10
10
|
import { LoginComponent as H } from "./Login.js";
|
|
11
|
-
import {
|
|
12
|
-
import { Buttons as A, Button as s } from "./styles.js";
|
|
11
|
+
import { Buttons as x, Button as s } from "./styles.js";
|
|
13
12
|
import "../notifications/notification/index.js";
|
|
14
13
|
import "@streamlayer/sdk-web-notifications";
|
|
15
14
|
import "../notifications/notification/onboarding-inapp/index.js";
|
|
@@ -84,59 +83,55 @@ import "@connectrpc/connect-web";
|
|
|
84
83
|
import "@connectrpc/connect";
|
|
85
84
|
import "@streamlayer/sl-eslib/users/users_connect";
|
|
86
85
|
import "../login/styles.js";
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const [e, n] = b(null), { organizationSettings: a, streamSettings: u } = c(r.sdkStore), y = h(() => {
|
|
92
|
-
const o = (u == null ? void 0 : u.data) || (a == null ? void 0 : a.data);
|
|
93
|
-
return o != null && o.overlays ? o.overlays : [];
|
|
86
|
+
const A = ({ activeFeature: r, sdk: o }) => {
|
|
87
|
+
const [e, n] = b(null), { organizationSettings: a, streamSettings: u } = c(o.sdkStore), y = h(() => {
|
|
88
|
+
const t = (u == null ? void 0 : u.data) || (a == null ? void 0 : a.data);
|
|
89
|
+
return t != null && t.overlays ? t.overlays : [];
|
|
94
90
|
}, [a, u]);
|
|
95
91
|
C(() => {
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
98
|
-
for (const [m, p] of
|
|
99
|
-
m ===
|
|
92
|
+
const t = o.getFeatures();
|
|
93
|
+
if (r)
|
|
94
|
+
for (const [m, p] of t)
|
|
95
|
+
m === r ? p.status.get() === l.Suspended && (p.enable(), n(p)) : p.status.get() === l.Ready && p.disable();
|
|
100
96
|
else {
|
|
101
|
-
for (const [, m] of
|
|
102
|
-
m.status.get() ===
|
|
97
|
+
for (const [, m] of t)
|
|
98
|
+
m.status.get() === l.Ready && m.disable();
|
|
103
99
|
n(null);
|
|
104
100
|
}
|
|
105
101
|
return () => {
|
|
106
|
-
for (const [, m] of
|
|
107
|
-
m.status.get() ===
|
|
102
|
+
for (const [, m] of t)
|
|
103
|
+
m.status.get() === l.Ready && m.disable();
|
|
108
104
|
};
|
|
109
|
-
}, [
|
|
110
|
-
const d = h(() => e ? e.featureConfig.get().type === g.GAMES ? e ? /* @__PURE__ */
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
y.map((
|
|
105
|
+
}, [r, o]);
|
|
106
|
+
const d = h(() => e ? e.featureConfig.get().type === g.GAMES ? e ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(w, { gamification: e, sdk: o }) }) : /* @__PURE__ */ i("div", { children: "wait gamification..." }) : e.featureConfig.get().type === g.HIGHLIGHTS ? e ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(G, { highlights: e, sdk: o }) }) : /* @__PURE__ */ i("div", { children: "wait highlights..." }) : /* @__PURE__ */ i("div", { children: "unknown feature" }) : null, [o, e]);
|
|
107
|
+
return /* @__PURE__ */ f("div", { children: [
|
|
108
|
+
/* @__PURE__ */ f(x, { children: [
|
|
109
|
+
/* @__PURE__ */ i(s, { onClick: () => o.closeFeature(), disabled: !d, children: "close" }),
|
|
110
|
+
/* @__PURE__ */ i(s, { onClick: () => o.logout(), children: "logout" }),
|
|
111
|
+
y.map((t) => /* @__PURE__ */ f(
|
|
116
112
|
s,
|
|
117
113
|
{
|
|
118
|
-
onClick: () =>
|
|
119
|
-
disabled: !(
|
|
120
|
-
"data-enable_sdk_button":
|
|
121
|
-
"data-selected":
|
|
114
|
+
onClick: () => o.openFeature(t.type),
|
|
115
|
+
disabled: !(t.type in S),
|
|
116
|
+
"data-enable_sdk_button": t.enableSdkButton.toString(),
|
|
117
|
+
"data-selected": t.type === r,
|
|
122
118
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
119
|
+
/* @__PURE__ */ i("img", { src: t.icon, alt: "" }),
|
|
120
|
+
t.name
|
|
125
121
|
]
|
|
126
122
|
},
|
|
127
|
-
|
|
123
|
+
t.name
|
|
128
124
|
))
|
|
129
125
|
] }),
|
|
130
126
|
d
|
|
131
127
|
] });
|
|
132
|
-
},
|
|
133
|
-
const
|
|
134
|
-
return
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
|
|
138
|
-
] }) : /* @__PURE__ */ t(H, { sdk: i }) : /* @__PURE__ */ t("div", { children: "wrong sdk key..." });
|
|
128
|
+
}, mi = ({ sdk: r }) => {
|
|
129
|
+
const o = c(r.organizationStore()), e = c(r.getUserStore()), n = c(r.getActiveFeature());
|
|
130
|
+
return o.loading ? /* @__PURE__ */ i("div", { children: "authentication..." }) : o.data ? e.loading ? /* @__PURE__ */ i("div", { children: "authentication..." }) : e.data ? /* @__PURE__ */ f(v, { children: [
|
|
131
|
+
/* @__PURE__ */ i(F, { notificationsStore: r.getNotificationsStore() }),
|
|
132
|
+
/* @__PURE__ */ i(A, { sdk: r, activeFeature: n })
|
|
133
|
+
] }) : /* @__PURE__ */ i(H, { sdk: r }) : /* @__PURE__ */ i("div", { children: "wrong sdk key..." });
|
|
139
134
|
};
|
|
140
135
|
export {
|
|
141
|
-
|
|
136
|
+
mi as Demo
|
|
142
137
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { ColorItem as e } from "@storybook/blocks";
|
|
3
|
+
import { MASTERS_COLORS as r } from "./constants.js";
|
|
4
|
+
const l = Object.keys(r), p = () => l.map((o) => /* @__PURE__ */ t(
|
|
5
|
+
e,
|
|
6
|
+
{
|
|
7
|
+
title: o,
|
|
8
|
+
subtitle: `--color-${o.toLowerCase().replaceAll("_", "-")}`,
|
|
9
|
+
colors: [r[o]]
|
|
10
|
+
},
|
|
11
|
+
o
|
|
12
|
+
));
|
|
13
|
+
export {
|
|
14
|
+
p as ThemeColors
|
|
15
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const N = {
|
|
2
2
|
BG_TRANSPARENT: "rgba(0,0,0, .8)",
|
|
3
3
|
BG_TRANSPARENT_VOTE_CONTAINER: "rgba(10, 14, 19, 0.8)",
|
|
4
4
|
BG_TRANSPARENT_ITEM: "rgba(0, 0, 0, 0.7)",
|
|
@@ -29,11 +29,39 @@ const R = {
|
|
|
29
29
|
DIVIDER_COLOR_PRIMARY: "#2d3135",
|
|
30
30
|
DIVIDER_COLOR_SECONDARY: "#53565a",
|
|
31
31
|
GREEN_PRIMARY_BTN: "#009B77"
|
|
32
|
-
},
|
|
32
|
+
}, T = {
|
|
33
|
+
PRIMARY_GREEN1: "#107D57",
|
|
34
|
+
PRIMARY_GREEN2: "#006747",
|
|
35
|
+
PRIMARY_GREEN3: "#1C4932",
|
|
36
|
+
PRIMARY_GREEN4: "#193526",
|
|
37
|
+
SECONDARY_RED1: "#DF2F3B",
|
|
38
|
+
SECONDARY_RED2: "#BA0C2F",
|
|
39
|
+
SECONDARY_YELLOW: "#fce300",
|
|
40
|
+
SECONDARY_GREEN5: "#C0DC8F",
|
|
41
|
+
NEUTRALS_WHITE: "#FFFFFF",
|
|
42
|
+
NEUTRALS_GRAY1: "#F7F7F7",
|
|
43
|
+
NEUTRALS_GRAY2: "#F2F2F1",
|
|
44
|
+
NEUTRALS_GRAY3: "#E8E8E8",
|
|
45
|
+
NEUTRALS_GRAY4: "#D9D9D6",
|
|
46
|
+
NEUTRALS_GRAY5: "#B1B3B3",
|
|
47
|
+
NEUTRALS_GRAY6: "#888B8D",
|
|
48
|
+
NEUTRALS_GRAY7: "#6B6F73",
|
|
49
|
+
NEUTRALS_GRAY8: "#53565A",
|
|
50
|
+
NEUTRALS_GRAY9: "#25282A",
|
|
51
|
+
NEUTRALS_BLACK: "#000000"
|
|
52
|
+
}, E = Object.assign({}, N, T), S = {
|
|
33
53
|
FAMILY: "Roboto, sans-serif",
|
|
34
54
|
COLOR: "#fff"
|
|
35
|
-
}
|
|
55
|
+
}, O = Object.keys(E).reduce((_, R) => {
|
|
56
|
+
const A = E[R];
|
|
57
|
+
return `
|
|
58
|
+
${_}
|
|
59
|
+
--color-${R.toLowerCase().replaceAll("_", "-")}: ${A};
|
|
60
|
+
`;
|
|
61
|
+
}, "");
|
|
36
62
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
63
|
+
E as COLORS,
|
|
64
|
+
S as FONT,
|
|
65
|
+
T as MASTERS_COLORS,
|
|
66
|
+
O as colors
|
|
39
67
|
};
|
package/lib/ui/theme/theme.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
--
|
|
7
|
-
--color
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
--color-green-primary-btn: ${r.GREEN_PRIMARY_BTN};
|
|
24
|
-
--font-family: ${o.FAMILY};
|
|
25
|
-
--font-color: ${o.COLOR};
|
|
26
|
-
`;
|
|
1
|
+
import { jsx as t, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { css as h } from "@linaria/core";
|
|
3
|
+
import { colors as d, FONT as n } from "./constants.js";
|
|
4
|
+
const l = `
|
|
5
|
+
${d}
|
|
6
|
+
--font-family: ${n.FAMILY};
|
|
7
|
+
--font-color: ${n.COLOR};
|
|
8
|
+
`, p = h`
|
|
9
|
+
${l}
|
|
10
|
+
`, f = () => /* @__PURE__ */ t("table", { children: /* @__PURE__ */ e("table", { children: [
|
|
11
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ e("tr", { children: [
|
|
12
|
+
/* @__PURE__ */ t("th", { children: "name" }),
|
|
13
|
+
/* @__PURE__ */ t("th", { children: "value" })
|
|
14
|
+
] }) }),
|
|
15
|
+
/* @__PURE__ */ t("tbody", { children: l.split(";").map((o) => {
|
|
16
|
+
const r = o.trim(), [c, i] = r.split(":");
|
|
17
|
+
return /* @__PURE__ */ e("tr", { children: [
|
|
18
|
+
/* @__PURE__ */ t("td", { children: c }),
|
|
19
|
+
/* @__PURE__ */ t("td", { children: i })
|
|
20
|
+
] }, r);
|
|
21
|
+
}) })
|
|
22
|
+
] }) });
|
|
27
23
|
export {
|
|
28
|
-
|
|
24
|
+
f as ThemeVariables,
|
|
25
|
+
p as theme,
|
|
26
|
+
l as themeStr
|
|
29
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@streamlayer/sl-eslib": "^5.45.1",
|
|
25
25
|
"@streamlayer/feature-gamification": "^0.16.0",
|
|
26
|
-
"@streamlayer/sdk-web": "^0.27.0",
|
|
27
26
|
"@streamlayer/sdk-web-anonymous-auth": "^0.10.5",
|
|
27
|
+
"@streamlayer/sdk-web": "^0.27.0",
|
|
28
28
|
"@streamlayer/sdk-web-api": "^0.0.2",
|
|
29
29
|
"@streamlayer/sdk-web-core": "^0.12.0",
|
|
30
30
|
"@streamlayer/sdk-web-features": "^0.9.5",
|