@streamlayer/react-ui 1.22.4 → 1.22.5
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/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 +29 -28
- 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 D, Image as P, Content as b, Title as x, Description as B } 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: 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
|
+
D,
|
|
25
|
+
{
|
|
26
|
+
className: u,
|
|
27
|
+
"data-rounded": o.imageMode === I.ROUNDED,
|
|
28
|
+
children: /* @__PURE__ */ d(P, { src: o == null ? void 0 : o.image })
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ h(b, { children: [
|
|
32
|
+
/* @__PURE__ */ d(x, { children: l && e ? m : y }),
|
|
33
|
+
/* @__PURE__ */ d(B, { 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
|
};
|
|
@@ -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;
|
|
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,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { eventBus as
|
|
1
|
+
import { jsxs as S, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cx as C } from "@linaria/core";
|
|
3
|
+
import { useRef as M, useState as y, useCallback as h, useEffect as E } from "react";
|
|
4
|
+
import { eventBus as j } from "@streamlayer/sdk-web-interfaces";
|
|
5
5
|
import { SvgIcon as I } from "../icons/index.js";
|
|
6
|
-
import { Container as
|
|
7
|
-
const
|
|
6
|
+
import { Container as k, ToggleIconPause as A, HideControls as B, Player as F, Poster as N, Control as q } from "./styles.js";
|
|
7
|
+
const z = (t) => {
|
|
8
8
|
for (const r of t)
|
|
9
9
|
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(
|
|
10
|
+
}, O = new IntersectionObserver(z, { threshold: 0.5 }), p = /* @__PURE__ */ new Set(), D = (t) => {
|
|
11
11
|
O.observe(t), p.add(t);
|
|
12
|
-
},
|
|
12
|
+
}, G = (t) => {
|
|
13
13
|
O.unobserve(t), p.delete(t);
|
|
14
|
-
},
|
|
14
|
+
}, J = () => {
|
|
15
15
|
for (const t of p)
|
|
16
16
|
t instanceof HTMLVideoElement && !t.paused && t.pause();
|
|
17
|
-
},
|
|
17
|
+
}, Z = ({
|
|
18
18
|
poster: t,
|
|
19
19
|
source: r,
|
|
20
20
|
aspectRatio: g,
|
|
@@ -22,13 +22,14 @@ const q = (t) => {
|
|
|
22
22
|
onPlay: o,
|
|
23
23
|
onPause: u,
|
|
24
24
|
autoPlay: T,
|
|
25
|
-
hideControls: c
|
|
25
|
+
hideControls: c,
|
|
26
|
+
className: w
|
|
26
27
|
}) => {
|
|
27
|
-
const e =
|
|
28
|
+
const e = M(null), [l, f] = y(!1), [v, m] = y(!0), x = h(() => {
|
|
28
29
|
n == null || n({ muted: !0 });
|
|
29
30
|
}, [n]), a = h(() => {
|
|
30
31
|
n == null || n({ muted: !1 });
|
|
31
|
-
}, [n]),
|
|
32
|
+
}, [n]), H = (s) => {
|
|
32
33
|
s.stopPropagation();
|
|
33
34
|
const b = e == null ? void 0 : e.current;
|
|
34
35
|
if (b) {
|
|
@@ -38,14 +39,14 @@ const q = (t) => {
|
|
|
38
39
|
const d = e == null ? void 0 : e.current;
|
|
39
40
|
if (!d)
|
|
40
41
|
return;
|
|
41
|
-
|
|
42
|
+
J(), d.play().catch((P) => console.log(P)), m(!1);
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
j.emit("interactions", {
|
|
44
45
|
action: "tap",
|
|
45
46
|
payload: {}
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
},
|
|
49
|
+
}, L = () => {
|
|
49
50
|
var s;
|
|
50
51
|
(s = e == null ? void 0 : e.current) == null || s.load(), m(!0);
|
|
51
52
|
};
|
|
@@ -56,42 +57,42 @@ const q = (t) => {
|
|
|
56
57
|
};
|
|
57
58
|
}, [a]), E(() => {
|
|
58
59
|
const s = e.current;
|
|
59
|
-
return s ? (
|
|
60
|
+
return s ? (D(s), () => G(s)) : () => {
|
|
60
61
|
};
|
|
61
|
-
}, []), /* @__PURE__ */
|
|
62
|
-
|
|
62
|
+
}, []), /* @__PURE__ */ S(
|
|
63
|
+
k,
|
|
63
64
|
{
|
|
64
|
-
onClick: c ? void 0 :
|
|
65
|
-
className:
|
|
65
|
+
onClick: c ? void 0 : H,
|
|
66
|
+
className: C(l && A, c && B, w),
|
|
66
67
|
style: g ? { aspectRatio: g } : {},
|
|
67
68
|
children: [
|
|
68
69
|
/* @__PURE__ */ i(
|
|
69
|
-
|
|
70
|
+
F,
|
|
70
71
|
{
|
|
71
72
|
ref: e,
|
|
72
73
|
src: r,
|
|
73
74
|
autoPlay: T,
|
|
74
75
|
onPlay: () => {
|
|
75
|
-
|
|
76
|
+
x(), f(!0), m(!1), o == null || o();
|
|
76
77
|
},
|
|
77
78
|
onPause: () => {
|
|
78
79
|
a(), f(!1), u == null || u();
|
|
79
80
|
},
|
|
80
81
|
onEnded: () => {
|
|
81
|
-
a(), f(!1),
|
|
82
|
+
a(), f(!1), L();
|
|
82
83
|
},
|
|
83
84
|
style: { visibility: v ? "hidden" : "visible" },
|
|
84
85
|
controls: !1,
|
|
85
86
|
playsInline: !0
|
|
86
87
|
}
|
|
87
88
|
),
|
|
88
|
-
/* @__PURE__ */ i(
|
|
89
|
-
!c && /* @__PURE__ */ i(
|
|
89
|
+
/* @__PURE__ */ i(N, { src: t, style: { visibility: v ? "visible" : "hidden" } }),
|
|
90
|
+
!c && /* @__PURE__ */ i(q, { children: l ? /* @__PURE__ */ i(I, { name: "icon-pause" }) : /* @__PURE__ */ i(I, { name: "icon-play" }) })
|
|
90
91
|
]
|
|
91
92
|
}
|
|
92
93
|
);
|
|
93
94
|
};
|
|
94
95
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
Z as VideoPlayer,
|
|
97
|
+
J as pauseAllVideos
|
|
97
98
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.5",
|
|
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.7",
|
|
73
|
+
"@streamlayer/react-polyfills": "^0.1.14",
|
|
74
|
+
"@streamlayer/sdk-web": "^1.10.7",
|
|
75
|
+
"@streamlayer/sdk-web-analytics": "^1.7.7",
|
|
76
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.1.33",
|
|
77
|
+
"@streamlayer/sdk-web-api": "^1.8.7",
|
|
78
|
+
"@streamlayer/sdk-web-core": "^1.11.9",
|
|
79
|
+
"@streamlayer/sdk-web-features": "^1.0.54",
|
|
80
|
+
"@streamlayer/sdk-web-interfaces": "^1.4.20",
|
|
81
|
+
"@streamlayer/sdk-web-logger": "^1.0.54",
|
|
82
|
+
"@streamlayer/sdk-web-notifications": "^1.3.16",
|
|
83
|
+
"@streamlayer/sdk-web-storage": "^1.0.54",
|
|
84
|
+
"@streamlayer/sdk-web-types": "^1.10.11"
|
|
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.7"
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
127
|
"@dailymotion/vast-client": "^6.2.0",
|