@streamlayer/react-ui 0.92.0 → 0.94.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/{useClipboardCopy-E5rEe6It.js → index-jRXrW6ie.js} +1513 -1537
- package/lib/index.js +5 -4
- package/lib/ui/app/Features/Gamification/Friends.js +6 -5
- package/lib/ui/app/Features/Gamification/Leaderboard.js +4 -3
- package/lib/ui/app/Features/Gamification/Question.js +19 -21
- package/lib/ui/app/Features/Gamification/QuestionsList.js +1 -1
- package/lib/ui/app/Features/Gamification/Tabs.js +42 -39
- package/lib/ui/app/Features/Gamification/gamification-feature.js +11 -6
- package/lib/ui/app/Features/Gamification/index.js +72 -84
- package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +2 -0
- package/lib/ui/app/Navigation/MastersNavigation/index.js +43 -35
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
- package/lib/ui/app/Notifications/Onboarding/index.js +114 -86
- package/lib/ui/app/Notifications/index.js +115 -108
- package/lib/ui/app/Points/index.js +6 -5
- package/lib/ui/app/masters.js +41 -31
- package/lib/ui/app/styles.d.ts +1 -0
- package/lib/ui/app/styles.js +6 -1
- package/lib/ui/app/useClipboardCopy.js +26 -5
- package/lib/ui/app/useImagesPreload.d.ts +4 -0
- package/lib/ui/app/useImagesPreload.js +23 -0
- package/lib/ui/app/useMastersApp.js +42 -35
- package/lib/ui/app/useSdkResponsive.d.ts +1 -1
- package/lib/ui/app/useSdkResponsive.js +23 -23
- package/lib/ui/app/useSdkScroll.d.ts +1 -0
- package/lib/ui/app/useSdkScroll.js +32 -23
- package/lib/ui/gamification/detail/header/index.js +11 -11
- package/lib/ui/gamification/detail/header/styles.d.ts +1 -1
- package/lib/ui/gamification/detail/header/styles.js +11 -11
- package/lib/ui/gamification/onboarding/index.d.ts +2 -1
- package/lib/ui/gamification/onboarding/index.js +55 -43
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +15 -13
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +9 -9
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +14 -13
- package/lib/ui/gamification/points/index.js +5 -4
- package/lib/ui/gamification/question/insight/index.js +4 -5
- package/lib/ui/gamification/question/list/index.js +14 -14
- package/lib/ui/gamification/question/notification/index.js +3 -2
- package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +17 -17
- package/lib/ui/gamification/question/notification/prediction-result/index.js +37 -39
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +1 -1
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +12 -12
- package/lib/ui/gamification/question/notification/tweet/index.js +10 -7
- package/lib/ui/gamification/question/twitter/index.js +16 -33
- package/lib/ui/gamification/question/twitter/styles.d.ts +0 -1
- package/lib/ui/gamification/question/twitter/styles.js +7 -12
- package/lib/ui/gamification/vote/index.js +57 -56
- package/lib/ui/gamification/vote/insight-details/index.js +5 -6
- package/lib/ui/gamification/vote/twitter-details/index.js +13 -29
- package/lib/ui/gamification/vote/twitter-details/styles.d.ts +0 -1
- package/lib/ui/gamification/vote/twitter-details/styles.js +3 -8
- package/lib/ui/gamification/vote/vote-option/index.js +61 -57
- package/lib/ui/gamification/vote/win-bar/index.d.ts +1 -0
- package/lib/ui/gamification/vote/win-bar/index.js +21 -20
- package/lib/ui/modal/index.d.ts +9 -0
- package/lib/ui/modal/index.js +34 -0
- package/lib/ui/navigation/button/FeaturedGroups.d.ts +3 -1
- package/lib/ui/navigation/button/FeaturedGroups.js +11 -11
- package/lib/ui/navigation/masters.d.ts +2 -1
- package/lib/ui/navigation/masters.js +9 -4
- package/lib/ui/questions/insight/index.d.ts +2 -3
- package/lib/ui/questions/insight/index.js +13 -35
- package/lib/ui/questions/insight/styles.d.ts +0 -1
- package/lib/ui/questions/insight/styles.js +9 -14
- package/lib/ui/questions/twitter/account/index.d.ts +2 -1
- package/lib/ui/questions/twitter/account/index.js +24 -18
- package/lib/ui/questions/twitter/account/styles.d.ts +1 -1
- package/lib/ui/questions/twitter/account/styles.js +2 -2
- package/lib/ui/questions/twitter/index.d.ts +2 -2
- package/lib/ui/questions/twitter/index.js +31 -9
- package/lib/ui/questions/twitter/styles.d.ts +1 -0
- package/lib/ui/questions/twitter/styles.js +8 -3
- package/lib/ui/skeleton/index.d.ts +7 -0
- package/lib/ui/skeleton/index.js +7 -0
- package/lib/ui/skeleton/styles.d.ts +2 -0
- package/lib/ui/skeleton/styles.js +9 -0
- package/lib/ui/theme/breakpoints.d.ts +4 -1
- package/lib/ui/theme/breakpoints.js +24 -12
- package/lib/ui/theme/constants.d.ts +4 -0
- package/lib/ui/theme/constants.js +6 -2
- package/lib/ui/theme/index.js +4 -3
- package/lib/ui/theme/theme.js +29 -21
- package/lib/utils/common.js +22 -8
- package/lib/utils/decorators/container.js +4 -3
- package/package.json +18 -18
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useStore as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { FeatureType as
|
|
1
|
+
import { useStore as d } from "@nanostores/react";
|
|
2
|
+
import { useRef as y, useState as v, useCallback as I, useEffect as c } from "react";
|
|
3
|
+
import { FeatureType as h } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import "./Navigation/MastersNavigation/index.js";
|
|
5
5
|
import { FeaturedGroupsButtonId as n } from "../navigation/button/FeaturedGroups.js";
|
|
6
|
-
import { ChannelsButtonId as
|
|
6
|
+
import { ChannelsButtonId as l } from "../navigation/button/Channels.js";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
8
|
import "../navigation/button/LeaderBoard.js";
|
|
9
9
|
import "@linaria/react";
|
|
@@ -12,54 +12,61 @@ import "../navigation/button/index.js";
|
|
|
12
12
|
import "../navigation/button/styles.js";
|
|
13
13
|
import "../navigation/masters.js";
|
|
14
14
|
import "../navigation/index.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
import "../theme/constants.js";
|
|
16
|
+
const W = (e) => {
|
|
17
|
+
const a = y(""), [m, f] = v(!1), A = d(e.status), i = d(e.userId()), r = A === "ready", [s, u] = v(n), p = I(
|
|
18
|
+
(t, o) => {
|
|
19
|
+
u(o), o === n ? (t && e.createEventSession(t), window.requestAnimationFrame(() => {
|
|
20
|
+
e.openFeature(h.GAMES);
|
|
21
|
+
})) : e.closeFeature(!1);
|
|
21
22
|
},
|
|
22
|
-
[
|
|
23
|
+
[e]
|
|
23
24
|
);
|
|
24
|
-
|
|
25
|
-
!
|
|
26
|
-
}, [
|
|
27
|
-
const
|
|
28
|
-
a.current =
|
|
29
|
-
if (
|
|
30
|
-
p(
|
|
25
|
+
c(() => {
|
|
26
|
+
!r && s === n && (u(l), e.closeFeature(!0));
|
|
27
|
+
}, [r, s, e]);
|
|
28
|
+
const g = (t) => {
|
|
29
|
+
a.current = t, f(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: o, err: S }) => {
|
|
30
|
+
if (S) {
|
|
31
|
+
p(t, l);
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
if (o) {
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
p(
|
|
35
|
+
e.isUserAuthorized().then((E) => {
|
|
36
|
+
if (E) {
|
|
37
|
+
p(t, n);
|
|
37
38
|
return;
|
|
38
39
|
} else
|
|
39
|
-
|
|
40
|
+
e.disableApp();
|
|
40
41
|
});
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
});
|
|
44
|
-
},
|
|
45
|
-
f(!1),
|
|
45
|
+
}, b = () => {
|
|
46
|
+
f(!1), e.disableApp();
|
|
46
47
|
};
|
|
47
|
-
return
|
|
48
|
-
if (!
|
|
49
|
-
|
|
48
|
+
return c(() => {
|
|
49
|
+
if (!i) {
|
|
50
|
+
r && (u(l), e.disableApp());
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
if (i && a.current && m) {
|
|
54
|
+
e.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
|
|
55
|
+
e.createEventSession(a.current);
|
|
56
|
+
});
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}, [i]), c(() => {
|
|
60
|
+
const t = e.getInviterId();
|
|
61
|
+
console.log("you invited by", t), t && e.status.get() === "disabled" && (console.log("deep link cb called"), e.deepLinkHandled());
|
|
62
|
+
}, [e]), {
|
|
56
63
|
sdkEnabled: m,
|
|
57
|
-
sdkReady:
|
|
64
|
+
sdkReady: r,
|
|
58
65
|
activeOverlay: s,
|
|
59
66
|
activateAndLoadOverlay: p,
|
|
60
|
-
activateEventWithId:
|
|
61
|
-
deactivate:
|
|
62
|
-
isLogged: !!
|
|
67
|
+
activateEventWithId: g,
|
|
68
|
+
deactivate: b,
|
|
69
|
+
isLogged: !!i
|
|
63
70
|
};
|
|
64
71
|
};
|
|
65
72
|
export {
|
|
@@ -7,7 +7,7 @@ type ResponsiveData = {
|
|
|
7
7
|
size: (typeof BREAKPOINTS)[BREAKPOINTS_KEYS];
|
|
8
8
|
};
|
|
9
9
|
sdkInView?: boolean;
|
|
10
|
-
|
|
10
|
+
sdkInDesktopView?: boolean;
|
|
11
11
|
};
|
|
12
12
|
export type ResponsiveStore = MapStore<ResponsiveData>;
|
|
13
13
|
export declare const useSdkResponsive: (appNode: AppNodeRef) => [ResponsiveStore];
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import c from "lodash.throttle";
|
|
2
2
|
import { useState as m, useEffect as u } from "react";
|
|
3
|
-
import { BREAKPOINTS as
|
|
4
|
-
import { m as
|
|
3
|
+
import { BREAKPOINTS as r } from "../theme/constants.js";
|
|
4
|
+
import { m as p } from "../../index-keh7OLCY.js";
|
|
5
5
|
import "../../index-uEuzH3jr.js";
|
|
6
|
-
const d = Object.keys(
|
|
7
|
-
const
|
|
6
|
+
const d = Object.keys(r), i = () => {
|
|
7
|
+
const t = window.innerWidth;
|
|
8
8
|
let e = "sm";
|
|
9
|
-
for (let
|
|
10
|
-
const
|
|
11
|
-
if (!(
|
|
12
|
-
e =
|
|
9
|
+
for (let n = d.length - 1; n > 0; n--) {
|
|
10
|
+
const s = d[n];
|
|
11
|
+
if (!(t < r[s]) && t >= r[s]) {
|
|
12
|
+
e = s;
|
|
13
13
|
break;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
return {
|
|
17
17
|
name: e,
|
|
18
|
-
size:
|
|
18
|
+
size: r[e]
|
|
19
19
|
};
|
|
20
|
-
},
|
|
20
|
+
}, w = (t) => {
|
|
21
21
|
var e;
|
|
22
|
-
return (((e =
|
|
23
|
-
},
|
|
22
|
+
return (((e = t.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
|
|
23
|
+
}, k = (t) => t >= r.xl, I = (t) => {
|
|
24
24
|
const [e] = m(() => {
|
|
25
|
-
const
|
|
26
|
-
return
|
|
25
|
+
const n = i();
|
|
26
|
+
return p({
|
|
27
27
|
screen: i(),
|
|
28
|
-
sdkInView:
|
|
29
|
-
|
|
28
|
+
sdkInView: w(t),
|
|
29
|
+
sdkInDesktopView: k(n.size)
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
return u(() => {
|
|
33
|
-
const
|
|
34
|
-
e.setKey("sdkInView",
|
|
35
|
-
}, 200),
|
|
33
|
+
const n = c(() => {
|
|
34
|
+
e.setKey("sdkInView", w(t));
|
|
35
|
+
}, 200), s = c(() => {
|
|
36
36
|
const o = i();
|
|
37
|
-
e.setKey("screen", o), e.setKey("
|
|
37
|
+
e.setKey("screen", o), e.setKey("sdkInDesktopView", k(o.size));
|
|
38
38
|
}, 200);
|
|
39
|
-
return window.addEventListener("scroll",
|
|
40
|
-
window.removeEventListener("scroll",
|
|
39
|
+
return window.addEventListener("scroll", n), window.addEventListener("resize", s), () => {
|
|
40
|
+
window.removeEventListener("scroll", n), window.removeEventListener("resize", s);
|
|
41
41
|
};
|
|
42
|
-
}, [e,
|
|
42
|
+
}, [e, t]), [e];
|
|
43
43
|
};
|
|
44
44
|
export {
|
|
45
45
|
I as useSdkResponsive
|
|
@@ -7,5 +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
11
|
export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore) => [ScrollNodeRef, ScrollStore];
|
|
11
12
|
export {};
|
|
@@ -1,36 +1,45 @@
|
|
|
1
1
|
import { useStore as p } from "@nanostores/react";
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { BREAKPOINTS as
|
|
5
|
-
import { m as
|
|
2
|
+
import S from "lodash.throttle";
|
|
3
|
+
import { useRef as f, useState as h, useEffect as b } from "react";
|
|
4
|
+
import { BREAKPOINTS as m } from "../theme/constants.js";
|
|
5
|
+
import { m as g } from "../../index-keh7OLCY.js";
|
|
6
6
|
import "../../index-uEuzH3jr.js";
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const D = (t, n) => {
|
|
8
|
+
var r;
|
|
9
|
+
(r = t.current) == null || r.scrollIntoView(n);
|
|
10
|
+
}, I = (t, n) => {
|
|
11
|
+
const r = f(null), l = f(0), [e] = h(
|
|
12
|
+
g({
|
|
10
13
|
scrollPosition: 0,
|
|
14
|
+
tabsShown: !0,
|
|
11
15
|
scrollDirection: "forward"
|
|
12
16
|
})
|
|
13
|
-
),
|
|
14
|
-
return
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
17
|
+
), c = p(n);
|
|
18
|
+
return b(() => {
|
|
19
|
+
const s = window.innerWidth < m.xl ? window : r.current;
|
|
20
|
+
if (!s)
|
|
17
21
|
return () => {
|
|
18
22
|
};
|
|
19
|
-
const
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
+
const i = S((w) => {
|
|
24
|
+
var a;
|
|
25
|
+
const u = w.target;
|
|
26
|
+
if (!u)
|
|
23
27
|
return;
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
const d =
|
|
27
|
-
|
|
28
|
+
let o = 0;
|
|
29
|
+
c.screen.size < m.xl ? o = ((a = t.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : o = u.scrollTop;
|
|
30
|
+
const d = l.current < o ? "forward" : "backward";
|
|
31
|
+
l.current = o, e.set({
|
|
32
|
+
scrollPosition: Math.round(o),
|
|
33
|
+
scrollDirection: d,
|
|
34
|
+
tabsShown: e.get().tabsShown
|
|
35
|
+
});
|
|
28
36
|
}, 200);
|
|
29
|
-
return
|
|
30
|
-
|
|
37
|
+
return s.addEventListener("scroll", i), () => {
|
|
38
|
+
s.removeEventListener("scroll", i);
|
|
31
39
|
};
|
|
32
|
-
}, [
|
|
40
|
+
}, [e, t, c.screen]), [r, e];
|
|
33
41
|
};
|
|
34
42
|
export {
|
|
35
|
-
|
|
43
|
+
D as scrollIntoAppView,
|
|
44
|
+
I as useSdkScroll
|
|
36
45
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { QuestionType as n } from "@streamlayer/sdk-web-types";
|
|
3
3
|
import { QuestionTypeData as c } from "../../constants.js";
|
|
4
|
-
import { Container as l, QuestionTypeWrap as a, QuestionTypeIcon as p, QuestionTypeTitle as s,
|
|
4
|
+
import { Container as l, QuestionTypeWrap as a, QuestionTypeIcon as p, QuestionTypeTitle as s, CloseIconWrap as d, CloseIcon as I } from "./styles.js";
|
|
5
5
|
import "@linaria/react";
|
|
6
6
|
import "../../../icons/index.js";
|
|
7
7
|
import "react";
|
|
8
|
-
const N = ({ type:
|
|
9
|
-
const o =
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
(o == null ? void 0 : o.iconName) && /* @__PURE__ */
|
|
8
|
+
const N = ({ type: r, close: m, label: t }) => {
|
|
9
|
+
const o = r ? c[r] : { label: t, iconName: void 0 };
|
|
10
|
+
return /* @__PURE__ */ i(l, { children: [
|
|
11
|
+
/* @__PURE__ */ i(a, { children: [
|
|
12
|
+
(o == null ? void 0 : o.iconName) && /* @__PURE__ */ e(
|
|
13
13
|
p,
|
|
14
14
|
{
|
|
15
|
-
"data-type-trivia":
|
|
16
|
-
"data-type-poll":
|
|
15
|
+
"data-type-trivia": r === n.TRIVIA,
|
|
16
|
+
"data-type-poll": r === n.POLL,
|
|
17
17
|
name: o.iconName
|
|
18
18
|
}
|
|
19
19
|
),
|
|
20
|
-
(o == null ? void 0 : o.label) && /* @__PURE__ */
|
|
20
|
+
(o == null ? void 0 : o.label) && /* @__PURE__ */ e(s, { children: o.label })
|
|
21
21
|
] }),
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ e(d, { onClick: m, children: /* @__PURE__ */ e(I, { name: "icon-cross" }) })
|
|
23
23
|
] });
|
|
24
24
|
};
|
|
25
25
|
export {
|
|
@@ -3,5 +3,5 @@ export declare const Container: import("@linaria/react").StyledComponent<import(
|
|
|
3
3
|
export declare const QuestionTypeWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
4
|
export declare const QuestionTypeIcon: any;
|
|
5
5
|
export declare const QuestionTypeTitle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const CloseIconWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
7
7
|
export declare const CloseIcon: any;
|
|
@@ -2,11 +2,11 @@ import { styled as s } from "@linaria/react";
|
|
|
2
2
|
import { SvgIcon as o } from "../../../icons/index.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
const
|
|
5
|
+
const r = /* @__PURE__ */ s("div")({
|
|
6
6
|
name: "Container",
|
|
7
7
|
class: "c1vwopgc",
|
|
8
8
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
9
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
10
10
|
name: "QuestionTypeWrap",
|
|
11
11
|
class: "qyktpt0",
|
|
12
12
|
propsAsIs: !1
|
|
@@ -14,24 +14,24 @@ const l = /* @__PURE__ */ s("div")({
|
|
|
14
14
|
name: "QuestionTypeIcon",
|
|
15
15
|
class: "q951jdx",
|
|
16
16
|
propsAsIs: !0
|
|
17
|
-
}),
|
|
17
|
+
}), I = /* @__PURE__ */ s("span")({
|
|
18
18
|
name: "QuestionTypeTitle",
|
|
19
19
|
class: "qss5f0e",
|
|
20
20
|
propsAsIs: !1
|
|
21
|
-
}),
|
|
22
|
-
name: "
|
|
21
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
22
|
+
name: "CloseIconWrap",
|
|
23
23
|
class: "c1ao1jtv",
|
|
24
24
|
propsAsIs: !1
|
|
25
|
-
}),
|
|
25
|
+
}), n = () => o, u = /* @__PURE__ */ s(n())({
|
|
26
26
|
name: "CloseIcon",
|
|
27
27
|
class: "cvsl7l3",
|
|
28
28
|
propsAsIs: !0
|
|
29
29
|
});
|
|
30
30
|
export {
|
|
31
|
-
u as
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
u as CloseIcon,
|
|
32
|
+
m as CloseIconWrap,
|
|
33
|
+
r as Container,
|
|
34
34
|
i as QuestionTypeIcon,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
I as QuestionTypeTitle,
|
|
36
|
+
l as QuestionTypeWrap
|
|
37
37
|
};
|
|
@@ -14,7 +14,8 @@ type OnboardingType = OnboardingInviteCardProps & {
|
|
|
14
14
|
termsText?: string;
|
|
15
15
|
primaryColor?: string;
|
|
16
16
|
inviteCardBtnLabel?: string;
|
|
17
|
-
|
|
17
|
+
loading: boolean;
|
|
18
|
+
renderToNode?: AppNodeRef | HeaderNodeRef;
|
|
18
19
|
onClose: () => void;
|
|
19
20
|
};
|
|
20
21
|
export declare const Onboarding: React.FC<OnboardingType>;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useState as c, useEffect as j, useMemo as
|
|
1
|
+
import { jsx as t, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useEffect as j, useMemo as H, useCallback as z } from "react";
|
|
3
3
|
import E from "react-virtualized-auto-sizer";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "./
|
|
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 q, OnboardingHeader as J, CloseBtn as K, IconClose as Q, Content as U, OnboardingFooter as V, OnboardingActionBtn as W } from "./styles.js";
|
|
10
|
+
import "../../skeleton/styles.js";
|
|
10
11
|
import "@linaria/react";
|
|
11
|
-
import "
|
|
12
|
+
import "./slides/onboarding-instructions/styles.js";
|
|
13
|
+
import "../../app/useClipboardCopy.js";
|
|
14
|
+
import "../../../index-jRXrW6ie.js";
|
|
12
15
|
import "../../../index-uEuzH3jr.js";
|
|
13
16
|
import "../copyNotification/index.js";
|
|
14
17
|
import "../../icons/index.js";
|
|
@@ -18,66 +21,75 @@ import "./slides/onboarding-rules/styles.js";
|
|
|
18
21
|
import "./slides/onboarding-terms/styles.js";
|
|
19
22
|
import "../../button/index.js";
|
|
20
23
|
import "../../button/styles.js";
|
|
21
|
-
const
|
|
24
|
+
const m = {
|
|
22
25
|
steps: !1,
|
|
23
26
|
rules: !1,
|
|
24
27
|
inviteCard: !1
|
|
25
|
-
},
|
|
26
|
-
gamification:
|
|
27
|
-
steps:
|
|
28
|
+
}, bi = ({
|
|
29
|
+
gamification: S,
|
|
30
|
+
steps: i,
|
|
28
31
|
rules: r,
|
|
29
|
-
rulesBtnLabel:
|
|
30
|
-
rulesTitle:
|
|
31
|
-
termsTitle:
|
|
32
|
+
rulesBtnLabel: a,
|
|
33
|
+
rulesTitle: y,
|
|
34
|
+
termsTitle: s,
|
|
32
35
|
termsText: f,
|
|
33
36
|
primaryColor: g,
|
|
34
|
-
inviteLink:
|
|
35
|
-
socialLinks:
|
|
36
|
-
inviteCardTitle:
|
|
37
|
-
inviteCardSubtext:
|
|
38
|
-
inviteCardBtnLabel:
|
|
37
|
+
inviteLink: v,
|
|
38
|
+
socialLinks: T,
|
|
39
|
+
inviteCardTitle: k,
|
|
40
|
+
inviteCardSubtext: x,
|
|
41
|
+
inviteCardBtnLabel: h,
|
|
42
|
+
loading: u,
|
|
39
43
|
renderToNode: I,
|
|
40
44
|
onClose: N
|
|
41
45
|
}) => {
|
|
42
|
-
const [o,
|
|
46
|
+
const [o, p] = c(0), [l, b] = c(!1), [n, e] = c(m);
|
|
43
47
|
j(() => {
|
|
44
|
-
|
|
48
|
+
i != null && i.length ? e({ ...m, steps: !0 }) : r != null && r.length ? e({ ...m, rules: !0 }) : e({ ...m, inviteCard: !0 });
|
|
45
49
|
}, []);
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
}, [o,
|
|
49
|
-
|
|
50
|
+
const w = H(() => n.steps && o === 0 ? "Continue" : n.rules ? l || !a ? "Got it" : a : n.inviteCard ? h || "Play Now" : "Next", [n, o, l, a, h]), A = z(() => {
|
|
51
|
+
i != null && i.length && o < i.length - 1 ? p((d) => ++d) : r != null && r.length && n.steps ? e({ ...m, rules: !0 }) : n.rules && e({ ...m, inviteCard: !0 });
|
|
52
|
+
}, [o, i == null ? void 0 : i.length, r == null ? void 0 : r.length, n, p, e]), D = async () => {
|
|
53
|
+
n.inviteCard ? await S.onboardingStatus.submitInplay() : n.rules && l ? b(!1) : A();
|
|
50
54
|
};
|
|
51
|
-
return /* @__PURE__ */ t(E, { children: ({ width: d, height:
|
|
52
|
-
/* @__PURE__ */ t(
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
return /* @__PURE__ */ t(E, { children: ({ width: d, height: C }) => /* @__PURE__ */ O(q, { style: { width: d, height: C, maxHeight: C }, children: [
|
|
56
|
+
/* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(K, { onClick: N, children: /* @__PURE__ */ t(Q, { name: "icon-close-btn-gray" }) }) }),
|
|
57
|
+
/* @__PURE__ */ O(U, { children: [
|
|
58
|
+
n.steps && (i == null ? void 0 : i.length) && /* @__PURE__ */ t(
|
|
59
|
+
G,
|
|
60
|
+
{
|
|
61
|
+
loading: u,
|
|
62
|
+
stepsCount: i.length,
|
|
63
|
+
currentStep: o,
|
|
64
|
+
...i[o]
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
n.rules && !l && /* @__PURE__ */ t(
|
|
68
|
+
P,
|
|
57
69
|
{
|
|
58
70
|
rules: r,
|
|
59
|
-
rulesTitle:
|
|
71
|
+
rulesTitle: y,
|
|
60
72
|
termsText: f,
|
|
61
73
|
primaryColor: g,
|
|
62
74
|
openTerms: () => b(!0)
|
|
63
75
|
}
|
|
64
76
|
),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
n.rules && l && /* @__PURE__ */ t(R, { termsTitle: s, termsText: f }),
|
|
78
|
+
n.inviteCard && /* @__PURE__ */ t(
|
|
79
|
+
M,
|
|
68
80
|
{
|
|
69
|
-
inviteLink:
|
|
70
|
-
inviteCardTitle:
|
|
71
|
-
inviteCardSubtext:
|
|
81
|
+
inviteLink: v,
|
|
82
|
+
inviteCardTitle: k,
|
|
83
|
+
inviteCardSubtext: x,
|
|
72
84
|
primaryColor: g,
|
|
73
|
-
socialLinks:
|
|
85
|
+
socialLinks: T,
|
|
74
86
|
renderToNode: I
|
|
75
87
|
}
|
|
76
88
|
)
|
|
77
89
|
] }),
|
|
78
|
-
/* @__PURE__ */ t(
|
|
90
|
+
/* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(F, { loading: u, style: { width: "100%" }, children: /* @__PURE__ */ t(W, { onClick: D, children: w }) }) })
|
|
79
91
|
] }) });
|
|
80
92
|
};
|
|
81
93
|
export {
|
|
82
|
-
|
|
94
|
+
bi as Onboarding
|
|
83
95
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type OnboardingInstructionsProps = OnboardingStep & {
|
|
3
|
+
loading: boolean;
|
|
3
4
|
stepsCount: number;
|
|
4
5
|
currentStep: number;
|
|
5
6
|
};
|
|
6
7
|
export type OnboardingStep = {
|
|
7
8
|
graphicSrc: string;
|
|
8
9
|
headline?: string;
|
|
9
|
-
width?: number;
|
|
10
10
|
};
|
|
11
11
|
export declare const OnboardingInstructions: React.FC<OnboardingInstructionsProps>;
|
|
12
12
|
export {};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Skeleton as c } from "../../../../skeleton/index.js";
|
|
3
|
+
import { Container as m, Content as p, Graphic as s, Headline as a, StepsContainer as l, StepIndicator as x } from "./styles.js";
|
|
4
|
+
import "../../../../skeleton/styles.js";
|
|
3
5
|
import "@linaria/react";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
graphicSrc:
|
|
7
|
-
headline:
|
|
8
|
-
stepsCount:
|
|
9
|
-
currentStep:
|
|
10
|
-
}) => /* @__PURE__ */ o(
|
|
11
|
-
/* @__PURE__ */ o(
|
|
12
|
-
/* @__PURE__ */ r(s, { "
|
|
13
|
-
|
|
6
|
+
const v = ({
|
|
7
|
+
loading: t,
|
|
8
|
+
graphicSrc: d,
|
|
9
|
+
headline: i,
|
|
10
|
+
stepsCount: h,
|
|
11
|
+
currentStep: e
|
|
12
|
+
}) => /* @__PURE__ */ o(m, { children: [
|
|
13
|
+
/* @__PURE__ */ o(p, { "data-centered": e === 0, children: [
|
|
14
|
+
/* @__PURE__ */ r(s, { children: /* @__PURE__ */ r(c, { loading: t, style: { width: "80px", height: "80px" }, children: /* @__PURE__ */ r("img", { src: d, alt: i }) }) }),
|
|
15
|
+
i && /* @__PURE__ */ r(c, { loading: t, children: /* @__PURE__ */ r(a, { children: i }) })
|
|
14
16
|
] }),
|
|
15
|
-
/* @__PURE__ */ r(
|
|
17
|
+
/* @__PURE__ */ r(l, { style: t ? { visibility: "hidden" } : {}, children: Array.from({ length: h }).map((f, n) => /* @__PURE__ */ r(x, { "data-active": e === n }, n)) })
|
|
16
18
|
] });
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
v as OnboardingInstructions
|
|
19
21
|
};
|
|
@@ -1,7 +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
|
-
export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
3
|
export declare const Graphic: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
4
|
export declare const Headline: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
+
export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
6
|
export declare const StepsContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
7
7
|
export declare const StepIndicator: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
@@ -4,16 +4,16 @@ const a = /* @__PURE__ */ s("div")({
|
|
|
4
4
|
class: "c1htq1lb",
|
|
5
5
|
propsAsIs: !1
|
|
6
6
|
}), e = /* @__PURE__ */ s("div")({
|
|
7
|
-
name: "
|
|
8
|
-
class: "
|
|
7
|
+
name: "Graphic",
|
|
8
|
+
class: "gjyzpp7",
|
|
9
9
|
propsAsIs: !1
|
|
10
10
|
}), o = /* @__PURE__ */ s("div")({
|
|
11
|
-
name: "
|
|
12
|
-
class: "
|
|
11
|
+
name: "Headline",
|
|
12
|
+
class: "h16mldgz",
|
|
13
13
|
propsAsIs: !1
|
|
14
14
|
}), t = /* @__PURE__ */ s("div")({
|
|
15
|
-
name: "
|
|
16
|
-
class: "
|
|
15
|
+
name: "Content",
|
|
16
|
+
class: "c69js65",
|
|
17
17
|
propsAsIs: !1
|
|
18
18
|
}), p = /* @__PURE__ */ s("div")({
|
|
19
19
|
name: "StepsContainer",
|
|
@@ -26,9 +26,9 @@ const a = /* @__PURE__ */ s("div")({
|
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
28
|
a as Container,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
t as Content,
|
|
30
|
+
e as Graphic,
|
|
31
|
+
o as Headline,
|
|
32
32
|
c as StepIndicator,
|
|
33
33
|
p as StepsContainer
|
|
34
34
|
};
|