@streamlayer/react-ui 0.96.2 → 0.97.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/assets/style.css +1 -1
- package/lib/hooks/analytics.js +50 -0
- package/lib/index-z0QjLiEL.js +75 -0
- package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
- package/lib/ui/app/Features/FeatureProvider.js +34 -6
- package/lib/ui/app/Features/Gamification/Friends.d.ts +0 -2
- package/lib/ui/app/Features/Gamification/Friends.js +20 -23
- package/lib/ui/app/Features/Gamification/Leaderboard.js +31 -25
- package/lib/ui/app/Features/Gamification/Question.js +4 -2
- package/lib/ui/app/Features/Gamification/QuestionsList.js +11 -8
- package/lib/ui/app/Features/Gamification/Tabs.js +30 -25
- package/lib/ui/app/Features/Gamification/UserSummary.js +14 -12
- package/lib/ui/app/Features/Gamification/gamification-feature.js +6 -2
- package/lib/ui/app/Features/Gamification/index.d.ts +10 -0
- package/lib/ui/app/Features/Gamification/index.js +73 -68
- package/lib/ui/app/Features/index.d.ts +8 -0
- package/lib/ui/app/Features/index.js +112 -16
- package/lib/ui/app/Navigation/MastersNavigation/index.js +5 -4
- package/lib/ui/app/Navigation/index.js +7 -6
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -0
- package/lib/ui/app/Notifications/Onboarding/index.js +76 -78
- package/lib/ui/app/Notifications/index.js +98 -91
- package/lib/ui/app/Points/index.js +20 -17
- package/lib/ui/app/masters.js +167 -86
- package/lib/ui/app/useMastersApp.js +12 -11
- package/lib/ui/app/useSdkFeature.js +13 -16
- package/lib/ui/app/useSdkResponsive.js +1 -1
- package/lib/ui/app/useSdkScroll.d.ts +1 -1
- package/lib/ui/app/useSdkScroll.js +28 -25
- package/lib/ui/gamification/invite-link/index.js +26 -12
- package/lib/ui/gamification/onboarding/index.d.ts +0 -2
- package/lib/ui/gamification/onboarding/index.js +46 -46
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +2 -2
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -20
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +20 -15
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +0 -3
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +34 -29
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.d.ts +0 -3
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +17 -32
- package/lib/ui/gamification/points/index.d.ts +1 -0
- package/lib/ui/gamification/points/index.js +9 -9
- package/lib/ui/gamification/question/index.d.ts +1 -0
- package/lib/ui/gamification/question/index.js +31 -24
- package/lib/ui/gamification/question/insight/index.js +11 -15
- package/lib/ui/gamification/question/list/index.d.ts +3 -1
- package/lib/ui/gamification/question/list/index.js +50 -34
- package/lib/ui/gamification/question/notification/index.js +23 -25
- package/lib/ui/gamification/question/notification/insight/index.js +10 -9
- package/lib/ui/gamification/question/notification/tweet/index.js +3 -2
- package/lib/ui/gamification/question/styles.d.ts +2 -0
- package/lib/ui/gamification/question/styles.js +39 -28
- package/lib/ui/gamification/question/twitter/index.js +14 -18
- package/lib/ui/gamification/user-statistics/index.d.ts +3 -2
- package/lib/ui/gamification/user-statistics/index.js +48 -45
- package/lib/ui/gamification/vote/feedback/index.d.ts +3 -2
- package/lib/ui/gamification/vote/feedback/index.js +74 -58
- package/lib/ui/gamification/vote/feedback/styles.d.ts +2 -0
- package/lib/ui/gamification/vote/feedback/styles.js +33 -21
- package/lib/ui/gamification/vote/index.js +94 -83
- package/lib/ui/gamification/vote/insight-details/index.js +7 -6
- package/lib/ui/gamification/vote/twitter-details/index.js +3 -2
- package/lib/ui/gamification/vote/vote-option/index.d.ts +2 -1
- package/lib/ui/gamification/vote/vote-option/index.js +47 -39
- package/lib/ui/icons/index.d.ts +1 -2
- package/lib/ui/icons/index.js +122 -49
- package/lib/ui/modal/index.js +27 -21
- package/lib/ui/navigation/button/Channels.js +6 -5
- package/lib/ui/navigation/button/FeaturedGroups.js +4 -3
- package/lib/ui/navigation/button/LeaderBoard.js +6 -5
- package/lib/ui/navigation/button/index.js +20 -7
- package/lib/ui/navigation/button/styles.d.ts +3 -0
- package/lib/ui/navigation/button/styles.js +9 -6
- package/lib/ui/questions/insight/index.js +16 -16
- package/lib/ui/questions/twitter/index.js +3 -2
- package/lib/ui/show-in/index.d.ts +2 -0
- package/lib/ui/show-in/index.js +24 -14
- package/lib/ui/timer/index.js +32 -28
- package/lib/ui/video-player/index.js +41 -39
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +10 -9
- package/package.json +22 -21
- package/lib/index-keh7OLCY.js +0 -67
|
@@ -2,35 +2,36 @@ import { useStore as A } from "@nanostores/react";
|
|
|
2
2
|
import { useRef as y, useState as d, useCallback as z, useEffect as u } from "react";
|
|
3
3
|
import { FeatureType as v } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import "./Navigation/MastersNavigation/index.js";
|
|
5
|
-
import { FeaturedGroupsButtonId as
|
|
6
|
-
import { ChannelsButtonId as
|
|
5
|
+
import { FeaturedGroupsButtonId as p } from "../navigation/button/FeaturedGroups.js";
|
|
6
|
+
import { ChannelsButtonId as i } from "../navigation/button/Channels.js";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
8
|
import "../navigation/button/LeaderBoard.js";
|
|
9
9
|
import "@linaria/react";
|
|
10
10
|
import "../icons/index.js";
|
|
11
11
|
import "../navigation/button/index.js";
|
|
12
|
+
import "@linaria/core";
|
|
12
13
|
import "../navigation/button/styles.js";
|
|
13
14
|
import "../navigation/masters.js";
|
|
14
15
|
import "../navigation/index.js";
|
|
15
16
|
import "../theme/constants.js";
|
|
16
|
-
const
|
|
17
|
-
const c = y(""), [S, o] = d(!1), E = A(e.status), a = A(e.userId()), f = A(e.getActiveFeature()), n = E === "ready", [l, r] = d(
|
|
17
|
+
const D = (e) => {
|
|
18
|
+
const c = y(""), [S, o] = d(!1), E = A(e.status), a = A(e.userId()), f = A(e.getActiveFeature()), n = E === "ready", [l, r] = d(p), m = z(
|
|
18
19
|
(t, s) => {
|
|
19
|
-
r(s),
|
|
20
|
+
r(s), t && e.createEventSession(t), s === p ? window.requestAnimationFrame(() => {
|
|
20
21
|
e.openFeature(v.GAMES);
|
|
21
|
-
})
|
|
22
|
+
}) : e.closeFeature(!1);
|
|
22
23
|
},
|
|
23
24
|
[e]
|
|
24
25
|
);
|
|
25
26
|
u(() => {
|
|
26
|
-
!n && l ===
|
|
27
|
+
!n && l === p && (r(i), e.closeFeature(!0));
|
|
27
28
|
}, [n, l, e]), u(() => {
|
|
28
|
-
f === v.GAMES ? r(
|
|
29
|
+
f === v.GAMES ? r(p) : f === v.UNSET && r(i);
|
|
29
30
|
}, [f]);
|
|
30
31
|
const F = (t) => {
|
|
31
32
|
c.current = t, o(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: s, err: g }) => {
|
|
32
33
|
if (g) {
|
|
33
|
-
m(t,
|
|
34
|
+
m(t, i);
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
if (s) {
|
|
@@ -49,7 +50,7 @@ const j = (e) => {
|
|
|
49
50
|
};
|
|
50
51
|
return u(() => {
|
|
51
52
|
if (!a) {
|
|
52
|
-
n && (r(
|
|
53
|
+
n && (r(i), e.disableApp());
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
55
56
|
if (a && c.current && S) {
|
|
@@ -71,5 +72,5 @@ const j = (e) => {
|
|
|
71
72
|
};
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
D as useMastersApp
|
|
75
76
|
};
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import { useStore as
|
|
1
|
+
import { useStore as f } from "@nanostores/react";
|
|
2
2
|
import { useState as c, useEffect as l } from "react";
|
|
3
3
|
import { FeatureStatus as a } from "@streamlayer/sdk-web-interfaces";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const p = (t) => {
|
|
5
|
+
const r = f(t.getActiveFeature()), n = f(t.streamStore()), [i, u] = c(null);
|
|
6
6
|
return l(() => {
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
e.status.get() === a.Ready && e.disable();
|
|
14
|
-
f(null);
|
|
15
|
-
}
|
|
7
|
+
const o = t.getFeatures();
|
|
8
|
+
if (!r)
|
|
9
|
+
u(null);
|
|
10
|
+
else
|
|
11
|
+
for (const [s, e] of o)
|
|
12
|
+
s === r ? (e.status.get() === a.Suspended && e.enable(), u(e)) : e.status.get() === a.Ready && e.disable();
|
|
16
13
|
return () => {
|
|
17
|
-
for (const [,
|
|
18
|
-
|
|
14
|
+
for (const [, s] of o)
|
|
15
|
+
s.status.get() === a.Ready && s.disable();
|
|
19
16
|
};
|
|
20
|
-
}, [
|
|
17
|
+
}, [r, t, n]), [r, i];
|
|
21
18
|
};
|
|
22
19
|
export {
|
|
23
|
-
|
|
20
|
+
p as useSdkFeature
|
|
24
21
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import c from "lodash.throttle";
|
|
2
2
|
import { useState as m, useEffect as u } from "react";
|
|
3
3
|
import { BREAKPOINTS as r } from "../theme/constants.js";
|
|
4
|
-
import { m as p } from "../../index-
|
|
4
|
+
import { m as p } from "../../index-z0QjLiEL.js";
|
|
5
5
|
import "../../index-uEuzH3jr.js";
|
|
6
6
|
const d = Object.keys(r), i = () => {
|
|
7
7
|
const t = window.innerWidth;
|
|
@@ -7,6 +7,6 @@ type ScrollData = {
|
|
|
7
7
|
scrollDirection: 'forward' | 'backward';
|
|
8
8
|
};
|
|
9
9
|
export type ScrollStore = MapStore<ScrollData>;
|
|
10
|
-
export declare const scrollIntoAppView: (appNode: AppNodeRef, options?: ScrollIntoViewOptions) => void;
|
|
10
|
+
export declare const scrollIntoAppView: (appNode: AppNodeRef, screenSize: number, options?: ScrollIntoViewOptions) => void;
|
|
11
11
|
export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore) => [ScrollNodeRef, ScrollStore];
|
|
12
12
|
export {};
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
import { useStore as p } from "@nanostores/react";
|
|
2
2
|
import S from "lodash.throttle";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { BREAKPOINTS as
|
|
5
|
-
import { m as
|
|
3
|
+
import { useRef as m, useState as h, useEffect as g } from "react";
|
|
4
|
+
import { BREAKPOINTS as l } from "../theme/constants.js";
|
|
5
|
+
import { m as T } from "../../index-z0QjLiEL.js";
|
|
6
6
|
import "../../index-uEuzH3jr.js";
|
|
7
|
-
const C = (t,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const C = (o, t, e) => {
|
|
8
|
+
const n = t >= l.lg && t < l.xl ? 75 : 52;
|
|
9
|
+
o.current && window.scrollTo({
|
|
10
|
+
top: o.current.offsetTop - n,
|
|
11
|
+
...e
|
|
12
|
+
});
|
|
13
|
+
}, D = (o, t) => {
|
|
14
|
+
const e = m(null), n = m(0), [s] = h(
|
|
15
|
+
T({
|
|
13
16
|
scrollPosition: 0,
|
|
14
17
|
tabsShown: !0,
|
|
15
18
|
scrollDirection: "forward"
|
|
16
19
|
})
|
|
17
|
-
),
|
|
18
|
-
return
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
20
|
+
), i = p(t);
|
|
21
|
+
return g(() => {
|
|
22
|
+
const c = window.innerWidth < l.xl ? window : e.current;
|
|
23
|
+
if (!c)
|
|
21
24
|
return () => {
|
|
22
25
|
};
|
|
23
|
-
const
|
|
26
|
+
const u = S((w) => {
|
|
24
27
|
var a;
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
28
|
+
const f = w.target;
|
|
29
|
+
if (!f)
|
|
27
30
|
return;
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
const d =
|
|
31
|
-
|
|
32
|
-
scrollPosition: Math.round(
|
|
31
|
+
let r = 0;
|
|
32
|
+
i.screen.size < l.xl ? r = ((a = o.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : r = f.scrollTop;
|
|
33
|
+
const d = n.current < r ? "forward" : "backward";
|
|
34
|
+
n.current = r, s.set({
|
|
35
|
+
scrollPosition: Math.round(r),
|
|
33
36
|
scrollDirection: d,
|
|
34
|
-
tabsShown:
|
|
37
|
+
tabsShown: s.get().tabsShown
|
|
35
38
|
});
|
|
36
39
|
}, 200);
|
|
37
|
-
return
|
|
38
|
-
|
|
40
|
+
return c.addEventListener("scroll", u), () => {
|
|
41
|
+
c.removeEventListener("scroll", u);
|
|
39
42
|
};
|
|
40
|
-
}, [
|
|
43
|
+
}, [s, o, i.screen]), [e, s];
|
|
41
44
|
};
|
|
42
45
|
export {
|
|
43
46
|
C as scrollIntoAppView,
|
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as C, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useAnalyticsHandle as c } from "../../../hooks/analytics.js";
|
|
3
|
+
import { InvitationFrom as l } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { Container as m, FriendsIcon as s, Content as p, Title as a, Description as d, ArrowInviteIcon as h } from "./styles.js";
|
|
5
|
+
import "lodash.throttle";
|
|
6
|
+
import "react";
|
|
7
|
+
import "@streamlayer/sdk-web-interfaces";
|
|
8
|
+
import "../../theme/constants.js";
|
|
3
9
|
import "@linaria/react";
|
|
4
10
|
import "../../icons/index.js";
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const f = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M10.4615%2012.6875C9.44231%2012.6875%208.61538%2013.4665%208.61538%2014.4266C8.61538%2015.3868%209.44231%2016.1658%2010.4615%2016.1658C11.4808%2016.1658%2012.3077%2015.3868%2012.3077%2014.4266C12.3077%2013.4665%2011.4808%2012.6875%2010.4615%2012.6875ZM10.4615%2016.1658C9.10817%2016.1658%208%2017.2097%208%2018.4846V19.7527C8%2019.7527%208.61538%2020.2237%2010.4615%2020.2237C12.3077%2020.2237%2012.9231%2019.7527%2012.9231%2019.7527V18.4846C12.9231%2017.2097%2011.8149%2016.1658%2010.4615%2016.1658ZM21.5385%2012.6875C20.5192%2012.6875%2019.6923%2013.4665%2019.6923%2014.4266C19.6923%2015.3868%2020.5192%2016.1658%2021.5385%2016.1658C22.5577%2016.1658%2023.3846%2015.3868%2023.3846%2014.4266C23.3846%2013.4665%2022.5577%2012.6875%2021.5385%2012.6875ZM21.5385%2016.1658C20.1851%2016.1658%2019.0769%2017.2097%2019.0769%2018.4846V19.7527C19.0769%2019.7527%2019.6923%2020.2237%2021.5385%2020.2237C23.3846%2020.2237%2024%2019.7527%2024%2019.7527V18.4846C24%2017.2097%2022.8918%2016.1658%2021.5385%2016.1658ZM16%2015.0063C14.9808%2015.0063%2014.1538%2015.7853%2014.1538%2016.7455C14.1538%2017.7056%2014.9808%2018.4846%2016%2018.4846C17.0192%2018.4846%2017.8462%2017.7056%2017.8462%2016.7455C17.8462%2015.7853%2017.0192%2015.0063%2016%2015.0063ZM16%2018.4846C14.6466%2018.4846%2013.5385%2019.5285%2013.5385%2020.8034V22.0715C13.5385%2022.0715%2014.1538%2022.5425%2016%2022.5425C17.8462%2022.5425%2018.4615%2022.0715%2018.4615%2022.0715V20.8034C18.4615%2019.5285%2017.3534%2018.4846%2016%2018.4846Z'%20fill='%23107D57'/%3e%3cpath%20opacity='0.5'%20d='M13.3908%209C12.3103%209%2011.4336%209.82584%2011.4336%2010.8437C11.4336%2011.8616%2012.3103%2012.6875%2013.3908%2012.6875C14.4713%2012.6875%2015.348%2011.8616%2015.348%2010.8437C15.348%209.82584%2014.4713%209%2013.3908%209ZM13.3908%2012.6875C13.1946%2012.6875%2012.9958%2012.6827%2012.7996%2012.7451C13.192%2013.2372%2013.3908%2013.8542%2013.3908%2014.5312C13.3908%2014.7761%2013.3296%2015.0161%2013.3296%2015.261C13.8521%2014.524%2014.6956%2014.0391%2015.6742%2013.9166C15.218%2013.1796%2014.3694%2012.6875%2013.3908%2012.6875ZM18.61%209C17.5295%209%2016.6528%209.82584%2016.6528%2010.8437C16.6528%2011.8616%2017.5295%2012.6875%2018.61%2012.6875C19.6905%2012.6875%2020.5672%2011.8616%2020.5672%2010.8437C20.5672%209.82584%2019.6905%209%2018.61%209ZM18.61%2012.6875C17.6314%2012.6875%2016.7828%2013.1796%2016.3266%2013.9166C17.3052%2014.0391%2018.1487%2014.524%2018.6712%2015.261C18.6712%2015.0161%2018.61%2014.7761%2018.61%2014.5312C18.61%2013.8542%2018.8088%2013.2372%2019.2012%2012.7451C19.005%2012.6827%2018.8062%2012.6875%2018.61%2012.6875Z'%20fill='%23107D57'/%3e%3c/svg%3e", D = ({ title: t, description: n, onClick: o, className: r }) => {
|
|
12
|
+
const [e] = c({
|
|
13
|
+
type: "invitation",
|
|
14
|
+
action: "sent",
|
|
15
|
+
payload: {
|
|
16
|
+
from: l.TITLE_CARD
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ C(m, { onClick: e(o), className: r, children: [
|
|
20
|
+
/* @__PURE__ */ i(s, { alt: "friends-icon", src: f }),
|
|
21
|
+
/* @__PURE__ */ C(p, { children: [
|
|
22
|
+
/* @__PURE__ */ i(a, { children: t }),
|
|
23
|
+
/* @__PURE__ */ i(d, { children: n })
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ i(h, { name: "icon-copy" })
|
|
26
|
+
] });
|
|
27
|
+
};
|
|
14
28
|
export {
|
|
15
|
-
|
|
29
|
+
D as InviteLink
|
|
16
30
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Gamification } from '@streamlayer/feature-gamification';
|
|
3
3
|
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
4
|
-
import { HeaderNodeRef, type AppNodeRef } from '../../app/masters';
|
|
5
4
|
import { OnboardingStep } from './slides/onboarding-instructions';
|
|
6
5
|
import { OnboardingInviteCardProps } from './slides/onboarding-invite-card';
|
|
7
6
|
import { OnboardingRule } from './slides/onboarding-rules';
|
|
@@ -17,7 +16,6 @@ type OnboardingType = OnboardingInviteCardProps & {
|
|
|
17
16
|
primaryColor?: string;
|
|
18
17
|
inviteCardBtnLabel?: string;
|
|
19
18
|
loading: boolean;
|
|
20
|
-
renderToNode?: AppNodeRef | HeaderNodeRef;
|
|
21
19
|
inviterName?: string;
|
|
22
20
|
onClose: () => void;
|
|
23
21
|
};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { Skeleton as
|
|
5
|
-
import { OnboardingInstructions as
|
|
6
|
-
import { OnboardingInviteCard as
|
|
7
|
-
import { OnboardingRules as
|
|
8
|
-
import { OnboardingTerms as
|
|
9
|
-
import { Container as
|
|
2
|
+
import { useState as p, useEffect as s, useMemo as N, useCallback as z } from "react";
|
|
3
|
+
import E from "react-virtualized-auto-sizer";
|
|
4
|
+
import { Skeleton as F } from "../../skeleton/index.js";
|
|
5
|
+
import { OnboardingInstructions as G } from "./slides/onboarding-instructions/index.js";
|
|
6
|
+
import { OnboardingInviteCard as M } from "./slides/onboarding-invite-card/index.js";
|
|
7
|
+
import { OnboardingRules as P } from "./slides/onboarding-rules/index.js";
|
|
8
|
+
import { OnboardingTerms as R } from "./slides/onboarding-terms/index.js";
|
|
9
|
+
import { Container as U, OnboardingHeader as q, CloseBtn as J, IconClose as K, Content as Q, OnboardingFooter as V, OnboardingActionBtn as W } from "./styles.js";
|
|
10
10
|
import "../../skeleton/styles.js";
|
|
11
11
|
import "@linaria/react";
|
|
12
12
|
import "./invitingUser/index.js";
|
|
13
13
|
import "../../../utils/common.js";
|
|
14
14
|
import "./invitingUser/styles.js";
|
|
15
15
|
import "./slides/onboarding-instructions/styles.js";
|
|
16
|
+
import "../../../hooks/analytics.js";
|
|
17
|
+
import "lodash.throttle";
|
|
18
|
+
import "@streamlayer/sdk-web-interfaces";
|
|
19
|
+
import "../../theme/constants.js";
|
|
20
|
+
import "@streamlayer/sdk-web-types";
|
|
16
21
|
import "../../app/useClipboardCopy.js";
|
|
17
22
|
import "../../../index-jRXrW6ie.js";
|
|
18
23
|
import "../../../index-uEuzH3jr.js";
|
|
@@ -24,80 +29,75 @@ import "./slides/onboarding-rules/styles.js";
|
|
|
24
29
|
import "./slides/onboarding-terms/styles.js";
|
|
25
30
|
import "../../button/index.js";
|
|
26
31
|
import "../../button/styles.js";
|
|
27
|
-
const
|
|
32
|
+
const e = {
|
|
28
33
|
steps: !1,
|
|
29
34
|
rules: !1,
|
|
30
35
|
inviteCard: !1
|
|
31
|
-
},
|
|
36
|
+
}, Ti = ({
|
|
32
37
|
gamification: v,
|
|
33
38
|
steps: i,
|
|
34
|
-
rules:
|
|
39
|
+
rules: o,
|
|
35
40
|
rulesBtnLabel: d,
|
|
36
41
|
rulesTitle: I,
|
|
37
42
|
termsTitle: T,
|
|
38
|
-
termsText:
|
|
43
|
+
termsText: h,
|
|
39
44
|
primaryColor: u,
|
|
40
45
|
inviteLink: x,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
inviteCardSubtext: w,
|
|
46
|
+
inviteCardTitle: D,
|
|
47
|
+
inviteCardSubtext: k,
|
|
44
48
|
inviteCardBtnLabel: g,
|
|
45
49
|
loading: a,
|
|
46
|
-
renderToNode: A,
|
|
47
50
|
inviterName: c,
|
|
48
51
|
sdk: b,
|
|
49
|
-
onClose:
|
|
52
|
+
onClose: w
|
|
50
53
|
}) => {
|
|
51
|
-
const [
|
|
54
|
+
const [m, C] = p(0), [l, O] = p(!1), [r, n] = p(e);
|
|
52
55
|
s(() => {
|
|
53
|
-
i != null && i.length ?
|
|
56
|
+
i != null && i.length ? n({ ...e, steps: !0 }) : o != null && o.length ? n({ ...e, rules: !0 }) : n({ ...e, inviteCard: !0 });
|
|
54
57
|
}, []);
|
|
55
|
-
const
|
|
56
|
-
i != null && i.length &&
|
|
57
|
-
}, [
|
|
58
|
-
|
|
58
|
+
const A = N(() => r.steps && m === 0 ? "Continue" : r.rules ? l || !d ? "Got it" : d : r.inviteCard ? g || "Play Now" : "Next", [r, m, l, d, g]), j = z(() => {
|
|
59
|
+
i != null && i.length && m < i.length - 1 ? C((f) => ++f) : o != null && o.length && r.steps ? n({ ...e, rules: !0 }) : r.rules && n({ ...e, inviteCard: !0 });
|
|
60
|
+
}, [m, i == null ? void 0 : i.length, o == null ? void 0 : o.length, r, C, n]), H = async () => {
|
|
61
|
+
r.inviteCard ? await v.onboardingStatus.submitInplay() : r.rules && l ? O(!1) : j();
|
|
59
62
|
};
|
|
60
63
|
return s(() => {
|
|
61
64
|
!a && c && b.inviteDisplayed();
|
|
62
|
-
}, [a, c, b]), /* @__PURE__ */ t(
|
|
63
|
-
/* @__PURE__ */ t(
|
|
64
|
-
/* @__PURE__ */ y(
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
}, [a, c, b]), /* @__PURE__ */ t(E, { children: ({ width: f, height: S }) => /* @__PURE__ */ y(U, { style: { width: f, height: S, maxHeight: S }, children: [
|
|
66
|
+
/* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(J, { onClick: w, children: /* @__PURE__ */ t(K, { name: "icon-close-btn-gray" }) }) }),
|
|
67
|
+
/* @__PURE__ */ y(Q, { children: [
|
|
68
|
+
r.steps && (i == null ? void 0 : i.length) && /* @__PURE__ */ t(
|
|
69
|
+
G,
|
|
67
70
|
{
|
|
68
71
|
loading: a,
|
|
69
|
-
|
|
70
|
-
currentStep:
|
|
71
|
-
inviterName: c
|
|
72
|
-
...i[o]
|
|
72
|
+
steps: i,
|
|
73
|
+
currentStep: m,
|
|
74
|
+
inviterName: c
|
|
73
75
|
}
|
|
74
76
|
),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
r.rules && !l && /* @__PURE__ */ t(
|
|
78
|
+
P,
|
|
77
79
|
{
|
|
78
|
-
rules:
|
|
80
|
+
rules: o,
|
|
79
81
|
rulesTitle: I,
|
|
80
|
-
termsText:
|
|
82
|
+
termsText: h,
|
|
81
83
|
primaryColor: u,
|
|
82
84
|
openTerms: () => O(!0)
|
|
83
85
|
}
|
|
84
86
|
),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
r.rules && l && /* @__PURE__ */ t(R, { termsTitle: T, termsText: h }),
|
|
88
|
+
r.inviteCard && /* @__PURE__ */ t(
|
|
89
|
+
M,
|
|
88
90
|
{
|
|
89
91
|
inviteLink: x,
|
|
90
|
-
inviteCardTitle:
|
|
91
|
-
inviteCardSubtext:
|
|
92
|
-
primaryColor: u
|
|
93
|
-
socialLinks: D,
|
|
94
|
-
renderToNode: A
|
|
92
|
+
inviteCardTitle: D,
|
|
93
|
+
inviteCardSubtext: k,
|
|
94
|
+
primaryColor: u
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
] }),
|
|
98
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(F, { loading: a, style: { width: "100%" }, children: /* @__PURE__ */ t(W, { onClick: H, children: A }) }) })
|
|
99
99
|
] }) });
|
|
100
100
|
};
|
|
101
101
|
export {
|
|
102
|
-
|
|
102
|
+
Ti as OnboardingUI
|
|
103
103
|
};
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { InvitingUser as
|
|
3
|
-
import { Skeleton as
|
|
4
|
-
import { Container as
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { InvitingUser as h } from "../../invitingUser/index.js";
|
|
3
|
+
import { Skeleton as d } from "../../../../skeleton/index.js";
|
|
4
|
+
import { Container as l, Content as p, Graphic as s, GraphicImage as f, Headline as I, InvitingUserWrap as g, StepsContainer as v, StepIndicator as x } from "./styles.js";
|
|
5
5
|
import "../../../../../utils/common.js";
|
|
6
6
|
import "../../invitingUser/styles.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "../../../../skeleton/styles.js";
|
|
9
|
-
const
|
|
10
|
-
loading:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
] });
|
|
9
|
+
const A = ({
|
|
10
|
+
loading: e,
|
|
11
|
+
steps: o,
|
|
12
|
+
currentStep: r,
|
|
13
|
+
inviterName: t
|
|
14
|
+
}) => {
|
|
15
|
+
const { headline: a } = o[r];
|
|
16
|
+
return /* @__PURE__ */ c(l, { children: [
|
|
17
|
+
/* @__PURE__ */ c(p, { "data-welcome-screen": r === 0, children: [
|
|
18
|
+
/* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(d, { loading: e, children: o.map(({ graphicSrc: m }, n) => /* @__PURE__ */ i(f, { src: m, "data-active": r === n })) }) }),
|
|
19
|
+
a && /* @__PURE__ */ i(d, { loading: e, children: /* @__PURE__ */ i(I, { children: a }) })
|
|
20
|
+
] }),
|
|
21
|
+
t && r === 0 && /* @__PURE__ */ i(g, { children: /* @__PURE__ */ i(h, { name: t }) }),
|
|
22
|
+
/* @__PURE__ */ i(v, { style: e ? { visibility: "hidden" } : {}, children: Array.from({ length: o.length }).map((m, n) => /* @__PURE__ */ i(x, { "data-active": r === n }, n)) })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
A as OnboardingInstructions
|
|
26
27
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
3
|
export declare const Graphic: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
+
export declare const GraphicImage: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
|
|
4
5
|
export declare const Headline: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
6
|
export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
7
|
export declare const StepsContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const n = /* @__PURE__ */ s("div")({
|
|
3
3
|
name: "Container",
|
|
4
4
|
class: "c1htq1lb",
|
|
5
5
|
propsAsIs: !1
|
|
@@ -7,33 +7,38 @@ const a = /* @__PURE__ */ s("div")({
|
|
|
7
7
|
name: "Graphic",
|
|
8
8
|
class: "gjyzpp7",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}), p = /* @__PURE__ */ s("
|
|
10
|
+
}), p = /* @__PURE__ */ s("img")({
|
|
11
|
+
name: "GraphicImage",
|
|
12
|
+
class: "g16mldgz",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), o = /* @__PURE__ */ s("div")({
|
|
11
15
|
name: "Headline",
|
|
12
|
-
class: "
|
|
16
|
+
class: "h69js65",
|
|
13
17
|
propsAsIs: !1
|
|
14
18
|
}), t = /* @__PURE__ */ s("div")({
|
|
15
19
|
name: "Content",
|
|
16
|
-
class: "
|
|
20
|
+
class: "cmm7qmo",
|
|
17
21
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
22
|
+
}), i = /* @__PURE__ */ s("div")({
|
|
19
23
|
name: "StepsContainer",
|
|
20
|
-
class: "
|
|
24
|
+
class: "s17knuw2",
|
|
21
25
|
propsAsIs: !1
|
|
22
|
-
}),
|
|
26
|
+
}), r = /* @__PURE__ */ s("span")({
|
|
23
27
|
name: "StepIndicator",
|
|
24
|
-
class: "
|
|
28
|
+
class: "s1b74psg",
|
|
25
29
|
propsAsIs: !1
|
|
26
|
-
}),
|
|
30
|
+
}), c = /* @__PURE__ */ s("div")({
|
|
27
31
|
name: "InvitingUserWrap",
|
|
28
|
-
class: "
|
|
32
|
+
class: "i1y99ug7",
|
|
29
33
|
propsAsIs: !1
|
|
30
34
|
});
|
|
31
35
|
export {
|
|
32
|
-
|
|
36
|
+
n as Container,
|
|
33
37
|
t as Content,
|
|
34
38
|
e as Graphic,
|
|
35
|
-
p as
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
p as GraphicImage,
|
|
40
|
+
o as Headline,
|
|
41
|
+
c as InvitingUserWrap,
|
|
42
|
+
r as StepIndicator,
|
|
43
|
+
i as StepsContainer
|
|
39
44
|
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { HeaderNodeRef, type AppNodeRef } from '../../../../app/masters';
|
|
3
2
|
import { icons } from '../../../../icons';
|
|
4
3
|
export type OnboardingInviteCardProps = {
|
|
5
|
-
renderToNode: AppNodeRef | HeaderNodeRef;
|
|
6
4
|
inviteLink?: string;
|
|
7
5
|
inviteCardTitle?: string;
|
|
8
6
|
inviteCardSubtext?: string;
|
|
9
7
|
primaryColor?: string;
|
|
10
|
-
socialLinks?: InviteCardSocialLink[];
|
|
11
8
|
className?: string;
|
|
12
9
|
};
|
|
13
10
|
export type InviteCardSocialLink = {
|