@streamlayer/react-ui 0.98.1 → 0.99.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/{index-jRXrW6ie.js → index-Bicco-Aq.js} +1 -1
- package/lib/{index-z0QjLiEL.js → index-CZvwzN5o.js} +1 -1
- package/lib/index.js +4 -8
- package/lib/ui/app/Features/Gamification/Friends.js +10 -23
- package/lib/ui/app/Features/Gamification/Leaderboard.js +30 -45
- package/lib/ui/app/Features/Gamification/Question.js +31 -63
- package/lib/ui/app/Features/Gamification/QuestionsList.js +8 -34
- package/lib/ui/app/Features/Gamification/Tabs.js +25 -82
- package/lib/ui/app/Features/Gamification/UserSummary.js +12 -21
- package/lib/ui/app/Features/Gamification/gamification-feature.js +2 -93
- package/lib/ui/app/Features/Gamification/index.js +52 -133
- package/lib/ui/app/Features/index.js +21 -109
- package/lib/ui/app/Navigation/MastersNavigation/index.js +16 -22
- package/lib/ui/app/Navigation/index.js +9 -12
- package/lib/ui/app/Notifications/Onboarding/Notification/index.js +13 -16
- package/lib/ui/app/Notifications/Onboarding/Notification/styles.js +18 -20
- package/lib/ui/app/Notifications/Onboarding/index.js +55 -82
- package/lib/ui/app/Notifications/index.js +96 -148
- package/lib/ui/app/Notifications/styles.js +10 -15
- package/lib/ui/app/Points/index.js +18 -26
- package/lib/ui/app/masters.js +60 -179
- package/lib/ui/app/useClipboardCopy.js +11 -15
- package/lib/ui/app/useMastersApp.js +34 -44
- package/lib/ui/app/useSdkResponsive.js +18 -19
- package/lib/ui/app/useSdkScroll.js +5 -6
- package/lib/ui/button/index.js +3 -4
- package/lib/ui/gamification/copyNotification/index.js +5 -7
- package/lib/ui/gamification/detail/header/index.js +15 -18
- package/lib/ui/gamification/detail/header/styles.js +12 -14
- package/lib/ui/gamification/detail/sponsor/index.js +2 -3
- package/lib/ui/gamification/insight/index.js +5 -6
- package/lib/ui/gamification/insight-list/index.js +3 -6
- package/lib/ui/gamification/invite-link/index.js +11 -17
- package/lib/ui/gamification/invite-link/styles.js +13 -15
- package/lib/ui/gamification/leaderboard/index.js +21 -28
- package/lib/ui/gamification/leaderboard/list-item/index.js +19 -22
- package/lib/ui/gamification/leaderboard/list-item/styles.js +16 -18
- package/lib/ui/gamification/leaderboard/static.js +19 -23
- package/lib/ui/gamification/leaderboard/styles.js +1 -1
- package/lib/ui/gamification/onboarding/index.js +51 -73
- package/lib/ui/gamification/onboarding/invitingUser/index.js +10 -11
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +3 -2
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +17 -20
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +2 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +21 -11
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +21 -30
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +22 -24
- package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +5 -7
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +2 -3
- package/lib/ui/gamification/onboarding/styles.js +14 -17
- package/lib/ui/gamification/points/index.js +9 -15
- package/lib/ui/gamification/points/styles.js +12 -14
- package/lib/ui/gamification/question/index.js +22 -26
- package/lib/ui/gamification/question/insight/index.js +7 -15
- package/lib/ui/gamification/question/list/index.js +33 -54
- package/lib/ui/gamification/question/notification/index.js +22 -35
- package/lib/ui/gamification/question/notification/insight/index.js +12 -17
- package/lib/ui/gamification/question/notification/pill/index.js +7 -9
- package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +11 -12
- package/lib/ui/gamification/question/notification/prediction-result/index.js +45 -51
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +23 -26
- package/lib/ui/gamification/question/notification/styles.js +17 -19
- package/lib/ui/gamification/question/notification/tweet/index.js +8 -18
- package/lib/ui/gamification/question/styles.js +32 -34
- package/lib/ui/gamification/question/twitter/index.js +8 -20
- package/lib/ui/gamification/question/twitter/styles.js +4 -6
- package/lib/ui/gamification/tabs/index.js +6 -7
- package/lib/ui/gamification/user-statistics/components/rank/index.js +4 -5
- package/lib/ui/gamification/user-statistics/components/statistic/index.js +0 -1
- package/lib/ui/gamification/user-statistics/index.js +2 -6
- package/lib/ui/gamification/vote/expired-alert/index.js +8 -10
- package/lib/ui/gamification/vote/feedback/index.js +19 -23
- package/lib/ui/gamification/vote/feedback/styles.js +20 -23
- package/lib/ui/gamification/vote/index.js +77 -91
- package/lib/ui/gamification/vote/insight-details/index.js +9 -16
- package/lib/ui/gamification/vote/twitter-details/index.js +7 -17
- package/lib/ui/gamification/vote/vote-option/index.js +21 -24
- package/lib/ui/gamification/vote/vote-option/styles.js +24 -26
- package/lib/ui/gamification/vote/win-bar/index.js +29 -37
- package/lib/ui/gamification/vote/win-bar/styles.js +16 -19
- package/lib/ui/login/demo.d.ts +1 -0
- package/lib/ui/login/demo.js +5 -17
- package/lib/ui/login/index.js +29 -35
- package/lib/ui/modal/index.js +9 -10
- package/lib/ui/navigation/button/Channels.js +5 -8
- package/lib/ui/navigation/button/FeaturedGroups.js +3 -6
- package/lib/ui/navigation/button/LeaderBoard.js +8 -11
- package/lib/ui/navigation/button/index.js +10 -11
- package/lib/ui/navigation/masters.js +2 -3
- package/lib/ui/questions/insight/index.js +14 -19
- package/lib/ui/questions/twitter/account/index.js +13 -15
- package/lib/ui/questions/twitter/account/styles.js +14 -16
- package/lib/ui/questions/twitter/index.js +31 -38
- package/lib/ui/skeleton/index.js +3 -4
- package/lib/ui/theme/index.js +3 -5
- package/lib/ui/video-player/index.js +44 -38
- package/lib/utils/createDemo.js +18 -28
- package/lib/utils/debug/components/copyLogs.js +2 -3
- package/lib/utils/debug/components/developer.js +20 -24
- package/lib/utils/debug/components/eventInput.js +9 -10
- package/lib/utils/debug/components/sdkKey.js +9 -10
- package/lib/utils/debug/index.js +17 -28
- package/lib/utils/debug/storage.js +32 -14
- package/lib/utils/decorators/container.js +5 -9
- package/lib/utils/storage.js +32 -14
- package/package.json +25 -25
- /package/lib/{index-uEuzH3jr.js → index-xuotMAFm.js} +0 -0
- /package/lib/{styles_z07sl8-w40geAFS.js → styles_z07sl8-l0sNRNKZ.js} +0 -0
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { SvgIcon as a } from "../../../icons/index.js";
|
|
3
3
|
import { getTimeUntilNow as l } from "../../../../utils/common.js";
|
|
4
|
-
import { Container as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
i && /* @__PURE__ */ r(s, { children: [
|
|
11
|
-
/* @__PURE__ */ t(d, { src: i }),
|
|
4
|
+
import { Container as s, ImageContainer as d, Image as p, TwitterIcon as f, Details as h, Name as D, UserNameAndDate as I } from "./styles.js";
|
|
5
|
+
const v = ({ image: e, name: i, userName: n, verified: m, createdTweet: o }) => {
|
|
6
|
+
const c = o && l(o);
|
|
7
|
+
return /* @__PURE__ */ r(s, { children: [
|
|
8
|
+
e && /* @__PURE__ */ r(d, { children: [
|
|
9
|
+
/* @__PURE__ */ t(p, { src: e }),
|
|
12
10
|
/* @__PURE__ */ t(f, { name: "twitter" })
|
|
13
11
|
] }),
|
|
14
12
|
/* @__PURE__ */ r(h, { children: [
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
i && /* @__PURE__ */ r(D, { children: [
|
|
14
|
+
i,
|
|
17
15
|
" ",
|
|
18
|
-
|
|
16
|
+
m && /* @__PURE__ */ t(a, { name: "icon-twitter-verified" })
|
|
19
17
|
] }),
|
|
20
|
-
|
|
18
|
+
n && /* @__PURE__ */ r(I, { children: [
|
|
21
19
|
"@",
|
|
22
|
-
|
|
20
|
+
n,
|
|
23
21
|
" ",
|
|
24
|
-
|
|
22
|
+
c && `・ ${c}`
|
|
25
23
|
] })
|
|
26
24
|
] })
|
|
27
25
|
] });
|
|
28
26
|
};
|
|
29
27
|
export {
|
|
30
|
-
|
|
28
|
+
v as Account
|
|
31
29
|
};
|
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
2
|
import { SvgIcon as e } from "../../../icons/index.js";
|
|
3
|
-
|
|
4
|
-
import "react";
|
|
5
|
-
const m = /* @__PURE__ */ s("div")({
|
|
3
|
+
const t = /* @__PURE__ */ s("div")({
|
|
6
4
|
name: "Container",
|
|
7
5
|
class: "cjq447q",
|
|
8
6
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
7
|
+
}), r = /* @__PURE__ */ s("div")({
|
|
10
8
|
name: "ImageContainer",
|
|
11
9
|
class: "i14egogb",
|
|
12
10
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
11
|
+
}), c = /* @__PURE__ */ s("img")({
|
|
14
12
|
name: "Image",
|
|
15
13
|
class: "i2g9g4l",
|
|
16
14
|
propsAsIs: !1
|
|
17
|
-
}), a = () => e,
|
|
15
|
+
}), a = () => e, m = /* @__PURE__ */ s(a())({
|
|
18
16
|
name: "TwitterIcon",
|
|
19
17
|
class: "t1c454nm",
|
|
20
18
|
propsAsIs: !0
|
|
21
|
-
}),
|
|
19
|
+
}), i = /* @__PURE__ */ s("div")({
|
|
22
20
|
name: "Details",
|
|
23
21
|
class: "d11nigc3",
|
|
24
22
|
propsAsIs: !1
|
|
25
|
-
}),
|
|
23
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
26
24
|
name: "Name",
|
|
27
25
|
class: "nrxa4k8",
|
|
28
26
|
propsAsIs: !1
|
|
29
|
-
}),
|
|
27
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
30
28
|
name: "UserNameAndDate",
|
|
31
29
|
class: "u1p051g3",
|
|
32
30
|
propsAsIs: !1
|
|
33
31
|
});
|
|
34
32
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
t as Container,
|
|
34
|
+
i as Details,
|
|
35
|
+
c as Image,
|
|
36
|
+
r as ImageContainer,
|
|
37
|
+
p as Name,
|
|
38
|
+
m as TwitterIcon,
|
|
39
|
+
l as UserNameAndDate
|
|
42
40
|
};
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as c, jsx as n, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import { VideoPlayer as k } from "../../video-player/index.js";
|
|
3
3
|
import { Account as x } from "./account/index.js";
|
|
4
|
-
import { Container as B, Details as E, Body as N, ImagesContainer as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "../../icons/index.js";
|
|
8
|
-
import "@linaria/react";
|
|
9
|
-
import "../../video-player/styles.js";
|
|
10
|
-
import "../../../utils/common.js";
|
|
11
|
-
import "./account/styles.js";
|
|
12
|
-
const R = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), S = (o) => o == null ? void 0 : o.replace(R, ""), K = ({
|
|
13
|
-
image: o,
|
|
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,
|
|
14
7
|
body: C,
|
|
15
8
|
account: z,
|
|
16
9
|
accountVerified: F,
|
|
17
10
|
tweet: s,
|
|
18
|
-
isDetail:
|
|
11
|
+
isDetail: d,
|
|
19
12
|
controlVideo: T
|
|
20
13
|
}) => {
|
|
21
|
-
var
|
|
22
|
-
const r = (g = (
|
|
23
|
-
({ contentType:
|
|
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"
|
|
24
17
|
)) == null ? void 0 : u.url;
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ c(B, { children: [
|
|
19
|
+
/* @__PURE__ */ c(E, { children: [
|
|
27
20
|
/* @__PURE__ */ n(
|
|
28
21
|
x,
|
|
29
22
|
{
|
|
30
|
-
image:
|
|
23
|
+
image: t,
|
|
31
24
|
name: (v = s == null ? void 0 : s.meta) == null ? void 0 : v.accountName,
|
|
32
25
|
userName: z,
|
|
33
26
|
verified: F,
|
|
@@ -35,35 +28,35 @@ const R = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), S = (o) => o == null ?
|
|
|
35
28
|
}
|
|
36
29
|
),
|
|
37
30
|
/* @__PURE__ */ n(N, { children: S(C) }),
|
|
38
|
-
!
|
|
39
|
-
|
|
40
|
-
(r == null ? void 0 : r.length) === 1 && /* @__PURE__ */ n(
|
|
41
|
-
(r == null ? void 0 : r.length) === 2 && /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */ n(
|
|
43
|
-
/* @__PURE__ */ n(
|
|
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 })
|
|
44
37
|
] }),
|
|
45
|
-
(r == null ? void 0 : r.length) === 3 && /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */ n(
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */ n(
|
|
49
|
-
/* @__PURE__ */ n(
|
|
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 })
|
|
50
43
|
] })
|
|
51
44
|
] }),
|
|
52
|
-
(r == null ? void 0 : r.length) === 4 && /* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */ n(
|
|
55
|
-
/* @__PURE__ */ n(
|
|
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 })
|
|
56
49
|
] }),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */ n(
|
|
59
|
-
/* @__PURE__ */ n(
|
|
50
|
+
/* @__PURE__ */ c(a, { children: [
|
|
51
|
+
/* @__PURE__ */ n(l, { src: r[2].mediaUrlHttps }),
|
|
52
|
+
/* @__PURE__ */ n(l, { src: r[3].mediaUrlHttps })
|
|
60
53
|
] })
|
|
61
54
|
] })
|
|
62
55
|
] })
|
|
63
56
|
] }),
|
|
64
|
-
!
|
|
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 })
|
|
65
58
|
] });
|
|
66
59
|
};
|
|
67
60
|
export {
|
|
68
|
-
|
|
61
|
+
V as TwitterContent
|
|
69
62
|
};
|
package/lib/ui/skeleton/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Container as
|
|
3
|
-
|
|
4
|
-
const f = ({ children: r, style: o, loading: t }) => t ? /* @__PURE__ */ e(m, { style: o, children: r }) : r;
|
|
2
|
+
import { Container as n } from "./styles.js";
|
|
3
|
+
const i = ({ children: r, style: o, loading: t }) => t ? /* @__PURE__ */ e(n, { style: o, children: r }) : r;
|
|
5
4
|
export {
|
|
6
|
-
|
|
5
|
+
i as Skeleton
|
|
7
6
|
};
|
package/lib/ui/theme/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { theme as
|
|
3
|
-
|
|
4
|
-
import "./constants.js";
|
|
5
|
-
const p = ({ children: r, style: m }) => /* @__PURE__ */ e("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ e("div", { className: o, style: m, children: r }) });
|
|
2
|
+
import { theme as a } from "./theme.js";
|
|
3
|
+
const i = ({ children: r, style: m }) => /* @__PURE__ */ e("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ e("div", { className: a, style: m, children: r }) });
|
|
6
4
|
export {
|
|
7
|
-
|
|
5
|
+
i as StreamLayerThemeProvider
|
|
8
6
|
};
|
|
@@ -1,71 +1,77 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as x, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cx as C } from "@linaria/core";
|
|
3
|
+
import { useRef as E, useState as g, useCallback as v, useEffect as d } from "react";
|
|
4
|
+
import { eventBus as S } from "@streamlayer/sdk-web-interfaces";
|
|
5
|
+
import { SvgIcon as y } from "../icons/index.js";
|
|
6
|
+
import { Container as T, ToggleIconPause as L, Player as j, Poster as k, Control as H } from "./styles.js";
|
|
7
|
+
const M = (s, a) => {
|
|
8
8
|
for (const t of s)
|
|
9
|
-
t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
},
|
|
9
|
+
t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (a.unobserve(t.target), t.target.pause());
|
|
10
|
+
}, P = new IntersectionObserver(M, { threshold: 0.5 }), f = /* @__PURE__ */ new Set(), A = (s) => {
|
|
11
|
+
P.observe(s), f.add(s);
|
|
12
|
+
}, o = (s) => {
|
|
13
|
+
P.unobserve(s), f.delete(s);
|
|
14
|
+
}, B = () => {
|
|
15
15
|
for (const s of f)
|
|
16
|
-
s instanceof HTMLVideoElement && !s.paused && (s.pause(),
|
|
17
|
-
},
|
|
18
|
-
const e =
|
|
16
|
+
s instanceof HTMLVideoElement && !s.paused && (s.pause(), o(s));
|
|
17
|
+
}, J = ({ poster: s, source: a, controlVideo: t }) => {
|
|
18
|
+
const e = E(null), [u, c] = g(!1), [m, p] = g(!0), h = v(() => {
|
|
19
19
|
t == null || t({ muted: !0 });
|
|
20
|
-
}, [t]), i =
|
|
20
|
+
}, [t]), i = v(() => {
|
|
21
21
|
t == null || t({ muted: !1 });
|
|
22
|
-
}, [t]),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
}, [t]), I = (r) => {
|
|
23
|
+
r.stopPropagation();
|
|
24
|
+
const b = e == null ? void 0 : e.current;
|
|
25
|
+
if (b) {
|
|
26
|
+
if (u)
|
|
27
|
+
b.pause(), e.current && o(e.current);
|
|
27
28
|
else {
|
|
28
29
|
const l = e == null ? void 0 : e.current;
|
|
29
30
|
if (!l)
|
|
30
31
|
return;
|
|
31
|
-
|
|
32
|
+
B(), A(l), l.play().catch((w) => console.log(w)), p(!1);
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
S.emit("interactions", {
|
|
35
|
+
action: "tap",
|
|
36
|
+
payload: {}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}, O = () => {
|
|
34
40
|
var r;
|
|
35
|
-
e.current &&
|
|
41
|
+
e.current && o(e.current), (r = e == null ? void 0 : e.current) == null || r.load(), p(!0);
|
|
36
42
|
};
|
|
37
|
-
return
|
|
38
|
-
e.current &&
|
|
39
|
-
}, []),
|
|
43
|
+
return d(() => {
|
|
44
|
+
e.current && o(e.current);
|
|
45
|
+
}, []), d(() => {
|
|
40
46
|
const r = e == null ? void 0 : e.current;
|
|
41
47
|
return () => {
|
|
42
|
-
r && (r.paused || i(),
|
|
48
|
+
r && (r.paused || i(), o(r));
|
|
43
49
|
};
|
|
44
|
-
}, [i]), /* @__PURE__ */
|
|
50
|
+
}, [i]), /* @__PURE__ */ x(T, { onClick: I, className: C(u && L), children: [
|
|
45
51
|
/* @__PURE__ */ n(
|
|
46
|
-
|
|
52
|
+
j,
|
|
47
53
|
{
|
|
48
54
|
ref: e,
|
|
49
|
-
src:
|
|
55
|
+
src: a,
|
|
50
56
|
onPlay: () => {
|
|
51
|
-
|
|
57
|
+
h(), c(!0);
|
|
52
58
|
},
|
|
53
59
|
onPause: () => {
|
|
54
60
|
i(), c(!1);
|
|
55
61
|
},
|
|
56
62
|
onEnded: () => {
|
|
57
|
-
i(), c(!1),
|
|
63
|
+
i(), c(!1), O();
|
|
58
64
|
},
|
|
59
65
|
style: { visibility: m ? "hidden" : "visible" },
|
|
60
66
|
controls: !1,
|
|
61
67
|
playsInline: !0
|
|
62
68
|
}
|
|
63
69
|
),
|
|
64
|
-
/* @__PURE__ */ n(
|
|
65
|
-
/* @__PURE__ */ n(
|
|
70
|
+
/* @__PURE__ */ n(k, { src: s, style: { visibility: m ? "visible" : "hidden" } }),
|
|
71
|
+
/* @__PURE__ */ n(H, { children: u ? /* @__PURE__ */ n(y, { name: "icon-pause" }) : /* @__PURE__ */ n(y, { name: "icon-play" }) })
|
|
66
72
|
] });
|
|
67
73
|
};
|
|
68
74
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
J as VideoPlayer,
|
|
76
|
+
B as pauseAllVideos
|
|
71
77
|
};
|
package/lib/utils/createDemo.js
CHANGED
|
@@ -1,45 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as t, jsxs as g, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as p, useState as c, useEffect as E } from "react";
|
|
3
3
|
import { useStreamLayerApp as l } from "@streamlayer/react/useStreamLayerApp";
|
|
4
4
|
import { anonymous as D } from "@streamlayer/sdk-web-anonymous-auth";
|
|
5
5
|
import { Developer as w } from "./debug/components/developer.js";
|
|
6
6
|
import { DeveloperStorage as x } from "./storage.js";
|
|
7
|
-
import "@linaria/react";
|
|
8
|
-
import "./debug/components/bypassLogin.js";
|
|
9
|
-
import "./debug/components/copyLogs.js";
|
|
10
|
-
import "./debug/components/styles.js";
|
|
11
|
-
import "./debug/components/envToggle.js";
|
|
12
|
-
import "./debug/components/eventInput.js";
|
|
13
|
-
import "@nanostores/react";
|
|
14
|
-
import "@streamlayer/sdk-web-core";
|
|
15
|
-
import "./debug/components/sdkKey.js";
|
|
16
|
-
import "@streamlayer/sdk-web-storage";
|
|
17
7
|
function K({
|
|
18
8
|
Component: o,
|
|
19
9
|
Story: r,
|
|
20
10
|
args: n,
|
|
21
11
|
autoEnable: a
|
|
22
12
|
}) {
|
|
23
|
-
const s =
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
}, []),
|
|
27
|
-
sdkKey:
|
|
13
|
+
const s = p(() => new x(), []), [i, f] = c(s.getEnv()), [d, v] = c(s.getSdkKey() || "set-sdk-key"), [m, k] = c(s.getEvent() || ""), S = p(() => {
|
|
14
|
+
const u = /* @__PURE__ */ new Set();
|
|
15
|
+
return u.add(D), u;
|
|
16
|
+
}, []), e = l({
|
|
17
|
+
sdkKey: d,
|
|
28
18
|
plugins: S,
|
|
29
|
-
production:
|
|
19
|
+
production: i === "production",
|
|
30
20
|
autoEnable: a
|
|
31
21
|
});
|
|
32
22
|
return E(() => {
|
|
33
|
-
m &&
|
|
34
|
-
}, [
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */
|
|
23
|
+
m && e && e.createEventSession(m);
|
|
24
|
+
}, [e]), /* @__PURE__ */ g(y, { children: [
|
|
25
|
+
e ? /* @__PURE__ */ t(o, { Story: r, sdk: e, args: n }) : /* @__PURE__ */ t("div", { children: "wait sdk..." }),
|
|
26
|
+
/* @__PURE__ */ t(
|
|
37
27
|
w,
|
|
38
28
|
{
|
|
39
|
-
sdk:
|
|
40
|
-
sdkKey:
|
|
29
|
+
sdk: e,
|
|
30
|
+
sdkKey: d,
|
|
41
31
|
setSdkKey: v,
|
|
42
|
-
env:
|
|
32
|
+
env: i,
|
|
43
33
|
setEnv: f,
|
|
44
34
|
event: m,
|
|
45
35
|
setEvent: k
|
|
@@ -47,13 +37,13 @@ function K({
|
|
|
47
37
|
)
|
|
48
38
|
] });
|
|
49
39
|
}
|
|
50
|
-
function
|
|
40
|
+
function b(o, r = !0) {
|
|
51
41
|
return {
|
|
52
42
|
decorators: [
|
|
53
|
-
(n) => /* @__PURE__ */
|
|
43
|
+
(n) => /* @__PURE__ */ t(K, { Story: n, Component: o, autoEnable: r })
|
|
54
44
|
]
|
|
55
45
|
};
|
|
56
46
|
}
|
|
57
47
|
export {
|
|
58
|
-
|
|
48
|
+
b as createDemo
|
|
59
49
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { InputField as r } from "./styles.js";
|
|
3
|
-
|
|
4
|
-
const p = () => /* @__PURE__ */ t(r, { children: [
|
|
3
|
+
const n = () => /* @__PURE__ */ t(r, { children: [
|
|
5
4
|
/* @__PURE__ */ o("label", { children: "Subscription Logs" }),
|
|
6
5
|
/* @__PURE__ */ o("button", { onClick: () => {
|
|
7
6
|
navigator.clipboard.writeText(sessionStorage.getItem("slstreamlogs") || "").then(() => {
|
|
@@ -10,5 +9,5 @@ const p = () => /* @__PURE__ */ t(r, { children: [
|
|
|
10
9
|
}, children: "Copy" })
|
|
11
10
|
] });
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
n as CopyLogs
|
|
14
13
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { styled as s } from "@linaria/react";
|
|
3
3
|
import { useMemo as b, useState as h } from "react";
|
|
4
4
|
import { DeveloperStorage as q } from "../../storage.js";
|
|
5
5
|
import { BypassLogin as u } from "./bypassLogin.js";
|
|
@@ -7,70 +7,66 @@ import { CopyLogs as D } from "./copyLogs.js";
|
|
|
7
7
|
import { EnvToggle as I } from "./envToggle.js";
|
|
8
8
|
import { EventInput as B } from "./eventInput.js";
|
|
9
9
|
import { SdkKey as v } from "./sdkKey.js";
|
|
10
|
-
|
|
11
|
-
import "./styles.js";
|
|
12
|
-
import "@nanostores/react";
|
|
13
|
-
import "@streamlayer/sdk-web-core";
|
|
14
|
-
const A = /* @__PURE__ */ n("div")({
|
|
10
|
+
const A = /* @__PURE__ */ s("div")({
|
|
15
11
|
name: "DeveloperContainer",
|
|
16
12
|
class: "d1sqxt7l",
|
|
17
13
|
propsAsIs: !1
|
|
18
|
-
}), x = /* @__PURE__ */
|
|
14
|
+
}), x = /* @__PURE__ */ s("div")({
|
|
19
15
|
name: "DeveloperItems",
|
|
20
16
|
class: "d1a3478s",
|
|
21
17
|
propsAsIs: !1
|
|
22
|
-
}), L = /* @__PURE__ */
|
|
18
|
+
}), L = /* @__PURE__ */ s("button")({
|
|
23
19
|
name: "BurgerBtn",
|
|
24
20
|
class: "butjcq8",
|
|
25
21
|
propsAsIs: !1
|
|
26
|
-
}),
|
|
22
|
+
}), G = ({
|
|
27
23
|
sdk: r,
|
|
28
|
-
sdkKey:
|
|
24
|
+
sdkKey: m,
|
|
29
25
|
setSdkKey: p,
|
|
30
|
-
env:
|
|
26
|
+
env: a,
|
|
31
27
|
setEnv: t,
|
|
32
|
-
event:
|
|
28
|
+
event: i,
|
|
33
29
|
setEvent: l,
|
|
34
30
|
hideAuth: c,
|
|
35
31
|
standalone: f = !1
|
|
36
32
|
}) => {
|
|
37
33
|
const e = b(() => new q(), []), [g, C] = h(f);
|
|
38
|
-
return f ? /* @__PURE__ */
|
|
34
|
+
return f ? /* @__PURE__ */ n(x, {
|
|
39
35
|
children: [t && /* @__PURE__ */ o(I, {
|
|
40
|
-
env:
|
|
36
|
+
env: a,
|
|
41
37
|
setEnv: t,
|
|
42
38
|
storage: e
|
|
43
39
|
}), p && /* @__PURE__ */ o(v, {
|
|
44
|
-
sdkKey:
|
|
40
|
+
sdkKey: m,
|
|
45
41
|
setSdkKey: p,
|
|
46
42
|
storage: e
|
|
47
43
|
}), r && /* @__PURE__ */ o(B, {
|
|
48
44
|
sdk: r,
|
|
49
45
|
storage: e,
|
|
50
|
-
event:
|
|
46
|
+
event: i,
|
|
51
47
|
setEvent: l
|
|
52
48
|
}), !c && r && /* @__PURE__ */ o(u, {
|
|
53
49
|
sdk: r,
|
|
54
50
|
storage: e
|
|
55
51
|
}), /* @__PURE__ */ o(D, {})]
|
|
56
|
-
}) : /* @__PURE__ */
|
|
57
|
-
children: [/* @__PURE__ */
|
|
52
|
+
}) : /* @__PURE__ */ n(A, {
|
|
53
|
+
children: [/* @__PURE__ */ n(L, {
|
|
58
54
|
"data-opened": g.toString(),
|
|
59
55
|
onClick: () => C((j) => !j),
|
|
60
56
|
children: [/* @__PURE__ */ o("span", {}), /* @__PURE__ */ o("span", {}), /* @__PURE__ */ o("span", {})]
|
|
61
|
-
}), g && /* @__PURE__ */
|
|
57
|
+
}), g && /* @__PURE__ */ n(x, {
|
|
62
58
|
children: [t && /* @__PURE__ */ o(I, {
|
|
63
|
-
env:
|
|
59
|
+
env: a,
|
|
64
60
|
setEnv: t,
|
|
65
61
|
storage: e
|
|
66
62
|
}), p && /* @__PURE__ */ o(v, {
|
|
67
|
-
sdkKey:
|
|
63
|
+
sdkKey: m,
|
|
68
64
|
setSdkKey: p,
|
|
69
65
|
storage: e
|
|
70
66
|
}), r && /* @__PURE__ */ o(B, {
|
|
71
67
|
sdk: r,
|
|
72
68
|
storage: e,
|
|
73
|
-
event:
|
|
69
|
+
event: i,
|
|
74
70
|
setEvent: l
|
|
75
71
|
}), !c && r && /* @__PURE__ */ o(u, {
|
|
76
72
|
sdk: r,
|
|
@@ -80,5 +76,5 @@ const A = /* @__PURE__ */ n("div")({
|
|
|
80
76
|
});
|
|
81
77
|
};
|
|
82
78
|
export {
|
|
83
|
-
|
|
79
|
+
G as Developer
|
|
84
80
|
};
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { useStore as d } from "@nanostores/react";
|
|
3
3
|
import "@streamlayer/sdk-web-core";
|
|
4
|
-
import { InputField as
|
|
5
|
-
|
|
6
|
-
const I = ({ sdk: t, storage: a, event: e, setEvent: l }) => {
|
|
4
|
+
import { InputField as u } from "./styles.js";
|
|
5
|
+
const y = ({ sdk: t, storage: a, event: e, setEvent: l }) => {
|
|
7
6
|
var i;
|
|
8
7
|
const s = d(t.sdkStore.providerStreamId), r = d(t.sdkStore.organizationSettings), c = !((i = r == null ? void 0 : r.data) != null && i.provider);
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ n("div", { children: /* @__PURE__ */ o(u, { children: [
|
|
9
|
+
/* @__PURE__ */ o("label", { children: [
|
|
11
10
|
c ? "Use StreamLayer event ids" : "Use your provider event ids",
|
|
12
11
|
", ",
|
|
13
|
-
/* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */ o("b", { children: [
|
|
14
13
|
"currently configured (",
|
|
15
14
|
s,
|
|
16
15
|
")"
|
|
17
16
|
] })
|
|
18
17
|
] }),
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ n("input", { type: "text", value: e, onChange: (p) => l(p.target.value) }),
|
|
19
|
+
/* @__PURE__ */ n("button", { onClick: () => {
|
|
21
20
|
t.createEventSession(e), a.setEvent(e);
|
|
22
21
|
}, disabled: s === e, children: "set" })
|
|
23
22
|
] }) });
|
|
24
23
|
};
|
|
25
24
|
export {
|
|
26
|
-
|
|
25
|
+
y as EventInput
|
|
27
26
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u } from "react";
|
|
3
|
-
import { InputField as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
storage: n
|
|
3
|
+
import { InputField as c } from "./styles.js";
|
|
4
|
+
const h = ({
|
|
5
|
+
sdkKey: n,
|
|
6
|
+
setSdkKey: r,
|
|
7
|
+
storage: i
|
|
9
8
|
}) => {
|
|
10
|
-
const [e, o] = u(
|
|
11
|
-
return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ l(
|
|
9
|
+
const [e, o] = u(n);
|
|
10
|
+
return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ l(c, { children: [
|
|
12
11
|
/* @__PURE__ */ t("label", { children: "SDK Key" }),
|
|
13
12
|
/* @__PURE__ */ t(
|
|
14
13
|
"input",
|
|
@@ -21,10 +20,10 @@ const b = ({
|
|
|
21
20
|
}
|
|
22
21
|
),
|
|
23
22
|
/* @__PURE__ */ t("button", { onClick: () => {
|
|
24
|
-
|
|
23
|
+
i.setSdkKey(e), r(e);
|
|
25
24
|
}, children: "set" })
|
|
26
25
|
] }) });
|
|
27
26
|
};
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
h as SdkKey
|
|
30
29
|
};
|