@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.
- package/lib/app/app/Advertisement/index.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +78 -67
- package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
- package/lib/app/app/Features/Gamification/Question.js +43 -41
- package/lib/app/app/Features/Gamification/Tabs.js +22 -21
- package/lib/app/app/Features/Gamification/index.js +66 -62
- package/lib/app/app/Insight/index.d.ts +2 -0
- package/lib/app/app/Insight/index.js +28 -24
- package/lib/app/app/Navigation/index.d.ts +4 -0
- package/lib/app/app/Navigation/index.js +88 -48
- package/lib/app/app/Notifications/index.js +125 -113
- package/lib/app/app/Points/index.js +16 -16
- package/lib/app/app/index.d.ts +1 -0
- package/lib/app/app/index.js +84 -83
- package/lib/app/app/story/index.js +27 -24
- package/lib/app/app/story/insight/index.d.ts +1 -0
- package/lib/app/app/story/insight/index.js +29 -26
- package/lib/app/app/story/insight/video.d.ts +1 -0
- package/lib/app/app/story/insight/video.js +13 -13
- package/lib/app/app/story/promotion/content.d.ts +3 -1
- package/lib/app/app/story/promotion/content.js +13 -10
- package/lib/app/app/story/promotion/index.d.ts +1 -0
- package/lib/app/app/story/promotion/index.js +34 -30
- package/lib/app/app/story/promotion/video.d.ts +1 -0
- package/lib/app/app/story/promotion/video.js +34 -31
- package/lib/app/app/styles.js +44 -0
- package/lib/app/app/useApp.d.ts +2 -14
- package/lib/app/app/useApp.js +14 -43
- package/lib/app/app/useAppContext.d.ts +2 -0
- package/lib/app/app/useAppContext.js +6 -5
- package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
- package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/index.js +1 -1
- package/lib/app/masters/Features/index.d.ts +2 -2
- package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
- package/lib/app/masters/Notifications/index.d.ts +2 -2
- package/lib/app/masters/Notifications/index.js +1 -1
- package/lib/app/masters/masters.js +23 -23
- package/lib/app/masters/styles.d.ts +20 -0
- package/lib/app/{styles.js → masters/styles.js} +15 -15
- package/lib/app/masters/useSdkResponsive.d.ts +15 -0
- package/lib/app/masters/useSdkResponsive.js +45 -0
- package/lib/app/masters/useSdkScroll.d.ts +12 -0
- package/lib/app/masters/useSdkScroll.js +50 -0
- package/lib/app/useSdkResponsive.d.ts +1 -0
- package/lib/app/useSdkResponsive.js +27 -29
- package/lib/app/useSdkScroll.js +25 -24
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.js +14 -11
- package/lib/ui/advertisement/index.d.ts +3 -0
- package/lib/ui/advertisement/index.js +31 -10
- package/lib/ui/advertisement/notification/index.d.ts +1 -0
- package/lib/ui/advertisement/notification/index.js +30 -27
- package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
- package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
- package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
- package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +58 -43
- package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
- package/lib/ui/advertisement/overlay/styles.js +41 -52
- package/lib/ui/close-btn/index.d.ts +7 -0
- package/lib/ui/close-btn/index.js +47 -0
- package/lib/ui/gamification/detail/header/index.d.ts +2 -1
- package/lib/ui/gamification/detail/header/index.js +16 -15
- package/lib/ui/gamification/vote/styles.js +1 -1
- package/lib/ui/navigation/button/FeaturedGroups.d.ts +1 -1
- package/lib/ui/navigation/index.d.ts +5 -3
- package/lib/ui/navigation/index.js +11 -12
- package/lib/ui/navigation/masters.js +1 -1
- package/lib/ui/navigation/styles.d.ts +5 -0
- package/lib/ui/navigation/styles.js +16 -0
- package/lib/ui/questions/insight/index.js +21 -20
- package/lib/ui/theme/masters-theme.js +36 -13
- package/lib/ui/theme/theme.js +25 -26
- package/lib/ui/timer/index.d.ts +3 -1
- package/lib/ui/timer/index.js +54 -32
- package/lib/ui/video-player/index.d.ts +2 -0
- package/lib/ui/video-player/index.js +62 -51
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +7 -6
- package/package.json +15 -15
- /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { SlideIn as
|
|
3
|
-
import { BannerContainer as
|
|
4
|
-
const
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
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:
|
|
13
|
+
href: n,
|
|
11
14
|
style: { backgroundImage: `url(${a.additionalBanner.imageUrl})` },
|
|
12
|
-
"data-promo-id":
|
|
15
|
+
"data-promo-id": i,
|
|
13
16
|
"data-promo-type": a.type,
|
|
14
17
|
"data-analytics": "banner",
|
|
15
18
|
target: "_blank"
|
|
16
19
|
}
|
|
17
|
-
) }) })
|
|
20
|
+
) }) });
|
|
18
21
|
};
|
|
19
22
|
export {
|
|
20
|
-
|
|
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
|
|
4
|
-
import { Notification as
|
|
5
|
-
import { Overlay as
|
|
6
|
-
import { Sidebar as
|
|
7
|
-
import { OverlayContainer as
|
|
8
|
-
const
|
|
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
|
-
|
|
12
|
+
skipAutoClose: u,
|
|
13
|
+
layoutMode: p = "side-by-side",
|
|
13
14
|
sidebar: n,
|
|
14
|
-
isNotification:
|
|
15
|
-
banner: f
|
|
16
|
-
|
|
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,
|
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { NotificationPromotionImagePosition as r, NotificationEnabled as
|
|
3
|
-
import { SlideIn as
|
|
4
|
-
import {
|
|
5
|
-
|
|
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]:
|
|
9
|
-
[r.BOTTOM]:
|
|
10
|
-
[r.SOLID]:
|
|
11
|
-
[r.MIDDLE]:
|
|
12
|
-
},
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */ i(
|
|
15
|
-
},
|
|
16
|
-
if (!e || !e.promotion || e.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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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__ */
|
|
28
|
-
(o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === O.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(
|
|
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(
|
|
34
|
+
/* @__PURE__ */ i(k, { name: "chevronRight" })
|
|
32
35
|
] })
|
|
33
36
|
] }) });
|
|
34
37
|
};
|
|
35
38
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
};
|
|
@@ -1,77 +1,92 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
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
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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: (
|
|
25
|
+
paddingLeft: (h = e.sponsor) != null && h.logo && e.logoMode === s.LEFT ? "0px" : "8px"
|
|
20
26
|
},
|
|
21
27
|
children: [
|
|
22
|
-
((
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
34
|
-
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
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: (
|
|
39
|
-
poster: (
|
|
40
|
-
aspectRatio:
|
|
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
|
-
|
|
46
|
-
|
|
59
|
+
id: t,
|
|
60
|
+
type: e.type
|
|
47
61
|
}
|
|
48
62
|
});
|
|
49
|
-
}
|
|
63
|
+
},
|
|
64
|
+
autoPlay: e.autoPlayVideo === q.ENABLED
|
|
50
65
|
}
|
|
51
|
-
) : (
|
|
52
|
-
!
|
|
53
|
-
((
|
|
54
|
-
((
|
|
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 !==
|
|
58
|
-
|
|
72
|
+
e.buttonType !== z.NO_BUTTON && /* @__PURE__ */ a(ie, { children: /* @__PURE__ */ a(
|
|
73
|
+
ye,
|
|
59
74
|
{
|
|
60
|
-
href:
|
|
75
|
+
href: r,
|
|
61
76
|
style: {
|
|
62
|
-
backgroundColor: ((
|
|
63
|
-
color: ((
|
|
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":
|
|
81
|
+
"data-promo-id": t,
|
|
67
82
|
"data-promo-type": e.type,
|
|
68
83
|
target: "_blank",
|
|
69
|
-
children: (
|
|
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
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
6
|
+
}), a = /* @__PURE__ */ s("div")({
|
|
8
7
|
name: "PromoOverlay",
|
|
9
8
|
class: "pmgz5i",
|
|
10
9
|
propsAsIs: !1
|
|
11
|
-
}),
|
|
10
|
+
}), n = /* @__PURE__ */ s("div")({
|
|
12
11
|
name: "Header",
|
|
13
12
|
class: "hyxi3jt",
|
|
14
13
|
propsAsIs: !1
|
|
15
|
-
}),
|
|
14
|
+
}), t = /* @__PURE__ */ s("div")({
|
|
16
15
|
name: "HeaderContent",
|
|
17
16
|
class: "h149e3gp",
|
|
18
17
|
propsAsIs: !1
|
|
19
|
-
}),
|
|
18
|
+
}), p = "h10toh7", r = /* @__PURE__ */ s("img")({
|
|
20
19
|
name: "SponsorLogo",
|
|
21
20
|
class: "s1jyea6t",
|
|
22
21
|
propsAsIs: !1
|
|
23
|
-
}),
|
|
22
|
+
}), c = /* @__PURE__ */ s("div")({
|
|
24
23
|
name: "SponsorName",
|
|
25
24
|
class: "szpfa3h",
|
|
26
25
|
propsAsIs: !1
|
|
27
|
-
}),
|
|
26
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
28
27
|
name: "Media",
|
|
29
28
|
class: "m1crmu01",
|
|
30
29
|
propsAsIs: !1
|
|
31
|
-
}),
|
|
30
|
+
}), i = /* @__PURE__ */ s("img")({
|
|
32
31
|
name: "PromoImg",
|
|
33
32
|
class: "p1l37r8s",
|
|
34
33
|
propsAsIs: !1
|
|
35
|
-
}),
|
|
34
|
+
}), m = "s1nmch9k", d = /* @__PURE__ */ s("div")({
|
|
36
35
|
name: "Content",
|
|
37
36
|
class: "c1er0ljd",
|
|
38
37
|
propsAsIs: !1
|
|
39
|
-
}),
|
|
38
|
+
}), A = /* @__PURE__ */ s("div")({
|
|
40
39
|
name: "Description",
|
|
41
40
|
class: "dydopmr",
|
|
42
41
|
propsAsIs: !1
|
|
43
|
-
}),
|
|
42
|
+
}), f = /* @__PURE__ */ s("div")({
|
|
44
43
|
name: "Sponsor",
|
|
45
44
|
class: "s1w6nt04",
|
|
46
45
|
propsAsIs: !1
|
|
47
|
-
}),
|
|
46
|
+
}), I = /* @__PURE__ */ s("div")({
|
|
48
47
|
name: "SponsorText",
|
|
49
48
|
class: "s1evcmtq",
|
|
50
49
|
propsAsIs: !1
|
|
51
|
-
}),
|
|
50
|
+
}), v = /* @__PURE__ */ s("div")({
|
|
52
51
|
name: "ADLogo",
|
|
53
52
|
class: "awodx0x",
|
|
54
53
|
propsAsIs: !1
|
|
55
|
-
}),
|
|
54
|
+
}), h = /* @__PURE__ */ s("span")({
|
|
56
55
|
name: "SponsoredText",
|
|
57
56
|
class: "s1q3n6oi",
|
|
58
57
|
propsAsIs: !1
|
|
59
|
-
}),
|
|
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: "
|
|
60
|
+
class: "a8d4xfk",
|
|
70
61
|
propsAsIs: !1
|
|
71
|
-
}),
|
|
62
|
+
}), S = /* @__PURE__ */ s("a")({
|
|
72
63
|
name: "ActionButton",
|
|
73
|
-
class: "
|
|
64
|
+
class: "at6oobh",
|
|
74
65
|
propsAsIs: !1
|
|
75
|
-
}),
|
|
66
|
+
}), x = /* @__PURE__ */ s("div")({
|
|
76
67
|
name: "Title",
|
|
77
|
-
class: "
|
|
68
|
+
class: "t1gyg7tt",
|
|
78
69
|
propsAsIs: !1
|
|
79
|
-
}),
|
|
70
|
+
}), y = "h17rwbtk";
|
|
80
71
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
};
|