@streamlayer/react-ui 1.28.2 → 1.29.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/Layout/styles.d.ts +1 -0
- package/lib/app/app/Layout/styles.js +33 -24
- package/lib/app/webos/Advertisement/AdvertisementUI.d.ts +0 -1
- package/lib/app/webos/Advertisement/AdvertisementUI.js +13 -15
- package/lib/app/webos/Advertisement/index.js +10 -11
- package/lib/app/webos/ExposedPauseAd/PauseAd.d.ts +2 -0
- package/lib/app/webos/ExposedPauseAd/PauseAd.js +92 -70
- package/lib/app/webos/ExposedPauseAd/styles.d.ts +1 -1
- package/lib/app/webos/ExposedPauseAd/styles.js +5 -5
- package/lib/app/webos/index.d.ts +4 -0
- package/lib/app/webos/index.js +38 -36
- package/lib/app/webos/story.js +47 -36
- package/lib/app/webos/ui/Sidebar/PromoAction.js +38 -34
- package/lib/app/webos/ui/Sidebar/index.d.ts +0 -1
- package/lib/app/webos/ui/Sidebar/index.js +70 -71
- package/lib/app/webos/ui/Sidebar/styles.d.ts +1 -0
- package/lib/app/webos/ui/Sidebar/styles.js +120 -115
- package/lib/app/webos/ui/insight/index.js +43 -77
- package/lib/assets/style.css +1 -1
- package/lib/{index-DXvAPWiE.js → index-l-eyvmpL.js} +296 -281
- package/lib/ui/advertisement/notification/index.js +24 -24
- package/lib/ui/advertisement/notification/lower-third/index.js +48 -40
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +8 -7
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.d.ts +9 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js +44 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +240 -6
- package/lib/ui/gamification/question/inapp/notification/AdNotification/index.js +62 -52
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +138 -125
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +32 -27
- package/lib/{useVastAds-CakWRNKN.js → vast-client.min-B0NUra1B.js} +358 -594
- package/package.json +17 -17
- package/lib/app/webos/ui/Layout/index.d.ts +0 -21
- package/lib/app/webos/ui/Layout/index.js +0 -78
- package/lib/app/webos/ui/Layout/styles.d.ts +0 -11
- package/lib/app/webos/ui/Layout/styles.js +0 -59
- package/lib/hooks/useKeyboardNavigation.d.ts +0 -15
- package/lib/hooks/useKeyboardNavigation.js +0 -74
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
],
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@lottiefiles/react-lottie-player": "^3.5.4",
|
|
74
|
-
"@streamlayer/sl-eslib": "^5.
|
|
74
|
+
"@streamlayer/sl-eslib": "^5.218.0",
|
|
75
75
|
"@types/lodash.throttle": "^4.1.9",
|
|
76
76
|
"lodash.throttle": "^4.1.1",
|
|
77
77
|
"react-infinite-scroller": "^1.2.6",
|
|
@@ -80,19 +80,19 @@
|
|
|
80
80
|
"@noriginmedia/norigin-spatial-navigation": "^2.3.0",
|
|
81
81
|
"react-window-infinite-loader": "^1.0.9",
|
|
82
82
|
"uuid": "^11.1.0",
|
|
83
|
-
"@streamlayer/feature-gamification": "^1.
|
|
84
|
-
"@streamlayer/react-polyfills": "^0.1.
|
|
85
|
-
"@streamlayer/sdk-web": "^1.
|
|
86
|
-
"@streamlayer/sdk-web-
|
|
87
|
-
"@streamlayer/sdk-web
|
|
88
|
-
"@streamlayer/sdk-web-api": "^1.
|
|
89
|
-
"@streamlayer/sdk-web-core": "^1.
|
|
90
|
-
"@streamlayer/sdk-web-
|
|
91
|
-
"@streamlayer/sdk-web-
|
|
92
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
93
|
-
"@streamlayer/sdk-web-notifications": "^1.3.
|
|
94
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
95
|
-
"@streamlayer/sdk-web-types": "^1.
|
|
83
|
+
"@streamlayer/feature-gamification": "^1.22.0",
|
|
84
|
+
"@streamlayer/react-polyfills": "^0.1.35",
|
|
85
|
+
"@streamlayer/sdk-web-analytics": "^1.12.0",
|
|
86
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.2.0",
|
|
87
|
+
"@streamlayer/sdk-web": "^1.15.0",
|
|
88
|
+
"@streamlayer/sdk-web-api": "^1.13.0",
|
|
89
|
+
"@streamlayer/sdk-web-core": "^1.16.0",
|
|
90
|
+
"@streamlayer/sdk-web-interfaces": "^1.7.8",
|
|
91
|
+
"@streamlayer/sdk-web-features": "^1.0.75",
|
|
92
|
+
"@streamlayer/sdk-web-logger": "^1.0.75",
|
|
93
|
+
"@streamlayer/sdk-web-notifications": "^1.3.37",
|
|
94
|
+
"@streamlayer/sdk-web-storage": "^1.0.75",
|
|
95
|
+
"@streamlayer/sdk-web-types": "^1.15.0"
|
|
96
96
|
},
|
|
97
97
|
"nx": {
|
|
98
98
|
"implicitDependencies": [
|
|
@@ -133,10 +133,10 @@
|
|
|
133
133
|
"vite-plugin-svgr": "^4.2.0",
|
|
134
134
|
"vite-svg-loader": "^5.1.0",
|
|
135
135
|
"vite-tsconfig-paths": "^5.0.1",
|
|
136
|
-
"@streamlayer/react": "^1.
|
|
136
|
+
"@streamlayer/react": "^1.19.0"
|
|
137
137
|
},
|
|
138
138
|
"dependencies": {
|
|
139
|
-
"@dailymotion/vast-client": "^6.2
|
|
139
|
+
"@dailymotion/vast-client": "^6.4.2",
|
|
140
140
|
"@types/vast-client": "^3.0.4",
|
|
141
141
|
"@types/vmap": "^2.2.4",
|
|
142
142
|
"react-qr-code": "^2.0.16",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Gamification } from '@streamlayer/feature-gamification';
|
|
2
|
-
type SDKLayoutProps = {
|
|
3
|
-
gamification: Gamification & {
|
|
4
|
-
advertisement: Exclude<Gamification['advertisement'], undefined>;
|
|
5
|
-
};
|
|
6
|
-
sidebar?: React.ReactElement;
|
|
7
|
-
banner?: React.ReactNode;
|
|
8
|
-
video?: React.ReactNode;
|
|
9
|
-
uiState: {
|
|
10
|
-
promotionExternalAd?: boolean;
|
|
11
|
-
promotionSidebar?: boolean;
|
|
12
|
-
promotionOverlay?: boolean;
|
|
13
|
-
promotionNotification?: boolean;
|
|
14
|
-
promotionBanner?: boolean;
|
|
15
|
-
app?: boolean;
|
|
16
|
-
appNotification?: boolean;
|
|
17
|
-
onboardingNotification?: boolean;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare const SDKLayout: React.FC<SDKLayoutProps>;
|
|
21
|
-
export {};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as g, useCallback as N, useEffect as f } from "react";
|
|
3
|
-
import { useStore as R } from "@streamlayer/react-polyfills";
|
|
4
|
-
import { Container as S, ContentContainer as V, VideoContainer as A, AdContainer as k, AdLabel as z, VideoBox as E, VideoPlayer as L, Banner as j, Sidebar as I } from "./styles.js";
|
|
5
|
-
const H = ({ gamification: b, sidebar: x, banner: y, video: C, uiState: h }) => {
|
|
6
|
-
var p, u;
|
|
7
|
-
const r = R(b.advertisement.$store), o = g(null), m = g(null), a = N(() => {
|
|
8
|
-
const e = m.current, i = o.current;
|
|
9
|
-
if (!e || !i)
|
|
10
|
-
return;
|
|
11
|
-
const { width: c, height: w } = e.getBoundingClientRect(), { width: B, height: v } = i.getBoundingClientRect();
|
|
12
|
-
(c > B || w > v) && (e.style.width === "100%" ? (e.style.height = "100%", e.style.width = "auto") : (e.style.width = "100%", e.style.height = "auto"));
|
|
13
|
-
}, []);
|
|
14
|
-
f(() => {
|
|
15
|
-
if (o.current) {
|
|
16
|
-
const e = new ResizeObserver((i) => {
|
|
17
|
-
for (const c of i)
|
|
18
|
-
c.contentBoxSize && a();
|
|
19
|
-
});
|
|
20
|
-
return e.observe(o.current), () => {
|
|
21
|
-
e.disconnect();
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
return () => {
|
|
25
|
-
};
|
|
26
|
-
}, [a]), f(a);
|
|
27
|
-
const s = h.promotionSidebar, d = h.promotionBanner, n = !!r.data;
|
|
28
|
-
return /* @__PURE__ */ l(
|
|
29
|
-
S,
|
|
30
|
-
{
|
|
31
|
-
style: { backgroundImage: `url(${(u = (p = r == null ? void 0 : r.data) == null ? void 0 : p.promotion) == null ? void 0 : u.backgroundImageLandscapeUrl})` },
|
|
32
|
-
className: "Container",
|
|
33
|
-
children: [
|
|
34
|
-
/* @__PURE__ */ l(
|
|
35
|
-
V,
|
|
36
|
-
{
|
|
37
|
-
className: "ContentContainer",
|
|
38
|
-
style: {
|
|
39
|
-
width: s ? "calc(100% - var(--sidebar-width-webos))" : "100%"
|
|
40
|
-
},
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ l(
|
|
43
|
-
A,
|
|
44
|
-
{
|
|
45
|
-
className: "VideoContainer",
|
|
46
|
-
ref: o,
|
|
47
|
-
style: {
|
|
48
|
-
height: d ? "calc(100% - var(--banner-height))" : "100%",
|
|
49
|
-
padding: n ? "20px 40px 0" : "0"
|
|
50
|
-
},
|
|
51
|
-
children: [
|
|
52
|
-
n && /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(z, { children: "Ad" }) }),
|
|
53
|
-
/* @__PURE__ */ t(E, { ref: m, className: "VideoBox", children: /* @__PURE__ */ t(L, { className: "VideoPlayer", children: C }) })
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
n && /* @__PURE__ */ t(
|
|
58
|
-
j,
|
|
59
|
-
{
|
|
60
|
-
className: "Banner",
|
|
61
|
-
style: {
|
|
62
|
-
height: d ? "var(--banner-height)" : "0px",
|
|
63
|
-
paddingTop: n ? "10px" : "0px"
|
|
64
|
-
},
|
|
65
|
-
children: d && y
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
n && /* @__PURE__ */ t(I, { style: { width: s ? "var(--sidebar-width-webos)" : "0px" }, className: "Sidebar", children: s && x })
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
export {
|
|
77
|
-
H as SDKLayout
|
|
78
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
|
-
export declare const ContentContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
-
export declare const Sidebar: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
4
|
-
export declare const Banner: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
|
-
export declare const VideoContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
|
-
export declare const AdSquare: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
7
|
-
export declare const AdText: import('@linaria/react').StyledComponent<import('react').SVGTextElementAttributes<SVGTextElement> & Record<never, unknown>>;
|
|
8
|
-
export declare const VideoBox: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
9
|
-
export declare const VideoPlayer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
10
|
-
export declare const AdContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
11
|
-
export declare const AdLabel: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { styled as s } from "@linaria/react";
|
|
2
|
-
const a = /* @__PURE__ */ s("div")({
|
|
3
|
-
name: "Container",
|
|
4
|
-
class: "c1obxisu",
|
|
5
|
-
propsAsIs: !1
|
|
6
|
-
}), n = /* @__PURE__ */ s("div")({
|
|
7
|
-
name: "ContentContainer",
|
|
8
|
-
class: "c1e373pc",
|
|
9
|
-
propsAsIs: !1
|
|
10
|
-
}), o = /* @__PURE__ */ s("div")({
|
|
11
|
-
name: "Sidebar",
|
|
12
|
-
class: "s17z6ieo",
|
|
13
|
-
propsAsIs: !1
|
|
14
|
-
}), t = /* @__PURE__ */ s("div")({
|
|
15
|
-
name: "Banner",
|
|
16
|
-
class: "b19343i2",
|
|
17
|
-
propsAsIs: !1
|
|
18
|
-
}), r = /* @__PURE__ */ s("div")({
|
|
19
|
-
name: "VideoContainer",
|
|
20
|
-
class: "v2g7ow7",
|
|
21
|
-
propsAsIs: !1
|
|
22
|
-
}), i = /* @__PURE__ */ s("div")({
|
|
23
|
-
name: "AdSquare",
|
|
24
|
-
class: "a1dsvt0d",
|
|
25
|
-
propsAsIs: !1
|
|
26
|
-
}), d = /* @__PURE__ */ s("text")({
|
|
27
|
-
name: "AdText",
|
|
28
|
-
class: "aicz97j",
|
|
29
|
-
propsAsIs: !0
|
|
30
|
-
}), p = /* @__PURE__ */ s("div")({
|
|
31
|
-
name: "VideoBox",
|
|
32
|
-
class: "vekop6u",
|
|
33
|
-
propsAsIs: !1
|
|
34
|
-
}), c = /* @__PURE__ */ s("div")({
|
|
35
|
-
name: "VideoPlayer",
|
|
36
|
-
class: "v10439jy",
|
|
37
|
-
propsAsIs: !1
|
|
38
|
-
}), l = /* @__PURE__ */ s("div")({
|
|
39
|
-
name: "AdContainer",
|
|
40
|
-
class: "atraheb",
|
|
41
|
-
propsAsIs: !1
|
|
42
|
-
}), A = /* @__PURE__ */ s("span")({
|
|
43
|
-
name: "AdLabel",
|
|
44
|
-
class: "a1uehkbk",
|
|
45
|
-
propsAsIs: !1
|
|
46
|
-
});
|
|
47
|
-
export {
|
|
48
|
-
l as AdContainer,
|
|
49
|
-
A as AdLabel,
|
|
50
|
-
i as AdSquare,
|
|
51
|
-
d as AdText,
|
|
52
|
-
t as Banner,
|
|
53
|
-
a as Container,
|
|
54
|
-
n as ContentContainer,
|
|
55
|
-
o as Sidebar,
|
|
56
|
-
p as VideoBox,
|
|
57
|
-
r as VideoContainer,
|
|
58
|
-
c as VideoPlayer
|
|
59
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DependencyList } from 'react';
|
|
2
|
-
interface KeyboardNavigationOptions {
|
|
3
|
-
containerSelector: string;
|
|
4
|
-
getElements?: (container: HTMLElement) => HTMLElement[];
|
|
5
|
-
onEscape: () => void;
|
|
6
|
-
onEnter?: (element: HTMLElement, index: number) => void;
|
|
7
|
-
initialFocusPriority?: 'close-btn' | 'first' | number;
|
|
8
|
-
enabled?: boolean;
|
|
9
|
-
dependencies?: DependencyList;
|
|
10
|
-
resetFocusOn?: unknown[];
|
|
11
|
-
}
|
|
12
|
-
export declare const useKeyboardNavigation: (options: KeyboardNavigationOptions) => {
|
|
13
|
-
focusedIndex: import('react').MutableRefObject<number>;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { useRef as m, useEffect as D } from "react";
|
|
2
|
-
const R = (g) => {
|
|
3
|
-
const {
|
|
4
|
-
containerSelector: y,
|
|
5
|
-
getElements: A,
|
|
6
|
-
onEscape: v,
|
|
7
|
-
onEnter: a,
|
|
8
|
-
initialFocusPriority: l = "close-btn",
|
|
9
|
-
enabled: E = !0,
|
|
10
|
-
dependencies: h = [],
|
|
11
|
-
resetFocusOn: f = []
|
|
12
|
-
} = g, t = m(0), d = m(!1), k = m(f);
|
|
13
|
-
return f.some((o, p) => o !== k.current[p]) && (d.current = !1, k.current = f), D(() => {
|
|
14
|
-
if (!E) return;
|
|
15
|
-
const o = document.querySelector(y);
|
|
16
|
-
if (!o) return;
|
|
17
|
-
const b = A || ((e) => Array.from(e.querySelectorAll("button")).filter((r) => !r.disabled));
|
|
18
|
-
let n = b(o);
|
|
19
|
-
(() => {
|
|
20
|
-
var e, c, r;
|
|
21
|
-
if (n.length !== 0) {
|
|
22
|
-
if (d.current) {
|
|
23
|
-
const s = document.activeElement;
|
|
24
|
-
if (n.includes(s))
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (l === "close-btn") {
|
|
28
|
-
const s = o.querySelector('[data-close-btn="true"]');
|
|
29
|
-
if (s) {
|
|
30
|
-
const i = n.indexOf(s);
|
|
31
|
-
t.current = i !== -1 ? i : 0, s.focus();
|
|
32
|
-
} else
|
|
33
|
-
t.current = 0, (e = n[t.current]) == null || e.focus();
|
|
34
|
-
} else l === "first" ? (t.current = 0, (c = n[t.current]) == null || c.focus()) : typeof l == "number" && (t.current = Math.min(l, n.length - 1), (r = n[t.current]) == null || r.focus());
|
|
35
|
-
d.current = !0;
|
|
36
|
-
}
|
|
37
|
-
})();
|
|
38
|
-
const w = (e) => {
|
|
39
|
-
var s, i;
|
|
40
|
-
if (!o) return;
|
|
41
|
-
n = b(o);
|
|
42
|
-
const c = n.length;
|
|
43
|
-
if (c === 0) return;
|
|
44
|
-
const r = e.keyCode;
|
|
45
|
-
if (["ArrowDown", "ArrowRight"].includes(e.key) || r === 40 || r === 39) {
|
|
46
|
-
t.current = (t.current + 1) % c, (s = n[t.current]) == null || s.focus(), e.preventDefault();
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (["ArrowUp", "ArrowLeft"].includes(e.key) || r === 38 || r === 37) {
|
|
50
|
-
t.current = (t.current - 1 + c) % c, (i = n[t.current]) == null || i.focus(), e.preventDefault();
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (e.key === "Enter" || r === 13 || e.key === " ") {
|
|
54
|
-
const u = n[t.current];
|
|
55
|
-
if (!u) return;
|
|
56
|
-
const F = document.activeElement;
|
|
57
|
-
if (!n.includes(F))
|
|
58
|
-
return;
|
|
59
|
-
a ? a(u, t.current) : (u.tagName === "BUTTON" || u.tagName, u.click()), e.preventDefault();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (e.key === "Escape" || e.key === "Backspace" || e.code === "Back" || r === 10009) {
|
|
63
|
-
v(), e.preventDefault();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
return window.addEventListener("keydown", w), () => {
|
|
68
|
-
window.removeEventListener("keydown", w);
|
|
69
|
-
};
|
|
70
|
-
}, [E, y, l, v, a, ...h, ...f]), { focusedIndex: t };
|
|
71
|
-
};
|
|
72
|
-
export {
|
|
73
|
-
R as useKeyboardNavigation
|
|
74
|
-
};
|