@streamlayer/react-ui 0.98.0 → 0.99.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 (114) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/hooks/analytics.js +2 -2
  3. package/lib/{index-jRXrW6ie.js → index-Bicco-Aq.js} +1 -1
  4. package/lib/{index-z0QjLiEL.js → index-CZvwzN5o.js} +1 -1
  5. package/lib/index.js +4 -8
  6. package/lib/ui/app/Features/Gamification/Friends.js +10 -23
  7. package/lib/ui/app/Features/Gamification/Leaderboard.js +30 -45
  8. package/lib/ui/app/Features/Gamification/Question.js +31 -63
  9. package/lib/ui/app/Features/Gamification/QuestionsList.js +8 -34
  10. package/lib/ui/app/Features/Gamification/Tabs.js +25 -82
  11. package/lib/ui/app/Features/Gamification/UserSummary.js +12 -21
  12. package/lib/ui/app/Features/Gamification/gamification-feature.js +2 -93
  13. package/lib/ui/app/Features/Gamification/index.js +58 -141
  14. package/lib/ui/app/Features/index.js +21 -109
  15. package/lib/ui/app/Navigation/MastersNavigation/index.js +16 -22
  16. package/lib/ui/app/Navigation/index.js +9 -12
  17. package/lib/ui/app/Notifications/Onboarding/Notification/index.js +13 -16
  18. package/lib/ui/app/Notifications/Onboarding/Notification/styles.js +18 -20
  19. package/lib/ui/app/Notifications/Onboarding/index.js +61 -89
  20. package/lib/ui/app/Notifications/index.js +124 -156
  21. package/lib/ui/app/Notifications/styles.js +10 -15
  22. package/lib/ui/app/Points/index.js +18 -26
  23. package/lib/ui/app/masters.js +74 -195
  24. package/lib/ui/app/useClipboardCopy.js +11 -15
  25. package/lib/ui/app/useMastersApp.js +34 -44
  26. package/lib/ui/app/useSdkResponsive.js +18 -19
  27. package/lib/ui/app/useSdkScroll.js +5 -6
  28. package/lib/ui/button/index.js +3 -4
  29. package/lib/ui/gamification/copyNotification/index.js +5 -7
  30. package/lib/ui/gamification/detail/header/index.js +15 -18
  31. package/lib/ui/gamification/detail/header/styles.js +12 -14
  32. package/lib/ui/gamification/detail/sponsor/index.js +2 -3
  33. package/lib/ui/gamification/insight/index.js +5 -6
  34. package/lib/ui/gamification/insight-list/index.js +3 -6
  35. package/lib/ui/gamification/invite-link/index.js +11 -17
  36. package/lib/ui/gamification/invite-link/styles.js +13 -15
  37. package/lib/ui/gamification/leaderboard/index.js +21 -28
  38. package/lib/ui/gamification/leaderboard/list-item/index.js +19 -22
  39. package/lib/ui/gamification/leaderboard/list-item/styles.js +16 -18
  40. package/lib/ui/gamification/leaderboard/static.js +19 -23
  41. package/lib/ui/gamification/leaderboard/styles.js +1 -1
  42. package/lib/ui/gamification/onboarding/index.js +51 -73
  43. package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -11
  44. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +3 -2
  45. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +17 -20
  46. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +2 -0
  47. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +21 -11
  48. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +21 -30
  49. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +22 -24
  50. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +5 -7
  51. package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +2 -3
  52. package/lib/ui/gamification/onboarding/styles.js +14 -17
  53. package/lib/ui/gamification/points/index.js +9 -15
  54. package/lib/ui/gamification/points/styles.js +12 -14
  55. package/lib/ui/gamification/question/index.js +22 -26
  56. package/lib/ui/gamification/question/insight/index.js +7 -15
  57. package/lib/ui/gamification/question/list/index.js +33 -54
  58. package/lib/ui/gamification/question/notification/index.js +22 -35
  59. package/lib/ui/gamification/question/notification/insight/index.js +12 -17
  60. package/lib/ui/gamification/question/notification/pill/index.js +7 -9
  61. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +11 -12
  62. package/lib/ui/gamification/question/notification/prediction-result/index.js +45 -51
  63. package/lib/ui/gamification/question/notification/prediction-result/styles.js +23 -26
  64. package/lib/ui/gamification/question/notification/styles.js +17 -19
  65. package/lib/ui/gamification/question/notification/tweet/index.js +8 -18
  66. package/lib/ui/gamification/question/styles.js +32 -34
  67. package/lib/ui/gamification/question/twitter/index.js +8 -20
  68. package/lib/ui/gamification/question/twitter/styles.js +4 -6
  69. package/lib/ui/gamification/tabs/index.js +6 -7
  70. package/lib/ui/gamification/user-statistics/components/rank/index.js +4 -5
  71. package/lib/ui/gamification/user-statistics/components/statistic/index.js +0 -1
  72. package/lib/ui/gamification/user-statistics/index.js +2 -6
  73. package/lib/ui/gamification/vote/expired-alert/index.js +8 -10
  74. package/lib/ui/gamification/vote/feedback/index.js +35 -39
  75. package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
  76. package/lib/ui/gamification/vote/feedback/styles.js +31 -29
  77. package/lib/ui/gamification/vote/index.js +108 -117
  78. package/lib/ui/gamification/vote/insight-details/index.js +9 -16
  79. package/lib/ui/gamification/vote/twitter-details/index.js +7 -17
  80. package/lib/ui/gamification/vote/vote-option/index.js +33 -34
  81. package/lib/ui/gamification/vote/vote-option/styles.js +24 -26
  82. package/lib/ui/gamification/vote/win-bar/index.js +29 -37
  83. package/lib/ui/gamification/vote/win-bar/styles.js +16 -19
  84. package/lib/ui/login/demo.d.ts +1 -0
  85. package/lib/ui/login/demo.js +5 -17
  86. package/lib/ui/login/index.js +29 -35
  87. package/lib/ui/modal/index.d.ts +0 -1
  88. package/lib/ui/modal/index.js +45 -38
  89. package/lib/ui/navigation/button/Channels.js +5 -8
  90. package/lib/ui/navigation/button/FeaturedGroups.js +3 -6
  91. package/lib/ui/navigation/button/LeaderBoard.js +8 -11
  92. package/lib/ui/navigation/button/index.js +10 -11
  93. package/lib/ui/navigation/masters.js +2 -3
  94. package/lib/ui/questions/insight/index.js +14 -19
  95. package/lib/ui/questions/twitter/account/index.js +13 -15
  96. package/lib/ui/questions/twitter/account/styles.js +14 -16
  97. package/lib/ui/questions/twitter/index.js +31 -38
  98. package/lib/ui/skeleton/index.js +3 -4
  99. package/lib/ui/theme/constants.js +1 -1
  100. package/lib/ui/theme/index.js +3 -5
  101. package/lib/ui/theme/theme.js +16 -14
  102. package/lib/ui/video-player/index.js +44 -38
  103. package/lib/utils/createDemo.js +18 -28
  104. package/lib/utils/debug/components/copyLogs.js +2 -3
  105. package/lib/utils/debug/components/developer.js +20 -24
  106. package/lib/utils/debug/components/eventInput.js +9 -10
  107. package/lib/utils/debug/components/sdkKey.js +9 -10
  108. package/lib/utils/debug/index.js +17 -28
  109. package/lib/utils/debug/storage.js +32 -14
  110. package/lib/utils/decorators/container.js +5 -9
  111. package/lib/utils/storage.js +32 -14
  112. package/package.json +25 -25
  113. /package/lib/{index-uEuzH3jr.js → index-xuotMAFm.js} +0 -0
  114. /package/lib/{styles_z07sl8-w40geAFS.js → styles_z07sl8-l0sNRNKZ.js} +0 -0
@@ -1,12 +1,9 @@
1
- import { jsx as e, jsxs as u } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
2
  import { useState as j, useLayoutEffect as U } from "react";
3
- import { QuestionImages as a, QuestionType as o, QuestionStatus as A } from "@streamlayer/sdk-web-types";
3
+ import { QuestionImages as a, QuestionType as o, QuestionStatus as D } from "@streamlayer/sdk-web-types";
4
4
  import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
5
5
  import { IconDefault as y, IconContainer as F, IconWrap as M, IconCircle as W, ButtonContainer as z, ButtonPct as G, ButtonBody as H, Title as J, Pts as K, Indicators as X, CheckIcon as Y, Percentage as Z } from "./styles.js";
6
- import "react-countup";
7
- import "@linaria/react";
8
- import "../../../icons/index.js";
9
- const I = {
6
+ const E = {
10
7
  [a.CENTERED]: (t) => /* @__PURE__ */ e(y, { alt: "option-icon", src: t }),
11
8
  [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
12
9
  [a.ROUNDED]: (t) => /* @__PURE__ */ e(W, { alt: "option-icon", src: t }),
@@ -28,66 +25,68 @@ const I = {
28
25
  correct: n,
29
26
  hasCorrectAnswer: r,
30
27
  questionStatus: i
31
- }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === A.RESOLVED && n : !1, at = (t) => {
32
- var T;
28
+ }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === D.RESOLVED && n : !1, ot = (t) => {
29
+ var S;
33
30
  const {
34
31
  // option props
35
32
  id: c,
36
33
  icon: n,
37
34
  text: r,
38
35
  percentageDecimal: i,
39
- points: N,
36
+ points: p,
40
37
  // extra props
41
- onVote: S,
42
- markThatVoted: D,
43
- onPercentsAnimated: w,
44
- youSelected: E,
38
+ onVote: w,
39
+ markThatVoted: A,
40
+ onPercentsAnimated: f,
41
+ youSelected: h,
45
42
  questionVoted: s,
46
- imageMode: h,
43
+ imageMode: C,
47
44
  answerTimeExpired: O,
48
- questionStatus: C,
45
+ questionStatus: P,
49
46
  isLoading: g,
50
47
  questionType: d,
51
48
  correct: k,
52
49
  hasCorrectAnswer: v,
53
50
  votedAfterQuestionClosed: x,
54
- enteredAnActiveQuestion: P,
55
- marketClosed: l
56
- } = t, [L, p] = j(0), m = _(t), Q = q({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: v, questionStatus: C }), f = l && d === o.PREDICTION, R = s || f, B = d === o.PREDICTION && !s && !l, V = s && !E && m !== "incorrect";
51
+ enteredAnActiveQuestion: R,
52
+ marketClosed: I
53
+ } = t, [L, T] = j(0), m = _(t), Q = q({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: v, questionStatus: P }), u = I && d === o.PREDICTION, N = s || u, B = d === o.PREDICTION && !s && !I, V = s && !h && m !== "incorrect";
57
54
  return U(() => {
58
- p(0), requestAnimationFrame(() => {
59
- p(i);
55
+ T(0), requestAnimationFrame(() => {
56
+ T(i);
60
57
  });
61
- }, [i]), /* @__PURE__ */ u(
58
+ }, [i]), /* @__PURE__ */ l(
62
59
  z,
63
60
  {
64
61
  value: c,
65
- "data-selected": E,
62
+ "data-selected": h,
66
63
  "data-answer-state": m,
67
- disabled: s || g || O || f && !P || f && P && x,
64
+ disabled: s || g || O || u && !R || u && R && x,
68
65
  "data-is-not-checked": V,
69
66
  onClick: (b) => {
70
- D(
71
- d === o.PREDICTION ? l : C === A.RESOLVED
72
- ), S(b);
67
+ A(
68
+ d === o.PREDICTION ? I : P === D.RESOLVED
69
+ ), w(b);
73
70
  },
74
71
  children: [
75
72
  /* @__PURE__ */ e(
76
73
  G,
77
74
  {
78
75
  "data-answer-state": m,
79
- style: { width: `${R ? L : 0}%` },
80
- onTransitionEnd: w
76
+ style: { width: `${N ? L : 0}%` },
77
+ onTransitionEnd: () => {
78
+ u || f == null || f();
79
+ }
81
80
  }
82
81
  ),
83
- /* @__PURE__ */ u(H, { children: [
84
- n && h && ((T = I[h]) == null ? void 0 : T.call(I, n)),
82
+ /* @__PURE__ */ l(H, { children: [
83
+ n && C && ((S = E[C]) == null ? void 0 : S.call(E, n)),
85
84
  /* @__PURE__ */ e(J, { children: r }),
86
- B && /* @__PURE__ */ u("div", { children: [
87
- N,
85
+ B && /* @__PURE__ */ l("div", { children: [
86
+ p,
88
87
  /* @__PURE__ */ e(K, { children: "pts" })
89
88
  ] }),
90
- R && /* @__PURE__ */ u(X, { children: [
89
+ N && /* @__PURE__ */ l(X, { children: [
91
90
  Q && /* @__PURE__ */ e(Y, { name: "selected" }),
92
91
  /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
93
92
  ] })
@@ -97,5 +96,5 @@ const I = {
97
96
  );
98
97
  };
99
98
  export {
100
- at as VotingOption
99
+ ot as VotingOption
101
100
  };
@@ -1,24 +1,22 @@
1
1
  import { styled as s } from "@linaria/react";
2
2
  import { SvgIcon as o } from "../../../icons/index.js";
3
- import "react/jsx-runtime";
4
- import "react";
5
- const I = /* @__PURE__ */ s("button")({
3
+ const r = /* @__PURE__ */ s("button")({
6
4
  name: "ButtonContainer",
7
5
  class: "b1b6dl8t",
8
6
  propsAsIs: !1
9
- }), i = /* @__PURE__ */ s("div")({
7
+ }), l = /* @__PURE__ */ s("div")({
10
8
  name: "ButtonPct",
11
9
  class: "b4iik8i",
12
10
  propsAsIs: !1
13
- }), m = /* @__PURE__ */ s("span")({
11
+ }), I = /* @__PURE__ */ s("span")({
14
12
  name: "ButtonBody",
15
13
  class: "b1gq1lnf",
16
14
  propsAsIs: !1
17
- }), f = /* @__PURE__ */ s("div")({
15
+ }), i = /* @__PURE__ */ s("div")({
18
16
  name: "IconContainer",
19
17
  class: "i1j65z51",
20
18
  propsAsIs: !1
21
- }), u = /* @__PURE__ */ s("div")({
19
+ }), m = /* @__PURE__ */ s("div")({
22
20
  name: "IconWrap",
23
21
  class: "i19tpfua",
24
22
  propsAsIs: !1
@@ -26,47 +24,47 @@ const I = /* @__PURE__ */ s("button")({
26
24
  name: "Icon",
27
25
  class: "i1tubmma",
28
26
  propsAsIs: !1
29
- }), t = () => n, A = /* @__PURE__ */ s(t())({
27
+ }), t = () => n, f = /* @__PURE__ */ s(t())({
30
28
  name: "IconDefault",
31
29
  class: "i1grrgwj",
32
30
  propsAsIs: !0
33
- }), a = () => n, d = /* @__PURE__ */ s(a())({
31
+ }), a = () => n, u = /* @__PURE__ */ s(a())({
34
32
  name: "IconCircle",
35
33
  class: "ibemyq8",
36
34
  propsAsIs: !0
37
- }), b = /* @__PURE__ */ s("span")({
35
+ }), A = /* @__PURE__ */ s("span")({
38
36
  name: "Title",
39
37
  class: "t1dceht",
40
38
  propsAsIs: !1
41
- }), B = /* @__PURE__ */ s("span")({
39
+ }), d = /* @__PURE__ */ s("span")({
42
40
  name: "Indicators",
43
41
  class: "i116q4vq",
44
42
  propsAsIs: !1
45
- }), C = /* @__PURE__ */ s("span")({
43
+ }), b = /* @__PURE__ */ s("span")({
46
44
  name: "Pts",
47
45
  class: "p17ajcu2",
48
46
  propsAsIs: !1
49
- }), g = /* @__PURE__ */ s("span")({
47
+ }), B = /* @__PURE__ */ s("span")({
50
48
  name: "Percentage",
51
49
  class: "pu9kmlb",
52
50
  propsAsIs: !1
53
- }), c = () => o, P = /* @__PURE__ */ s(c())({
51
+ }), c = () => o, C = /* @__PURE__ */ s(c())({
54
52
  name: "CheckIcon",
55
53
  class: "c1j2j0s0",
56
54
  propsAsIs: !0
57
55
  });
58
56
  export {
59
- m as ButtonBody,
60
- I as ButtonContainer,
61
- i as ButtonPct,
62
- P as CheckIcon,
57
+ I as ButtonBody,
58
+ r as ButtonContainer,
59
+ l as ButtonPct,
60
+ C as CheckIcon,
63
61
  n as Icon,
64
- d as IconCircle,
65
- f as IconContainer,
66
- A as IconDefault,
67
- u as IconWrap,
68
- B as Indicators,
69
- g as Percentage,
70
- C as Pts,
71
- b as Title
62
+ u as IconCircle,
63
+ i as IconContainer,
64
+ f as IconDefault,
65
+ m as IconWrap,
66
+ d as Indicators,
67
+ B as Percentage,
68
+ b as Pts,
69
+ A as Title
72
70
  };
@@ -1,55 +1,47 @@
1
- import { jsx as r, jsxs as n, Fragment as C } from "react/jsx-runtime";
2
- import { QuestionType as t } from "@streamlayer/sdk-web-types";
3
- import { AnimatedCounter as P } from "../../../animated-counter/index.js";
4
- import { Timer as s } from "../../../timer/index.js";
5
- import { ShowInContainer as I, WinBarContainer as f, Content as u, Title as O, WinIcon as T, Points as j, PointsCount as x, PointsUnits as y } from "./styles.js";
6
- import "react-countup";
7
- import "@linaria/react";
8
- import "react";
9
- import "react-countdown-circle-timer";
10
- import "../../../theme/constants.js";
11
- import "../../../icons/index.js";
12
- import "../../../show-in/index.js";
13
- import "@linaria/core";
14
- const F = ({
15
- title: e,
16
- points: o,
17
- isPlayingTimer: m,
18
- isTimer: a,
1
+ import { jsx as n, jsxs as e, Fragment as P } from "react/jsx-runtime";
2
+ import { QuestionType as i } from "@streamlayer/sdk-web-types";
3
+ import { AnimatedCounter as s } from "../../../animated-counter/index.js";
4
+ import { Timer as I } from "../../../timer/index.js";
5
+ import { ShowInContainer as f, WinBarContainer as p, Content as u, Title as O, WinIcon as T, Points as j, PointsCount as x, PointsUnits as y } from "./styles.js";
6
+ const b = ({
7
+ title: o,
8
+ points: t,
9
+ isPlayingTimer: a,
10
+ isTimer: m,
19
11
  animatePoints: c,
20
- questionType: i,
12
+ questionType: r,
21
13
  timerDuration: d,
22
14
  votedInCurrentRender: l,
23
- percentsAnimated: p,
24
- onTimerExpired: h
25
- }) => /* @__PURE__ */ r(
26
- I,
15
+ percentsAnimated: h,
16
+ onTimerExpired: C
17
+ }) => /* @__PURE__ */ n(
18
+ f,
27
19
  {
28
- enabled: i === t.PREDICTION && l,
29
- animate: p,
30
- children: /* @__PURE__ */ n(
31
- f,
20
+ enabled: r === i.PREDICTION && l,
21
+ animate: h,
22
+ children: /* @__PURE__ */ e(
23
+ p,
32
24
  {
33
25
  style: {
34
- justifyContent: i === t.PREDICTION ? "center" : "space-between"
26
+ justifyContent: r === i.PREDICTION ? "center" : "space-between"
35
27
  },
36
28
  children: [
37
- /* @__PURE__ */ n(u, { children: [
38
- e && /* @__PURE__ */ r(O, { children: e }),
39
- o !== void 0 && i !== t.POLL && /* @__PURE__ */ n(C, { children: [
40
- /* @__PURE__ */ r(T, { name: "icon-trophy" }),
41
- /* @__PURE__ */ n(j, { children: [
42
- /* @__PURE__ */ r(x, { children: c ? /* @__PURE__ */ r(P, { value: o, delay: 0.3 }) : o }),
43
- /* @__PURE__ */ r(y, { children: "PTS" })
29
+ /* @__PURE__ */ e(u, { children: [
30
+ o && /* @__PURE__ */ n(O, { children: o }),
31
+ t !== void 0 && r !== i.POLL && /* @__PURE__ */ e(P, { children: [
32
+ /* @__PURE__ */ n(T, { name: "icon-trophy" }),
33
+ /* @__PURE__ */ e(j, { children: [
34
+ /* @__PURE__ */ n(x, { children: c ? /* @__PURE__ */ n(s, { value: t, delay: 0.3 }) : t }),
35
+ /* @__PURE__ */ n(y, { children: "PTS" })
44
36
  ] })
45
37
  ] })
46
38
  ] }),
47
- a && i !== t.PREDICTION && /* @__PURE__ */ r(s, { isPlaying: m, onTimerExpired: h, duration: d })
39
+ m && r !== i.PREDICTION && /* @__PURE__ */ n(I, { isPlaying: a, onTimerExpired: C, duration: d })
48
40
  ]
49
41
  }
50
42
  )
51
43
  }
52
44
  );
53
45
  export {
54
- F as WinBar
46
+ b as WinBar
55
47
  };
@@ -1,49 +1,46 @@
1
1
  import { styled as s } from "@linaria/react";
2
2
  import { SvgIcon as n } from "../../../icons/index.js";
3
3
  import { GrowingShowIn as o } from "../../../show-in/index.js";
4
- import "react/jsx-runtime";
5
- import "react";
6
- import "@linaria/core";
7
- const t = () => o, m = /* @__PURE__ */ s(t())({
4
+ const t = () => o, c = /* @__PURE__ */ s(t())({
8
5
  name: "ShowInContainer",
9
6
  class: "sie6cqo",
10
7
  propsAsIs: !0
11
- }), I = /* @__PURE__ */ s("div")({
8
+ }), r = /* @__PURE__ */ s("div")({
12
9
  name: "WinBarContainer",
13
10
  class: "wgizw4u",
14
11
  propsAsIs: !1
15
- }), f = /* @__PURE__ */ s("div")({
12
+ }), l = /* @__PURE__ */ s("div")({
16
13
  name: "Content",
17
14
  class: "c1l3ucjp",
18
15
  propsAsIs: !1
19
- }), w = /* @__PURE__ */ s("div")({
16
+ }), m = /* @__PURE__ */ s("div")({
20
17
  name: "Title",
21
18
  class: "tx7j799",
22
19
  propsAsIs: !1
23
- }), i = () => n, A = /* @__PURE__ */ s(i())({
20
+ }), a = () => n, I = /* @__PURE__ */ s(a())({
24
21
  name: "WinIcon",
25
22
  class: "w4lwuj0",
26
23
  propsAsIs: !0
27
- }), C = /* @__PURE__ */ s("div")({
24
+ }), f = /* @__PURE__ */ s("div")({
28
25
  name: "Points",
29
26
  class: "po9i64o",
30
27
  propsAsIs: !1
31
- }), u = /* @__PURE__ */ s("span")({
28
+ }), w = /* @__PURE__ */ s("span")({
32
29
  name: "PointsCount",
33
30
  class: "pe5g05h",
34
31
  propsAsIs: !1
35
- }), d = /* @__PURE__ */ s("span")({
32
+ }), A = /* @__PURE__ */ s("span")({
36
33
  name: "PointsUnits",
37
34
  class: "p1hdtpmb",
38
35
  propsAsIs: !1
39
36
  });
40
37
  export {
41
- f as Content,
42
- C as Points,
43
- u as PointsCount,
44
- d as PointsUnits,
45
- m as ShowInContainer,
46
- w as Title,
47
- I as WinBarContainer,
48
- A as WinIcon
38
+ l as Content,
39
+ f as Points,
40
+ w as PointsCount,
41
+ A as PointsUnits,
42
+ c as ShowInContainer,
43
+ m as Title,
44
+ r as WinBarContainer,
45
+ I as WinIcon
49
46
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
+ import '@streamlayer/sdk-web-anonymous-auth';
3
4
  export declare const LoginComponent: React.FC<{
4
5
  sdk: StreamLayerSDK;
5
6
  }>;
@@ -1,26 +1,14 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { useStore as m } from "@nanostores/react";
2
+ import { useStore as e } from "@nanostores/react";
3
3
  import "@streamlayer/sdk-web-anonymous-auth";
4
- import { Login as n } from "./index.js";
5
- import "react";
6
- import "react-auth-code-input";
7
- import "react-phone-number-input";
8
- import "../timer/index.js";
9
- import "@linaria/react";
10
- import "react-countdown-circle-timer";
11
- import "../theme/constants.js";
12
- import "../../utils/login.js";
13
- import "@connectrpc/connect";
14
- import "@connectrpc/connect-web";
15
- import "@streamlayer/sl-eslib/users/users_connect";
16
- import "./styles.js";
17
- const j = ({ sdk: o }) => m(o.getUserStore()).data ? /* @__PURE__ */ r("button", { onClick: o.logout, children: "logout" }) : /* @__PURE__ */ r(n, { login: async (i) => {
4
+ import { Login as i } from "./index.js";
5
+ const c = ({ sdk: o }) => e(o.getUserStore()).data ? /* @__PURE__ */ r("button", { onClick: o.logout, children: "logout" }) : /* @__PURE__ */ r(i, { login: async (n) => {
18
6
  try {
19
- await o.authorizationBypass("streamlayer:streamlayer", i);
7
+ await o.authorizationBypass("streamlayer:streamlayer", n);
20
8
  } catch (t) {
21
9
  throw console.log("login err", t), t;
22
10
  }
23
11
  }, anonymousLogin: o.anonymousAuthorization, host: o.host });
24
12
  export {
25
- j as LoginComponent
13
+ c as LoginComponent
26
14
  };
@@ -1,60 +1,54 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as a } from "react";
3
3
  import w from "react-auth-code-input";
4
4
  import P, { isValidPhoneNumber as F, formatPhoneNumberIntl as v } from "react-phone-number-input";
5
5
  import { Timer as D } from "../timer/index.js";
6
6
  import { requestLoginCode as I, register as k, login as S } from "../../utils/login.js";
7
- import { Panel as q, Form as u, FormTitle as p, FormDescription as d, FormInputContainer as x, FormSubmit as m, Digits as E } from "./styles.js";
8
- import "@linaria/react";
9
- import "react-countdown-circle-timer";
10
- import "../theme/constants.js";
11
- import "@connectrpc/connect";
12
- import "@connectrpc/connect-web";
13
- import "@streamlayer/sl-eslib/users/users_connect";
14
- const O = ({ login: s, anonymousLogin: h, host: c }) => {
15
- const [n, g] = a(""), [i, b] = a(""), [l, f] = a(""), y = async (o) => {
16
- o.preventDefault();
7
+ import { Panel as q, Form as m, FormTitle as p, FormDescription as d, FormInputContainer as x, FormSubmit as s, Digits as E } from "./styles.js";
8
+ const z = ({ login: h, anonymousLogin: u, host: c }) => {
9
+ const [o, g] = a(""), [i, b] = a(""), [l, f] = a(""), y = async (t) => {
10
+ t.preventDefault();
17
11
  try {
18
- const r = n.replaceAll("+", "");
12
+ const n = o.replaceAll("+", "");
19
13
  try {
20
- await I(c, r);
14
+ await I(c, n);
21
15
  } catch {
22
- await k(c, r);
16
+ await k(c, n);
23
17
  }
24
- b(r);
25
- } catch (r) {
26
- window.alert(r);
18
+ b(n);
19
+ } catch (n) {
20
+ window.alert(n);
27
21
  }
28
- }, C = async (o) => {
29
- if (o.preventDefault(), i && l)
22
+ }, C = async (t) => {
23
+ if (t.preventDefault(), i && l)
30
24
  try {
31
- const r = await S(c, i, l);
32
- r && s ? await s(r) : console.log("token", r);
33
- } catch (r) {
34
- window.alert(r);
25
+ const n = await S(c, i, l);
26
+ n && h ? await h(n) : console.log("token", n);
27
+ } catch (n) {
28
+ window.alert(n);
35
29
  }
36
30
  };
37
- return /* @__PURE__ */ t(q, { children: [
38
- !i && /* @__PURE__ */ t("div", { children: [
39
- /* @__PURE__ */ t(u, { onSubmit: y, children: [
31
+ return /* @__PURE__ */ r(q, { children: [
32
+ !i && /* @__PURE__ */ r("div", { children: [
33
+ /* @__PURE__ */ r(m, { onSubmit: y, children: [
40
34
  /* @__PURE__ */ e(p, { children: "Enter your phone number" }),
41
35
  /* @__PURE__ */ e(d, { children: "Enter your phone up for number to log in or sign an account." }),
42
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(P, { value: n, onChange: (o) => g(`${o}`) }) }),
43
- /* @__PURE__ */ e(m, { disabled: !F(n), type: "submit", children: "request code" })
36
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(P, { value: o, onChange: (t) => g(`${t}`) }) }),
37
+ /* @__PURE__ */ e(s, { disabled: !F(o), type: "submit", children: "request code" })
44
38
  ] }),
45
- h && /* @__PURE__ */ e(m, { style: { display: "block", margin: "auto" }, onClick: h, children: "anonymous login" })
39
+ u && /* @__PURE__ */ e(s, { style: { display: "block", margin: "auto" }, onClick: u, children: "anonymous login" })
46
40
  ] }),
47
- i && /* @__PURE__ */ t(u, { onSubmit: C, children: [
41
+ i && /* @__PURE__ */ r(m, { onSubmit: C, children: [
48
42
  /* @__PURE__ */ e(p, { children: "Enter Verification Code" }),
49
- /* @__PURE__ */ t(d, { children: [
43
+ /* @__PURE__ */ r(d, { children: [
50
44
  "Please enter the verification code ",
51
45
  /* @__PURE__ */ e("br", {}),
52
46
  "sent to ",
53
- /* @__PURE__ */ e("b", { children: v(n) })
47
+ /* @__PURE__ */ e("b", { children: v(o) })
54
48
  ] }),
55
49
  /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(w, { autoFocus: !0, allowedCharacters: "numeric", length: 4, onChange: f }) }),
56
- /* @__PURE__ */ e(m, { disabled: l.length !== 4, type: "submit", children: "login" }),
57
- /* @__PURE__ */ t(d, { children: [
50
+ /* @__PURE__ */ e(s, { disabled: l.length !== 4, type: "submit", children: "login" }),
51
+ /* @__PURE__ */ r(d, { children: [
58
52
  "Didn't get 59 the code? ",
59
53
  /* @__PURE__ */ e("br", {}),
60
54
  "Resend Code in",
@@ -64,5 +58,5 @@ const O = ({ login: s, anonymousLogin: h, host: c }) => {
64
58
  ] });
65
59
  };
66
60
  export {
67
- O as Login
61
+ z as Login
68
62
  };
@@ -2,7 +2,6 @@
2
2
  type ModalProps = {
3
3
  children: React.ReactNode;
4
4
  container: React.MutableRefObject<HTMLDivElement | null>;
5
- fixedView: boolean;
6
5
  useContainer: boolean;
7
6
  };
8
7
  /**
@@ -1,52 +1,59 @@
1
- import { jsxs as a, jsx as s } from "react/jsx-runtime";
2
- import { cx as m } from "@linaria/core";
3
- import { styled as f } from "@linaria/react";
4
- import { useState as u, useCallback as i, useEffect as c } from "react";
5
- import { r as d } from "../../index-jRXrW6ie.js";
6
- import "../../index-uEuzH3jr.js";
7
- const p = /* @__PURE__ */ f("div")({
1
+ import { jsxs as p, jsx as u } from "react/jsx-runtime";
2
+ import { styled as h } from "@linaria/react";
3
+ import { useState as w, useEffect as a } from "react";
4
+ import { r as f } from "../../index-Bicco-Aq.js";
5
+ import { BREAKPOINTS as n } from "../theme/constants.js";
6
+ const y = /* @__PURE__ */ h("div")({
8
7
  name: "StaticContainer",
9
8
  class: "svm502q",
10
9
  propsAsIs: !1
11
- }), v = "fd3gza8", x = `
12
- body {
13
- overflow: hidden !important;
14
- }
15
- `, y = `
10
+ }), g = `
16
11
  .sl-hide-on-modal {
17
- display: none !important;
12
+ height: 0 !important;
13
+ opacity: 0 !important;
14
+ overflow: hidden !important;
18
15
  }
19
- `, h = `
16
+ `, O = `
20
17
  .sl-pill-button {
21
18
  display: none !important;
22
19
  }
23
- `, E = (r) => {
24
- const [t, n] = u(r), o = i((l) => {
25
- l.target instanceof HTMLAnchorElement && l.target.href.slice(-1) === "#" && n(!1);
26
- }, []), e = i(() => n(!1), []);
27
- return c(() => (r && (document.addEventListener("scroll", e), document.addEventListener("click", o)), () => {
28
- document.removeEventListener("scroll", e), document.removeEventListener("click", o);
29
- }), [r, e, o]), c(() => {
30
- t === !1 && (document.removeEventListener("scroll", e), document.removeEventListener("click", o));
31
- }, [t, e, o]), [t];
32
- }, V = ({
33
- children: r,
20
+ `, W = ({
21
+ children: i,
34
22
  container: t,
35
- fixedView: n,
36
- useContainer: o
23
+ useContainer: m
37
24
  }) => {
38
- const [e] = E(n);
39
- return t.current ? o ? d.createPortal(/* @__PURE__ */ a(p, {
40
- className: m(e && v),
41
- children: [r, e && /* @__PURE__ */ s("style", {
42
- children: x
43
- }), !e && /* @__PURE__ */ s("style", {
44
- children: y
45
- }), /* @__PURE__ */ s("style", {
46
- children: h
25
+ const [l] = w(() => {
26
+ var r;
27
+ const e = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
28
+ return (((r = t.current) == null ? void 0 : r.getBoundingClientRect().y) || 0) - e < 0;
29
+ }), [o, s] = w(!1);
30
+ return a(() => {
31
+ if (!t.current || !l)
32
+ return s(!0), () => {
33
+ };
34
+ const e = window.scrollY;
35
+ return s(!0), () => {
36
+ var c;
37
+ const d = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
38
+ (((c = t.current) == null ? void 0 : c.getBoundingClientRect().y) || 0) - d < 0 && window.scrollTo({
39
+ top: e
40
+ });
41
+ };
42
+ }, []), a(() => {
43
+ if (o && t.current && l) {
44
+ const e = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
45
+ window.scrollTo({
46
+ top: t.current.offsetTop - e
47
+ });
48
+ }
49
+ }, [o]), !t.current || !o ? null : m ? f.createPortal(/* @__PURE__ */ p(y, {
50
+ children: [i, /* @__PURE__ */ u("style", {
51
+ children: g
52
+ }), /* @__PURE__ */ u("style", {
53
+ children: O
47
54
  })]
48
- }), t.current, "modal-node") : d.createPortal(r, t.current, "modal-node") : null;
55
+ }), t.current, "modal-node") : f.createPortal(i, t.current, "modal-node");
49
56
  };
50
57
  export {
51
- V as ModalPortal
58
+ W as ModalPortal
52
59
  };
@@ -2,26 +2,23 @@ import { jsx as o } from "react/jsx-runtime";
2
2
  import { styled as e } from "@linaria/react";
3
3
  import { SvgIcon as s } from "../../icons/index.js";
4
4
  import { Button as c } from "./index.js";
5
- import "react";
6
- import "@linaria/core";
7
- import "./styles.js";
8
- const r = () => s, a = /* @__PURE__ */ e(r())({
5
+ const a = () => s, l = /* @__PURE__ */ e(a())({
9
6
  name: "ButtonIcon",
10
7
  class: "b1whzxvd",
11
8
  propsAsIs: !0
12
- }), B = "channels", I = (n) => {
9
+ }), d = "channels", p = (n) => {
13
10
  var t;
14
11
  return /* @__PURE__ */ o(c, {
15
12
  ...n,
16
13
  id: "channels",
17
14
  label: "Channels",
18
- icon: /* @__PURE__ */ o(a, {
15
+ icon: /* @__PURE__ */ o(l, {
19
16
  name: "icon-btn-channels",
20
17
  "data-selected": (t = n.active) == null ? void 0 : t.toString()
21
18
  })
22
19
  });
23
20
  };
24
21
  export {
25
- I as ChannelsButton,
26
- B as ChannelsButtonId
22
+ p as ChannelsButton,
23
+ d as ChannelsButtonId
27
24
  };