@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.
- package/lib/assets/style.css +1 -1
- package/lib/{useClipboardCopy-E5rEe6It.js → index-jRXrW6ie.js} +1513 -1537
- 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 +39 -40
- package/lib/ui/app/Features/Gamification/gamification-feature.js +12 -10
- package/lib/ui/app/Features/Gamification/index.js +73 -89
- package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +2 -0
- package/lib/ui/app/Navigation/MastersNavigation/index.js +40 -34
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
- package/lib/ui/app/Notifications/Onboarding/index.js +96 -79
- package/lib/ui/app/Notifications/index.js +114 -112
- package/lib/ui/app/masters.js +35 -31
- package/lib/ui/app/useClipboardCopy.js +26 -5
- package/lib/ui/app/useMastersApp.js +42 -35
- package/lib/ui/app/useSdkResponsive.d.ts +1 -1
- package/lib/ui/app/useSdkResponsive.js +25 -25
- package/lib/ui/app/useSdkScroll.js +11 -10
- package/lib/ui/gamification/onboarding/index.d.ts +1 -1
- package/lib/ui/gamification/onboarding/index.js +11 -10
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +14 -13
- package/lib/ui/gamification/question/insight/index.js +3 -4
- 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/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/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/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/questions/insight/index.d.ts +1 -2
- package/lib/ui/questions/insight/index.js +13 -29
- 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/utils/common.js +22 -8
- package/package.json +14 -14
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { r as
|
|
5
|
-
import { NotificationType as
|
|
6
|
-
import { scrollIntoAppView as
|
|
7
|
-
import { QuestionTypeData as
|
|
8
|
-
import { Notification as
|
|
9
|
-
import { PredictionResult as
|
|
10
|
-
import { Onboarding as
|
|
11
|
-
import { Pill as
|
|
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
|
|
60
|
-
const [t,
|
|
61
|
-
i.current =
|
|
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
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
const
|
|
69
|
-
|
|
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 [
|
|
72
|
-
},
|
|
73
|
-
sdk:
|
|
74
|
+
return [m, t, n];
|
|
75
|
+
}, U = ({
|
|
76
|
+
sdk: s,
|
|
74
77
|
notification: t,
|
|
75
|
-
appNode:
|
|
76
|
-
|
|
77
|
-
sdkInScrollView: l
|
|
78
|
+
appNode: p,
|
|
79
|
+
sdkInDesktopView: i
|
|
78
80
|
}) => {
|
|
79
|
-
var
|
|
80
|
-
const [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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 :
|
|
91
|
+
height: t.hiding ? 0 : n
|
|
107
92
|
},
|
|
108
|
-
saveHeight: e,
|
|
109
|
-
close: t.close,
|
|
110
93
|
hiding: t.hiding,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
scrollNode: p,
|
|
125
|
+
responsiveStore: i,
|
|
126
|
+
appNode: m,
|
|
127
|
+
scrollStore: n
|
|
132
128
|
}) => {
|
|
133
|
-
const [
|
|
134
|
-
tabsShown:
|
|
135
|
-
} =
|
|
129
|
+
const [o] = w(s.getNotificationsStore()), r = a(o), {
|
|
130
|
+
tabsShown: c
|
|
131
|
+
} = a(n, {
|
|
136
132
|
keys: ["tabsShown"]
|
|
137
133
|
}), {
|
|
138
|
-
sdkInView:
|
|
139
|
-
|
|
140
|
-
} =
|
|
141
|
-
keys: ["sdkInView", "
|
|
142
|
-
}), [
|
|
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
|
|
146
|
-
if (
|
|
147
|
-
return
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}, [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
165
|
+
}), h(null);
|
|
164
166
|
},
|
|
165
|
-
className:
|
|
166
|
-
}),
|
|
167
|
-
}, [
|
|
168
|
-
return /* @__PURE__ */
|
|
169
|
-
children: [!
|
|
170
|
-
|
|
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:
|
|
173
|
-
sdk:
|
|
174
|
-
notification:
|
|
175
|
-
}),
|
|
174
|
+
appNode: m,
|
|
175
|
+
sdk: s,
|
|
176
|
+
notification: l
|
|
177
|
+
}), E]
|
|
176
178
|
});
|
|
177
179
|
};
|
|
178
180
|
export {
|
|
179
|
-
|
|
181
|
+
Wt as SDKNotifications
|
|
180
182
|
};
|
package/lib/ui/app/masters.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
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 "../../
|
|
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:
|
|
78
|
-
const [,
|
|
79
|
-
return /* @__PURE__ */
|
|
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:
|
|
86
|
+
scrollNode: m,
|
|
84
87
|
appNode: t,
|
|
85
|
-
scrollStore:
|
|
86
|
-
feature:
|
|
87
|
-
headerNode:
|
|
88
|
+
scrollStore: a,
|
|
89
|
+
feature: n,
|
|
90
|
+
headerNode: r,
|
|
88
91
|
responsiveStore: p,
|
|
89
|
-
sdk:
|
|
92
|
+
sdk: o
|
|
90
93
|
}
|
|
91
94
|
);
|
|
92
|
-
},
|
|
93
|
-
const t = f(null),
|
|
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__ */
|
|
100
|
+
d && /* @__PURE__ */ i(
|
|
98
101
|
C,
|
|
99
102
|
{
|
|
100
|
-
ref:
|
|
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__ */
|
|
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:
|
|
115
|
+
sdk: o,
|
|
112
116
|
scrollNode: p,
|
|
113
|
-
headerNode:
|
|
117
|
+
headerNode: m,
|
|
114
118
|
appNode: t,
|
|
115
|
-
scrollStore:
|
|
116
|
-
responsiveStore:
|
|
119
|
+
scrollStore: n,
|
|
120
|
+
responsiveStore: r
|
|
117
121
|
}
|
|
118
122
|
),
|
|
119
|
-
/* @__PURE__ */
|
|
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__ */
|
|
125
|
+
l && e === L && /* @__PURE__ */ i(
|
|
122
126
|
M,
|
|
123
127
|
{
|
|
124
|
-
scrollStore:
|
|
125
|
-
responsiveStore:
|
|
128
|
+
scrollStore: n,
|
|
129
|
+
responsiveStore: r,
|
|
126
130
|
scrollNode: p,
|
|
127
131
|
appNode: t,
|
|
128
|
-
headerNode:
|
|
132
|
+
headerNode: m,
|
|
129
133
|
className: u,
|
|
130
|
-
sdk:
|
|
134
|
+
sdk: o
|
|
131
135
|
}
|
|
132
136
|
)
|
|
133
137
|
] }),
|
|
134
|
-
d && !g && /* @__PURE__ */
|
|
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
|
-
|
|
142
|
+
po as MastersApp
|
|
139
143
|
};
|
|
@@ -1,11 +1,32 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import {
|
|
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
|
-
|
|
31
|
+
h as useClipboardCopy
|
|
11
32
|
};
|
|
@@ -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
|
-
import { useState as m, useEffect as
|
|
3
|
-
import { BREAKPOINTS as
|
|
4
|
-
import { m as
|
|
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(
|
|
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
|
-
}, w = (
|
|
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: w(
|
|
29
|
-
|
|
28
|
+
sdkInView: w(t),
|
|
29
|
+
sdkInDesktopView: k(n.size)
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
e.setKey("sdkInView", w(
|
|
35
|
-
}, 200),
|
|
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("
|
|
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
|