@streamlayer/react-ui 0.28.0 → 0.28.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.
Files changed (41) hide show
  1. package/lib/index.js +43 -40
  2. package/lib/ui/app/Features/FeatureProvider.js +1 -1
  3. package/lib/ui/app/Features/Gamification/Leaderboard.js +2 -2
  4. package/lib/ui/app/Features/Gamification/Question.js +2 -2
  5. package/lib/ui/app/Features/Gamification/Tabs.js +16 -16
  6. package/lib/ui/app/Features/Gamification/UserSummary.js +3 -3
  7. package/lib/ui/app/Features/Gamification/index.js +33 -33
  8. package/lib/ui/app/Features/index.js +32 -32
  9. package/lib/ui/app/Navigation/index.js +4 -4
  10. package/lib/ui/app/Notifications/index.js +1 -1
  11. package/lib/ui/app/index.js +49 -46
  12. package/lib/ui/app/useSdkFeature.js +4 -4
  13. package/lib/ui/demo/Gamification.js +7 -7
  14. package/lib/ui/demo/Highlights.js +5 -5
  15. package/lib/ui/demo/Login.js +8 -7
  16. package/lib/ui/demo/components/Leaderboard.js +2 -2
  17. package/lib/ui/demo/components/Question.js +2 -2
  18. package/lib/ui/demo/components/UserSummary.js +4 -10
  19. package/lib/ui/demo/components/index.js +8 -8
  20. package/lib/ui/demo/index.js +64 -53
  21. package/lib/ui/gamification/leaderboard-invite-link/index.js +4 -4
  22. package/lib/ui/gamification/leaderboard-item-detail/index.js +2 -2
  23. package/lib/ui/gamification/onboarding/index.js +17 -17
  24. package/lib/ui/gamification/points/styles.js +2 -3
  25. package/lib/ui/gamification/question/index.js +6 -6
  26. package/lib/ui/gamification/user-statistics/index.js +3 -3
  27. package/lib/ui/gamification/vote/components/voting-header/index.js +6 -6
  28. package/lib/ui/gamification/vote/index.js +5 -5
  29. package/lib/ui/icons/index.js +27 -27
  30. package/lib/ui/login/index.js +15 -15
  31. package/lib/ui/notifications/decorator.js +6 -6
  32. package/lib/ui/notifications/index.js +1 -1
  33. package/lib/ui/notifications/notification/index.js +1 -1
  34. package/lib/utils/components/developer.js +10 -10
  35. package/lib/utils/components/envToggle.js +3 -3
  36. package/lib/utils/components/eventInput.js +4 -4
  37. package/lib/utils/createDemo.js +12 -12
  38. package/lib/utils/login.js +8 -8
  39. package/lib/utils/useStreamLayerApp.js +5 -5
  40. package/package.json +2 -2
  41. package/lib/module.d.js +0 -1
@@ -1,29 +1,29 @@
1
1
  import { jsx as e, jsxs as S, Fragment as g } from "react/jsx-runtime";
2
- import { anonymous as y } from "@streamlayer/sdk-web-anonymous-auth";
3
- import { useMemo as d, useState as m, useEffect as E } from "react";
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 { useStreamLayerApp as D } from "./useStreamLayerApp.js";
6
- import { DeveloperStorage as w } from "./storage.js";
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 w(), []), [i, a] = m(n.getEnv()), [p, f] = m(n.getSdkKey() || "set-sdk-key"), [s, v] = m(n.getEvent() || ""), k = d(() => {
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(y), c;
25
- }, []), t = D(p, k, i === "production");
26
- return E(() => {
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..." }),
@@ -1,21 +1,21 @@
1
- import { createGrpcWebTransport as o } from "@connectrpc/connect-web";
2
- import { createPromiseClient as i } from "@connectrpc/connect";
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 = o({
5
+ const e = i({
6
6
  baseUrl: r
7
7
  });
8
- return await i(a, e).requestPassword({ id: t }), !0;
8
+ return await o(a, e).requestPassword({ id: t }), !0;
9
9
  }, d = async (r, t) => {
10
- const e = o({
10
+ const e = i({
11
11
  baseUrl: r
12
12
  });
13
- return await i(a, e).register({ id: t }), !0;
13
+ return await o(a, e).register({ id: t }), !0;
14
14
  }, w = async (r, t, e) => {
15
15
  var c;
16
- const s = o({
16
+ const s = i({
17
17
  baseUrl: r
18
- }), n = await i(a, s).login({ id: t, password: e });
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 { StreamLayer as a } from "@streamlayer/sdk-web";
2
- import { useState as i, useEffect as u } from "react";
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] = i(null);
5
- return u(() => {
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 = a(t, n);
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.28.0",
3
+ "version": "0.28.1",
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
-