@streamlayer/react-ui 1.2.2 → 1.3.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 +2 -1
- package/lib/app/app/Advertisement/index.js +66 -47
- package/lib/app/app/Features/FeatureProvider.d.ts +0 -1
- package/lib/app/app/Features/Gamification/Leaderboard.d.ts +0 -1
- package/lib/app/app/Features/Gamification/Question.d.ts +3 -1
- package/lib/app/app/Features/Gamification/Question.js +45 -41
- package/lib/app/app/Features/Gamification/QuestionsList.d.ts +0 -1
- package/lib/app/app/Features/Gamification/Tabs.d.ts +0 -1
- package/lib/app/app/Features/Gamification/UserSummary.d.ts +0 -1
- package/lib/app/app/Features/Gamification/gamification-feature.d.ts +0 -1
- package/lib/app/app/Features/Gamification/index.d.ts +0 -1
- package/lib/app/app/Features/index.d.ts +0 -1
- package/lib/app/app/Insight/index.d.ts +18 -0
- package/lib/app/app/Insight/index.js +62 -0
- package/lib/app/app/Navigation/index.d.ts +0 -1
- package/lib/app/app/Navigation/index.js +39 -31
- package/lib/app/app/Notifications/Onboarding/Notification/index.d.ts +0 -1
- package/lib/app/app/Notifications/Onboarding/index.d.ts +0 -1
- package/lib/app/app/Notifications/index.d.ts +0 -1
- package/lib/app/app/Notifications/styles.d.ts +1 -1
- package/lib/app/app/Points/index.d.ts +0 -1
- package/lib/app/app/index.d.ts +0 -1
- package/lib/app/app/story/index.d.ts +2 -10
- package/lib/app/app/story/index.js +44 -89
- package/lib/app/app/story/insight/index.d.ts +8 -0
- package/lib/app/app/story/insight/index.js +57 -0
- package/lib/app/app/story/insight/styles.d.ts +6 -0
- package/lib/app/app/story/insight/styles.js +30 -0
- package/lib/app/app/story/insight/video.d.ts +4 -0
- package/lib/app/app/story/insight/video.js +30 -0
- package/lib/app/app/story/promotion/content.d.ts +3 -0
- package/lib/app/app/story/{content.js → promotion/content.js} +22 -18
- package/lib/app/app/story/promotion/index.d.ts +9 -0
- package/lib/app/app/story/promotion/index.js +54 -0
- package/lib/app/app/story/promotion/styles.d.ts +6 -0
- package/lib/app/app/story/promotion/styles.js +35 -0
- package/lib/app/app/story/promotion/video.d.ts +8 -0
- package/lib/app/app/story/promotion/video.js +98 -0
- package/lib/app/app/story/settings/index.d.ts +1 -0
- package/lib/app/app/story/settings/index.js +14 -0
- package/lib/app/app/story/styles.d.ts +1 -6
- package/lib/app/app/story/styles.js +9 -34
- package/lib/app/app/story/video.d.ts +1 -10
- package/lib/app/app/story/video.js +35 -62
- package/lib/app/app/useApp.d.ts +0 -1
- package/lib/app/app/useAppContext.d.ts +0 -1
- package/lib/app/login/demo.d.ts +0 -1
- package/lib/app/login/demo.js +23 -9
- package/lib/app/masters/Features/FeatureProvider.d.ts +0 -1
- package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +0 -1
- package/lib/app/masters/Features/Gamification/Question.d.ts +0 -1
- package/lib/app/masters/Features/Gamification/QuestionsList.d.ts +0 -1
- package/lib/app/masters/Features/Gamification/Tabs.d.ts +0 -1
- package/lib/app/masters/Features/Gamification/UserSummary.d.ts +0 -1
- package/lib/app/masters/Features/Gamification/gamification-feature.d.ts +0 -1
- package/lib/app/masters/Features/Gamification/index.d.ts +0 -1
- package/lib/app/masters/Features/index.d.ts +0 -1
- package/lib/app/masters/Navigation/MastersNavigation/index.d.ts +0 -1
- package/lib/app/masters/Notifications/Onboarding/Notification/index.d.ts +0 -1
- package/lib/app/masters/Notifications/Onboarding/index.d.ts +0 -1
- package/lib/app/masters/Notifications/index.d.ts +0 -1
- package/lib/app/masters/Notifications/styles.d.ts +1 -1
- package/lib/app/masters/Points/index.d.ts +0 -1
- package/lib/app/masters/masters.d.ts +0 -1
- package/lib/app/masters/useMastersApp.d.ts +0 -1
- package/lib/app/masters/useMastersContext.d.ts +0 -1
- package/lib/app/styles.d.ts +3 -3
- package/lib/app/useClipboardCopy.d.ts +0 -1
- package/lib/app/useSdkFeature.d.ts +0 -1
- package/lib/app/useSdkResponsive.d.ts +0 -1
- package/lib/app/useSdkScroll.d.ts +0 -1
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.d.ts +1 -2
- package/lib/ui/advertisement/banner/index.js +16 -28
- package/lib/ui/advertisement/banner/styles.d.ts +3 -0
- package/lib/ui/advertisement/banner/styles.js +20 -0
- package/lib/ui/advertisement/index.d.ts +0 -1
- package/lib/ui/advertisement/index.js +13 -12
- package/lib/ui/advertisement/mock.d.ts +0 -1
- package/lib/ui/advertisement/overlay/index.d.ts +2 -1
- package/lib/ui/advertisement/overlay/index.js +61 -58
- package/lib/ui/advertisement/overlay/styles.d.ts +8 -4
- package/lib/ui/advertisement/overlay/styles.js +70 -62
- package/lib/ui/animated-counter/index.d.ts +0 -1
- package/lib/ui/gamification/constants.d.ts +0 -1
- package/lib/ui/gamification/detail/header/index.d.ts +0 -1
- package/lib/ui/gamification/insight/index.d.ts +0 -1
- package/lib/ui/gamification/insight-list/index.d.ts +0 -1
- package/lib/ui/gamification/leaderboard/index.d.ts +0 -1
- package/lib/ui/gamification/leaderboard/list-item/index.d.ts +0 -1
- package/lib/ui/gamification/leaderboard/static.d.ts +0 -1
- package/lib/ui/gamification/onboarding/index.d.ts +0 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +0 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +0 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.d.ts +0 -1
- package/lib/ui/gamification/question/index.d.ts +0 -1
- package/lib/ui/gamification/question/insight/index.d.ts +0 -1
- package/lib/ui/gamification/question/list/index.d.ts +0 -1
- package/lib/ui/gamification/question/notification/index.d.ts +0 -1
- package/lib/ui/gamification/question/notification/insight/index.d.ts +0 -1
- package/lib/ui/gamification/question/notification/prediction-result/animation-lines/styles.d.ts +14 -14
- package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +0 -1
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +1 -1
- package/lib/ui/gamification/question/notification/tweet/index.d.ts +0 -1
- package/lib/ui/gamification/question/twitter/index.d.ts +0 -1
- package/lib/ui/gamification/vote/alert/index.d.ts +0 -1
- package/lib/ui/gamification/vote/feedback/index.d.ts +0 -1
- package/lib/ui/gamification/vote/index.d.ts +0 -1
- package/lib/ui/gamification/vote/insight-details/index.d.ts +0 -1
- package/lib/ui/gamification/vote/insight-details/index.js +7 -8
- package/lib/ui/gamification/vote/insight-details/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/insight-details/styles.js +10 -4
- package/lib/ui/gamification/vote/twitter-details/index.d.ts +0 -1
- package/lib/ui/gamification/vote/vote-option/index.d.ts +0 -1
- package/lib/ui/gamification/vote/vote-option/styles.d.ts +2 -2
- package/lib/ui/gamification/vote/win-bar/index.d.ts +0 -1
- package/lib/ui/link/index.d.ts +1 -0
- package/lib/ui/link/index.js +9 -0
- package/lib/ui/navigation/button/Channels.d.ts +0 -1
- package/lib/ui/navigation/button/FeaturedGroups.d.ts +0 -1
- package/lib/ui/navigation/button/LeaderBoard.d.ts +0 -1
- package/lib/ui/navigation/button/index.d.ts +0 -1
- package/lib/ui/navigation/index.d.ts +0 -1
- package/lib/ui/questions/insight/index.d.ts +0 -1
- package/lib/ui/questions/twitter/index.d.ts +0 -1
- package/lib/ui/questions/twitter/styles.d.ts +2 -2
- package/lib/ui/show-in/index.d.ts +0 -1
- package/lib/ui/theme/breakpoints.d.ts +0 -1
- package/lib/ui/theme/index.d.ts +1 -0
- package/lib/ui/theme/index.js +4 -3
- package/lib/ui/theme/masters-theme.d.ts +0 -1
- package/lib/ui/theme/theme.js +42 -16
- package/lib/ui/timer/index.d.ts +0 -1
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +43 -43
- package/lib/utils/debug/index.js +45 -19
- package/package.json +26 -26
- package/lib/app/app/story/content.d.ts +0 -4
- package/lib/app/app/story/useResponsive.d.ts +0 -1
- package/lib/app/app/story/useResponsive.js +0 -15
- /package/lib/app/app/story/{login.d.ts → settings/login.d.ts} +0 -0
- /package/lib/app/app/story/{login.js → settings/login.js} +0 -0
|
@@ -6,7 +6,7 @@ export declare const Title: import('@linaria/react').StyledComponent<import('rea
|
|
|
6
6
|
export declare const PointsTitle: {
|
|
7
7
|
__wyw_meta: unknown;
|
|
8
8
|
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
|
|
9
|
-
as?:
|
|
9
|
+
as?: React.ElementType;
|
|
10
10
|
}>;
|
|
11
11
|
export declare const Subtitle: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
12
12
|
export declare const SubtitleFG: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { SvgIcon as b } from "../../../icons/index.js";
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
3
2
|
import { InsightContent as k } from "../../../questions/insight/index.js";
|
|
4
|
-
import { Container as
|
|
5
|
-
const
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
(r == null ? void 0 : r.webLink) && /* @__PURE__ */
|
|
3
|
+
import { Container as m, WebLinkBtn as c, WebLinkIcon as e } from "./styles.js";
|
|
4
|
+
const p = ({ instantView: r, ...b }) => /* @__PURE__ */ l(m, { children: [
|
|
5
|
+
/* @__PURE__ */ o(k, { instantView: r, ...b, isDetail: !0 }),
|
|
6
|
+
(r == null ? void 0 : r.webLink) && /* @__PURE__ */ l(c, { href: r == null ? void 0 : r.webLink.url, target: "_blank", "data-analytics": "web-link", children: [
|
|
8
7
|
r == null ? void 0 : r.webLink.label,
|
|
9
|
-
/* @__PURE__ */
|
|
8
|
+
/* @__PURE__ */ o(e, { name: "icon-external-link" })
|
|
10
9
|
] })
|
|
11
10
|
] });
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
p as InsightDetails
|
|
14
13
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
2
|
export declare const WebLinkBtn: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLAnchorElement> & import('react').AnchorHTMLAttributes<HTMLAnchorElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const WebLinkIcon: any;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
|
|
2
|
+
import { SvgIcon as n } from "../../../icons/index.js";
|
|
3
|
+
const a = /* @__PURE__ */ s("div")({
|
|
3
4
|
name: "Container",
|
|
4
5
|
class: "c1euiow",
|
|
5
6
|
propsAsIs: !1
|
|
6
|
-
}),
|
|
7
|
+
}), c = /* @__PURE__ */ s("a")({
|
|
7
8
|
name: "WebLinkBtn",
|
|
8
9
|
class: "w19zie3h",
|
|
9
10
|
propsAsIs: !1
|
|
11
|
+
}), o = () => n, i = /* @__PURE__ */ s(o())({
|
|
12
|
+
name: "WebLinkIcon",
|
|
13
|
+
class: "wyg5v7z",
|
|
14
|
+
propsAsIs: !0
|
|
10
15
|
});
|
|
11
16
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
a as Container,
|
|
18
|
+
c as WebLinkBtn,
|
|
19
|
+
i as WebLinkIcon
|
|
14
20
|
};
|
|
@@ -8,12 +8,12 @@ export declare const Icon: import('@linaria/react').StyledComponent<import('reac
|
|
|
8
8
|
export declare const IconDefault: {
|
|
9
9
|
__wyw_meta: unknown;
|
|
10
10
|
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLImageElement> & import('react').ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
|
|
11
|
-
as?:
|
|
11
|
+
as?: React.ElementType;
|
|
12
12
|
}>;
|
|
13
13
|
export declare const IconCircle: {
|
|
14
14
|
__wyw_meta: unknown;
|
|
15
15
|
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLImageElement> & import('react').ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
|
|
16
|
-
as?:
|
|
16
|
+
as?: React.ElementType;
|
|
17
17
|
}>;
|
|
18
18
|
export declare const Title: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
19
19
|
export declare const Indicators: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Link: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLAnchorElement> & import('react').AnchorHTMLAttributes<HTMLAnchorElement> & Record<never, unknown>>;
|
|
@@ -7,10 +7,10 @@ export declare const Image: import('@linaria/react').StyledComponent<import('rea
|
|
|
7
7
|
export declare const ImageFullSize: {
|
|
8
8
|
__wyw_meta: unknown;
|
|
9
9
|
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLImageElement> & import('react').ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
|
|
10
|
-
as?:
|
|
10
|
+
as?: React.ElementType;
|
|
11
11
|
}>;
|
|
12
12
|
export declare const ImageHalfSize: {
|
|
13
13
|
__wyw_meta: unknown;
|
|
14
14
|
} & import('react').FunctionComponent<import('react').ClassAttributes<HTMLImageElement> & import('react').ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
|
|
15
|
-
as?:
|
|
15
|
+
as?: React.ElementType;
|
|
16
16
|
}>;
|
package/lib/ui/theme/index.d.ts
CHANGED
package/lib/ui/theme/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { cx as a } from "@linaria/core";
|
|
3
|
+
import { theme as t } from "./theme.js";
|
|
4
|
+
const d = ({ children: r, customTheme: m, style: o }) => /* @__PURE__ */ e("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ e("div", { className: a(t, m), style: o, children: r }) });
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
d as StreamLayerThemeProvider
|
|
6
7
|
};
|
package/lib/ui/theme/theme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { breakpoints as
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { breakpoints as o } from "./breakpoints.js";
|
|
3
3
|
import { colors as s, colorsAdvertisement as h, FONT as t } from "./constants.js";
|
|
4
|
-
const
|
|
4
|
+
const p = `
|
|
5
5
|
${s}
|
|
6
6
|
${h}
|
|
7
7
|
--font-family: ${t.REGULAR};
|
|
@@ -23,18 +23,44 @@ const l = `
|
|
|
23
23
|
--max-width: 600px;
|
|
24
24
|
--max-notifications-width: 400px;
|
|
25
25
|
|
|
26
|
-
${
|
|
26
|
+
${o.down("xl")`
|
|
27
27
|
--header-offset: 0px;
|
|
28
28
|
--watch-live-header: 46px;
|
|
29
29
|
`}
|
|
30
30
|
|
|
31
|
-
${
|
|
31
|
+
${o.intermediate("xl", "lg")`
|
|
32
32
|
--header-offset: 0px;
|
|
33
33
|
`}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
|
|
35
|
+
--insight-image-ratio: 16/9;
|
|
36
|
+
|
|
37
|
+
--adv-side-indents: 16px;
|
|
38
|
+
--adv-top-indent: 32px;
|
|
39
|
+
--adv-header-height: 52px;
|
|
40
|
+
--adv-media-row-gap: 24px;
|
|
41
|
+
--adv-sponsor-logo-size: 32px;
|
|
42
|
+
--adv-sponsor-font-size: 16px;
|
|
43
|
+
--adv-header-border: 1px solid var(--color-adv-border-primary);
|
|
44
|
+
--adv-header-shift: 0;
|
|
45
|
+
--adv-media-shift: 0;
|
|
46
|
+
--adv-hide-on-mobile: unset;
|
|
47
|
+
|
|
48
|
+
.mobile-view {
|
|
49
|
+
--adv-side-indents: 16px;
|
|
50
|
+
--adv-hide-on-mobile: none;
|
|
51
|
+
--adv-header-shift: -10px;
|
|
52
|
+
--adv-media-shift: -10px;
|
|
53
|
+
--adv-top-indent: 4px;
|
|
54
|
+
--adv-header-border: none;
|
|
55
|
+
--adv-header-height: 48px;
|
|
56
|
+
--adv-media-row-gap: 22.5px;
|
|
57
|
+
--adv-sponsor-logo-size: 28px;
|
|
58
|
+
--adv-sponsor-font-size: 12px;
|
|
59
|
+
}
|
|
60
|
+
`, f = "StreamLayerCSSReset", v = "ttkj0ah", c = () => /* @__PURE__ */ e("table", {
|
|
61
|
+
children: /* @__PURE__ */ a("table", {
|
|
36
62
|
children: [/* @__PURE__ */ e("thead", {
|
|
37
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ a("tr", {
|
|
38
64
|
children: [/* @__PURE__ */ e("th", {
|
|
39
65
|
children: "name"
|
|
40
66
|
}), /* @__PURE__ */ e("th", {
|
|
@@ -42,13 +68,13 @@ const l = `
|
|
|
42
68
|
})]
|
|
43
69
|
})
|
|
44
70
|
}), /* @__PURE__ */ e("tbody", {
|
|
45
|
-
children:
|
|
46
|
-
const i =
|
|
47
|
-
return /* @__PURE__ */
|
|
71
|
+
children: p.split(";").map((d) => {
|
|
72
|
+
const i = d.trim(), [r, n] = i.split(":");
|
|
73
|
+
return /* @__PURE__ */ a("tr", {
|
|
48
74
|
children: [/* @__PURE__ */ e("td", {
|
|
49
|
-
children:
|
|
75
|
+
children: r
|
|
50
76
|
}), /* @__PURE__ */ e("td", {
|
|
51
|
-
children:
|
|
77
|
+
children: n
|
|
52
78
|
})]
|
|
53
79
|
}, i);
|
|
54
80
|
})
|
|
@@ -56,8 +82,8 @@ const l = `
|
|
|
56
82
|
})
|
|
57
83
|
});
|
|
58
84
|
export {
|
|
59
|
-
|
|
85
|
+
c as ThemeVariables,
|
|
60
86
|
f as resetCss,
|
|
61
|
-
|
|
62
|
-
|
|
87
|
+
v as theme,
|
|
88
|
+
p as themeStr
|
|
63
89
|
};
|
package/lib/ui/timer/index.d.ts
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { eventBus as
|
|
1
|
+
import { jsxs as E, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cx as S } from "@linaria/core";
|
|
3
|
+
import { useRef as T, useState as d, useCallback as h, useEffect as y } from "react";
|
|
4
|
+
import { eventBus as L } from "@streamlayer/sdk-web-interfaces";
|
|
5
5
|
import { SvgIcon as P } from "../icons/index.js";
|
|
6
|
-
import { Container as
|
|
7
|
-
const
|
|
6
|
+
import { Container as j, ToggleIconPause as k, Player as H, Poster as M, Control as A } from "./styles.js";
|
|
7
|
+
const B = (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 =
|
|
10
|
+
}, I = new IntersectionObserver(B, { threshold: 0.5 }), p = /* @__PURE__ */ new Set(), F = (s) => {
|
|
11
|
+
I.observe(s), p.add(s);
|
|
12
|
+
}, u = (s) => {
|
|
13
|
+
I.unobserve(s), p.delete(s);
|
|
14
|
+
}, N = () => {
|
|
15
|
+
for (const s of p)
|
|
16
|
+
s instanceof HTMLVideoElement && !s.paused && (s.pause(), u(s));
|
|
17
|
+
}, Q = ({ poster: s, source: a, aspectRatio: t, controlVideo: r, onPlay: c }) => {
|
|
18
|
+
const e = T(null), [f, l] = d(!1), [b, g] = d(!0), O = h(() => {
|
|
19
19
|
r == null || r({ muted: !0 });
|
|
20
|
-
}, [r]),
|
|
20
|
+
}, [r]), o = h(() => {
|
|
21
21
|
r == null || r({ muted: !1 });
|
|
22
|
-
}, [r]),
|
|
22
|
+
}, [r]), w = (n) => {
|
|
23
23
|
n.stopPropagation();
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
27
|
-
|
|
24
|
+
const v = e == null ? void 0 : e.current;
|
|
25
|
+
if (v) {
|
|
26
|
+
if (f)
|
|
27
|
+
v.pause(), e.current && u(e.current);
|
|
28
28
|
else {
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
29
|
+
const m = e == null ? void 0 : e.current;
|
|
30
|
+
if (!m)
|
|
31
31
|
return;
|
|
32
|
-
|
|
32
|
+
N(), F(m), m.play().catch((C) => console.log(C)), g(!1);
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
L.emit("interactions", {
|
|
35
35
|
action: "tap",
|
|
36
36
|
payload: {}
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, x = () => {
|
|
40
40
|
var n;
|
|
41
|
-
e.current &&
|
|
41
|
+
e.current && u(e.current), (n = e == null ? void 0 : e.current) == null || n.load(), g(!0);
|
|
42
42
|
};
|
|
43
43
|
return y(() => {
|
|
44
|
-
e.current &&
|
|
44
|
+
e.current && u(e.current);
|
|
45
45
|
}, []), y(() => {
|
|
46
46
|
const n = e == null ? void 0 : e.current;
|
|
47
47
|
return () => {
|
|
48
|
-
n && (n.paused ||
|
|
48
|
+
n && (n.paused || o(), u(n));
|
|
49
49
|
};
|
|
50
|
-
}, [
|
|
51
|
-
|
|
50
|
+
}, [o]), /* @__PURE__ */ E(
|
|
51
|
+
j,
|
|
52
52
|
{
|
|
53
|
-
onClick:
|
|
54
|
-
className:
|
|
53
|
+
onClick: w,
|
|
54
|
+
className: S(f && k),
|
|
55
55
|
style: t ? { aspectRatio: t } : {},
|
|
56
56
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
57
|
+
/* @__PURE__ */ i(
|
|
58
|
+
H,
|
|
59
59
|
{
|
|
60
60
|
ref: e,
|
|
61
61
|
src: a,
|
|
62
62
|
onPlay: () => {
|
|
63
|
-
|
|
63
|
+
O(), l(!0), c == null || c();
|
|
64
64
|
},
|
|
65
65
|
onPause: () => {
|
|
66
|
-
|
|
66
|
+
o(), l(!1);
|
|
67
67
|
},
|
|
68
68
|
onEnded: () => {
|
|
69
|
-
|
|
69
|
+
o(), l(!1), x();
|
|
70
70
|
},
|
|
71
|
-
style: { visibility:
|
|
71
|
+
style: { visibility: b ? "hidden" : "visible" },
|
|
72
72
|
controls: !1,
|
|
73
73
|
playsInline: !0
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ i(M, { src: s, style: { visibility: b ? "visible" : "hidden" } }),
|
|
77
|
+
/* @__PURE__ */ i(A, { children: f ? /* @__PURE__ */ i(P, { name: "icon-pause" }) : /* @__PURE__ */ i(P, { name: "icon-play" }) })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
};
|
|
82
82
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
Q as VideoPlayer,
|
|
84
|
+
N as pauseAllVideos
|
|
85
85
|
};
|
package/lib/utils/debug/index.js
CHANGED
|
@@ -1,23 +1,49 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useStreamLayer as
|
|
4
|
-
import { Developer as
|
|
5
|
-
import { DeveloperStorage as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as y, useState as n, useEffect as o } from "react";
|
|
3
|
+
import { useStreamLayer as m } from "@streamlayer/react";
|
|
4
|
+
import { Developer as k } from "./components/developer.js";
|
|
5
|
+
import { DeveloperStorage as a } from "./storage.js";
|
|
6
|
+
const E = {
|
|
7
|
+
args: {
|
|
8
|
+
sdkKey: void 0,
|
|
9
|
+
eventId: void 0,
|
|
10
|
+
production: !1
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
sdkKey: {
|
|
14
|
+
type: "string"
|
|
15
|
+
},
|
|
16
|
+
eventId: {
|
|
17
|
+
type: "string"
|
|
18
|
+
},
|
|
19
|
+
production: {
|
|
20
|
+
type: "boolean"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}, I = (e = {}) => {
|
|
24
|
+
const t = y(() => new a(), []), [s, d] = n(
|
|
25
|
+
e.production !== void 0 ? e.production ? "production" : "development" : t.getEnv()
|
|
26
|
+
), [v, i] = n(e.sdkKey || t.getSdkKey() || "set-sdk-key"), [c, r] = n(e.eventId || t.getEvent() || "");
|
|
27
|
+
return o(() => {
|
|
28
|
+
e.sdkKey && (i(e.sdkKey), t.setSdkKey(e.sdkKey));
|
|
29
|
+
}, [e.sdkKey, t]), o(() => {
|
|
30
|
+
e.eventId && (r(e.eventId), t.setEvent(e.eventId));
|
|
31
|
+
}, [e.eventId, t]), o(() => {
|
|
32
|
+
e.production !== void 0 && (d(e.production ? "production" : "development"), t.setEnv(e.production ? "production" : "development"));
|
|
33
|
+
}, [e.production, t]), {
|
|
34
|
+
env: s,
|
|
35
|
+
setEnv: d,
|
|
36
|
+
sdkKey: v,
|
|
37
|
+
setSdkKey: i,
|
|
38
|
+
event: c,
|
|
39
|
+
setEvent: r
|
|
15
40
|
};
|
|
16
|
-
},
|
|
17
|
-
const t =
|
|
18
|
-
return /* @__PURE__ */
|
|
41
|
+
}, b = (e) => {
|
|
42
|
+
const t = m();
|
|
43
|
+
return /* @__PURE__ */ u(k, { sdk: t, ...e });
|
|
19
44
|
};
|
|
20
45
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
46
|
+
b as StreamLayerDebug,
|
|
47
|
+
E as storybookOptions,
|
|
48
|
+
I as useStreamLayerDebug
|
|
23
49
|
};
|