@streamlayer/react-ui 1.9.0 → 1.10.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 +23 -22
- package/lib/app/app/Features/Gamification/index.js +1 -1
- package/lib/app/app/Insight/index.d.ts +2 -0
- package/lib/app/app/Insight/index.js +28 -24
- package/lib/app/app/Navigation/SDKPillNode.d.ts +1 -0
- package/lib/app/app/Navigation/SDKPillNode.js +9 -0
- 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 -86
- 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 +0 -14
- package/lib/app/app/useApp.js +14 -44
- 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/questions/insight/index.js +21 -20
- package/lib/ui/theme/masters-theme.js +36 -13
- package/lib/ui/theme/theme.js +22 -21
- 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
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { styled as s } from "@linaria/react";
|
|
3
|
+
import { useState as p, useEffect as f, useCallback as l } from "react";
|
|
4
|
+
import { CloseTimerAuto as a } from "@streamlayer/sdk-web-types";
|
|
5
|
+
import { SvgIcon as I } from "../icons/index.js";
|
|
6
|
+
import { SimpleTimer as u } from "../timer/index.js";
|
|
7
|
+
const v = /* @__PURE__ */ s("div")({
|
|
8
|
+
name: "CloseIconWrap",
|
|
9
|
+
class: "c3v6bv6",
|
|
10
|
+
propsAsIs: !1
|
|
11
|
+
}), T = /* @__PURE__ */ s("div")({
|
|
12
|
+
name: "TimerWrap",
|
|
13
|
+
class: "teuhmro",
|
|
14
|
+
propsAsIs: !1
|
|
15
|
+
}), g = () => I, x = /* @__PURE__ */ s(g())({
|
|
16
|
+
name: "Icon",
|
|
17
|
+
class: "i17rfxv5",
|
|
18
|
+
propsAsIs: !0
|
|
19
|
+
}), S = ({
|
|
20
|
+
close: r,
|
|
21
|
+
className: t,
|
|
22
|
+
duration: o = 0,
|
|
23
|
+
autoClose: m
|
|
24
|
+
}) => {
|
|
25
|
+
const [c, n] = p(o === 0);
|
|
26
|
+
f(() => {
|
|
27
|
+
n(!o);
|
|
28
|
+
}, [o]);
|
|
29
|
+
const i = l(() => {
|
|
30
|
+
m === a.ENABLED ? r == null || r() : n(!0);
|
|
31
|
+
}, [m, r]);
|
|
32
|
+
return c ? /* @__PURE__ */ e(v, {
|
|
33
|
+
onClick: r,
|
|
34
|
+
className: t,
|
|
35
|
+
children: /* @__PURE__ */ e(x, {
|
|
36
|
+
name: "icon-cross"
|
|
37
|
+
})
|
|
38
|
+
}) : /* @__PURE__ */ e(T, {
|
|
39
|
+
children: /* @__PURE__ */ e(u, {
|
|
40
|
+
duration: o,
|
|
41
|
+
onTimerExpired: i
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
S as CloseButton
|
|
47
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { QuestionType } from '@streamlayer/sdk-web-types';
|
|
1
|
+
import { CloseTimer, QuestionType } from '@streamlayer/sdk-web-types';
|
|
2
2
|
interface VoteHeaderProps {
|
|
3
3
|
type?: QuestionType;
|
|
4
4
|
close: () => void;
|
|
5
5
|
label?: string;
|
|
6
|
+
closeTimer?: CloseTimer;
|
|
6
7
|
}
|
|
7
8
|
export declare const VoteHeader: React.FC<VoteHeaderProps>;
|
|
8
9
|
export {};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as e } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { CloseButton as c } from "../../../close-btn/index.js";
|
|
4
|
+
import { QuestionTypeData as p } from "../../constants.js";
|
|
5
|
+
import { Container as s, QuestionTypeWrap as l, QuestionTypeIcon as m, QuestionTypeTitle as u, CloseIconWrap as C, CloseIcon as f } from "./styles.js";
|
|
6
|
+
const b = ({ type: r, closeTimer: n, close: i, label: d }) => {
|
|
7
|
+
const o = r ? p[r] : { label: d, iconName: void 0 };
|
|
8
|
+
return /* @__PURE__ */ a(s, { children: [
|
|
9
|
+
/* @__PURE__ */ a(l, { children: [
|
|
10
|
+
(o == null ? void 0 : o.iconName) && /* @__PURE__ */ t(
|
|
11
|
+
m,
|
|
11
12
|
{
|
|
12
|
-
"data-type-trivia":
|
|
13
|
-
"data-type-poll":
|
|
13
|
+
"data-type-trivia": r === e.TRIVIA,
|
|
14
|
+
"data-type-poll": r === e.POLL,
|
|
14
15
|
name: o.iconName
|
|
15
16
|
}
|
|
16
17
|
),
|
|
17
|
-
(o == null ? void 0 : o.label) && /* @__PURE__ */
|
|
18
|
+
(o == null ? void 0 : o.label) && /* @__PURE__ */ t(u, { children: o.label })
|
|
18
19
|
] }),
|
|
19
|
-
/* @__PURE__ */ n(
|
|
20
|
+
n != null && n.seconds ? /* @__PURE__ */ t(c, { close: i, autoClose: n.auto, duration: n.seconds }) : /* @__PURE__ */ t(C, { onClick: i, children: /* @__PURE__ */ t(f, { name: "icon-cross" }) })
|
|
20
21
|
] });
|
|
21
22
|
};
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
+
b as VoteHeader
|
|
24
25
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
import { SDKScrollContainer as o } from "../../../app/styles.js";
|
|
2
|
+
import { SDKScrollContainer as o } from "../../../app/app/styles.js";
|
|
3
3
|
import { ShowIn as n } from "../../show-in/index.js";
|
|
4
4
|
const l = /* @__PURE__ */ s("div")({
|
|
5
5
|
name: "Container",
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { QuestionImages as I } from "@streamlayer/sdk-web-types";
|
|
3
|
-
import { VideoPlayer as
|
|
4
|
-
import { Container as
|
|
5
|
-
const
|
|
6
|
-
instantView:
|
|
1
|
+
import { jsxs as g, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { AutoPlayVideo as e, QuestionImages as I } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { VideoPlayer as v } from "../../video-player/index.js";
|
|
4
|
+
import { Container as C, ImageContainer as D, Image as P, Content as b, Title as x, Description as B } from "./styles.js";
|
|
5
|
+
const N = ({
|
|
6
|
+
instantView: o,
|
|
7
7
|
isDetail: l,
|
|
8
|
-
notification:
|
|
9
|
-
controlVideo:
|
|
8
|
+
notification: r,
|
|
9
|
+
controlVideo: y
|
|
10
10
|
}) => {
|
|
11
|
-
const m =
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
(
|
|
14
|
-
|
|
11
|
+
const m = o == null ? void 0 : o.heading, h = o == null ? void 0 : o.body, u = m || h, c = r == null ? void 0 : r.title, p = r == null ? void 0 : r.body;
|
|
12
|
+
return /* @__PURE__ */ g(C, { children: [
|
|
13
|
+
(o == null ? void 0 : o.video) && /* @__PURE__ */ d(
|
|
14
|
+
v,
|
|
15
15
|
{
|
|
16
|
-
source:
|
|
17
|
-
poster:
|
|
18
|
-
controlVideo:
|
|
16
|
+
source: o.video.url,
|
|
17
|
+
poster: o.video.thumbnailUrl,
|
|
18
|
+
controlVideo: y,
|
|
19
|
+
autoPlay: o.autoPlayVideo === e.ENABLED
|
|
19
20
|
}
|
|
20
21
|
),
|
|
21
|
-
(
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
22
|
+
(o == null ? void 0 : o.image) && !(o != null && o.video) && /* @__PURE__ */ d(D, { "data-rounded": o.imageMode === I.ROUNDED, children: /* @__PURE__ */ d(P, { src: o == null ? void 0 : o.image }) }),
|
|
23
|
+
/* @__PURE__ */ g(b, { children: [
|
|
24
|
+
/* @__PURE__ */ d(x, { children: l && u ? m : c }),
|
|
25
|
+
/* @__PURE__ */ d(B, { children: l && u ? h : p })
|
|
25
26
|
] })
|
|
26
27
|
] });
|
|
27
28
|
};
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
N as InsightContent
|
|
30
31
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { breakpoints as
|
|
2
|
-
|
|
1
|
+
import { breakpoints as i } from "./breakpoints.js";
|
|
2
|
+
import { FONT as t } from "./constants.js";
|
|
3
|
+
const E = {
|
|
3
4
|
BG_TRANSPARENT: "rgba(0,0,0, .8)",
|
|
4
5
|
BLUE_QUESTION_ACTION_BTN: "#1589ee",
|
|
5
6
|
WHITE: "#FFFFFF",
|
|
@@ -13,6 +14,7 @@ const a = {
|
|
|
13
14
|
UNSUCCESS: "#DF2F3B",
|
|
14
15
|
SECONDARY_RED1: "#DF2F3B",
|
|
15
16
|
NEUTRALS_WHITE: "#FFFFFF",
|
|
17
|
+
NEUTRALS_WHITE1: "#FFFFFF",
|
|
16
18
|
NEUTRALS_GRAY1: "#F7F7F7",
|
|
17
19
|
NEUTRALS_GRAY2: "#F2F2F1",
|
|
18
20
|
NEUTRALS_GRAY3: "#E8E8E8",
|
|
@@ -22,20 +24,29 @@ const a = {
|
|
|
22
24
|
NEUTRALS_GRAY7: "#6B6F73",
|
|
23
25
|
NEUTRALS_GRAY9: "#25282A"
|
|
24
26
|
}, e = {
|
|
27
|
+
...t,
|
|
25
28
|
REGULAR: "'Benton Sans', BentonSans, Arial, Helvetica, sans-serif",
|
|
26
29
|
SERIF: "'Tiempos', 'Tiempos Text', Times New Roman, serif",
|
|
27
30
|
COLOR: "#fff",
|
|
28
31
|
WEIGHT_DEFAULT: "500"
|
|
29
|
-
},
|
|
30
|
-
${
|
|
31
|
-
--color-${
|
|
32
|
-
`, ""),
|
|
33
|
-
${
|
|
32
|
+
}, R = Object.entries(E).reduce((n, [a, o]) => `
|
|
33
|
+
${n}
|
|
34
|
+
--color-${a.toLowerCase().replaceAll("_", "-")}: ${o};
|
|
35
|
+
`, ""), s = `
|
|
36
|
+
${R}
|
|
34
37
|
--font-family: ${e.REGULAR};
|
|
35
38
|
--font-regular: ${e.REGULAR};
|
|
36
39
|
--font-color: ${e.COLOR};
|
|
37
40
|
--font-serif: ${e.SERIF};
|
|
38
41
|
--font-weight-default: ${e.WEIGHT_DEFAULT};
|
|
42
|
+
--font-weight-default1: ${e.WEIGHT_DEFAULT1};
|
|
43
|
+
--font-weight-default2: ${e.WEIGHT_DEFAULT2};
|
|
44
|
+
--font-weight-default3: ${e.WEIGHT_DEFAULT3};
|
|
45
|
+
--font-size-default: ${t.SIZE_DEFAULT};
|
|
46
|
+
--font-size-secondary: ${t.SIZE_DEFAULT1};
|
|
47
|
+
--font-size-small: ${t.SIZE_DEFAULT2};
|
|
48
|
+
--line-height-default: ${t.LINE_HEIGHT};
|
|
49
|
+
--margin-title-default: ${t.MARGIN_TITLE_DEFAULT};
|
|
39
50
|
|
|
40
51
|
--header-offset: 0px;
|
|
41
52
|
--header-height: 68px;
|
|
@@ -47,18 +58,30 @@ const a = {
|
|
|
47
58
|
--pill-offset: 0px;
|
|
48
59
|
--max-width: 600px;
|
|
49
60
|
--max-notifications-width: 400px;
|
|
61
|
+
--header-padding: 12px 12px 12px 16px;
|
|
62
|
+
--margin-web-link-btn: 0px;
|
|
63
|
+
--padding-web-link-btn: 11px 16px;
|
|
64
|
+
--insight-content-padding: 0px;
|
|
65
|
+
--close-icon-size: 12px;
|
|
66
|
+
--close-icon-stroke-width: 1.5;
|
|
67
|
+
--padding-title-default: 0px;
|
|
68
|
+
--insight-image-display: inline;
|
|
69
|
+
--web-link-align-items: center;
|
|
70
|
+
--web-link-column-gap: 10px;
|
|
50
71
|
|
|
51
|
-
|
|
72
|
+
--insight-image-ratio: 16/9;
|
|
73
|
+
|
|
74
|
+
${i.down("xl")`
|
|
52
75
|
--header-offset: 56px;
|
|
53
76
|
--watch-live-header: 46px;
|
|
54
77
|
`}
|
|
55
78
|
|
|
56
|
-
${
|
|
79
|
+
${i.intermediate("xl", "lg")`
|
|
57
80
|
--header-offset: 76px;
|
|
58
81
|
`}
|
|
59
|
-
`,
|
|
82
|
+
`, r = "m1ojpy2l";
|
|
60
83
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
84
|
+
E as MASTERS_COLORS,
|
|
85
|
+
r as mastersTheme,
|
|
86
|
+
s as mastersThemeStr
|
|
64
87
|
};
|
package/lib/ui/theme/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { breakpoints as d } from "./breakpoints.js";
|
|
3
3
|
import { colors as p, colorsAdvertisement as s, FONT as e } from "./constants.js";
|
|
4
4
|
const l = `
|
|
@@ -13,8 +13,8 @@ const l = `
|
|
|
13
13
|
--font-weight-default2: ${e.WEIGHT_DEFAULT2};
|
|
14
14
|
--font-weight-default3: ${e.WEIGHT_DEFAULT3};
|
|
15
15
|
--font-size-default: ${e.SIZE_DEFAULT};
|
|
16
|
-
--font-size-
|
|
17
|
-
--font-size-
|
|
16
|
+
--font-size-secondary: ${e.SIZE_DEFAULT1};
|
|
17
|
+
--font-size-small: ${e.SIZE_DEFAULT2};
|
|
18
18
|
--line-height-default: ${e.LINE_HEIGHT};
|
|
19
19
|
--margin-title-default: ${e.MARGIN_TITLE_DEFAULT};
|
|
20
20
|
|
|
@@ -22,18 +22,12 @@ const l = `
|
|
|
22
22
|
--header-height: 68px;
|
|
23
23
|
--watch-live-header: 0px;
|
|
24
24
|
--animation-duration: 0.5s;
|
|
25
|
-
--promo-animation-duration: 0.5s;
|
|
26
|
-
--promo-animation-function: ease-in;
|
|
27
25
|
--animation-function: ease;
|
|
28
26
|
--container-padding: 16px;
|
|
29
27
|
--border-radius: 8px;
|
|
30
28
|
--pill-offset: 0px;
|
|
31
29
|
--max-width: 600px;
|
|
32
30
|
--max-notifications-width: 400px;
|
|
33
|
-
--promo-header-line-height: 18.5px;
|
|
34
|
-
--row-gap-default: 12px;
|
|
35
|
-
--row-gap-default1: 12px;
|
|
36
|
-
--row-gap-default2: 16px;
|
|
37
31
|
--header-padding: 12px 12px 12px 16px;
|
|
38
32
|
--margin-web-link-btn: 0px;
|
|
39
33
|
--padding-web-link-btn: 11px 16px;
|
|
@@ -45,6 +39,13 @@ const l = `
|
|
|
45
39
|
--web-link-align-items: center;
|
|
46
40
|
--web-link-column-gap: 10px;
|
|
47
41
|
|
|
42
|
+
--row-gap-default: 12px;
|
|
43
|
+
--row-gap-default1: 12px;
|
|
44
|
+
--row-gap-default2: 16px;
|
|
45
|
+
--promo-header-line-height: 18.5px;
|
|
46
|
+
--promo-animation-duration: 0.5s;
|
|
47
|
+
--promo-animation-function: ease-in;
|
|
48
|
+
|
|
48
49
|
${d.down("xl")`
|
|
49
50
|
--header-offset: 0px;
|
|
50
51
|
--watch-live-header: 46px;
|
|
@@ -86,23 +87,23 @@ const l = `
|
|
|
86
87
|
--adv-sponsor-logo-size: 28px;
|
|
87
88
|
--adv-sponsor-font-size: 12px;
|
|
88
89
|
}
|
|
89
|
-
`, m = "StreamLayerCSSReset",
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
-
children: [/* @__PURE__ */
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
children: [/* @__PURE__ */
|
|
90
|
+
`, m = "StreamLayerCSSReset", c = "ttkj0ah", g = () => /* @__PURE__ */ i("table", {
|
|
91
|
+
children: /* @__PURE__ */ t("table", {
|
|
92
|
+
children: [/* @__PURE__ */ i("thead", {
|
|
93
|
+
children: /* @__PURE__ */ t("tr", {
|
|
94
|
+
children: [/* @__PURE__ */ i("th", {
|
|
94
95
|
children: "name"
|
|
95
|
-
}), /* @__PURE__ */
|
|
96
|
+
}), /* @__PURE__ */ i("th", {
|
|
96
97
|
children: "value"
|
|
97
98
|
})]
|
|
98
99
|
})
|
|
99
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ i("tbody", {
|
|
100
101
|
children: l.split(";").map((n) => {
|
|
101
102
|
const a = n.trim(), [o, r] = a.split(":");
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
children: [/* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ t("tr", {
|
|
104
|
+
children: [/* @__PURE__ */ i("td", {
|
|
104
105
|
children: o
|
|
105
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ i("td", {
|
|
106
107
|
children: r
|
|
107
108
|
})]
|
|
108
109
|
}, a);
|
|
@@ -111,8 +112,8 @@ const l = `
|
|
|
111
112
|
})
|
|
112
113
|
});
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
+
g as ThemeVariables,
|
|
115
116
|
m as resetCss,
|
|
116
|
-
|
|
117
|
+
c as theme,
|
|
117
118
|
l as themeStr
|
|
118
119
|
};
|
package/lib/ui/timer/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ interface TimerProps {
|
|
|
4
4
|
duration?: number;
|
|
5
5
|
onTimerExpired?: () => void;
|
|
6
6
|
}
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const SimpleTimer: React.FC<TimerProps & {
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
8
10
|
export declare const Timer: React.FC<TimerProps>;
|
|
9
11
|
export {};
|
package/lib/ui/timer/index.js
CHANGED
|
@@ -1,45 +1,67 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { CountdownCircleTimer as
|
|
5
|
-
import { TIMER_COLORS as
|
|
6
|
-
const k = [10, 10, 1, 0],
|
|
7
|
-
name: "
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { styled as T } from "@linaria/react";
|
|
3
|
+
import { useState as m, useEffect as d, useCallback as a } from "react";
|
|
4
|
+
import { CountdownCircleTimer as f } from "react-countdown-circle-timer";
|
|
5
|
+
import { TIMER_COLORS as g, TIMER_GREEN as M, TIMER_RED as S, TIMER_GRAY as _ } from "../theme/constants.js";
|
|
6
|
+
const k = [10, 10, 1, 0], u = /* @__PURE__ */ T("div")({
|
|
7
|
+
name: "RemainingTimeCircle",
|
|
8
8
|
class: "r165427",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
}), E = /* @__PURE__ */ T("div")({
|
|
11
|
+
name: "RemainingTime",
|
|
12
|
+
class: "r17garf3",
|
|
13
|
+
propsAsIs: !1
|
|
14
|
+
}), O = M, l = S, R = _, G = ({
|
|
15
|
+
className: o,
|
|
16
|
+
duration: e = 30,
|
|
17
|
+
onTimerExpired: r,
|
|
18
|
+
isPlaying: n = !0
|
|
19
|
+
}) => /* @__PURE__ */ s(f, {
|
|
20
|
+
isPlaying: n,
|
|
21
|
+
strokeWidth: 0,
|
|
22
|
+
duration: e,
|
|
23
|
+
colors: l,
|
|
24
|
+
size: 24,
|
|
25
|
+
onComplete: r,
|
|
26
|
+
children: ({
|
|
27
|
+
remainingTime: i
|
|
28
|
+
}) => /* @__PURE__ */ s(E, {
|
|
29
|
+
className: o,
|
|
30
|
+
children: e === 0 ? 0 : i
|
|
31
|
+
})
|
|
32
|
+
}), L = ({
|
|
33
|
+
isPlaying: o = !0,
|
|
34
|
+
duration: e = 30,
|
|
35
|
+
onTimerExpired: r
|
|
14
36
|
}) => {
|
|
15
|
-
const [
|
|
16
|
-
|
|
17
|
-
|
|
37
|
+
const [n, t] = m(e > 10 ? O : l), [i, C] = m(2);
|
|
38
|
+
d(() => {
|
|
39
|
+
e === 0 && (C(0), t(R));
|
|
40
|
+
}, [e]);
|
|
41
|
+
const p = ({
|
|
42
|
+
remainingTime: c
|
|
43
|
+
}) => /* @__PURE__ */ s(u, {
|
|
44
|
+
children: e === 0 ? 0 : c
|
|
45
|
+
}), h = a(() => {
|
|
46
|
+
r == null || r(), t(R);
|
|
47
|
+
}, [r, t]), I = a((c) => {
|
|
48
|
+
c === 10 && t(l);
|
|
18
49
|
}, [t]);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}), T = n(() => {
|
|
24
|
-
s == null || s(), o(m);
|
|
25
|
-
}, [s, o]), I = n((e) => {
|
|
26
|
-
e === 10 && o(l);
|
|
27
|
-
}, [o]);
|
|
28
|
-
return /* @__PURE__ */ r(h, {
|
|
29
|
-
isPlaying: i,
|
|
30
|
-
duration: t,
|
|
31
|
-
colors: p,
|
|
50
|
+
return /* @__PURE__ */ s(f, {
|
|
51
|
+
isPlaying: o,
|
|
52
|
+
duration: e,
|
|
53
|
+
colors: g,
|
|
32
54
|
colorsTime: k,
|
|
33
55
|
size: 32,
|
|
34
|
-
strokeWidth:
|
|
56
|
+
strokeWidth: i,
|
|
35
57
|
trailStrokeWidth: 2,
|
|
36
|
-
trailColor:
|
|
37
|
-
onComplete:
|
|
58
|
+
trailColor: n,
|
|
59
|
+
onComplete: h,
|
|
38
60
|
onUpdate: I,
|
|
39
|
-
children:
|
|
61
|
+
children: p
|
|
40
62
|
});
|
|
41
63
|
};
|
|
42
64
|
export {
|
|
43
|
-
|
|
65
|
+
G as SimpleTimer,
|
|
44
66
|
L as Timer
|
|
45
67
|
};
|
|
@@ -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
|
};
|