@streamlayer/react-ui 1.11.4 → 1.12.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 (47) hide show
  1. package/lib/app/app/Advertisement/index.d.ts +1 -0
  2. package/lib/app/app/Advertisement/index.js +86 -67
  3. package/lib/app/app/Features/Gamification/Tabs.js +13 -13
  4. package/lib/app/app/Navigation/index.js +70 -64
  5. package/lib/app/app/Notifications/Onboarding/index.js +66 -72
  6. package/lib/app/app/Notifications/index.d.ts +1 -0
  7. package/lib/app/app/Notifications/index.js +76 -72
  8. package/lib/app/app/index.js +28 -27
  9. package/lib/app/app/story/index.d.ts +3 -1
  10. package/lib/app/app/story/index.js +29 -26
  11. package/lib/app/app/story/promotion/video.js +34 -34
  12. package/lib/app/app/styles.d.ts +5 -0
  13. package/lib/app/app/styles.js +25 -20
  14. package/lib/assets/style.css +1 -1
  15. package/lib/ui/advertisement/index.d.ts +3 -0
  16. package/lib/ui/advertisement/index.js +25 -19
  17. package/lib/ui/advertisement/mock.d.ts +1 -0
  18. package/lib/ui/advertisement/mock.js +39 -5
  19. package/lib/ui/advertisement/overlay/externalAd/controls.d.ts +5 -0
  20. package/lib/ui/advertisement/overlay/externalAd/controls.js +33 -0
  21. package/lib/ui/advertisement/overlay/externalAd/index.d.ts +2 -0
  22. package/lib/ui/advertisement/overlay/externalAd/index.js +121 -0
  23. package/lib/ui/advertisement/overlay/index.d.ts +7 -2
  24. package/lib/ui/advertisement/overlay/index.js +67 -58
  25. package/lib/ui/close-btn/index.d.ts +1 -0
  26. package/lib/ui/close-btn/index.js +25 -23
  27. package/lib/ui/gamification/question/insight/styles.d.ts +10 -2
  28. package/lib/ui/gamification/question/insight/styles.js +8 -7
  29. package/lib/ui/gamification/question/notification/prediction-result/index.js +84 -64
  30. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +2 -0
  31. package/lib/ui/gamification/question/notification/prediction-result/styles.js +36 -26
  32. package/lib/ui/gamification/question/twitter/styles.d.ts +5 -1
  33. package/lib/ui/gamification/question/twitter/styles.js +9 -8
  34. package/lib/ui/gamification/vote/alert/index.js +7 -8
  35. package/lib/ui/gamification/vote/alert/styles.d.ts +1 -0
  36. package/lib/ui/gamification/vote/alert/styles.js +12 -6
  37. package/lib/ui/gamification/vote/vote-option/index.js +59 -58
  38. package/lib/ui/icons/index.d.ts +1 -0
  39. package/lib/ui/icons/index.js +45 -44
  40. package/lib/ui/skeleton/index.d.ts +1 -1
  41. package/lib/ui/theme/constants.d.ts +32 -1
  42. package/lib/ui/theme/constants.js +50 -17
  43. package/lib/ui/theme/masters-theme.js +9 -4
  44. package/lib/ui/theme/theme.js +16 -9
  45. package/lib/ui/video-player/index.d.ts +2 -0
  46. package/lib/ui/video-player/index.js +57 -56
  47. package/package.json +14 -14
@@ -1,62 +1,65 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import { styled as t } from "@linaria/react";
3
- import { useEffect as i } from "react";
4
- import { StreamLayerProvider as l, useStreamLayer as p, StreamLayerSDKEvent as m } from "@streamlayer/react";
5
- import { App as c } from "../index.js";
6
- import { StreamLayerThemeProvider as f } from "../../../ui/theme/index.js";
7
- import { useStreamLayerDebug as u } from "../../../utils/debug/index.js";
8
- import { Video as y } from "./video.js";
1
+ import { jsx as r, jsxs as t } from "react/jsx-runtime";
2
+ import { styled as s } from "@linaria/react";
3
+ import { useEffect as l } from "react";
4
+ import { StreamLayerProvider as p, useStreamLayer as m, StreamLayerSDKEvent as c } from "@streamlayer/react";
5
+ import { App as f } from "../index.js";
6
+ import { StreamLayerThemeProvider as u } from "../../../ui/theme/index.js";
7
+ import { useStreamLayerDebug as y } from "../../../utils/debug/index.js";
8
+ import { Video as h } from "./video.js";
9
9
  const a = () => {
10
10
  console.log("deep link handled cb");
11
- }, h = () => {
11
+ }, k = () => {
12
12
  console.log("video player handled cb");
13
13
  }, v = ({
14
14
  event: o
15
15
  }) => {
16
- const e = p();
17
- return i(() => {
16
+ const e = m();
17
+ return l(() => {
18
18
  e && e.openFeature(12);
19
- }, [e, o]), e ? /* @__PURE__ */ s(f, {
20
- children: [/* @__PURE__ */ r(m, {
19
+ }, [e, o]), e ? /* @__PURE__ */ t(u, {
20
+ customTheme: "dark",
21
+ children: [/* @__PURE__ */ r(c, {
21
22
  event: o
22
- }), /* @__PURE__ */ r(c, {
23
+ }), /* @__PURE__ */ r(f, {
23
24
  sdk: e,
24
25
  event: o,
25
26
  onDeepLinkHandled: a
26
27
  })]
27
28
  }) : null;
28
- }, A = /* @__PURE__ */ t("div")({
29
+ }, A = /* @__PURE__ */ s("div")({
29
30
  name: "Container",
30
31
  class: "c1a4qh28",
31
32
  propsAsIs: !1
32
- }), S = /* @__PURE__ */ t("div")({
33
+ }), S = /* @__PURE__ */ s("div")({
33
34
  name: "Body",
34
35
  class: "b9h8kuk",
35
36
  propsAsIs: !1
36
- }), k = /* @__PURE__ */ t("div")({
37
+ }), C = /* @__PURE__ */ s("div")({
37
38
  name: "AppContainer",
38
39
  class: "a1wkro2j",
39
40
  propsAsIs: !1
40
- }), j = ({
41
+ }), E = ({
41
42
  sdkKey: o,
42
43
  eventId: e,
43
- production: d
44
+ production: d,
45
+ darkMode: i
44
46
  }) => {
45
- const n = u({
47
+ const n = y({
46
48
  sdkKey: o,
47
49
  eventId: e,
48
50
  production: d
49
51
  });
50
- return /* @__PURE__ */ r(l, {
52
+ return /* @__PURE__ */ r(p, {
51
53
  sdkKey: n.sdkKey,
52
54
  production: n.env === "production",
53
55
  autoEnable: !0,
54
56
  onDeepLinkHandled: a,
55
- videoPlayerController: h,
57
+ videoPlayerController: k,
56
58
  withAd: !1,
57
- children: /* @__PURE__ */ s(S, {
58
- children: [/* @__PURE__ */ r(y, {}), /* @__PURE__ */ r(A, {
59
- children: /* @__PURE__ */ r(k, {
59
+ children: /* @__PURE__ */ t(S, {
60
+ className: i ? "dark" : "",
61
+ children: [/* @__PURE__ */ r(h, {}), /* @__PURE__ */ r(A, {
62
+ children: /* @__PURE__ */ r(C, {
60
63
  className: "StreamLayerSDK",
61
64
  children: /* @__PURE__ */ r(v, {
62
65
  event: n.event
@@ -67,5 +70,5 @@ const a = () => {
67
70
  });
68
71
  };
69
72
  export {
70
- j as AppStory
73
+ E as AppStory
71
74
  };
@@ -1,55 +1,55 @@
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";
1
+ import { jsxs as a, Fragment as g, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as y, useState as x, useCallback as P, useEffect as V } from "react";
3
+ import { useStreamLayer as A } from "@streamlayer/react";
4
+ import { StreamLayerSDKAdvertisement as d } from "../../Advertisement/index.js";
5
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 }) => {
6
+ import { PromoButton as C, VideoFrame as w, AdvSidebar as F, VideoPlayerWrap as L, AdvBanner as S, AdvContent as T } from "./styles.js";
7
+ const K = ({ isMobileScreen: o, skipAutoClose: n, sidebar: l, banner: p, event: m, promotionId: s, layoutMode: t }) => {
8
+ const e = A(), u = y(null), [f, v] = x(!1), c = P(({ muted: i }) => {
9
9
  v(i);
10
10
  }, []);
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: () => {
11
+ return V(() => (e == null || e.addVideoPlayerController(c), () => {
12
+ e == null || e.removeVideoPlayerController(c);
13
+ }), [e, c]), /* @__PURE__ */ a(g, { children: [
14
+ s && /* @__PURE__ */ a(C, { onClick: () => {
15
15
  var i;
16
16
  (i = u.current) == null || i.scrollIntoView({ behavior: "smooth" }), setTimeout(() => {
17
- e == null || e.getFeature(12).background.advertisement.show(l);
17
+ e == null || e.getFeature(12).background.advertisement.show(s);
18
18
  }, 200);
19
19
  }, children: [
20
20
  "open promotion: ",
21
- l
21
+ s
22
22
  ] }),
23
- /* @__PURE__ */ r("h3", { children: "Sidebar On Video View and Banner" }),
24
- /* @__PURE__ */ r("p", { children: "On desktop, the width limit is 344px, and for mobile screens, it is 300px as designed." }),
25
- /* @__PURE__ */ n(F, { ref: u, "data-testid": "video-frame", children: [
23
+ /* @__PURE__ */ a(w, { ref: u, "data-testid": "video-frame", children: [
26
24
  /* @__PURE__ */ r(
27
- S,
25
+ F,
28
26
  {
29
27
  style: {
30
28
  ...t === "cover" ? { position: "absolute" } : {},
31
- ...s === "left" ? { left: 0 } : { right: 0, order: 3 },
29
+ ...l === "left" ? { left: 0 } : { right: 0, order: 3 },
32
30
  ...o ? { maxWidth: "calc(300px + env(safe-area-inset-left))" } : {}
33
31
  },
34
32
  children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
35
- c,
33
+ d,
36
34
  {
37
35
  isMobileScreen: o,
38
- event: d,
36
+ event: m,
39
37
  sdk: e,
40
- sidebar: s,
38
+ sidebar: l,
41
39
  layoutMode: t,
42
- skipAutoClose: a,
40
+ skipAutoClose: n,
41
+ skipTypeCheck: !0,
42
+ externalAd: !0,
43
43
  persistent: !0
44
44
  }
45
45
  ) })
46
46
  }
47
47
  ),
48
- /* @__PURE__ */ n(A, { children: [
48
+ /* @__PURE__ */ a(L, { children: [
49
49
  /* @__PURE__ */ r("div", { className: "divAnchor", children: /* @__PURE__ */ r(
50
50
  "video",
51
51
  {
52
- src: "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
52
+ src: "https://storage.googleapis.com/gvabox/media/samples/stock.mp4",
53
53
  muted: f,
54
54
  width: "100%",
55
55
  height: "100%",
@@ -60,21 +60,21 @@ const E = ({ isMobileScreen: o, skipAutoClose: a, sidebar: s, banner: p, event:
60
60
  }
61
61
  ) }),
62
62
  /* @__PURE__ */ r(
63
- B,
63
+ S,
64
64
  {
65
65
  style: {
66
66
  ...t === "cover" ? { position: "absolute" } : {},
67
67
  ...p === "top" ? { top: 0, order: -1 } : { bottom: 0 }
68
68
  },
69
69
  children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
70
- c,
70
+ d,
71
71
  {
72
72
  isMobileScreen: o,
73
- event: d,
73
+ event: m,
74
74
  sdk: e,
75
75
  banner: p,
76
76
  layoutMode: t,
77
- skipAutoClose: a,
77
+ skipAutoClose: n,
78
78
  persistent: !0
79
79
  }
80
80
  ) })
@@ -82,20 +82,20 @@ const E = ({ isMobileScreen: o, skipAutoClose: a, sidebar: s, banner: p, event:
82
82
  )
83
83
  ] })
84
84
  ] }),
85
- /* @__PURE__ */ r(C, { children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
86
- c,
85
+ /* @__PURE__ */ r(T, { children: e && /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
86
+ d,
87
87
  {
88
88
  isMobileScreen: o,
89
- event: d,
89
+ event: m,
90
90
  sdk: e,
91
- sidebar: s,
91
+ sidebar: l,
92
92
  layoutMode: t,
93
- skipAutoClose: a,
93
+ skipAutoClose: n,
94
94
  persistent: !0
95
95
  }
96
96
  ) }) })
97
97
  ] });
98
98
  };
99
99
  export {
100
- E as Video
100
+ K as Video
101
101
  };
@@ -6,6 +6,11 @@ export declare const SDKWhiteContainer: {
6
6
  } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
7
7
  as?: React.ElementType;
8
8
  }>;
9
+ export declare const SDKSummaryContainer: {
10
+ __wyw_meta: unknown;
11
+ } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
12
+ as?: React.ElementType;
13
+ }>;
9
14
  export declare const TabsContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
10
15
  export declare const LeaderboardContainer: {
11
16
  __wyw_meta: unknown;
@@ -1,44 +1,49 @@
1
1
  import { styled as s } from "@linaria/react";
2
- const i = /* @__PURE__ */ s("div")({
2
+ const p = /* @__PURE__ */ s("div")({
3
3
  name: "SDKContainer",
4
4
  class: "sopqfe6",
5
5
  propsAsIs: !1
6
- }), p = /* @__PURE__ */ s("div")({
6
+ }), c = /* @__PURE__ */ s("div")({
7
7
  name: "SDKScrollContainer",
8
8
  class: "s102vcph",
9
9
  propsAsIs: !1
10
- }), e = /* @__PURE__ */ s("div")({
10
+ }), n = /* @__PURE__ */ s("div")({
11
11
  name: "SDKContentContainer",
12
12
  class: "s1meqjjv",
13
13
  propsAsIs: !1
14
- }), a = () => e, n = /* @__PURE__ */ s(a())({
14
+ }), e = () => n, a = /* @__PURE__ */ s(e())({
15
15
  name: "SDKWhiteContainer",
16
16
  class: "s1burm22",
17
17
  propsAsIs: !0
18
- }), c = /* @__PURE__ */ s("div")({
18
+ }), r = () => a, m = /* @__PURE__ */ s(r())({
19
+ name: "SDKSummaryContainer",
20
+ class: "sm5r3j5",
21
+ propsAsIs: !0
22
+ }), l = /* @__PURE__ */ s("div")({
19
23
  name: "TabsContainer",
20
- class: "tm5r3j5",
24
+ class: "tysxwr6",
21
25
  propsAsIs: !1
22
- }), o = () => n, l = /* @__PURE__ */ s(o())({
26
+ }), o = () => n, C = /* @__PURE__ */ s(o())({
23
27
  name: "LeaderboardContainer",
24
- class: "lysxwr6",
28
+ class: "l9er3b1",
25
29
  propsAsIs: !0
26
- }), r = () => n, C = /* @__PURE__ */ s(r())({
30
+ }), t = () => a, S = /* @__PURE__ */ s(t())({
27
31
  name: "TabsNavContainer",
28
- class: "t9er3b1",
32
+ class: "t19dtrb3",
29
33
  propsAsIs: !0
30
- }), m = /* @__PURE__ */ s("div")({
34
+ }), d = /* @__PURE__ */ s("div")({
31
35
  name: "UserSummaryContainer",
32
- class: "u19dtrb3",
36
+ class: "u1552n3j",
33
37
  propsAsIs: !1
34
38
  });
35
39
  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
40
+ C as LeaderboardContainer,
41
+ p as SDKContainer,
42
+ n as SDKContentContainer,
43
+ c as SDKScrollContainer,
44
+ m as SDKSummaryContainer,
45
+ a as SDKWhiteContainer,
46
+ l as TabsContainer,
47
+ S as TabsNavContainer,
48
+ d as UserSummaryContainer
44
49
  };