@streamlayer/react-ui 1.23.2 → 1.23.4
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "@linaria/core";
|
|
3
3
|
import "react";
|
|
4
|
-
import
|
|
4
|
+
import "@streamlayer/sdk-web-types";
|
|
5
|
+
import { BetPackOverlay as c } from "../index.js";
|
|
5
6
|
import "../../../../ui/icons/index.js";
|
|
6
7
|
import "./styles.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
c as BetPackOverlay
|
|
9
10
|
};
|
|
@@ -1,65 +1,69 @@
|
|
|
1
1
|
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { cx as P } from "@linaria/core";
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as I, useState as y, useCallback as H, useEffect as w, memo as L, useMemo as p } from "react";
|
|
4
4
|
import { useStore as B } from "@streamlayer/react-polyfills";
|
|
5
|
-
import { FeatureType as
|
|
5
|
+
import { FeatureType as A } from "@streamlayer/sdk-web-types";
|
|
6
6
|
import { BetPackContent as M } from "./BetPackContent/index.js";
|
|
7
|
-
import { EmergencyScreen as
|
|
8
|
-
import { LoaderScreen as
|
|
9
|
-
import { BetPackContainer as
|
|
10
|
-
import { defaultEventHandler as
|
|
11
|
-
import { SvgIcon as
|
|
12
|
-
import { Container as
|
|
13
|
-
const nr =
|
|
14
|
-
const [
|
|
15
|
-
(
|
|
16
|
-
if (
|
|
17
|
-
const { next:
|
|
18
|
-
|
|
19
|
-
current:
|
|
20
|
-
canPrev:
|
|
21
|
-
canNext:
|
|
7
|
+
import { EmergencyScreen as G } from "./BetPackContent/EmergencyScreen/index.js";
|
|
8
|
+
import { LoaderScreen as g } from "./BetPackContent/LoaderScreen/index.js";
|
|
9
|
+
import { BetPackContainer as O } from "./styles.js";
|
|
10
|
+
import { defaultEventHandler as R } from "./utils.js";
|
|
11
|
+
import { SvgIcon as x } from "../../../ui/icons/index.js";
|
|
12
|
+
import { Container as j, Header as T, HeaderTitle as z, CloseButton as U, Main as Y, Footer as q, SlideSwitchButton as C, IconArrowPrev as D, buttonAvailable as k, IconArrowNext as J } from "./BetPackOverlay/styles.js";
|
|
13
|
+
const nr = I(({ sdk: o, onEvent: a, close: m }, t) => {
|
|
14
|
+
const [n, u] = y(), [e, h] = y(), N = H(
|
|
15
|
+
(i) => {
|
|
16
|
+
if (i.type === "slBetPackReady") {
|
|
17
|
+
const { next: l, prev: s, current: f, canNext: b, canPrev: F } = i.payload || {};
|
|
18
|
+
u({ next: l, prev: s }), h((c) => ({
|
|
19
|
+
current: c != null && c.current ? c == null ? void 0 : c.current : f,
|
|
20
|
+
canPrev: c != null && c.current ? c == null ? void 0 : c.canPrev : F,
|
|
21
|
+
canNext: b
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
|
-
if (
|
|
25
|
-
const { current:
|
|
26
|
-
h({ current:
|
|
24
|
+
if (i.type === "slBetPackChangeCard") {
|
|
25
|
+
const { current: l, canNext: s, canPrev: f } = i.payload || {};
|
|
26
|
+
h({ current: l, canNext: s, canPrev: f });
|
|
27
27
|
}
|
|
28
|
-
a == null || a(
|
|
28
|
+
a == null || a(i);
|
|
29
29
|
},
|
|
30
30
|
[a]
|
|
31
31
|
);
|
|
32
|
-
return
|
|
32
|
+
return w(() => () => {
|
|
33
|
+
var l;
|
|
34
|
+
const i = o.getFeature(A.GAMES);
|
|
35
|
+
i && ((l = i.betPack) == null || l.off());
|
|
36
|
+
}, [o]), /* @__PURE__ */ d(j, { ref: t, children: [
|
|
33
37
|
/* @__PURE__ */ d(T, { children: [
|
|
34
38
|
/* @__PURE__ */ d(z, { children: [
|
|
35
|
-
/* @__PURE__ */ r(
|
|
39
|
+
/* @__PURE__ */ r(x, { name: "fgIcon" }),
|
|
36
40
|
"Featured Groups+"
|
|
37
41
|
] }),
|
|
38
|
-
/* @__PURE__ */ r(U, { "data-a": "intr", onClick:
|
|
42
|
+
/* @__PURE__ */ r(U, { "data-a": "intr", onClick: m, children: /* @__PURE__ */ r(x, { name: "icon-close-btn-gray" }) })
|
|
39
43
|
] }),
|
|
40
|
-
/* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(Q, { sdk:
|
|
44
|
+
/* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(Q, { sdk: o, onEvent: N, overlay: !0 }) }),
|
|
41
45
|
/* @__PURE__ */ d(q, { children: [
|
|
42
|
-
/* @__PURE__ */ r(C, { "data-a": "intr", onClick:
|
|
43
|
-
/* @__PURE__ */ r(C, { "data-a": "intr", onClick:
|
|
46
|
+
/* @__PURE__ */ r(C, { "data-a": "intr", onClick: n == null ? void 0 : n.prev, disabled: !(e != null && e.canPrev), children: /* @__PURE__ */ r(D, { "data-a": "intr", name: "iconArrowPrev", className: P((e == null ? void 0 : e.canPrev) && k) }) }),
|
|
47
|
+
/* @__PURE__ */ r(C, { "data-a": "intr", onClick: n == null ? void 0 : n.next, disabled: !(e != null && e.canNext), children: /* @__PURE__ */ r(J, { "data-a": "intr", name: "iconArrowPrev", className: P((e == null ? void 0 : e.canNext) && k) }) })
|
|
44
48
|
] })
|
|
45
49
|
] });
|
|
46
|
-
}), K = ({ user:
|
|
47
|
-
|
|
50
|
+
}), K = ({ user: o, gamification: a, overlay: m, swipeable: t, onEvent: n }) => o.data ? a ? /* @__PURE__ */ r(M, { overlay: m, gamification: a, onEvent: n, swipeable: t }) : /* @__PURE__ */ r(g, {}) : o.error && !o.loading ? /* @__PURE__ */ r(
|
|
51
|
+
G,
|
|
48
52
|
{
|
|
49
|
-
onEvent:
|
|
50
|
-
actionFn: () =>
|
|
53
|
+
onEvent: n,
|
|
54
|
+
actionFn: () => n({ type: "slHardRefresh" }),
|
|
51
55
|
description: `You are not authorized to
|
|
52
56
|
view this resource.`
|
|
53
57
|
}
|
|
54
|
-
) : /* @__PURE__ */ r(
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
+
) : /* @__PURE__ */ r(g, {}), Q = L(({ sdk: o, swipeable: a = !0, onEvent: m = R, overlay: t }) => {
|
|
59
|
+
const n = B(o.featuresList.getStore()), u = p(() => o.getFeature(A.GAMES), [n]), e = B(o.getUserStore());
|
|
60
|
+
return w(() => (o.writeOverlaySessionId(), () => {
|
|
61
|
+
o.writeOverlaySessionId("");
|
|
58
62
|
}), []), /* @__PURE__ */ r(
|
|
59
|
-
|
|
63
|
+
O,
|
|
60
64
|
{
|
|
61
|
-
className: P("SL-BetPack",
|
|
62
|
-
children: /* @__PURE__ */ r(K, { overlay:
|
|
65
|
+
className: P("SL-BetPack", t && "SL-BetPack--overlay", !t && "SL-BetPack--standalone"),
|
|
66
|
+
children: /* @__PURE__ */ r(K, { overlay: t, user: e, gamification: u, onEvent: m, swipeable: a })
|
|
63
67
|
}
|
|
64
68
|
);
|
|
65
69
|
});
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { styled as
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { styled as u } from "@linaria/react";
|
|
3
3
|
import { useMastersContext as a } from "../../useMastersContext.js";
|
|
4
|
-
import { useStore as
|
|
4
|
+
import { useStore as l } from "@streamlayer/react-polyfills";
|
|
5
5
|
import { QuestionType as m } from "@streamlayer/sdk-web-types";
|
|
6
6
|
import { VoteHeader as c } from "../../../../ui/gamification/detail/header/index.js";
|
|
7
7
|
import { Sponsor as p } from "../../../../ui/gamification/detail/sponsor/index.js";
|
|
8
8
|
import { Vote as f, VoteSkeleton as b } from "../../../../ui/gamification/vote/index.js";
|
|
9
9
|
import { InsightDetails as y } from "../../../../ui/gamification/vote/insight-details/index.js";
|
|
10
|
-
import { TwitterDetails as
|
|
11
|
-
const
|
|
10
|
+
import { TwitterDetails as S } from "../../../../ui/gamification/vote/twitter-details/index.js";
|
|
11
|
+
const V = /* @__PURE__ */ u("div")({
|
|
12
12
|
name: "QuestionContainer",
|
|
13
13
|
class: "qwgkhsv",
|
|
14
14
|
propsAsIs: !1
|
|
15
|
-
}),
|
|
15
|
+
}), g = ({
|
|
16
16
|
openedQuestion: t
|
|
17
17
|
}) => {
|
|
18
18
|
var s, o;
|
|
19
19
|
const {
|
|
20
|
-
sdk:
|
|
20
|
+
sdk: e
|
|
21
21
|
} = a();
|
|
22
|
-
return ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */
|
|
22
|
+
return ((s = t == null ? void 0 : t.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */ r(y, {
|
|
23
23
|
...t.attributes.attributes.value,
|
|
24
|
-
controlVideo:
|
|
25
|
-
}) : ((o = t == null ? void 0 : t.attributes) == null ? void 0 : o.attributes.case) === "tweet" ? /* @__PURE__ */
|
|
24
|
+
controlVideo: e == null ? void 0 : e.controlVideoPlayer
|
|
25
|
+
}) : ((o = t == null ? void 0 : t.attributes) == null ? void 0 : o.attributes.case) === "tweet" ? /* @__PURE__ */ r(S, {
|
|
26
26
|
...t.attributes.attributes.value,
|
|
27
|
-
controlVideo:
|
|
27
|
+
controlVideo: e == null ? void 0 : e.controlVideoPlayer
|
|
28
28
|
}) : null;
|
|
29
|
-
},
|
|
29
|
+
}, h = ({
|
|
30
30
|
extendedQuestion: t,
|
|
31
|
-
vote:
|
|
31
|
+
vote: e,
|
|
32
32
|
close: s
|
|
33
33
|
}) => {
|
|
34
34
|
const {
|
|
35
35
|
loading: o,
|
|
36
36
|
data: i
|
|
37
37
|
} = t;
|
|
38
|
-
return i ? /* @__PURE__ */
|
|
39
|
-
vote:
|
|
38
|
+
return localStorage.getItem("SL_DEBUG") && console.log("QuestionDetail", t), i ? /* @__PURE__ */ r(f, {
|
|
39
|
+
vote: e,
|
|
40
40
|
close: s,
|
|
41
41
|
openedQuestion: i,
|
|
42
42
|
isLoading: !!o
|
|
43
|
-
}) : /* @__PURE__ */
|
|
44
|
-
},
|
|
43
|
+
}) : /* @__PURE__ */ r(b, {});
|
|
44
|
+
}, L = ({
|
|
45
45
|
gamification: t
|
|
46
46
|
}) => {
|
|
47
47
|
var i;
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
48
|
+
const e = l(t.openedQuestion.$store), s = l(t.openedQuestion.$extendedStore);
|
|
49
|
+
if (!e)
|
|
50
50
|
return null;
|
|
51
|
-
const o =
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
children: [/* @__PURE__ */
|
|
51
|
+
const o = e.type;
|
|
52
|
+
return /* @__PURE__ */ n(V, {
|
|
53
|
+
children: [/* @__PURE__ */ r(c, {
|
|
54
54
|
close: t.closeQuestion,
|
|
55
|
-
type: ((i =
|
|
56
|
-
}), o === "question" && /* @__PURE__ */
|
|
55
|
+
type: ((i = e.attributes) == null ? void 0 : i.type) || m.UNSET
|
|
56
|
+
}), o === "question" && /* @__PURE__ */ r(h, {
|
|
57
57
|
vote: t.submitAnswer,
|
|
58
58
|
close: t.closeQuestion,
|
|
59
59
|
extendedQuestion: s
|
|
60
|
-
}), o !== "question" && /* @__PURE__ */
|
|
61
|
-
openedQuestion:
|
|
62
|
-
}), /* @__PURE__ */
|
|
60
|
+
}), o !== "question" && /* @__PURE__ */ r(g, {
|
|
61
|
+
openedQuestion: e
|
|
62
|
+
}), /* @__PURE__ */ r(p, {
|
|
63
63
|
mastersApp: !0
|
|
64
64
|
})]
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
L as Question
|
|
69
69
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -69,19 +69,19 @@
|
|
|
69
69
|
"react-window": "^1.8.10",
|
|
70
70
|
"react-window-infinite-loader": "^1.0.9",
|
|
71
71
|
"uuid": "^11.1.0",
|
|
72
|
-
"@streamlayer/feature-gamification": "^1.16.
|
|
73
|
-
"@streamlayer/react-polyfills": "^0.1.
|
|
74
|
-
"@streamlayer/sdk-web": "^1.10.
|
|
75
|
-
"@streamlayer/sdk-web-
|
|
76
|
-
"@streamlayer/sdk-web-
|
|
77
|
-
"@streamlayer/sdk-web-
|
|
78
|
-
"@streamlayer/sdk-web-
|
|
79
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
80
|
-
"@streamlayer/sdk-web-interfaces": "^1.5.
|
|
81
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
82
|
-
"@streamlayer/sdk-web-
|
|
83
|
-
"@streamlayer/sdk-web-
|
|
84
|
-
"@streamlayer/sdk-web-types": "^1.10.
|
|
72
|
+
"@streamlayer/feature-gamification": "^1.16.13",
|
|
73
|
+
"@streamlayer/react-polyfills": "^0.1.20",
|
|
74
|
+
"@streamlayer/sdk-web": "^1.10.13",
|
|
75
|
+
"@streamlayer/sdk-web-analytics": "^1.7.13",
|
|
76
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.1.39",
|
|
77
|
+
"@streamlayer/sdk-web-api": "^1.8.13",
|
|
78
|
+
"@streamlayer/sdk-web-core": "^1.11.15",
|
|
79
|
+
"@streamlayer/sdk-web-features": "^1.0.60",
|
|
80
|
+
"@streamlayer/sdk-web-interfaces": "^1.5.4",
|
|
81
|
+
"@streamlayer/sdk-web-logger": "^1.0.60",
|
|
82
|
+
"@streamlayer/sdk-web-notifications": "^1.3.22",
|
|
83
|
+
"@streamlayer/sdk-web-storage": "^1.0.60",
|
|
84
|
+
"@streamlayer/sdk-web-types": "^1.10.17"
|
|
85
85
|
},
|
|
86
86
|
"nx": {
|
|
87
87
|
"implicitDependencies": [
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"vite-plugin-svgr": "^4.2.0",
|
|
122
122
|
"vite-svg-loader": "^5.1.0",
|
|
123
123
|
"vite-tsconfig-paths": "^5.0.1",
|
|
124
|
-
"@streamlayer/react": "^1.15.
|
|
124
|
+
"@streamlayer/react": "^1.15.4"
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
127
|
"@dailymotion/vast-client": "^6.2.0",
|