@streamlayer/react-ui 0.93.0 → 0.95.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/{useClipboardCopy-E5rEe6It.js → index-jRXrW6ie.js} +1513 -1537
- package/lib/ui/app/Features/Gamification/Friends.js +6 -5
- package/lib/ui/app/Features/Gamification/Leaderboard.js +4 -3
- package/lib/ui/app/Features/Gamification/Question.js +19 -21
- package/lib/ui/app/Features/Gamification/QuestionsList.js +1 -1
- package/lib/ui/app/Features/Gamification/Tabs.js +36 -37
- package/lib/ui/app/Features/Gamification/gamification-feature.js +12 -10
- package/lib/ui/app/Features/Gamification/index.js +73 -89
- package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +3 -0
- package/lib/ui/app/Navigation/MastersNavigation/index.js +43 -35
- package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
- package/lib/ui/app/Notifications/Onboarding/index.js +97 -80
- package/lib/ui/app/Notifications/index.js +114 -112
- package/lib/ui/app/masters.js +48 -40
- package/lib/ui/app/useClipboardCopy.js +26 -5
- package/lib/ui/app/useMastersApp.js +42 -35
- package/lib/ui/app/useSdkResponsive.d.ts +1 -1
- package/lib/ui/app/useSdkResponsive.js +25 -25
- package/lib/ui/app/useSdkScroll.js +16 -15
- package/lib/ui/gamification/onboarding/index.d.ts +1 -1
- package/lib/ui/gamification/onboarding/index.js +11 -10
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +14 -13
- package/lib/ui/gamification/question/insight/index.js +3 -4
- package/lib/ui/gamification/question/list/index.js +14 -14
- package/lib/ui/gamification/question/notification/index.js +3 -2
- package/lib/ui/gamification/question/notification/insight/index.d.ts +5 -3
- package/lib/ui/gamification/question/notification/insight/index.js +12 -17
- package/lib/ui/gamification/question/notification/insight/styles.d.ts +1 -0
- package/lib/ui/gamification/question/notification/insight/styles.js +15 -10
- package/lib/ui/gamification/question/notification/tweet/index.js +10 -7
- package/lib/ui/gamification/question/twitter/index.js +16 -33
- package/lib/ui/gamification/question/twitter/styles.d.ts +0 -1
- package/lib/ui/gamification/question/twitter/styles.js +7 -12
- package/lib/ui/gamification/vote/feedback/index.js +5 -5
- package/lib/ui/gamification/vote/insight-details/index.js +5 -6
- package/lib/ui/gamification/vote/twitter-details/index.js +13 -29
- package/lib/ui/gamification/vote/twitter-details/styles.d.ts +0 -1
- package/lib/ui/gamification/vote/twitter-details/styles.js +3 -8
- package/lib/ui/modal/index.d.ts +9 -0
- package/lib/ui/modal/index.js +34 -0
- package/lib/ui/navigation/button/FeaturedGroups.d.ts +3 -1
- package/lib/ui/navigation/button/FeaturedGroups.js +11 -11
- package/lib/ui/questions/insight/index.d.ts +1 -2
- package/lib/ui/questions/insight/index.js +13 -29
- package/lib/ui/questions/insight/styles.d.ts +0 -1
- package/lib/ui/questions/insight/styles.js +9 -14
- package/lib/ui/questions/twitter/account/index.d.ts +2 -1
- package/lib/ui/questions/twitter/account/index.js +24 -18
- package/lib/ui/questions/twitter/account/styles.d.ts +1 -1
- package/lib/ui/questions/twitter/account/styles.js +2 -2
- package/lib/ui/questions/twitter/index.d.ts +2 -2
- package/lib/ui/questions/twitter/index.js +62 -9
- package/lib/ui/questions/twitter/styles.d.ts +9 -0
- package/lib/ui/questions/twitter/styles.js +31 -6
- package/lib/ui/theme/constants.d.ts +1 -0
- package/lib/ui/theme/constants.js +3 -2
- package/lib/ui/theme/theme.js +26 -22
- package/lib/ui/video-player/index.js +44 -20
- package/lib/utils/common.js +22 -8
- package/lib/utils/debug/components/developer.js +62 -43
- package/package.json +14 -14
package/lib/ui/theme/theme.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { breakpoints as
|
|
3
|
-
import { colors as
|
|
4
|
-
const
|
|
5
|
-
${
|
|
6
|
-
--font-family: ${
|
|
7
|
-
--font-regular: ${
|
|
8
|
-
--font-color: ${
|
|
9
|
-
--font-serif: ${
|
|
10
|
-
--font-weight-default: ${
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { breakpoints as i } from "./breakpoints.js";
|
|
3
|
+
import { colors as l, FONT as t } from "./constants.js";
|
|
4
|
+
const s = `
|
|
5
|
+
${l}
|
|
6
|
+
--font-family: ${t.REGULAR};
|
|
7
|
+
--font-regular: ${t.REGULAR};
|
|
8
|
+
--font-color: ${t.COLOR};
|
|
9
|
+
--font-serif: ${t.SERIF};
|
|
10
|
+
--font-weight-default: ${t.WEIGHT_DEFAULT};
|
|
11
11
|
|
|
12
12
|
--header-offset: 0px;
|
|
13
13
|
--header-height: 68px;
|
|
@@ -19,27 +19,31 @@ const h = `
|
|
|
19
19
|
--max-width: 600px;
|
|
20
20
|
--max-notifications-width: 400px;
|
|
21
21
|
|
|
22
|
-
${
|
|
22
|
+
${i.down("xl")`
|
|
23
23
|
--header-offset: 56px;
|
|
24
24
|
`}
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
${i.intermediate("xl", "lg")`
|
|
27
|
+
--header-offset: 76px;
|
|
28
|
+
`}
|
|
29
|
+
`, m = "StreamLayerCSSReset", p = "ttkj0ah", x = () => /* @__PURE__ */ e("table", {
|
|
26
30
|
children: /* @__PURE__ */ r("table", {
|
|
27
|
-
children: [/* @__PURE__ */
|
|
31
|
+
children: [/* @__PURE__ */ e("thead", {
|
|
28
32
|
children: /* @__PURE__ */ r("tr", {
|
|
29
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ e("th", {
|
|
30
34
|
children: "name"
|
|
31
|
-
}), /* @__PURE__ */
|
|
35
|
+
}), /* @__PURE__ */ e("th", {
|
|
32
36
|
children: "value"
|
|
33
37
|
})]
|
|
34
38
|
})
|
|
35
|
-
}), /* @__PURE__ */
|
|
36
|
-
children:
|
|
37
|
-
const n =
|
|
39
|
+
}), /* @__PURE__ */ e("tbody", {
|
|
40
|
+
children: s.split(";").map((o) => {
|
|
41
|
+
const n = o.trim(), [a, d] = n.split(":");
|
|
38
42
|
return /* @__PURE__ */ r("tr", {
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
-
children: o
|
|
41
|
-
}), /* @__PURE__ */ t("td", {
|
|
43
|
+
children: [/* @__PURE__ */ e("td", {
|
|
42
44
|
children: a
|
|
45
|
+
}), /* @__PURE__ */ e("td", {
|
|
46
|
+
children: d
|
|
43
47
|
})]
|
|
44
48
|
}, n);
|
|
45
49
|
})
|
|
@@ -50,5 +54,5 @@ export {
|
|
|
50
54
|
x as ThemeVariables,
|
|
51
55
|
m as resetCss,
|
|
52
56
|
p as theme,
|
|
53
|
-
|
|
57
|
+
s as themeStr
|
|
54
58
|
};
|
|
@@ -1,30 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { SvgIcon as
|
|
4
|
-
import { Container as
|
|
1
|
+
import { jsxs as y, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useState as b, useEffect as P } from "react";
|
|
3
|
+
import { SvgIcon as h } from "../icons/index.js";
|
|
4
|
+
import { Container as O, Player as w, Poster as E, Control as I } from "./styles.js";
|
|
5
5
|
import "@linaria/react";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const S = (r, c) => {
|
|
7
|
+
for (const e of r)
|
|
8
|
+
e.isIntersecting || e.target instanceof HTMLVideoElement && !e.target.paused && (c.unobserve(e.target), e.target.pause());
|
|
9
|
+
}, v = new IntersectionObserver(S, { threshold: 0.5 }), a = /* @__PURE__ */ new Set(), V = (r) => {
|
|
10
|
+
v.observe(r), a.add(r);
|
|
11
|
+
}, i = (r) => {
|
|
12
|
+
v.unobserve(r), a.delete(r);
|
|
13
|
+
}, H = ({ poster: r, source: c }) => {
|
|
14
|
+
const e = m(null), [l, u] = b(!1), [f, d] = b(!0), g = () => {
|
|
15
|
+
const s = e == null ? void 0 : e.current;
|
|
16
|
+
if (s)
|
|
17
|
+
if (l)
|
|
18
|
+
s.pause(), e.current && i(e.current);
|
|
19
|
+
else {
|
|
20
|
+
const n = e == null ? void 0 : e.current;
|
|
21
|
+
if (!n)
|
|
22
|
+
return;
|
|
23
|
+
for (const t of a)
|
|
24
|
+
t !== n && t instanceof HTMLVideoElement && !t.paused && (t.pause(), i(t));
|
|
25
|
+
V(n), n.play().catch((t) => console.log(t)), d(!1);
|
|
26
|
+
}
|
|
27
|
+
}, p = () => {
|
|
28
|
+
var s;
|
|
29
|
+
e.current && i(e.current), (s = e == null ? void 0 : e.current) == null || s.load(), d(!0);
|
|
30
|
+
};
|
|
31
|
+
return P(() => {
|
|
32
|
+
e.current && i(e.current);
|
|
33
|
+
}, []), /* @__PURE__ */ y(O, { onClick: g, children: [
|
|
34
|
+
/* @__PURE__ */ o(
|
|
35
|
+
w,
|
|
14
36
|
{
|
|
15
|
-
ref:
|
|
16
|
-
src:
|
|
37
|
+
ref: e,
|
|
38
|
+
src: c,
|
|
39
|
+
onPlay: () => u(!0),
|
|
40
|
+
onPause: () => u(!1),
|
|
17
41
|
onEnded: () => {
|
|
18
|
-
|
|
19
|
-
(r = t == null ? void 0 : t.current) == null || r.load(), n(!1), o(!0);
|
|
42
|
+
u(!1), p();
|
|
20
43
|
},
|
|
21
|
-
style: { visibility:
|
|
44
|
+
style: { visibility: f ? "hidden" : "visible" },
|
|
45
|
+
playsInline: !0
|
|
22
46
|
}
|
|
23
47
|
),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ o(E, { src: r, style: { visibility: f ? "visible" : "hidden" } }),
|
|
49
|
+
/* @__PURE__ */ o(I, { children: !l && /* @__PURE__ */ o(h, { name: "icon-play" }) })
|
|
26
50
|
] });
|
|
27
51
|
};
|
|
28
52
|
export {
|
|
29
|
-
|
|
53
|
+
H as VideoPlayer
|
|
30
54
|
};
|
package/lib/utils/common.js
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
const
|
|
1
|
+
const I = (t) => t.split(/\s+/).map((n) => n[0]).join("").toUpperCase(), s = (t) => t ? t.toLocaleString("en-US") : "0", S = (t) => t.toLocaleDateString("en-US", {
|
|
2
2
|
weekday: "short",
|
|
3
3
|
month: "short",
|
|
4
4
|
day: "numeric"
|
|
5
|
-
}),
|
|
5
|
+
}), N = (t) => t.toLocaleTimeString("en-US", {
|
|
6
6
|
hour: "2-digit",
|
|
7
7
|
minute: "2-digit"
|
|
8
|
-
}),
|
|
8
|
+
}), c = (t) => !isNaN(t.getTime()), L = (t) => {
|
|
9
|
+
const o = new Date(t);
|
|
10
|
+
if (!o)
|
|
11
|
+
return "";
|
|
12
|
+
const r = /* @__PURE__ */ new Date(), e = Math.floor(r.getTime() - o.getTime());
|
|
13
|
+
return e < 6e4 ? `${Math.floor(e / 1e3)}s` : e < 36e5 ? `${Math.floor(e / 6e4)}m` : e < 864e5 ? `${Math.floor(e / 36e5)}h` : o.getFullYear() === r.getFullYear() ? `${o.toLocaleDateString("en-US", {
|
|
14
|
+
month: "short",
|
|
15
|
+
day: "numeric"
|
|
16
|
+
})}` : `${o.toLocaleDateString("en-US", {
|
|
17
|
+
month: "2-digit",
|
|
18
|
+
day: "2-digit",
|
|
19
|
+
year: "2-digit"
|
|
20
|
+
})}`;
|
|
21
|
+
};
|
|
9
22
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
I as abbreviate,
|
|
24
|
+
S as formatDate,
|
|
25
|
+
s as formatDecimals,
|
|
26
|
+
N as formatTime,
|
|
27
|
+
L as getTimeUntilNow,
|
|
28
|
+
c as isValidDate
|
|
15
29
|
};
|
|
@@ -1,65 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { DeveloperStorage as
|
|
5
|
-
import { BypassLogin as
|
|
6
|
-
import { CopyLogs as
|
|
7
|
-
import { EnvToggle as
|
|
8
|
-
import { EventInput as
|
|
9
|
-
import { SdkKey as
|
|
1
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { styled as n } from "@linaria/react";
|
|
3
|
+
import { useMemo as b, useState as h } from "react";
|
|
4
|
+
import { DeveloperStorage as q } from "../../storage.js";
|
|
5
|
+
import { BypassLogin as u } from "./bypassLogin.js";
|
|
6
|
+
import { CopyLogs as D } from "./copyLogs.js";
|
|
7
|
+
import { EnvToggle as I } from "./envToggle.js";
|
|
8
|
+
import { EventInput as B } from "./eventInput.js";
|
|
9
|
+
import { SdkKey as v } from "./sdkKey.js";
|
|
10
10
|
import "@streamlayer/sdk-web-storage";
|
|
11
11
|
import "./styles.js";
|
|
12
12
|
import "@nanostores/react";
|
|
13
13
|
import "@streamlayer/sdk-web-core";
|
|
14
|
-
const
|
|
14
|
+
const A = /* @__PURE__ */ n("div")({
|
|
15
15
|
name: "DeveloperContainer",
|
|
16
16
|
class: "d1sqxt7l",
|
|
17
17
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
18
|
+
}), x = /* @__PURE__ */ n("div")({
|
|
19
19
|
name: "DeveloperItems",
|
|
20
20
|
class: "d1a3478s",
|
|
21
21
|
propsAsIs: !1
|
|
22
|
-
}),
|
|
22
|
+
}), L = /* @__PURE__ */ n("button")({
|
|
23
23
|
name: "BurgerBtn",
|
|
24
24
|
class: "butjcq8",
|
|
25
25
|
propsAsIs: !1
|
|
26
|
-
}),
|
|
27
|
-
sdk:
|
|
28
|
-
sdkKey:
|
|
26
|
+
}), P = ({
|
|
27
|
+
sdk: r,
|
|
28
|
+
sdkKey: s,
|
|
29
29
|
setSdkKey: p,
|
|
30
|
-
env:
|
|
31
|
-
setEnv:
|
|
32
|
-
event:
|
|
33
|
-
setEvent:
|
|
34
|
-
hideAuth:
|
|
30
|
+
env: i,
|
|
31
|
+
setEnv: t,
|
|
32
|
+
event: a,
|
|
33
|
+
setEvent: l,
|
|
34
|
+
hideAuth: c,
|
|
35
|
+
standalone: f = !1
|
|
35
36
|
}) => {
|
|
36
|
-
const
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
children: [/* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const e = b(() => new q(), []), [g, C] = h(f);
|
|
38
|
+
return f ? /* @__PURE__ */ m(x, {
|
|
39
|
+
children: [t && /* @__PURE__ */ o(I, {
|
|
40
|
+
env: i,
|
|
41
|
+
setEnv: t,
|
|
42
|
+
storage: e
|
|
43
|
+
}), p && /* @__PURE__ */ o(v, {
|
|
44
|
+
sdkKey: s,
|
|
45
|
+
setSdkKey: p,
|
|
46
|
+
storage: e
|
|
47
|
+
}), r && /* @__PURE__ */ o(B, {
|
|
48
|
+
sdk: r,
|
|
49
|
+
storage: e,
|
|
50
|
+
event: a,
|
|
51
|
+
setEvent: l
|
|
52
|
+
}), !c && r && /* @__PURE__ */ o(u, {
|
|
53
|
+
sdk: r,
|
|
54
|
+
storage: e
|
|
55
|
+
}), /* @__PURE__ */ o(D, {})]
|
|
56
|
+
}) : /* @__PURE__ */ m(A, {
|
|
57
|
+
children: [/* @__PURE__ */ m(L, {
|
|
58
|
+
"data-opened": g.toString(),
|
|
59
|
+
onClick: () => C((j) => !j),
|
|
41
60
|
children: [/* @__PURE__ */ o("span", {}), /* @__PURE__ */ o("span", {}), /* @__PURE__ */ o("span", {})]
|
|
42
|
-
}),
|
|
43
|
-
children: [
|
|
44
|
-
env:
|
|
45
|
-
setEnv:
|
|
46
|
-
storage:
|
|
47
|
-
}), p && /* @__PURE__ */ o(
|
|
48
|
-
sdkKey:
|
|
61
|
+
}), g && /* @__PURE__ */ m(x, {
|
|
62
|
+
children: [t && /* @__PURE__ */ o(I, {
|
|
63
|
+
env: i,
|
|
64
|
+
setEnv: t,
|
|
65
|
+
storage: e
|
|
66
|
+
}), p && /* @__PURE__ */ o(v, {
|
|
67
|
+
sdkKey: s,
|
|
49
68
|
setSdkKey: p,
|
|
50
|
-
storage:
|
|
51
|
-
}),
|
|
52
|
-
sdk:
|
|
53
|
-
storage:
|
|
54
|
-
event:
|
|
55
|
-
setEvent:
|
|
56
|
-
}), !
|
|
57
|
-
sdk:
|
|
58
|
-
storage:
|
|
59
|
-
}), /* @__PURE__ */ o(
|
|
69
|
+
storage: e
|
|
70
|
+
}), r && /* @__PURE__ */ o(B, {
|
|
71
|
+
sdk: r,
|
|
72
|
+
storage: e,
|
|
73
|
+
event: a,
|
|
74
|
+
setEvent: l
|
|
75
|
+
}), !c && r && /* @__PURE__ */ o(u, {
|
|
76
|
+
sdk: r,
|
|
77
|
+
storage: e
|
|
78
|
+
}), /* @__PURE__ */ o(D, {})]
|
|
60
79
|
})]
|
|
61
80
|
});
|
|
62
81
|
};
|
|
63
82
|
export {
|
|
64
|
-
|
|
83
|
+
P as Developer
|
|
65
84
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.95.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -36,24 +36,24 @@
|
|
|
36
36
|
],
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@lottiefiles/react-lottie-player": "*",
|
|
39
|
-
"@streamlayer/sl-eslib": "^5.
|
|
39
|
+
"@streamlayer/sl-eslib": "^5.67.0",
|
|
40
40
|
"@types/lodash.throttle": "^4.1.9",
|
|
41
41
|
"lodash.throttle": "^4.1.1",
|
|
42
42
|
"react-infinite-scroller": "^1.2.6",
|
|
43
43
|
"react-virtualized-auto-sizer": "^1.0.21",
|
|
44
44
|
"react-window": "^1.8.10",
|
|
45
45
|
"react-window-infinite-loader": "^1.0.9",
|
|
46
|
-
"@streamlayer/feature-gamification": "^0.
|
|
47
|
-
"@streamlayer/sdk-web": "^0.
|
|
48
|
-
"@streamlayer/sdk-web-anonymous-auth": "^0.11.
|
|
49
|
-
"@streamlayer/sdk-web-api": "^0.
|
|
50
|
-
"@streamlayer/sdk-web-core": "^0.
|
|
51
|
-
"@streamlayer/sdk-web-features": "^0.11.
|
|
52
|
-
"@streamlayer/sdk-web-interfaces": "^0.20.
|
|
53
|
-
"@streamlayer/sdk-web-
|
|
54
|
-
"@streamlayer/sdk-web-
|
|
55
|
-
"@streamlayer/sdk-web-storage": "^0.
|
|
56
|
-
"@streamlayer/sdk-web-types": "^0.
|
|
46
|
+
"@streamlayer/feature-gamification": "^0.37.0",
|
|
47
|
+
"@streamlayer/sdk-web": "^0.31.1",
|
|
48
|
+
"@streamlayer/sdk-web-anonymous-auth": "^0.11.36",
|
|
49
|
+
"@streamlayer/sdk-web-api": "^0.21.1",
|
|
50
|
+
"@streamlayer/sdk-web-core": "^0.20.0",
|
|
51
|
+
"@streamlayer/sdk-web-features": "^0.11.18",
|
|
52
|
+
"@streamlayer/sdk-web-interfaces": "^0.20.3",
|
|
53
|
+
"@streamlayer/sdk-web-logger": "^0.5.14",
|
|
54
|
+
"@streamlayer/sdk-web-notifications": "^0.13.9",
|
|
55
|
+
"@streamlayer/sdk-web-storage": "^0.4.1",
|
|
56
|
+
"@streamlayer/sdk-web-types": "^0.22.1"
|
|
57
57
|
},
|
|
58
58
|
"nx": {
|
|
59
59
|
"implicitDependencies": [
|
|
@@ -94,6 +94,6 @@
|
|
|
94
94
|
"vite-plugin-svgr": "^4.2.0",
|
|
95
95
|
"vite-svg-loader": "^5.1.0",
|
|
96
96
|
"vite-tsconfig-paths": "^4.3.1",
|
|
97
|
-
"@streamlayer/react": "^0.
|
|
97
|
+
"@streamlayer/react": "^0.39.0"
|
|
98
98
|
}
|
|
99
99
|
}
|