@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.
Files changed (34) hide show
  1. package/lib/app/masters/Features/Gamification/index.d.ts +1 -0
  2. package/lib/app/masters/Features/Gamification/index.js +36 -30
  3. package/lib/app/masters/Features/index.d.ts +1 -0
  4. package/lib/app/masters/Features/index.js +13 -12
  5. package/lib/app/masters/Notifications/index.d.ts +1 -0
  6. package/lib/app/masters/Notifications/index.js +97 -94
  7. package/lib/app/masters/Points/index.js +16 -25
  8. package/lib/app/masters/masters.d.ts +1 -0
  9. package/lib/app/masters/masters.js +71 -60
  10. package/lib/app/masters/story/index.d.ts +0 -1
  11. package/lib/app/masters/story/index.js +25 -37
  12. package/lib/app/masters/styles.d.ts +1 -0
  13. package/lib/app/masters/styles.js +16 -15
  14. package/lib/app/masters/useSdkResponsive.js +20 -19
  15. package/lib/app/masters/useSdkScroll.d.ts +1 -1
  16. package/lib/app/masters/useSdkScroll.js +33 -33
  17. package/lib/assets/style.css +1 -1
  18. package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
  19. package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
  20. package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
  21. package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
  22. package/lib/ui/modal/index.d.ts +1 -0
  23. package/lib/ui/modal/index.js +36 -31
  24. package/lib/ui/questions/insight/index.js +24 -16
  25. package/lib/ui/questions/insight/styles.d.ts +1 -0
  26. package/lib/ui/questions/insight/styles.js +14 -13
  27. package/lib/ui/questions/twitter/index.js +54 -58
  28. package/lib/ui/theme/constants.d.ts +2 -0
  29. package/lib/ui/theme/constants.js +6 -4
  30. package/lib/ui/theme/masters-theme.js +6 -2
  31. package/lib/ui/theme/theme.js +3 -0
  32. package/lib/ui/video-player/index.d.ts +1 -0
  33. package/lib/ui/video-player/index.js +76 -60
  34. package/package.json +15 -15
@@ -1,31 +1,39 @@
1
- import { jsxs as g, jsx as d } from "react/jsx-runtime";
2
- import { AutoPlayVideo as e, QuestionImages as I } from "@streamlayer/sdk-web-types";
3
- import { VideoPlayer as v } from "../../video-player/index.js";
4
- import { Container as C, ImageContainer as D, Image as P, Content as b, Title as x, Description as B } from "./styles.js";
5
- const N = ({
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: y
9
+ controlVideo: g
10
10
  }) => {
11
- const m = o == null ? void 0 : o.heading, h = o == null ? void 0 : o.body, u = m || h, c = r == null ? void 0 : r.title, p = r == null ? void 0 : r.body;
12
- return /* @__PURE__ */ g(C, { children: [
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
- v,
14
+ N,
15
15
  {
16
+ className: u,
16
17
  source: o.video.url,
17
18
  poster: o.video.thumbnailUrl,
18
- controlVideo: y,
19
- autoPlay: o.autoPlayVideo === e.ENABLED
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(D, { "data-rounded": o.imageMode === I.ROUNDED, children: /* @__PURE__ */ d(P, { src: o == null ? void 0 : o.image }) }),
23
- /* @__PURE__ */ g(b, { children: [
24
- /* @__PURE__ */ d(x, { children: l && u ? m : c }),
25
- /* @__PURE__ */ d(B, { children: l && u ? h : p })
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
- N as InsightContent
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: "c1px8nt6",
8
+ class: "c5et2jt",
9
9
  propsAsIs: !1
10
- }), t = /* @__PURE__ */ s("h3")({
10
+ }), o = /* @__PURE__ */ s("h3")({
11
11
  name: "Title",
12
- class: "t5et2jt",
12
+ class: "t1i2kpk2",
13
13
  propsAsIs: !1
14
- }), o = /* @__PURE__ */ s("div")({
14
+ }), i = /* @__PURE__ */ s("div")({
15
15
  name: "Description",
16
- class: "d1i2kpk2",
16
+ class: "dd3lh3p",
17
17
  propsAsIs: !1
18
- }), i = /* @__PURE__ */ s("img")({
18
+ }), c = /* @__PURE__ */ s("img")({
19
19
  name: "Image",
20
- class: "id3lh3p",
20
+ class: "i1gfjeu5",
21
21
  propsAsIs: !1
22
22
  }), p = /* @__PURE__ */ s("div")({
23
23
  name: "ImageContainer",
24
- class: "i1gfjeu5",
24
+ class: "i58y999",
25
25
  propsAsIs: !1
26
26
  });
27
27
  export {
28
28
  n as Container,
29
- a as Content,
30
- o as Description,
31
- i as Image,
29
+ t as Content,
30
+ i as Description,
31
+ c as Image,
32
32
  p as ImageContainer,
33
- t as Title
33
+ o as Title,
34
+ a as contentContainerClassName
34
35
  };
@@ -1,63 +1,59 @@
1
- import { jsxs as c, jsx as n, Fragment as j } from "react/jsx-runtime";
2
- import { VideoPlayer as k } from "../../video-player/index.js";
3
- import { Account as x } from "./account/index.js";
4
- import { Container as B, Details as E, Body as N, ImagesContainer as i, ImageFullSize as l, ImageHalfSize as p, ImagesBlock as a } from "./styles.js";
5
- const R = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), S = (t) => t == null ? void 0 : t.replace(R, ""), V = ({
6
- image: t,
7
- body: C,
8
- account: z,
9
- accountVerified: F,
10
- tweet: s,
11
- isDetail: d,
12
- controlVideo: T
13
- }) => {
14
- var m, g, H, U, f, u, v, I, y;
15
- const r = (g = (m = s == null ? void 0 : s.meta) == null ? void 0 : m.extendedEntities) == null ? void 0 : g.media, o = r == null ? void 0 : r.find(({ type: e }) => e === "photo"), h = (u = (f = (U = (H = r == null ? void 0 : r[0]) == null ? void 0 : H.videoInfo) == null ? void 0 : U.variants) == null ? void 0 : f.find(
16
- ({ contentType: e }) => e === "video/mp4"
17
- )) == null ? void 0 : u.url;
18
- return /* @__PURE__ */ c(B, { children: [
19
- /* @__PURE__ */ c(E, { children: [
20
- /* @__PURE__ */ n(
21
- x,
22
- {
23
- image: t,
24
- name: (v = s == null ? void 0 : s.meta) == null ? void 0 : v.accountName,
25
- userName: z,
26
- verified: F,
27
- createdTweet: s == null ? void 0 : s.date
28
- }
29
- ),
30
- /* @__PURE__ */ n(N, { children: S(C) }),
31
- !d && o && /* @__PURE__ */ n(i, { children: /* @__PURE__ */ n(l, { src: r == null ? void 0 : r[0].mediaUrlHttps }) }),
32
- d && o && /* @__PURE__ */ c(j, { children: [
33
- (r == null ? void 0 : r.length) === 1 && /* @__PURE__ */ n(i, { children: /* @__PURE__ */ n(l, { src: r[0].mediaUrlHttps }) }),
34
- (r == null ? void 0 : r.length) === 2 && /* @__PURE__ */ c(i, { children: [
35
- /* @__PURE__ */ n(p, { src: r[0].mediaUrlHttps }),
36
- /* @__PURE__ */ n(p, { src: r[1].mediaUrlHttps })
37
- ] }),
38
- (r == null ? void 0 : r.length) === 3 && /* @__PURE__ */ c(i, { children: [
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__ */ c(a, { children: [
51
- /* @__PURE__ */ n(l, { src: r[2].mediaUrlHttps }),
52
- /* @__PURE__ */ n(l, { src: r[3].mediaUrlHttps })
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
- !o && (((I = r == null ? void 0 : r[0]) == null ? void 0 : I.type) === "video" || ((y = r == null ? void 0 : r[0]) == null ? void 0 : y.type) === "animated_gif") && h && /* @__PURE__ */ n(k, { source: h, poster: r[0].mediaUrlHttps, controlVideo: T })
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
- V as TwitterContent,
62
- S as sanitizeContent
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"], N = "#cee5de", O = "#f9d6d8", S = "#E8E8E8", D = {
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
- N as TIMER_GREEN,
115
- O as TIMER_RED,
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: ${t.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;
@@ -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;
@@ -10,6 +10,7 @@ export type VideoPlayerProps = {
10
10
  onPause?: () => void;
11
11
  autoPlay?: boolean;
12
12
  hideControls?: boolean;
13
+ className?: string;
13
14
  };
14
15
  export type ControlVideoCb = VideoPlayerProps['controlVideo'];
15
16
  export declare const pauseAllVideos: () => void;
@@ -1,97 +1,113 @@
1
- import { jsxs as P, jsx as i } from "react/jsx-runtime";
2
- import { cx as S } from "@linaria/core";
3
- import { useRef as C, useState as y, useCallback as h, useEffect as E } from "react";
4
- import { eventBus as M } from "@streamlayer/sdk-web-interfaces";
5
- import { SvgIcon as I } from "../icons/index.js";
6
- import { Container as j, ToggleIconPause as k, HideControls as A, Player as B, Poster as F, Control as N } from "./styles.js";
7
- const q = (t) => {
8
- for (const r of t)
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
- }, O = new IntersectionObserver(q, { threshold: 0.5 }), p = /* @__PURE__ */ new Set(), z = (t) => {
11
- O.observe(t), p.add(t);
12
- }, D = (t) => {
13
- O.unobserve(t), p.delete(t);
14
- }, G = () => {
15
- for (const t of p)
16
- t instanceof HTMLVideoElement && !t.paused && t.pause();
17
- }, Y = ({
18
- poster: t,
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: g,
21
+ aspectRatio: y,
21
22
  controlVideo: n,
22
- onPlay: o,
23
- onPause: u,
24
- autoPlay: T,
25
- hideControls: c
23
+ onPlay: f,
24
+ onPause: m,
25
+ autoPlay: x,
26
+ hideControls: b,
27
+ className: M
26
28
  }) => {
27
- const e = C(null), [l, f] = y(!1), [v, m] = y(!0), w = h(() => {
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]), a = h(() => {
31
+ }, [n]), l = w(() => {
30
32
  n == null || n({ muted: !1 });
31
- }, [n]), x = (s) => {
32
- s.stopPropagation();
33
- const b = e == null ? void 0 : e.current;
34
- if (b) {
35
- if (l)
36
- b.pause();
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 d = e == null ? void 0 : e.current;
39
- if (!d)
40
+ const u = t == null ? void 0 : t.current;
41
+ if (!u)
40
42
  return;
41
- G(), d.play().catch((L) => console.log(L)), m(!1);
43
+ Q(), u.play().catch((g) => console.log(g)), c(!1);
42
44
  }
43
- M.emit("interactions", {
45
+ F.emit("interactions", {
44
46
  action: "tap",
45
47
  payload: {}
46
48
  });
47
49
  }
48
- }, H = () => {
49
- var s;
50
- (s = e == null ? void 0 : e.current) == null || s.load(), m(!0);
50
+ }, j = () => {
51
+ var e;
52
+ (e = t == null ? void 0 : t.current) == null || e.load(), c(!0);
51
53
  };
52
- return E(() => {
53
- const s = e == null ? void 0 : e.current;
54
+ return O(() => {
55
+ const e = t == null ? void 0 : t.current;
54
56
  return () => {
55
- s && (s.paused || a());
57
+ e && (e.paused || l());
56
58
  };
57
- }, [a]), E(() => {
58
- const s = e.current;
59
- return s ? (z(s), () => D(s)) : () => {
59
+ }, [l]), O(() => {
60
+ const e = t.current;
61
+ return e ? (J(e), () => K(e)) : () => {
60
62
  };
61
- }, []), /* @__PURE__ */ P(
62
- j,
63
+ }, []), /* @__PURE__ */ k(
64
+ B,
63
65
  {
64
- onClick: c ? void 0 : x,
65
- className: S(l && k, c && A),
66
- style: g ? { aspectRatio: g } : {},
66
+ onClick: b ? void 0 : S,
67
+ className: C(d && N, b && q, M),
68
+ style: y ? { aspectRatio: y } : {},
67
69
  children: [
68
- /* @__PURE__ */ i(
69
- B,
70
+ /* @__PURE__ */ a(
71
+ z,
70
72
  {
71
- ref: e,
73
+ ref: t,
72
74
  src: r,
73
- autoPlay: T,
75
+ autoPlay: x,
74
76
  onPlay: () => {
75
- w(), f(!0), m(!1), o == null || o();
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
- a(), f(!1), u == null || u();
93
+ l(), o(!1), m == null || m();
79
94
  },
80
95
  onEnded: () => {
81
- a(), f(!1), H();
96
+ l(), o(!1), j();
82
97
  },
83
- style: { visibility: v ? "hidden" : "visible" },
98
+ style: { visibility: E ? "hidden" : "visible" },
84
99
  controls: !1,
85
100
  playsInline: !0
86
101
  }
87
102
  ),
88
- /* @__PURE__ */ i(F, { src: t, style: { visibility: v ? "visible" : "hidden" } }),
89
- !c && /* @__PURE__ */ i(N, { children: l ? /* @__PURE__ */ i(I, { name: "icon-pause" }) : /* @__PURE__ */ i(I, { name: "icon-play" }) })
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
- Y as VideoPlayer,
96
- G as pauseAllVideos
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.4",
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.6",
73
- "@streamlayer/react-polyfills": "^0.1.13",
74
- "@streamlayer/sdk-web": "^1.10.6",
75
- "@streamlayer/sdk-web-analytics": "^1.7.6",
76
- "@streamlayer/sdk-web-anonymous-auth": "^1.1.32",
77
- "@streamlayer/sdk-web-api": "^1.8.6",
78
- "@streamlayer/sdk-web-core": "^1.11.8",
79
- "@streamlayer/sdk-web-features": "^1.0.53",
80
- "@streamlayer/sdk-web-interfaces": "^1.4.19",
81
- "@streamlayer/sdk-web-logger": "^1.0.53",
82
- "@streamlayer/sdk-web-notifications": "^1.3.15",
83
- "@streamlayer/sdk-web-storage": "^1.0.53",
84
- "@streamlayer/sdk-web-types": "^1.10.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.6"
124
+ "@streamlayer/react": "^1.14.8"
125
125
  },
126
126
  "dependencies": {
127
127
  "@dailymotion/vast-client": "^6.2.0",