@streamlayer/react-ui 1.9.0 → 1.11.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 (87) 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 +22 -21
  6. package/lib/app/app/Features/Gamification/index.js +66 -62
  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/index.d.ts +4 -0
  10. package/lib/app/app/Navigation/index.js +88 -48
  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 -83
  15. package/lib/app/app/story/index.js +27 -24
  16. package/lib/app/app/story/insight/index.d.ts +1 -0
  17. package/lib/app/app/story/insight/index.js +29 -26
  18. package/lib/app/app/story/insight/video.d.ts +1 -0
  19. package/lib/app/app/story/insight/video.js +13 -13
  20. package/lib/app/app/story/promotion/content.d.ts +3 -1
  21. package/lib/app/app/story/promotion/content.js +13 -10
  22. package/lib/app/app/story/promotion/index.d.ts +1 -0
  23. package/lib/app/app/story/promotion/index.js +34 -30
  24. package/lib/app/app/story/promotion/video.d.ts +1 -0
  25. package/lib/app/app/story/promotion/video.js +34 -31
  26. package/lib/app/app/styles.js +44 -0
  27. package/lib/app/app/useApp.d.ts +2 -14
  28. package/lib/app/app/useApp.js +14 -43
  29. package/lib/app/app/useAppContext.d.ts +2 -0
  30. package/lib/app/app/useAppContext.js +6 -5
  31. package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
  32. package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
  33. package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
  34. package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
  35. package/lib/app/masters/Features/Gamification/index.js +1 -1
  36. package/lib/app/masters/Features/index.d.ts +2 -2
  37. package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
  38. package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
  39. package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
  40. package/lib/app/masters/Notifications/index.d.ts +2 -2
  41. package/lib/app/masters/Notifications/index.js +1 -1
  42. package/lib/app/masters/masters.js +23 -23
  43. package/lib/app/masters/styles.d.ts +20 -0
  44. package/lib/app/{styles.js → masters/styles.js} +15 -15
  45. package/lib/app/masters/useSdkResponsive.d.ts +15 -0
  46. package/lib/app/masters/useSdkResponsive.js +45 -0
  47. package/lib/app/masters/useSdkScroll.d.ts +12 -0
  48. package/lib/app/masters/useSdkScroll.js +50 -0
  49. package/lib/app/useSdkResponsive.d.ts +1 -0
  50. package/lib/app/useSdkResponsive.js +27 -29
  51. package/lib/app/useSdkScroll.js +25 -24
  52. package/lib/assets/style.css +1 -1
  53. package/lib/ui/advertisement/banner/index.js +14 -11
  54. package/lib/ui/advertisement/index.d.ts +3 -0
  55. package/lib/ui/advertisement/index.js +31 -10
  56. package/lib/ui/advertisement/notification/index.d.ts +1 -0
  57. package/lib/ui/advertisement/notification/index.js +30 -27
  58. package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
  59. package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
  60. package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
  61. package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
  62. package/lib/ui/advertisement/overlay/index.d.ts +2 -0
  63. package/lib/ui/advertisement/overlay/index.js +58 -43
  64. package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
  65. package/lib/ui/advertisement/overlay/styles.js +41 -52
  66. package/lib/ui/close-btn/index.d.ts +7 -0
  67. package/lib/ui/close-btn/index.js +47 -0
  68. package/lib/ui/gamification/detail/header/index.d.ts +2 -1
  69. package/lib/ui/gamification/detail/header/index.js +16 -15
  70. package/lib/ui/gamification/vote/styles.js +1 -1
  71. package/lib/ui/navigation/button/FeaturedGroups.d.ts +1 -1
  72. package/lib/ui/navigation/index.d.ts +5 -3
  73. package/lib/ui/navigation/index.js +11 -12
  74. package/lib/ui/navigation/masters.js +1 -1
  75. package/lib/ui/navigation/styles.d.ts +5 -0
  76. package/lib/ui/navigation/styles.js +16 -0
  77. package/lib/ui/questions/insight/index.js +21 -20
  78. package/lib/ui/theme/masters-theme.js +36 -13
  79. package/lib/ui/theme/theme.js +25 -26
  80. package/lib/ui/timer/index.d.ts +3 -1
  81. package/lib/ui/timer/index.js +54 -32
  82. package/lib/ui/video-player/index.d.ts +2 -0
  83. package/lib/ui/video-player/index.js +62 -51
  84. package/lib/ui/video-player/styles.d.ts +1 -0
  85. package/lib/ui/video-player/styles.js +7 -6
  86. package/package.json +15 -15
  87. /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
@@ -1,21 +1,24 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { SlideIn as l } from "../../slide-in/index.js";
3
- import { BannerContainer as d, BannerLink as m } from "./styles.js";
4
- const c = ({ promotion: a, promotionId: e, hiding: t, direction: i = "bottom" }) => {
5
- var r;
6
- return (r = a.additionalBanner) != null && r.imageUrl ? /* @__PURE__ */ n(l, { direction: i, hiding: t, children: /* @__PURE__ */ n(d, { className: "BannerContainer", children: /* @__PURE__ */ n(
7
- m,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { SlideIn as m } from "../../slide-in/index.js";
3
+ import { BannerContainer as o, BannerLink as s } from "./styles.js";
4
+ const B = ({ promotion: a, promotionId: i, hiding: l, direction: d = "bottom" }) => {
5
+ var e, t;
6
+ if (!((e = a.additionalBanner) != null && e.imageUrl))
7
+ return null;
8
+ let n = (t = a.banner) == null ? void 0 : t.url;
9
+ return n && n.indexOf("http") !== 0 && (n = `https://${n}`), /* @__PURE__ */ r(m, { direction: d, hiding: l, children: /* @__PURE__ */ r(o, { className: "BannerContainer", children: /* @__PURE__ */ r(
10
+ s,
8
11
  {
9
12
  className: "BannerLink",
10
- href: a.additionalBanner.url,
13
+ href: n,
11
14
  style: { backgroundImage: `url(${a.additionalBanner.imageUrl})` },
12
- "data-promo-id": e,
15
+ "data-promo-id": i,
13
16
  "data-promo-type": a.type,
14
17
  "data-analytics": "banner",
15
18
  target: "_blank"
16
19
  }
17
- ) }) }) : null;
20
+ ) }) });
18
21
  };
19
22
  export {
20
- c as Banner
23
+ B as Banner
21
24
  };
@@ -4,7 +4,10 @@ export declare const AdvertisementUI: React.FC<{
4
4
  layoutMode?: 'cover' | 'side-by-side';
5
5
  sidebar?: 'left' | 'right';
6
6
  banner?: 'top' | 'bottom';
7
+ open?: () => void;
7
8
  close?: () => void;
9
+ markAsViewed?: () => void;
8
10
  isNotification?: boolean;
9
11
  skipTypeCheck?: boolean;
12
+ skipAutoClose?: boolean;
10
13
  }>;
@@ -1,20 +1,41 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { PromotionType as r } from "@streamlayer/sdk-web-types";
3
- import { Banner as c } from "./banner/index.js";
4
- import { Notification as y } from "./notification/index.js";
5
- import { Overlay as u } from "./overlay/index.js";
6
- import { Sidebar as A } from "./sidebar/index.js";
7
- import { OverlayContainer as a } from "./overlay/styles.js";
8
- const d = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i == null ? void 0 : i.type) === r.INGAME_IAB21_LBAR, B = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11 || (i == null ? void 0 : i.type) === r.INGAME_IAB21, C = ({
3
+ import { Banner as a } from "./banner/index.js";
4
+ import { Notification as d } from "./notification/index.js";
5
+ import { Overlay as c } from "./overlay/index.js";
6
+ import { Sidebar as B } from "./sidebar/index.js";
7
+ import { OverlayContainer as N } from "./overlay/styles.js";
8
+ const _ = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i == null ? void 0 : i.type) === r.INGAME_IAB21_LBAR, M = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11 || (i == null ? void 0 : i.type) === r.INGAME_IAB21, C = ({
9
9
  advertisement: i,
10
10
  close: t,
11
11
  skipTypeCheck: l,
12
- layoutMode: N = "side-by-side",
12
+ skipAutoClose: u,
13
+ layoutMode: p = "side-by-side",
13
14
  sidebar: n,
14
- isNotification: I,
15
- banner: f
16
- }) => i.promotion ? I && i.notification ? /* @__PURE__ */ o(y, { notification: i.notification, promotionId: i.question.id }) : !n && !f && (l || B(i.promotion)) ? /* @__PURE__ */ o(a, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(u, { promotionId: i.question.id, promotion: i.promotion, onClose: t }) }) : n && (l || d(i.promotion)) ? /* @__PURE__ */ o(A, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ o(u, { promotionId: i.question.id, promotion: i.promotion, onClose: t }) }) : f ? /* @__PURE__ */ o(
15
+ isNotification: y,
16
+ banner: f,
17
+ markAsViewed: I,
18
+ open: A
19
+ }) => i.promotion ? y && i.notification ? /* @__PURE__ */ o(d, { open: A, notification: i.notification, promotionId: i.question.id }) : !n && !f && (l || M(i.promotion)) ? /* @__PURE__ */ o(N, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(
17
20
  c,
21
+ {
22
+ markAsViewed: I,
23
+ promotionId: i.question.id,
24
+ promotion: i.promotion,
25
+ onClose: t,
26
+ skipAutoClose: u
27
+ }
28
+ ) }) : n && (l || _(i.promotion)) ? /* @__PURE__ */ o(B, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ o(
29
+ c,
30
+ {
31
+ markAsViewed: I,
32
+ promotionId: i.question.id,
33
+ promotion: i.promotion,
34
+ onClose: t,
35
+ skipAutoClose: u
36
+ }
37
+ ) }) : f ? /* @__PURE__ */ o(
38
+ a,
18
39
  {
19
40
  promotionId: i.question.id,
20
41
  hiding: !1,
@@ -8,4 +8,5 @@ export declare const Notification: React.FC<{
8
8
  promotionId: string;
9
9
  direction?: 'left' | 'right';
10
10
  hiding?: boolean;
11
+ open?: () => void;
11
12
  }>;
@@ -1,38 +1,41 @@
1
- import { jsx as i, jsxs as n } from "react/jsx-runtime";
2
- import { NotificationPromotionImagePosition as r, NotificationEnabled as M, NotificationSponsorLogoMode as C, CtaIconMode as O } from "@streamlayer/sdk-web-types";
3
- import { SlideIn as T } from "../../slide-in/index.js";
4
- import { MediaImgFit as c, MediaImgCentered as h, MediaImgBottom as f, MediaImgSolid as E, MediaImgMiddle as S, NotificationContainer as L, Logo as _, NotificationContent as b, Body as A, Title as P, Text as R, Button as x, CtaIcon as D, StyledChevronRight as y } from "./styles.js";
5
- const F = {
1
+ import { jsx as i, jsxs as d } from "react/jsx-runtime";
2
+ import { NotificationPromotionImagePosition as r, NotificationEnabled as T, NotificationPromotionMode as h, NotificationSponsorLogoMode as C, CtaIconMode as O } from "@streamlayer/sdk-web-types";
3
+ import { SlideIn as f } from "../../slide-in/index.js";
4
+ import { LowerThirdNotification as E } from "./lower-third/index.js";
5
+ import { MediaImgFit as c, MediaImgCentered as L, MediaImgBottom as S, MediaImgSolid as _, MediaImgMiddle as R, NotificationContainer as P, Logo as b, NotificationContent as A, Body as D, Title as x, Text as y, Button as F, CtaIcon as j, StyledChevronRight as k } from "./styles.js";
6
+ const v = {
6
7
  [r.UNSET]: c,
7
8
  [r.FIT]: c,
8
- [r.CENTERED]: h,
9
- [r.BOTTOM]: f,
10
- [r.SOLID]: E,
11
- [r.MIDDLE]: S
12
- }, j = ({ src: e, imagePosition: t }) => {
13
- const d = F[t];
14
- return /* @__PURE__ */ i(d, { children: /* @__PURE__ */ i("img", { src: e, alt: "" }) });
15
- }, q = ({ notification: e, promotionId: t, hiding: d, direction: I = "left" }) => {
16
- if (!e || !e.promotion || e.enabled !== M.NOTIFICATION_ENABLED)
9
+ [r.CENTERED]: L,
10
+ [r.BOTTOM]: S,
11
+ [r.SOLID]: _,
12
+ [r.MIDDLE]: R
13
+ }, w = ({ src: e, imagePosition: n }) => {
14
+ const m = v[n];
15
+ return /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i("img", { src: e, alt: "" }) });
16
+ }, z = ({ notification: e, open: n, promotionId: m, hiding: I, direction: N = "left" }) => {
17
+ if (!e || !e.promotion || e.enabled !== T.NOTIFICATION_ENABLED)
17
18
  return null;
18
- const { title: l, body: m, image: s, promotion: a } = e, { sponsorLogo: N, sponsorLogoMode: g, imagePosition: p, ctaButton: o } = a;
19
- return /* @__PURE__ */ i(T, { direction: I, hiding: d, children: /* @__PURE__ */ n(L, { children: [
20
- g !== C.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ i(_, { children: /* @__PURE__ */ i("img", { src: N, alt: l }) }),
21
- /* @__PURE__ */ n(b, { children: [
22
- /* @__PURE__ */ i(j, { src: s, imagePosition: p }),
23
- /* @__PURE__ */ n(A, { children: [
24
- l && /* @__PURE__ */ i(P, { children: l }),
25
- m && /* @__PURE__ */ i(R, { children: m })
19
+ if (e.promotion.mode === h.LOWER_THIRD)
20
+ return /* @__PURE__ */ i(E, { notification: e, open: n });
21
+ const { title: t, body: l, image: a, promotion: s } = e, { sponsorLogo: g, sponsorLogoMode: p, imagePosition: M, ctaButton: o } = s;
22
+ return /* @__PURE__ */ i(f, { className: "SL_Rich_Notification", direction: N, hiding: I, children: /* @__PURE__ */ d(P, { onClick: n, children: [
23
+ p !== C.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ i(b, { children: /* @__PURE__ */ i("img", { src: g, alt: t }) }),
24
+ /* @__PURE__ */ d(A, { children: [
25
+ /* @__PURE__ */ i(w, { src: a, imagePosition: M }),
26
+ /* @__PURE__ */ d(D, { children: [
27
+ t && /* @__PURE__ */ i(x, { children: t }),
28
+ l && /* @__PURE__ */ i(y, { children: l })
26
29
  ] }),
27
- /* @__PURE__ */ n(x, { name: "promo-button", style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color }, children: [
28
- (o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === O.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(D, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
30
+ /* @__PURE__ */ d(F, { name: "promo-button", style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color }, children: [
31
+ (o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === O.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(j, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
29
32
  (o == null ? void 0 : o.label) || "Open"
30
33
  ] }),
31
- /* @__PURE__ */ i(y, { name: "chevronRight" })
34
+ /* @__PURE__ */ i(k, { name: "chevronRight" })
32
35
  ] })
33
36
  ] }) });
34
37
  };
35
38
  export {
36
- q as Notification,
37
- j as NotificationMedia
39
+ z as Notification,
40
+ w as NotificationMedia
38
41
  };
@@ -0,0 +1,9 @@
1
+ import { QuestionNotification, PromotionNotification } from '@streamlayer/sdk-web-types';
2
+ export declare const NotificationMedia: React.FC<{
3
+ src: string;
4
+ imagePosition: PromotionNotification['imagePosition'];
5
+ }>;
6
+ export declare const LowerThirdNotification: React.FC<{
7
+ notification?: QuestionNotification;
8
+ open?: () => void;
9
+ }>;
@@ -0,0 +1,37 @@
1
+ import { jsx as i, jsxs as r, Fragment as g } from "react/jsx-runtime";
2
+ import { NotificationPromotionImagePosition as d, NotificationEnabled as O, NotificationSponsorLogoMode as T, CtaIconMode as h } from "@streamlayer/sdk-web-types";
3
+ import { MediaImgBottom as t, MediaImgMiddle as p, NotificationContainer as C, NotificationContent as M, Body as L, Title as f, Text as _, Footer as b, Logo as A, Vector as E, Button as P, CtaIcon as x } from "./styles.js";
4
+ const S = {
5
+ [d.BOTTOM]: t,
6
+ [d.MIDDLE]: p
7
+ }, F = ({ src: e, imagePosition: c }) => {
8
+ const n = S[c] || t;
9
+ return /* @__PURE__ */ i(n, { children: /* @__PURE__ */ i("img", { src: e, alt: "" }) });
10
+ }, j = ({ notification: e, open: c }) => {
11
+ if (!e || !e.promotion || e.enabled !== O.NOTIFICATION_ENABLED)
12
+ return null;
13
+ const { title: n, body: l, image: s, promotion: m } = e, { sponsorLogo: a, sponsorLogoMode: N, imagePosition: I, ctaButton: o } = m;
14
+ return /* @__PURE__ */ r(C, { className: "SL_Lower_Third_Notification", onClick: c, children: [
15
+ /* @__PURE__ */ r(M, { children: [
16
+ /* @__PURE__ */ i(F, { src: s, imagePosition: I }),
17
+ /* @__PURE__ */ r(L, { children: [
18
+ n && /* @__PURE__ */ i(f, { children: n }),
19
+ l && /* @__PURE__ */ i(_, { children: l })
20
+ ] })
21
+ ] }),
22
+ /* @__PURE__ */ r(b, { children: [
23
+ N !== T.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ r(g, { children: [
24
+ /* @__PURE__ */ i(A, { children: /* @__PURE__ */ i("img", { src: a, alt: n }) }),
25
+ /* @__PURE__ */ i(E, {})
26
+ ] }),
27
+ /* @__PURE__ */ r(P, { name: "promo-button", style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color }, children: [
28
+ (o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === h.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(x, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
29
+ (o == null ? void 0 : o.label) || "Open"
30
+ ] })
31
+ ] })
32
+ ] });
33
+ };
34
+ export {
35
+ j as LowerThirdNotification,
36
+ F as NotificationMedia
37
+ };
@@ -0,0 +1,16 @@
1
+ export declare const NotificationContent: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const Body: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const Title: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const Text: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const MediaImgBottom: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const MediaImgMiddle: {
7
+ __wyw_meta: unknown;
8
+ } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
9
+ as?: React.ElementType;
10
+ }>;
11
+ export declare const CtaIcon: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLImageElement> & import('react').ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
12
+ export declare const Button: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
13
+ export declare const Logo: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
14
+ export declare const Footer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
15
+ export declare const Vector: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
16
+ export declare const NotificationContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,64 @@
1
+ import { styled as s } from "@linaria/react";
2
+ const e = /* @__PURE__ */ s("div")({
3
+ name: "NotificationContent",
4
+ class: "n18wsqoo",
5
+ propsAsIs: !1
6
+ }), n = /* @__PURE__ */ s("div")({
7
+ name: "Body",
8
+ class: "b1ia90c2",
9
+ propsAsIs: !1
10
+ }), c = /* @__PURE__ */ s("div")({
11
+ name: "Title",
12
+ class: "tg2z08v",
13
+ propsAsIs: !1
14
+ }), i = /* @__PURE__ */ s("div")({
15
+ name: "Text",
16
+ class: "t59zdk1",
17
+ propsAsIs: !1
18
+ }), o = /* @__PURE__ */ s("div")({
19
+ name: "MediaImgBottom",
20
+ class: "m1ab9fq",
21
+ propsAsIs: !1
22
+ }), t = () => o, l = /* @__PURE__ */ s(t())({
23
+ name: "MediaImgMiddle",
24
+ class: "m9fsr0y",
25
+ propsAsIs: !0
26
+ }), p = /* @__PURE__ */ s("img")({
27
+ name: "CtaIcon",
28
+ class: "cvi9y5q",
29
+ propsAsIs: !1
30
+ }), m = /* @__PURE__ */ s("button")({
31
+ name: "Button",
32
+ class: "bgl6boa",
33
+ propsAsIs: !1
34
+ }), r = /* @__PURE__ */ s("div")({
35
+ name: "Logo",
36
+ class: "l5mq0z",
37
+ propsAsIs: !1
38
+ }), d = /* @__PURE__ */ s("div")({
39
+ name: "Footer",
40
+ class: "f1mse0ft",
41
+ propsAsIs: !1
42
+ }), f = /* @__PURE__ */ s("div")({
43
+ name: "Vector",
44
+ class: "v1hcloah",
45
+ propsAsIs: !1
46
+ }), I = /* @__PURE__ */ s("div")({
47
+ name: "NotificationContainer",
48
+ class: "n3n65jf",
49
+ propsAsIs: !1
50
+ });
51
+ export {
52
+ n as Body,
53
+ m as Button,
54
+ p as CtaIcon,
55
+ d as Footer,
56
+ r as Logo,
57
+ o as MediaImgBottom,
58
+ l as MediaImgMiddle,
59
+ I as NotificationContainer,
60
+ e as NotificationContent,
61
+ i as Text,
62
+ c as Title,
63
+ f as Vector
64
+ };
@@ -4,5 +4,7 @@ export declare const Overlay: React.FC<{
4
4
  promotionId: string;
5
5
  promotion: PromotionOptions;
6
6
  onClose?: () => void;
7
+ markAsViewed?: () => void;
8
+ skipAutoClose?: boolean;
7
9
  inSidebar?: boolean;
8
10
  }>;
@@ -1,77 +1,92 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { cx as D } from "@linaria/core";
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import { cx as I } from "@linaria/core";
3
+ import { useEffect as $ } from "react";
3
4
  import { eventBus as k } from "@streamlayer/sdk-web-interfaces";
4
- import { PromotionType as R, PromotionLogoMode as n, PromotionButtonType as j } from "@streamlayer/sdk-web-types";
5
- import { VideoPlayer as G } from "../../video-player/index.js";
6
- import { PromoOverlay as H, Header as W, HeaderContent as V, headerContentShift as q, SponsorLogo as _, Sponsor as w, SponsorName as z, SponsorText as J, ADLogo as K, SponsoredText as Q, CloseIconWrap as X, CloseIcon as Y, Media as Z, shiftMedia as $, Content as F, PromoImg as ee, Title as re, hideOnMobile as ae, Description as ne, ActionBtnWrap as le, ActionButton as oe } from "./styles.js";
7
- import { OverlayContainer as pe } from "./styles.js";
8
- const be = ({ promotion: e, promotionId: s, onClose: U }) => {
9
- var t, c, d, i, y, b, h, g, p, u, m, T, f, v, N, C, x, A, B, P, M, I, O, S, E, L;
10
- const l = e.type === R.INGAME_IAB11_LBAR || e.type === R.INGAME_IAB11, o = ((t = e.sponsor) == null ? void 0 : t.logo) && e.logoMode === n.CENTER;
11
- return /* @__PURE__ */ a(H, { className: "PromoOverlay", children: [
12
- /* @__PURE__ */ a(W, { children: [
13
- /* @__PURE__ */ a(V, { className: D(!o && q), children: [
14
- ((c = e.sponsor) == null ? void 0 : c.logo) && e.logoMode === n.LEFT && /* @__PURE__ */ r(_, { src: (d = e.sponsor) == null ? void 0 : d.logo, alt: "promo" }),
15
- /* @__PURE__ */ a(
5
+ import { PromotionType as j, PromotionLogoMode as s, AutoPlayVideo as q, PromotionButtonType as z } from "@streamlayer/sdk-web-types";
6
+ import { CloseButton as J } from "../../close-btn/index.js";
7
+ import { VideoPlayer as K } from "../../video-player/index.js";
8
+ import { PromoOverlay as Q, Header as X, HeaderContent as Y, headerContentShift as Z, SponsorLogo as G, Sponsor as w, SponsorName as ee, SponsorText as ae, ADLogo as le, SponsoredText as re, Media as te, shiftMedia as se, Content as H, PromoImg as ne, Title as oe, hideOnMobile as ce, Description as de, ActionBtnWrap as ie, ActionButton as ye } from "./styles.js";
9
+ import { OverlayContainer as xe } from "./styles.js";
10
+ const Pe = ({ promotion: e, skipAutoClose: V, promotionId: t, onClose: W, markAsViewed: n }) => {
11
+ var d, i, y, u, h, b, f, g, p, T, N, P, B, v, x, A, C, E, m, M, O, L, S, D, R, U, _, F;
12
+ const o = e.type === j.INGAME_IAB11_LBAR || e.type === j.INGAME_IAB11, c = ((d = e.sponsor) == null ? void 0 : d.logo) && e.logoMode === s.CENTER;
13
+ $(() => {
14
+ t && e.type && n && n();
15
+ }, [t, e.type, n]);
16
+ let r = (i = e.banner) == null ? void 0 : i.url;
17
+ return r && r.indexOf("http") !== 0 && (r = `https://${r}`), /* @__PURE__ */ l(Q, { className: "PromoOverlay", children: [
18
+ /* @__PURE__ */ l(X, { children: [
19
+ /* @__PURE__ */ l(Y, { className: I(!c && Z), children: [
20
+ ((y = e.sponsor) == null ? void 0 : y.logo) && e.logoMode === s.LEFT && /* @__PURE__ */ a(G, { src: (u = e.sponsor) == null ? void 0 : u.logo, alt: "promo" }),
21
+ /* @__PURE__ */ l(
16
22
  w,
17
23
  {
18
24
  style: {
19
- paddingLeft: (i = e.sponsor) != null && i.logo && e.logoMode === n.LEFT ? "0px" : "8px"
25
+ paddingLeft: (h = e.sponsor) != null && h.logo && e.logoMode === s.LEFT ? "0px" : "8px"
20
26
  },
21
27
  children: [
22
- ((y = e.sponsor) == null ? void 0 : y.logo) && e.logoMode === n.LEFT && /* @__PURE__ */ r(z, { children: (b = e.sponsor) == null ? void 0 : b.name }),
23
- /* @__PURE__ */ a(J, { className: "SponsorText", children: [
24
- /* @__PURE__ */ r(K, { children: "AD" }),
25
- /* @__PURE__ */ r(Q, { children: "SPONSORED" })
28
+ ((b = e.sponsor) == null ? void 0 : b.logo) && e.logoMode === s.LEFT && /* @__PURE__ */ a(ee, { children: (f = e.sponsor) == null ? void 0 : f.name }),
29
+ /* @__PURE__ */ l(ae, { className: "SponsorText", children: [
30
+ /* @__PURE__ */ a(le, { children: "AD" }),
31
+ /* @__PURE__ */ a(re, { children: "SPONSORED" })
26
32
  ] })
27
33
  ]
28
34
  }
29
35
  )
30
36
  ] }),
31
- /* @__PURE__ */ r(X, { className: "ClosePromoIcon", onClick: U, children: /* @__PURE__ */ r(Y, { name: "icon-cross" }) })
37
+ /* @__PURE__ */ a(
38
+ J,
39
+ {
40
+ className: "ClosePromoIcon",
41
+ close: W,
42
+ autoClose: (g = e.closeTimer) == null ? void 0 : g.auto,
43
+ duration: V ? 0 : (p = e.closeTimer) == null ? void 0 : p.seconds
44
+ }
45
+ )
32
46
  ] }),
33
- /* @__PURE__ */ a(Z, { children: [
34
- o && /* @__PURE__ */ r(_, { className: $, src: (h = e.sponsor) == null ? void 0 : h.logo, alt: "promo" }),
35
- /* @__PURE__ */ r(F, { children: (p = (g = e.banner) == null ? void 0 : g.video) != null && p.url ? /* @__PURE__ */ r(
36
- G,
47
+ /* @__PURE__ */ l(te, { children: [
48
+ c && /* @__PURE__ */ a(G, { className: se, src: (T = e.sponsor) == null ? void 0 : T.logo, alt: "promo" }),
49
+ /* @__PURE__ */ a(H, { children: (P = (N = e.banner) == null ? void 0 : N.video) != null && P.url ? /* @__PURE__ */ a(
50
+ K,
37
51
  {
38
- source: (m = (u = e.banner) == null ? void 0 : u.video) == null ? void 0 : m.url,
39
- poster: (f = (T = e.banner) == null ? void 0 : T.video) == null ? void 0 : f.thumbnailUrl,
40
- aspectRatio: l ? "1/1" : "16/9",
52
+ source: (v = (B = e.banner) == null ? void 0 : B.video) == null ? void 0 : v.url,
53
+ poster: (A = (x = e.banner) == null ? void 0 : x.video) == null ? void 0 : A.thumbnailUrl,
54
+ aspectRatio: o ? "1/1" : "16/9",
41
55
  onPlay: () => {
42
56
  k.emit("advertisement", {
43
57
  action: "videoPlay",
44
58
  payload: {
45
- advertisementId: s,
46
- advertisementType: e.type
59
+ id: t,
60
+ type: e.type
47
61
  }
48
62
  });
49
- }
63
+ },
64
+ autoPlay: e.autoPlayVideo === q.ENABLED
50
65
  }
51
- ) : (v = e.banner) != null && v.imageUrl ? /* @__PURE__ */ r(ee, { style: l ? { aspectRatio: "1/1" } : {}, src: (N = e.banner) == null ? void 0 : N.imageUrl, alt: "promo" }) : null }),
52
- !l && /* @__PURE__ */ a(F, { children: [
53
- ((C = e.banner) == null ? void 0 : C.title) && /* @__PURE__ */ r(re, { className: D("AdvTitle", o && ae), children: (x = e.banner) == null ? void 0 : x.title }),
54
- ((A = e.banner) == null ? void 0 : A.body) && /* @__PURE__ */ r(ne, { className: "AdvDescription", children: (B = e.banner) == null ? void 0 : B.body })
66
+ ) : (C = e.banner) != null && C.imageUrl ? /* @__PURE__ */ a(ne, { style: o ? { aspectRatio: "1/1" } : {}, src: (E = e.banner) == null ? void 0 : E.imageUrl, alt: "promo" }) : null }),
67
+ !o && /* @__PURE__ */ l(H, { children: [
68
+ ((m = e.banner) == null ? void 0 : m.title) && /* @__PURE__ */ a(oe, { className: I("AdvTitle", c && ce), children: (M = e.banner) == null ? void 0 : M.title }),
69
+ ((O = e.banner) == null ? void 0 : O.body) && /* @__PURE__ */ a(de, { className: "AdvDescription", children: (L = e.banner) == null ? void 0 : L.body })
55
70
  ] })
56
71
  ] }),
57
- e.buttonType !== j.NO_BUTTON && /* @__PURE__ */ r(le, { children: /* @__PURE__ */ r(
58
- oe,
72
+ e.buttonType !== z.NO_BUTTON && /* @__PURE__ */ a(ie, { children: /* @__PURE__ */ a(
73
+ ye,
59
74
  {
60
- href: (P = e.banner) == null ? void 0 : P.url,
75
+ href: r,
61
76
  style: {
62
- backgroundColor: ((I = (M = e.banner) == null ? void 0 : M.ctaButton) == null ? void 0 : I.color) || "#009dc4",
63
- color: ((S = (O = e.banner) == null ? void 0 : O.ctaButton) == null ? void 0 : S.textColor) || "#fff"
77
+ backgroundColor: ((D = (S = e.banner) == null ? void 0 : S.ctaButton) == null ? void 0 : D.color) || "#009dc4",
78
+ color: ((U = (R = e.banner) == null ? void 0 : R.ctaButton) == null ? void 0 : U.textColor) || "#fff"
64
79
  },
65
80
  "data-analytics": "button",
66
- "data-promo-id": s,
81
+ "data-promo-id": t,
67
82
  "data-promo-type": e.type,
68
83
  target: "_blank",
69
- children: (L = (E = e.banner) == null ? void 0 : E.ctaButton) == null ? void 0 : L.label
84
+ children: (F = (_ = e.banner) == null ? void 0 : _.ctaButton) == null ? void 0 : F.label
70
85
  }
71
86
  ) })
72
87
  ] });
73
88
  };
74
89
  export {
75
- be as Overlay,
76
- pe as OverlayContainer
90
+ Pe as Overlay,
91
+ xe as OverlayContainer
77
92
  };
@@ -14,8 +14,6 @@ export declare const Sponsor: import('@linaria/react').StyledComponent<import('r
14
14
  export declare const SponsorText: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
15
15
  export declare const ADLogo: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
16
16
  export declare const SponsoredText: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
17
- export declare const CloseIconWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
18
- export declare const CloseIcon: any;
19
17
  export declare const ActionBtnWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
20
18
  export declare const ActionButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLAnchorElement> & import('react').AnchorHTMLAttributes<HTMLAnchorElement> & Record<never, unknown>>;
21
19
  export declare const Title: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -1,103 +1,92 @@
1
1
  import { styled as s } from "@linaria/react";
2
- import { SvgIcon as o } from "../../icons/index.js";
3
- const t = /* @__PURE__ */ s("div")({
2
+ const e = /* @__PURE__ */ s("div")({
4
3
  name: "OverlayContainer",
5
4
  class: "okzhq2w",
6
5
  propsAsIs: !1
7
- }), p = /* @__PURE__ */ s("div")({
6
+ }), a = /* @__PURE__ */ s("div")({
8
7
  name: "PromoOverlay",
9
8
  class: "pmgz5i",
10
9
  propsAsIs: !1
11
- }), r = /* @__PURE__ */ s("div")({
10
+ }), n = /* @__PURE__ */ s("div")({
12
11
  name: "Header",
13
12
  class: "hyxi3jt",
14
13
  propsAsIs: !1
15
- }), c = /* @__PURE__ */ s("div")({
14
+ }), t = /* @__PURE__ */ s("div")({
16
15
  name: "HeaderContent",
17
16
  class: "h149e3gp",
18
17
  propsAsIs: !1
19
- }), l = "h10toh7", i = /* @__PURE__ */ s("img")({
18
+ }), p = "h10toh7", r = /* @__PURE__ */ s("img")({
20
19
  name: "SponsorLogo",
21
20
  class: "s1jyea6t",
22
21
  propsAsIs: !1
23
- }), m = /* @__PURE__ */ s("div")({
22
+ }), c = /* @__PURE__ */ s("div")({
24
23
  name: "SponsorName",
25
24
  class: "szpfa3h",
26
25
  propsAsIs: !1
27
- }), d = /* @__PURE__ */ s("div")({
26
+ }), l = /* @__PURE__ */ s("div")({
28
27
  name: "Media",
29
28
  class: "m1crmu01",
30
29
  propsAsIs: !1
31
- }), I = /* @__PURE__ */ s("img")({
30
+ }), i = /* @__PURE__ */ s("img")({
32
31
  name: "PromoImg",
33
32
  class: "p1l37r8s",
34
33
  propsAsIs: !1
35
- }), f = "s1nmch9k", A = /* @__PURE__ */ s("div")({
34
+ }), m = "s1nmch9k", d = /* @__PURE__ */ s("div")({
36
35
  name: "Content",
37
36
  class: "c1er0ljd",
38
37
  propsAsIs: !1
39
- }), v = /* @__PURE__ */ s("div")({
38
+ }), A = /* @__PURE__ */ s("div")({
40
39
  name: "Description",
41
40
  class: "dydopmr",
42
41
  propsAsIs: !1
43
- }), g = /* @__PURE__ */ s("div")({
42
+ }), f = /* @__PURE__ */ s("div")({
44
43
  name: "Sponsor",
45
44
  class: "s1w6nt04",
46
45
  propsAsIs: !1
47
- }), h = /* @__PURE__ */ s("div")({
46
+ }), I = /* @__PURE__ */ s("div")({
48
47
  name: "SponsorText",
49
48
  class: "s1evcmtq",
50
49
  propsAsIs: !1
51
- }), S = /* @__PURE__ */ s("div")({
50
+ }), v = /* @__PURE__ */ s("div")({
52
51
  name: "ADLogo",
53
52
  class: "awodx0x",
54
53
  propsAsIs: !1
55
- }), x = /* @__PURE__ */ s("span")({
54
+ }), h = /* @__PURE__ */ s("span")({
56
55
  name: "SponsoredText",
57
56
  class: "s1q3n6oi",
58
57
  propsAsIs: !1
59
- }), C = /* @__PURE__ */ s("div")({
60
- name: "CloseIconWrap",
61
- class: "c8d4xfk",
62
- propsAsIs: !1
63
- }), e = () => o, y = /* @__PURE__ */ s(e())({
64
- name: "CloseIcon",
65
- class: "ct6oobh",
66
- propsAsIs: !0
67
- }), T = /* @__PURE__ */ s("div")({
58
+ }), g = /* @__PURE__ */ s("div")({
68
59
  name: "ActionBtnWrap",
69
- class: "a1gyg7tt",
60
+ class: "a8d4xfk",
70
61
  propsAsIs: !1
71
- }), u = /* @__PURE__ */ s("a")({
62
+ }), S = /* @__PURE__ */ s("a")({
72
63
  name: "ActionButton",
73
- class: "a17rwbtk",
64
+ class: "at6oobh",
74
65
  propsAsIs: !1
75
- }), w = /* @__PURE__ */ s("div")({
66
+ }), x = /* @__PURE__ */ s("div")({
76
67
  name: "Title",
77
- class: "t3vxzaw",
68
+ class: "t1gyg7tt",
78
69
  propsAsIs: !1
79
- }), O = "h10f3u0j";
70
+ }), y = "h17rwbtk";
80
71
  export {
81
- S as ADLogo,
82
- T as ActionBtnWrap,
83
- u as ActionButton,
84
- y as CloseIcon,
85
- C as CloseIconWrap,
86
- A as Content,
87
- v as Description,
88
- r as Header,
89
- c as HeaderContent,
90
- d as Media,
91
- t as OverlayContainer,
92
- I as PromoImg,
93
- p as PromoOverlay,
94
- g as Sponsor,
95
- i as SponsorLogo,
96
- m as SponsorName,
97
- h as SponsorText,
98
- x as SponsoredText,
99
- w as Title,
100
- l as headerContentShift,
101
- O as hideOnMobile,
102
- f as shiftMedia
72
+ v as ADLogo,
73
+ g as ActionBtnWrap,
74
+ S as ActionButton,
75
+ d as Content,
76
+ A as Description,
77
+ n as Header,
78
+ t as HeaderContent,
79
+ l as Media,
80
+ e as OverlayContainer,
81
+ i as PromoImg,
82
+ a as PromoOverlay,
83
+ f as Sponsor,
84
+ r as SponsorLogo,
85
+ c as SponsorName,
86
+ I as SponsorText,
87
+ h as SponsoredText,
88
+ x as Title,
89
+ p as headerContentShift,
90
+ y as hideOnMobile,
91
+ m as shiftMedia
103
92
  };
@@ -0,0 +1,7 @@
1
+ import { CloseTimerAuto } from '@streamlayer/sdk-web-types';
2
+ export declare const CloseButton: React.FC<{
3
+ close?: () => void;
4
+ duration?: number;
5
+ autoClose?: CloseTimerAuto;
6
+ className?: string;
7
+ }>;