@streamlayer/react-ui 0.28.0 → 0.29.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 +43 -40
- package/lib/ui/app/Features/FeatureProvider.js +1 -1
- package/lib/ui/app/Features/Gamification/Leaderboard.js +2 -2
- package/lib/ui/app/Features/Gamification/Question.js +2 -2
- package/lib/ui/app/Features/Gamification/Tabs.js +16 -16
- package/lib/ui/app/Features/Gamification/UserSummary.js +3 -3
- package/lib/ui/app/Features/Gamification/index.js +33 -33
- package/lib/ui/app/Features/index.js +32 -32
- package/lib/ui/app/Navigation/index.js +4 -4
- package/lib/ui/app/Notifications/index.js +1 -1
- package/lib/ui/app/index.js +49 -46
- package/lib/ui/app/styles.js +3 -2
- package/lib/ui/app/useSdkFeature.js +4 -4
- package/lib/ui/demo/Gamification.js +7 -7
- package/lib/ui/demo/Highlights.js +5 -5
- package/lib/ui/demo/Login.js +8 -7
- package/lib/ui/demo/components/Leaderboard.js +2 -2
- package/lib/ui/demo/components/Question.js +2 -2
- package/lib/ui/demo/components/UserSummary.js +4 -10
- package/lib/ui/demo/components/index.js +8 -8
- package/lib/ui/demo/index.js +64 -53
- package/lib/ui/gamification/leaderboard-invite-link/index.js +4 -4
- package/lib/ui/gamification/leaderboard-item-detail/index.js +2 -2
- package/lib/ui/gamification/onboarding/index.js +17 -17
- package/lib/ui/gamification/points/styles.js +2 -3
- package/lib/ui/gamification/question/index.js +6 -6
- package/lib/ui/gamification/user-statistics/index.js +3 -3
- package/lib/ui/gamification/vote/components/voting-header/index.js +6 -6
- package/lib/ui/gamification/vote/index.js +5 -5
- package/lib/ui/icons/index.js +27 -27
- package/lib/ui/login/index.js +15 -15
- package/lib/ui/notifications/decorator.js +6 -6
- package/lib/ui/notifications/index.js +1 -1
- package/lib/ui/notifications/notification/index.js +1 -1
- package/lib/ui/theme/ThemeTypography.js +13 -3
- package/lib/ui/theme/constants.js +2 -1
- package/lib/ui/theme/theme.js +19 -17
- package/lib/utils/components/developer.js +10 -10
- package/lib/utils/components/envToggle.js +3 -3
- package/lib/utils/components/eventInput.js +4 -4
- package/lib/utils/createDemo.js +12 -12
- package/lib/utils/login.js +8 -8
- package/lib/utils/useStreamLayerApp.js +5 -5
- package/package.json +2 -2
- package/lib/module.d.js +0 -1
|
@@ -41,10 +41,10 @@ const d = o.div`
|
|
|
41
41
|
box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.3);
|
|
42
42
|
transition: all 300ms;
|
|
43
43
|
}
|
|
44
|
-
`,
|
|
44
|
+
`, m = ({ env: r, setEnv: i, storage: s }) => /* @__PURE__ */ t(d, { children: [
|
|
45
45
|
/* @__PURE__ */ e("label", { htmlFor: "slEnvCheckbox", children: "Production:" }),
|
|
46
46
|
/* @__PURE__ */ t(a, { children: [
|
|
47
|
-
/* @__PURE__ */ e("input", { id: "slEnvCheckbox", type: "checkbox", checked: r === "production", onChange: (
|
|
47
|
+
/* @__PURE__ */ e("input", { id: "slEnvCheckbox", type: "checkbox", checked: r === "production", onChange: () => {
|
|
48
48
|
i((c) => {
|
|
49
49
|
const n = c === "production" ? "development" : "production";
|
|
50
50
|
return s.setEnv(n), n;
|
|
@@ -54,5 +54,5 @@ const d = o.div`
|
|
|
54
54
|
] })
|
|
55
55
|
] });
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
m as EnvToggle
|
|
58
58
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as d } from "@nanostores/react";
|
|
3
|
+
import { useEffect as m } from "react";
|
|
2
4
|
import "@streamlayer/sdk-web-core";
|
|
3
|
-
import { useEffect as d } from "react";
|
|
4
|
-
import { useStore as m } from "@nanostores/react";
|
|
5
5
|
import { InputField as u } from "./styles.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
7
|
const y = ({ sdk: o, storage: i, event: e, setEvent: l }) => {
|
|
8
8
|
var n;
|
|
9
|
-
const { organizationSettings: r } =
|
|
9
|
+
const { organizationSettings: r } = d(o.sdkStore), a = !((n = r == null ? void 0 : r.data) != null && n.provider), s = () => {
|
|
10
10
|
o.createEventSession(e), i.setEvent(e);
|
|
11
11
|
};
|
|
12
|
-
return
|
|
12
|
+
return m(() => {
|
|
13
13
|
e && s();
|
|
14
14
|
}, []), /* @__PURE__ */ t("div", { children: /* @__PURE__ */ c(u, { children: [
|
|
15
15
|
/* @__PURE__ */ t("label", { children: a ? "Use StreamLayer event ids" : "Use your provider event ids" }),
|
package/lib/utils/createDemo.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { jsx as e, jsxs as S, Fragment as g } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMemo as d, useState as m, useEffect as y } from "react";
|
|
3
|
+
import { anonymous as E } from "@streamlayer/sdk-web-anonymous-auth";
|
|
4
4
|
import { Developer as l } from "./components/developer.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { DeveloperStorage as D } from "./storage.js";
|
|
6
|
+
import { useStreamLayerApp as w } from "./useStreamLayerApp.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
|
+
import "./components/bypassLogin.js";
|
|
9
|
+
import "./components/envToggle.js";
|
|
8
10
|
import "./components/eventInput.js";
|
|
9
|
-
import "@streamlayer/sdk-web-core";
|
|
10
11
|
import "@nanostores/react";
|
|
12
|
+
import "@streamlayer/sdk-web-core";
|
|
11
13
|
import "./components/styles.js";
|
|
12
|
-
import "./components/bypassLogin.js";
|
|
13
14
|
import "./components/sdkKey.js";
|
|
14
|
-
import "./components/envToggle.js";
|
|
15
|
-
import "@streamlayer/sdk-web";
|
|
16
15
|
import "@streamlayer/sdk-web-storage";
|
|
16
|
+
import "@streamlayer/sdk-web";
|
|
17
17
|
function x({
|
|
18
18
|
Component: o,
|
|
19
19
|
Story: r,
|
|
20
20
|
args: u
|
|
21
21
|
}) {
|
|
22
|
-
const n = d(() => new
|
|
22
|
+
const n = d(() => new D(), []), [i, a] = m(n.getEnv()), [p, f] = m(n.getSdkKey() || "set-sdk-key"), [s, v] = m(n.getEvent() || ""), k = d(() => {
|
|
23
23
|
const c = /* @__PURE__ */ new Set();
|
|
24
|
-
return c.add(
|
|
25
|
-
}, []), t =
|
|
26
|
-
return
|
|
24
|
+
return c.add(E), c;
|
|
25
|
+
}, []), t = w(p, k, i === "production");
|
|
26
|
+
return y(() => {
|
|
27
27
|
s && t && t.createEventSession(s);
|
|
28
28
|
}, [t]), /* @__PURE__ */ S(g, { children: [
|
|
29
29
|
t ? /* @__PURE__ */ e(o, { Story: r, sdk: t, args: u }) : /* @__PURE__ */ e("div", { children: "wait sdk..." }),
|
package/lib/utils/login.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createPromiseClient as o } from "@connectrpc/connect";
|
|
2
|
+
import { createGrpcWebTransport as i } from "@connectrpc/connect-web";
|
|
3
3
|
import { Users as a } from "@streamlayer/sl-eslib/users/users_connect";
|
|
4
4
|
const C = async (r, t) => {
|
|
5
|
-
const e =
|
|
5
|
+
const e = i({
|
|
6
6
|
baseUrl: r
|
|
7
7
|
});
|
|
8
|
-
return await
|
|
8
|
+
return await o(a, e).requestPassword({ id: t }), !0;
|
|
9
9
|
}, d = async (r, t) => {
|
|
10
|
-
const e =
|
|
10
|
+
const e = i({
|
|
11
11
|
baseUrl: r
|
|
12
12
|
});
|
|
13
|
-
return await
|
|
13
|
+
return await o(a, e).register({ id: t }), !0;
|
|
14
14
|
}, w = async (r, t, e) => {
|
|
15
15
|
var c;
|
|
16
|
-
const s =
|
|
16
|
+
const s = i({
|
|
17
17
|
baseUrl: r
|
|
18
|
-
}), n = await
|
|
18
|
+
}), n = await o(a, s).login({ id: t, password: e });
|
|
19
19
|
return (c = n == null ? void 0 : n.meta) == null ? void 0 : c.jwt;
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useState as a, useEffect as i } from "react";
|
|
2
|
+
import { StreamLayer as u } from "@streamlayer/sdk-web";
|
|
3
3
|
const d = (t, r, n) => {
|
|
4
|
-
const [f, c] =
|
|
5
|
-
return
|
|
4
|
+
const [f, c] = a(null);
|
|
5
|
+
return i(() => {
|
|
6
6
|
let s = !1;
|
|
7
7
|
if (!t)
|
|
8
8
|
throw new Error("sdk key should be provided");
|
|
9
|
-
const o =
|
|
9
|
+
const o = u(t, n);
|
|
10
10
|
if (r)
|
|
11
11
|
for (const e of r)
|
|
12
12
|
o.use(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@streamlayer/sdk-web-anonymous-auth": "^0.10.6",
|
|
28
28
|
"@streamlayer/sdk-web-api": "^0.0.2",
|
|
29
29
|
"@streamlayer/sdk-web-core": "^0.13.0",
|
|
30
|
+
"@streamlayer/sdk-web-features": "^0.10.0",
|
|
30
31
|
"@streamlayer/sdk-web-interfaces": "^0.18.0",
|
|
31
32
|
"@streamlayer/sdk-web-notifications": "^0.9.4",
|
|
32
|
-
"@streamlayer/sdk-web-features": "^0.10.0",
|
|
33
33
|
"@streamlayer/sdk-web-storage": "^0.3.2",
|
|
34
34
|
"@streamlayer/sdk-web-types": "^0.16.0"
|
|
35
35
|
},
|
package/lib/module.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|