@streamlayer/react-ui 0.69.0 → 0.69.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.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { CountUpProps } from 'react-countup';
3
- export declare const AnimatedCounter: React.FC<Omit<CountUpProps, 'end' | 'start' | 'duration' | 'preserveValue'> & {
3
+ export declare const AnimatedCounter: React.FC<Omit<CountUpProps, 'end' | 'start'> & {
4
4
  value?: number;
5
5
  }>;
@@ -1,9 +1,19 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import i from "react-countup";
3
- const m = ({ value: e = 0, decimals: r, ...n }) => {
4
- const [, t] = e.toString().split("."), o = r ?? ((t == null ? void 0 : t.length) || 0);
5
- return /* @__PURE__ */ s(i, { end: e, ...n, duration: 1, decimals: o, enableScrollSpy: !1, preserveValue: !0 });
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import p from "react-countup";
3
+ const d = ({ value: n = 0, decimals: o, duration: r = 1, preserveValue: e = !0, ...s }) => {
4
+ const [, t] = n.toString().split("."), i = o ?? ((t == null ? void 0 : t.length) || 0);
5
+ return /* @__PURE__ */ m(
6
+ p,
7
+ {
8
+ end: n,
9
+ ...s,
10
+ duration: r,
11
+ decimals: i,
12
+ enableScrollSpy: !1,
13
+ preserveValue: e
14
+ }
15
+ );
6
16
  };
7
17
  export {
8
- m as AnimatedCounter
18
+ d as AnimatedCounter
9
19
  };
@@ -5,8 +5,4 @@ export declare const Onboarding: React.FC<{
5
5
  sdk: StreamLayerSDK;
6
6
  notification: Notification;
7
7
  hiding?: boolean;
8
- NotificationContainer: React.FC<{
9
- hiding?: boolean;
10
- children: React.ReactNode;
11
- }>;
12
8
  }>;
@@ -1,4 +1,4 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as s } from "react/jsx-runtime";
2
2
  import { styled as u } from "@linaria/react";
3
3
  import { useStore as g } from "@nanostores/react";
4
4
  import { useState as y } from "react";
@@ -27,19 +27,19 @@ const v = () => f, S = /* @__PURE__ */ u(v())({
27
27
  propsAsIs: !0
28
28
  }), L = ({
29
29
  hiding: n,
30
- deepLink: a,
30
+ deepLink: t,
31
31
  onboardingOpts: e,
32
- setOpened: p,
33
- notification: s,
34
- gamification: i
32
+ setOpened: i,
33
+ notification: r,
34
+ gamification: o
35
35
  }) => {
36
- var t, d, l, c, m, b;
36
+ var p, d, l, c, m, b;
37
37
  const {
38
- data: r
39
- } = g(a.$store);
40
- return /* @__PURE__ */ o(S, {
38
+ data: a
39
+ } = g(t.$store);
40
+ return /* @__PURE__ */ s(S, {
41
41
  hiding: n,
42
- children: /* @__PURE__ */ o(w, {
42
+ children: /* @__PURE__ */ s(w, {
43
43
  rules: [{
44
44
  label: "Answer as many questions as you like.",
45
45
  icon: "icon-btn-feature-groups"
@@ -50,7 +50,7 @@ const v = () => f, S = /* @__PURE__ */ u(v())({
50
50
  label: "Top the leader board and best your friends.",
51
51
  icon: "icon-trophy"
52
52
  }],
53
- rulesBtnLabel: (t = e.rules) == null ? void 0 : t.buttonLabel,
53
+ rulesBtnLabel: (p = e.rules) == null ? void 0 : p.buttonLabel,
54
54
  rulesTitle: (d = e.rules) == null ? void 0 : d.heading,
55
55
  steps: [{
56
56
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_01.json",
@@ -69,13 +69,13 @@ const v = () => f, S = /* @__PURE__ */ u(v())({
69
69
  headline: "Compete against friends on the leaderboard"
70
70
  }],
71
71
  primaryColor: (l = e.inviteCard) == null ? void 0 : l.iconColor,
72
- inviteLink: r == null ? void 0 : r.url,
72
+ inviteLink: a == null ? void 0 : a.url,
73
73
  inviteCardTitle: (c = e.inviteCard) == null ? void 0 : c.heading,
74
74
  inviteCardSubtext: (m = e.inviteCard) == null ? void 0 : m.subtext,
75
75
  inviteCardBtnLabel: (b = e.inviteCard) == null ? void 0 : b.buttonLabel,
76
76
  onClose: () => {
77
77
  var h;
78
- p(!1), (h = s.close) == null || h.call(s);
78
+ i(!1), (h = r.close) == null || h.call(r);
79
79
  },
80
80
  socialLinks: [{
81
81
  icon: "icon-facebook",
@@ -86,30 +86,25 @@ const v = () => f, S = /* @__PURE__ */ u(v())({
86
86
  link: "https://twitter.com/@TheMasters",
87
87
  label: "X"
88
88
  }],
89
- gamification: i
89
+ gamification: o
90
90
  })
91
91
  });
92
92
  }, Q = ({
93
93
  sdk: n,
94
- hiding: a,
95
- notification: e,
96
- NotificationContainer: p
94
+ notification: t
97
95
  }) => {
98
- const [s, i] = y(!1), r = n.getFeature(k.GAMES), t = e.data.onboarding;
99
- return s && r && t ? /* @__PURE__ */ o(L, {
100
- notification: e,
96
+ const [e, i] = y(!1), r = n.getFeature(k.GAMES), o = t.data.onboarding;
97
+ return e && r && o ? /* @__PURE__ */ s(L, {
98
+ notification: t,
101
99
  setOpened: i,
102
100
  gamification: r,
103
- onboardingOpts: t,
101
+ onboardingOpts: o,
104
102
  deepLink: r.deepLink
105
- }) : /* @__PURE__ */ o(p, {
106
- hiding: a,
107
- children: /* @__PURE__ */ o("div", {
108
- children: /* @__PURE__ */ o(C, {
109
- close: e.close,
110
- action: () => i(!0),
111
- onboarding: t
112
- })
103
+ }) : /* @__PURE__ */ s("div", {
104
+ children: /* @__PURE__ */ s(C, {
105
+ close: t.close,
106
+ action: () => i(!0),
107
+ onboarding: o
113
108
  })
114
109
  });
115
110
  };
@@ -1,10 +1,10 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useStore as u } from "@nanostores/react";
3
- import { useMemo as c } from "react";
4
- import { NotificationType as o } from "@streamlayer/sdk-web-notifications";
5
- import { Notification as e } from "../../gamification/question/notification/index.js";
6
- import { Onboarding as s } from "./Onboarding/index.js";
7
- import { Container as m } from "./styles.js";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useStore as f } from "@nanostores/react";
3
+ import { useState as u, useMemo as s } from "react";
4
+ import { NotificationType as m } from "@streamlayer/sdk-web-notifications";
5
+ import { Notification as n } from "../../gamification/question/notification/index.js";
6
+ import { Onboarding as c } from "./Onboarding/index.js";
7
+ import { Container as l } from "./styles.js";
8
8
  import "@streamlayer/sdk-web-types";
9
9
  import "../../gamification/constants.js";
10
10
  import "../../gamification/question/notification/insight/index.js";
@@ -39,25 +39,17 @@ import "../../show-in/index.js";
39
39
  import "@linaria/core";
40
40
  import "./Onboarding/Notification/index.js";
41
41
  import "./Onboarding/Notification/styles.js";
42
- const ii = ({ sdk: p }) => {
43
- const f = p.getNotificationsStore(), t = u(f), i = c(() => {
44
- if (!(t != null && t.size))
42
+ const N = ({ sdk: o, notification: r }) => r.type === m.QUESTION ? /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(n, { ...r }) }) : r.type === m.QUESTION_RESOLVED ? /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(n, { ...r }) }) : r.type === m.ONBOARDING ? /* @__PURE__ */ t(c, { sdk: o, notification: r, hiding: r.hiding }) : null, ir = ({ sdk: o }) => {
43
+ const [r] = u(o.getNotificationsStore()), i = f(r), p = s(() => {
44
+ if (!(i != null && i.size))
45
45
  return null;
46
- for (const n of t.values())
47
- if (n.type === o.ONBOARDING)
48
- return n;
49
- return t.values().next().value;
50
- }, [t]);
51
- return (i == null ? void 0 : i.type) === o.QUESTION ? /* @__PURE__ */ r(m, { hiding: i.hiding, children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(e, { ...i }) }) }) : (i == null ? void 0 : i.type) === o.QUESTION_RESOLVED ? /* @__PURE__ */ r(m, { hiding: i.hiding, children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(e, { ...i }) }) }) : (i == null ? void 0 : i.type) === o.ONBOARDING ? /* @__PURE__ */ r(
52
- s,
53
- {
54
- NotificationContainer: m,
55
- sdk: p,
56
- notification: i,
57
- hiding: i.hiding
58
- }
59
- ) : null;
46
+ for (const e of i.values())
47
+ if (e.type === m.ONBOARDING)
48
+ return e;
49
+ return i.values().next().value;
50
+ }, [i]);
51
+ return p ? /* @__PURE__ */ t(l, { hiding: p.hiding, children: /* @__PURE__ */ t(N, { sdk: o, notification: p }) }) : null;
60
52
  };
61
53
  export {
62
- ii as SDKNotifications
54
+ ir as SDKNotifications
63
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.69.0",
3
+ "version": "0.69.1",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -40,15 +40,16 @@
40
40
  "react-virtualized-auto-sizer": "^1.0.20",
41
41
  "react-window": "^1.8.9",
42
42
  "react-window-infinite-loader": "^1.0.9",
43
- "@streamlayer/feature-gamification": "^0.26.6",
44
- "@streamlayer/sdk-web": "^0.28.28",
45
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.23",
43
+ "@streamlayer/feature-gamification": "^0.26.7",
44
+ "@streamlayer/sdk-web": "^0.28.29",
45
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.24",
46
46
  "@streamlayer/sdk-web-api": "^0.0.1",
47
- "@streamlayer/sdk-web-core": "^0.0.3",
48
- "@streamlayer/sdk-web-features": "^0.10.31",
47
+ "@streamlayer/sdk-web-core": "^0.0.4",
48
+ "@streamlayer/sdk-web-features": "^0.10.32",
49
49
  "@streamlayer/sdk-web-interfaces": "^0.0.1",
50
- "@streamlayer/sdk-web-notifications": "^0.13.3",
50
+ "@streamlayer/sdk-web-notifications": "^0.13.4",
51
51
  "@streamlayer/sdk-web-storage": "^0.0.4",
52
+ "@streamlayer/sdk-web-logger": "^0.0.1",
52
53
  "@streamlayer/sdk-web-types": "^0.0.1"
53
54
  },
54
55
  "nx": {
@@ -89,6 +90,6 @@
89
90
  "vite-plugin-svgr": "^4.1.0",
90
91
  "vite-svg-loader": "^4.0.0",
91
92
  "vite-tsconfig-paths": "^4.2.1",
92
- "@streamlayer/react": "^0.31.4"
93
+ "@streamlayer/react": "^0.31.5"
93
94
  }
94
95
  }