@streamlayer/react-ui 0.95.0 → 0.96.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/ui/app/Features/Gamification/Question.js +38 -32
- package/lib/ui/app/Features/Gamification/QuestionsList.js +9 -8
- package/lib/ui/app/Features/Gamification/Tabs.js +3 -2
- package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -0
- package/lib/ui/app/Features/Gamification/index.js +26 -25
- package/lib/ui/app/Notifications/Onboarding/index.js +90 -77
- package/lib/ui/app/Notifications/index.js +80 -74
- package/lib/ui/app/masters.js +59 -48
- package/lib/ui/app/useMastersApp.js +39 -38
- package/lib/ui/app/useMastersContext.d.ts +8 -0
- package/lib/ui/app/useMastersContext.js +8 -0
- package/lib/ui/app/useSdkResponsive.d.ts +2 -2
- package/lib/ui/gamification/onboarding/index.d.ts +4 -1
- package/lib/ui/gamification/onboarding/index.js +56 -48
- package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -8
- package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/invitingUser/styles.js +12 -7
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -16
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +11 -6
- package/lib/ui/gamification/question/insight/index.d.ts +6 -2
- package/lib/ui/gamification/question/insight/index.js +1 -5
- package/lib/ui/gamification/question/list/index.d.ts +2 -0
- package/lib/ui/gamification/question/list/index.js +22 -13
- package/lib/ui/gamification/question/notification/index.d.ts +2 -1
- package/lib/ui/gamification/question/notification/index.js +20 -19
- package/lib/ui/gamification/question/notification/insight/index.d.ts +3 -1
- package/lib/ui/gamification/question/notification/insight/index.js +11 -11
- package/lib/ui/gamification/question/twitter/index.d.ts +6 -2
- package/lib/ui/gamification/question/twitter/index.js +1 -4
- package/lib/ui/modal/index.d.ts +7 -2
- package/lib/ui/modal/index.js +32 -22
- package/lib/ui/questions/insight/index.d.ts +2 -0
- package/lib/ui/questions/insight/index.js +23 -11
- package/lib/ui/questions/twitter/index.d.ts +2 -0
- package/lib/ui/questions/twitter/index.js +14 -13
- package/lib/ui/video-player/index.d.ts +5 -0
- package/lib/ui/video-player/index.js +43 -35
- package/package.json +14 -13
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsx as m, jsxs as w, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as k } from "@nanostores/react";
|
|
3
|
+
import { useState as y, useMemo as O, useEffect as I, useRef as E, useCallback as R } from "react";
|
|
4
4
|
import { r as P } from "../../../index-jRXrW6ie.js";
|
|
5
|
-
import { NotificationType as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { NotificationType as g } from "@streamlayer/sdk-web-notifications";
|
|
6
|
+
import { useMastersContext as q } from "../useMastersContext.js";
|
|
7
|
+
import { scrollIntoAppView as A } from "../useSdkScroll.js";
|
|
8
|
+
import { QuestionTypeData as B } from "../../gamification/constants.js";
|
|
8
9
|
import { Notification as T } from "../../gamification/question/notification/index.js";
|
|
9
|
-
import { PredictionResult as
|
|
10
|
-
import { Onboarding as
|
|
11
|
-
import { Pill as
|
|
10
|
+
import { PredictionResult as H } from "../../gamification/question/notification/prediction-result/index.js";
|
|
11
|
+
import { Onboarding as Q } from "./Onboarding/index.js";
|
|
12
|
+
import { Pill as j, HiddenContainer as z, Container as F, InnerContainer as G, NotificationRefreshing as M } from "./styles.js";
|
|
12
13
|
import "../../../index-uEuzH3jr.js";
|
|
13
14
|
import "lodash.throttle";
|
|
14
15
|
import "../../theme/constants.js";
|
|
@@ -41,6 +42,8 @@ import "react-virtualized-auto-sizer";
|
|
|
41
42
|
import "../../skeleton/index.js";
|
|
42
43
|
import "../../skeleton/styles.js";
|
|
43
44
|
import "../../gamification/onboarding/slides/onboarding-instructions/index.js";
|
|
45
|
+
import "../../gamification/onboarding/invitingUser/index.js";
|
|
46
|
+
import "../../gamification/onboarding/invitingUser/styles.js";
|
|
44
47
|
import "../../gamification/onboarding/slides/onboarding-instructions/styles.js";
|
|
45
48
|
import "../../gamification/onboarding/slides/onboarding-invite-card/index.js";
|
|
46
49
|
import "../useClipboardCopy.js";
|
|
@@ -59,124 +62,127 @@ import "./Onboarding/Notification/index.js";
|
|
|
59
62
|
import "./Onboarding/Notification/styles.js";
|
|
60
63
|
import "../../gamification/question/notification/pill/index.js";
|
|
61
64
|
import "../../gamification/question/notification/pill/styles.js";
|
|
62
|
-
const
|
|
63
|
-
const [t,
|
|
64
|
-
i.current =
|
|
65
|
+
const U = (p) => {
|
|
66
|
+
const [t, n] = y(0), i = E(null), e = R((r) => {
|
|
67
|
+
i.current = r;
|
|
65
68
|
}, []);
|
|
66
69
|
I(() => {
|
|
67
|
-
var
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
const
|
|
72
|
-
|
|
70
|
+
var o;
|
|
71
|
+
const r = (o = i.current) == null ? void 0 : o.getBoundingClientRect();
|
|
72
|
+
r && n(r.height);
|
|
73
|
+
}, [p]);
|
|
74
|
+
const s = R((r) => {
|
|
75
|
+
n(r);
|
|
73
76
|
}, []);
|
|
74
|
-
return [
|
|
75
|
-
},
|
|
76
|
-
sdk:
|
|
77
|
+
return [e, t, s];
|
|
78
|
+
}, K = ({
|
|
79
|
+
sdk: p,
|
|
77
80
|
notification: t,
|
|
78
|
-
appNode:
|
|
81
|
+
appNode: n,
|
|
79
82
|
sdkInDesktopView: i
|
|
80
83
|
}) => {
|
|
81
|
-
var
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
var c, u;
|
|
85
|
+
const {
|
|
86
|
+
sdk: e
|
|
87
|
+
} = q(), [s, r, o] = U(t.id);
|
|
88
|
+
return t.type === g.QUESTION ? /* @__PURE__ */ w(b, {
|
|
89
|
+
children: [/* @__PURE__ */ m(z, {
|
|
90
|
+
ref: s,
|
|
91
|
+
children: /* @__PURE__ */ m(T, {
|
|
87
92
|
...t
|
|
88
93
|
})
|
|
89
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ w(F, {
|
|
90
95
|
style: {
|
|
91
|
-
height: t.hiding ? 0 :
|
|
96
|
+
height: t.hiding ? 0 : r
|
|
92
97
|
},
|
|
93
98
|
hiding: t.hiding,
|
|
94
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ m(G, {
|
|
95
100
|
style: {
|
|
96
101
|
height: "100%"
|
|
97
102
|
},
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
-
...t
|
|
103
|
+
children: /* @__PURE__ */ m(T, {
|
|
104
|
+
...t,
|
|
105
|
+
controlVideo: e == null ? void 0 : e.controlVideoPlayer
|
|
100
106
|
})
|
|
101
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ m(M, {}, t.id)]
|
|
102
108
|
})]
|
|
103
|
-
}) : t.type ===
|
|
109
|
+
}) : t.type === g.QUESTION_RESOLVED && ((u = (c = t.data) == null ? void 0 : c.question) != null && u.predictionResult) ? /* @__PURE__ */ m(H, {
|
|
104
110
|
style: {
|
|
105
|
-
height: t.hiding ? 0 :
|
|
111
|
+
height: t.hiding ? 0 : r
|
|
106
112
|
},
|
|
107
113
|
saveHeight: o,
|
|
108
114
|
close: t.close,
|
|
109
115
|
hiding: t.hiding,
|
|
110
116
|
...t.data.question
|
|
111
|
-
}) : t.type ===
|
|
117
|
+
}) : t.type === g.ONBOARDING ? /* @__PURE__ */ m(Q, {
|
|
112
118
|
style: {
|
|
113
|
-
height: t.hiding ? 0 :
|
|
119
|
+
height: t.hiding ? 0 : r
|
|
114
120
|
},
|
|
115
121
|
saveHeight: o,
|
|
116
|
-
sdk:
|
|
122
|
+
sdk: p,
|
|
117
123
|
notification: t,
|
|
118
124
|
sdkInDesktopView: i,
|
|
119
|
-
appNode:
|
|
125
|
+
appNode: n
|
|
120
126
|
}) : null;
|
|
121
|
-
},
|
|
122
|
-
sdk:
|
|
127
|
+
}, ti = ({
|
|
128
|
+
sdk: p,
|
|
123
129
|
headerNode: t,
|
|
124
|
-
scrollNode:
|
|
130
|
+
scrollNode: n,
|
|
125
131
|
responsiveStore: i,
|
|
126
|
-
appNode:
|
|
127
|
-
scrollStore:
|
|
132
|
+
appNode: e,
|
|
133
|
+
scrollStore: s
|
|
128
134
|
}) => {
|
|
129
|
-
const [
|
|
135
|
+
const [r] = y(p.getNotificationsStore()), o = k(r), {
|
|
130
136
|
tabsShown: c
|
|
131
|
-
} =
|
|
137
|
+
} = k(s, {
|
|
132
138
|
keys: ["tabsShown"]
|
|
133
139
|
}), {
|
|
134
|
-
sdkInView:
|
|
140
|
+
sdkInView: u,
|
|
135
141
|
sdkInDesktopView: C
|
|
136
|
-
} =
|
|
142
|
+
} = k(i, {
|
|
137
143
|
keys: ["sdkInView", "sdkInDesktopView"]
|
|
138
|
-
}), [
|
|
139
|
-
if (!(
|
|
144
|
+
}), [d, h] = y(null), l = O(() => {
|
|
145
|
+
if (!(o != null && o.size))
|
|
140
146
|
return null;
|
|
141
|
-
for (const
|
|
142
|
-
if (
|
|
143
|
-
return
|
|
144
|
-
return
|
|
145
|
-
}, [
|
|
147
|
+
for (const a of o.values())
|
|
148
|
+
if (a.type === g.ONBOARDING)
|
|
149
|
+
return a;
|
|
150
|
+
return o.values().next().value;
|
|
151
|
+
}, [o]);
|
|
146
152
|
I(() => {
|
|
147
153
|
l && (i.get().sdkInDesktopView || i.get().sdkInView) && (!i.get().sdkInDesktopView && i.get().sdkInView && h(l), i.get().sdkInDesktopView && window.requestAnimationFrame(() => {
|
|
148
|
-
|
|
154
|
+
s.get().scrollPosition !== 0 && h(l);
|
|
149
155
|
}));
|
|
150
156
|
}, [l]), I(() => {
|
|
151
|
-
|
|
152
|
-
}, [
|
|
153
|
-
const
|
|
154
|
-
var
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
title: `New ${((
|
|
157
|
+
u || h(null);
|
|
158
|
+
}, [u]);
|
|
159
|
+
const x = O(() => {
|
|
160
|
+
var V, D;
|
|
161
|
+
const f = i.get().sdkInDesktopView ? e : t;
|
|
162
|
+
return d && f.current && P.createPortal(/* @__PURE__ */ m(j, {
|
|
163
|
+
title: `New ${((D = B[(V = d.data) == null ? void 0 : V.questionType]) == null ? void 0 : D.label) || "notification"}`,
|
|
158
164
|
onClick: () => {
|
|
159
165
|
var N;
|
|
160
|
-
i.get().sdkInDesktopView ? (N =
|
|
166
|
+
i.get().sdkInDesktopView ? (N = n.current) == null || N.scrollTo({
|
|
161
167
|
top: 0,
|
|
162
168
|
behavior: "smooth"
|
|
163
|
-
}) :
|
|
169
|
+
}) : A(e, {
|
|
164
170
|
behavior: "smooth"
|
|
165
171
|
}), h(null);
|
|
166
172
|
},
|
|
167
173
|
className: c ? "c1d7yse1" : void 0
|
|
168
|
-
}),
|
|
169
|
-
}, [
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
-
children: [!
|
|
174
|
+
}), f.current) || null;
|
|
175
|
+
}, [d, e, t, n, c, i]);
|
|
176
|
+
return /* @__PURE__ */ w(b, {
|
|
177
|
+
children: [!d && l && /* @__PURE__ */ m(K, {
|
|
172
178
|
sdkInDesktopView: C,
|
|
173
179
|
headerNode: t,
|
|
174
|
-
appNode:
|
|
175
|
-
sdk:
|
|
180
|
+
appNode: e,
|
|
181
|
+
sdk: p,
|
|
176
182
|
notification: l
|
|
177
|
-
}),
|
|
183
|
+
}), x]
|
|
178
184
|
});
|
|
179
185
|
};
|
|
180
186
|
export {
|
|
181
|
-
|
|
187
|
+
ti as SDKNotifications
|
|
182
188
|
};
|
package/lib/ui/app/masters.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef as u, useEffect as
|
|
1
|
+
import { jsx as r, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useEffect as C, useMemo as x } from "react";
|
|
3
3
|
import { resetCss as v } from "../theme/theme.js";
|
|
4
4
|
import { ActiveFeature as A } from "./Features/index.js";
|
|
5
|
-
import { MastersNavigation as
|
|
6
|
-
import { SDKNotifications as
|
|
7
|
-
import { SDKContainer as
|
|
8
|
-
import { useMastersApp as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
5
|
+
import { MastersNavigation as I } from "./Navigation/MastersNavigation/index.js";
|
|
6
|
+
import { SDKNotifications as M } from "./Notifications/index.js";
|
|
7
|
+
import { SDKContainer as B, SDKScrollContainer as F } from "./styles.js";
|
|
8
|
+
import { useMastersApp as j } from "./useMastersApp.js";
|
|
9
|
+
import { MastersContext as D } from "./useMastersContext.js";
|
|
10
|
+
import { useSdkFeature as E } from "./useSdkFeature.js";
|
|
11
|
+
import { useSdkResponsive as K } from "./useSdkResponsive.js";
|
|
12
|
+
import { useSdkScroll as L } from "./useSdkScroll.js";
|
|
13
|
+
import { ChannelsButtonId as O } from "../navigation/button/Channels.js";
|
|
14
|
+
import { LeaderBoardButtonId as R } from "../navigation/button/LeaderBoard.js";
|
|
15
|
+
import { FeaturedGroupsButtonId as T } from "../navigation/button/FeaturedGroups.js";
|
|
15
16
|
import "../theme/breakpoints.js";
|
|
16
17
|
import "../theme/constants.js";
|
|
17
18
|
import "@streamlayer/sdk-web-types";
|
|
@@ -56,6 +57,8 @@ import "react-virtualized-auto-sizer";
|
|
|
56
57
|
import "../skeleton/index.js";
|
|
57
58
|
import "../skeleton/styles.js";
|
|
58
59
|
import "../gamification/onboarding/slides/onboarding-instructions/index.js";
|
|
60
|
+
import "../gamification/onboarding/invitingUser/index.js";
|
|
61
|
+
import "../gamification/onboarding/invitingUser/styles.js";
|
|
59
62
|
import "../gamification/onboarding/slides/onboarding-instructions/styles.js";
|
|
60
63
|
import "../gamification/onboarding/slides/onboarding-invite-card/index.js";
|
|
61
64
|
import "./useClipboardCopy.js";
|
|
@@ -77,71 +80,79 @@ import "../gamification/question/notification/pill/index.js";
|
|
|
77
80
|
import "../gamification/question/notification/pill/styles.js";
|
|
78
81
|
import "lodash.throttle";
|
|
79
82
|
import "../../index-keh7OLCY.js";
|
|
80
|
-
const
|
|
81
|
-
const [, n] =
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
const b = ({ sdk: t, className: s, scrollStore: a, appNode: o, scrollNode: p, headerNode: i, responsiveStore: m }) => {
|
|
84
|
+
const [, n] = E(t);
|
|
85
|
+
return /* @__PURE__ */ r(
|
|
83
86
|
A,
|
|
84
87
|
{
|
|
85
88
|
className: s,
|
|
86
89
|
scrollNode: p,
|
|
87
|
-
appNode:
|
|
90
|
+
appNode: o,
|
|
88
91
|
scrollStore: a,
|
|
89
92
|
feature: n,
|
|
90
|
-
headerNode:
|
|
91
|
-
responsiveStore:
|
|
92
|
-
sdk:
|
|
93
|
+
headerNode: i,
|
|
94
|
+
responsiveStore: m,
|
|
95
|
+
sdk: t
|
|
93
96
|
}
|
|
94
97
|
);
|
|
95
|
-
},
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
+
}, co = ({ sdk: t, overlays: s, children: a }) => {
|
|
99
|
+
const o = u(null), p = u(null), [i] = K(o), [m, n] = L(o, i), { sdkEnabled: l, sdkReady: d, activeOverlay: e, activateAndLoadOverlay: S, activateEventWithId: h, deactivate: g, isLogged: y } = j(t);
|
|
100
|
+
C(() => {
|
|
98
101
|
import("./Features/Gamification/gamification-feature.js");
|
|
99
|
-
}, [])
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
}, []);
|
|
103
|
+
const N = x(() => ({ sdk: t }), [t]);
|
|
104
|
+
return /* @__PURE__ */ r(D.Provider, { value: N, children: /* @__PURE__ */ f(B, { ref: o, children: [
|
|
105
|
+
l && /* @__PURE__ */ r(
|
|
106
|
+
I,
|
|
102
107
|
{
|
|
103
108
|
ref: p,
|
|
104
|
-
sdkReady:
|
|
109
|
+
sdkReady: d,
|
|
105
110
|
activeOverlay: e,
|
|
106
111
|
className: v,
|
|
107
|
-
setActiveOverlay: (
|
|
112
|
+
setActiveOverlay: (c) => S("", c),
|
|
108
113
|
scrollToTop: () => {
|
|
109
|
-
var
|
|
110
|
-
return (
|
|
114
|
+
var c;
|
|
115
|
+
return (c = m.current) == null ? void 0 : c.scrollTo(0, 0);
|
|
111
116
|
},
|
|
112
|
-
responsiveStore:
|
|
117
|
+
responsiveStore: i
|
|
113
118
|
}
|
|
114
119
|
),
|
|
115
|
-
/* @__PURE__ */ f(
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
/* @__PURE__ */ f(F, { className: "sl-hide-on-modal", ref: m, "data-nav": l.toString(), children: [
|
|
121
|
+
d && /* @__PURE__ */ r(
|
|
122
|
+
M,
|
|
118
123
|
{
|
|
119
|
-
sdk:
|
|
120
|
-
scrollNode:
|
|
124
|
+
sdk: t,
|
|
125
|
+
scrollNode: m,
|
|
121
126
|
headerNode: p,
|
|
122
|
-
appNode:
|
|
127
|
+
appNode: o,
|
|
123
128
|
scrollStore: n,
|
|
124
|
-
responsiveStore:
|
|
129
|
+
responsiveStore: i
|
|
125
130
|
}
|
|
126
131
|
),
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
s && e ===
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
/* @__PURE__ */ r("div", { style: !l || e === O ? {} : { display: "none" }, children: a && a({ activateEventWithId: h, deactivate: g }) }),
|
|
133
|
+
s && e === R && s[e],
|
|
134
|
+
d && e === T && /* @__PURE__ */ r(
|
|
135
|
+
b,
|
|
131
136
|
{
|
|
132
137
|
scrollStore: n,
|
|
133
|
-
responsiveStore:
|
|
134
|
-
scrollNode:
|
|
135
|
-
appNode:
|
|
138
|
+
responsiveStore: i,
|
|
139
|
+
scrollNode: m,
|
|
140
|
+
appNode: o,
|
|
136
141
|
headerNode: p,
|
|
137
142
|
className: v,
|
|
138
|
-
sdk:
|
|
143
|
+
sdk: t
|
|
139
144
|
}
|
|
140
145
|
)
|
|
141
146
|
] }),
|
|
142
|
-
l && !y && /* @__PURE__ */
|
|
143
|
-
|
|
147
|
+
l && !y && /* @__PURE__ */ r(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" },
|
|
151
|
+
children: "You are not logged in."
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] }) });
|
|
144
155
|
};
|
|
145
156
|
export {
|
|
146
|
-
|
|
157
|
+
co as MastersApp
|
|
147
158
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useStore as
|
|
2
|
-
import { useRef as y, useState as
|
|
3
|
-
import { FeatureType as
|
|
1
|
+
import { useStore as A } from "@nanostores/react";
|
|
2
|
+
import { useRef as y, useState as d, useCallback as z, useEffect as u } from "react";
|
|
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 i } from "../navigation/button/FeaturedGroups.js";
|
|
6
|
+
import { ChannelsButtonId as p } from "../navigation/button/Channels.js";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
8
|
import "../navigation/button/LeaderBoard.js";
|
|
9
9
|
import "@linaria/react";
|
|
@@ -13,28 +13,30 @@ import "../navigation/button/styles.js";
|
|
|
13
13
|
import "../navigation/masters.js";
|
|
14
14
|
import "../navigation/index.js";
|
|
15
15
|
import "../theme/constants.js";
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
(t,
|
|
19
|
-
|
|
20
|
-
e.openFeature(
|
|
16
|
+
const j = (e) => {
|
|
17
|
+
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(i), m = z(
|
|
18
|
+
(t, s) => {
|
|
19
|
+
r(s), s === i ? (t && e.createEventSession(t), window.requestAnimationFrame(() => {
|
|
20
|
+
e.openFeature(v.GAMES);
|
|
21
21
|
})) : e.closeFeature(!1);
|
|
22
22
|
},
|
|
23
23
|
[e]
|
|
24
24
|
);
|
|
25
|
-
|
|
26
|
-
!
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
u(() => {
|
|
26
|
+
!n && l === i && (r(p), e.closeFeature(!0));
|
|
27
|
+
}, [n, l, e]), u(() => {
|
|
28
|
+
f === v.GAMES ? r(i) : f === v.UNSET && r(p);
|
|
29
|
+
}, [f]);
|
|
30
|
+
const F = (t) => {
|
|
31
|
+
c.current = t, o(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: s, err: g }) => {
|
|
32
|
+
if (g) {
|
|
33
|
+
m(t, p);
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
|
-
if (
|
|
35
|
-
e.isUserAuthorized().then((
|
|
36
|
-
if (
|
|
37
|
-
|
|
36
|
+
if (s) {
|
|
37
|
+
e.isUserAuthorized().then((h) => {
|
|
38
|
+
if (h) {
|
|
39
|
+
m(t, i);
|
|
38
40
|
return;
|
|
39
41
|
} else
|
|
40
42
|
e.disableApp();
|
|
@@ -43,32 +45,31 @@ const W = (e) => {
|
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
}, b = () => {
|
|
46
|
-
|
|
48
|
+
o(!1), e.disableApp();
|
|
47
49
|
};
|
|
48
|
-
return
|
|
49
|
-
if (!
|
|
50
|
-
|
|
50
|
+
return u(() => {
|
|
51
|
+
if (!a) {
|
|
52
|
+
n && (r(p), e.disableApp());
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
|
-
if (
|
|
55
|
+
if (a && c.current && S) {
|
|
54
56
|
e.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
|
|
55
|
-
e.createEventSession(
|
|
57
|
+
e.createEventSession(c.current);
|
|
56
58
|
});
|
|
57
59
|
return;
|
|
58
60
|
}
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
activateEventWithId: g,
|
|
61
|
+
}, [a]), u(() => () => {
|
|
62
|
+
o(!1), e.disableApp();
|
|
63
|
+
}, [o, e]), {
|
|
64
|
+
sdkEnabled: S,
|
|
65
|
+
sdkReady: n,
|
|
66
|
+
activeOverlay: l,
|
|
67
|
+
activateAndLoadOverlay: m,
|
|
68
|
+
activateEventWithId: F,
|
|
68
69
|
deactivate: b,
|
|
69
|
-
isLogged: !!
|
|
70
|
+
isLogged: !!a
|
|
70
71
|
};
|
|
71
72
|
};
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
+
j as useMastersApp
|
|
74
75
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
|
+
export declare const MastersContext: import("react").Context<{
|
|
4
|
+
sdk: StreamLayerSDK | null;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const useMastersContext: () => {
|
|
7
|
+
sdk: StreamLayerSDK | null;
|
|
8
|
+
};
|
|
@@ -6,8 +6,8 @@ type ResponsiveData = {
|
|
|
6
6
|
name: BREAKPOINTS_KEYS;
|
|
7
7
|
size: (typeof BREAKPOINTS)[BREAKPOINTS_KEYS];
|
|
8
8
|
};
|
|
9
|
-
sdkInView
|
|
10
|
-
sdkInDesktopView
|
|
9
|
+
sdkInView: boolean;
|
|
10
|
+
sdkInDesktopView: boolean;
|
|
11
11
|
};
|
|
12
12
|
export type ResponsiveStore = MapStore<ResponsiveData>;
|
|
13
13
|
export declare const useSdkResponsive: (appNode: AppNodeRef) => [ResponsiveStore];
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Gamification } from '@streamlayer/feature-gamification';
|
|
3
|
+
import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
4
|
import { HeaderNodeRef, type AppNodeRef } from '../../app/masters';
|
|
4
5
|
import { OnboardingStep } from './slides/onboarding-instructions';
|
|
5
6
|
import { OnboardingInviteCardProps } from './slides/onboarding-invite-card';
|
|
6
7
|
import { OnboardingRule } from './slides/onboarding-rules';
|
|
7
8
|
type OnboardingType = OnboardingInviteCardProps & {
|
|
8
9
|
gamification: Gamification;
|
|
10
|
+
sdk: StreamLayerSDK;
|
|
9
11
|
steps?: OnboardingStep[];
|
|
10
12
|
rules?: OnboardingRule[];
|
|
11
13
|
rulesBtnLabel?: string;
|
|
@@ -16,7 +18,8 @@ type OnboardingType = OnboardingInviteCardProps & {
|
|
|
16
18
|
inviteCardBtnLabel?: string;
|
|
17
19
|
loading: boolean;
|
|
18
20
|
renderToNode?: AppNodeRef | HeaderNodeRef;
|
|
21
|
+
inviterName?: string;
|
|
19
22
|
onClose: () => void;
|
|
20
23
|
};
|
|
21
|
-
export declare const
|
|
24
|
+
export declare const OnboardingUI: React.FC<OnboardingType>;
|
|
22
25
|
export {};
|