@streamlayer/react-ui 1.22.4 → 1.22.6
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/masters/Features/Gamification/index.d.ts +1 -0
- package/lib/app/masters/Features/Gamification/index.js +36 -30
- package/lib/app/masters/Features/index.d.ts +1 -0
- package/lib/app/masters/Features/index.js +13 -12
- package/lib/app/masters/Notifications/index.d.ts +1 -0
- package/lib/app/masters/Notifications/index.js +97 -94
- package/lib/app/masters/Points/index.js +16 -25
- package/lib/app/masters/masters.d.ts +1 -0
- package/lib/app/masters/masters.js +71 -60
- package/lib/app/masters/story/index.d.ts +0 -1
- package/lib/app/masters/story/index.js +25 -37
- package/lib/app/masters/styles.d.ts +1 -0
- package/lib/app/masters/styles.js +16 -15
- package/lib/app/masters/useSdkResponsive.js +20 -19
- package/lib/app/masters/useSdkScroll.d.ts +1 -1
- package/lib/app/masters/useSdkScroll.js +33 -33
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
- package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
- package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
- package/lib/ui/modal/index.d.ts +1 -0
- package/lib/ui/modal/index.js +36 -31
- package/lib/ui/questions/insight/index.js +24 -16
- package/lib/ui/questions/insight/styles.d.ts +1 -0
- package/lib/ui/questions/insight/styles.js +14 -13
- package/lib/ui/questions/twitter/index.js +54 -58
- package/lib/ui/theme/constants.d.ts +2 -0
- package/lib/ui/theme/constants.js +6 -4
- package/lib/ui/theme/masters-theme.js +6 -2
- package/lib/ui/theme/theme.js +3 -0
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +76 -60
- package/package.json +15 -15
|
@@ -1,31 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { AutoPlayVideo as
|
|
3
|
-
import { VideoPlayer as
|
|
4
|
-
import { Container as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as h, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { AutoPlayVideo as C, QuestionImages as I } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { VideoPlayer as N } from "../../video-player/index.js";
|
|
4
|
+
import { Container as v, contentContainerClassName as u, ImageContainer as P, Image as b, Content as x, Title as B, Description as D } from "./styles.js";
|
|
5
|
+
const U = ({
|
|
6
6
|
instantView: o,
|
|
7
7
|
isDetail: l,
|
|
8
8
|
notification: r,
|
|
9
|
-
controlVideo:
|
|
9
|
+
controlVideo: g
|
|
10
10
|
}) => {
|
|
11
|
-
const m = o == null ? void 0 : o.heading,
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
const m = o == null ? void 0 : o.heading, c = o == null ? void 0 : o.body, e = m || c, y = r == null ? void 0 : r.title, p = r == null ? void 0 : r.body;
|
|
12
|
+
return /* @__PURE__ */ h(v, { children: [
|
|
13
13
|
(o == null ? void 0 : o.video) && /* @__PURE__ */ d(
|
|
14
|
-
|
|
14
|
+
N,
|
|
15
15
|
{
|
|
16
|
+
className: u,
|
|
16
17
|
source: o.video.url,
|
|
17
18
|
poster: o.video.thumbnailUrl,
|
|
18
|
-
controlVideo:
|
|
19
|
-
autoPlay: o.autoPlayVideo ===
|
|
19
|
+
controlVideo: g,
|
|
20
|
+
autoPlay: l && o.autoPlayVideo === C.ENABLED
|
|
20
21
|
}
|
|
21
22
|
),
|
|
22
|
-
(o == null ? void 0 : o.image) && !(o != null && o.video) && /* @__PURE__ */ d(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
(o == null ? void 0 : o.image) && !(o != null && o.video) && /* @__PURE__ */ d(
|
|
24
|
+
P,
|
|
25
|
+
{
|
|
26
|
+
className: u,
|
|
27
|
+
"data-rounded": o.imageMode === I.ROUNDED,
|
|
28
|
+
children: /* @__PURE__ */ d(b, { src: o == null ? void 0 : o.image })
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ h(x, { children: [
|
|
32
|
+
/* @__PURE__ */ d(B, { children: l && e ? m : y }),
|
|
33
|
+
/* @__PURE__ */ d(D, { children: l && e ? c : p })
|
|
26
34
|
] })
|
|
27
35
|
] });
|
|
28
36
|
};
|
|
29
37
|
export {
|
|
30
|
-
|
|
38
|
+
U as InsightContent
|
|
31
39
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
|
+
export declare const contentContainerClassName: import('@linaria/core').LinariaClassName;
|
|
2
3
|
export declare const Content: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
4
|
export declare const Title: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLHeadingElement> & import('react').HTMLAttributes<HTMLHeadingElement> & Record<never, unknown>>;
|
|
4
5
|
export declare const Description: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -3,32 +3,33 @@ const n = /* @__PURE__ */ s("div")({
|
|
|
3
3
|
name: "Container",
|
|
4
4
|
class: "cgn5uen",
|
|
5
5
|
propsAsIs: !1
|
|
6
|
-
}), a = /* @__PURE__ */ s("div")({
|
|
6
|
+
}), a = "c1px8nt6", t = /* @__PURE__ */ s("div")({
|
|
7
7
|
name: "Content",
|
|
8
|
-
class: "
|
|
8
|
+
class: "c5et2jt",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
10
|
+
}), o = /* @__PURE__ */ s("h3")({
|
|
11
11
|
name: "Title",
|
|
12
|
-
class: "
|
|
12
|
+
class: "t1i2kpk2",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
14
|
+
}), i = /* @__PURE__ */ s("div")({
|
|
15
15
|
name: "Description",
|
|
16
|
-
class: "
|
|
16
|
+
class: "dd3lh3p",
|
|
17
17
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
18
|
+
}), c = /* @__PURE__ */ s("img")({
|
|
19
19
|
name: "Image",
|
|
20
|
-
class: "
|
|
20
|
+
class: "i1gfjeu5",
|
|
21
21
|
propsAsIs: !1
|
|
22
22
|
}), p = /* @__PURE__ */ s("div")({
|
|
23
23
|
name: "ImageContainer",
|
|
24
|
-
class: "
|
|
24
|
+
class: "i58y999",
|
|
25
25
|
propsAsIs: !1
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
28
|
n as Container,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
t as Content,
|
|
30
|
+
i as Description,
|
|
31
|
+
c as Image,
|
|
32
32
|
p as ImageContainer,
|
|
33
|
-
|
|
33
|
+
o as Title,
|
|
34
|
+
a as contentContainerClassName
|
|
34
35
|
};
|
|
@@ -1,63 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
body: C,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */ n(p, { src: r[0].mediaUrlHttps }),
|
|
40
|
-
/* @__PURE__ */ c(a, { children: [
|
|
41
|
-
/* @__PURE__ */ n(l, { src: r[1].mediaUrlHttps }),
|
|
42
|
-
/* @__PURE__ */ n(l, { src: r[2].mediaUrlHttps })
|
|
43
|
-
] })
|
|
44
|
-
] }),
|
|
45
|
-
(r == null ? void 0 : r.length) === 4 && /* @__PURE__ */ c(i, { children: [
|
|
46
|
-
/* @__PURE__ */ c(a, { children: [
|
|
47
|
-
/* @__PURE__ */ n(l, { src: r[0].mediaUrlHttps }),
|
|
48
|
-
/* @__PURE__ */ n(l, { src: r[1].mediaUrlHttps })
|
|
1
|
+
import { jsxs as o, jsx as s, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { memo as k, useMemo as x } from "react";
|
|
3
|
+
import { VideoPlayer as B } from "../../video-player/index.js";
|
|
4
|
+
import { Account as E } from "./account/index.js";
|
|
5
|
+
import { Container as L, Details as N, Body as R, ImagesContainer as l, ImageFullSize as t, ImageHalfSize as p, ImagesBlock as a } from "./styles.js";
|
|
6
|
+
const S = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), A = (c) => c == null ? void 0 : c.replace(S, ""), $ = k(
|
|
7
|
+
({ image: c, body: y, account: C, accountVerified: z, tweet: n, isDetail: d, controlVideo: F }) => {
|
|
8
|
+
var h, g, H, U, f;
|
|
9
|
+
const r = (g = (h = n == null ? void 0 : n.meta) == null ? void 0 : h.extendedEntities) == null ? void 0 : g.media, i = r == null ? void 0 : r.find(({ type: e }) => e === "photo"), m = x(() => {
|
|
10
|
+
var e, u, v, I;
|
|
11
|
+
return (I = (v = (u = (e = r == null ? void 0 : r[0]) == null ? void 0 : e.videoInfo) == null ? void 0 : u.variants) == null ? void 0 : v.findLast(({ contentType: T }) => T === "video/mp4")) == null ? void 0 : I.url;
|
|
12
|
+
}, [r]);
|
|
13
|
+
return /* @__PURE__ */ o(L, { children: [
|
|
14
|
+
/* @__PURE__ */ o(N, { children: [
|
|
15
|
+
/* @__PURE__ */ s(
|
|
16
|
+
E,
|
|
17
|
+
{
|
|
18
|
+
image: c,
|
|
19
|
+
name: (H = n == null ? void 0 : n.meta) == null ? void 0 : H.accountName,
|
|
20
|
+
userName: C,
|
|
21
|
+
verified: z,
|
|
22
|
+
createdTweet: n == null ? void 0 : n.date
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ s(R, { children: A(y) }),
|
|
26
|
+
!d && i && /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(t, { src: r == null ? void 0 : r[0].mediaUrlHttps }) }),
|
|
27
|
+
d && i && /* @__PURE__ */ o(j, { children: [
|
|
28
|
+
(r == null ? void 0 : r.length) === 1 && /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(t, { src: r[0].mediaUrlHttps }) }),
|
|
29
|
+
(r == null ? void 0 : r.length) === 2 && /* @__PURE__ */ o(l, { children: [
|
|
30
|
+
/* @__PURE__ */ s(p, { src: r[0].mediaUrlHttps }),
|
|
31
|
+
/* @__PURE__ */ s(p, { src: r[1].mediaUrlHttps })
|
|
32
|
+
] }),
|
|
33
|
+
(r == null ? void 0 : r.length) === 3 && /* @__PURE__ */ o(l, { children: [
|
|
34
|
+
/* @__PURE__ */ s(p, { src: r[0].mediaUrlHttps }),
|
|
35
|
+
/* @__PURE__ */ o(a, { children: [
|
|
36
|
+
/* @__PURE__ */ s(t, { src: r[1].mediaUrlHttps }),
|
|
37
|
+
/* @__PURE__ */ s(t, { src: r[2].mediaUrlHttps })
|
|
38
|
+
] })
|
|
49
39
|
] }),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
40
|
+
(r == null ? void 0 : r.length) === 4 && /* @__PURE__ */ o(l, { children: [
|
|
41
|
+
/* @__PURE__ */ o(a, { children: [
|
|
42
|
+
/* @__PURE__ */ s(t, { src: r[0].mediaUrlHttps }),
|
|
43
|
+
/* @__PURE__ */ s(t, { src: r[1].mediaUrlHttps })
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ o(a, { children: [
|
|
46
|
+
/* @__PURE__ */ s(t, { src: r[2].mediaUrlHttps }),
|
|
47
|
+
/* @__PURE__ */ s(t, { src: r[3].mediaUrlHttps })
|
|
48
|
+
] })
|
|
53
49
|
] })
|
|
54
50
|
] })
|
|
55
|
-
] })
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
] }),
|
|
52
|
+
!i && (((U = r == null ? void 0 : r[0]) == null ? void 0 : U.type) === "video" || ((f = r == null ? void 0 : r[0]) == null ? void 0 : f.type) === "animated_gif") && m && /* @__PURE__ */ s(B, { source: m, poster: r[0].mediaUrlHttps, controlVideo: F })
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
);
|
|
60
56
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
$ as TwitterContent,
|
|
58
|
+
A as sanitizeContent
|
|
63
59
|
};
|
|
@@ -61,6 +61,8 @@ export declare const COLORS: {
|
|
|
61
61
|
IN_APP_QUESTION_QUOTE: string;
|
|
62
62
|
IN_APP_QUESTION_RESULT_SUBTITLE_BG: string;
|
|
63
63
|
IN_APP_QUESTION_RESULT_LINE: string;
|
|
64
|
+
QUOTE_BORDER: string;
|
|
65
|
+
QUOTE_TEXT: string;
|
|
64
66
|
};
|
|
65
67
|
export declare const COLORS_ADVERTISEMENT: {
|
|
66
68
|
BG_PRIMARY: string;
|
|
@@ -62,7 +62,9 @@ const R = {
|
|
|
62
62
|
IN_APP_QUESTION_TYPE_LABEL: "#82899E",
|
|
63
63
|
IN_APP_QUESTION_QUOTE: "rgba(10, 14, 19, 0.70)",
|
|
64
64
|
IN_APP_QUESTION_RESULT_SUBTITLE_BG: "#1D7BFF",
|
|
65
|
-
IN_APP_QUESTION_RESULT_LINE: "#babfc5"
|
|
65
|
+
IN_APP_QUESTION_RESULT_LINE: "#babfc5",
|
|
66
|
+
QUOTE_BORDER: "#E8E8E8",
|
|
67
|
+
QUOTE_TEXT: "rgba(10, 14, 19, 0.70)"
|
|
66
68
|
}, F = {
|
|
67
69
|
BG_PRIMARY: "#13212b",
|
|
68
70
|
BG_SECONDARY: "#152430",
|
|
@@ -73,7 +75,7 @@ const R = {
|
|
|
73
75
|
TEXT_SECONDARY: "rgba(255, 255, 255, 0.8)",
|
|
74
76
|
TEXT_SECONDARY1: "#878787",
|
|
75
77
|
WHITE: "#fff"
|
|
76
|
-
}, I = ["#107D57", "#DF2F3B", "#DF2F3B", "#E8E8E8"],
|
|
78
|
+
}, I = ["#107D57", "#DF2F3B", "#DF2F3B", "#E8E8E8"], O = "#cee5de", N = "#f9d6d8", S = "#E8E8E8", D = {
|
|
77
79
|
REGULAR: "'SF Pro Text', Arial, Helvetica, sans-serif",
|
|
78
80
|
SERIF: "'SF Pro Display', Arial, Helvetica, sans-serif",
|
|
79
81
|
COLOR: "#fff",
|
|
@@ -111,8 +113,8 @@ export {
|
|
|
111
113
|
B as ORIENTATION,
|
|
112
114
|
I as TIMER_COLORS,
|
|
113
115
|
S as TIMER_GRAY,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
O as TIMER_GREEN,
|
|
117
|
+
N as TIMER_RED,
|
|
116
118
|
C as colors,
|
|
117
119
|
L as colorsAdvertisement
|
|
118
120
|
};
|
|
@@ -65,7 +65,8 @@ const _ = {
|
|
|
65
65
|
IN_APP_QUESTION_TYPE_LABEL: "#82899E",
|
|
66
66
|
IN_APP_QUESTION_QUOTE: "rgba(10, 14, 19, 0.70)",
|
|
67
67
|
IN_APP_QUESTION_RESULT_SUBTITLE_BG: "#1D7BFF",
|
|
68
|
-
IN_APP_QUESTION_RESULT_LINE: "#babfc5"
|
|
68
|
+
IN_APP_QUESTION_RESULT_LINE: "#babfc5",
|
|
69
|
+
QUOTE_TEXT: "#006944"
|
|
69
70
|
}, e = {
|
|
70
71
|
...t,
|
|
71
72
|
REGULAR: "'Benton Sans', BentonSans, Arial, Helvetica, sans-serif",
|
|
@@ -93,7 +94,7 @@ const _ = {
|
|
|
93
94
|
--font-size-secondary: ${t.SIZE_DEFAULT1};
|
|
94
95
|
--font-size-small: ${t.SIZE_DEFAULT2};
|
|
95
96
|
--line-height-default: ${t.LINE_HEIGHT};
|
|
96
|
-
--margin-title-default:
|
|
97
|
+
--margin-title-default: 0px 0px 12px;
|
|
97
98
|
--font-header-title: 20px;
|
|
98
99
|
|
|
99
100
|
--header-offset: 0px;
|
|
@@ -120,6 +121,9 @@ const _ = {
|
|
|
120
121
|
--welcome-screen-graphic-size: 80px;
|
|
121
122
|
--welcome-screen-graphic-size-xl: 125px;
|
|
122
123
|
--insight-image-ratio: 16/9;
|
|
124
|
+
--quote-indent: 0px;
|
|
125
|
+
--quote-padding: 0px;
|
|
126
|
+
--history-card-gap: 1rem;
|
|
123
127
|
|
|
124
128
|
${n.down("xl")`
|
|
125
129
|
--header-offset: 0px;
|
package/lib/ui/theme/theme.js
CHANGED
|
@@ -46,6 +46,9 @@ const l = `
|
|
|
46
46
|
--card-border: 1px solid var(--color-card-border);
|
|
47
47
|
--welcome-screen-graphic-size: 144px;
|
|
48
48
|
--welcome-screen-graphic-size-xl: 144px;
|
|
49
|
+
--quote-indent: 0 0 8px 0px;
|
|
50
|
+
--quote-padding: 4px 16px 8px 0;
|
|
51
|
+
--history-card-gap: 0.75rem;
|
|
49
52
|
|
|
50
53
|
--row-gap-default: 12px;
|
|
51
54
|
--row-gap-default1: 12px;
|
|
@@ -1,97 +1,113 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { eventBus as
|
|
5
|
-
import { SvgIcon as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as k, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cx as C } from "@linaria/core";
|
|
3
|
+
import { useRef as U, useState as p, useCallback as w, useEffect as O } from "react";
|
|
4
|
+
import { eventBus as F } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { SvgIcon as T } from "../icons/index.js";
|
|
6
|
+
import { Loader as A } from "../loader/index.js";
|
|
7
|
+
import { Container as B, ToggleIconPause as N, HideControls as q, Player as z, Poster as D, Control as H } from "./styles.js";
|
|
8
|
+
const G = (s) => {
|
|
9
|
+
for (const r of s)
|
|
9
10
|
r.isIntersecting ? r.target instanceof HTMLVideoElement && r.target.autoplay && r.target.play() : r.target instanceof HTMLVideoElement && !r.target.paused && r.target.pause();
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
for (const
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
poster:
|
|
11
|
+
}, I = new IntersectionObserver(G, { threshold: 0.5 }), v = /* @__PURE__ */ new Set(), J = (s) => {
|
|
12
|
+
I.observe(s), v.add(s);
|
|
13
|
+
}, K = (s) => {
|
|
14
|
+
I.unobserve(s), v.delete(s);
|
|
15
|
+
}, Q = () => {
|
|
16
|
+
for (const s of v)
|
|
17
|
+
s instanceof HTMLVideoElement && !s.paused && s.pause();
|
|
18
|
+
}, R = ({
|
|
19
|
+
poster: s,
|
|
19
20
|
source: r,
|
|
20
|
-
aspectRatio:
|
|
21
|
+
aspectRatio: y,
|
|
21
22
|
controlVideo: n,
|
|
22
|
-
onPlay:
|
|
23
|
-
onPause:
|
|
24
|
-
autoPlay:
|
|
25
|
-
hideControls:
|
|
23
|
+
onPlay: f,
|
|
24
|
+
onPause: m,
|
|
25
|
+
autoPlay: x,
|
|
26
|
+
hideControls: b,
|
|
27
|
+
className: M
|
|
26
28
|
}) => {
|
|
27
|
-
const
|
|
29
|
+
const t = U(null), [d, o] = p(!1), [h, L] = p(!1), [E, c] = p(!0), P = w(() => {
|
|
28
30
|
n == null || n({ muted: !0 });
|
|
29
|
-
}, [n]),
|
|
31
|
+
}, [n]), l = w(() => {
|
|
30
32
|
n == null || n({ muted: !1 });
|
|
31
|
-
}, [n]),
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
if (
|
|
36
|
-
|
|
33
|
+
}, [n]), S = (e) => {
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
const i = t == null ? void 0 : t.current;
|
|
36
|
+
if (i) {
|
|
37
|
+
if (d)
|
|
38
|
+
i.pause();
|
|
37
39
|
else {
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
+
const u = t == null ? void 0 : t.current;
|
|
41
|
+
if (!u)
|
|
40
42
|
return;
|
|
41
|
-
|
|
43
|
+
Q(), u.play().catch((g) => console.log(g)), c(!1);
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
F.emit("interactions", {
|
|
44
46
|
action: "tap",
|
|
45
47
|
payload: {}
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
|
-
},
|
|
49
|
-
var
|
|
50
|
-
(
|
|
50
|
+
}, j = () => {
|
|
51
|
+
var e;
|
|
52
|
+
(e = t == null ? void 0 : t.current) == null || e.load(), c(!0);
|
|
51
53
|
};
|
|
52
|
-
return
|
|
53
|
-
const
|
|
54
|
+
return O(() => {
|
|
55
|
+
const e = t == null ? void 0 : t.current;
|
|
54
56
|
return () => {
|
|
55
|
-
|
|
57
|
+
e && (e.paused || l());
|
|
56
58
|
};
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
return
|
|
59
|
+
}, [l]), O(() => {
|
|
60
|
+
const e = t.current;
|
|
61
|
+
return e ? (J(e), () => K(e)) : () => {
|
|
60
62
|
};
|
|
61
|
-
}, []), /* @__PURE__ */
|
|
62
|
-
|
|
63
|
+
}, []), /* @__PURE__ */ k(
|
|
64
|
+
B,
|
|
63
65
|
{
|
|
64
|
-
onClick:
|
|
65
|
-
className:
|
|
66
|
-
style:
|
|
66
|
+
onClick: b ? void 0 : S,
|
|
67
|
+
className: C(d && N, b && q, M),
|
|
68
|
+
style: y ? { aspectRatio: y } : {},
|
|
67
69
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
70
|
+
/* @__PURE__ */ a(
|
|
71
|
+
z,
|
|
70
72
|
{
|
|
71
|
-
ref:
|
|
73
|
+
ref: t,
|
|
72
74
|
src: r,
|
|
73
|
-
autoPlay:
|
|
75
|
+
autoPlay: x,
|
|
74
76
|
onPlay: () => {
|
|
75
|
-
|
|
77
|
+
P(), o(!0), c(!1), f == null || f();
|
|
78
|
+
},
|
|
79
|
+
onError: async (e) => {
|
|
80
|
+
try {
|
|
81
|
+
if (e.target instanceof HTMLVideoElement) {
|
|
82
|
+
L(!0);
|
|
83
|
+
const u = await (await fetch(e.target.src)).blob(), g = URL.createObjectURL(u);
|
|
84
|
+
e.target.src = g;
|
|
85
|
+
}
|
|
86
|
+
} catch (i) {
|
|
87
|
+
console.error("video fallback fetch failed", i), o(!0), c(!0);
|
|
88
|
+
} finally {
|
|
89
|
+
L(!1);
|
|
90
|
+
}
|
|
76
91
|
},
|
|
77
92
|
onPause: () => {
|
|
78
|
-
|
|
93
|
+
l(), o(!1), m == null || m();
|
|
79
94
|
},
|
|
80
95
|
onEnded: () => {
|
|
81
|
-
|
|
96
|
+
l(), o(!1), j();
|
|
82
97
|
},
|
|
83
|
-
style: { visibility:
|
|
98
|
+
style: { visibility: E ? "hidden" : "visible" },
|
|
84
99
|
controls: !1,
|
|
85
100
|
playsInline: !0
|
|
86
101
|
}
|
|
87
102
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
!
|
|
103
|
+
/* @__PURE__ */ a(D, { src: s, style: { visibility: E ? "visible" : "hidden" } }),
|
|
104
|
+
!b && !h && /* @__PURE__ */ a(H, { children: d ? /* @__PURE__ */ a(T, { name: "icon-pause" }) : /* @__PURE__ */ a(T, { name: "icon-play" }) }),
|
|
105
|
+
h && /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(A, {}) })
|
|
90
106
|
]
|
|
91
107
|
}
|
|
92
108
|
);
|
|
93
109
|
};
|
|
94
110
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
111
|
+
R as VideoPlayer,
|
|
112
|
+
Q as pauseAllVideos
|
|
97
113
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -69,19 +69,19 @@
|
|
|
69
69
|
"react-window": "^1.8.10",
|
|
70
70
|
"react-window-infinite-loader": "^1.0.9",
|
|
71
71
|
"uuid": "^11.1.0",
|
|
72
|
-
"@streamlayer/feature-gamification": "^1.16.
|
|
73
|
-
"@streamlayer/react-polyfills": "^0.1.
|
|
74
|
-
"@streamlayer/sdk-web": "^1.10.
|
|
75
|
-
"@streamlayer/sdk-web-analytics": "^1.7.
|
|
76
|
-
"@streamlayer/sdk-web-anonymous-auth": "^1.1.
|
|
77
|
-
"@streamlayer/sdk-web-api": "^1.8.
|
|
78
|
-
"@streamlayer/sdk-web-core": "^1.11.
|
|
79
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
80
|
-
"@streamlayer/sdk-web-interfaces": "^1.4.
|
|
81
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
82
|
-
"@streamlayer/sdk-web-notifications": "^1.3.
|
|
83
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
84
|
-
"@streamlayer/sdk-web-types": "^1.10.
|
|
72
|
+
"@streamlayer/feature-gamification": "^1.16.8",
|
|
73
|
+
"@streamlayer/react-polyfills": "^0.1.15",
|
|
74
|
+
"@streamlayer/sdk-web": "^1.10.8",
|
|
75
|
+
"@streamlayer/sdk-web-analytics": "^1.7.8",
|
|
76
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.1.34",
|
|
77
|
+
"@streamlayer/sdk-web-api": "^1.8.8",
|
|
78
|
+
"@streamlayer/sdk-web-core": "^1.11.10",
|
|
79
|
+
"@streamlayer/sdk-web-features": "^1.0.55",
|
|
80
|
+
"@streamlayer/sdk-web-interfaces": "^1.4.21",
|
|
81
|
+
"@streamlayer/sdk-web-logger": "^1.0.55",
|
|
82
|
+
"@streamlayer/sdk-web-notifications": "^1.3.17",
|
|
83
|
+
"@streamlayer/sdk-web-storage": "^1.0.55",
|
|
84
|
+
"@streamlayer/sdk-web-types": "^1.10.12"
|
|
85
85
|
},
|
|
86
86
|
"nx": {
|
|
87
87
|
"implicitDependencies": [
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"vite-plugin-svgr": "^4.2.0",
|
|
122
122
|
"vite-svg-loader": "^5.1.0",
|
|
123
123
|
"vite-tsconfig-paths": "^5.0.1",
|
|
124
|
-
"@streamlayer/react": "^1.14.
|
|
124
|
+
"@streamlayer/react": "^1.14.8"
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
127
|
"@dailymotion/vast-client": "^6.2.0",
|