@streamlayer/react-ui 1.32.4 → 1.33.1
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 -1
- package/lib/app/app/Advertisement/index.js +14 -15
- package/lib/app/app/Banner/index.d.ts +1 -1
- package/lib/app/app/Features/FeatureProvider.d.ts +2 -2
- package/lib/app/app/Features/Gamification/Leaderboard.d.ts +1 -1
- package/lib/app/app/Features/Gamification/Leaderboard.js +46 -36
- package/lib/app/app/Features/Gamification/Question.d.ts +2 -2
- package/lib/app/app/Features/Gamification/Question.js +42 -42
- package/lib/app/app/Features/Gamification/QuestionAdvertisement.js +19 -25
- package/lib/app/app/Features/Gamification/QuestionsList.d.ts +1 -1
- package/lib/app/app/Features/Gamification/Tabs.d.ts +1 -1
- package/lib/app/app/Features/Gamification/UserSummary.d.ts +1 -1
- package/lib/app/app/Features/Gamification/index.d.ts +2 -2
- package/lib/app/app/Features/Gamification/index.js +29 -28
- package/lib/app/app/Features/index.d.ts +2 -2
- package/lib/app/app/InApp/index.d.ts +1 -1
- package/lib/app/app/Insight/index.d.ts +2 -2
- package/lib/app/app/Layout/index.d.ts +1 -1
- package/lib/app/app/Navigation/index.d.ts +1 -1
- package/lib/app/app/Notifications/Onboarding/Notification/index.d.ts +2 -2
- package/lib/app/app/Notifications/Onboarding/index.d.ts +2 -2
- package/lib/app/app/Notifications/Onboarding/index.js +45 -42
- package/lib/app/app/Notifications/index.d.ts +1 -1
- package/lib/app/app/Points/index.d.ts +1 -1
- package/lib/app/app/index.d.ts +1 -1
- package/lib/app/app/story/index.js +24 -24
- package/lib/app/app/story/insight/index.js +14 -15
- package/lib/app/app/story/insight/video.js +3 -3
- package/lib/app/app/story/promotion/content.js +5 -5
- package/lib/app/app/story/promotion/index.d.ts +1 -0
- package/lib/app/app/story/promotion/index.js +24 -25
- package/lib/app/app/story/promotion/video.d.ts +0 -1
- package/lib/app/app/story/promotion/video.js +41 -43
- package/lib/app/app/story/promotion-notification/index.js +15 -16
- package/lib/app/app/story/promotion-notification/video.d.ts +0 -1
- package/lib/app/app/story/promotion-notification/video.js +22 -30
- package/lib/app/app/story/settings/index.js +6 -6
- package/lib/app/app/story/settings/login.js +1 -1
- package/lib/app/app/story/video.js +28 -28
- package/lib/app/app/useApp.d.ts +1 -1
- package/lib/app/app/useAppContext.d.ts +1 -1
- package/lib/app/login/demo.js +19 -18
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +17 -17
- package/lib/app/masters/BetPack/BetPackContent/QuestionScreen/index.d.ts +2 -2
- package/lib/app/masters/BetPack/BetPackContent/index.d.ts +1 -1
- package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
- package/lib/app/masters/BetPack/index.d.ts +1 -1
- package/lib/app/masters/Features/FeatureProvider.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/Question.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/QuestionsList.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/Tabs.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/UserSummary.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/index.d.ts +1 -1
- package/lib/app/masters/Features/index.d.ts +2 -2
- package/lib/app/masters/Notifications/Onboarding/Notification/index.d.ts +2 -2
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +2 -2
- package/lib/app/masters/Notifications/Onboarding/index.js +42 -39
- package/lib/app/masters/Notifications/index.d.ts +1 -1
- package/lib/app/masters/Points/index.d.ts +1 -1
- package/lib/app/masters/masters.d.ts +2 -1
- package/lib/app/masters/masters.js +34 -32
- package/lib/app/masters/provider.d.ts +4 -0
- package/lib/app/masters/provider.js +23 -0
- package/lib/app/masters/story/components.js +48 -52
- package/lib/app/masters/story/index.js +16 -15
- package/lib/app/masters/useMastersApp.d.ts +1 -1
- package/lib/app/masters/useMastersContext.d.ts +1 -1
- package/lib/app/tgl/index.d.ts +1 -0
- package/lib/app/tgl/index.js +19 -20
- package/lib/app/tgl/video.d.ts +0 -1
- package/lib/app/tgl/video.js +40 -42
- package/lib/app/useSdkFeature.d.ts +3 -3
- package/lib/app/webos/Advertisement/AdvertisementUI.d.ts +1 -1
- package/lib/app/webos/Advertisement/index.d.ts +1 -1
- package/lib/app/webos/ExposedPauseAd/PauseAd.d.ts +1 -1
- package/lib/app/webos/ExposedPauseAd/PauseAd.js +68 -68
- package/lib/app/webos/Question/index.d.ts +1 -1
- package/lib/app/webos/index.d.ts +1 -1
- package/lib/app/webos/story.js +26 -26
- package/lib/app/webos/ui/Sidebar/PromoAction.d.ts +1 -1
- package/lib/app/webos/ui/Sidebar/index.d.ts +2 -2
- package/lib/app/webos/ui/Sidebar/styles.js +82 -888
- package/lib/app/webos/ui/insight/index.d.ts +1 -1
- package/lib/assets/style.css +1 -1
- package/lib/core/app.d.ts +7 -0
- package/lib/core/app.js +14 -0
- package/lib/core/event.d.ts +6 -0
- package/lib/core/event.js +5 -0
- package/lib/core/hooks.d.ts +16 -0
- package/lib/core/hooks.js +8 -0
- package/lib/core/provider.d.ts +49 -0
- package/lib/core/provider.js +9 -0
- package/lib/hooks/analytics.d.ts +1 -1
- package/lib/hooks-B0Qttldg.js +99 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +2 -4
- package/lib/ui/advertisement/banner/index.d.ts +3 -3
- package/lib/ui/advertisement/index.d.ts +1 -1
- package/lib/ui/advertisement/mock.d.ts +1 -1
- package/lib/ui/advertisement/notification/index.d.ts +1 -1
- package/lib/ui/advertisement/notification/lower-third/index.d.ts +1 -1
- package/lib/ui/advertisement/notification/lower-third/index.js +34 -30
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +100 -33212
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js +13 -13
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.d.ts +1 -1
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +63 -204
- package/lib/ui/advertisement/overlay/index.d.ts +2 -2
- package/lib/ui/close-btn/index.d.ts +1 -1
- package/lib/ui/gamification/constants.d.ts +1 -1
- package/lib/ui/gamification/detail/header/index.d.ts +1 -1
- package/lib/ui/gamification/insight/index.d.ts +1 -1
- package/lib/ui/gamification/insight-list/index.d.ts +1 -1
- package/lib/ui/gamification/leaderboard/list-item/index.d.ts +1 -1
- package/lib/ui/gamification/leaderboard/static.d.ts +1 -1
- package/lib/ui/gamification/onboarding/index.d.ts +2 -2
- package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.d.ts +2 -2
- package/lib/ui/gamification/question/inapp/notification/AdNotification/NotificationMedia/index.js +1 -1
- package/lib/ui/gamification/question/inapp/notification/AdNotification/index.d.ts +1 -1
- package/lib/ui/gamification/question/inapp/notification/NotificationMedia/index.d.ts +1 -1
- package/lib/ui/gamification/question/inapp/notification/index.d.ts +1 -1
- package/lib/ui/gamification/question/inapp/onboarding/index.d.ts +1 -1
- package/lib/ui/gamification/question/inapp/prediction-result/frames/index.d.ts +1 -1
- package/lib/ui/gamification/question/inapp/prediction-result/index.d.ts +1 -1
- package/lib/ui/gamification/question/inapp/prediction-result-ad/frames/index.d.ts +1 -1
- package/lib/ui/gamification/question/inapp/prediction-result-ad/index.d.ts +1 -1
- package/lib/ui/gamification/question/index.d.ts +1 -1
- package/lib/ui/gamification/question/list/index.d.ts +1 -1
- package/lib/ui/gamification/question/notification/index.d.ts +1 -1
- package/lib/ui/gamification/question/notification/insight/index.d.ts +2 -2
- package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +1 -1
- package/lib/ui/gamification/question/notification/tweet/index.d.ts +1 -1
- package/lib/ui/gamification/vote/feedback/index.d.ts +1 -1
- package/lib/ui/gamification/vote/index.d.ts +1 -1
- package/lib/ui/gamification/vote/vote-option/index.d.ts +1 -1
- package/lib/ui/gamification/vote/win-bar/index.d.ts +1 -1
- package/lib/ui/icons/index.d.ts +198 -66
- package/lib/ui/navigation/button/index.d.ts +1 -1
- package/lib/ui/questions/insight/index.d.ts +1 -1
- package/lib/ui/questions/twitter/index.d.ts +1 -1
- package/lib/ui/video-player/index.js +26 -23
- package/lib/useStreamLayerApp.d.ts +23 -0
- package/lib/useStreamLayerApp.js +167 -0
- package/lib/utils/debug/components/bypassLogin.d.ts +1 -1
- package/lib/utils/debug/components/developer.d.ts +1 -1
- package/lib/utils/debug/components/eventInput.d.ts +1 -1
- package/lib/utils/debug/index.js +8 -8
- package/lib/utils/debug/storage.d.ts +1 -1
- package/lib/utils/storage.d.ts +1 -1
- package/package.json +42 -35
- package/lib/index-l-eyvmpL.js +0 -3758
- package/lib/utils/createDemo.d.ts +0 -12
- package/lib/utils/createDemo.js +0 -49
- package/lib/vast-client.min-B0NUra1B.js +0 -1060
package/lib/core/app.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { App as l } from "../app/app/index.js";
|
|
3
|
+
import { useContext as o } from "react";
|
|
4
|
+
import { StreamLayerThemeProvider as f } from "../ui/theme/index.js";
|
|
5
|
+
import { S as n, a as h, b as y, c as s } from "../hooks-B0Qttldg.js";
|
|
6
|
+
const b = ({ event: p, topNavigation: S, theme: c, muted: u, withSidebarNotification: d = !0 }) => {
|
|
7
|
+
const { sdk: t, status: i } = o(n), e = h(), m = y(), { event: a } = o(n);
|
|
8
|
+
if (i === s.UNSET)
|
|
9
|
+
throw new Error("Wrap app in `StreamLayerProvider`");
|
|
10
|
+
return i === s.CONNECTED ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: "wait" }) : t === null ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : !e.app && !e.appNotification && !e.appSidebar || !e.app && !e.appSidebar && e.appNotification && !d ? null : /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ r(f, { customTheme: c ?? m.theme, themeMode: m.themeMode, children: /* @__PURE__ */ r(l, { sdk: t, muted: u, event: (a == null ? void 0 : a.current) || p, topNavigation: S }) }) });
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
b as StreamLayerSDKReact
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StreamLayerOptions, StreamLayerSDK } from '../packages/sdk-web-interfaces/src/index.ts';
|
|
2
|
+
export declare const useStreamLayer: () => StreamLayerSDK | null;
|
|
3
|
+
export declare const useStreamLayerEvent: () => import('react').MutableRefObject<string> | undefined;
|
|
4
|
+
export declare const useStreamLayerTheme: () => Pick<StreamLayerOptions, "theme" | "themeMode">;
|
|
5
|
+
export declare const useStreamLayerUI: () => {
|
|
6
|
+
promotionExternalAd?: boolean;
|
|
7
|
+
promotionSidebar?: boolean;
|
|
8
|
+
promotionOverlay?: boolean;
|
|
9
|
+
promotionNotification?: boolean;
|
|
10
|
+
promotionBanner?: boolean;
|
|
11
|
+
app?: boolean;
|
|
12
|
+
appNotification?: boolean;
|
|
13
|
+
appSidebar?: boolean;
|
|
14
|
+
appBanner?: boolean;
|
|
15
|
+
onboardingNotification?: boolean;
|
|
16
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DeepLinkCallback } from '../packages/sdk-web-core/src/index.ts';
|
|
2
|
+
import { StreamLayerSDK, StreamLayerPlugin } from '../packages/sdk-web-interfaces/src/index.ts';
|
|
3
|
+
export type { DeepLinkCallback } from '../packages/sdk-web-core/src/index.ts';
|
|
4
|
+
export type ContentActivateParams = {
|
|
5
|
+
stage: 'activate' | 'deactivate';
|
|
6
|
+
id: string;
|
|
7
|
+
isViewed?: boolean;
|
|
8
|
+
hasNotification?: boolean;
|
|
9
|
+
type: 'advertisement' | 'insight' | 'poll' | 'trivia' | 'prediction' | 'tweet' | 'question';
|
|
10
|
+
};
|
|
11
|
+
export type VideoPlayerData = {
|
|
12
|
+
muted?: boolean;
|
|
13
|
+
play?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type VideoPlayerCallback = (videoPlayerData: VideoPlayerData) => void;
|
|
16
|
+
export type OnContentActivateCallback = (renderData: ContentActivateParams) => void;
|
|
17
|
+
export declare enum StreamLayerStatus {
|
|
18
|
+
UNSET = 0,
|
|
19
|
+
CONNECTED = 1,
|
|
20
|
+
READY = 2
|
|
21
|
+
}
|
|
22
|
+
export declare const StreamLayerContext: import('react').Context<{
|
|
23
|
+
status: StreamLayerStatus;
|
|
24
|
+
sdk: StreamLayerSDK | null;
|
|
25
|
+
event?: React.MutableRefObject<string>;
|
|
26
|
+
}>;
|
|
27
|
+
export type StreamLayerProps = {
|
|
28
|
+
sdkKey: string;
|
|
29
|
+
plugins?: Set<StreamLayerPlugin>;
|
|
30
|
+
event?: string;
|
|
31
|
+
production?: boolean;
|
|
32
|
+
autoEnable?: boolean;
|
|
33
|
+
onDeepLinkHandled?: DeepLinkCallback;
|
|
34
|
+
videoPlayerController?: VideoPlayerCallback;
|
|
35
|
+
onContentActivate?: OnContentActivateCallback;
|
|
36
|
+
theme?: string;
|
|
37
|
+
withAdNotification?: boolean;
|
|
38
|
+
withAd?: boolean;
|
|
39
|
+
hideFriends?: boolean;
|
|
40
|
+
friendsTab?: 'enabled' | 'disabled' | 'activatedGame';
|
|
41
|
+
themeMode?: 'light' | 'dark';
|
|
42
|
+
containerId?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const StreamLayerProvider: React.FC<StreamLayerProps & {
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
skipOnboarding?: boolean;
|
|
47
|
+
betPack?: boolean;
|
|
48
|
+
webOS?: boolean;
|
|
49
|
+
}>;
|
package/lib/hooks/analytics.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventBusData } from '
|
|
1
|
+
import { EventBusData } from '../packages/sdk-web-interfaces/src/index.ts';
|
|
2
2
|
type Arguments<T> = T extends (...args: infer U) => void ? U : never;
|
|
3
3
|
export declare const useAnalyticsHandle: (options: EventBusData) => (<T extends Function>(callback?: T) => (...args: Arguments<T>) => any)[];
|
|
4
4
|
export declare const newTabLinkListener: (event: Event) => void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useEffect as n, createContext as A, useRef as D, useMemo as R, useContext as m, useState as v } from "react";
|
|
2
|
+
import { jsxs as I, jsx as M } from "react/jsx-runtime";
|
|
3
|
+
import { useStreamLayerApp as g } from "./useStreamLayerApp.js";
|
|
4
|
+
const j = ({
|
|
5
|
+
event: e,
|
|
6
|
+
internal: o
|
|
7
|
+
}) => {
|
|
8
|
+
const s = B(), r = G();
|
|
9
|
+
return n(() => (s && (e && (s.createEventSession(e, o), r && (r.current = e)), !e && (r != null && r.current) && (s.createEventSession("", o), r.current = "")), () => {
|
|
10
|
+
s && s.disableApp();
|
|
11
|
+
}), [e, o, r, s]), null;
|
|
12
|
+
};
|
|
13
|
+
var Y = /* @__PURE__ */ ((e) => (e[e.UNSET = 0] = "UNSET", e[e.CONNECTED = 1] = "CONNECTED", e[e.READY = 2] = "READY", e))(Y || {});
|
|
14
|
+
const w = {
|
|
15
|
+
status: 0,
|
|
16
|
+
sdk: null
|
|
17
|
+
}, c = A(w), q = ({
|
|
18
|
+
sdkKey: e,
|
|
19
|
+
theme: o,
|
|
20
|
+
themeMode: s,
|
|
21
|
+
plugins: r,
|
|
22
|
+
children: f,
|
|
23
|
+
event: E,
|
|
24
|
+
production: x = !0,
|
|
25
|
+
autoEnable: K = !0,
|
|
26
|
+
withAdNotification: N,
|
|
27
|
+
withAd: C = !0,
|
|
28
|
+
betPack: a = !1,
|
|
29
|
+
hideFriends: T,
|
|
30
|
+
skipOnboarding: p,
|
|
31
|
+
friendsTab: S = "enabled",
|
|
32
|
+
onDeepLinkHandled: u,
|
|
33
|
+
videoPlayerController: i,
|
|
34
|
+
onContentActivate: U,
|
|
35
|
+
containerId: h,
|
|
36
|
+
webOS: b
|
|
37
|
+
}) => {
|
|
38
|
+
const t = g({
|
|
39
|
+
sdkKey: e,
|
|
40
|
+
plugins: r,
|
|
41
|
+
production: x,
|
|
42
|
+
autoEnable: K,
|
|
43
|
+
onDeepLinkHandled: u,
|
|
44
|
+
videoPlayerController: i,
|
|
45
|
+
onContentActivate: U,
|
|
46
|
+
hideFriends: T,
|
|
47
|
+
skipOnboarding: p,
|
|
48
|
+
withAdNotification: N,
|
|
49
|
+
withAd: C,
|
|
50
|
+
friendsTab: S,
|
|
51
|
+
betPack: a,
|
|
52
|
+
webOS: b
|
|
53
|
+
}), l = D(""), y = R(() => t ? { sdk: t, status: 2, event: l } : { status: 1, sdk: null, event: l }, [t]);
|
|
54
|
+
return n(() => {
|
|
55
|
+
t && (t.options.setKey("friendsTab", S), t.options.setKey("theme", o), t.options.setKey("themeMode", s), t.options.setKey("skipOnboarding", p), t.options.setKey("betPack", a), t.options.setKey("containerId", h));
|
|
56
|
+
}, [t, S, o, s, p, a, h]), n(() => () => {
|
|
57
|
+
u && (t == null || t.removeDeepLinkHandler(u)), i && (t == null || t.removeVideoPlayerController(i));
|
|
58
|
+
}, [t]), n(() => {
|
|
59
|
+
localStorage.getItem("SL_DEBUG") && console.log("StreamLayerProvider mounted with props:", {
|
|
60
|
+
sdkKey: !!e,
|
|
61
|
+
onDeepLinkHandled: !!u,
|
|
62
|
+
videoPlayerController: !!i
|
|
63
|
+
});
|
|
64
|
+
}, [e, u, i]), /* @__PURE__ */ I(c.Provider, { value: y, children: [
|
|
65
|
+
E !== void 0 && /* @__PURE__ */ M(j, { event: E }),
|
|
66
|
+
f
|
|
67
|
+
] });
|
|
68
|
+
}, B = () => {
|
|
69
|
+
const { sdk: e } = m(c);
|
|
70
|
+
return e;
|
|
71
|
+
}, G = () => {
|
|
72
|
+
const { event: e } = m(c);
|
|
73
|
+
return e;
|
|
74
|
+
}, z = () => {
|
|
75
|
+
const { sdk: e } = m(c), [o, s] = v({});
|
|
76
|
+
return n(() => {
|
|
77
|
+
var r;
|
|
78
|
+
return e != null && e.options ? (r = e == null ? void 0 : e.options) == null ? void 0 : r.subscribe((f) => {
|
|
79
|
+
s({ theme: f.theme, themeMode: f.themeMode });
|
|
80
|
+
}) : () => {
|
|
81
|
+
};
|
|
82
|
+
}, [e == null ? void 0 : e.options]), o;
|
|
83
|
+
}, F = () => {
|
|
84
|
+
const { sdk: e } = m(c), [o, s] = v({});
|
|
85
|
+
return n(() => e != null && e.uiState ? e == null ? void 0 : e.uiState.subscribe((r) => {
|
|
86
|
+
s({ ...r });
|
|
87
|
+
}) : () => {
|
|
88
|
+
}, [e == null ? void 0 : e.uiState]), o;
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
c as S,
|
|
92
|
+
F as a,
|
|
93
|
+
z as b,
|
|
94
|
+
Y as c,
|
|
95
|
+
q as d,
|
|
96
|
+
j as e,
|
|
97
|
+
G as f,
|
|
98
|
+
B as u
|
|
99
|
+
};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Advertisement } from '
|
|
2
|
-
import {
|
|
1
|
+
import { Advertisement } from '../../../packages/feature-gamification/src/index.ts';
|
|
2
|
+
import { Promotion } from '../../../packages/sdk-web-types/src/index.ts';
|
|
3
3
|
export declare const Banner: React.FC<{
|
|
4
|
-
promotion:
|
|
4
|
+
promotion: Promotion;
|
|
5
5
|
promotionId: string;
|
|
6
6
|
direction?: 'top' | 'bottom';
|
|
7
7
|
hiding?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Advertisement } from '
|
|
1
|
+
import { Advertisement } from '../../packages/feature-gamification/src/index.ts';
|
|
2
2
|
import { ControlVideoCb } from '../video-player';
|
|
3
3
|
export declare const AdvertisementUI: React.FC<{
|
|
4
4
|
advertisement: Exclude<Advertisement['data'], undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PromotionOptions } from '
|
|
1
|
+
import { PromotionOptions } from '../../packages/sdk-web-types/src/index.ts';
|
|
2
2
|
export declare const promotionMock: PromotionOptions;
|
|
3
3
|
export declare const promotionMockWithVideo: PromotionOptions;
|
|
4
4
|
export declare const promotionMockWithGAM: PromotionOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QuestionNotification, PromotionNotification } from '
|
|
1
|
+
import { QuestionNotification, PromotionNotification } from '../../../packages/sdk-web-types/src/index.ts';
|
|
2
2
|
export declare const NotificationMedia: React.FC<{
|
|
3
3
|
src: string;
|
|
4
4
|
imagePosition: PromotionNotification['imagePosition'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QuestionNotification, PromotionNotification } from '
|
|
1
|
+
import { QuestionNotification, PromotionNotification } from '../../../../packages/sdk-web-types/src/index.ts';
|
|
2
2
|
export declare const NotificationMedia: React.FC<{
|
|
3
3
|
src: string;
|
|
4
4
|
imagePosition: PromotionNotification['imagePosition'];
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import { jsx as i, jsxs as e, Fragment as
|
|
2
|
-
import { withFocusable as
|
|
3
|
-
import { NotificationPromotionImagePosition as
|
|
4
|
-
import { MediaImgBottom as
|
|
5
|
-
const
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as i, jsxs as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { withFocusable as C } from "../../../../app/webos/useTvButton.js";
|
|
3
|
+
import { NotificationPromotionImagePosition as n, NotificationEnabled as t, NotificationSponsorLogoMode as E, CtaIconMode as O } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { MediaImgBottom as l, MediaImgMiddle as L, NotificationContainer as _, NotificationContent as f, Body as S, Title as A, Text as D, Footer as F, Logo as P, Vector as x, CtaIcon as a, OpenButton as T, DismissButton as R } from "./styles.js";
|
|
5
|
+
const k = {
|
|
6
|
+
[n.UNSET]: l,
|
|
7
|
+
[n.FIT]: l,
|
|
8
|
+
[n.CENTERED]: l,
|
|
9
|
+
[n.SOLID]: l,
|
|
10
|
+
[n.BOTTOM]: l,
|
|
11
|
+
[n.MIDDLE]: L
|
|
12
|
+
}, w = ({ src: r, imagePosition: s }) => {
|
|
13
|
+
const c = k[s];
|
|
14
|
+
return /* @__PURE__ */ i(c, { children: /* @__PURE__ */ i("img", { src: r, alt: "" }) });
|
|
15
|
+
}, y = C(R), j = C(T), V = ({ notification: r, open: s, close: c, webos: d }) => {
|
|
12
16
|
if (!r || !r.promotion || r.enabled !== t.NOTIFICATION_ENABLED)
|
|
13
17
|
return null;
|
|
14
|
-
const { title:
|
|
18
|
+
const { title: m, body: N, image: h, promotion: p } = r, { sponsorLogo: g, sponsorLogoMode: M, imagePosition: b, ctaButton: o } = p;
|
|
15
19
|
return /* @__PURE__ */ e(
|
|
16
|
-
|
|
20
|
+
_,
|
|
17
21
|
{
|
|
18
|
-
"data-webos":
|
|
22
|
+
"data-webos": d,
|
|
19
23
|
className: "SL_Lower_Third_Notification",
|
|
20
|
-
onClick:
|
|
24
|
+
onClick: d ? void 0 : s,
|
|
21
25
|
children: [
|
|
22
|
-
/* @__PURE__ */ e(
|
|
23
|
-
/* @__PURE__ */ i(w, { src:
|
|
26
|
+
/* @__PURE__ */ e(f, { children: [
|
|
27
|
+
/* @__PURE__ */ i(w, { src: h, imagePosition: b }),
|
|
24
28
|
/* @__PURE__ */ e(S, { children: [
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
m && /* @__PURE__ */ i(A, { children: m }),
|
|
30
|
+
N && /* @__PURE__ */ i(D, { children: N })
|
|
27
31
|
] })
|
|
28
32
|
] }),
|
|
29
|
-
/* @__PURE__ */ e(
|
|
30
|
-
M !==
|
|
31
|
-
/* @__PURE__ */ i(
|
|
32
|
-
/* @__PURE__ */ i(
|
|
33
|
+
/* @__PURE__ */ e(F, { children: [
|
|
34
|
+
M !== E.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ e(I, { children: [
|
|
35
|
+
/* @__PURE__ */ i(P, { children: /* @__PURE__ */ i("img", { src: g, alt: m }) }),
|
|
36
|
+
/* @__PURE__ */ i(x, {})
|
|
33
37
|
] }),
|
|
34
|
-
|
|
35
|
-
/* @__PURE__ */ i(y, { webos: !0, onClick:
|
|
38
|
+
d ? /* @__PURE__ */ e(I, { children: [
|
|
39
|
+
/* @__PURE__ */ i(y, { webos: !0, onClick: c, children: "Dismiss" }),
|
|
36
40
|
/* @__PURE__ */ e(
|
|
37
41
|
j,
|
|
38
42
|
{
|
|
39
43
|
webos: !0,
|
|
40
44
|
autoFocus: !0,
|
|
41
45
|
style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color },
|
|
42
|
-
onClick:
|
|
46
|
+
onClick: s,
|
|
43
47
|
children: [
|
|
44
|
-
(o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) ===
|
|
48
|
+
(o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === O.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(a, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
|
|
45
49
|
(o == null ? void 0 : o.label) || "Open"
|
|
46
50
|
]
|
|
47
51
|
}
|
|
48
52
|
)
|
|
49
|
-
] }) : /* @__PURE__ */ e(
|
|
50
|
-
(o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) ===
|
|
53
|
+
] }) : /* @__PURE__ */ e(T, { name: "promo-button", style: { color: o == null ? void 0 : o.textColor, backgroundColor: o == null ? void 0 : o.color }, children: [
|
|
54
|
+
(o == null ? void 0 : o.ctaIcon) && (o == null ? void 0 : o.ctaIconMode) === O.CTA_ICON_TRANSPARENT && /* @__PURE__ */ i(a, { src: o == null ? void 0 : o.ctaIcon, alt: "cta-icon" }),
|
|
51
55
|
(o == null ? void 0 : o.label) || "Open"
|
|
52
56
|
] })
|
|
53
57
|
] })
|
|
@@ -56,6 +60,6 @@ const R = {
|
|
|
56
60
|
);
|
|
57
61
|
};
|
|
58
62
|
export {
|
|
59
|
-
|
|
63
|
+
V as LowerThirdNotification,
|
|
60
64
|
w as NotificationMedia
|
|
61
65
|
};
|