@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.
Files changed (78) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -0
  2. package/lib/app/app/Advertisement/index.js +78 -67
  3. package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
  4. package/lib/app/app/Features/Gamification/Question.js +43 -41
  5. package/lib/app/app/Features/Gamification/Tabs.js +23 -22
  6. package/lib/app/app/Features/Gamification/index.js +1 -1
  7. package/lib/app/app/Insight/index.d.ts +2 -0
  8. package/lib/app/app/Insight/index.js +28 -24
  9. package/lib/app/app/Navigation/SDKPillNode.d.ts +1 -0
  10. package/lib/app/app/Navigation/SDKPillNode.js +9 -0
  11. package/lib/app/app/Notifications/index.js +125 -113
  12. package/lib/app/app/Points/index.js +16 -16
  13. package/lib/app/app/index.d.ts +1 -0
  14. package/lib/app/app/index.js +84 -86
  15. package/lib/app/app/story/insight/index.d.ts +1 -0
  16. package/lib/app/app/story/insight/index.js +29 -26
  17. package/lib/app/app/story/insight/video.d.ts +1 -0
  18. package/lib/app/app/story/insight/video.js +13 -13
  19. package/lib/app/app/story/promotion/content.d.ts +3 -1
  20. package/lib/app/app/story/promotion/content.js +13 -10
  21. package/lib/app/app/story/promotion/index.d.ts +1 -0
  22. package/lib/app/app/story/promotion/index.js +34 -30
  23. package/lib/app/app/story/promotion/video.d.ts +1 -0
  24. package/lib/app/app/story/promotion/video.js +34 -31
  25. package/lib/app/app/styles.js +44 -0
  26. package/lib/app/app/useApp.d.ts +0 -14
  27. package/lib/app/app/useApp.js +14 -44
  28. package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
  29. package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
  30. package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
  31. package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
  32. package/lib/app/masters/Features/Gamification/index.js +1 -1
  33. package/lib/app/masters/Features/index.d.ts +2 -2
  34. package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
  35. package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
  36. package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
  37. package/lib/app/masters/Notifications/index.d.ts +2 -2
  38. package/lib/app/masters/Notifications/index.js +1 -1
  39. package/lib/app/masters/masters.js +23 -23
  40. package/lib/app/masters/styles.d.ts +20 -0
  41. package/lib/app/{styles.js → masters/styles.js} +15 -15
  42. package/lib/app/masters/useSdkResponsive.d.ts +15 -0
  43. package/lib/app/masters/useSdkResponsive.js +45 -0
  44. package/lib/app/masters/useSdkScroll.d.ts +12 -0
  45. package/lib/app/masters/useSdkScroll.js +50 -0
  46. package/lib/app/useSdkResponsive.d.ts +1 -0
  47. package/lib/app/useSdkResponsive.js +27 -29
  48. package/lib/app/useSdkScroll.js +25 -24
  49. package/lib/assets/style.css +1 -1
  50. package/lib/ui/advertisement/banner/index.js +14 -11
  51. package/lib/ui/advertisement/index.d.ts +3 -0
  52. package/lib/ui/advertisement/index.js +31 -10
  53. package/lib/ui/advertisement/notification/index.d.ts +1 -0
  54. package/lib/ui/advertisement/notification/index.js +30 -27
  55. package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
  56. package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
  57. package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
  58. package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
  59. package/lib/ui/advertisement/overlay/index.d.ts +2 -0
  60. package/lib/ui/advertisement/overlay/index.js +58 -43
  61. package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
  62. package/lib/ui/advertisement/overlay/styles.js +41 -52
  63. package/lib/ui/close-btn/index.d.ts +7 -0
  64. package/lib/ui/close-btn/index.js +47 -0
  65. package/lib/ui/gamification/detail/header/index.d.ts +2 -1
  66. package/lib/ui/gamification/detail/header/index.js +16 -15
  67. package/lib/ui/gamification/vote/styles.js +1 -1
  68. package/lib/ui/questions/insight/index.js +21 -20
  69. package/lib/ui/theme/masters-theme.js +36 -13
  70. package/lib/ui/theme/theme.js +22 -21
  71. package/lib/ui/timer/index.d.ts +3 -1
  72. package/lib/ui/timer/index.js +54 -32
  73. package/lib/ui/video-player/index.d.ts +2 -0
  74. package/lib/ui/video-player/index.js +62 -51
  75. package/lib/ui/video-player/styles.d.ts +1 -0
  76. package/lib/ui/video-player/styles.js +7 -6
  77. package/package.json +15 -15
  78. /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
@@ -1,4 +1,5 @@
1
1
  export declare const Video: React.FC<{
2
2
  insightId?: string;
3
+ skipAutoClose?: boolean;
3
4
  layoutMode?: 'side-by-side' | 'cover';
4
5
  }>;
@@ -1,15 +1,15 @@
1
- import { jsxs as o, Fragment as d, jsx as e } from "react/jsx-runtime";
2
- import { useRef as h } from "react";
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 i } from "../../Insight/index.js";
5
- import { StreamLayerThemeProvider as n } from "../../../../ui/theme/index.js";
6
- import { VideoFrame as c, customTheme as s, VideoPlayerWrap as p, InsightContainerMobile as u, InsightContainerOverlay as f, InsightContainerLBar as g } from "./styles.js";
7
- const x = ({ insightId: t, layoutMode: a }) => {
8
- const r = l(), m = h(null);
9
- return /* @__PURE__ */ o(d, { children: [
10
- /* @__PURE__ */ o(c, { ref: m, "data-testid": "video-frame", children: [
11
- /* @__PURE__ */ e(a === "cover" ? f : g, { children: r && /* @__PURE__ */ e(n, { customTheme: s, children: /* @__PURE__ */ e(i, { sdk: r, insightId: t, persistent: !0 }) }) }),
12
- /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e("div", { className: "divAnchor", children: /* @__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(u, { children: r && /* @__PURE__ */ e(n, { customTheme: s, children: /* @__PURE__ */ e(i, { sdk: r, insightId: t, persistent: !0 }) }) })
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
- x as Video
29
+ F as Video
30
30
  };
@@ -1 +1,3 @@
1
- export declare const Content: React.FC;
1
+ export declare const Content: React.FC<{
2
+ skipAutoClose?: boolean;
3
+ }>;
@@ -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 m } from "@streamlayer/react";
4
- import { StreamLayerSDKAdvertisement as o } from "../../Advertisement/index.js";
5
- import { theme as i } from "../../../../ui/theme/theme.js";
6
- const a = /* @__PURE__ */ r("div")({
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
- }), c = () => {
15
- const s = m();
16
- return s ? /* @__PURE__ */ e(a, {
17
- className: i,
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(o, {
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
- c as Content
33
+ h as Content
31
34
  };
@@ -4,6 +4,7 @@ export declare const PromotionStory: React.FC<{
4
4
  sdkKey?: string;
5
5
  eventId?: string;
6
6
  production?: boolean;
7
+ skipAutoClose?: boolean;
7
8
  sidebar: 'left' | 'right';
8
9
  banner: 'top' | 'bottom';
9
10
  }>;
@@ -1,53 +1,57 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
- import { styled as r } from "@linaria/react";
3
- import { StreamLayerProvider as l } from "@streamlayer/react";
4
- import { useStreamLayerDebug as y } from "../../../../utils/debug/index.js";
5
- import { Content as u } from "./content.js";
6
- import { Video as v } from "./video.js";
7
- const b = /* @__PURE__ */ r("div")({
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
- }), f = /* @__PURE__ */ r("div")({
11
+ }), h = /* @__PURE__ */ t("div")({
12
12
  name: "Main",
13
13
  class: "mgga81b",
14
14
  propsAsIs: !1
15
- }), j = ({
16
- isMobileScreen: t,
15
+ }), B = ({
16
+ isMobileScreen: n,
17
17
  promotionId: s,
18
- sdkKey: n,
19
- eventId: i,
20
- sidebar: d,
21
- production: a,
22
- banner: m,
23
- layoutMode: c = "side-by-side"
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 = y({
26
- sdkKey: n,
27
- eventId: i,
28
- production: a
26
+ const o = v({
27
+ sdkKey: i,
28
+ eventId: d,
29
+ production: m
29
30
  });
30
- return /* @__PURE__ */ e(f, {
31
- children: /* @__PURE__ */ p(l, {
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(b, {
37
- children: /* @__PURE__ */ e(v, {
37
+ children: [/* @__PURE__ */ e(u, {
38
+ children: /* @__PURE__ */ e(f, {
38
39
  event: o.event,
39
- banner: m,
40
- sidebar: d,
41
- layoutMode: c,
40
+ banner: c,
41
+ sidebar: a,
42
+ layoutMode: p,
42
43
  promotionId: s,
43
- isMobileScreen: t
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(u, {})]
49
+ }), /* @__PURE__ */ e(b, {
50
+ skipAutoClose: r
51
+ })]
48
52
  })
49
53
  });
50
54
  };
51
55
  export {
52
- j as PromotionStory
56
+ B as PromotionStory
53
57
  };
@@ -3,6 +3,7 @@ export declare const Video: React.FC<{
3
3
  banner: 'top' | 'bottom';
4
4
  layoutMode: 'cover' | 'side-by-side';
5
5
  isMobileScreen?: boolean;
6
+ skipAutoClose?: boolean;
6
7
  event?: string;
7
8
  promotionId?: string;
8
9
  }>;
@@ -1,19 +1,19 @@
1
- import { jsxs as n, Fragment as v, jsx as r } from "react/jsx-runtime";
2
- import { useRef as g, useState as V, useCallback as y, useEffect as w } from "react";
3
- import { useStreamLayer as x } from "@streamlayer/react";
4
- import { StreamLayerSDKAdvertisement as m } from "../../Advertisement/index.js";
5
- import { StreamLayerThemeProvider as c } from "../../../../ui/theme/index.js";
6
- import { PromoButton as P, VideoFrame as A, AdvSidebar as C, VideoPlayerWrap as b, AdvBanner as F, AdvContent as S } from "./styles.js";
7
- const D = ({ isMobileScreen: o, sidebar: s, banner: h, event: a, promotionId: l, layoutMode: t }) => {
8
- const e = x(), p = g(null), [u, f] = V(!0), d = y(({ muted: i }) => {
9
- f(i);
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 w(() => (e == null || e.addVideoPlayerController(d), () => {
12
- e == null || e.removeVideoPlayerController(d);
13
- }), [e, d]), /* @__PURE__ */ n(v, { children: [
14
- l && /* @__PURE__ */ n(P, { onClick: () => {
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 = p.current) == null || i.scrollIntoView({ behavior: "smooth" }), setTimeout(() => {
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(A, { ref: p, "data-testid": "video-frame", children: [
25
+ /* @__PURE__ */ n(F, { ref: u, "data-testid": "video-frame", children: [
26
26
  /* @__PURE__ */ r(
27
- C,
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(c, { children: /* @__PURE__ */ r(
35
- m,
34
+ children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
35
+ c,
36
36
  {
37
37
  isMobileScreen: o,
38
- event: a,
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(b, { children: [
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: u,
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
- F,
63
+ B,
63
64
  {
64
65
  style: {
65
66
  ...t === "cover" ? { position: "absolute" } : {},
66
- ...h === "top" ? { top: 0, order: -1 } : { bottom: 0 }
67
+ ...p === "top" ? { top: 0, order: -1 } : { bottom: 0 }
67
68
  },
68
- children: e && /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(
69
- m,
69
+ children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
70
+ c,
70
71
  {
71
72
  isMobileScreen: o,
72
- event: a,
73
+ event: d,
73
74
  sdk: e,
74
- banner: h,
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(S, { children: e && /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(
84
- m,
85
+ /* @__PURE__ */ r(C, { children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
86
+ c,
85
87
  {
86
88
  isMobileScreen: o,
87
- event: a,
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
- D as Video
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
+ };
@@ -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
  };
@@ -1,48 +1,18 @@
1
- import { useStore as n } from "@nanostores/react";
2
- import { useRef as m, useState as b, useEffect as s, useCallback as c } from "react";
3
- import { FeatureType as E } from "@streamlayer/sdk-web-types";
4
- const F = (e) => {
5
- const a = m(""), [o, r] = b(!1), p = n(e.status), l = n(e.sdkStore.slStreamId), i = n(e.userId()), f = n(e.getActiveFeature()), u = p === "ready" && !!l.data;
6
- s(() => {
7
- const t = e.getFeature(E.GAMES);
8
- t && (t.closeQuestion(), t.closeUser());
9
- }, [f, e]);
10
- const A = c(
11
- (t) => {
12
- a.current = t, r(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: v, err: d }) => {
13
- if (!d && v) {
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
- F as useAppApp
17
+ A as useAppApp
48
18
  };
@@ -1,5 +1,5 @@
1
1
  import { ScrollNodeRef } from '../../..';
2
- import { ScrollStore } from '../../../useSdkScroll';
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 '../../../useSdkResponsive';
3
- import { ScrollStore } from '../../../useSdkScroll';
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 "../../../styles.js";
4
- import { scrollIntoAppView as P } from "../../../useSdkScroll.js";
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 '../../../useSdkResponsive';
3
- import { ScrollStore } from '../../../useSdkScroll';
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 "../../../styles.js";
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 '../../useSdkResponsive';
3
- import { ScrollStore } from '../../useSdkScroll';
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 '../../../useSdkResponsive';
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 '../../../useSdkResponsive';
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 { useImagesPreload as F } from "../../../useImagesPreload.js";
5
- import { scrollIntoAppView as T } from "../../../useSdkScroll.js";
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
- } = F(m);
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 && T(s, h.size, {
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 '../../useSdkResponsive';
3
- import { ScrollStore } from '../../useSdkScroll';
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 "../../useSdkScroll.js";
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";