@streamlayer/react-ui 1.9.0 → 1.10.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/app/app/Advertisement/index.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +78 -67
- package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
- package/lib/app/app/Features/Gamification/Question.js +43 -41
- package/lib/app/app/Features/Gamification/Tabs.js +23 -22
- package/lib/app/app/Features/Gamification/index.js +1 -1
- package/lib/app/app/Insight/index.d.ts +2 -0
- package/lib/app/app/Insight/index.js +28 -24
- package/lib/app/app/Navigation/SDKPillNode.d.ts +1 -0
- package/lib/app/app/Navigation/SDKPillNode.js +9 -0
- package/lib/app/app/Notifications/index.js +125 -113
- package/lib/app/app/Points/index.js +16 -16
- package/lib/app/app/index.d.ts +1 -0
- package/lib/app/app/index.js +84 -86
- package/lib/app/app/story/insight/index.d.ts +1 -0
- package/lib/app/app/story/insight/index.js +29 -26
- package/lib/app/app/story/insight/video.d.ts +1 -0
- package/lib/app/app/story/insight/video.js +13 -13
- package/lib/app/app/story/promotion/content.d.ts +3 -1
- package/lib/app/app/story/promotion/content.js +13 -10
- package/lib/app/app/story/promotion/index.d.ts +1 -0
- package/lib/app/app/story/promotion/index.js +34 -30
- package/lib/app/app/story/promotion/video.d.ts +1 -0
- package/lib/app/app/story/promotion/video.js +34 -31
- package/lib/app/app/styles.js +44 -0
- package/lib/app/app/useApp.d.ts +0 -14
- package/lib/app/app/useApp.js +14 -44
- package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
- package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/index.js +1 -1
- package/lib/app/masters/Features/index.d.ts +2 -2
- package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
- package/lib/app/masters/Notifications/index.d.ts +2 -2
- package/lib/app/masters/Notifications/index.js +1 -1
- package/lib/app/masters/masters.js +23 -23
- package/lib/app/masters/styles.d.ts +20 -0
- package/lib/app/{styles.js → masters/styles.js} +15 -15
- package/lib/app/masters/useSdkResponsive.d.ts +15 -0
- package/lib/app/masters/useSdkResponsive.js +45 -0
- package/lib/app/masters/useSdkScroll.d.ts +12 -0
- package/lib/app/masters/useSdkScroll.js +50 -0
- package/lib/app/useSdkResponsive.d.ts +1 -0
- package/lib/app/useSdkResponsive.js +27 -29
- package/lib/app/useSdkScroll.js +25 -24
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.js +14 -11
- package/lib/ui/advertisement/index.d.ts +3 -0
- package/lib/ui/advertisement/index.js +31 -10
- package/lib/ui/advertisement/notification/index.d.ts +1 -0
- package/lib/ui/advertisement/notification/index.js +30 -27
- package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
- package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
- package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
- package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +58 -43
- package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
- package/lib/ui/advertisement/overlay/styles.js +41 -52
- package/lib/ui/close-btn/index.d.ts +7 -0
- package/lib/ui/close-btn/index.js +47 -0
- package/lib/ui/gamification/detail/header/index.d.ts +2 -1
- package/lib/ui/gamification/detail/header/index.js +16 -15
- package/lib/ui/gamification/vote/styles.js +1 -1
- package/lib/ui/questions/insight/index.js +21 -20
- package/lib/ui/theme/masters-theme.js +36 -13
- package/lib/ui/theme/theme.js +22 -21
- package/lib/ui/timer/index.d.ts +3 -1
- package/lib/ui/timer/index.js +54 -32
- package/lib/ui/video-player/index.d.ts +2 -0
- package/lib/ui/video-player/index.js +62 -51
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +7 -6
- package/package.json +15 -15
- /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as i, Fragment as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as c } from "react";
|
|
3
3
|
import { useStreamLayer as l } from "@streamlayer/react";
|
|
4
|
-
import { StreamLayerSDKInsight as
|
|
5
|
-
import { StreamLayerThemeProvider as
|
|
6
|
-
import { VideoFrame as
|
|
7
|
-
const
|
|
8
|
-
const r = l(),
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */ e(
|
|
12
|
-
/* @__PURE__ */ e(
|
|
4
|
+
import { StreamLayerSDKInsight as n } from "../../Insight/index.js";
|
|
5
|
+
import { StreamLayerThemeProvider as s } from "../../../../ui/theme/index.js";
|
|
6
|
+
import { VideoFrame as p, customTheme as a, VideoPlayerWrap as u, InsightContainerMobile as f, InsightContainerOverlay as g, InsightContainerLBar as v } from "./styles.js";
|
|
7
|
+
const F = ({ insightId: t, layoutMode: m, skipAutoClose: o }) => {
|
|
8
|
+
const r = l(), d = c(null);
|
|
9
|
+
return /* @__PURE__ */ i(h, { children: [
|
|
10
|
+
/* @__PURE__ */ i(p, { ref: d, "data-testid": "video-frame", children: [
|
|
11
|
+
/* @__PURE__ */ e(m === "cover" ? g : v, { children: r && /* @__PURE__ */ e(s, { customTheme: a, children: /* @__PURE__ */ e(n, { skipAutoClose: o, sdk: r, insightId: t, persistent: !0 }) }) }),
|
|
12
|
+
/* @__PURE__ */ e(u, { children: /* @__PURE__ */ e("div", { className: "divAnchor", children: /* @__PURE__ */ e(
|
|
13
13
|
"video",
|
|
14
14
|
{
|
|
15
15
|
src: "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
|
|
@@ -22,9 +22,9 @@ const x = ({ insightId: t, layoutMode: a }) => {
|
|
|
22
22
|
}
|
|
23
23
|
) }) })
|
|
24
24
|
] }),
|
|
25
|
-
/* @__PURE__ */ e(
|
|
25
|
+
/* @__PURE__ */ e(f, { children: r && /* @__PURE__ */ e(s, { customTheme: a, children: /* @__PURE__ */ e(n, { skipAutoClose: o, sdk: r, insightId: t, persistent: !0 }) }) })
|
|
26
26
|
] });
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
F as Video
|
|
30
30
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { styled as r } from "@linaria/react";
|
|
3
|
-
import { useStreamLayer as
|
|
4
|
-
import { StreamLayerSDKAdvertisement as
|
|
5
|
-
import { theme as
|
|
6
|
-
const
|
|
3
|
+
import { useStreamLayer as o } from "@streamlayer/react";
|
|
4
|
+
import { StreamLayerSDKAdvertisement as i } from "../../Advertisement/index.js";
|
|
5
|
+
import { theme as a } from "../../../../ui/theme/theme.js";
|
|
6
|
+
const d = /* @__PURE__ */ r("div")({
|
|
7
7
|
name: "Container",
|
|
8
8
|
class: "c1g3vhjc",
|
|
9
9
|
propsAsIs: !1
|
|
@@ -11,14 +11,17 @@ const a = /* @__PURE__ */ r("div")({
|
|
|
11
11
|
name: "Div",
|
|
12
12
|
class: "d1626h38",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
}), h = ({
|
|
15
|
+
skipAutoClose: m
|
|
16
|
+
}) => {
|
|
17
|
+
const s = o();
|
|
18
|
+
return s ? /* @__PURE__ */ e(d, {
|
|
19
|
+
className: a,
|
|
18
20
|
"data-testid": "overlay",
|
|
19
21
|
children: [/* @__PURE__ */ e(n, {
|
|
20
22
|
children: ["Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ", /* @__PURE__ */ t("br", {}), "-------------"]
|
|
21
|
-
}), /* @__PURE__ */ t(
|
|
23
|
+
}), /* @__PURE__ */ t(i, {
|
|
24
|
+
skipAutoClose: m,
|
|
22
25
|
sdk: s,
|
|
23
26
|
persistent: !0
|
|
24
27
|
}), /* @__PURE__ */ e(n, {
|
|
@@ -27,5 +30,5 @@ const a = /* @__PURE__ */ r("div")({
|
|
|
27
30
|
}) : null;
|
|
28
31
|
};
|
|
29
32
|
export {
|
|
30
|
-
|
|
33
|
+
h as Content
|
|
31
34
|
};
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { StreamLayerProvider as
|
|
4
|
-
import { useStreamLayerDebug as
|
|
5
|
-
import { Content as
|
|
6
|
-
import { Video as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { styled as t } from "@linaria/react";
|
|
3
|
+
import { StreamLayerProvider as y } from "@streamlayer/react";
|
|
4
|
+
import { useStreamLayerDebug as v } from "../../../../utils/debug/index.js";
|
|
5
|
+
import { Content as b } from "./content.js";
|
|
6
|
+
import { Video as f } from "./video.js";
|
|
7
|
+
const u = /* @__PURE__ */ t("div")({
|
|
8
8
|
name: "Body",
|
|
9
9
|
class: "bqh4lcc",
|
|
10
10
|
propsAsIs: !1
|
|
11
|
-
}),
|
|
11
|
+
}), h = /* @__PURE__ */ t("div")({
|
|
12
12
|
name: "Main",
|
|
13
13
|
class: "mgga81b",
|
|
14
14
|
propsAsIs: !1
|
|
15
|
-
}),
|
|
16
|
-
isMobileScreen:
|
|
15
|
+
}), B = ({
|
|
16
|
+
isMobileScreen: n,
|
|
17
17
|
promotionId: s,
|
|
18
|
-
sdkKey:
|
|
19
|
-
eventId:
|
|
20
|
-
sidebar:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
sdkKey: i,
|
|
19
|
+
eventId: d,
|
|
20
|
+
sidebar: a,
|
|
21
|
+
skipAutoClose: r,
|
|
22
|
+
production: m,
|
|
23
|
+
banner: c,
|
|
24
|
+
layoutMode: p = "side-by-side"
|
|
24
25
|
}) => {
|
|
25
|
-
const o =
|
|
26
|
-
sdkKey:
|
|
27
|
-
eventId:
|
|
28
|
-
production:
|
|
26
|
+
const o = v({
|
|
27
|
+
sdkKey: i,
|
|
28
|
+
eventId: d,
|
|
29
|
+
production: m
|
|
29
30
|
});
|
|
30
|
-
return /* @__PURE__ */ e(
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ e(h, {
|
|
32
|
+
children: /* @__PURE__ */ l(y, {
|
|
32
33
|
sdkKey: o.sdkKey,
|
|
33
34
|
event: o.event,
|
|
34
35
|
production: o.env === "production",
|
|
35
36
|
autoEnable: !0,
|
|
36
|
-
children: [/* @__PURE__ */ e(
|
|
37
|
-
children: /* @__PURE__ */ e(
|
|
37
|
+
children: [/* @__PURE__ */ e(u, {
|
|
38
|
+
children: /* @__PURE__ */ e(f, {
|
|
38
39
|
event: o.event,
|
|
39
|
-
banner:
|
|
40
|
-
sidebar:
|
|
41
|
-
layoutMode:
|
|
40
|
+
banner: c,
|
|
41
|
+
sidebar: a,
|
|
42
|
+
layoutMode: p,
|
|
42
43
|
promotionId: s,
|
|
43
|
-
|
|
44
|
+
skipAutoClose: r,
|
|
45
|
+
isMobileScreen: n
|
|
44
46
|
})
|
|
45
47
|
}), /* @__PURE__ */ e("h3", {
|
|
46
48
|
children: "Overlay View (should appear between two text blocks)"
|
|
47
|
-
}), /* @__PURE__ */ e(
|
|
49
|
+
}), /* @__PURE__ */ e(b, {
|
|
50
|
+
skipAutoClose: r
|
|
51
|
+
})]
|
|
48
52
|
})
|
|
49
53
|
});
|
|
50
54
|
};
|
|
51
55
|
export {
|
|
52
|
-
|
|
56
|
+
B as PromotionStory
|
|
53
57
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useStreamLayer as
|
|
4
|
-
import { StreamLayerSDKAdvertisement as
|
|
5
|
-
import { StreamLayerThemeProvider as
|
|
6
|
-
import { PromoButton as
|
|
7
|
-
const
|
|
8
|
-
const e =
|
|
9
|
-
|
|
1
|
+
import { jsxs as n, Fragment as g, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as V, useState as y, useCallback as w, useEffect as x } from "react";
|
|
3
|
+
import { useStreamLayer as P } from "@streamlayer/react";
|
|
4
|
+
import { StreamLayerSDKAdvertisement as c } from "../../Advertisement/index.js";
|
|
5
|
+
import { StreamLayerThemeProvider as h } from "../../../../ui/theme/index.js";
|
|
6
|
+
import { PromoButton as b, VideoFrame as F, AdvSidebar as S, VideoPlayerWrap as A, AdvBanner as B, AdvContent as C } from "./styles.js";
|
|
7
|
+
const E = ({ isMobileScreen: o, skipAutoClose: a, sidebar: s, banner: p, event: d, promotionId: l, layoutMode: t }) => {
|
|
8
|
+
const e = P(), u = V(null), [f, v] = y(!0), m = w(({ muted: i }) => {
|
|
9
|
+
v(i);
|
|
10
10
|
}, []);
|
|
11
|
-
return
|
|
12
|
-
e == null || e.removeVideoPlayerController(
|
|
13
|
-
}), [e,
|
|
14
|
-
l && /* @__PURE__ */ n(
|
|
11
|
+
return x(() => (e == null || e.addVideoPlayerController(m), () => {
|
|
12
|
+
e == null || e.removeVideoPlayerController(m);
|
|
13
|
+
}), [e, m]), /* @__PURE__ */ n(g, { children: [
|
|
14
|
+
l && /* @__PURE__ */ n(b, { onClick: () => {
|
|
15
15
|
var i;
|
|
16
|
-
(i =
|
|
16
|
+
(i = u.current) == null || i.scrollIntoView({ behavior: "smooth" }), setTimeout(() => {
|
|
17
17
|
e == null || e.getFeature(12).background.advertisement.show(l);
|
|
18
18
|
}, 200);
|
|
19
19
|
}, children: [
|
|
@@ -22,34 +22,35 @@ const D = ({ isMobileScreen: o, sidebar: s, banner: h, event: a, promotionId: l,
|
|
|
22
22
|
] }),
|
|
23
23
|
/* @__PURE__ */ r("h3", { children: "Sidebar On Video View and Banner" }),
|
|
24
24
|
/* @__PURE__ */ r("p", { children: "On desktop, the width limit is 344px, and for mobile screens, it is 300px as designed." }),
|
|
25
|
-
/* @__PURE__ */ n(
|
|
25
|
+
/* @__PURE__ */ n(F, { ref: u, "data-testid": "video-frame", children: [
|
|
26
26
|
/* @__PURE__ */ r(
|
|
27
|
-
|
|
27
|
+
S,
|
|
28
28
|
{
|
|
29
29
|
style: {
|
|
30
30
|
...t === "cover" ? { position: "absolute" } : {},
|
|
31
31
|
...s === "left" ? { left: 0 } : { right: 0, order: 3 },
|
|
32
32
|
...o ? { maxWidth: "calc(300px + env(safe-area-inset-left))" } : {}
|
|
33
33
|
},
|
|
34
|
-
children: e && /* @__PURE__ */ r(
|
|
35
|
-
|
|
34
|
+
children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
|
|
35
|
+
c,
|
|
36
36
|
{
|
|
37
37
|
isMobileScreen: o,
|
|
38
|
-
event:
|
|
38
|
+
event: d,
|
|
39
39
|
sdk: e,
|
|
40
40
|
sidebar: s,
|
|
41
41
|
layoutMode: t,
|
|
42
|
+
skipAutoClose: a,
|
|
42
43
|
persistent: !0
|
|
43
44
|
}
|
|
44
45
|
) })
|
|
45
46
|
}
|
|
46
47
|
),
|
|
47
|
-
/* @__PURE__ */ n(
|
|
48
|
+
/* @__PURE__ */ n(A, { children: [
|
|
48
49
|
/* @__PURE__ */ r("div", { className: "divAnchor", children: /* @__PURE__ */ r(
|
|
49
50
|
"video",
|
|
50
51
|
{
|
|
51
52
|
src: "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
|
|
52
|
-
muted:
|
|
53
|
+
muted: f,
|
|
53
54
|
width: "100%",
|
|
54
55
|
height: "100%",
|
|
55
56
|
autoplay: "autoplay",
|
|
@@ -59,20 +60,21 @@ const D = ({ isMobileScreen: o, sidebar: s, banner: h, event: a, promotionId: l,
|
|
|
59
60
|
}
|
|
60
61
|
) }),
|
|
61
62
|
/* @__PURE__ */ r(
|
|
62
|
-
|
|
63
|
+
B,
|
|
63
64
|
{
|
|
64
65
|
style: {
|
|
65
66
|
...t === "cover" ? { position: "absolute" } : {},
|
|
66
|
-
...
|
|
67
|
+
...p === "top" ? { top: 0, order: -1 } : { bottom: 0 }
|
|
67
68
|
},
|
|
68
|
-
children: e && /* @__PURE__ */ r(
|
|
69
|
-
|
|
69
|
+
children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
|
|
70
|
+
c,
|
|
70
71
|
{
|
|
71
72
|
isMobileScreen: o,
|
|
72
|
-
event:
|
|
73
|
+
event: d,
|
|
73
74
|
sdk: e,
|
|
74
|
-
banner:
|
|
75
|
+
banner: p,
|
|
75
76
|
layoutMode: t,
|
|
77
|
+
skipAutoClose: a,
|
|
76
78
|
persistent: !0
|
|
77
79
|
}
|
|
78
80
|
) })
|
|
@@ -80,19 +82,20 @@ const D = ({ isMobileScreen: o, sidebar: s, banner: h, event: a, promotionId: l,
|
|
|
80
82
|
)
|
|
81
83
|
] })
|
|
82
84
|
] }),
|
|
83
|
-
/* @__PURE__ */ r(
|
|
84
|
-
|
|
85
|
+
/* @__PURE__ */ r(C, { children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
|
|
86
|
+
c,
|
|
85
87
|
{
|
|
86
88
|
isMobileScreen: o,
|
|
87
|
-
event:
|
|
89
|
+
event: d,
|
|
88
90
|
sdk: e,
|
|
89
91
|
sidebar: s,
|
|
90
92
|
layoutMode: t,
|
|
93
|
+
skipAutoClose: a,
|
|
91
94
|
persistent: !0
|
|
92
95
|
}
|
|
93
96
|
) }) })
|
|
94
97
|
] });
|
|
95
98
|
};
|
|
96
99
|
export {
|
|
97
|
-
|
|
100
|
+
E as Video
|
|
98
101
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { styled as s } from "@linaria/react";
|
|
2
|
+
const i = /* @__PURE__ */ s("div")({
|
|
3
|
+
name: "SDKContainer",
|
|
4
|
+
class: "sopqfe6",
|
|
5
|
+
propsAsIs: !1
|
|
6
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
7
|
+
name: "SDKScrollContainer",
|
|
8
|
+
class: "s102vcph",
|
|
9
|
+
propsAsIs: !1
|
|
10
|
+
}), e = /* @__PURE__ */ s("div")({
|
|
11
|
+
name: "SDKContentContainer",
|
|
12
|
+
class: "s1meqjjv",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), a = () => e, n = /* @__PURE__ */ s(a())({
|
|
15
|
+
name: "SDKWhiteContainer",
|
|
16
|
+
class: "s1burm22",
|
|
17
|
+
propsAsIs: !0
|
|
18
|
+
}), c = /* @__PURE__ */ s("div")({
|
|
19
|
+
name: "TabsContainer",
|
|
20
|
+
class: "tm5r3j5",
|
|
21
|
+
propsAsIs: !1
|
|
22
|
+
}), o = () => n, l = /* @__PURE__ */ s(o())({
|
|
23
|
+
name: "LeaderboardContainer",
|
|
24
|
+
class: "lysxwr6",
|
|
25
|
+
propsAsIs: !0
|
|
26
|
+
}), r = () => n, C = /* @__PURE__ */ s(r())({
|
|
27
|
+
name: "TabsNavContainer",
|
|
28
|
+
class: "t9er3b1",
|
|
29
|
+
propsAsIs: !0
|
|
30
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
31
|
+
name: "UserSummaryContainer",
|
|
32
|
+
class: "u19dtrb3",
|
|
33
|
+
propsAsIs: !1
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
l as LeaderboardContainer,
|
|
37
|
+
i as SDKContainer,
|
|
38
|
+
e as SDKContentContainer,
|
|
39
|
+
p as SDKScrollContainer,
|
|
40
|
+
n as SDKWhiteContainer,
|
|
41
|
+
c as TabsContainer,
|
|
42
|
+
C as TabsNavContainer,
|
|
43
|
+
m as UserSummaryContainer
|
|
44
|
+
};
|
package/lib/app/app/useApp.d.ts
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
-
/**
|
|
3
|
-
* A hook that provides functionality for managing the StreamLayerSDK in the App app.
|
|
4
|
-
* - On activate FG+ button, the SDK is initialized and the FG+ overlay is opened.
|
|
5
|
-
* - On activate Channels or Leaderboard button, the SDK is disabled and the FG+ overlay is closed.
|
|
6
|
-
* - On sdk status change, if sdk disabled (f.e some errors occurred), the SDK is disabled and the FG+ overlay is closed.
|
|
7
|
-
* @param sdk - The StreamLayerSDK instance to use.
|
|
8
|
-
* @returns An object containing various functions and state values for managing the SDK and app overlays.
|
|
9
|
-
* @returns deactivate - A function that disables the SDK and closes the FG+ overlay.
|
|
10
|
-
* @returns activateEventWithId - A function that initializes the SDK and opens the FG+ overlay.
|
|
11
|
-
* With event (The id of the event to create a session for.) as a parameter.
|
|
12
|
-
*/
|
|
13
2
|
export declare const useAppApp: (sdk: StreamLayerSDK) => {
|
|
14
|
-
sdkEnabled: boolean;
|
|
15
3
|
sdkReady: boolean;
|
|
16
|
-
activateEventWithId: (event: string) => void;
|
|
17
|
-
deactivate: () => void;
|
|
18
4
|
isLogged: boolean;
|
|
19
5
|
};
|
package/lib/app/app/useApp.js
CHANGED
|
@@ -1,48 +1,18 @@
|
|
|
1
|
-
import { useStore as
|
|
2
|
-
import {
|
|
3
|
-
import { FeatureType as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const t = e.getFeature(
|
|
8
|
-
t && (t.closeQuestion(), t.closeUser())
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
e.isUserAuthorized().then((g) => {
|
|
15
|
-
g || e.disableApp();
|
|
16
|
-
});
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
},
|
|
21
|
-
[e]
|
|
22
|
-
), S = c(() => {
|
|
23
|
-
r(!1), e.disableApp();
|
|
24
|
-
}, [e]);
|
|
25
|
-
return s(() => {
|
|
26
|
-
if (!i) {
|
|
27
|
-
u && e.disableApp();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (i && a.current && o) {
|
|
31
|
-
e.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
|
|
32
|
-
e.createEventSession(a.current);
|
|
33
|
-
});
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
}, [i]), s(() => () => {
|
|
37
|
-
r(!1), e.disableApp();
|
|
38
|
-
}, [r, e]), {
|
|
39
|
-
sdkEnabled: o,
|
|
40
|
-
sdkReady: u,
|
|
41
|
-
activateEventWithId: A,
|
|
42
|
-
deactivate: S,
|
|
43
|
-
isLogged: !!i
|
|
1
|
+
import { useStore as r } from "@nanostores/react";
|
|
2
|
+
import { useEffect as S } from "react";
|
|
3
|
+
import { FeatureType as o } from "@streamlayer/sdk-web-types";
|
|
4
|
+
const A = (e) => {
|
|
5
|
+
const u = r(e.status), a = r(e.sdkStore.slStreamId), c = r(e.userId()), s = r(e.getActiveFeature()), n = u === "ready" && !!a.data;
|
|
6
|
+
return S(() => {
|
|
7
|
+
const t = e.getFeature(o.GAMES);
|
|
8
|
+
t && s !== o.GAMES && (t.closeQuestion(), t.closeUser()), t == null || t.openedQuestionId.subscribe((p) => {
|
|
9
|
+
p && s !== o.GAMES && e.openFeature(o.GAMES);
|
|
10
|
+
});
|
|
11
|
+
}, [s, e]), {
|
|
12
|
+
sdkReady: n,
|
|
13
|
+
isLogged: !!c
|
|
44
14
|
};
|
|
45
15
|
};
|
|
46
16
|
export {
|
|
47
|
-
|
|
17
|
+
A as useAppApp
|
|
48
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScrollNodeRef } from '../../..';
|
|
2
|
-
import { ScrollStore } from '
|
|
2
|
+
import { ScrollStore } from '../../useSdkScroll';
|
|
3
3
|
import { Gamification } from '@streamlayer/feature-gamification';
|
|
4
4
|
export declare const Leaderboard: React.FC<{
|
|
5
5
|
gamification: Gamification;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppNodeRef, ScrollNodeRef } from '../../..';
|
|
2
|
-
import { ResponsiveStore } from '
|
|
3
|
-
import { ScrollStore } from '
|
|
2
|
+
import { ResponsiveStore } from '../../useSdkResponsive';
|
|
3
|
+
import { ScrollStore } from '../../useSdkScroll';
|
|
4
4
|
import { Gamification } from '@streamlayer/feature-gamification';
|
|
5
5
|
export declare const Tabs: React.FC<{
|
|
6
6
|
appNode: AppNodeRef;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as h, jsx as e, Fragment as x } from "react/jsx-runtime";
|
|
2
2
|
import { useStore as u } from "@nanostores/react";
|
|
3
|
-
import { TabsContainer as D, TabsNavContainer as T, SDKWhiteContainer as v, UserSummaryContainer as C, SDKContentContainer as A, LeaderboardContainer as I } from "
|
|
4
|
-
import { scrollIntoAppView as P } from "
|
|
3
|
+
import { TabsContainer as D, TabsNavContainer as T, SDKWhiteContainer as v, UserSummaryContainer as C, SDKContentContainer as A, LeaderboardContainer as I } from "../../styles.js";
|
|
4
|
+
import { scrollIntoAppView as P } from "../../useSdkScroll.js";
|
|
5
5
|
import { useState as S, useTransition as V, useEffect as E } from "react";
|
|
6
6
|
import { ActivePages as a, Tabs as K } from "../../../../ui/gamification/tabs/index.js";
|
|
7
7
|
import { Leaderboard as L } from "./Leaderboard.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppNodeRef, ScrollNodeRef } from '../../..';
|
|
2
|
-
import { ResponsiveStore } from '
|
|
3
|
-
import { ScrollStore } from '
|
|
2
|
+
import { ResponsiveStore } from '../../useSdkResponsive';
|
|
3
|
+
import { ScrollStore } from '../../useSdkScroll';
|
|
4
4
|
import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
|
|
5
5
|
export declare const GamificationOverlay: React.FC<{
|
|
6
6
|
gamification: GamificationClass;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { styled as m } from "@linaria/react";
|
|
3
3
|
import { useStore as a } from "@nanostores/react";
|
|
4
|
-
import { SDKWhiteContainer as h } from "
|
|
4
|
+
import { SDKWhiteContainer as h } from "../../styles.js";
|
|
5
5
|
import { useHideTransition as C } from "../../../../hooks/showIn.js";
|
|
6
6
|
import { VoteHeader as k } from "../../../../ui/gamification/detail/header/index.js";
|
|
7
7
|
import { UserStatistics as S } from "../../../../ui/gamification/user-statistics/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppNodeRef, ScrollNodeRef } from '../..';
|
|
2
|
-
import { ResponsiveStore } from '
|
|
3
|
-
import { ScrollStore } from '
|
|
2
|
+
import { ResponsiveStore } from '../useSdkResponsive';
|
|
3
|
+
import { ScrollStore } from '../useSdkScroll';
|
|
4
4
|
import { Features } from '@streamlayer/sdk-web-features';
|
|
5
5
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
6
6
|
/** render feature by type */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResponsiveStore } from '
|
|
1
|
+
import { ResponsiveStore } from '../../useSdkResponsive';
|
|
2
2
|
import { ChannelsButtonId } from '../../../../ui/navigation/button/Channels';
|
|
3
3
|
import { FeaturedGroupsButtonId } from '../../../../ui/navigation/button/FeaturedGroups';
|
|
4
4
|
import { LeaderBoardButtonId } from '../../../../ui/navigation/button/LeaderBoard';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppNodeRef } from '../../..';
|
|
2
|
-
import { ResponsiveStore } from '
|
|
2
|
+
import { ResponsiveStore } from '../../useSdkResponsive';
|
|
3
3
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
4
4
|
import { Notification } from '@streamlayer/sdk-web-notifications';
|
|
5
5
|
export declare const Onboarding: React.FC<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as t, jsxs as Z, Fragment as w } from "react/jsx-runtime";
|
|
2
2
|
import { styled as v } from "@linaria/react";
|
|
3
3
|
import { useStore as I } from "@nanostores/react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { scrollIntoAppView as F } from "../../useSdkScroll.js";
|
|
5
|
+
import { useImagesPreload as T } from "../../../useImagesPreload.js";
|
|
6
6
|
import { useRef as A, useState as S, useMemo as x, useLayoutEffect as _, useEffect as B } from "react";
|
|
7
7
|
import { FeatureType as j } from "@streamlayer/sdk-web-types";
|
|
8
8
|
import { OnboardingUI as E } from "../../../../ui/gamification/onboarding/index.js";
|
|
@@ -118,7 +118,7 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
|
|
|
118
118
|
const {
|
|
119
119
|
loading: g,
|
|
120
120
|
throttled: V
|
|
121
|
-
} =
|
|
121
|
+
} = T(m);
|
|
122
122
|
return f && o && e && s.current && !V ? /* @__PURE__ */ t(G, {
|
|
123
123
|
container: s,
|
|
124
124
|
useContainer: !a,
|
|
@@ -153,7 +153,7 @@ const R = "data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200
|
|
|
153
153
|
close: r.close,
|
|
154
154
|
action: () => {
|
|
155
155
|
var n;
|
|
156
|
-
d(!0), (((n = s.current) == null ? void 0 : n.getBoundingClientRect().y) || 0) < 0 &&
|
|
156
|
+
d(!0), (((n = s.current) == null ? void 0 : n.getBoundingClientRect().y) || 0) < 0 && F(s, h.size, {
|
|
157
157
|
behavior: "smooth"
|
|
158
158
|
});
|
|
159
159
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppNodeRef, ScrollNodeRef, HeaderNodeRef } from '../..';
|
|
2
|
-
import { ResponsiveStore } from '
|
|
3
|
-
import { ScrollStore } from '
|
|
2
|
+
import { ResponsiveStore } from '../useSdkResponsive';
|
|
3
|
+
import { ScrollStore } from '../useSdkScroll';
|
|
4
4
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
5
5
|
export declare const SDKNotifications: React.FC<{
|
|
6
6
|
sdk: StreamLayerSDK;
|
|
@@ -2,7 +2,7 @@ import { jsxs as f, Fragment as D, jsx as c } from "react/jsx-runtime";
|
|
|
2
2
|
import { cx as N } from "@linaria/core";
|
|
3
3
|
import { useStore as g } from "@nanostores/react";
|
|
4
4
|
import { useMastersContext as T } from "../useMastersContext.js";
|
|
5
|
-
import { scrollIntoAppView as q } from "
|
|
5
|
+
import { scrollIntoAppView as q } from "../useSdkScroll.js";
|
|
6
6
|
import { useState as p, useMemo as E, useEffect as h, useRef as O, useCallback as w } from "react";
|
|
7
7
|
import { r as b } from "../../../index-B1QdimmR.js";
|
|
8
8
|
import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
|