@streamlayer/react-ui 0.91.1 → 0.93.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.
Files changed (94) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/index-keh7OLCY.js +67 -0
  3. package/lib/index.js +5 -4
  4. package/lib/ui/app/Features/Gamification/Friends.d.ts +2 -1
  5. package/lib/ui/app/Features/Gamification/Friends.js +6 -6
  6. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +3 -2
  7. package/lib/ui/app/Features/Gamification/Leaderboard.js +26 -24
  8. package/lib/ui/app/Features/Gamification/Question.js +1 -1
  9. package/lib/ui/app/Features/Gamification/Tabs.d.ts +7 -2
  10. package/lib/ui/app/Features/Gamification/Tabs.js +42 -31
  11. package/lib/ui/app/Features/Gamification/gamification-feature.js +5 -2
  12. package/lib/ui/app/Features/Gamification/index.d.ts +6 -2
  13. package/lib/ui/app/Features/Gamification/index.js +86 -45
  14. package/lib/ui/app/Features/index.d.ts +6 -2
  15. package/lib/ui/app/Features/index.js +13 -11
  16. package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +3 -2
  17. package/lib/ui/app/Navigation/MastersNavigation/index.js +37 -31
  18. package/lib/ui/app/Navigation/index.js +6 -7
  19. package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -1
  20. package/lib/ui/app/Notifications/Onboarding/index.js +91 -73
  21. package/lib/ui/app/Notifications/index.d.ts +6 -2
  22. package/lib/ui/app/Notifications/index.js +120 -91
  23. package/lib/ui/app/Points/index.js +6 -5
  24. package/lib/ui/app/masters.d.ts +7 -0
  25. package/lib/ui/app/masters.js +73 -51
  26. package/lib/ui/app/styles.d.ts +1 -0
  27. package/lib/ui/app/styles.js +6 -1
  28. package/lib/ui/app/useClipboardCopy.d.ts +2 -1
  29. package/lib/ui/app/useImagesPreload.d.ts +4 -0
  30. package/lib/ui/app/useImagesPreload.js +23 -0
  31. package/lib/ui/app/useMastersApp.js +15 -14
  32. package/lib/ui/app/useSdkResponsive.d.ts +14 -0
  33. package/lib/ui/app/useSdkResponsive.js +46 -0
  34. package/lib/ui/app/useSdkScroll.d.ts +4 -1
  35. package/lib/ui/app/useSdkScroll.js +36 -85
  36. package/lib/ui/gamification/detail/header/index.js +11 -11
  37. package/lib/ui/gamification/detail/header/styles.d.ts +1 -1
  38. package/lib/ui/gamification/detail/header/styles.js +11 -11
  39. package/lib/ui/gamification/leaderboard/static.d.ts +2 -1
  40. package/lib/ui/gamification/onboarding/index.d.ts +5 -0
  41. package/lib/ui/gamification/onboarding/index.js +69 -42
  42. package/lib/ui/gamification/onboarding/invitingUser/index.d.ts +7 -0
  43. package/lib/ui/gamification/onboarding/invitingUser/index.js +16 -0
  44. package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +5 -0
  45. package/lib/ui/gamification/onboarding/invitingUser/styles.js +24 -0
  46. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -1
  47. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +15 -13
  48. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -1
  49. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +9 -9
  50. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +2 -1
  51. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +1 -1
  52. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.d.ts +2 -0
  53. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +18 -12
  54. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.d.ts +7 -0
  55. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +10 -0
  56. package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.d.ts +5 -0
  57. package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.js +24 -0
  58. package/lib/ui/gamification/points/index.js +5 -4
  59. package/lib/ui/gamification/question/insight/index.js +5 -5
  60. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +17 -17
  61. package/lib/ui/gamification/question/notification/prediction-result/index.js +37 -39
  62. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +1 -1
  63. package/lib/ui/gamification/question/notification/prediction-result/styles.js +12 -12
  64. package/lib/ui/gamification/vote/index.js +55 -54
  65. package/lib/ui/gamification/vote/insight-details/index.js +1 -1
  66. package/lib/ui/gamification/vote/styles.d.ts +1 -0
  67. package/lib/ui/gamification/vote/styles.js +17 -11
  68. package/lib/ui/gamification/vote/vote-option/index.js +62 -58
  69. package/lib/ui/gamification/vote/win-bar/index.d.ts +1 -0
  70. package/lib/ui/gamification/vote/win-bar/index.js +21 -20
  71. package/lib/ui/navigation/button/LeaderBoard.js +5 -6
  72. package/lib/ui/navigation/index.js +6 -7
  73. package/lib/ui/navigation/masters.d.ts +2 -1
  74. package/lib/ui/navigation/masters.js +9 -6
  75. package/lib/ui/questions/insight/index.d.ts +1 -1
  76. package/lib/ui/questions/insight/index.js +18 -25
  77. package/lib/ui/skeleton/index.d.ts +7 -0
  78. package/lib/ui/skeleton/index.js +7 -0
  79. package/lib/ui/skeleton/styles.d.ts +2 -0
  80. package/lib/ui/skeleton/styles.js +9 -0
  81. package/lib/ui/theme/breakpoints.d.ts +4 -1
  82. package/lib/ui/theme/breakpoints.js +24 -12
  83. package/lib/ui/theme/constants.d.ts +4 -0
  84. package/lib/ui/theme/constants.js +6 -2
  85. package/lib/ui/theme/index.js +4 -3
  86. package/lib/ui/theme/theme.js +29 -21
  87. package/lib/utils/createDemo.js +12 -13
  88. package/lib/utils/debug/components/copyLogs.js +10 -9
  89. package/lib/utils/decorators/container.js +4 -3
  90. package/package.json +18 -18
  91. package/lib/LeaderBoard_fzzlxb-w40geAFS.js +0 -1
  92. package/lib/index_ej4hfx-w40geAFS.js +0 -1
  93. package/lib/masters_m6itlr-w40geAFS.js +0 -1
  94. package/lib/utils/useStreamLayerApp.js +0 -25
@@ -1,9 +1,9 @@
1
1
  import { jsx as e, jsxs as g, Fragment as y } from "react/jsx-runtime";
2
2
  import { useMemo as u, useState as i, useEffect as E } from "react";
3
- import { anonymous as l } from "@streamlayer/sdk-web-anonymous-auth";
4
- import { Developer as D } from "./debug/components/developer.js";
5
- import { DeveloperStorage as w } from "./storage.js";
6
- import { useStreamLayerApp as x } from "./useStreamLayerApp.js";
3
+ import { useStreamLayerApp as l } from "@streamlayer/react/useStreamLayerApp";
4
+ import { anonymous as D } from "@streamlayer/sdk-web-anonymous-auth";
5
+ import { Developer as w } from "./debug/components/developer.js";
6
+ import { DeveloperStorage as x } from "./storage.js";
7
7
  import "@linaria/react";
8
8
  import "./debug/components/bypassLogin.js";
9
9
  import "./debug/components/copyLogs.js";
@@ -14,36 +14,35 @@ import "@nanostores/react";
14
14
  import "@streamlayer/sdk-web-core";
15
15
  import "./debug/components/sdkKey.js";
16
16
  import "@streamlayer/sdk-web-storage";
17
- import "@streamlayer/sdk-web";
18
17
  function K({
19
18
  Component: o,
20
19
  Story: r,
21
20
  args: n,
22
21
  autoEnable: a
23
22
  }) {
24
- const m = u(() => new w(), []), [p, f] = i(m.getEnv()), [c, v] = i(m.getSdkKey() || "set-sdk-key"), [s, k] = i(m.getEvent() || ""), S = u(() => {
23
+ const s = u(() => new x(), []), [p, f] = i(s.getEnv()), [c, v] = i(s.getSdkKey() || "set-sdk-key"), [m, k] = i(s.getEvent() || ""), S = u(() => {
25
24
  const d = /* @__PURE__ */ new Set();
26
- return d.add(l), d;
27
- }, []), t = x(c, S, p === "production", a);
25
+ return d.add(D), d;
26
+ }, []), t = l(c, S, p === "production", a);
28
27
  return E(() => {
29
- s && t && t.createEventSession(s);
28
+ m && t && t.createEventSession(m);
30
29
  }, [t]), /* @__PURE__ */ g(y, { children: [
31
30
  t ? /* @__PURE__ */ e(o, { Story: r, sdk: t, args: n }) : /* @__PURE__ */ e("div", { children: "wait sdk..." }),
32
31
  /* @__PURE__ */ e(
33
- D,
32
+ w,
34
33
  {
35
34
  sdk: t,
36
35
  sdkKey: c,
37
36
  setSdkKey: v,
38
37
  env: p,
39
38
  setEnv: f,
40
- event: s,
39
+ event: m,
41
40
  setEvent: k
42
41
  }
43
42
  )
44
43
  ] });
45
44
  }
46
- function P(o, r = !0) {
45
+ function O(o, r = !0) {
47
46
  return {
48
47
  decorators: [
49
48
  (n) => /* @__PURE__ */ e(K, { Story: n, Component: o, autoEnable: r })
@@ -51,5 +50,5 @@ function P(o, r = !0) {
51
50
  };
52
51
  }
53
52
  export {
54
- P as createDemo
53
+ O as createDemo
55
54
  };
@@ -1,13 +1,14 @@
1
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
- import { InputField as n } from "./styles.js";
1
+ import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
+ import { InputField as r } from "./styles.js";
3
3
  import "@linaria/react";
4
- const d = () => /* @__PURE__ */ e(n, { children: [
5
- /* @__PURE__ */ t("label", { children: "Store Logs" }),
6
- /* @__PURE__ */ t("button", { onClick: () => {
7
- const o = document.createElement("a");
8
- o.download = "store_logs_" + (/* @__PURE__ */ new Date()).toISOString() + ".log", o.href = URL.createObjectURL(new Blob([JSON.stringify(window.slStore, null, 2)])), o.click();
9
- }, children: "Download" })
4
+ const p = () => /* @__PURE__ */ t(r, { children: [
5
+ /* @__PURE__ */ o("label", { children: "Subscription Logs" }),
6
+ /* @__PURE__ */ o("button", { onClick: () => {
7
+ navigator.clipboard.writeText(sessionStorage.getItem("slstreamlogs") || "").then(() => {
8
+ alert("Subscription Logs Copied to clipboard");
9
+ });
10
+ }, children: "Copy" })
10
11
  ] });
11
12
  export {
12
- d as CopyLogs
13
+ p as CopyLogs
13
14
  };
@@ -2,10 +2,11 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import { StreamLayerThemeProvider as o } from "../../ui/theme/index.js";
3
3
  import { AppContainer as t } from "./styles.js";
4
4
  import "../../ui/theme/theme.js";
5
+ import "../../ui/theme/breakpoints.js";
5
6
  import "../../ui/theme/constants.js";
6
7
  import "@linaria/react";
7
- const h = (e) => /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(e, {}) }), a = (e) => /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(e, {}) }) }) });
8
+ const a = (e) => /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(e, {}) }), l = (e) => /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(e, {}) }) }) });
8
9
  export {
9
- a as container,
10
- h as theme
10
+ l as container,
11
+ a as theme
11
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.91.1",
3
+ "version": "0.93.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -36,24 +36,24 @@
36
36
  ],
37
37
  "peerDependencies": {
38
38
  "@lottiefiles/react-lottie-player": "*",
39
- "@streamlayer/sl-eslib": "^5.63.3",
39
+ "@streamlayer/sl-eslib": "^5.64.1",
40
40
  "@types/lodash.throttle": "^4.1.9",
41
41
  "lodash.throttle": "^4.1.1",
42
42
  "react-infinite-scroller": "^1.2.6",
43
43
  "react-virtualized-auto-sizer": "^1.0.21",
44
44
  "react-window": "^1.8.10",
45
45
  "react-window-infinite-loader": "^1.0.9",
46
- "@streamlayer/feature-gamification": "^0.34.1",
47
- "@streamlayer/sdk-web": "^0.30.0",
48
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.32",
49
- "@streamlayer/sdk-web-api": "^0.19.0",
50
- "@streamlayer/sdk-web-core": "^0.18.0",
51
- "@streamlayer/sdk-web-features": "^0.11.14",
52
- "@streamlayer/sdk-web-logger": "^0.5.11",
53
- "@streamlayer/sdk-web-notifications": "^0.13.5",
54
- "@streamlayer/sdk-web-storage": "^0.3.11",
55
- "@streamlayer/sdk-web-types": "^0.21.0",
56
- "@streamlayer/sdk-web-interfaces": "^0.19.0"
46
+ "@streamlayer/feature-gamification": "^0.35.1",
47
+ "@streamlayer/sdk-web": "^0.30.2",
48
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.34",
49
+ "@streamlayer/sdk-web-api": "^0.20.1",
50
+ "@streamlayer/sdk-web-core": "^0.18.2",
51
+ "@streamlayer/sdk-web-features": "^0.11.16",
52
+ "@streamlayer/sdk-web-interfaces": "^0.20.1",
53
+ "@streamlayer/sdk-web-notifications": "^0.13.7",
54
+ "@streamlayer/sdk-web-logger": "^0.5.12",
55
+ "@streamlayer/sdk-web-storage": "^0.3.12",
56
+ "@streamlayer/sdk-web-types": "^0.21.1"
57
57
  },
58
58
  "nx": {
59
59
  "implicitDependencies": [
@@ -69,12 +69,12 @@
69
69
  "@linaria/core": "^6.0.0",
70
70
  "@linaria/react": "^6.0.0",
71
71
  "@nanostores/react": "^0.7.1",
72
- "@storybook/addon-docs": "^7.6.10",
72
+ "@storybook/addon-docs": "^7.6.11",
73
73
  "@storybook/addon-styling": "^1.3.7",
74
- "@storybook/addon-viewport": "^7.6.10",
75
- "@storybook/blocks": "^7.6.10",
74
+ "@storybook/addon-viewport": "^7.6.11",
75
+ "@storybook/blocks": "^7.6.11",
76
76
  "@storybook/jest": "^0.2.3",
77
- "@storybook/react": "^7.6.10",
77
+ "@storybook/react": "^7.6.11",
78
78
  "@storybook/testing-library": "^0.2.2",
79
79
  "@types/react-infinite-scroller": "^1.2.5",
80
80
  "@types/react-window": "^1.8.8",
@@ -94,6 +94,6 @@
94
94
  "vite-plugin-svgr": "^4.2.0",
95
95
  "vite-svg-loader": "^5.1.0",
96
96
  "vite-tsconfig-paths": "^4.3.1",
97
- "@streamlayer/react": "^0.36.2"
97
+ "@streamlayer/react": "^0.37.1"
98
98
  }
99
99
  }
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1,25 +0,0 @@
1
- import { useState as i, useEffect as u } from "react";
2
- import { StreamLayer as l } from "@streamlayer/sdk-web";
3
- const h = (t, r, n, f) => {
4
- const [c, a] = i(null);
5
- return u(() => {
6
- let s = !1;
7
- if (!t)
8
- throw new Error("sdk key should be provided");
9
- const o = l(t, n, f);
10
- if (r)
11
- for (const e of r)
12
- o.use(e);
13
- return o.ready().then((e) => {
14
- s || a(e.sdk);
15
- }).catch((e) => console.log(e)), () => {
16
- s = !0, o.close(function(e) {
17
- if (e)
18
- throw e;
19
- });
20
- };
21
- }, [t, n]), c;
22
- };
23
- export {
24
- h as useStreamLayerApp
25
- };