@streamlayer/react-ui 0.63.0 → 0.64.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.
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { Gamification } from '@streamlayer/feature-gamification';
3
+ export declare const Friends: React.FC<{
4
+ deepLink: Gamification['deepLink'];
5
+ }>;
@@ -0,0 +1,33 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useStore as i } from "@nanostores/react";
3
+ import { OnboardingInviteCard as r } from "../../../gamification/onboarding/slides/onboarding-invite-card/index.js";
4
+ import "../../../icons/index.js";
5
+ import "@linaria/react";
6
+ import "react";
7
+ import "../../../gamification/onboarding/slides/onboarding-invite-card/styles.js";
8
+ const d = ({ deepLink: o }) => {
9
+ const { data: t } = i(o.$store);
10
+ return /* @__PURE__ */ e(
11
+ r,
12
+ {
13
+ inviteLink: t == null ? void 0 : t.url,
14
+ socialLinks: [
15
+ {
16
+ icon: "icon-facebook",
17
+ link: "https://www.facebook.com/TheMasters",
18
+ label: "Facebook"
19
+ },
20
+ {
21
+ icon: "icon-twitter",
22
+ link: "https://twitter.com/@TheMasters",
23
+ label: "X"
24
+ }
25
+ ],
26
+ inviteCardTitle: "It’s more fun with friends",
27
+ inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
28
+ }
29
+ );
30
+ };
31
+ export {
32
+ d as Friends
33
+ };
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import type { Gamification } from '@streamlayer/feature-gamification';
3
3
  export declare const Leaderboard: React.FC<{
4
- leaderboardList: Gamification['leaderboardList'];
5
- openUser: (userId: string) => void;
4
+ gamification: Gamification;
6
5
  }>;
@@ -1,6 +1,7 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useStore as e } from "@nanostores/react";
3
- import { LeaderboardList as i } from "../../../gamification/leaderboard/index.js";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useStore as t } from "@nanostores/react";
3
+ import { LeaderboardList as p } from "../../../gamification/leaderboard/index.js";
4
+ import { Friends as m } from "./Friends.js";
4
5
  import "react-virtualized-auto-sizer";
5
6
  import "react-window";
6
7
  import "react-window-infinite-loader";
@@ -10,10 +11,19 @@ import "../../../gamification/leaderboard/list-item/styles.js";
10
11
  import "@linaria/react";
11
12
  import "../../../icons/index.js";
12
13
  import "react";
13
- const b = ({ leaderboardList: o, openUser: r }) => {
14
- const { data: t } = e(o.$store);
15
- return /* @__PURE__ */ m(i, { fetchMore: o.fetchMore, items: t, openItemDetail: r });
14
+ import "../../../gamification/onboarding/slides/onboarding-invite-card/index.js";
15
+ import "../../../gamification/onboarding/slides/onboarding-invite-card/styles.js";
16
+ const j = ({ gamification: r }) => {
17
+ const { data: e } = t(r.leaderboardList.$store);
18
+ return e != null && e.length ? /* @__PURE__ */ o(m, { deepLink: r.deepLink }) : /* @__PURE__ */ o(
19
+ p,
20
+ {
21
+ fetchMore: r.leaderboardList.fetchMore,
22
+ items: e,
23
+ openItemDetail: r.openUser
24
+ }
25
+ );
16
26
  };
17
27
  export {
18
- b as Leaderboard
28
+ j as Leaderboard
19
29
  };
@@ -1,7 +1,7 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as s } from "react";
3
- import { SDKWhiteContainer as n, SDKContentContainer as m } from "../../styles.js";
4
- import { ActivePages as e, Tabs as a } from "../../../gamification/tabs/index.js";
3
+ import { SDKWhiteContainer as p, SDKContentContainer as n } from "../../styles.js";
4
+ import { ActivePages as i, Tabs as a } from "../../../gamification/tabs/index.js";
5
5
  import { Leaderboard as d } from "./Leaderboard.js";
6
6
  import { QuestionsList as l } from "./QuestionsList.js";
7
7
  import { UserSummary as u } from "./UserSummary.js";
@@ -16,6 +16,9 @@ import "../../../gamification/leaderboard/list-item/index.js";
16
16
  import "../../../../utils/common.js";
17
17
  import "../../../gamification/leaderboard/list-item/styles.js";
18
18
  import "../../../icons/index.js";
19
+ import "./Friends.js";
20
+ import "../../../gamification/onboarding/slides/onboarding-invite-card/index.js";
21
+ import "../../../gamification/onboarding/slides/onboarding-invite-card/styles.js";
19
22
  import "../../../gamification/question/list/index.js";
20
23
  import "../../../gamification/question/index.js";
21
24
  import "@streamlayer/sdk-web-types";
@@ -36,17 +39,17 @@ import "../../../gamification/user-statistics/components/rank/styles.js";
36
39
  import "../../../gamification/user-statistics/components/statistic/index.js";
37
40
  import "../../../gamification/user-statistics/components/statistic/styles.js";
38
41
  import "../../../gamification/user-statistics/styles.js";
39
- const Y = ({ gamification: t }) => {
40
- const [o, p] = s(e.HOME);
41
- return /* @__PURE__ */ i("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
42
- /* @__PURE__ */ i(n, { children: [
43
- /* @__PURE__ */ r(a, { activePage: o, toggleActivePage: p }),
44
- o === e.HOME && /* @__PURE__ */ r(u, { userSummary: t.userSummary })
42
+ const tt = ({ gamification: r }) => {
43
+ const [o, e] = s(i.HOME);
44
+ return /* @__PURE__ */ m("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
45
+ /* @__PURE__ */ m(p, { children: [
46
+ /* @__PURE__ */ t(a, { activePage: o, toggleActivePage: e }),
47
+ o === i.HOME && /* @__PURE__ */ t(u, { userSummary: r.userSummary })
45
48
  ] }),
46
- o === e.HOME && /* @__PURE__ */ r(m, { children: /* @__PURE__ */ r(l, { openQuestion: t.openQuestion, store: t.feedList.getStore() }) }),
47
- o === e.LEADERBOARD && /* @__PURE__ */ r(m, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ r(d, { openUser: t.openUser, leaderboardList: t.leaderboardList }) })
49
+ o === i.HOME && /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(l, { openQuestion: r.openQuestion, store: r.feedList.getStore() }) }),
50
+ o === i.LEADERBOARD && /* @__PURE__ */ t(p, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ t(d, { gamification: r }) })
48
51
  ] });
49
52
  };
50
53
  export {
51
- Y as Tabs
54
+ tt as Tabs
52
55
  };
@@ -45,6 +45,9 @@ import "react-window";
45
45
  import "react-window-infinite-loader";
46
46
  import "../../../gamification/leaderboard/list-item/index.js";
47
47
  import "../../../gamification/leaderboard/list-item/styles.js";
48
+ import "./Friends.js";
49
+ import "../../../gamification/onboarding/slides/onboarding-invite-card/index.js";
50
+ import "../../../gamification/onboarding/slides/onboarding-invite-card/styles.js";
48
51
  import "./QuestionsList.js";
49
52
  import "../../../gamification/question/list/index.js";
50
53
  import "../../../gamification/question/index.js";
@@ -74,7 +77,7 @@ const e = n(u)`
74
77
  & > div {
75
78
  width: 100%;
76
79
  }
77
- `, wr = ({ gamification: t, className: o }) => {
80
+ `, jr = ({ gamification: t, className: o }) => {
78
81
  const s = m(t.openedQuestion.$store), i = m(t.openedUser);
79
82
  return /* @__PURE__ */ p(d, { children: [
80
83
  s && /* @__PURE__ */ r(e, { className: o, children: /* @__PURE__ */ r(f, { gamification: t }) }),
@@ -86,6 +89,6 @@ const e = n(u)`
86
89
  ] });
87
90
  };
88
91
  export {
89
- wr as GamificationOverlay,
90
- wr as default
92
+ jr as GamificationOverlay,
93
+ jr as default
91
94
  };
@@ -1,4 +1,4 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import { styled as g } from "@linaria/react";
3
3
  import { useState as y } from "react";
4
4
  import { FeatureType as k } from "@streamlayer/sdk-web-types";
@@ -22,10 +22,10 @@ const C = g(f)`
22
22
  height: 100%;
23
23
 
24
24
  animation-duration: var(--animation-duration);
25
- `, $ = ({ sdk: b, hiding: r, notification: t, NotificationContainer: h }) => {
26
- var s, a, p, d, l, c;
27
- const [u, i] = y(!1), n = b.getFeature(k.GAMES), e = t.data.onboarding;
28
- return u && n && e ? /* @__PURE__ */ o(C, { hiding: r, children: /* @__PURE__ */ o(
25
+ `, $ = ({ sdk: b, hiding: o, notification: t, NotificationContainer: h }) => {
26
+ var n, a, p, d, l, c;
27
+ const [u, i] = y(!1), s = b.getFeature(k.GAMES), e = t.data.onboarding;
28
+ return u && s && e ? /* @__PURE__ */ r(C, { hiding: o, children: /* @__PURE__ */ r(
29
29
  w,
30
30
  {
31
31
  rules: [
@@ -42,7 +42,7 @@ const C = g(f)`
42
42
  icon: "icon-trophy"
43
43
  }
44
44
  ],
45
- rulesBtnLabel: (s = e.rules) == null ? void 0 : s.buttonLabel,
45
+ rulesBtnLabel: (n = e.rules) == null ? void 0 : n.buttonLabel,
46
46
  rulesTitle: (a = e.rules) == null ? void 0 : a.heading,
47
47
  steps: [
48
48
  {
@@ -78,18 +78,18 @@ const C = g(f)`
78
78
  socialLinks: [
79
79
  {
80
80
  icon: "icon-facebook",
81
- link: "https://www.facebook.com/",
81
+ link: "https://www.facebook.com/TheMasters",
82
82
  label: "Facebook"
83
83
  },
84
84
  {
85
85
  icon: "icon-twitter",
86
- link: "https://twitter.com",
86
+ link: "https://twitter.com/@TheMasters",
87
87
  label: "X"
88
88
  }
89
89
  ],
90
- gamification: n
90
+ gamification: s
91
91
  }
92
- ) }) : /* @__PURE__ */ o(h, { hiding: r, children: /* @__PURE__ */ o("button", { onClick: () => i(!0), children: "go onboarding" }) });
92
+ ) }) : /* @__PURE__ */ r(h, { hiding: o, children: /* @__PURE__ */ r("button", { onClick: () => i(!0), children: "go onboarding" }) });
93
93
  };
94
94
  export {
95
95
  $ as Onboarding
@@ -6,6 +6,7 @@ export type OnboardingInviteCardProps = {
6
6
  inviteCardSubtext?: string;
7
7
  primaryColor?: string;
8
8
  socialLinks?: InviteCardSocialLink[];
9
+ className?: string;
9
10
  };
10
11
  export type InviteCardSocialLink = {
11
12
  icon: keyof typeof icons;
@@ -1,21 +1,22 @@
1
1
  import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
- import { SvgIcon as h } from "../../../../icons/index.js";
3
- import { Container as m, IconContainer as p, InviteGameIcon as C, Content as I, Heading as b, Subtext as g, LinkContainer as s, LinkInfo as y, LinkTitle as f, LinkAddress as k, LinkIcon as x, SocialLinksContainer as S, SocialLink as L, SocialLinkLabel as u } from "./styles.js";
2
+ import { SvgIcon as m } from "../../../../icons/index.js";
3
+ import { Container as p, IconContainer as C, InviteGameIcon as b, Content as g, Heading as I, Subtext as s, LinkContainer as y, LinkInfo as f, LinkTitle as k, LinkAddress as x, LinkIcon as S, SocialLinksContainer as L, SocialLink as u, SocialLinkLabel as v } from "./styles.js";
4
4
  import "@linaria/react";
5
5
  import "react";
6
- const H = ({
6
+ const O = ({
7
7
  inviteLink: e,
8
8
  socialLinks: o,
9
9
  inviteCardTitle: t,
10
10
  inviteCardSubtext: a,
11
- primaryColor: l
12
- }) => /* @__PURE__ */ r(m, { children: [
13
- /* @__PURE__ */ n(p, { style: { backgroundColor: l }, children: /* @__PURE__ */ n(C, { name: "invite-game-icon" }) }),
14
- /* @__PURE__ */ r(I, { children: [
15
- /* @__PURE__ */ n(b, { children: t || "" }),
16
- /* @__PURE__ */ n(g, { children: a || "" })
11
+ primaryColor: l,
12
+ className: d
13
+ }) => /* @__PURE__ */ r(p, { className: d, children: [
14
+ /* @__PURE__ */ n(C, { style: { backgroundColor: l }, children: /* @__PURE__ */ n(b, { name: "invite-game-icon" }) }),
15
+ /* @__PURE__ */ r(g, { children: [
16
+ /* @__PURE__ */ n(I, { children: t || "" }),
17
+ /* @__PURE__ */ n(s, { children: a || "" })
17
18
  ] }),
18
- e && /* @__PURE__ */ r(s, { onClick: async () => {
19
+ e && /* @__PURE__ */ r(y, { onClick: async () => {
19
20
  if (e)
20
21
  try {
21
22
  await navigator.clipboard.writeText(e);
@@ -23,17 +24,17 @@ const H = ({
23
24
  console.error("Unable to copy to clipboard", i);
24
25
  }
25
26
  }, children: [
26
- /* @__PURE__ */ r(y, { children: [
27
- /* @__PURE__ */ n(f, { children: "Invite link" }),
28
- /* @__PURE__ */ n(k, { children: e })
27
+ /* @__PURE__ */ r(f, { children: [
28
+ /* @__PURE__ */ n(k, { children: "Invite link" }),
29
+ /* @__PURE__ */ n(x, { children: e })
29
30
  ] }),
30
- /* @__PURE__ */ n(x, { name: "icon-copy" })
31
+ /* @__PURE__ */ n(S, { name: "icon-copy" })
31
32
  ] }),
32
- o && o.length > 0 && /* @__PURE__ */ n(S, { children: o.map(({ icon: i, link: c, label: d }) => /* @__PURE__ */ r(L, { href: c, children: [
33
- /* @__PURE__ */ n(h, { name: i }),
34
- /* @__PURE__ */ n(u, { children: d })
33
+ o && o.length > 0 && /* @__PURE__ */ n(L, { children: o.map(({ icon: i, link: c, label: h }) => /* @__PURE__ */ r(u, { href: c, target: "_blank", children: [
34
+ /* @__PURE__ */ n(m, { name: i }),
35
+ /* @__PURE__ */ n(v, { children: h })
35
36
  ] }, c)) })
36
37
  ] });
37
38
  export {
38
- H as OnboardingInviteCard
39
+ O as OnboardingInviteCard
39
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -36,12 +36,12 @@
36
36
  "react-window": "^1.8.9",
37
37
  "@lottiefiles/react-lottie-player": "*",
38
38
  "react-window-infinite-loader": "^1.0.9",
39
- "@streamlayer/feature-gamification": "^0.24.0",
40
- "@streamlayer/sdk-web": "^0.28.20",
41
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.15",
39
+ "@streamlayer/feature-gamification": "^0.25.0",
40
+ "@streamlayer/sdk-web": "^0.28.21",
41
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.16",
42
42
  "@streamlayer/sdk-web-api": "^0.0.1",
43
43
  "@streamlayer/sdk-web-core": "^0.17.8",
44
- "@streamlayer/sdk-web-features": "^0.10.23",
44
+ "@streamlayer/sdk-web-features": "^0.10.24",
45
45
  "@streamlayer/sdk-web-interfaces": "^0.18.15",
46
46
  "@streamlayer/sdk-web-notifications": "^0.12.1",
47
47
  "@streamlayer/sdk-web-storage": "^0.0.4",
@@ -84,6 +84,6 @@
84
84
  "vite-plugin-svgr": "^4.1.0",
85
85
  "vite-svg-loader": "^4.0.0",
86
86
  "vite-tsconfig-paths": "^4.2.1",
87
- "@streamlayer/react": "^0.29.4"
87
+ "@streamlayer/react": "^0.29.5"
88
88
  }
89
89
  }