@streamlayer/react-ui 1.9.0 → 1.11.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/Advertisement/index.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +78 -67
- package/lib/app/app/Features/Gamification/Question.d.ts +1 -0
- package/lib/app/app/Features/Gamification/Question.js +43 -41
- package/lib/app/app/Features/Gamification/Tabs.js +22 -21
- package/lib/app/app/Features/Gamification/index.js +66 -62
- package/lib/app/app/Insight/index.d.ts +2 -0
- package/lib/app/app/Insight/index.js +28 -24
- package/lib/app/app/Navigation/index.d.ts +4 -0
- package/lib/app/app/Navigation/index.js +88 -48
- package/lib/app/app/Notifications/index.js +125 -113
- package/lib/app/app/Points/index.js +16 -16
- package/lib/app/app/index.d.ts +1 -0
- package/lib/app/app/index.js +84 -83
- package/lib/app/app/story/index.js +27 -24
- package/lib/app/app/story/insight/index.d.ts +1 -0
- package/lib/app/app/story/insight/index.js +29 -26
- package/lib/app/app/story/insight/video.d.ts +1 -0
- package/lib/app/app/story/insight/video.js +13 -13
- package/lib/app/app/story/promotion/content.d.ts +3 -1
- package/lib/app/app/story/promotion/content.js +13 -10
- package/lib/app/app/story/promotion/index.d.ts +1 -0
- package/lib/app/app/story/promotion/index.js +34 -30
- package/lib/app/app/story/promotion/video.d.ts +1 -0
- package/lib/app/app/story/promotion/video.js +34 -31
- package/lib/app/app/styles.js +44 -0
- package/lib/app/app/useApp.d.ts +2 -14
- package/lib/app/app/useApp.js +14 -43
- package/lib/app/app/useAppContext.d.ts +2 -0
- package/lib/app/app/useAppContext.js +6 -5
- package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +1 -1
- package/lib/app/masters/Features/Gamification/Tabs.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/Tabs.js +2 -2
- package/lib/app/masters/Features/Gamification/index.d.ts +2 -2
- package/lib/app/masters/Features/Gamification/index.js +1 -1
- package/lib/app/masters/Features/index.d.ts +2 -2
- package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +1 -1
- package/lib/app/masters/Notifications/Onboarding/index.js +4 -4
- package/lib/app/masters/Notifications/index.d.ts +2 -2
- package/lib/app/masters/Notifications/index.js +1 -1
- package/lib/app/masters/masters.js +23 -23
- package/lib/app/masters/styles.d.ts +20 -0
- package/lib/app/{styles.js → masters/styles.js} +15 -15
- package/lib/app/masters/useSdkResponsive.d.ts +15 -0
- package/lib/app/masters/useSdkResponsive.js +45 -0
- package/lib/app/masters/useSdkScroll.d.ts +12 -0
- package/lib/app/masters/useSdkScroll.js +50 -0
- package/lib/app/useSdkResponsive.d.ts +1 -0
- package/lib/app/useSdkResponsive.js +27 -29
- package/lib/app/useSdkScroll.js +25 -24
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.js +14 -11
- package/lib/ui/advertisement/index.d.ts +3 -0
- package/lib/ui/advertisement/index.js +31 -10
- package/lib/ui/advertisement/notification/index.d.ts +1 -0
- package/lib/ui/advertisement/notification/index.js +30 -27
- package/lib/ui/advertisement/notification/lower-third/index.d.ts +9 -0
- package/lib/ui/advertisement/notification/lower-third/index.js +37 -0
- package/lib/ui/advertisement/notification/lower-third/styles.d.ts +16 -0
- package/lib/ui/advertisement/notification/lower-third/styles.js +64 -0
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +58 -43
- package/lib/ui/advertisement/overlay/styles.d.ts +0 -2
- package/lib/ui/advertisement/overlay/styles.js +41 -52
- package/lib/ui/close-btn/index.d.ts +7 -0
- package/lib/ui/close-btn/index.js +47 -0
- package/lib/ui/gamification/detail/header/index.d.ts +2 -1
- package/lib/ui/gamification/detail/header/index.js +16 -15
- package/lib/ui/gamification/vote/styles.js +1 -1
- package/lib/ui/navigation/button/FeaturedGroups.d.ts +1 -1
- package/lib/ui/navigation/index.d.ts +5 -3
- package/lib/ui/navigation/index.js +11 -12
- package/lib/ui/navigation/masters.js +1 -1
- package/lib/ui/navigation/styles.d.ts +5 -0
- package/lib/ui/navigation/styles.js +16 -0
- package/lib/ui/questions/insight/index.js +21 -20
- package/lib/ui/theme/masters-theme.js +36 -13
- package/lib/ui/theme/theme.js +25 -26
- package/lib/ui/timer/index.d.ts +3 -1
- package/lib/ui/timer/index.js +54 -32
- package/lib/ui/video-player/index.d.ts +2 -0
- package/lib/ui/video-player/index.js +62 -51
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +7 -6
- package/package.json +15 -15
- /package/lib/app/{styles.d.ts → app/styles.d.ts} +0 -0
|
@@ -1,85 +1,96 @@
|
|
|
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
|
|
8
|
-
for (const
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
for (const s of
|
|
16
|
-
s instanceof HTMLVideoElement && !s.paused &&
|
|
17
|
-
},
|
|
18
|
-
|
|
1
|
+
import { jsxs as H, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cx as L } from "@linaria/core";
|
|
3
|
+
import { useRef as S, useState as d, useCallback as y, useEffect as P } from "react";
|
|
4
|
+
import { eventBus as C } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { SvgIcon as h } from "../icons/index.js";
|
|
6
|
+
import { Container as M, ToggleIconPause as j, HideControls as k, Player as A, Poster as B, Control as F } from "./styles.js";
|
|
7
|
+
const N = (s) => {
|
|
8
|
+
for (const n of s)
|
|
9
|
+
n.isIntersecting ? n.target instanceof HTMLVideoElement && n.target.autoplay && n.target.play() : n.target instanceof HTMLVideoElement && !n.target.paused && n.target.pause();
|
|
10
|
+
}, E = new IntersectionObserver(N, { threshold: 0.5 }), m = /* @__PURE__ */ new Set(), q = (s) => {
|
|
11
|
+
E.observe(s), m.add(s);
|
|
12
|
+
}, z = (s) => {
|
|
13
|
+
E.unobserve(s), m.delete(s);
|
|
14
|
+
}, D = () => {
|
|
15
|
+
for (const s of m)
|
|
16
|
+
s instanceof HTMLVideoElement && !s.paused && s.pause();
|
|
17
|
+
}, X = ({
|
|
18
|
+
poster: s,
|
|
19
|
+
source: n,
|
|
20
|
+
aspectRatio: p,
|
|
21
|
+
controlVideo: r,
|
|
22
|
+
onPlay: i,
|
|
23
|
+
autoPlay: I,
|
|
24
|
+
hideControls: u
|
|
25
|
+
}) => {
|
|
26
|
+
const e = S(null), [c, l] = d(!1), [g, f] = d(!0), O = y(() => {
|
|
19
27
|
r == null || r({ muted: !0 });
|
|
20
|
-
}, [r]),
|
|
28
|
+
}, [r]), a = y(() => {
|
|
21
29
|
r == null || r({ muted: !1 });
|
|
22
|
-
}, [r]),
|
|
23
|
-
|
|
30
|
+
}, [r]), T = (t) => {
|
|
31
|
+
t.stopPropagation();
|
|
24
32
|
const v = e == null ? void 0 : e.current;
|
|
25
33
|
if (v) {
|
|
26
|
-
if (
|
|
27
|
-
v.pause()
|
|
34
|
+
if (c)
|
|
35
|
+
v.pause();
|
|
28
36
|
else {
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
37
|
+
const b = e == null ? void 0 : e.current;
|
|
38
|
+
if (!b)
|
|
31
39
|
return;
|
|
32
|
-
|
|
40
|
+
D(), b.play().catch((x) => console.log(x)), f(!1);
|
|
33
41
|
}
|
|
34
|
-
|
|
42
|
+
C.emit("interactions", {
|
|
35
43
|
action: "tap",
|
|
36
44
|
payload: {}
|
|
37
45
|
});
|
|
38
46
|
}
|
|
39
|
-
},
|
|
40
|
-
var
|
|
41
|
-
|
|
47
|
+
}, w = () => {
|
|
48
|
+
var t;
|
|
49
|
+
(t = e == null ? void 0 : e.current) == null || t.load(), f(!0);
|
|
42
50
|
};
|
|
43
|
-
return
|
|
44
|
-
e
|
|
45
|
-
}, []), y(() => {
|
|
46
|
-
const n = e == null ? void 0 : e.current;
|
|
51
|
+
return P(() => {
|
|
52
|
+
const t = e == null ? void 0 : e.current;
|
|
47
53
|
return () => {
|
|
48
|
-
|
|
54
|
+
t && (t.paused || a());
|
|
49
55
|
};
|
|
50
|
-
}, [
|
|
51
|
-
|
|
56
|
+
}, [a]), P(() => {
|
|
57
|
+
const t = e.current;
|
|
58
|
+
return t ? (q(t), () => z(t)) : () => {
|
|
59
|
+
};
|
|
60
|
+
}, []), /* @__PURE__ */ H(
|
|
61
|
+
M,
|
|
52
62
|
{
|
|
53
|
-
onClick:
|
|
54
|
-
className:
|
|
55
|
-
style:
|
|
63
|
+
onClick: u ? void 0 : T,
|
|
64
|
+
className: L(c && j, u && k),
|
|
65
|
+
style: p ? { aspectRatio: p } : {},
|
|
56
66
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
67
|
+
/* @__PURE__ */ o(
|
|
68
|
+
A,
|
|
59
69
|
{
|
|
60
70
|
ref: e,
|
|
61
|
-
src:
|
|
71
|
+
src: n,
|
|
72
|
+
autoPlay: I,
|
|
62
73
|
onPlay: () => {
|
|
63
|
-
O(), l(!0),
|
|
74
|
+
console.log("play"), O(), l(!0), f(!1), i == null || i();
|
|
64
75
|
},
|
|
65
76
|
onPause: () => {
|
|
66
|
-
|
|
77
|
+
a(), l(!1);
|
|
67
78
|
},
|
|
68
79
|
onEnded: () => {
|
|
69
|
-
|
|
80
|
+
a(), l(!1), w();
|
|
70
81
|
},
|
|
71
|
-
style: { visibility:
|
|
82
|
+
style: { visibility: g ? "hidden" : "visible" },
|
|
72
83
|
controls: !1,
|
|
73
84
|
playsInline: !0
|
|
74
85
|
}
|
|
75
86
|
),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ o(B, { src: s, style: { visibility: g ? "visible" : "hidden" } }),
|
|
88
|
+
!u && /* @__PURE__ */ o(F, { children: c ? /* @__PURE__ */ o(h, { name: "icon-pause" }) : /* @__PURE__ */ o(h, { name: "icon-play" }) })
|
|
78
89
|
]
|
|
79
90
|
}
|
|
80
91
|
);
|
|
81
92
|
};
|
|
82
93
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
X as VideoPlayer,
|
|
95
|
+
D as pauseAllVideos
|
|
85
96
|
};
|
|
@@ -3,3 +3,4 @@ export declare const Player: import('@linaria/react').StyledComponent<import('re
|
|
|
3
3
|
export declare const Poster: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLImageElement> & import('react').ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
|
|
4
4
|
export declare const Control: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
5
5
|
export declare const ToggleIconPause: import('@linaria/core').LinariaClassName;
|
|
6
|
+
export declare const HideControls: import('@linaria/core').LinariaClassName;
|
|
@@ -7,19 +7,20 @@ const e = /* @__PURE__ */ s("div")({
|
|
|
7
7
|
name: "Player",
|
|
8
8
|
class: "p6703cq",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
10
|
+
}), n = /* @__PURE__ */ s("img")({
|
|
11
11
|
name: "Poster",
|
|
12
12
|
class: "p12ow7zo",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
14
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
15
15
|
name: "Control",
|
|
16
16
|
class: "cdpal9o",
|
|
17
17
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
18
|
+
}), t = "t1xke4ml", r = "h1yzxv57";
|
|
19
19
|
export {
|
|
20
20
|
e as Container,
|
|
21
|
-
|
|
21
|
+
l as Control,
|
|
22
|
+
r as HideControls,
|
|
22
23
|
a as Player,
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
n as Poster,
|
|
25
|
+
t as ToggleIconPause
|
|
25
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
],
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@lottiefiles/react-lottie-player": "^3.5.4",
|
|
54
|
-
"@streamlayer/sl-eslib": "^5.
|
|
54
|
+
"@streamlayer/sl-eslib": "^5.130.0",
|
|
55
55
|
"@types/lodash.throttle": "^4.1.9",
|
|
56
56
|
"lodash.throttle": "^4.1.1",
|
|
57
57
|
"nanoid": "3.3.7",
|
|
@@ -59,18 +59,18 @@
|
|
|
59
59
|
"react-virtualized-auto-sizer": "^1.0.24",
|
|
60
60
|
"react-window": "^1.8.10",
|
|
61
61
|
"react-window-infinite-loader": "^1.0.9",
|
|
62
|
-
"@streamlayer/feature-gamification": "^1.
|
|
63
|
-
"@streamlayer/sdk-web": "^1.
|
|
64
|
-
"@streamlayer/sdk-web-analytics": "^1.
|
|
65
|
-
"@streamlayer/sdk-web-anonymous-auth": "^1.
|
|
66
|
-
"@streamlayer/sdk-web-api": "^1.
|
|
67
|
-
"@streamlayer/sdk-web-core": "^1.
|
|
68
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
69
|
-
"@streamlayer/sdk-web-interfaces": "^1.1
|
|
70
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
71
|
-
"@streamlayer/sdk-web-notifications": "^1.1
|
|
72
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
73
|
-
"@streamlayer/sdk-web-types": "^1.
|
|
62
|
+
"@streamlayer/feature-gamification": "^1.8.0",
|
|
63
|
+
"@streamlayer/sdk-web": "^1.5.0",
|
|
64
|
+
"@streamlayer/sdk-web-analytics": "^1.4.1",
|
|
65
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.1.1",
|
|
66
|
+
"@streamlayer/sdk-web-api": "^1.6.1",
|
|
67
|
+
"@streamlayer/sdk-web-core": "^1.6.0",
|
|
68
|
+
"@streamlayer/sdk-web-features": "^1.0.22",
|
|
69
|
+
"@streamlayer/sdk-web-interfaces": "^1.2.1",
|
|
70
|
+
"@streamlayer/sdk-web-logger": "^1.0.22",
|
|
71
|
+
"@streamlayer/sdk-web-notifications": "^1.2.1",
|
|
72
|
+
"@streamlayer/sdk-web-storage": "^1.0.22",
|
|
73
|
+
"@streamlayer/sdk-web-types": "^1.7.1"
|
|
74
74
|
},
|
|
75
75
|
"nx": {
|
|
76
76
|
"implicitDependencies": [
|
|
@@ -111,6 +111,6 @@
|
|
|
111
111
|
"vite-plugin-svgr": "^4.2.0",
|
|
112
112
|
"vite-svg-loader": "^5.1.0",
|
|
113
113
|
"vite-tsconfig-paths": "^5.0.1",
|
|
114
|
-
"@streamlayer/react": "^1.
|
|
114
|
+
"@streamlayer/react": "^1.8.0"
|
|
115
115
|
}
|
|
116
116
|
}
|
|
File without changes
|