@streamlayer/react-ui 1.1.0 → 1.2.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 +6 -2
- package/lib/app/app/Advertisement/index.js +75 -24
- package/lib/app/app/story/content.d.ts +1 -0
- package/lib/app/app/story/content.js +26 -10
- package/lib/app/app/story/index.d.ts +2 -0
- package/lib/app/app/story/index.js +75 -58
- package/lib/app/app/story/styles.d.ts +9 -0
- package/lib/app/app/story/styles.js +49 -0
- package/lib/app/app/story/useResponsive.d.ts +1 -0
- package/lib/app/app/story/useResponsive.js +15 -0
- package/lib/app/app/story/video.d.ts +3 -1
- package/lib/app/app/story/video.js +63 -92
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.d.ts +2 -0
- package/lib/ui/advertisement/banner/index.js +17 -12
- package/lib/ui/advertisement/index.d.ts +1 -0
- package/lib/ui/advertisement/index.js +12 -24
- package/lib/ui/advertisement/mock.d.ts +1 -0
- package/lib/ui/advertisement/mock.js +38 -4
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +68 -15
- package/lib/ui/advertisement/overlay/styles.d.ts +18 -0
- package/lib/ui/advertisement/overlay/styles.js +95 -0
- package/lib/ui/advertisement/sidebar/index.d.ts +1 -0
- package/lib/ui/advertisement/sidebar/index.js +10 -8
- package/lib/ui/gamification/question/index.js +1 -0
- package/lib/ui/gamification/vote/vote-option/index.js +6 -6
- package/lib/ui/icons/index.js +1 -0
- package/lib/ui/slide-in/index.js +18 -23
- package/lib/ui/theme/ThemeColorsAdvertisement.d.ts +1 -0
- package/lib/ui/theme/ThemeColorsAdvertisement.js +15 -0
- package/lib/ui/theme/constants.d.ts +11 -0
- package/lib/ui/theme/constants.js +28 -14
- package/lib/ui/theme/theme.js +11 -8
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +70 -62
- package/package.json +15 -14
|
@@ -1,77 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { eventBus as
|
|
5
|
-
import { SvgIcon as
|
|
6
|
-
import { Container as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as C, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cx as E } from "@linaria/core";
|
|
3
|
+
import { useRef as S, useState as v, useCallback as d, useEffect as y } from "react";
|
|
4
|
+
import { eventBus as T } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { SvgIcon as P } from "../icons/index.js";
|
|
6
|
+
import { Container as L, ToggleIconPause as j, Player as k, Poster as H, Control as M } from "./styles.js";
|
|
7
|
+
const A = (s, a) => {
|
|
8
8
|
for (const t of s)
|
|
9
9
|
t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (a.unobserve(t.target), t.target.pause());
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
for (const s of
|
|
16
|
-
s instanceof HTMLVideoElement && !s.paused && (s.pause(),
|
|
17
|
-
},
|
|
18
|
-
const e =
|
|
19
|
-
|
|
20
|
-
}, [
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
27
|
-
|
|
10
|
+
}, h = new IntersectionObserver(A, { threshold: 0.5 }), m = /* @__PURE__ */ new Set(), B = (s) => {
|
|
11
|
+
h.observe(s), m.add(s);
|
|
12
|
+
}, i = (s) => {
|
|
13
|
+
h.unobserve(s), m.delete(s);
|
|
14
|
+
}, F = () => {
|
|
15
|
+
for (const s of m)
|
|
16
|
+
s instanceof HTMLVideoElement && !s.paused && (s.pause(), i(s));
|
|
17
|
+
}, K = ({ poster: s, source: a, aspectRatio: t, controlVideo: r }) => {
|
|
18
|
+
const e = S(null), [c, l] = v(!1), [p, b] = v(!0), I = d(() => {
|
|
19
|
+
r == null || r({ muted: !0 });
|
|
20
|
+
}, [r]), u = d(() => {
|
|
21
|
+
r == null || r({ muted: !1 });
|
|
22
|
+
}, [r]), O = (n) => {
|
|
23
|
+
n.stopPropagation();
|
|
24
|
+
const g = e == null ? void 0 : e.current;
|
|
25
|
+
if (g) {
|
|
26
|
+
if (c)
|
|
27
|
+
g.pause(), e.current && i(e.current);
|
|
28
28
|
else {
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
29
|
+
const f = e == null ? void 0 : e.current;
|
|
30
|
+
if (!f)
|
|
31
31
|
return;
|
|
32
|
-
|
|
32
|
+
F(), B(f), f.play().catch((x) => console.log(x)), b(!1);
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
T.emit("interactions", {
|
|
35
35
|
action: "tap",
|
|
36
36
|
payload: {}
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
},
|
|
40
|
-
var
|
|
41
|
-
e.current &&
|
|
39
|
+
}, w = () => {
|
|
40
|
+
var n;
|
|
41
|
+
e.current && i(e.current), (n = e == null ? void 0 : e.current) == null || n.load(), b(!0);
|
|
42
42
|
};
|
|
43
|
-
return
|
|
44
|
-
e.current &&
|
|
45
|
-
}, []),
|
|
46
|
-
const
|
|
43
|
+
return y(() => {
|
|
44
|
+
e.current && i(e.current);
|
|
45
|
+
}, []), y(() => {
|
|
46
|
+
const n = e == null ? void 0 : e.current;
|
|
47
47
|
return () => {
|
|
48
|
-
|
|
48
|
+
n && (n.paused || u(), i(n));
|
|
49
49
|
};
|
|
50
|
-
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
50
|
+
}, [u]), /* @__PURE__ */ C(
|
|
51
|
+
L,
|
|
52
|
+
{
|
|
53
|
+
onClick: O,
|
|
54
|
+
className: E(c && j),
|
|
55
|
+
style: t ? { aspectRatio: t } : {},
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ o(
|
|
58
|
+
k,
|
|
59
|
+
{
|
|
60
|
+
ref: e,
|
|
61
|
+
src: a,
|
|
62
|
+
onPlay: () => {
|
|
63
|
+
I(), l(!0);
|
|
64
|
+
},
|
|
65
|
+
onPause: () => {
|
|
66
|
+
u(), l(!1);
|
|
67
|
+
},
|
|
68
|
+
onEnded: () => {
|
|
69
|
+
u(), l(!1), w();
|
|
70
|
+
},
|
|
71
|
+
style: { visibility: p ? "hidden" : "visible" },
|
|
72
|
+
controls: !1,
|
|
73
|
+
playsInline: !0
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ o(H, { src: s, style: { visibility: p ? "visible" : "hidden" } }),
|
|
77
|
+
/* @__PURE__ */ o(M, { children: c ? /* @__PURE__ */ o(P, { name: "icon-pause" }) : /* @__PURE__ */ o(P, { name: "icon-play" }) })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
73
81
|
};
|
|
74
82
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
K as VideoPlayer,
|
|
84
|
+
F as pauseAllVideos
|
|
77
85
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -54,18 +54,18 @@
|
|
|
54
54
|
"react-virtualized-auto-sizer": "^1.0.24",
|
|
55
55
|
"react-window": "^1.8.10",
|
|
56
56
|
"react-window-infinite-loader": "^1.0.9",
|
|
57
|
-
"@streamlayer/feature-gamification": "^1.1
|
|
58
|
-
"@streamlayer/sdk-web": "^1.0.
|
|
59
|
-
"@streamlayer/sdk-web-analytics": "^1.0.
|
|
60
|
-
"@streamlayer/sdk-web-anonymous-auth": "^1.0.
|
|
61
|
-
"@streamlayer/sdk-web-api": "^1.1.
|
|
62
|
-
"@streamlayer/sdk-web-core": "^1.0.
|
|
63
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
64
|
-
"@streamlayer/sdk-web-interfaces": "^1.0.
|
|
65
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
66
|
-
"@streamlayer/sdk-web-notifications": "^1.0.
|
|
67
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
68
|
-
"@streamlayer/sdk-web-types": "^1.1.
|
|
57
|
+
"@streamlayer/feature-gamification": "^1.2.1",
|
|
58
|
+
"@streamlayer/sdk-web": "^1.0.3",
|
|
59
|
+
"@streamlayer/sdk-web-analytics": "^1.0.3",
|
|
60
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.0.3",
|
|
61
|
+
"@streamlayer/sdk-web-api": "^1.1.2",
|
|
62
|
+
"@streamlayer/sdk-web-core": "^1.0.3",
|
|
63
|
+
"@streamlayer/sdk-web-features": "^1.0.3",
|
|
64
|
+
"@streamlayer/sdk-web-interfaces": "^1.0.3",
|
|
65
|
+
"@streamlayer/sdk-web-logger": "^1.0.3",
|
|
66
|
+
"@streamlayer/sdk-web-notifications": "^1.0.3",
|
|
67
|
+
"@streamlayer/sdk-web-storage": "^1.0.3",
|
|
68
|
+
"@streamlayer/sdk-web-types": "^1.1.2"
|
|
69
69
|
},
|
|
70
70
|
"nx": {
|
|
71
71
|
"implicitDependencies": [
|
|
@@ -99,12 +99,13 @@
|
|
|
99
99
|
"react-countup": "^6.5.3",
|
|
100
100
|
"react-phone-number-input": "^3.4.3",
|
|
101
101
|
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
102
|
+
"screenfull": "^6.0.2",
|
|
102
103
|
"tslib": "^2.6.3",
|
|
103
104
|
"vite": "5.3.2",
|
|
104
105
|
"vite-plugin-node-polyfills": "^0.22.0",
|
|
105
106
|
"vite-plugin-svgr": "^4.2.0",
|
|
106
107
|
"vite-svg-loader": "^5.1.0",
|
|
107
108
|
"vite-tsconfig-paths": "^4.3.2",
|
|
108
|
-
"@streamlayer/react": "^1.1.
|
|
109
|
+
"@streamlayer/react": "^1.1.2"
|
|
109
110
|
}
|
|
110
111
|
}
|