@streamlayer/react-ui 0.96.3 → 0.97.1
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/hooks/analytics.js +50 -0
- package/lib/index-z0QjLiEL.js +75 -0
- package/lib/ui/app/Features/Gamification/Friends.d.ts +0 -2
- package/lib/ui/app/Features/Gamification/Friends.js +16 -22
- package/lib/ui/app/Features/Gamification/Leaderboard.js +31 -25
- package/lib/ui/app/Features/Gamification/Question.js +4 -2
- package/lib/ui/app/Features/Gamification/QuestionsList.js +11 -8
- package/lib/ui/app/Features/Gamification/Tabs.js +30 -25
- package/lib/ui/app/Features/Gamification/UserSummary.js +14 -12
- package/lib/ui/app/Features/Gamification/gamification-feature.js +5 -1
- package/lib/ui/app/Features/Gamification/index.js +9 -5
- package/lib/ui/app/Features/index.js +24 -21
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -0
- package/lib/ui/app/Notifications/Onboarding/index.js +76 -78
- package/lib/ui/app/Notifications/index.js +98 -91
- package/lib/ui/app/Points/index.js +20 -17
- package/lib/ui/app/masters.js +76 -65
- package/lib/ui/app/useMastersApp.js +9 -9
- package/lib/ui/app/useSdkFeature.js +13 -16
- package/lib/ui/app/useSdkResponsive.js +1 -1
- package/lib/ui/app/useSdkScroll.d.ts +1 -1
- package/lib/ui/app/useSdkScroll.js +28 -25
- package/lib/ui/gamification/invite-link/index.js +26 -12
- package/lib/ui/gamification/onboarding/index.d.ts +0 -2
- package/lib/ui/gamification/onboarding/index.js +46 -46
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +2 -2
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -20
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +20 -15
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +0 -3
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +34 -29
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.d.ts +0 -3
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +17 -32
- package/lib/ui/gamification/points/index.d.ts +1 -0
- package/lib/ui/gamification/points/index.js +9 -9
- package/lib/ui/gamification/question/index.d.ts +1 -0
- package/lib/ui/gamification/question/index.js +31 -24
- package/lib/ui/gamification/question/insight/index.js +3 -2
- package/lib/ui/gamification/question/list/index.d.ts +3 -1
- package/lib/ui/gamification/question/list/index.js +22 -19
- package/lib/ui/gamification/question/notification/index.js +3 -2
- package/lib/ui/gamification/question/notification/insight/index.js +10 -9
- package/lib/ui/gamification/question/notification/tweet/index.js +3 -2
- package/lib/ui/gamification/question/styles.d.ts +2 -0
- package/lib/ui/gamification/question/styles.js +39 -28
- package/lib/ui/gamification/question/twitter/index.js +3 -2
- package/lib/ui/gamification/user-statistics/index.d.ts +3 -2
- package/lib/ui/gamification/user-statistics/index.js +48 -45
- package/lib/ui/gamification/vote/feedback/index.d.ts +3 -2
- package/lib/ui/gamification/vote/feedback/index.js +76 -63
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +31 -24
- package/lib/ui/gamification/vote/index.js +93 -89
- package/lib/ui/gamification/vote/insight-details/index.js +7 -6
- package/lib/ui/gamification/vote/twitter-details/index.js +3 -2
- package/lib/ui/gamification/vote/vote-option/index.d.ts +2 -1
- package/lib/ui/gamification/vote/vote-option/index.js +47 -39
- package/lib/ui/icons/index.d.ts +1 -2
- package/lib/ui/icons/index.js +44 -36
- package/lib/ui/modal/index.js +27 -21
- package/lib/ui/questions/insight/index.js +3 -2
- package/lib/ui/questions/twitter/index.js +3 -2
- package/lib/ui/show-in/index.d.ts +2 -0
- package/lib/ui/show-in/index.js +24 -14
- package/lib/ui/timer/index.js +32 -28
- package/lib/ui/video-player/index.js +41 -39
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +10 -9
- package/package.json +22 -21
- package/lib/index-keh7OLCY.js +0 -67
package/lib/ui/app/masters.js
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
1
|
+
import { jsx as m, jsxs as v } from "react/jsx-runtime";
|
|
2
2
|
import { useStore as C } from "@nanostores/react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import "../
|
|
3
|
+
import { useAnalyticsListener as d, newTabLinkListener as A, appScrollListener as F, appClickListener as x } from "../../hooks/analytics.js";
|
|
4
|
+
import { useRef as S, useEffect as b, useMemo as D } from "react";
|
|
5
|
+
import { resetCss as f } from "../theme/theme.js";
|
|
6
|
+
import { ActiveFeature as I, StandaloneFeature as M } from "./Features/index.js";
|
|
7
|
+
import { MastersNavigation as B } from "./Navigation/MastersNavigation/index.js";
|
|
8
|
+
import { SDKNotifications as j } from "./Notifications/index.js";
|
|
9
|
+
import { SDKContainer as k, SDKScrollContainer as E } from "./styles.js";
|
|
10
|
+
import { useMastersApp as K } from "./useMastersApp.js";
|
|
11
|
+
import { MastersContext as O } from "./useMastersContext.js";
|
|
12
|
+
import { useSdkFeature as R } from "./useSdkFeature.js";
|
|
13
|
+
import { useSdkResponsive as T } from "./useSdkResponsive.js";
|
|
14
|
+
import { useSdkScroll as w } from "./useSdkScroll.js";
|
|
15
|
+
import { ChannelsButtonId as G } from "../navigation/button/Channels.js";
|
|
16
|
+
import { LeaderBoardButtonId as P } from "../navigation/button/LeaderBoard.js";
|
|
17
|
+
import { FeaturedGroupsButtonId as V } from "../navigation/button/FeaturedGroups.js";
|
|
18
|
+
import "lodash.throttle";
|
|
19
|
+
import "@streamlayer/sdk-web-interfaces";
|
|
18
20
|
import "../theme/constants.js";
|
|
21
|
+
import "../theme/breakpoints.js";
|
|
19
22
|
import "@streamlayer/sdk-web-types";
|
|
20
23
|
import "./Features/FeatureProvider.js";
|
|
21
24
|
import "@linaria/react";
|
|
22
|
-
import "@streamlayer/sdk-web-interfaces";
|
|
23
25
|
import "./Features/Gamification/index.js";
|
|
24
26
|
import "../gamification/detail/header/index.js";
|
|
25
27
|
import "../gamification/constants.js";
|
|
26
28
|
import "../gamification/detail/header/styles.js";
|
|
27
29
|
import "../icons/index.js";
|
|
28
30
|
import "../gamification/user-statistics/index.js";
|
|
31
|
+
import "../skeleton/index.js";
|
|
32
|
+
import "../skeleton/styles.js";
|
|
29
33
|
import "../../utils/common.js";
|
|
30
34
|
import "../gamification/user-statistics/components/rank/index.js";
|
|
31
35
|
import "../gamification/user-statistics/components/rank/styles.js";
|
|
@@ -115,8 +119,6 @@ import "../gamification/question/notification/prediction-result/styles.js";
|
|
|
115
119
|
import "./Notifications/Onboarding/index.js";
|
|
116
120
|
import "./useImagesPreload.js";
|
|
117
121
|
import "../gamification/onboarding/index.js";
|
|
118
|
-
import "../skeleton/index.js";
|
|
119
|
-
import "../skeleton/styles.js";
|
|
120
122
|
import "../gamification/onboarding/slides/onboarding-instructions/index.js";
|
|
121
123
|
import "../gamification/onboarding/invitingUser/index.js";
|
|
122
124
|
import "../gamification/onboarding/invitingUser/styles.js";
|
|
@@ -131,90 +133,99 @@ import "./Notifications/Onboarding/Notification/styles.js";
|
|
|
131
133
|
import "./Notifications/styles.js";
|
|
132
134
|
import "../gamification/question/notification/pill/index.js";
|
|
133
135
|
import "../gamification/question/notification/pill/styles.js";
|
|
134
|
-
import "
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
const [, s] = K(t);
|
|
136
|
+
import "../../index-z0QjLiEL.js";
|
|
137
|
+
const W = ({ sdk: t, className: n, scrollStore: s, appNode: r, scrollNode: p, headerNode: i, responsiveStore: o }) => {
|
|
138
|
+
const [, l] = R(t);
|
|
138
139
|
return /* @__PURE__ */ m(
|
|
139
|
-
|
|
140
|
+
I,
|
|
140
141
|
{
|
|
141
|
-
className:
|
|
142
|
+
className: n,
|
|
142
143
|
scrollNode: p,
|
|
143
144
|
appNode: r,
|
|
144
|
-
scrollStore:
|
|
145
|
-
feature:
|
|
146
|
-
headerNode:
|
|
147
|
-
responsiveStore:
|
|
145
|
+
scrollStore: s,
|
|
146
|
+
feature: l,
|
|
147
|
+
headerNode: i,
|
|
148
|
+
responsiveStore: o,
|
|
148
149
|
sdk: t
|
|
149
150
|
}
|
|
150
151
|
);
|
|
151
|
-
},
|
|
152
|
+
}, Y = ({ sdk: t, className: n, appNode: s, responsiveStore: r }) => {
|
|
152
153
|
const p = C(t.featuresList.getStore());
|
|
153
|
-
return p ? Array.from(p, (
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
|
|
154
|
+
return p ? Array.from(p, (i) => {
|
|
155
|
+
const o = t.getFeature(i);
|
|
156
|
+
return o ? /* @__PURE__ */ m(
|
|
157
|
+
M,
|
|
157
158
|
{
|
|
158
|
-
className:
|
|
159
|
-
appNode:
|
|
160
|
-
feature:
|
|
159
|
+
className: n,
|
|
160
|
+
appNode: s,
|
|
161
|
+
feature: o,
|
|
161
162
|
responsiveStore: r,
|
|
162
163
|
sdk: t
|
|
163
164
|
},
|
|
164
|
-
|
|
165
|
+
i
|
|
165
166
|
) : null;
|
|
166
167
|
}) : null;
|
|
167
|
-
},
|
|
168
|
-
const r =
|
|
169
|
-
|
|
168
|
+
}, go = ({ sdk: t, overlays: n, children: s }) => {
|
|
169
|
+
const r = S(null), p = S(null), [i] = T(r), [o, l] = w(r, i), { sdkEnabled: e, sdkReady: c, activeOverlay: a, activateAndLoadOverlay: h, activateEventWithId: N, deactivate: g, isLogged: y } = K(t);
|
|
170
|
+
d(r, { enabled: e, event: "click", listener: A }), d(o, {
|
|
171
|
+
enabled: e,
|
|
172
|
+
event: "scrollend",
|
|
173
|
+
listener: F,
|
|
174
|
+
useDomNode: !0
|
|
175
|
+
}), d(o, {
|
|
176
|
+
enabled: e,
|
|
177
|
+
event: "click",
|
|
178
|
+
listener: x,
|
|
179
|
+
useDomNode: !0
|
|
180
|
+
}), b(() => {
|
|
170
181
|
import("./Features/Gamification/gamification-feature.js");
|
|
171
182
|
}, []);
|
|
172
|
-
const
|
|
173
|
-
return /* @__PURE__ */ m(
|
|
174
|
-
|
|
175
|
-
|
|
183
|
+
const L = D(() => ({ sdk: t }), [t]);
|
|
184
|
+
return /* @__PURE__ */ m(O.Provider, { value: L, children: /* @__PURE__ */ v(k, { ref: r, children: [
|
|
185
|
+
e && /* @__PURE__ */ m(
|
|
186
|
+
B,
|
|
176
187
|
{
|
|
177
188
|
ref: p,
|
|
178
189
|
sdkReady: c,
|
|
179
190
|
activeOverlay: a,
|
|
180
|
-
className:
|
|
181
|
-
setActiveOverlay: (u) =>
|
|
191
|
+
className: f,
|
|
192
|
+
setActiveOverlay: (u) => h("", u),
|
|
182
193
|
scrollToTop: () => {
|
|
183
194
|
var u;
|
|
184
|
-
return (u =
|
|
195
|
+
return (u = o.current) == null ? void 0 : u.scrollTo(0, 0);
|
|
185
196
|
},
|
|
186
|
-
responsiveStore:
|
|
197
|
+
responsiveStore: i
|
|
187
198
|
}
|
|
188
199
|
),
|
|
189
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ v(E, { className: "sl-hide-on-modal", ref: o, "data-nav": e.toString(), children: [
|
|
190
201
|
c && /* @__PURE__ */ m(
|
|
191
|
-
|
|
202
|
+
j,
|
|
192
203
|
{
|
|
193
204
|
sdk: t,
|
|
194
|
-
scrollNode:
|
|
205
|
+
scrollNode: o,
|
|
195
206
|
headerNode: p,
|
|
196
207
|
appNode: r,
|
|
197
|
-
scrollStore:
|
|
198
|
-
responsiveStore:
|
|
208
|
+
scrollStore: l,
|
|
209
|
+
responsiveStore: i
|
|
199
210
|
}
|
|
200
211
|
),
|
|
201
|
-
/* @__PURE__ */ m("div", { style: !
|
|
202
|
-
|
|
203
|
-
c && a ===
|
|
204
|
-
|
|
212
|
+
/* @__PURE__ */ m("div", { style: !e || a === G ? {} : { display: "none" }, children: s && s({ activateEventWithId: N, deactivate: g }) }),
|
|
213
|
+
n && a === P && n[a],
|
|
214
|
+
c && a === V && /* @__PURE__ */ m(
|
|
215
|
+
W,
|
|
205
216
|
{
|
|
206
|
-
scrollStore:
|
|
207
|
-
responsiveStore:
|
|
208
|
-
scrollNode:
|
|
217
|
+
scrollStore: l,
|
|
218
|
+
responsiveStore: i,
|
|
219
|
+
scrollNode: o,
|
|
209
220
|
appNode: r,
|
|
210
221
|
headerNode: p,
|
|
211
|
-
className:
|
|
222
|
+
className: f,
|
|
212
223
|
sdk: t
|
|
213
224
|
}
|
|
214
225
|
),
|
|
215
|
-
c && /* @__PURE__ */ m(
|
|
226
|
+
c && /* @__PURE__ */ m(Y, { responsiveStore: i, appNode: r, className: f, sdk: t })
|
|
216
227
|
] }),
|
|
217
|
-
|
|
228
|
+
e && !y && /* @__PURE__ */ m(
|
|
218
229
|
"div",
|
|
219
230
|
{
|
|
220
231
|
style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" },
|
|
@@ -224,5 +235,5 @@ const G = ({ sdk: t, className: e, scrollStore: n, appNode: r, scrollNode: p, he
|
|
|
224
235
|
] }) });
|
|
225
236
|
};
|
|
226
237
|
export {
|
|
227
|
-
|
|
238
|
+
go as MastersApp
|
|
228
239
|
};
|
|
@@ -2,8 +2,8 @@ import { useStore as A } from "@nanostores/react";
|
|
|
2
2
|
import { useRef as y, useState as d, useCallback as z, useEffect as u } from "react";
|
|
3
3
|
import { FeatureType as v } from "@streamlayer/sdk-web-types";
|
|
4
4
|
import "./Navigation/MastersNavigation/index.js";
|
|
5
|
-
import { FeaturedGroupsButtonId as
|
|
6
|
-
import { ChannelsButtonId as
|
|
5
|
+
import { FeaturedGroupsButtonId as p } from "../navigation/button/FeaturedGroups.js";
|
|
6
|
+
import { ChannelsButtonId as i } from "../navigation/button/Channels.js";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
8
|
import "../navigation/button/LeaderBoard.js";
|
|
9
9
|
import "@linaria/react";
|
|
@@ -15,23 +15,23 @@ import "../navigation/masters.js";
|
|
|
15
15
|
import "../navigation/index.js";
|
|
16
16
|
import "../theme/constants.js";
|
|
17
17
|
const D = (e) => {
|
|
18
|
-
const c = y(""), [S, o] = d(!1), E = A(e.status), a = A(e.userId()), f = A(e.getActiveFeature()), n = E === "ready", [l, r] = d(
|
|
18
|
+
const c = y(""), [S, o] = d(!1), E = A(e.status), a = A(e.userId()), f = A(e.getActiveFeature()), n = E === "ready", [l, r] = d(p), m = z(
|
|
19
19
|
(t, s) => {
|
|
20
|
-
r(s),
|
|
20
|
+
r(s), t && e.createEventSession(t), s === p ? window.requestAnimationFrame(() => {
|
|
21
21
|
e.openFeature(v.GAMES);
|
|
22
|
-
})
|
|
22
|
+
}) : e.closeFeature(!1);
|
|
23
23
|
},
|
|
24
24
|
[e]
|
|
25
25
|
);
|
|
26
26
|
u(() => {
|
|
27
|
-
!n && l ===
|
|
27
|
+
!n && l === p && (r(i), e.closeFeature(!0));
|
|
28
28
|
}, [n, l, e]), u(() => {
|
|
29
|
-
f === v.GAMES ? r(
|
|
29
|
+
f === v.GAMES ? r(p) : f === v.UNSET && r(i);
|
|
30
30
|
}, [f]);
|
|
31
31
|
const F = (t) => {
|
|
32
32
|
c.current = t, o(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: s, err: g }) => {
|
|
33
33
|
if (g) {
|
|
34
|
-
m(t,
|
|
34
|
+
m(t, i);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
if (s) {
|
|
@@ -50,7 +50,7 @@ const D = (e) => {
|
|
|
50
50
|
};
|
|
51
51
|
return u(() => {
|
|
52
52
|
if (!a) {
|
|
53
|
-
n && (r(
|
|
53
|
+
n && (r(i), e.disableApp());
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
if (a && c.current && S) {
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import { useStore as
|
|
1
|
+
import { useStore as f } from "@nanostores/react";
|
|
2
2
|
import { useState as c, useEffect as l } from "react";
|
|
3
3
|
import { FeatureStatus as a } from "@streamlayer/sdk-web-interfaces";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const p = (t) => {
|
|
5
|
+
const r = f(t.getActiveFeature()), n = f(t.streamStore()), [i, u] = c(null);
|
|
6
6
|
return l(() => {
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
e.status.get() === a.Ready && e.disable();
|
|
14
|
-
f(null);
|
|
15
|
-
}
|
|
7
|
+
const o = t.getFeatures();
|
|
8
|
+
if (!r)
|
|
9
|
+
u(null);
|
|
10
|
+
else
|
|
11
|
+
for (const [s, e] of o)
|
|
12
|
+
s === r ? (e.status.get() === a.Suspended && e.enable(), u(e)) : e.status.get() === a.Ready && e.disable();
|
|
16
13
|
return () => {
|
|
17
|
-
for (const [,
|
|
18
|
-
|
|
14
|
+
for (const [, s] of o)
|
|
15
|
+
s.status.get() === a.Ready && s.disable();
|
|
19
16
|
};
|
|
20
|
-
}, [
|
|
17
|
+
}, [r, t, n]), [r, i];
|
|
21
18
|
};
|
|
22
19
|
export {
|
|
23
|
-
|
|
20
|
+
p as useSdkFeature
|
|
24
21
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import c from "lodash.throttle";
|
|
2
2
|
import { useState as m, useEffect as u } from "react";
|
|
3
3
|
import { BREAKPOINTS as r } from "../theme/constants.js";
|
|
4
|
-
import { m as p } from "../../index-
|
|
4
|
+
import { m as p } from "../../index-z0QjLiEL.js";
|
|
5
5
|
import "../../index-uEuzH3jr.js";
|
|
6
6
|
const d = Object.keys(r), i = () => {
|
|
7
7
|
const t = window.innerWidth;
|
|
@@ -7,6 +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
|
+
export declare const scrollIntoAppView: (appNode: AppNodeRef, screenSize: number, options?: ScrollIntoViewOptions) => void;
|
|
11
11
|
export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore) => [ScrollNodeRef, ScrollStore];
|
|
12
12
|
export {};
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
import { useStore as p } from "@nanostores/react";
|
|
2
2
|
import S from "lodash.throttle";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { BREAKPOINTS as
|
|
5
|
-
import { m as
|
|
3
|
+
import { useRef as m, useState as h, useEffect as g } from "react";
|
|
4
|
+
import { BREAKPOINTS as l } from "../theme/constants.js";
|
|
5
|
+
import { m as T } from "../../index-z0QjLiEL.js";
|
|
6
6
|
import "../../index-uEuzH3jr.js";
|
|
7
|
-
const C = (t,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const C = (o, t, e) => {
|
|
8
|
+
const n = t >= l.lg && t < l.xl ? 75 : 52;
|
|
9
|
+
o.current && window.scrollTo({
|
|
10
|
+
top: o.current.offsetTop - n,
|
|
11
|
+
...e
|
|
12
|
+
});
|
|
13
|
+
}, D = (o, t) => {
|
|
14
|
+
const e = m(null), n = m(0), [s] = h(
|
|
15
|
+
T({
|
|
13
16
|
scrollPosition: 0,
|
|
14
17
|
tabsShown: !0,
|
|
15
18
|
scrollDirection: "forward"
|
|
16
19
|
})
|
|
17
|
-
),
|
|
18
|
-
return
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
20
|
+
), i = p(t);
|
|
21
|
+
return g(() => {
|
|
22
|
+
const c = window.innerWidth < l.xl ? window : e.current;
|
|
23
|
+
if (!c)
|
|
21
24
|
return () => {
|
|
22
25
|
};
|
|
23
|
-
const
|
|
26
|
+
const u = S((w) => {
|
|
24
27
|
var a;
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
28
|
+
const f = w.target;
|
|
29
|
+
if (!f)
|
|
27
30
|
return;
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
const d =
|
|
31
|
-
|
|
32
|
-
scrollPosition: Math.round(
|
|
31
|
+
let r = 0;
|
|
32
|
+
i.screen.size < l.xl ? r = ((a = o.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : r = f.scrollTop;
|
|
33
|
+
const d = n.current < r ? "forward" : "backward";
|
|
34
|
+
n.current = r, s.set({
|
|
35
|
+
scrollPosition: Math.round(r),
|
|
33
36
|
scrollDirection: d,
|
|
34
|
-
tabsShown:
|
|
37
|
+
tabsShown: s.get().tabsShown
|
|
35
38
|
});
|
|
36
39
|
}, 200);
|
|
37
|
-
return
|
|
38
|
-
|
|
40
|
+
return c.addEventListener("scroll", u), () => {
|
|
41
|
+
c.removeEventListener("scroll", u);
|
|
39
42
|
};
|
|
40
|
-
}, [
|
|
43
|
+
}, [s, o, i.screen]), [e, s];
|
|
41
44
|
};
|
|
42
45
|
export {
|
|
43
46
|
C as scrollIntoAppView,
|
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as C, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useAnalyticsHandle as c } from "../../../hooks/analytics.js";
|
|
3
|
+
import { InvitationFrom as l } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { Container as m, FriendsIcon as s, Content as p, Title as a, Description as d, ArrowInviteIcon as h } from "./styles.js";
|
|
5
|
+
import "lodash.throttle";
|
|
6
|
+
import "react";
|
|
7
|
+
import "@streamlayer/sdk-web-interfaces";
|
|
8
|
+
import "../../theme/constants.js";
|
|
3
9
|
import "@linaria/react";
|
|
4
10
|
import "../../icons/index.js";
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const f = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M10.4615%2012.6875C9.44231%2012.6875%208.61538%2013.4665%208.61538%2014.4266C8.61538%2015.3868%209.44231%2016.1658%2010.4615%2016.1658C11.4808%2016.1658%2012.3077%2015.3868%2012.3077%2014.4266C12.3077%2013.4665%2011.4808%2012.6875%2010.4615%2012.6875ZM10.4615%2016.1658C9.10817%2016.1658%208%2017.2097%208%2018.4846V19.7527C8%2019.7527%208.61538%2020.2237%2010.4615%2020.2237C12.3077%2020.2237%2012.9231%2019.7527%2012.9231%2019.7527V18.4846C12.9231%2017.2097%2011.8149%2016.1658%2010.4615%2016.1658ZM21.5385%2012.6875C20.5192%2012.6875%2019.6923%2013.4665%2019.6923%2014.4266C19.6923%2015.3868%2020.5192%2016.1658%2021.5385%2016.1658C22.5577%2016.1658%2023.3846%2015.3868%2023.3846%2014.4266C23.3846%2013.4665%2022.5577%2012.6875%2021.5385%2012.6875ZM21.5385%2016.1658C20.1851%2016.1658%2019.0769%2017.2097%2019.0769%2018.4846V19.7527C19.0769%2019.7527%2019.6923%2020.2237%2021.5385%2020.2237C23.3846%2020.2237%2024%2019.7527%2024%2019.7527V18.4846C24%2017.2097%2022.8918%2016.1658%2021.5385%2016.1658ZM16%2015.0063C14.9808%2015.0063%2014.1538%2015.7853%2014.1538%2016.7455C14.1538%2017.7056%2014.9808%2018.4846%2016%2018.4846C17.0192%2018.4846%2017.8462%2017.7056%2017.8462%2016.7455C17.8462%2015.7853%2017.0192%2015.0063%2016%2015.0063ZM16%2018.4846C14.6466%2018.4846%2013.5385%2019.5285%2013.5385%2020.8034V22.0715C13.5385%2022.0715%2014.1538%2022.5425%2016%2022.5425C17.8462%2022.5425%2018.4615%2022.0715%2018.4615%2022.0715V20.8034C18.4615%2019.5285%2017.3534%2018.4846%2016%2018.4846Z'%20fill='%23107D57'/%3e%3cpath%20opacity='0.5'%20d='M13.3908%209C12.3103%209%2011.4336%209.82584%2011.4336%2010.8437C11.4336%2011.8616%2012.3103%2012.6875%2013.3908%2012.6875C14.4713%2012.6875%2015.348%2011.8616%2015.348%2010.8437C15.348%209.82584%2014.4713%209%2013.3908%209ZM13.3908%2012.6875C13.1946%2012.6875%2012.9958%2012.6827%2012.7996%2012.7451C13.192%2013.2372%2013.3908%2013.8542%2013.3908%2014.5312C13.3908%2014.7761%2013.3296%2015.0161%2013.3296%2015.261C13.8521%2014.524%2014.6956%2014.0391%2015.6742%2013.9166C15.218%2013.1796%2014.3694%2012.6875%2013.3908%2012.6875ZM18.61%209C17.5295%209%2016.6528%209.82584%2016.6528%2010.8437C16.6528%2011.8616%2017.5295%2012.6875%2018.61%2012.6875C19.6905%2012.6875%2020.5672%2011.8616%2020.5672%2010.8437C20.5672%209.82584%2019.6905%209%2018.61%209ZM18.61%2012.6875C17.6314%2012.6875%2016.7828%2013.1796%2016.3266%2013.9166C17.3052%2014.0391%2018.1487%2014.524%2018.6712%2015.261C18.6712%2015.0161%2018.61%2014.7761%2018.61%2014.5312C18.61%2013.8542%2018.8088%2013.2372%2019.2012%2012.7451C19.005%2012.6827%2018.8062%2012.6875%2018.61%2012.6875Z'%20fill='%23107D57'/%3e%3c/svg%3e", D = ({ title: t, description: n, onClick: o, className: r }) => {
|
|
12
|
+
const [e] = c({
|
|
13
|
+
type: "invitation",
|
|
14
|
+
action: "sent",
|
|
15
|
+
payload: {
|
|
16
|
+
from: l.TITLE_CARD
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ C(m, { onClick: e(o), className: r, children: [
|
|
20
|
+
/* @__PURE__ */ i(s, { alt: "friends-icon", src: f }),
|
|
21
|
+
/* @__PURE__ */ C(p, { children: [
|
|
22
|
+
/* @__PURE__ */ i(a, { children: t }),
|
|
23
|
+
/* @__PURE__ */ i(d, { children: n })
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ i(h, { name: "icon-copy" })
|
|
26
|
+
] });
|
|
27
|
+
};
|
|
14
28
|
export {
|
|
15
|
-
|
|
29
|
+
D as InviteLink
|
|
16
30
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Gamification } from '@streamlayer/feature-gamification';
|
|
3
3
|
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
4
|
-
import { HeaderNodeRef, type AppNodeRef } from '../../app/masters';
|
|
5
4
|
import { OnboardingStep } from './slides/onboarding-instructions';
|
|
6
5
|
import { OnboardingInviteCardProps } from './slides/onboarding-invite-card';
|
|
7
6
|
import { OnboardingRule } from './slides/onboarding-rules';
|
|
@@ -17,7 +16,6 @@ type OnboardingType = OnboardingInviteCardProps & {
|
|
|
17
16
|
primaryColor?: string;
|
|
18
17
|
inviteCardBtnLabel?: string;
|
|
19
18
|
loading: boolean;
|
|
20
|
-
renderToNode?: AppNodeRef | HeaderNodeRef;
|
|
21
19
|
inviterName?: string;
|
|
22
20
|
onClose: () => void;
|
|
23
21
|
};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { Skeleton as
|
|
5
|
-
import { OnboardingInstructions as
|
|
6
|
-
import { OnboardingInviteCard as
|
|
7
|
-
import { OnboardingRules as
|
|
8
|
-
import { OnboardingTerms as
|
|
9
|
-
import { Container as
|
|
2
|
+
import { useState as p, useEffect as s, useMemo as N, useCallback as z } from "react";
|
|
3
|
+
import E from "react-virtualized-auto-sizer";
|
|
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 U, OnboardingHeader as q, CloseBtn as J, IconClose as K, Content as Q, OnboardingFooter as V, OnboardingActionBtn as W } from "./styles.js";
|
|
10
10
|
import "../../skeleton/styles.js";
|
|
11
11
|
import "@linaria/react";
|
|
12
12
|
import "./invitingUser/index.js";
|
|
13
13
|
import "../../../utils/common.js";
|
|
14
14
|
import "./invitingUser/styles.js";
|
|
15
15
|
import "./slides/onboarding-instructions/styles.js";
|
|
16
|
+
import "../../../hooks/analytics.js";
|
|
17
|
+
import "lodash.throttle";
|
|
18
|
+
import "@streamlayer/sdk-web-interfaces";
|
|
19
|
+
import "../../theme/constants.js";
|
|
20
|
+
import "@streamlayer/sdk-web-types";
|
|
16
21
|
import "../../app/useClipboardCopy.js";
|
|
17
22
|
import "../../../index-jRXrW6ie.js";
|
|
18
23
|
import "../../../index-uEuzH3jr.js";
|
|
@@ -24,80 +29,75 @@ import "./slides/onboarding-rules/styles.js";
|
|
|
24
29
|
import "./slides/onboarding-terms/styles.js";
|
|
25
30
|
import "../../button/index.js";
|
|
26
31
|
import "../../button/styles.js";
|
|
27
|
-
const
|
|
32
|
+
const e = {
|
|
28
33
|
steps: !1,
|
|
29
34
|
rules: !1,
|
|
30
35
|
inviteCard: !1
|
|
31
|
-
},
|
|
36
|
+
}, Ti = ({
|
|
32
37
|
gamification: v,
|
|
33
38
|
steps: i,
|
|
34
|
-
rules:
|
|
39
|
+
rules: o,
|
|
35
40
|
rulesBtnLabel: d,
|
|
36
41
|
rulesTitle: I,
|
|
37
42
|
termsTitle: T,
|
|
38
|
-
termsText:
|
|
43
|
+
termsText: h,
|
|
39
44
|
primaryColor: u,
|
|
40
45
|
inviteLink: x,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
inviteCardSubtext: w,
|
|
46
|
+
inviteCardTitle: D,
|
|
47
|
+
inviteCardSubtext: k,
|
|
44
48
|
inviteCardBtnLabel: g,
|
|
45
49
|
loading: a,
|
|
46
|
-
renderToNode: A,
|
|
47
50
|
inviterName: c,
|
|
48
51
|
sdk: b,
|
|
49
|
-
onClose:
|
|
52
|
+
onClose: w
|
|
50
53
|
}) => {
|
|
51
|
-
const [
|
|
54
|
+
const [m, C] = p(0), [l, O] = p(!1), [r, n] = p(e);
|
|
52
55
|
s(() => {
|
|
53
|
-
i != null && i.length ?
|
|
56
|
+
i != null && i.length ? n({ ...e, steps: !0 }) : o != null && o.length ? n({ ...e, rules: !0 }) : n({ ...e, inviteCard: !0 });
|
|
54
57
|
}, []);
|
|
55
|
-
const
|
|
56
|
-
i != null && i.length &&
|
|
57
|
-
}, [
|
|
58
|
-
|
|
58
|
+
const A = N(() => r.steps && m === 0 ? "Continue" : r.rules ? l || !d ? "Got it" : d : r.inviteCard ? g || "Play Now" : "Next", [r, m, l, d, g]), j = z(() => {
|
|
59
|
+
i != null && i.length && m < i.length - 1 ? C((f) => ++f) : o != null && o.length && r.steps ? n({ ...e, rules: !0 }) : r.rules && n({ ...e, inviteCard: !0 });
|
|
60
|
+
}, [m, i == null ? void 0 : i.length, o == null ? void 0 : o.length, r, C, n]), H = async () => {
|
|
61
|
+
r.inviteCard ? await v.onboardingStatus.submitInplay() : r.rules && l ? O(!1) : j();
|
|
59
62
|
};
|
|
60
63
|
return s(() => {
|
|
61
64
|
!a && c && b.inviteDisplayed();
|
|
62
|
-
}, [a, c, b]), /* @__PURE__ */ t(
|
|
63
|
-
/* @__PURE__ */ t(
|
|
64
|
-
/* @__PURE__ */ y(
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
}, [a, c, b]), /* @__PURE__ */ t(E, { children: ({ width: f, height: S }) => /* @__PURE__ */ y(U, { style: { width: f, height: S, maxHeight: S }, children: [
|
|
66
|
+
/* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(J, { onClick: w, children: /* @__PURE__ */ t(K, { name: "icon-close-btn-gray" }) }) }),
|
|
67
|
+
/* @__PURE__ */ y(Q, { children: [
|
|
68
|
+
r.steps && (i == null ? void 0 : i.length) && /* @__PURE__ */ t(
|
|
69
|
+
G,
|
|
67
70
|
{
|
|
68
71
|
loading: a,
|
|
69
|
-
|
|
70
|
-
currentStep:
|
|
71
|
-
inviterName: c
|
|
72
|
-
...i[o]
|
|
72
|
+
steps: i,
|
|
73
|
+
currentStep: m,
|
|
74
|
+
inviterName: c
|
|
73
75
|
}
|
|
74
76
|
),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
r.rules && !l && /* @__PURE__ */ t(
|
|
78
|
+
P,
|
|
77
79
|
{
|
|
78
|
-
rules:
|
|
80
|
+
rules: o,
|
|
79
81
|
rulesTitle: I,
|
|
80
|
-
termsText:
|
|
82
|
+
termsText: h,
|
|
81
83
|
primaryColor: u,
|
|
82
84
|
openTerms: () => O(!0)
|
|
83
85
|
}
|
|
84
86
|
),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
r.rules && l && /* @__PURE__ */ t(R, { termsTitle: T, termsText: h }),
|
|
88
|
+
r.inviteCard && /* @__PURE__ */ t(
|
|
89
|
+
M,
|
|
88
90
|
{
|
|
89
91
|
inviteLink: x,
|
|
90
|
-
inviteCardTitle:
|
|
91
|
-
inviteCardSubtext:
|
|
92
|
-
primaryColor: u
|
|
93
|
-
socialLinks: D,
|
|
94
|
-
renderToNode: A
|
|
92
|
+
inviteCardTitle: D,
|
|
93
|
+
inviteCardSubtext: k,
|
|
94
|
+
primaryColor: u
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
] }),
|
|
98
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(F, { loading: a, style: { width: "100%" }, children: /* @__PURE__ */ t(W, { onClick: H, children: A }) }) })
|
|
99
99
|
] }) });
|
|
100
100
|
};
|
|
101
101
|
export {
|
|
102
|
-
|
|
102
|
+
Ti as OnboardingUI
|
|
103
103
|
};
|