@streamlayer/react-ui 0.96.2 → 0.97.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/hooks/analytics.js +50 -0
- package/lib/index-z0QjLiEL.js +75 -0
- package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
- package/lib/ui/app/Features/FeatureProvider.js +34 -6
- package/lib/ui/app/Features/Gamification/Friends.d.ts +0 -2
- package/lib/ui/app/Features/Gamification/Friends.js +20 -23
- package/lib/ui/app/Features/Gamification/Leaderboard.js +31 -25
- package/lib/ui/app/Features/Gamification/Question.js +4 -2
- package/lib/ui/app/Features/Gamification/QuestionsList.js +11 -8
- package/lib/ui/app/Features/Gamification/Tabs.js +30 -25
- package/lib/ui/app/Features/Gamification/UserSummary.js +14 -12
- package/lib/ui/app/Features/Gamification/gamification-feature.js +6 -2
- package/lib/ui/app/Features/Gamification/index.d.ts +10 -0
- package/lib/ui/app/Features/Gamification/index.js +73 -68
- package/lib/ui/app/Features/index.d.ts +8 -0
- package/lib/ui/app/Features/index.js +112 -16
- package/lib/ui/app/Navigation/MastersNavigation/index.js +5 -4
- package/lib/ui/app/Navigation/index.js +7 -6
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -0
- package/lib/ui/app/Notifications/Onboarding/index.js +76 -78
- package/lib/ui/app/Notifications/index.js +98 -91
- package/lib/ui/app/Points/index.js +20 -17
- package/lib/ui/app/masters.js +167 -86
- package/lib/ui/app/useMastersApp.js +12 -11
- package/lib/ui/app/useSdkFeature.js +13 -16
- package/lib/ui/app/useSdkResponsive.js +1 -1
- package/lib/ui/app/useSdkScroll.d.ts +1 -1
- package/lib/ui/app/useSdkScroll.js +28 -25
- package/lib/ui/gamification/invite-link/index.js +26 -12
- package/lib/ui/gamification/onboarding/index.d.ts +0 -2
- package/lib/ui/gamification/onboarding/index.js +46 -46
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +2 -2
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -20
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +20 -15
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +0 -3
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +34 -29
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.d.ts +0 -3
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +17 -32
- package/lib/ui/gamification/points/index.d.ts +1 -0
- package/lib/ui/gamification/points/index.js +9 -9
- package/lib/ui/gamification/question/index.d.ts +1 -0
- package/lib/ui/gamification/question/index.js +31 -24
- package/lib/ui/gamification/question/insight/index.js +11 -15
- package/lib/ui/gamification/question/list/index.d.ts +3 -1
- package/lib/ui/gamification/question/list/index.js +50 -34
- package/lib/ui/gamification/question/notification/index.js +23 -25
- package/lib/ui/gamification/question/notification/insight/index.js +10 -9
- package/lib/ui/gamification/question/notification/tweet/index.js +3 -2
- package/lib/ui/gamification/question/styles.d.ts +2 -0
- package/lib/ui/gamification/question/styles.js +39 -28
- package/lib/ui/gamification/question/twitter/index.js +14 -18
- package/lib/ui/gamification/user-statistics/index.d.ts +3 -2
- package/lib/ui/gamification/user-statistics/index.js +48 -45
- package/lib/ui/gamification/vote/feedback/index.d.ts +3 -2
- package/lib/ui/gamification/vote/feedback/index.js +74 -58
- package/lib/ui/gamification/vote/feedback/styles.d.ts +2 -0
- package/lib/ui/gamification/vote/feedback/styles.js +33 -21
- package/lib/ui/gamification/vote/index.js +94 -83
- package/lib/ui/gamification/vote/insight-details/index.js +7 -6
- package/lib/ui/gamification/vote/twitter-details/index.js +3 -2
- package/lib/ui/gamification/vote/vote-option/index.d.ts +2 -1
- package/lib/ui/gamification/vote/vote-option/index.js +47 -39
- package/lib/ui/icons/index.d.ts +1 -2
- package/lib/ui/icons/index.js +122 -49
- package/lib/ui/modal/index.js +27 -21
- package/lib/ui/navigation/button/Channels.js +6 -5
- package/lib/ui/navigation/button/FeaturedGroups.js +4 -3
- package/lib/ui/navigation/button/LeaderBoard.js +6 -5
- package/lib/ui/navigation/button/index.js +20 -7
- package/lib/ui/navigation/button/styles.d.ts +3 -0
- package/lib/ui/navigation/button/styles.js +9 -6
- package/lib/ui/questions/insight/index.js +16 -16
- package/lib/ui/questions/twitter/index.js +3 -2
- package/lib/ui/show-in/index.d.ts +2 -0
- package/lib/ui/show-in/index.js +24 -14
- package/lib/ui/timer/index.js +32 -28
- package/lib/ui/video-player/index.js +41 -39
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +10 -9
- package/package.json +22 -21
- package/lib/index-keh7OLCY.js +0 -67
package/lib/ui/modal/index.js
CHANGED
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { styled as
|
|
1
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cx as d } from "@linaria/core";
|
|
3
|
+
import { styled as a } from "@linaria/react";
|
|
4
4
|
import { useState as m, useCallback as f, useEffect as l } from "react";
|
|
5
|
-
import { r as
|
|
5
|
+
import { r as i } from "../../index-jRXrW6ie.js";
|
|
6
6
|
import "../../index-uEuzH3jr.js";
|
|
7
|
-
const u = /* @__PURE__ */
|
|
7
|
+
const u = /* @__PURE__ */ a("div")({
|
|
8
8
|
name: "StaticContainer",
|
|
9
9
|
class: "svm502q",
|
|
10
10
|
propsAsIs: !1
|
|
11
|
-
}), p = "fd3gza8",
|
|
11
|
+
}), p = "fd3gza8", y = `
|
|
12
12
|
body {
|
|
13
13
|
overflow: hidden !important;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`, v = `
|
|
16
16
|
.sl-hide-on-modal {
|
|
17
17
|
display: none !important;
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
`, x = `
|
|
20
|
+
.sl-pill-button {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
`, h = (o) => {
|
|
24
|
+
const [e, r] = m(o), t = f(() => r(!1), []);
|
|
25
|
+
return l(() => (o && document.addEventListener("scroll", t), () => {
|
|
22
26
|
document.removeEventListener("scroll", t);
|
|
23
|
-
}), [
|
|
27
|
+
}), [o, t]), l(() => {
|
|
24
28
|
e === !1 && document.removeEventListener("scroll", t);
|
|
25
29
|
}, [e, t]), [e];
|
|
26
|
-
},
|
|
27
|
-
children:
|
|
30
|
+
}, P = ({
|
|
31
|
+
children: o,
|
|
28
32
|
container: e,
|
|
29
|
-
fixedView:
|
|
33
|
+
fixedView: r,
|
|
30
34
|
useContainer: t
|
|
31
35
|
}) => {
|
|
32
|
-
const [s] =
|
|
33
|
-
return e.current ? t ?
|
|
34
|
-
className:
|
|
35
|
-
children: [
|
|
36
|
-
children:
|
|
36
|
+
const [s] = h(r);
|
|
37
|
+
return e.current ? t ? i.createPortal(/* @__PURE__ */ c(u, {
|
|
38
|
+
className: d(s && p),
|
|
39
|
+
children: [o, s && /* @__PURE__ */ n("style", {
|
|
40
|
+
children: y
|
|
37
41
|
}), !s && /* @__PURE__ */ n("style", {
|
|
42
|
+
children: v
|
|
43
|
+
}), /* @__PURE__ */ n("style", {
|
|
38
44
|
children: x
|
|
39
45
|
})]
|
|
40
|
-
}), e.current, "modal-node") :
|
|
46
|
+
}), e.current, "modal-node") : i.createPortal(o, e.current, "modal-node") : null;
|
|
41
47
|
};
|
|
42
48
|
export {
|
|
43
|
-
|
|
49
|
+
P as ModalPortal
|
|
44
50
|
};
|
|
@@ -3,24 +3,25 @@ import { styled as e } from "@linaria/react";
|
|
|
3
3
|
import { SvgIcon as s } from "../../icons/index.js";
|
|
4
4
|
import { Button as c } from "./index.js";
|
|
5
5
|
import "react";
|
|
6
|
+
import "@linaria/core";
|
|
6
7
|
import "./styles.js";
|
|
7
|
-
const
|
|
8
|
+
const r = () => s, a = /* @__PURE__ */ e(r())({
|
|
8
9
|
name: "ButtonIcon",
|
|
9
10
|
class: "b1whzxvd",
|
|
10
11
|
propsAsIs: !0
|
|
11
|
-
}),
|
|
12
|
+
}), B = "channels", I = (n) => {
|
|
12
13
|
var t;
|
|
13
14
|
return /* @__PURE__ */ o(c, {
|
|
14
15
|
...n,
|
|
15
16
|
id: "channels",
|
|
16
17
|
label: "Channels",
|
|
17
|
-
icon: /* @__PURE__ */ o(
|
|
18
|
+
icon: /* @__PURE__ */ o(a, {
|
|
18
19
|
name: "icon-btn-channels",
|
|
19
20
|
"data-selected": (t = n.active) == null ? void 0 : t.toString()
|
|
20
21
|
})
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
I as ChannelsButton,
|
|
26
|
+
B as ChannelsButtonId
|
|
26
27
|
};
|
|
@@ -3,12 +3,13 @@ import { styled as r } from "@linaria/react";
|
|
|
3
3
|
import { SvgIcon as u } from "../../icons/index.js";
|
|
4
4
|
import { Button as n } from "./index.js";
|
|
5
5
|
import "react";
|
|
6
|
+
import "@linaria/core";
|
|
6
7
|
import "./styles.js";
|
|
7
8
|
const s = () => u, a = /* @__PURE__ */ r(s())({
|
|
8
9
|
name: "ButtonIcon",
|
|
9
10
|
class: "b11des7c",
|
|
10
11
|
propsAsIs: !0
|
|
11
|
-
}),
|
|
12
|
+
}), G = "featuredGroups", B = (t) => {
|
|
12
13
|
var o;
|
|
13
14
|
return /* @__PURE__ */ e(n, {
|
|
14
15
|
...t,
|
|
@@ -21,6 +22,6 @@ const s = () => u, a = /* @__PURE__ */ r(s())({
|
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
B as FeaturedGroupsButton,
|
|
26
|
+
G as FeaturedGroupsButtonId
|
|
26
27
|
};
|
|
@@ -3,24 +3,25 @@ import { styled as e } from "@linaria/react";
|
|
|
3
3
|
import { SvgIcon as a } from "../../icons/index.js";
|
|
4
4
|
import { Button as d } from "./index.js";
|
|
5
5
|
import "react";
|
|
6
|
+
import "@linaria/core";
|
|
6
7
|
import "./styles.js";
|
|
7
|
-
const n = () => a,
|
|
8
|
+
const n = () => a, m = /* @__PURE__ */ e(n())({
|
|
8
9
|
name: "ButtonIcon",
|
|
9
10
|
class: "b180jd7l",
|
|
10
11
|
propsAsIs: !0
|
|
11
|
-
}),
|
|
12
|
+
}), u = "leaderboard", I = (o) => {
|
|
12
13
|
var t;
|
|
13
14
|
return /* @__PURE__ */ r(d, {
|
|
14
15
|
...o,
|
|
15
16
|
label: "Leader Board",
|
|
16
17
|
id: "leaderboard",
|
|
17
|
-
icon: /* @__PURE__ */ r(
|
|
18
|
+
icon: /* @__PURE__ */ r(m, {
|
|
18
19
|
name: "icon-btn-leaderboard",
|
|
19
20
|
"data-selected": (t = o.active) == null ? void 0 : t.toString()
|
|
20
21
|
})
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
I as LeaderBoardButton,
|
|
26
|
+
u as LeaderBoardButtonId
|
|
26
27
|
};
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { cx as d } from "@linaria/core";
|
|
3
|
+
import { SButton as s, SelectedButton as u, HoverIconState as p, HoverIconLeaderboardState as h, ButtonIcon as B, ButtonLabel as f } from "./styles.js";
|
|
3
4
|
import "@linaria/react";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const I = ({ disabled: n, active: r, onClick: a, label: c, icon: o, id: t }) => /* @__PURE__ */ e(
|
|
6
|
+
s,
|
|
7
|
+
{
|
|
8
|
+
onClick: a,
|
|
9
|
+
disabled: n,
|
|
10
|
+
className: d(
|
|
11
|
+
r && u,
|
|
12
|
+
!r && (t === "channels" || t === "featuredGroups") && p,
|
|
13
|
+
!r && t === "leaderboard" && h
|
|
14
|
+
),
|
|
15
|
+
children: /* @__PURE__ */ l(m, { children: [
|
|
16
|
+
o && /* @__PURE__ */ e(B, { children: o }),
|
|
17
|
+
/* @__PURE__ */ e(f, { children: c })
|
|
18
|
+
] })
|
|
19
|
+
}
|
|
20
|
+
);
|
|
8
21
|
export {
|
|
9
|
-
|
|
22
|
+
I as Button
|
|
10
23
|
};
|
|
@@ -2,3 +2,6 @@
|
|
|
2
2
|
export declare const SButton: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
3
3
|
export declare const ButtonIcon: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
4
4
|
export declare const ButtonLabel: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
|
|
5
|
+
export declare const SelectedButton: import("@linaria/core").LinariaClassName;
|
|
6
|
+
export declare const HoverIconState: import("@linaria/core").LinariaClassName;
|
|
7
|
+
export declare const HoverIconLeaderboardState: import("@linaria/core").LinariaClassName;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const o = /* @__PURE__ */
|
|
1
|
+
import { styled as t } from "@linaria/react";
|
|
2
|
+
const o = /* @__PURE__ */ t("button")({
|
|
3
3
|
name: "SButton",
|
|
4
4
|
class: "sxxa0c",
|
|
5
5
|
propsAsIs: !1
|
|
6
|
-
}), n = /* @__PURE__ */
|
|
6
|
+
}), n = /* @__PURE__ */ t("span")({
|
|
7
7
|
name: "ButtonIcon",
|
|
8
8
|
class: "b193dcyu",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}), a = /* @__PURE__ */
|
|
10
|
+
}), a = /* @__PURE__ */ t("span")({
|
|
11
11
|
name: "ButtonLabel",
|
|
12
12
|
class: "b40tuix",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
});
|
|
14
|
+
}), e = "s14xk0af", c = "ha3mg7c", r = "h103yr45";
|
|
15
15
|
export {
|
|
16
16
|
n as ButtonIcon,
|
|
17
17
|
a as ButtonLabel,
|
|
18
|
-
|
|
18
|
+
r as HoverIconLeaderboardState,
|
|
19
|
+
c as HoverIconState,
|
|
20
|
+
o as SButton,
|
|
21
|
+
e as SelectedButton
|
|
19
22
|
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { QuestionImages as
|
|
3
|
-
import { VideoPlayer as
|
|
4
|
-
import { Container as
|
|
1
|
+
import { jsxs as g, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionImages as I } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { VideoPlayer as e } from "../../video-player/index.js";
|
|
4
|
+
import { Container as v, ImageContainer as C, Image as b, Content as x, Title as D, Description as T } from "./styles.js";
|
|
5
|
+
import "@linaria/core";
|
|
5
6
|
import "react";
|
|
6
7
|
import "../../icons/index.js";
|
|
7
8
|
import "@linaria/react";
|
|
8
9
|
import "../../video-player/styles.js";
|
|
9
|
-
const
|
|
10
|
-
imageMode: g,
|
|
10
|
+
const R = ({
|
|
11
11
|
instantView: r,
|
|
12
12
|
isDetail: m,
|
|
13
13
|
notification: o,
|
|
14
|
-
controlVideo:
|
|
14
|
+
controlVideo: c
|
|
15
15
|
}) => {
|
|
16
|
-
const l = r == null ? void 0 : r.heading, p = r == null ? void 0 : r.body, h = l || p,
|
|
17
|
-
return /* @__PURE__ */
|
|
16
|
+
const l = r == null ? void 0 : r.heading, p = r == null ? void 0 : r.body, h = l || p, u = o == null ? void 0 : o.title, y = o == null ? void 0 : o.body;
|
|
17
|
+
return /* @__PURE__ */ g(v, { children: [
|
|
18
18
|
(r == null ? void 0 : r.video) && /* @__PURE__ */ d(
|
|
19
|
-
|
|
19
|
+
e,
|
|
20
20
|
{
|
|
21
21
|
source: r.video.url,
|
|
22
22
|
poster: r.video.thumbnailUrl,
|
|
23
|
-
controlVideo:
|
|
23
|
+
controlVideo: c
|
|
24
24
|
}
|
|
25
25
|
),
|
|
26
|
-
(r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ d(
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */ d(
|
|
29
|
-
/* @__PURE__ */ d(
|
|
26
|
+
(r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ d(C, { "data-rounded": r.imageMode === I.ROUNDED, children: /* @__PURE__ */ d(b, { src: r == null ? void 0 : r.image }) }),
|
|
27
|
+
/* @__PURE__ */ g(x, { children: [
|
|
28
|
+
/* @__PURE__ */ d(D, { children: m && h ? l : u }),
|
|
29
|
+
/* @__PURE__ */ d(T, { children: m && h ? p : y })
|
|
30
30
|
] })
|
|
31
31
|
] });
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
R as InsightContent
|
|
35
35
|
};
|
|
@@ -2,13 +2,14 @@ import { jsxs as t, 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
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
|
+
import "@linaria/core";
|
|
5
6
|
import "react";
|
|
6
7
|
import "../../icons/index.js";
|
|
7
8
|
import "@linaria/react";
|
|
8
9
|
import "../../video-player/styles.js";
|
|
9
10
|
import "../../../utils/common.js";
|
|
10
11
|
import "./account/styles.js";
|
|
11
|
-
const R = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), S = (o) => o == null ? void 0 : o.replace(R, ""),
|
|
12
|
+
const R = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), S = (o) => o == null ? void 0 : o.replace(R, ""), K = ({
|
|
12
13
|
image: o,
|
|
13
14
|
body: C,
|
|
14
15
|
account: z,
|
|
@@ -64,5 +65,5 @@ const R = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), S = (o) => o == null ?
|
|
|
64
65
|
] });
|
|
65
66
|
};
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
+
K as TwitterContent
|
|
68
69
|
};
|
package/lib/ui/show-in/index.js
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { styled as
|
|
4
|
-
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { cx as u } from "@linaria/core";
|
|
3
|
+
import { styled as g } from "@linaria/react";
|
|
4
|
+
import { useState as p, useEffect as h } from "react";
|
|
5
|
+
const w = /* @__PURE__ */ g("div")({
|
|
5
6
|
name: "Container",
|
|
6
7
|
class: "c1pgyo67",
|
|
7
8
|
propsAsIs: !1
|
|
8
|
-
}),
|
|
9
|
-
children:
|
|
9
|
+
}), S = "sx17qu6", d = "h1692c5m", v = ({
|
|
10
|
+
children: i,
|
|
10
11
|
style: n,
|
|
11
|
-
className:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
className: r,
|
|
13
|
+
enabled: o = !0,
|
|
14
|
+
replayKey: t,
|
|
15
|
+
hiding: e
|
|
16
|
+
}) => {
|
|
17
|
+
const [m, s] = p(!0), c = o && m, a = o && e;
|
|
18
|
+
return h(() => {
|
|
19
|
+
t !== void 0 && (s(!1), requestAnimationFrame(() => {
|
|
20
|
+
s(!0);
|
|
21
|
+
}));
|
|
22
|
+
}, [t]), /* @__PURE__ */ f(w, {
|
|
23
|
+
style: n,
|
|
24
|
+
className: u(r, c && S, a && d),
|
|
25
|
+
children: i
|
|
26
|
+
});
|
|
27
|
+
};
|
|
18
28
|
export {
|
|
19
|
-
|
|
29
|
+
v as ShowIn
|
|
20
30
|
};
|
package/lib/ui/timer/index.js
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { CountdownCircleTimer as
|
|
5
|
-
import { COLORS as
|
|
6
|
-
const
|
|
2
|
+
import { styled as _ } from "@linaria/react";
|
|
3
|
+
import { useState as c, useEffect as a, useCallback as n } from "react";
|
|
4
|
+
import { CountdownCircleTimer as N } from "react-countdown-circle-timer";
|
|
5
|
+
import { COLORS as t } from "../theme/constants.js";
|
|
6
|
+
const D = [t.PRIMARY_GREEN1, t.SECONDARY_RED1, t.SECONDARY_RED1, t.NEUTRALS_GRAY3], T = [10, 10, 1, 0], Y = /* @__PURE__ */ _("div")({
|
|
7
7
|
name: "RemainingTime",
|
|
8
8
|
class: "r165427",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
11
|
-
isPlaying:
|
|
12
|
-
duration:
|
|
13
|
-
onTimerExpired:
|
|
10
|
+
}), h = t.SECONDARY_GREEN6, l = t.SECONDARY_RED3, m = t.NEUTRALS_GRAY3, G = ({
|
|
11
|
+
isPlaying: i = !0,
|
|
12
|
+
duration: o = 30,
|
|
13
|
+
onTimerExpired: e
|
|
14
14
|
}) => {
|
|
15
|
-
const [
|
|
15
|
+
const [C, s] = c(o > 10 ? h : l), [E, S] = c(2);
|
|
16
|
+
a(() => {
|
|
17
|
+
o === 0 && (S(0), s(m));
|
|
18
|
+
}, [o]);
|
|
19
|
+
const f = ({
|
|
16
20
|
remainingTime: r
|
|
17
|
-
}) => /* @__PURE__ */ R(
|
|
18
|
-
children: r
|
|
19
|
-
}),
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
r === 10 && s(
|
|
21
|
+
}) => /* @__PURE__ */ R(Y, {
|
|
22
|
+
children: o === 0 ? 0 : r
|
|
23
|
+
}), A = n(() => {
|
|
24
|
+
e == null || e(), s(m);
|
|
25
|
+
}, [e, s]), O = n((r) => {
|
|
26
|
+
r === 10 && s(l);
|
|
23
27
|
}, [s]);
|
|
24
|
-
return /* @__PURE__ */ R(
|
|
25
|
-
isPlaying:
|
|
26
|
-
duration:
|
|
27
|
-
colors:
|
|
28
|
-
colorsTime:
|
|
28
|
+
return /* @__PURE__ */ R(N, {
|
|
29
|
+
isPlaying: i,
|
|
30
|
+
duration: o,
|
|
31
|
+
colors: D,
|
|
32
|
+
colorsTime: T,
|
|
29
33
|
size: 32,
|
|
30
|
-
strokeWidth:
|
|
34
|
+
strokeWidth: E,
|
|
31
35
|
trailStrokeWidth: 2,
|
|
32
|
-
trailColor:
|
|
33
|
-
onComplete:
|
|
34
|
-
onUpdate:
|
|
35
|
-
children:
|
|
36
|
+
trailColor: C,
|
|
37
|
+
onComplete: A,
|
|
38
|
+
onUpdate: O,
|
|
39
|
+
children: f
|
|
36
40
|
});
|
|
37
41
|
};
|
|
38
42
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
Y as RemainingTime,
|
|
44
|
+
G as Timer
|
|
41
45
|
};
|
|
@@ -1,69 +1,71 @@
|
|
|
1
|
-
import { jsxs as w, jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as w, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cx as x } from "@linaria/core";
|
|
3
|
+
import { useRef as C, useState as p, useCallback as g, useEffect as v } from "react";
|
|
4
|
+
import { SvgIcon as d } from "../icons/index.js";
|
|
5
|
+
import { Container as E, ToggleIconPause as S, Player as T, Poster as L, Control as j } from "./styles.js";
|
|
5
6
|
import "@linaria/react";
|
|
6
|
-
const
|
|
7
|
+
const k = (s, o) => {
|
|
7
8
|
for (const t of s)
|
|
8
|
-
t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
},
|
|
9
|
+
t.isIntersecting || t.target instanceof HTMLVideoElement && !t.target.paused && (o.unobserve(t.target), t.target.pause());
|
|
10
|
+
}, y = new IntersectionObserver(k, { threshold: 0.5 }), f = /* @__PURE__ */ new Set(), H = (s) => {
|
|
11
|
+
y.observe(s), f.add(s);
|
|
12
|
+
}, u = (s) => {
|
|
13
|
+
y.unobserve(s), f.delete(s);
|
|
14
|
+
}, M = () => {
|
|
14
15
|
for (const s of f)
|
|
15
|
-
s instanceof HTMLVideoElement && !s.paused && (s.pause(),
|
|
16
|
-
},
|
|
17
|
-
const e = C(null), [
|
|
16
|
+
s instanceof HTMLVideoElement && !s.paused && (s.pause(), u(s));
|
|
17
|
+
}, D = ({ poster: s, source: o, controlVideo: t }) => {
|
|
18
|
+
const e = C(null), [a, c] = p(!1), [m, b] = p(!0), P = g(() => {
|
|
18
19
|
t == null || t({ muted: !0 });
|
|
19
|
-
}, [t]),
|
|
20
|
+
}, [t]), i = g(() => {
|
|
20
21
|
t == null || t({ muted: !1 });
|
|
21
|
-
}, [t]),
|
|
22
|
+
}, [t]), h = () => {
|
|
22
23
|
const r = e == null ? void 0 : e.current;
|
|
23
24
|
if (r)
|
|
24
|
-
if (
|
|
25
|
-
r.pause(), e.current &&
|
|
25
|
+
if (a)
|
|
26
|
+
r.pause(), e.current && u(e.current);
|
|
26
27
|
else {
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
28
|
+
const l = e == null ? void 0 : e.current;
|
|
29
|
+
if (!l)
|
|
29
30
|
return;
|
|
30
|
-
|
|
31
|
+
M(), H(l), l.play().catch((O) => console.log(O)), b(!1);
|
|
31
32
|
}
|
|
32
|
-
},
|
|
33
|
+
}, I = () => {
|
|
33
34
|
var r;
|
|
34
|
-
e.current &&
|
|
35
|
+
e.current && u(e.current), (r = e == null ? void 0 : e.current) == null || r.load(), b(!0);
|
|
35
36
|
};
|
|
36
|
-
return
|
|
37
|
-
e.current &&
|
|
38
|
-
}, []),
|
|
37
|
+
return v(() => {
|
|
38
|
+
e.current && u(e.current);
|
|
39
|
+
}, []), v(() => {
|
|
39
40
|
const r = e == null ? void 0 : e.current;
|
|
40
41
|
return () => {
|
|
41
|
-
r && (r.paused ||
|
|
42
|
+
r && (r.paused || i(), u(r));
|
|
42
43
|
};
|
|
43
|
-
}, [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
}, [i]), /* @__PURE__ */ w(E, { onClick: h, className: x(a && S), children: [
|
|
45
|
+
/* @__PURE__ */ n(
|
|
46
|
+
T,
|
|
46
47
|
{
|
|
47
48
|
ref: e,
|
|
48
|
-
src:
|
|
49
|
+
src: o,
|
|
49
50
|
onPlay: () => {
|
|
50
|
-
|
|
51
|
+
P(), c(!0);
|
|
51
52
|
},
|
|
52
53
|
onPause: () => {
|
|
53
|
-
|
|
54
|
+
i(), c(!1);
|
|
54
55
|
},
|
|
55
56
|
onEnded: () => {
|
|
56
|
-
|
|
57
|
+
i(), c(!1), I();
|
|
57
58
|
},
|
|
58
|
-
style: { visibility:
|
|
59
|
+
style: { visibility: m ? "hidden" : "visible" },
|
|
60
|
+
controls: !1,
|
|
59
61
|
playsInline: !0
|
|
60
62
|
}
|
|
61
63
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ n(L, { src: s, style: { visibility: m ? "visible" : "hidden" } }),
|
|
65
|
+
/* @__PURE__ */ n(j, { children: a ? /* @__PURE__ */ n(d, { name: "icon-pause" }) : /* @__PURE__ */ n(d, { name: "icon-play" }) })
|
|
64
66
|
] });
|
|
65
67
|
};
|
|
66
68
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
D as VideoPlayer,
|
|
70
|
+
M as pauseAllVideos
|
|
69
71
|
};
|
|
@@ -3,3 +3,4 @@ export declare const Container: import("@linaria/react").StyledComponent<import(
|
|
|
3
3
|
export declare const Player: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLVideoElement> & import("react").VideoHTMLAttributes<HTMLVideoElement> & Record<never, unknown>>;
|
|
4
4
|
export declare const Poster: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
|
|
5
5
|
export declare const Control: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
6
|
+
export declare const ToggleIconPause: import("@linaria/core").LinariaClassName;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const e = /* @__PURE__ */ s("div")({
|
|
3
3
|
name: "Container",
|
|
4
4
|
class: "c1bgb86j",
|
|
5
5
|
propsAsIs: !1
|
|
6
|
-
}),
|
|
6
|
+
}), a = /* @__PURE__ */ s("video")({
|
|
7
7
|
name: "Player",
|
|
8
8
|
class: "p6703cq",
|
|
9
9
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
10
|
+
}), l = /* @__PURE__ */ s("img")({
|
|
11
11
|
name: "Poster",
|
|
12
12
|
class: "p12ow7zo",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
14
|
+
}), n = /* @__PURE__ */ s("div")({
|
|
15
15
|
name: "Control",
|
|
16
16
|
class: "cdpal9o",
|
|
17
17
|
propsAsIs: !1
|
|
18
|
-
});
|
|
18
|
+
}), r = "t1xke4ml";
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
e as Container,
|
|
21
|
+
n as Control,
|
|
22
|
+
a as Player,
|
|
23
|
+
l as Poster,
|
|
24
|
+
r as ToggleIconPause
|
|
24
25
|
};
|