@streamlayer/react-ui 0.91.1 → 0.93.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-keh7OLCY.js +67 -0
- package/lib/index.js +5 -4
- package/lib/ui/app/Features/Gamification/Friends.d.ts +2 -1
- package/lib/ui/app/Features/Gamification/Friends.js +6 -6
- package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +3 -2
- package/lib/ui/app/Features/Gamification/Leaderboard.js +26 -24
- package/lib/ui/app/Features/Gamification/Question.js +1 -1
- package/lib/ui/app/Features/Gamification/Tabs.d.ts +7 -2
- package/lib/ui/app/Features/Gamification/Tabs.js +42 -31
- package/lib/ui/app/Features/Gamification/gamification-feature.js +5 -2
- package/lib/ui/app/Features/Gamification/index.d.ts +6 -2
- package/lib/ui/app/Features/Gamification/index.js +86 -45
- package/lib/ui/app/Features/index.d.ts +6 -2
- package/lib/ui/app/Features/index.js +13 -11
- package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +3 -2
- package/lib/ui/app/Navigation/MastersNavigation/index.js +37 -31
- package/lib/ui/app/Navigation/index.js +6 -7
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -1
- package/lib/ui/app/Notifications/Onboarding/index.js +91 -73
- package/lib/ui/app/Notifications/index.d.ts +6 -2
- package/lib/ui/app/Notifications/index.js +120 -91
- package/lib/ui/app/Points/index.js +6 -5
- package/lib/ui/app/masters.d.ts +7 -0
- package/lib/ui/app/masters.js +73 -51
- package/lib/ui/app/styles.d.ts +1 -0
- package/lib/ui/app/styles.js +6 -1
- package/lib/ui/app/useClipboardCopy.d.ts +2 -1
- package/lib/ui/app/useImagesPreload.d.ts +4 -0
- package/lib/ui/app/useImagesPreload.js +23 -0
- package/lib/ui/app/useMastersApp.js +15 -14
- package/lib/ui/app/useSdkResponsive.d.ts +14 -0
- package/lib/ui/app/useSdkResponsive.js +46 -0
- package/lib/ui/app/useSdkScroll.d.ts +4 -1
- package/lib/ui/app/useSdkScroll.js +36 -85
- package/lib/ui/gamification/detail/header/index.js +11 -11
- package/lib/ui/gamification/detail/header/styles.d.ts +1 -1
- package/lib/ui/gamification/detail/header/styles.js +11 -11
- package/lib/ui/gamification/leaderboard/static.d.ts +2 -1
- package/lib/ui/gamification/onboarding/index.d.ts +5 -0
- package/lib/ui/gamification/onboarding/index.js +69 -42
- package/lib/ui/gamification/onboarding/invitingUser/index.d.ts +7 -0
- package/lib/ui/gamification/onboarding/invitingUser/index.js +16 -0
- package/lib/ui/gamification/onboarding/invitingUser/styles.d.ts +5 -0
- package/lib/ui/gamification/onboarding/invitingUser/styles.js +24 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +15 -13
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +9 -9
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +2 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +1 -1
- package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.d.ts +2 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +18 -12
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.d.ts +7 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/index.js +10 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.d.ts +5 -0
- package/lib/ui/gamification/onboarding/slides/onboarding-terms/styles.js +24 -0
- package/lib/ui/gamification/points/index.js +5 -4
- package/lib/ui/gamification/question/insight/index.js +5 -5
- package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +17 -17
- package/lib/ui/gamification/question/notification/prediction-result/index.js +37 -39
- package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +1 -1
- package/lib/ui/gamification/question/notification/prediction-result/styles.js +12 -12
- package/lib/ui/gamification/vote/index.js +55 -54
- package/lib/ui/gamification/vote/insight-details/index.js +1 -1
- package/lib/ui/gamification/vote/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/styles.js +17 -11
- package/lib/ui/gamification/vote/vote-option/index.js +62 -58
- package/lib/ui/gamification/vote/win-bar/index.d.ts +1 -0
- package/lib/ui/gamification/vote/win-bar/index.js +21 -20
- package/lib/ui/navigation/button/LeaderBoard.js +5 -6
- package/lib/ui/navigation/index.js +6 -7
- package/lib/ui/navigation/masters.d.ts +2 -1
- package/lib/ui/navigation/masters.js +9 -6
- package/lib/ui/questions/insight/index.d.ts +1 -1
- package/lib/ui/questions/insight/index.js +18 -25
- package/lib/ui/skeleton/index.d.ts +7 -0
- package/lib/ui/skeleton/index.js +7 -0
- package/lib/ui/skeleton/styles.d.ts +2 -0
- package/lib/ui/skeleton/styles.js +9 -0
- package/lib/ui/theme/breakpoints.d.ts +4 -1
- package/lib/ui/theme/breakpoints.js +24 -12
- package/lib/ui/theme/constants.d.ts +4 -0
- package/lib/ui/theme/constants.js +6 -2
- package/lib/ui/theme/index.js +4 -3
- package/lib/ui/theme/theme.js +29 -21
- package/lib/utils/createDemo.js +12 -13
- package/lib/utils/debug/components/copyLogs.js +10 -9
- package/lib/utils/decorators/container.js +4 -3
- package/package.json +18 -18
- package/lib/LeaderBoard_fzzlxb-w40geAFS.js +0 -1
- package/lib/index_ej4hfx-w40geAFS.js +0 -1
- package/lib/masters_m6itlr-w40geAFS.js +0 -1
- package/lib/utils/useStreamLayerApp.js +0 -25
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useLayoutEffect as j } from "react";
|
|
3
|
+
import { QuestionImages as a, QuestionType as o, QuestionStatus as S } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { AnimatedCounter as U } from "../../../animated-counter/index.js";
|
|
5
|
+
import { IconDefault as $, IconContainer as y, IconWrap as F, IconCircle as M, ButtonContainer as W, ButtonPct as z, ButtonBody as G, Title as H, Pts as J, Indicators as K, CheckIcon as X, Percentage as Y } from "./styles.js";
|
|
5
6
|
import "react-countup";
|
|
6
7
|
import "@linaria/react";
|
|
7
8
|
import "../../../icons/index.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[a.
|
|
11
|
-
[a.
|
|
12
|
-
[a.ROUNDED]: (t) => /* @__PURE__ */ e(j, { alt: "option-icon", src: t }),
|
|
9
|
+
const I = {
|
|
10
|
+
[a.CENTERED]: (t) => /* @__PURE__ */ n($, { alt: "option-icon", src: t }),
|
|
11
|
+
[a.TRANSPARENT]: (t) => /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(F, { style: { backgroundImage: `url(${t})` } }) }),
|
|
12
|
+
[a.ROUNDED]: (t) => /* @__PURE__ */ n(M, { alt: "option-icon", src: t }),
|
|
13
13
|
[a.NONE]: () => null,
|
|
14
14
|
[a.UNSET]: () => null
|
|
15
|
-
},
|
|
16
|
-
if (t ===
|
|
15
|
+
}, Z = ({ questionType: t, hasCorrectAnswer: c, correct: r, youVoted: i, questionVoted: e }) => {
|
|
16
|
+
if (t === o.POLL && i)
|
|
17
17
|
return "correct";
|
|
18
|
-
if (t ===
|
|
19
|
-
if (c &&
|
|
20
|
-
return
|
|
21
|
-
if (
|
|
18
|
+
if (t === o.PREDICTION) {
|
|
19
|
+
if (c && e)
|
|
20
|
+
return i ? r ? "correct" : "incorrect" : "unset";
|
|
21
|
+
if (i)
|
|
22
22
|
return "correct";
|
|
23
23
|
}
|
|
24
|
-
return t ===
|
|
25
|
-
},
|
|
24
|
+
return t === o.TRIVIA && e && i ? r ? "correct" : "incorrect" : "unset";
|
|
25
|
+
}, _ = ({
|
|
26
26
|
questionType: t,
|
|
27
27
|
questionVoted: c,
|
|
28
|
-
correct:
|
|
29
|
-
hasCorrectAnswer:
|
|
30
|
-
questionStatus:
|
|
31
|
-
}) => t ===
|
|
32
|
-
var
|
|
28
|
+
correct: r,
|
|
29
|
+
hasCorrectAnswer: i,
|
|
30
|
+
questionStatus: e
|
|
31
|
+
}) => t === o.TRIVIA ? c && r : t === o.PREDICTION ? c && r && i || e === S.RESOLVED && r : !1, st = (t) => {
|
|
32
|
+
var N;
|
|
33
33
|
const {
|
|
34
34
|
// option props
|
|
35
35
|
id: c,
|
|
36
|
-
icon:
|
|
37
|
-
text:
|
|
38
|
-
percentageDecimal:
|
|
39
|
-
points:
|
|
36
|
+
icon: r,
|
|
37
|
+
text: i,
|
|
38
|
+
percentageDecimal: e,
|
|
39
|
+
points: T,
|
|
40
40
|
// extra props
|
|
41
|
-
onVote:
|
|
42
|
-
markThatVoted:
|
|
43
|
-
youSelected:
|
|
41
|
+
onVote: A,
|
|
42
|
+
markThatVoted: D,
|
|
43
|
+
youSelected: h,
|
|
44
44
|
questionVoted: s,
|
|
45
|
-
imageMode:
|
|
45
|
+
imageMode: E,
|
|
46
46
|
answerTimeExpired: w,
|
|
47
|
-
questionStatus:
|
|
48
|
-
isLoading:
|
|
47
|
+
questionStatus: C,
|
|
48
|
+
isLoading: O,
|
|
49
49
|
questionType: d,
|
|
50
|
-
correct:
|
|
50
|
+
correct: g,
|
|
51
51
|
hasCorrectAnswer: k,
|
|
52
|
-
votedAfterQuestionClosed:
|
|
53
|
-
enteredAnActiveQuestion:
|
|
54
|
-
marketClosed:
|
|
55
|
-
} = t,
|
|
56
|
-
return
|
|
57
|
-
|
|
52
|
+
votedAfterQuestionClosed: x,
|
|
53
|
+
enteredAnActiveQuestion: P,
|
|
54
|
+
marketClosed: l
|
|
55
|
+
} = t, [L, p] = b(e), m = Z(t), v = _({ questionType: d, questionVoted: s, correct: g, hasCorrectAnswer: k, questionStatus: C }), f = l && d === o.PREDICTION, R = s || f, Q = d === o.PREDICTION && !s && !l, B = s && !h && m !== "incorrect";
|
|
56
|
+
return j(() => {
|
|
57
|
+
e > 0 && (p(0), requestAnimationFrame(() => {
|
|
58
|
+
p(e);
|
|
59
|
+
}));
|
|
60
|
+
}, [e]), /* @__PURE__ */ u(
|
|
61
|
+
W,
|
|
58
62
|
{
|
|
59
63
|
value: c,
|
|
60
|
-
"data-selected":
|
|
61
|
-
"data-answer-state":
|
|
62
|
-
disabled: s ||
|
|
63
|
-
"data-is-not-checked":
|
|
64
|
-
onClick: (
|
|
65
|
-
|
|
66
|
-
d ===
|
|
67
|
-
),
|
|
64
|
+
"data-selected": h,
|
|
65
|
+
"data-answer-state": m,
|
|
66
|
+
disabled: s || O || w || f && !P || f && P && x,
|
|
67
|
+
"data-is-not-checked": B,
|
|
68
|
+
onClick: (V) => {
|
|
69
|
+
D(
|
|
70
|
+
d === o.PREDICTION ? l : C === S.RESOLVED
|
|
71
|
+
), A(V);
|
|
68
72
|
},
|
|
69
73
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ n(z, { "data-answer-state": m, style: { width: `${R ? L : 0}%` } }),
|
|
75
|
+
/* @__PURE__ */ u(G, { children: [
|
|
76
|
+
r && E && ((N = I[E]) == null ? void 0 : N.call(I, r)),
|
|
77
|
+
/* @__PURE__ */ n(H, { children: i }),
|
|
78
|
+
Q && /* @__PURE__ */ u("div", { children: [
|
|
79
|
+
T,
|
|
80
|
+
/* @__PURE__ */ n(J, { children: "pts" })
|
|
77
81
|
] }),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */
|
|
82
|
+
R && /* @__PURE__ */ u(K, { children: [
|
|
83
|
+
v && /* @__PURE__ */ n(X, { name: "selected" }),
|
|
84
|
+
/* @__PURE__ */ n(Y, { children: /* @__PURE__ */ n(U, { value: e, suffix: "%" }) })
|
|
81
85
|
] })
|
|
82
86
|
] })
|
|
83
87
|
]
|
|
@@ -85,5 +89,5 @@ const f = {
|
|
|
85
89
|
);
|
|
86
90
|
};
|
|
87
91
|
export {
|
|
88
|
-
|
|
92
|
+
st as VotingOption
|
|
89
93
|
};
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsxs as i, jsx as r, Fragment as
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import { AnimatedCounter as
|
|
4
|
-
import { Timer as
|
|
5
|
-
import { WinBarContainer as
|
|
1
|
+
import { jsxs as i, jsx as r, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { QuestionType as o } from "@streamlayer/sdk-web-types";
|
|
3
|
+
import { AnimatedCounter as s } from "../../../animated-counter/index.js";
|
|
4
|
+
import { Timer as h } from "../../../timer/index.js";
|
|
5
|
+
import { WinBarContainer as P, Content as C, Title as f, WinIcon as u, Points as I, PointsCount as y, PointsUnits as T } from "./styles.js";
|
|
6
6
|
import "react-countup";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "react";
|
|
9
9
|
import "react-countdown-circle-timer";
|
|
10
10
|
import "../../../theme/constants.js";
|
|
11
11
|
import "../../../icons/index.js";
|
|
12
|
-
const
|
|
13
|
-
title:
|
|
14
|
-
points:
|
|
12
|
+
const R = ({
|
|
13
|
+
title: e,
|
|
14
|
+
points: n,
|
|
15
15
|
isPlayingTimer: m,
|
|
16
16
|
isTimer: c,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
e
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
17
|
+
animatePoints: a,
|
|
18
|
+
questionType: t,
|
|
19
|
+
timerDuration: d,
|
|
20
|
+
onTimerExpired: l
|
|
21
|
+
}) => /* @__PURE__ */ i(P, { style: { justifyContent: t === o.PREDICTION ? "center" : "space-between" }, children: [
|
|
22
|
+
/* @__PURE__ */ i(C, { children: [
|
|
23
|
+
e && /* @__PURE__ */ r(f, { children: e }),
|
|
24
|
+
n !== void 0 && t !== o.POLL && /* @__PURE__ */ i(p, { children: [
|
|
25
|
+
/* @__PURE__ */ r(u, { name: "icon-trophy" }),
|
|
26
|
+
/* @__PURE__ */ i(I, { children: [
|
|
27
|
+
/* @__PURE__ */ r(y, { children: a ? /* @__PURE__ */ r(s, { value: n, delay: 0.3 }) : n }),
|
|
27
28
|
/* @__PURE__ */ r(T, { children: "PTS" })
|
|
28
29
|
] })
|
|
29
30
|
] })
|
|
30
31
|
] }),
|
|
31
|
-
c &&
|
|
32
|
+
c && t !== o.PREDICTION && /* @__PURE__ */ r(h, { isPlaying: m, onTimerExpired: l, duration: d })
|
|
32
33
|
] });
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
R as WinBar
|
|
35
36
|
};
|
|
@@ -2,26 +2,25 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
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
|
-
import "../../../LeaderBoard_fzzlxb-w40geAFS.js";
|
|
6
5
|
import "react";
|
|
7
6
|
import "./styles.js";
|
|
8
|
-
const n = () => a,
|
|
7
|
+
const n = () => a, c = /* @__PURE__ */ e(n())({
|
|
9
8
|
name: "ButtonIcon",
|
|
10
9
|
class: "b180jd7l",
|
|
11
10
|
propsAsIs: !0
|
|
12
|
-
}),
|
|
11
|
+
}), b = "leaderboard", u = (o) => {
|
|
13
12
|
var t;
|
|
14
13
|
return /* @__PURE__ */ r(d, {
|
|
15
14
|
...o,
|
|
16
15
|
label: "Leader Board",
|
|
17
16
|
id: "leaderboard",
|
|
18
|
-
icon: /* @__PURE__ */ r(
|
|
17
|
+
icon: /* @__PURE__ */ r(c, {
|
|
19
18
|
name: "icon-btn-leaderboard",
|
|
20
19
|
"data-selected": (t = o.active) == null ? void 0 : t.toString()
|
|
21
20
|
})
|
|
22
21
|
});
|
|
23
22
|
};
|
|
24
23
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
u as LeaderBoardButton,
|
|
25
|
+
b as LeaderBoardButtonId
|
|
27
26
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { styled as r } from "@linaria/react";
|
|
3
|
-
import "../../index_ej4hfx-w40geAFS.js";
|
|
4
3
|
const n = /* @__PURE__ */ r("div")({
|
|
5
4
|
name: "Buttons",
|
|
6
5
|
class: "b6tbwuy",
|
|
7
6
|
propsAsIs: !1
|
|
8
|
-
}),
|
|
7
|
+
}), i = ({
|
|
9
8
|
children: t,
|
|
10
|
-
className:
|
|
11
|
-
}) => /* @__PURE__ */
|
|
12
|
-
className:
|
|
9
|
+
className: s
|
|
10
|
+
}) => /* @__PURE__ */ o(n, {
|
|
11
|
+
className: s,
|
|
13
12
|
children: t
|
|
14
13
|
});
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
i as Navigation
|
|
17
16
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const Navigation: import("@linaria/react").
|
|
2
|
+
export declare const Navigation: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
|
+
export declare const NavigationItems: import("@linaria/react").WYWEvalMeta & import("react").FC<{
|
|
3
4
|
children: import("react").ReactElement<import("./button").ButtonProps, string | import("react").JSXElementConstructor<any>>[];
|
|
4
5
|
className?: string | undefined;
|
|
5
6
|
}>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
import { Navigation as
|
|
3
|
-
import "../../masters_m6itlr-w40geAFS.js";
|
|
1
|
+
import { styled as a } from "@linaria/react";
|
|
2
|
+
import { Navigation as s } from "./index.js";
|
|
4
3
|
import "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
const i = () => t, n = /* @__PURE__ */ o(i())({
|
|
4
|
+
const p = /* @__PURE__ */ a("div")({
|
|
7
5
|
name: "Navigation",
|
|
8
6
|
class: "n19lpak2",
|
|
7
|
+
propsAsIs: !1
|
|
8
|
+
}), o = () => s, e = /* @__PURE__ */ a(o())({
|
|
9
|
+
name: "NavigationItems",
|
|
10
|
+
class: "n1w473c2",
|
|
9
11
|
propsAsIs: !0
|
|
10
12
|
});
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
p as Navigation,
|
|
15
|
+
e as NavigationItems
|
|
13
16
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { InsightHistory, FeedItem } from '@streamlayer/sdk-web-types';
|
|
3
3
|
export type InsightContentProps = InsightHistory & {
|
|
4
4
|
created?: FeedItem['created'];
|
|
5
|
-
|
|
5
|
+
isDetail?: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const InsightContent: React.FC<InsightContentProps>;
|
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
import { jsxs as e, jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { VideoPlayer as
|
|
4
|
-
import { isValidDate as
|
|
5
|
-
import { Container as C, DateWrap as
|
|
1
|
+
import { jsxs as e, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as T } from "react";
|
|
3
|
+
import { VideoPlayer as v } from "../../video-player/index.js";
|
|
4
|
+
import { isValidDate as b, formatDate as f, formatTime as x } from "../../../utils/common.js";
|
|
5
|
+
import { Container as C, DateWrap as I, Image as j, Content as B, Title as M, Description as P } from "./styles.js";
|
|
6
6
|
import "../../icons/index.js";
|
|
7
7
|
import "@linaria/react";
|
|
8
8
|
import "../../video-player/styles.js";
|
|
9
|
-
const G = ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
instantView: r,
|
|
15
|
-
notification: d
|
|
16
|
-
}) => {
|
|
17
|
-
const l = g(() => {
|
|
18
|
-
if (m) {
|
|
19
|
-
const p = new Date(m);
|
|
20
|
-
if (v(p))
|
|
9
|
+
const G = ({ created: d, instantView: r, isDetail: h, notification: o }) => {
|
|
10
|
+
const l = T(() => {
|
|
11
|
+
if (d) {
|
|
12
|
+
const p = new Date(d);
|
|
13
|
+
if (b(p))
|
|
21
14
|
return {
|
|
22
|
-
date:
|
|
15
|
+
date: f(p),
|
|
23
16
|
time: x(p)
|
|
24
17
|
};
|
|
25
18
|
}
|
|
26
19
|
return null;
|
|
27
|
-
}, [
|
|
20
|
+
}, [d]), u = r == null ? void 0 : r.heading, c = r == null ? void 0 : r.body, g = u || c, y = o == null ? void 0 : o.title, D = o == null ? void 0 : o.body;
|
|
28
21
|
return /* @__PURE__ */ e(C, { children: [
|
|
29
|
-
l && /* @__PURE__ */ e(
|
|
22
|
+
l && /* @__PURE__ */ e(I, { children: [
|
|
30
23
|
l.date,
|
|
31
24
|
" · ",
|
|
32
25
|
l.time
|
|
33
26
|
] }),
|
|
34
|
-
(r == null ? void 0 : r.video) && /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */ e(
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
27
|
+
(r == null ? void 0 : r.video) && /* @__PURE__ */ m(v, { source: r.video.url, poster: r.video.thumbnailUrl }),
|
|
28
|
+
(r == null ? void 0 : r.image) && !(r != null && r.video) && /* @__PURE__ */ m(j, { src: r == null ? void 0 : r.image }),
|
|
29
|
+
/* @__PURE__ */ e(B, { children: [
|
|
30
|
+
/* @__PURE__ */ m(M, { children: h && g ? u : y }),
|
|
31
|
+
/* @__PURE__ */ m(P, { children: h && g ? c : D })
|
|
39
32
|
] })
|
|
40
33
|
] });
|
|
41
34
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { BREAKPOINTS } from './constants';
|
|
1
|
+
import { BREAKPOINTS, ORIENTATION } from './constants';
|
|
2
2
|
export type Breakpoints = keyof typeof BREAKPOINTS;
|
|
3
|
+
export type Orientation = keyof typeof ORIENTATION;
|
|
3
4
|
export declare const breakpoints: {
|
|
4
5
|
up: (key: Breakpoints) => (styles: TemplateStringsArray) => string;
|
|
5
6
|
down: (key: Breakpoints) => (styles: TemplateStringsArray) => string;
|
|
7
|
+
intermediate: (down: Breakpoints, up: Breakpoints) => (styles: TemplateStringsArray) => string;
|
|
8
|
+
orientation: (key: Orientation) => (styles: TemplateStringsArray) => string;
|
|
6
9
|
};
|
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
import { BREAKPOINTS as e } from "./constants.js";
|
|
2
|
-
const
|
|
3
|
-
@media (${
|
|
4
|
-
${
|
|
1
|
+
import { BREAKPOINTS as e, ORIENTATION as a } from "./constants.js";
|
|
2
|
+
const r = (n) => (t) => `
|
|
3
|
+
@media only screen and (${n}) {
|
|
4
|
+
${t}
|
|
5
5
|
}
|
|
6
|
-
`,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
`, d = (n, t) => (i) => `
|
|
7
|
+
@media only screen and (${n}) and (${t}) {
|
|
8
|
+
${i}
|
|
9
|
+
}
|
|
10
|
+
`, s = {
|
|
11
|
+
up: (n) => {
|
|
12
|
+
const t = e[n];
|
|
13
|
+
return r(`min-width: ${t}px`);
|
|
14
|
+
},
|
|
15
|
+
down: (n) => {
|
|
16
|
+
const t = e[n] - 1;
|
|
17
|
+
return r(`max-width: ${t}px`);
|
|
18
|
+
},
|
|
19
|
+
intermediate: (n, t) => {
|
|
20
|
+
const i = e[n] - 1, o = e[t];
|
|
21
|
+
return d(`max-width: ${i}px`, `min-width: ${o}px`);
|
|
10
22
|
},
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
return
|
|
23
|
+
orientation: (n) => {
|
|
24
|
+
const t = a[n];
|
|
25
|
+
return r(`orientation: ${t}`);
|
|
14
26
|
}
|
|
15
27
|
};
|
|
16
28
|
export {
|
|
17
|
-
|
|
29
|
+
s as breakpoints
|
|
18
30
|
};
|
|
@@ -60,7 +60,10 @@ const N = {
|
|
|
60
60
|
lg: 992,
|
|
61
61
|
xl: 1200,
|
|
62
62
|
xxl: 1400
|
|
63
|
-
}, G =
|
|
63
|
+
}, G = {
|
|
64
|
+
landscape: "landscape",
|
|
65
|
+
portrait: "portrait"
|
|
66
|
+
}, B = Object.keys(E).reduce((A, R) => {
|
|
64
67
|
const _ = E[R];
|
|
65
68
|
return `
|
|
66
69
|
${A}
|
|
@@ -72,5 +75,6 @@ export {
|
|
|
72
75
|
E as COLORS,
|
|
73
76
|
S as FONT,
|
|
74
77
|
T as MASTERS_COLORS,
|
|
75
|
-
G as
|
|
78
|
+
G as ORIENTATION,
|
|
79
|
+
B as colors
|
|
76
80
|
};
|
package/lib/ui/theme/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { theme as
|
|
2
|
+
import { theme as o } from "./theme.js";
|
|
3
|
+
import "./breakpoints.js";
|
|
3
4
|
import "./constants.js";
|
|
4
|
-
const
|
|
5
|
+
const p = ({ children: r, style: m }) => /* @__PURE__ */ e("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ e("div", { className: o, style: m, children: r }) });
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
p as StreamLayerThemeProvider
|
|
7
8
|
};
|
package/lib/ui/theme/theme.js
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
--font-
|
|
7
|
-
--font-
|
|
8
|
-
--font-
|
|
9
|
-
--font-
|
|
1
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { breakpoints as d } from "./breakpoints.js";
|
|
3
|
+
import { colors as s, FONT as e } from "./constants.js";
|
|
4
|
+
const h = `
|
|
5
|
+
${s}
|
|
6
|
+
--font-family: ${e.REGULAR};
|
|
7
|
+
--font-regular: ${e.REGULAR};
|
|
8
|
+
--font-color: ${e.COLOR};
|
|
9
|
+
--font-serif: ${e.SERIF};
|
|
10
|
+
--font-weight-default: ${e.WEIGHT_DEFAULT};
|
|
10
11
|
|
|
12
|
+
--header-offset: 0px;
|
|
11
13
|
--header-height: 68px;
|
|
12
14
|
--animation-duration: 0.5s;
|
|
13
15
|
--animation-function: ease;
|
|
14
16
|
--container-padding: 16px;
|
|
15
17
|
--border-radius: 8px;
|
|
16
18
|
--pill-offset: 0px;
|
|
17
|
-
|
|
19
|
+
--max-width: 600px;
|
|
20
|
+
--max-notifications-width: 400px;
|
|
21
|
+
|
|
22
|
+
${d.down("xl")`
|
|
23
|
+
--header-offset: 56px;
|
|
24
|
+
`}
|
|
25
|
+
`, m = "StreamLayerCSSReset", p = "ttkj0ah", x = () => /* @__PURE__ */ t("table", {
|
|
18
26
|
children: /* @__PURE__ */ r("table", {
|
|
19
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ t("thead", {
|
|
20
28
|
children: /* @__PURE__ */ r("tr", {
|
|
21
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ t("th", {
|
|
22
30
|
children: "name"
|
|
23
|
-
}), /* @__PURE__ */
|
|
31
|
+
}), /* @__PURE__ */ t("th", {
|
|
24
32
|
children: "value"
|
|
25
33
|
})]
|
|
26
34
|
})
|
|
27
|
-
}), /* @__PURE__ */
|
|
28
|
-
children:
|
|
35
|
+
}), /* @__PURE__ */ t("tbody", {
|
|
36
|
+
children: h.split(";").map((i) => {
|
|
29
37
|
const n = i.trim(), [o, a] = n.split(":");
|
|
30
38
|
return /* @__PURE__ */ r("tr", {
|
|
31
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ t("td", {
|
|
32
40
|
children: o
|
|
33
|
-
}), /* @__PURE__ */
|
|
41
|
+
}), /* @__PURE__ */ t("td", {
|
|
34
42
|
children: a
|
|
35
43
|
})]
|
|
36
44
|
}, n);
|
|
@@ -39,8 +47,8 @@ const s = `
|
|
|
39
47
|
})
|
|
40
48
|
});
|
|
41
49
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
x as ThemeVariables,
|
|
51
|
+
m as resetCss,
|
|
52
|
+
p as theme,
|
|
53
|
+
h as themeStr
|
|
46
54
|
};
|