@streamlayer/react-ui 1.32.4 → 1.33.2

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 (67) hide show
  1. package/lib/app/app/Advertisement/index.js +14 -15
  2. package/lib/app/app/Features/Gamification/Leaderboard.js +46 -36
  3. package/lib/app/app/Features/Gamification/Question.js +42 -42
  4. package/lib/app/app/Features/Gamification/QuestionAdvertisement.js +19 -25
  5. package/lib/app/app/Features/Gamification/index.js +29 -28
  6. package/lib/app/app/Notifications/Onboarding/index.js +45 -42
  7. package/lib/app/app/story/index.js +24 -24
  8. package/lib/app/app/story/insight/index.js +14 -15
  9. package/lib/app/app/story/insight/video.js +3 -3
  10. package/lib/app/app/story/promotion/content.js +5 -5
  11. package/lib/app/app/story/promotion/index.d.ts +1 -0
  12. package/lib/app/app/story/promotion/index.js +24 -25
  13. package/lib/app/app/story/promotion/video.d.ts +0 -1
  14. package/lib/app/app/story/promotion/video.js +41 -43
  15. package/lib/app/app/story/promotion-notification/index.js +15 -16
  16. package/lib/app/app/story/promotion-notification/video.d.ts +0 -1
  17. package/lib/app/app/story/promotion-notification/video.js +22 -30
  18. package/lib/app/app/story/settings/index.js +6 -6
  19. package/lib/app/app/story/settings/login.js +1 -1
  20. package/lib/app/app/story/video.js +28 -28
  21. package/lib/app/login/demo.js +19 -18
  22. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +0 -1
  23. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +17 -17
  24. package/lib/app/masters/Notifications/Onboarding/index.js +42 -39
  25. package/lib/app/masters/masters.d.ts +1 -0
  26. package/lib/app/masters/masters.js +34 -32
  27. package/lib/app/masters/provider.d.ts +4 -0
  28. package/lib/app/masters/provider.js +23 -0
  29. package/lib/app/masters/story/components.js +48 -52
  30. package/lib/app/masters/story/index.js +16 -15
  31. package/lib/app/tgl/index.d.ts +1 -0
  32. package/lib/app/tgl/index.js +19 -20
  33. package/lib/app/tgl/video.d.ts +0 -1
  34. package/lib/app/tgl/video.js +40 -42
  35. package/lib/app/webos/ExposedPauseAd/PauseAd.js +68 -68
  36. package/lib/app/webos/story.js +26 -26
  37. package/lib/app/webos/ui/Sidebar/styles.js +82 -888
  38. package/lib/assets/style.css +1 -1
  39. package/lib/core/app.d.ts +7 -0
  40. package/lib/core/app.js +14 -0
  41. package/lib/core/event.d.ts +6 -0
  42. package/lib/core/event.js +5 -0
  43. package/lib/core/hooks.d.ts +16 -0
  44. package/lib/core/hooks.js +8 -0
  45. package/lib/core/provider.d.ts +49 -0
  46. package/lib/core/provider.js +9 -0
  47. package/lib/hooks-B0Qttldg.js +99 -0
  48. package/lib/index.d.ts +0 -1
  49. package/lib/index.js +2 -4
  50. package/lib/ui/advertisement/banner/index.d.ts +2 -2
  51. package/lib/ui/advertisement/notification/lower-third/index.js +34 -30
  52. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +100 -33212
  53. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js +13 -13
  54. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +63 -204
  55. package/lib/ui/gamification/leaderboard/static.d.ts +1 -1
  56. package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.d.ts +1 -1
  57. package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.js +1 -1
  58. package/lib/ui/icons/index.d.ts +198 -66
  59. package/lib/ui/video-player/index.js +26 -23
  60. package/lib/useStreamLayerApp.d.ts +23 -0
  61. package/lib/useStreamLayerApp.js +167 -0
  62. package/lib/utils/debug/index.js +8 -8
  63. package/package.json +42 -35
  64. package/lib/index-l-eyvmpL.js +0 -3758
  65. package/lib/utils/createDemo.d.ts +0 -12
  66. package/lib/utils/createDemo.js +0 -49
  67. package/lib/vast-client.min-B0NUra1B.js +0 -1060
@@ -1,26 +1,26 @@
1
- import { jsx as a, jsxs as x } from "react/jsx-runtime";
2
- import { cx as F } from "@linaria/core";
3
- import { useFocusable as G } from "@noriginmedia/norigin-spatial-navigation";
4
- import { useState as w, useRef as L, useCallback as B, useEffect as P } from "react";
5
- import { useStore as I } from "@streamlayer/react-polyfills";
6
- import { eventBus as S } from "@streamlayer/sdk-web-interfaces";
7
- import { useLoadGAMStatic as C } from "../../../ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js";
8
- import { PauseAdOverlay as N, PauseAdContent as j, PauseAdTopLeft as K, PauseAdTitle as O, PauseAdCaption as V, PauseAdBottomLeft as $, PauseAdPlayButton as _, PauseAdSidebarGradient as q, PauseAdSidebar as z, PauseAdTitleDescription as H, ExternalAdContainer as D } from "./styles.js";
9
- const J = ({ vastUrl: r, isDesktop: n }) => {
10
- var u;
11
- const [, y] = C(), e = I(y, { keys: [r] });
12
- return P(() => {
13
- e && e[r] && e[r].imageSrc && e[r].id && S.emit("exposedPauseAd", {
1
+ import { jsx as u, jsxs as b } from "react/jsx-runtime";
2
+ import { cx as G } from "@linaria/core";
3
+ import { useFocusable as I } from "@noriginmedia/norigin-spatial-navigation";
4
+ import { useState as B, useRef as E, useCallback as C, useEffect as y } from "react";
5
+ import { useStore as N } from "@streamlayer/react-polyfills";
6
+ import { eventBus as g } from "@streamlayer/sdk-web-interfaces";
7
+ import { useLoadGAMStatic as M } from "../../../ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js";
8
+ import { PauseAdOverlay as j, PauseAdContent as K, PauseAdTopLeft as O, PauseAdTitle as V, PauseAdCaption as $, PauseAdBottomLeft as _, PauseAdPlayButton as q, PauseAdSidebarGradient as z, PauseAdSidebar as H, PauseAdTitleDescription as J, ExternalAdContainer as D } from "./styles.js";
9
+ const Q = ({ vastUrl: r, isDesktop: o }) => {
10
+ var a;
11
+ const [, h] = M(), e = N(h, { keys: [r] });
12
+ return y(() => {
13
+ e && e[r] && e[r].imageSrc && e[r].id && g.emit("exposedPauseAd", {
14
14
  action: "rendered",
15
15
  payload: {
16
16
  id: e[r].id
17
17
  }
18
18
  });
19
- }, [e, r]), (u = e == null ? void 0 : e[r]) != null && u.imageSrc ? !e[r].adUrl || !n ? /* @__PURE__ */ a(D, { src: e[r].imageSrc }) : /* @__PURE__ */ a(
19
+ }, [e, r]), (a = e == null ? void 0 : e[r]) != null && a.imageSrc ? !e[r].adUrl || !o ? /* @__PURE__ */ u(D, { src: e[r].imageSrc }) : /* @__PURE__ */ u(
20
20
  "a",
21
21
  {
22
22
  onClick: () => {
23
- S.emit("exposedPauseAd", {
23
+ g.emit("exposedPauseAd", {
24
24
  action: "navigated",
25
25
  payload: {
26
26
  id: e[r].id
@@ -30,101 +30,101 @@ const J = ({ vastUrl: r, isDesktop: n }) => {
30
30
  href: e[r].adUrl,
31
31
  target: "_blank",
32
32
  rel: "noopener noreferrer",
33
- children: /* @__PURE__ */ a(D, { src: e[r].imageSrc })
33
+ children: /* @__PURE__ */ u(D, { src: e[r].imageSrc })
34
34
  }
35
35
  ) : null;
36
- }, Q = ({ isClosing: r, title: n, caption: y, onPlay: e, onClose: u, vastUrl: f, options: t, isDesktop: m }) => {
37
- const T = (t == null ? void 0 : t.showPauseButton) ?? !0, { ref: d, focusSelf: p } = G({
36
+ }, W = ({ isClosing: r, title: o, caption: h, onPlay: e, onClose: a, vastUrl: f, options: t, isDesktop: m }) => {
37
+ const T = (t == null ? void 0 : t.showPauseButton) ?? !0, { ref: s, focusSelf: p } = I({
38
38
  focusKey: "sl-pause-ad-play",
39
39
  onEnterRelease: e,
40
40
  isFocusBoundary: !0,
41
41
  forceFocus: !0
42
42
  });
43
- return P(() => {
44
- d.current && p();
45
- }, [d, p]), P(() => {
46
- if (!u)
43
+ return y(() => {
44
+ s.current && p();
45
+ }, [s, p]), y(() => {
46
+ if (!a)
47
47
  return () => {
48
48
  };
49
- const h = (A) => {
50
- const s = A.keyCode;
51
- if (s === 461 || s === 10009 || s === 27 || s === 8) {
52
- A.preventDefault(), A.stopPropagation(), A.stopImmediatePropagation(), u();
49
+ const S = (A) => {
50
+ const d = A.keyCode;
51
+ if (d === 461 || d === 10009 || d === 27 || d === 8) {
52
+ A.preventDefault(), A.stopPropagation(), A.stopImmediatePropagation(), a();
53
53
  return;
54
54
  }
55
55
  };
56
- return window.addEventListener("keydown", h, { capture: !0 }), () => window.removeEventListener("keydown", h, { capture: !0 });
57
- }, [u]), /* @__PURE__ */ a(N, { className: F("SL_PauseAdOverlay", r && "pause-ad-closing"), children: /* @__PURE__ */ x(j, { children: [
58
- /* @__PURE__ */ x(K, { children: [
59
- /* @__PURE__ */ a(O, { children: n }),
60
- /* @__PURE__ */ a(V, { children: y })
56
+ return window.addEventListener("keydown", S, { capture: !0 }), () => window.removeEventListener("keydown", S, { capture: !0 });
57
+ }, [a]), /* @__PURE__ */ u(j, { className: G("SL_PauseAdOverlay", r && "pause-ad-closing"), children: /* @__PURE__ */ b(K, { children: [
58
+ /* @__PURE__ */ b(O, { children: [
59
+ /* @__PURE__ */ u(V, { children: o }),
60
+ /* @__PURE__ */ u($, { children: h })
61
61
  ] }),
62
- T && /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(
63
- _,
62
+ T && /* @__PURE__ */ u(_, { children: /* @__PURE__ */ u(
63
+ q,
64
64
  {
65
- ref: d,
65
+ ref: s,
66
66
  onClick: e,
67
- onMouseEnter: () => d.current.focus(),
67
+ onMouseEnter: () => s.current.focus(),
68
68
  "aria-label": "Resume playback"
69
69
  }
70
70
  ) }),
71
- /* @__PURE__ */ a(q, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ x(z, { children: [
72
- f && /* @__PURE__ */ a(J, { isDesktop: m, vastUrl: f }),
73
- /* @__PURE__ */ a(H, { children: "ADVERTISEMENT" })
71
+ /* @__PURE__ */ u(z, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ b(H, { children: [
72
+ f && /* @__PURE__ */ u(Q, { isDesktop: m, vastUrl: f }),
73
+ /* @__PURE__ */ u(J, { children: "ADVERTISEMENT" })
74
74
  ] }) })
75
75
  ] }) });
76
- }, re = ({ showPauseAd: r, vastUrls: n, title: y, caption: e, sdk: u, onClose: f, onRender: t, options: m, isDesktop: T }) => {
77
- const d = (m == null ? void 0 : m.pauseAdDelay) ?? 5e3, [p, h] = w(!1), [A, s] = w(!1), c = L(), i = n == null ? void 0 : n[0].url, g = L(i);
78
- g.current = i;
79
- const [b, E] = C(), o = B(() => {
80
- f && (S.emit("exposedPauseAd", {
76
+ }, te = ({ showPauseAd: r, vastUrls: o, title: h, caption: e, sdk: a, onClose: f, onRender: t, options: m, isDesktop: T }) => {
77
+ const s = (m == null ? void 0 : m.pauseAdDelay) ?? 5e3, [p, S] = B(!1), [A, d] = B(!1), c = E(), i = o == null ? void 0 : o[0].url, P = E(i), x = E("");
78
+ P.current = i;
79
+ const [k, w] = M(), n = C(() => {
80
+ f && (x.current = P.current, g.emit("exposedPauseAd", {
81
81
  action: "closed",
82
82
  payload: {}
83
83
  }), f());
84
- }, [f]), M = B(() => {
85
- u.controlVideoPlayer({ play: !0 });
86
- }, [u]);
87
- return P(() => {
84
+ }, [f]), F = C(() => {
85
+ a.controlVideoPlayer({ play: !0 });
86
+ }, [a]);
87
+ return y(() => {
88
88
  if (r && i) {
89
- S.emit("exposedPauseAd", {
89
+ g.emit("exposedPauseAd", {
90
90
  action: "enabled",
91
91
  payload: {}
92
- }), b(i).then((l) => {
93
- g.current === i && (l == null ? void 0 : l.success) !== !0 && (clearTimeout(c.current), o == null || o());
92
+ }), k(i).then((l) => {
93
+ P.current === i && (l == null ? void 0 : l.success) !== !0 && (clearTimeout(c.current), n == null || n());
94
94
  }).catch(() => {
95
- g.current === i && (clearTimeout(c.current), o == null || o());
95
+ P.current === i && (clearTimeout(c.current), n == null || n());
96
96
  });
97
- const k = () => {
98
- const l = E.get()[g.current];
99
- l != null && l.imageSrc ? (clearTimeout(c.current), s(!1), h(!0)) : c.current = setTimeout(() => {
100
- k();
97
+ const L = () => {
98
+ const l = w.get()[P.current];
99
+ l != null && l.imageSrc ? (clearTimeout(c.current), d(!1), S(!0)) : c.current = setTimeout(() => {
100
+ L();
101
101
  }, 200);
102
102
  };
103
103
  c.current = setTimeout(() => {
104
- k();
105
- }, d);
104
+ L();
105
+ }, s);
106
106
  } else
107
- S.emit("exposedPauseAd", {
107
+ x.current !== P.current && (x.current = "", g.emit("exposedPauseAd", {
108
108
  action: "disabled",
109
109
  payload: {}
110
- }), s(!0), c.current = setTimeout(() => {
111
- h(!1);
110
+ })), d(!0), c.current = setTimeout(() => {
111
+ S(!1);
112
112
  }, 400);
113
113
  return () => {
114
114
  c.current && clearTimeout(c.current);
115
115
  };
116
- }, [E, b, o, d, r, i]), P(() => {
116
+ }, [w, k, n, s, r, i]), y(() => {
117
117
  t == null || t({ rendered: p });
118
- }, [p, t]), P(() => () => {
118
+ }, [p, t]), y(() => () => {
119
119
  t == null || t({ rendered: !1 });
120
- }, [t]), p ? /* @__PURE__ */ a(
121
- Q,
120
+ }, [t]), p ? /* @__PURE__ */ u(
121
+ W,
122
122
  {
123
- onClose: o,
123
+ onClose: n,
124
124
  isClosing: A,
125
- title: y,
125
+ title: h,
126
126
  caption: e,
127
- onPlay: M,
127
+ onPlay: F,
128
128
  vastUrl: i,
129
129
  options: m,
130
130
  isDesktop: T
@@ -132,5 +132,5 @@ const J = ({ vastUrl: r, isDesktop: n }) => {
132
132
  ) : null;
133
133
  };
134
134
  export {
135
- re as PauseAd
135
+ te as PauseAd
136
136
  };
@@ -1,16 +1,16 @@
1
- import { jsx as a, jsxs as p, Fragment as f } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as p, Fragment as f } from "react/jsx-runtime";
2
+ import { d as y, u as d } from "../../hooks-B0Qttldg.js";
2
3
  import c from "hls.js";
3
- import { useRef as m, useState as d, useEffect as i } from "react";
4
- import { StreamLayerProvider as y, useStreamLayer as l, useStreamLayerUI as S } from "@streamlayer/react";
5
- import { anonymous as h } from "@streamlayer/sdk-web-anonymous-auth";
6
- import { useStreamLayerDebug as b } from "../../utils/debug/index.js";
7
- import { StreamLayerSDKTv as g } from "./index.js";
8
- const w = ({ src: r }) => {
9
- const e = m(), n = m(), [t, o] = d(r);
4
+ import { useRef as m, useState as l, useEffect as i } from "react";
5
+ import { anonymous as S } from "@streamlayer/sdk-web-anonymous-auth";
6
+ import { useStreamLayerDebug as h } from "../../utils/debug/index.js";
7
+ import { StreamLayerSDKTv as b } from "./index.js";
8
+ const g = ({ src: r }) => {
9
+ const e = m(), a = m(), [t, o] = l(r);
10
10
  return i(() => {
11
11
  o(r);
12
12
  }, [r]), i(() => () => {
13
- n.current && clearTimeout(n.current);
13
+ a.current && clearTimeout(a.current);
14
14
  }, []), i(() => {
15
15
  if (t && t.includes("m3u8"))
16
16
  if (c.isSupported() && e.current) {
@@ -24,7 +24,7 @@ const w = ({ src: r }) => {
24
24
  var u;
25
25
  console.error(s), (u = e.current) == null || u.play();
26
26
  }));
27
- }, [t]), /* @__PURE__ */ a(
27
+ }, [t]), /* @__PURE__ */ n(
28
28
  "video",
29
29
  {
30
30
  src: t || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
@@ -39,35 +39,35 @@ const w = ({ src: r }) => {
39
39
  }
40
40
  );
41
41
  }, v = () => {
42
- const r = l(), [e, n] = d("");
42
+ const r = d(), [e, a] = l("");
43
43
  return i(() => r ? r.streamSummary().subscribe((t) => {
44
44
  var o, s;
45
- (s = (o = t.data) == null ? void 0 : o.summary) != null && s.stream && n(t.data.summary.stream);
45
+ (s = (o = t.data) == null ? void 0 : o.summary) != null && s.stream && a(t.data.summary.stream);
46
46
  }) : () => {
47
- }, [r]), /* @__PURE__ */ a(
48
- w,
47
+ }, [r]), /* @__PURE__ */ n(
48
+ g,
49
49
  {
50
50
  src: e || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4"
51
51
  }
52
52
  );
53
- }, k = ({ sdk: r }) => (i(() => {
53
+ }, w = ({ sdk: r }) => (i(() => {
54
54
  r.anonymousAuthorization();
55
- }, [r]), null), L = ({ persistent: r }) => {
56
- const e = l(), n = S();
55
+ }, [r]), null), k = ({ persistent: r }) => {
56
+ const e = d();
57
57
  return e ? /* @__PURE__ */ p(f, { children: [
58
- /* @__PURE__ */ a(k, { sdk: e }),
59
- /* @__PURE__ */ a(g, { sdk: e, persistent: r, uiState: n, children: /* @__PURE__ */ a(v, {}) })
58
+ /* @__PURE__ */ n(w, { sdk: e }),
59
+ /* @__PURE__ */ n(b, { sdk: e, persistent: r, children: /* @__PURE__ */ n(v, {}) })
60
60
  ] }) : null;
61
- }, R = /* @__PURE__ */ new Set([h]), P = ({ sdkKey: r, eventId: e, persistent: n, production: t }) => {
62
- const o = b({ sdkKey: r, eventId: e, production: t });
63
- return /* @__PURE__ */ a(
61
+ }, L = /* @__PURE__ */ new Set([S]), K = ({ sdkKey: r, eventId: e, persistent: a, production: t }) => {
62
+ const o = h({ sdkKey: r, eventId: e, production: t });
63
+ return /* @__PURE__ */ n(
64
64
  y,
65
65
  {
66
66
  event: o.event,
67
67
  sdkKey: o.sdkKey,
68
68
  production: o.env === "production",
69
69
  themeMode: "dark",
70
- plugins: R,
70
+ plugins: L,
71
71
  autoEnable: !0,
72
72
  withAd: !0,
73
73
  skipOnboarding: !0,
@@ -75,11 +75,11 @@ const w = ({ src: r }) => {
75
75
  friendsTab: "disabled",
76
76
  hideFriends: !0,
77
77
  webOS: !0,
78
- children: /* @__PURE__ */ a(L, { persistent: n })
78
+ children: /* @__PURE__ */ n(k, { persistent: a })
79
79
  }
80
80
  );
81
81
  };
82
82
  export {
83
- w as Player,
84
- P as WebOSStory
83
+ g as Player,
84
+ K as WebOSStory
85
85
  };