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