@streamlayer/react-ui 0.95.1 → 0.96.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/assets/style.css +1 -1
- package/lib/ui/app/Features/Gamification/Question.js +38 -32
- package/lib/ui/app/Features/Gamification/QuestionsList.js +9 -8
- package/lib/ui/app/Features/Gamification/Tabs.js +3 -2
- package/lib/ui/app/Features/Gamification/gamification-feature.js +1 -0
- package/lib/ui/app/Features/Gamification/index.js +26 -25
- package/lib/ui/app/Notifications/Onboarding/index.js +90 -77
- package/lib/ui/app/Notifications/index.js +80 -74
- package/lib/ui/app/masters.js +59 -48
- package/lib/ui/app/useMastersApp.js +44 -40
- package/lib/ui/app/useMastersContext.d.ts +8 -0
- package/lib/ui/app/useMastersContext.js +8 -0
- package/lib/ui/app/useSdkResponsive.d.ts +2 -2
- package/lib/ui/gamification/onboarding/index.d.ts +4 -1
- package/lib/ui/gamification/onboarding/index.js +56 -48
- package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -8
- package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/invitingUser/styles.js +12 -7
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -16
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +11 -6
- package/lib/ui/gamification/question/insight/index.d.ts +6 -2
- package/lib/ui/gamification/question/insight/index.js +1 -5
- package/lib/ui/gamification/question/list/index.d.ts +2 -0
- package/lib/ui/gamification/question/list/index.js +22 -13
- package/lib/ui/gamification/question/notification/index.d.ts +2 -1
- package/lib/ui/gamification/question/notification/index.js +20 -19
- package/lib/ui/gamification/question/notification/insight/index.d.ts +3 -1
- package/lib/ui/gamification/question/notification/insight/index.js +11 -11
- package/lib/ui/gamification/question/twitter/index.d.ts +6 -2
- package/lib/ui/gamification/question/twitter/index.js +1 -4
- package/lib/ui/modal/index.d.ts +7 -2
- package/lib/ui/modal/index.js +32 -22
- package/lib/ui/questions/insight/index.d.ts +2 -0
- package/lib/ui/questions/insight/index.js +23 -11
- package/lib/ui/questions/twitter/index.d.ts +2 -0
- package/lib/ui/questions/twitter/index.js +14 -13
- package/lib/ui/video-player/index.d.ts +5 -0
- package/lib/ui/video-player/index.js +43 -35
- package/package.json +14 -13
package/lib/ui/modal/index.js
CHANGED
|
@@ -1,34 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { styled as
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cx as a } from "@linaria/core";
|
|
3
|
+
import { styled as d } from "@linaria/react";
|
|
4
|
+
import { useState as m, useCallback as f, useEffect as l } from "react";
|
|
5
|
+
import { r as c } from "../../index-jRXrW6ie.js";
|
|
5
6
|
import "../../index-uEuzH3jr.js";
|
|
6
|
-
|
|
7
|
-
const c = /* @__PURE__ */ m("div")({
|
|
7
|
+
const u = /* @__PURE__ */ d("div")({
|
|
8
8
|
name: "StaticContainer",
|
|
9
9
|
class: "svm502q",
|
|
10
10
|
propsAsIs: !1
|
|
11
|
-
}),
|
|
11
|
+
}), p = "fd3gza8", v = `
|
|
12
12
|
body {
|
|
13
13
|
overflow: hidden !important;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`, x = `
|
|
16
16
|
.sl-hide-on-modal {
|
|
17
17
|
display: none !important;
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
19
|
+
`, y = (r) => {
|
|
20
|
+
const [e, o] = m(r), t = f(() => o(!1), []);
|
|
21
|
+
return l(() => (r && document.addEventListener("scroll", t), () => {
|
|
22
|
+
document.removeEventListener("scroll", t);
|
|
23
|
+
}), [r, t]), l(() => {
|
|
24
|
+
e === !1 && document.removeEventListener("scroll", t);
|
|
25
|
+
}, [e, t]), [e];
|
|
26
|
+
}, V = ({
|
|
27
|
+
children: r,
|
|
28
|
+
container: e,
|
|
29
|
+
fixedView: o,
|
|
30
|
+
useContainer: t
|
|
31
|
+
}) => {
|
|
32
|
+
const [s] = y(o);
|
|
33
|
+
return e.current ? t ? c.createPortal(/* @__PURE__ */ i(u, {
|
|
34
|
+
className: a(s && p),
|
|
35
|
+
children: [r, s && /* @__PURE__ */ n("style", {
|
|
36
|
+
children: v
|
|
37
|
+
}), !s && /* @__PURE__ */ n("style", {
|
|
38
|
+
children: x
|
|
39
|
+
})]
|
|
40
|
+
}), e.current, "modal-node") : c.createPortal(r, e.current, "modal-node") : null;
|
|
41
|
+
};
|
|
32
42
|
export {
|
|
33
|
-
|
|
43
|
+
V as ModalPortal
|
|
34
44
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InsightHistory } from '@streamlayer/sdk-web-types';
|
|
3
|
+
import { VideoPlayerProps } from '../../video-player';
|
|
3
4
|
export type InsightContentProps = InsightHistory & {
|
|
4
5
|
isDetail?: boolean;
|
|
6
|
+
controlVideo: VideoPlayerProps['controlVideo'];
|
|
5
7
|
};
|
|
6
8
|
export declare const InsightContent: React.FC<InsightContentProps>;
|
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
import { jsxs as c, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { VideoPlayer as
|
|
3
|
-
import { Container as
|
|
2
|
+
import { VideoPlayer as v } from "../../video-player/index.js";
|
|
3
|
+
import { Container as b, Image as x, Content as C, Title as I, Description as T } from "./styles.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../icons/index.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
7
|
import "../../video-player/styles.js";
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
const z = ({
|
|
9
|
+
instantView: r,
|
|
10
|
+
isDetail: l,
|
|
11
|
+
notification: o,
|
|
12
|
+
controlVideo: g
|
|
13
|
+
}) => {
|
|
14
|
+
const m = r == null ? void 0 : r.heading, p = r == null ? void 0 : r.body, h = m || p, y = o == null ? void 0 : o.title, u = o == null ? void 0 : o.body;
|
|
15
|
+
return /* @__PURE__ */ c(b, { children: [
|
|
16
|
+
(r == null ? void 0 : r.video) && /* @__PURE__ */ d(
|
|
17
|
+
v,
|
|
18
|
+
{
|
|
19
|
+
source: r.video.url,
|
|
20
|
+
poster: r.video.thumbnailUrl,
|
|
21
|
+
controlVideo: g
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
(r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ d(x, { src: r == null ? void 0 : r.image }),
|
|
25
|
+
/* @__PURE__ */ c(C, { children: [
|
|
26
|
+
/* @__PURE__ */ d(I, { children: l && h ? m : y }),
|
|
27
|
+
/* @__PURE__ */ d(T, { children: l && h ? p : u })
|
|
16
28
|
] })
|
|
17
29
|
] });
|
|
18
30
|
};
|
|
19
31
|
export {
|
|
20
|
-
|
|
32
|
+
z as InsightContent
|
|
21
33
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TweetHistory } from '@streamlayer/sdk-web-types';
|
|
3
|
+
import { VideoPlayerProps } from '../../video-player';
|
|
3
4
|
export type TwitterContentProps = TweetHistory & {
|
|
4
5
|
isDetail?: boolean;
|
|
6
|
+
controlVideo: VideoPlayerProps['controlVideo'];
|
|
5
7
|
};
|
|
6
8
|
export declare const TwitterContent: React.FC<TwitterContentProps>;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsxs as t, jsx as n, Fragment as
|
|
2
|
-
import { VideoPlayer as
|
|
3
|
-
import { Account as
|
|
4
|
-
import { Container as
|
|
1
|
+
import { jsxs as t, 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 c, ImageFullSize as i, ImageHalfSize as e, ImagesBlock as m } from "./styles.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../icons/index.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "../../video-player/styles.js";
|
|
9
9
|
import "../../../utils/common.js";
|
|
10
10
|
import "./account/styles.js";
|
|
11
|
-
const
|
|
11
|
+
const R = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), S = (o) => o == null ? void 0 : o.replace(R, ""), J = ({
|
|
12
12
|
image: o,
|
|
13
13
|
body: C,
|
|
14
14
|
account: z,
|
|
15
15
|
accountVerified: F,
|
|
16
16
|
tweet: s,
|
|
17
|
-
isDetail: a
|
|
17
|
+
isDetail: a,
|
|
18
|
+
controlVideo: T
|
|
18
19
|
}) => {
|
|
19
20
|
var h, g, H, U, f, u, v, I, y;
|
|
20
21
|
const r = (g = (h = s == null ? void 0 : s.meta) == null ? void 0 : h.extendedEntities) == null ? void 0 : g.media, l = r == null ? void 0 : r.find(({ type: p }) => p === "photo"), d = (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(
|
|
21
22
|
({ contentType: p }) => p === "video/mp4"
|
|
22
23
|
)) == null ? void 0 : u.url;
|
|
23
|
-
return /* @__PURE__ */ t(
|
|
24
|
-
/* @__PURE__ */ t(
|
|
24
|
+
return /* @__PURE__ */ t(B, { children: [
|
|
25
|
+
/* @__PURE__ */ t(E, { children: [
|
|
25
26
|
/* @__PURE__ */ n(
|
|
26
|
-
|
|
27
|
+
x,
|
|
27
28
|
{
|
|
28
29
|
image: o,
|
|
29
30
|
name: (v = s == null ? void 0 : s.meta) == null ? void 0 : v.accountName,
|
|
@@ -32,9 +33,9 @@ const N = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), R = (o) => o == null ?
|
|
|
32
33
|
createdTweet: s == null ? void 0 : s.date
|
|
33
34
|
}
|
|
34
35
|
),
|
|
35
|
-
/* @__PURE__ */ n(
|
|
36
|
+
/* @__PURE__ */ n(N, { children: S(C) }),
|
|
36
37
|
!a && l && /* @__PURE__ */ n(c, { children: /* @__PURE__ */ n(i, { src: r == null ? void 0 : r[0].mediaUrlHttps }) }),
|
|
37
|
-
a && l && /* @__PURE__ */ t(
|
|
38
|
+
a && l && /* @__PURE__ */ t(j, { children: [
|
|
38
39
|
(r == null ? void 0 : r.length) === 1 && /* @__PURE__ */ n(c, { children: /* @__PURE__ */ n(i, { src: r[0].mediaUrlHttps }) }),
|
|
39
40
|
(r == null ? void 0 : r.length) === 2 && /* @__PURE__ */ t(c, { children: [
|
|
40
41
|
/* @__PURE__ */ n(e, { src: r[0].mediaUrlHttps }),
|
|
@@ -59,9 +60,9 @@ const N = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), R = (o) => o == null ?
|
|
|
59
60
|
] })
|
|
60
61
|
] })
|
|
61
62
|
] }),
|
|
62
|
-
!l && (((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") && d && /* @__PURE__ */ n(
|
|
63
|
+
!l && (((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") && d && /* @__PURE__ */ n(k, { source: d, poster: r[0].mediaUrlHttps, controlVideo: T })
|
|
63
64
|
] });
|
|
64
65
|
};
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
+
J as TwitterContent
|
|
67
68
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
type ControlVideoProps = {
|
|
3
|
+
muted: boolean;
|
|
4
|
+
};
|
|
2
5
|
export type VideoPlayerProps = {
|
|
3
6
|
poster?: string;
|
|
4
7
|
source?: string;
|
|
8
|
+
controlVideo?: (props: ControlVideoProps) => void;
|
|
5
9
|
};
|
|
6
10
|
/**
|
|
7
11
|
* VideoPlayer component for playing videos with a poster image.
|
|
@@ -31,3 +35,4 @@ export type VideoPlayerProps = {
|
|
|
31
35
|
* @returns {JSX.Element} The rendered VideoPlayer component.
|
|
32
36
|
*/
|
|
33
37
|
export declare const VideoPlayer: React.FC<VideoPlayerProps>;
|
|
38
|
+
export {};
|
|
@@ -1,54 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { SvgIcon as
|
|
4
|
-
import { Container as
|
|
1
|
+
import { jsxs as h, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as O, useState as d, useEffect as w } from "react";
|
|
3
|
+
import { SvgIcon as E } from "../icons/index.js";
|
|
4
|
+
import { Container as I, Player as S, Poster as x, Control as C } from "./styles.js";
|
|
5
5
|
import "@linaria/react";
|
|
6
|
-
const
|
|
7
|
-
for (const
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
const e =
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
const L = (t, c) => {
|
|
7
|
+
for (const s of t)
|
|
8
|
+
s.isIntersecting || s.target instanceof HTMLVideoElement && !s.target.paused && (c.unobserve(s.target), s.target.pause());
|
|
9
|
+
}, g = new IntersectionObserver(L, { threshold: 0.5 }), f = /* @__PURE__ */ new Set(), T = (t) => {
|
|
10
|
+
g.observe(t), f.add(t);
|
|
11
|
+
}, u = (t) => {
|
|
12
|
+
g.unobserve(t), f.delete(t);
|
|
13
|
+
}, q = ({ poster: t, source: c, controlVideo: s }) => {
|
|
14
|
+
const e = O(null), [l, a] = d(!1), [b, m] = d(!0), p = () => {
|
|
15
|
+
s == null || s({ muted: !0 });
|
|
16
|
+
}, v = () => {
|
|
17
|
+
s == null || s({ muted: !1 });
|
|
18
|
+
}, y = () => {
|
|
19
|
+
const n = e == null ? void 0 : e.current;
|
|
20
|
+
if (n)
|
|
17
21
|
if (l)
|
|
18
|
-
|
|
22
|
+
n.pause(), e.current && u(e.current);
|
|
19
23
|
else {
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
24
|
+
const i = e == null ? void 0 : e.current;
|
|
25
|
+
if (!i)
|
|
22
26
|
return;
|
|
23
|
-
for (const
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
for (const r of f)
|
|
28
|
+
r !== i && r instanceof HTMLVideoElement && !r.paused && (r.pause(), u(r));
|
|
29
|
+
T(i), i.play().catch((r) => console.log(r)), m(!1);
|
|
26
30
|
}
|
|
27
|
-
},
|
|
28
|
-
var
|
|
29
|
-
e.current &&
|
|
31
|
+
}, P = () => {
|
|
32
|
+
var n;
|
|
33
|
+
e.current && u(e.current), (n = e == null ? void 0 : e.current) == null || n.load(), m(!0);
|
|
30
34
|
};
|
|
31
|
-
return
|
|
32
|
-
e.current &&
|
|
33
|
-
}, []), /* @__PURE__ */
|
|
35
|
+
return w(() => {
|
|
36
|
+
e.current && u(e.current);
|
|
37
|
+
}, []), /* @__PURE__ */ h(I, { onClick: y, children: [
|
|
34
38
|
/* @__PURE__ */ o(
|
|
35
|
-
|
|
39
|
+
S,
|
|
36
40
|
{
|
|
37
41
|
ref: e,
|
|
38
42
|
src: c,
|
|
39
|
-
onPlay: () =>
|
|
40
|
-
|
|
43
|
+
onPlay: () => {
|
|
44
|
+
p(), a(!0);
|
|
45
|
+
},
|
|
46
|
+
onPause: () => {
|
|
47
|
+
v(), a(!1);
|
|
48
|
+
},
|
|
41
49
|
onEnded: () => {
|
|
42
|
-
|
|
50
|
+
v(), a(!1), P();
|
|
43
51
|
},
|
|
44
|
-
style: { visibility:
|
|
52
|
+
style: { visibility: b ? "hidden" : "visible" },
|
|
45
53
|
playsInline: !0
|
|
46
54
|
}
|
|
47
55
|
),
|
|
48
|
-
/* @__PURE__ */ o(
|
|
49
|
-
/* @__PURE__ */ o(
|
|
56
|
+
/* @__PURE__ */ o(x, { src: t, style: { visibility: b ? "visible" : "hidden" } }),
|
|
57
|
+
/* @__PURE__ */ o(C, { children: !l && /* @__PURE__ */ o(E, { name: "icon-play" }) })
|
|
50
58
|
] });
|
|
51
59
|
};
|
|
52
60
|
export {
|
|
53
|
-
|
|
61
|
+
q as VideoPlayer
|
|
54
62
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.96.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -37,23 +37,24 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@lottiefiles/react-lottie-player": "*",
|
|
39
39
|
"@streamlayer/sl-eslib": "^5.67.0",
|
|
40
|
+
"nanoid": "3.3.7",
|
|
40
41
|
"@types/lodash.throttle": "^4.1.9",
|
|
41
42
|
"lodash.throttle": "^4.1.1",
|
|
42
43
|
"react-infinite-scroller": "^1.2.6",
|
|
43
44
|
"react-virtualized-auto-sizer": "^1.0.21",
|
|
44
45
|
"react-window": "^1.8.10",
|
|
45
46
|
"react-window-infinite-loader": "^1.0.9",
|
|
46
|
-
"@streamlayer/feature-gamification": "^0.37.
|
|
47
|
-
"@streamlayer/sdk-web": "^0.
|
|
48
|
-
"@streamlayer/sdk-web-anonymous-auth": "^0.11.
|
|
49
|
-
"@streamlayer/sdk-web-api": "^0.
|
|
50
|
-
"@streamlayer/sdk-web-
|
|
51
|
-
"@streamlayer/sdk-web-
|
|
52
|
-
"@streamlayer/sdk-web-interfaces": "^0.20.
|
|
53
|
-
"@streamlayer/sdk-web-logger": "^0.5.
|
|
54
|
-
"@streamlayer/sdk-web-notifications": "^0.
|
|
55
|
-
"@streamlayer/sdk-web-storage": "^0.4.
|
|
56
|
-
"@streamlayer/sdk-web-types": "^0.22.
|
|
47
|
+
"@streamlayer/feature-gamification": "^0.37.2",
|
|
48
|
+
"@streamlayer/sdk-web": "^0.32.0",
|
|
49
|
+
"@streamlayer/sdk-web-anonymous-auth": "^0.11.38",
|
|
50
|
+
"@streamlayer/sdk-web-api": "^0.22.0",
|
|
51
|
+
"@streamlayer/sdk-web-features": "^0.11.20",
|
|
52
|
+
"@streamlayer/sdk-web-core": "^0.21.0",
|
|
53
|
+
"@streamlayer/sdk-web-interfaces": "^0.20.5",
|
|
54
|
+
"@streamlayer/sdk-web-logger": "^0.5.16",
|
|
55
|
+
"@streamlayer/sdk-web-notifications": "^0.14.0",
|
|
56
|
+
"@streamlayer/sdk-web-storage": "^0.4.3",
|
|
57
|
+
"@streamlayer/sdk-web-types": "^0.22.3"
|
|
57
58
|
},
|
|
58
59
|
"nx": {
|
|
59
60
|
"implicitDependencies": [
|
|
@@ -94,6 +95,6 @@
|
|
|
94
95
|
"vite-plugin-svgr": "^4.2.0",
|
|
95
96
|
"vite-svg-loader": "^5.1.0",
|
|
96
97
|
"vite-tsconfig-paths": "^4.3.1",
|
|
97
|
-
"@streamlayer/react": "^0.
|
|
98
|
+
"@streamlayer/react": "^0.40.0"
|
|
98
99
|
}
|
|
99
100
|
}
|