@streamlayer/react-ui 0.93.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 (52) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/{useClipboardCopy-E5rEe6It.js → index-jRXrW6ie.js} +1513 -1537
  3. package/lib/ui/app/Features/Gamification/Friends.js +6 -5
  4. package/lib/ui/app/Features/Gamification/Leaderboard.js +4 -3
  5. package/lib/ui/app/Features/Gamification/Question.js +19 -21
  6. package/lib/ui/app/Features/Gamification/QuestionsList.js +1 -1
  7. package/lib/ui/app/Features/Gamification/Tabs.js +39 -40
  8. package/lib/ui/app/Features/Gamification/gamification-feature.js +12 -10
  9. package/lib/ui/app/Features/Gamification/index.js +73 -89
  10. package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +2 -0
  11. package/lib/ui/app/Navigation/MastersNavigation/index.js +40 -34
  12. package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
  13. package/lib/ui/app/Notifications/Onboarding/index.js +96 -79
  14. package/lib/ui/app/Notifications/index.js +114 -112
  15. package/lib/ui/app/masters.js +35 -31
  16. package/lib/ui/app/useClipboardCopy.js +26 -5
  17. package/lib/ui/app/useMastersApp.js +42 -35
  18. package/lib/ui/app/useSdkResponsive.d.ts +1 -1
  19. package/lib/ui/app/useSdkResponsive.js +25 -25
  20. package/lib/ui/app/useSdkScroll.js +11 -10
  21. package/lib/ui/gamification/onboarding/index.d.ts +1 -1
  22. package/lib/ui/gamification/onboarding/index.js +11 -10
  23. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +14 -13
  24. package/lib/ui/gamification/question/insight/index.js +3 -4
  25. package/lib/ui/gamification/question/list/index.js +14 -14
  26. package/lib/ui/gamification/question/notification/index.js +3 -2
  27. package/lib/ui/gamification/question/notification/tweet/index.js +10 -7
  28. package/lib/ui/gamification/question/twitter/index.js +16 -33
  29. package/lib/ui/gamification/question/twitter/styles.d.ts +0 -1
  30. package/lib/ui/gamification/question/twitter/styles.js +7 -12
  31. package/lib/ui/gamification/vote/insight-details/index.js +5 -6
  32. package/lib/ui/gamification/vote/twitter-details/index.js +13 -29
  33. package/lib/ui/gamification/vote/twitter-details/styles.d.ts +0 -1
  34. package/lib/ui/gamification/vote/twitter-details/styles.js +3 -8
  35. package/lib/ui/modal/index.d.ts +9 -0
  36. package/lib/ui/modal/index.js +34 -0
  37. package/lib/ui/navigation/button/FeaturedGroups.d.ts +3 -1
  38. package/lib/ui/navigation/button/FeaturedGroups.js +11 -11
  39. package/lib/ui/questions/insight/index.d.ts +1 -2
  40. package/lib/ui/questions/insight/index.js +13 -29
  41. package/lib/ui/questions/insight/styles.d.ts +0 -1
  42. package/lib/ui/questions/insight/styles.js +9 -14
  43. package/lib/ui/questions/twitter/account/index.d.ts +2 -1
  44. package/lib/ui/questions/twitter/account/index.js +24 -18
  45. package/lib/ui/questions/twitter/account/styles.d.ts +1 -1
  46. package/lib/ui/questions/twitter/account/styles.js +2 -2
  47. package/lib/ui/questions/twitter/index.d.ts +2 -2
  48. package/lib/ui/questions/twitter/index.js +31 -9
  49. package/lib/ui/questions/twitter/styles.d.ts +1 -0
  50. package/lib/ui/questions/twitter/styles.js +8 -3
  51. package/lib/utils/common.js +22 -8
  52. package/package.json +14 -14
@@ -1,31 +1,30 @@
1
- import { jsx as o, jsxs as N, Fragment as T } from "react/jsx-runtime";
2
- import { useStore as y } from "@nanostores/react";
3
- import { useState as S, useMemo as k, useEffect as I, useRef as b, useCallback as O } from "react";
4
- import { r as v } from "../../../useClipboardCopy-E5rEe6It.js";
5
- import { NotificationType as g } from "@streamlayer/sdk-web-notifications";
6
- import { scrollIntoAppView as C } from "../useSdkScroll.js";
7
- import { QuestionTypeData as D } from "../../gamification/constants.js";
8
- import { Notification as R } from "../../gamification/question/notification/index.js";
9
- import { PredictionResult as E } from "../../gamification/question/notification/prediction-result/index.js";
10
- import { Onboarding as x } from "./Onboarding/index.js";
11
- import { Pill as B, HiddenContainer as H, Container as P, InnerContainer as q, NotificationRefreshing as A } from "./styles.js";
1
+ import { jsx as e, jsxs as k, Fragment as b } from "react/jsx-runtime";
2
+ import { useStore as a } from "@nanostores/react";
3
+ import { useState as w, useMemo as O, useEffect as I, useRef as x, useCallback as R } from "react";
4
+ import { r as P } from "../../../index-jRXrW6ie.js";
5
+ import { NotificationType as d } from "@streamlayer/sdk-web-notifications";
6
+ import { scrollIntoAppView as q } from "../useSdkScroll.js";
7
+ import { QuestionTypeData as A } from "../../gamification/constants.js";
8
+ import { Notification as T } from "../../gamification/question/notification/index.js";
9
+ import { PredictionResult as B } from "../../gamification/question/notification/prediction-result/index.js";
10
+ import { Onboarding as H } from "./Onboarding/index.js";
11
+ import { Pill as Q, HiddenContainer as j, Container as z, InnerContainer as F, NotificationRefreshing as G } from "./styles.js";
12
12
  import "../../../index-uEuzH3jr.js";
13
- import "../../gamification/copyNotification/index.js";
14
- import "../../icons/index.js";
15
- import "@linaria/react";
16
- import "../../gamification/copyNotification/styles.js";
17
13
  import "lodash.throttle";
18
14
  import "../../theme/constants.js";
19
15
  import "../../../index-keh7OLCY.js";
20
16
  import "@streamlayer/sdk-web-types";
21
17
  import "../../gamification/question/notification/insight/index.js";
22
18
  import "../../video-player/index.js";
19
+ import "../../icons/index.js";
20
+ import "@linaria/react";
23
21
  import "../../video-player/styles.js";
24
22
  import "../../gamification/question/notification/insight/styles.js";
25
23
  import "../../gamification/question/notification/styles.js";
26
24
  import "../../gamification/question/notification/tweet/index.js";
27
25
  import "../../questions/twitter/index.js";
28
26
  import "../../questions/twitter/account/index.js";
27
+ import "../../../utils/common.js";
29
28
  import "../../questions/twitter/account/styles.js";
30
29
  import "../../questions/twitter/styles.js";
31
30
  import "../../gamification/question/notification/tweet/styles.js";
@@ -44,6 +43,9 @@ import "../../skeleton/styles.js";
44
43
  import "../../gamification/onboarding/slides/onboarding-instructions/index.js";
45
44
  import "../../gamification/onboarding/slides/onboarding-instructions/styles.js";
46
45
  import "../../gamification/onboarding/slides/onboarding-invite-card/index.js";
46
+ import "../useClipboardCopy.js";
47
+ import "../../gamification/copyNotification/index.js";
48
+ import "../../gamification/copyNotification/styles.js";
47
49
  import "../../gamification/onboarding/slides/onboarding-invite-card/styles.js";
48
50
  import "../../gamification/onboarding/slides/onboarding-rules/index.js";
49
51
  import "../../gamification/onboarding/slides/onboarding-rules/styles.js";
@@ -52,129 +54,129 @@ import "../../gamification/onboarding/slides/onboarding-terms/styles.js";
52
54
  import "../../gamification/onboarding/styles.js";
53
55
  import "../../button/index.js";
54
56
  import "../../button/styles.js";
57
+ import "../../modal/index.js";
55
58
  import "./Onboarding/Notification/index.js";
56
59
  import "./Onboarding/Notification/styles.js";
57
60
  import "../../gamification/question/notification/pill/index.js";
58
61
  import "../../gamification/question/notification/pill/styles.js";
59
- const Q = (n) => {
60
- const [t, m] = S(0), i = b(null), l = O((r) => {
61
- i.current = r;
62
+ const S = (s) => {
63
+ const [t, p] = w(0), i = x(null), m = R((o) => {
64
+ i.current = o;
62
65
  }, []);
63
66
  I(() => {
64
- var e;
65
- const r = (e = i.current) == null ? void 0 : e.getBoundingClientRect();
66
- r && m(r.height);
67
- }, [n]);
68
- const c = O((r) => {
69
- m(r);
67
+ var r;
68
+ const o = (r = i.current) == null ? void 0 : r.getBoundingClientRect();
69
+ o && p(o.height);
70
+ }, [s]);
71
+ const n = R((o) => {
72
+ p(o);
70
73
  }, []);
71
- return [l, t, c];
72
- }, j = ({
73
- sdk: n,
74
+ return [m, t, n];
75
+ }, U = ({
76
+ sdk: s,
74
77
  notification: t,
75
- appNode: m,
76
- headerNode: i,
77
- sdkInScrollView: l
78
+ appNode: p,
79
+ sdkInDesktopView: i
78
80
  }) => {
79
- var u, p;
80
- const [c, r, e] = Q(t.id);
81
- if (t.type === g.QUESTION)
82
- return /* @__PURE__ */ N(T, {
83
- children: [/* @__PURE__ */ o(H, {
84
- ref: c,
85
- children: /* @__PURE__ */ o(R, {
86
- ...t
87
- })
88
- }), /* @__PURE__ */ N(P, {
89
- style: {
90
- height: t.hiding ? 0 : r
91
- },
92
- hiding: t.hiding,
93
- children: [/* @__PURE__ */ o(q, {
94
- style: {
95
- height: "100%"
96
- },
97
- children: /* @__PURE__ */ o(R, {
98
- ...t
99
- })
100
- }), /* @__PURE__ */ o(A, {}, t.id)]
101
- })]
102
- });
103
- if (t.type === g.QUESTION_RESOLVED && ((p = (u = t.data) == null ? void 0 : u.question) != null && p.predictionResult))
104
- return /* @__PURE__ */ o(E, {
81
+ var r, c;
82
+ const [m, n, o] = S(t.id);
83
+ return t.type === d.QUESTION ? /* @__PURE__ */ k(b, {
84
+ children: [/* @__PURE__ */ e(j, {
85
+ ref: m,
86
+ children: /* @__PURE__ */ e(T, {
87
+ ...t
88
+ })
89
+ }), /* @__PURE__ */ k(z, {
105
90
  style: {
106
- height: t.hiding ? 0 : r
91
+ height: t.hiding ? 0 : n
107
92
  },
108
- saveHeight: e,
109
- close: t.close,
110
93
  hiding: t.hiding,
111
- ...t.data.question
112
- });
113
- if (t.type === g.ONBOARDING) {
114
- const s = l ? m : i;
115
- return /* @__PURE__ */ o(x, {
116
- style: {
117
- height: t.hiding ? 0 : r
118
- },
119
- saveHeight: e,
120
- sdk: n,
121
- notification: t,
122
- renderToNode: s
123
- });
124
- }
125
- return null;
126
- }, Kt = ({
127
- sdk: n,
94
+ children: [/* @__PURE__ */ e(F, {
95
+ style: {
96
+ height: "100%"
97
+ },
98
+ children: /* @__PURE__ */ e(T, {
99
+ ...t
100
+ })
101
+ }), /* @__PURE__ */ e(G, {}, t.id)]
102
+ })]
103
+ }) : t.type === d.QUESTION_RESOLVED && ((c = (r = t.data) == null ? void 0 : r.question) != null && c.predictionResult) ? /* @__PURE__ */ e(B, {
104
+ style: {
105
+ height: t.hiding ? 0 : n
106
+ },
107
+ saveHeight: o,
108
+ close: t.close,
109
+ hiding: t.hiding,
110
+ ...t.data.question
111
+ }) : t.type === d.ONBOARDING ? /* @__PURE__ */ e(H, {
112
+ style: {
113
+ height: t.hiding ? 0 : n
114
+ },
115
+ saveHeight: o,
116
+ sdk: s,
117
+ notification: t,
118
+ sdkInDesktopView: i,
119
+ appNode: p
120
+ }) : null;
121
+ }, Wt = ({
122
+ sdk: s,
128
123
  headerNode: t,
129
- responsiveStore: m,
130
- appNode: i,
131
- scrollStore: l
124
+ scrollNode: p,
125
+ responsiveStore: i,
126
+ appNode: m,
127
+ scrollStore: n
132
128
  }) => {
133
- const [c] = S(n.getNotificationsStore()), r = y(c), {
134
- tabsShown: e
135
- } = y(l, {
129
+ const [o] = w(s.getNotificationsStore()), r = a(o), {
130
+ tabsShown: c
131
+ } = a(n, {
136
132
  keys: ["tabsShown"]
137
133
  }), {
138
- sdkInView: u,
139
- sdkInScrollView: p
140
- } = y(m, {
141
- keys: ["sdkInView", "sdkInScrollView"]
142
- }), [s, f] = S(null), h = k(() => {
134
+ sdkInView: y,
135
+ sdkInDesktopView: C
136
+ } = a(i, {
137
+ keys: ["sdkInView", "sdkInDesktopView"]
138
+ }), [u, h] = w(null), l = O(() => {
143
139
  if (!(r != null && r.size))
144
140
  return null;
145
- for (const d of r.values())
146
- if (d.type === g.ONBOARDING)
147
- return d;
141
+ for (const f of r.values())
142
+ if (f.type === d.ONBOARDING)
143
+ return f;
148
144
  return r.values().next().value;
149
145
  }, [r]);
150
146
  I(() => {
151
- h && m.get().sdkInView && f(h);
152
- }, [h]), I(() => {
153
- u || f(null);
154
- }, [u]);
155
- const V = k(() => {
156
- var d, w;
157
- const a = p ? i : t;
158
- return s && a.current && v.createPortal(/* @__PURE__ */ o(B, {
159
- title: `New ${((w = D[(d = s.data) == null ? void 0 : d.questionType]) == null ? void 0 : w.label) || "notification"}`,
147
+ l && (i.get().sdkInDesktopView || i.get().sdkInView) && (!i.get().sdkInDesktopView && i.get().sdkInView && h(l), i.get().sdkInDesktopView && window.requestAnimationFrame(() => {
148
+ n.get().scrollPosition !== 0 && h(l);
149
+ }));
150
+ }, [l]), I(() => {
151
+ y || h(null);
152
+ }, [y]);
153
+ const E = O(() => {
154
+ var D, V;
155
+ const g = i.get().sdkInDesktopView ? m : t;
156
+ return u && g.current && P.createPortal(/* @__PURE__ */ e(Q, {
157
+ title: `New ${((V = A[(D = u.data) == null ? void 0 : D.questionType]) == null ? void 0 : V.label) || "notification"}`,
160
158
  onClick: () => {
161
- C(i, {
159
+ var N;
160
+ i.get().sdkInDesktopView ? (N = p.current) == null || N.scrollTo({
161
+ top: 0,
162
+ behavior: "smooth"
163
+ }) : q(m, {
162
164
  behavior: "smooth"
163
- }), f(null);
165
+ }), h(null);
164
166
  },
165
- className: e ? "c1d7yse1" : void 0
166
- }), a.current) || null;
167
- }, [s, p, i, t, e]);
168
- return /* @__PURE__ */ N(T, {
169
- children: [!s && h && /* @__PURE__ */ o(j, {
170
- sdkInScrollView: p,
167
+ className: c ? "c1d7yse1" : void 0
168
+ }), g.current) || null;
169
+ }, [u, m, t, p, c, i]);
170
+ return /* @__PURE__ */ k(b, {
171
+ children: [!u && l && /* @__PURE__ */ e(U, {
172
+ sdkInDesktopView: C,
171
173
  headerNode: t,
172
- appNode: i,
173
- sdk: n,
174
- notification: h
175
- }), V]
174
+ appNode: m,
175
+ sdk: s,
176
+ notification: l
177
+ }), E]
176
178
  });
177
179
  };
178
180
  export {
179
- Kt as SDKNotifications
181
+ Wt as SDKNotifications
180
182
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as c, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
2
  import { useRef as f, useEffect as N } from "react";
3
3
  import { resetCss as u } from "../theme/theme.js";
4
4
  import { ActiveFeature as A } from "./Features/index.js";
@@ -24,10 +24,8 @@ import "../navigation/index.js";
24
24
  import "../icons/index.js";
25
25
  import "../navigation/button/index.js";
26
26
  import "../navigation/button/styles.js";
27
- import "../../useClipboardCopy-E5rEe6It.js";
27
+ import "../../index-jRXrW6ie.js";
28
28
  import "../../index-uEuzH3jr.js";
29
- import "../gamification/copyNotification/index.js";
30
- import "../gamification/copyNotification/styles.js";
31
29
  import "@streamlayer/sdk-web-notifications";
32
30
  import "../gamification/constants.js";
33
31
  import "../gamification/question/notification/index.js";
@@ -39,6 +37,7 @@ import "../gamification/question/notification/styles.js";
39
37
  import "../gamification/question/notification/tweet/index.js";
40
38
  import "../questions/twitter/index.js";
41
39
  import "../questions/twitter/account/index.js";
40
+ import "../../utils/common.js";
42
41
  import "../questions/twitter/account/styles.js";
43
42
  import "../questions/twitter/styles.js";
44
43
  import "../gamification/question/notification/tweet/styles.js";
@@ -59,6 +58,9 @@ import "../skeleton/styles.js";
59
58
  import "../gamification/onboarding/slides/onboarding-instructions/index.js";
60
59
  import "../gamification/onboarding/slides/onboarding-instructions/styles.js";
61
60
  import "../gamification/onboarding/slides/onboarding-invite-card/index.js";
61
+ import "./useClipboardCopy.js";
62
+ import "../gamification/copyNotification/index.js";
63
+ import "../gamification/copyNotification/styles.js";
62
64
  import "../gamification/onboarding/slides/onboarding-invite-card/styles.js";
63
65
  import "../gamification/onboarding/slides/onboarding-rules/index.js";
64
66
  import "../gamification/onboarding/slides/onboarding-rules/styles.js";
@@ -67,6 +69,7 @@ import "../gamification/onboarding/slides/onboarding-terms/styles.js";
67
69
  import "../gamification/onboarding/styles.js";
68
70
  import "../button/index.js";
69
71
  import "../button/styles.js";
72
+ import "../modal/index.js";
70
73
  import "./Notifications/Onboarding/Notification/index.js";
71
74
  import "./Notifications/Onboarding/Notification/styles.js";
72
75
  import "./Notifications/styles.js";
@@ -74,66 +77,67 @@ import "../gamification/question/notification/pill/index.js";
74
77
  import "../gamification/question/notification/pill/styles.js";
75
78
  import "lodash.throttle";
76
79
  import "../../index-keh7OLCY.js";
77
- const M = ({ sdk: r, className: s, scrollStore: n, appNode: t, scrollNode: i, headerNode: m, responsiveStore: p }) => {
78
- const [, a] = j(r);
79
- return /* @__PURE__ */ o(
80
+ const M = ({ sdk: o, className: s, scrollStore: a, appNode: t, scrollNode: m, headerNode: r, responsiveStore: p }) => {
81
+ const [, n] = j(o);
82
+ return /* @__PURE__ */ i(
80
83
  A,
81
84
  {
82
85
  className: s,
83
- scrollNode: i,
86
+ scrollNode: m,
84
87
  appNode: t,
85
- scrollStore: n,
86
- feature: a,
87
- headerNode: m,
88
+ scrollStore: a,
89
+ feature: n,
90
+ headerNode: r,
88
91
  responsiveStore: p,
89
- sdk: r
92
+ sdk: o
90
93
  }
91
94
  );
92
- }, or = ({ sdk: r, overlays: s, children: n }) => {
93
- const t = f(null), i = f(null), [m] = k(t), [p, a] = D(t, m), { sdkEnabled: d, sdkReady: l, activeOverlay: e, activateAndLoadOverlay: v, activateEventWithId: S, deactivate: h, isLogged: g } = F(r);
95
+ }, po = ({ sdk: o, overlays: s, children: a }) => {
96
+ const t = f(null), m = f(null), [r] = k(t), [p, n] = D(t, r), { sdkEnabled: d, sdkReady: l, activeOverlay: e, activateAndLoadOverlay: v, activateEventWithId: S, deactivate: h, isLogged: g } = F(o);
94
97
  return N(() => {
95
98
  import("./Features/Gamification/gamification-feature.js");
96
99
  }, []), /* @__PURE__ */ c(x, { ref: t, children: [
97
- d && /* @__PURE__ */ o(
100
+ d && /* @__PURE__ */ i(
98
101
  C,
99
102
  {
100
- ref: i,
103
+ ref: m,
101
104
  sdkReady: l,
102
105
  activeOverlay: e,
103
106
  className: u,
104
- setActiveOverlay: (y) => v("", y)
107
+ setActiveOverlay: (y) => v("", y),
108
+ responsiveStore: r
105
109
  }
106
110
  ),
107
- /* @__PURE__ */ c(B, { ref: p, "data-nav": d.toString(), children: [
108
- l && /* @__PURE__ */ o(
111
+ /* @__PURE__ */ c(B, { className: "sl-hide-on-modal", ref: p, "data-nav": d.toString(), children: [
112
+ l && /* @__PURE__ */ i(
109
113
  I,
110
114
  {
111
- sdk: r,
115
+ sdk: o,
112
116
  scrollNode: p,
113
- headerNode: i,
117
+ headerNode: m,
114
118
  appNode: t,
115
- scrollStore: a,
116
- responsiveStore: m
119
+ scrollStore: n,
120
+ responsiveStore: r
117
121
  }
118
122
  ),
119
- /* @__PURE__ */ o("div", { style: !d || e === E ? {} : { display: "none" }, children: n && n({ activateEventWithId: S, deactivate: h }) }),
123
+ /* @__PURE__ */ i("div", { style: !d || e === E ? {} : { display: "none" }, children: a && a({ activateEventWithId: S, deactivate: h }) }),
120
124
  s && e === K && s[e],
121
- l && e === L && /* @__PURE__ */ o(
125
+ l && e === L && /* @__PURE__ */ i(
122
126
  M,
123
127
  {
124
- scrollStore: a,
125
- responsiveStore: m,
128
+ scrollStore: n,
129
+ responsiveStore: r,
126
130
  scrollNode: p,
127
131
  appNode: t,
128
- headerNode: i,
132
+ headerNode: m,
129
133
  className: u,
130
- sdk: r
134
+ sdk: o
131
135
  }
132
136
  )
133
137
  ] }),
134
- d && !g && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "You are not logged in." })
138
+ d && !g && /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "You are not logged in." })
135
139
  ] });
136
140
  };
137
141
  export {
138
- or as MastersApp
142
+ po as MastersApp
139
143
  };
@@ -1,11 +1,32 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { u } from "../../useClipboardCopy-E5rEe6It.js";
4
- import "../gamification/copyNotification/index.js";
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useRef as p, useState as m, useCallback as l, useEffect as s } from "react";
3
+ import { r as f } from "../../index-jRXrW6ie.js";
4
+ import { CopyNotification as b } from "../gamification/copyNotification/index.js";
5
5
  import "../../index-uEuzH3jr.js";
6
6
  import "../icons/index.js";
7
7
  import "@linaria/react";
8
8
  import "../gamification/copyNotification/styles.js";
9
+ const h = (r) => {
10
+ const t = p(), [c, o] = m(null), a = l(
11
+ async (i) => {
12
+ var e;
13
+ if (i && ((e = navigator == null ? void 0 : navigator.clipboard) != null && e.writeText)) {
14
+ t.current && (clearTimeout(t.current), o(null));
15
+ try {
16
+ await navigator.clipboard.writeText(i), r.current && (o(f.createPortal(/* @__PURE__ */ u(b, {}), r.current)), t.current = setTimeout(() => {
17
+ o(null);
18
+ }, 1e3));
19
+ } catch (n) {
20
+ console.error("Unable to copy to clipboard", n);
21
+ }
22
+ }
23
+ },
24
+ [r]
25
+ );
26
+ return s(() => () => {
27
+ clearTimeout(t.current);
28
+ }, []), [a, c];
29
+ };
9
30
  export {
10
- u as useClipboardCopy
31
+ h as useClipboardCopy
11
32
  };
@@ -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
- import { useState as m, useEffect as k } from "react";
3
- import { BREAKPOINTS as s } from "../theme/constants.js";
4
- import { m as u } from "../../index-keh7OLCY.js";
2
+ import { useState as m, useEffect as u } from "react";
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
- }, w = (n) => {
20
+ }, w = (t) => {
21
21
  var e;
22
- return (((e = n.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
23
- }, l = (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 u({
25
+ const n = i();
26
+ return p({
27
27
  screen: i(),
28
- sdkInView: w(n),
29
- sdkInScrollView: l(t.size)
28
+ sdkInView: w(t),
29
+ sdkInDesktopView: k(n.size)
30
30
  });
31
31
  });
32
- return k(() => {
33
- const t = c(() => {
34
- e.setKey("sdkInView", w(n));
35
- }, 200), r = c(() => {
32
+ return u(() => {
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", l(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), () => {
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