@streamlayer/react-ui 1.3.2 → 1.4.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.js +17 -15
- package/lib/app/app/Insight/index.d.ts +1 -0
- package/lib/app/app/Insight/index.js +45 -38
- package/lib/app/app/story/insight/index.d.ts +1 -0
- package/lib/app/app/story/insight/index.js +32 -27
- package/lib/app/app/story/insight/video.d.ts +1 -0
- package/lib/app/app/story/insight/video.js +13 -13
- package/package.json +15 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { styled as u } from "@linaria/react";
|
|
3
3
|
import { useStore as f } from "@nanostores/react";
|
|
4
4
|
import { useAnalyticsListener as p } from "../../../hooks/analytics.js";
|
|
@@ -34,7 +34,7 @@ const L = /* @__PURE__ */ u("div")({
|
|
|
34
34
|
layoutMode: e,
|
|
35
35
|
sidebar: i,
|
|
36
36
|
banner: r,
|
|
37
|
-
isMobileScreen:
|
|
37
|
+
isMobileScreen: l,
|
|
38
38
|
persistent: o
|
|
39
39
|
}) => {
|
|
40
40
|
const a = A(null), s = f(t.advertisement.$list), n = y(
|
|
@@ -43,29 +43,31 @@ const L = /* @__PURE__ */ u("div")({
|
|
|
43
43
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
44
|
[s, o]
|
|
45
45
|
);
|
|
46
|
-
|
|
46
|
+
p(a, {
|
|
47
47
|
enabled: !!n,
|
|
48
48
|
event: "click",
|
|
49
49
|
listener: E
|
|
50
|
-
})
|
|
50
|
+
});
|
|
51
|
+
const m = !r && !i;
|
|
52
|
+
return n ? /* @__PURE__ */ c(L, {
|
|
51
53
|
ref: a,
|
|
52
54
|
style: {
|
|
53
|
-
height:
|
|
55
|
+
height: m ? "auto" : "100%"
|
|
54
56
|
},
|
|
55
|
-
className:
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
+
className: l ? "mobile-view" : "",
|
|
58
|
+
children: /* @__PURE__ */ c(h, {
|
|
57
59
|
sidebar: i,
|
|
58
60
|
banner: r,
|
|
59
61
|
advertisement: n,
|
|
60
62
|
layoutMode: e
|
|
61
63
|
})
|
|
62
64
|
}) : null;
|
|
63
|
-
},
|
|
65
|
+
}, P = ({
|
|
64
66
|
sdk: t,
|
|
65
67
|
sidebar: e,
|
|
66
68
|
banner: i,
|
|
67
69
|
event: r,
|
|
68
|
-
layoutMode:
|
|
70
|
+
layoutMode: l,
|
|
69
71
|
isMobileScreen: o,
|
|
70
72
|
persistent: a
|
|
71
73
|
}) => {
|
|
@@ -77,7 +79,7 @@ const L = /* @__PURE__ */ u("div")({
|
|
|
77
79
|
}, [r, s, t]);
|
|
78
80
|
const n = f(t.featuresList.getStore());
|
|
79
81
|
if (e && i)
|
|
80
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ c("div", {
|
|
81
83
|
style: {
|
|
82
84
|
color: "red"
|
|
83
85
|
},
|
|
@@ -85,17 +87,17 @@ const L = /* @__PURE__ */ u("div")({
|
|
|
85
87
|
});
|
|
86
88
|
if (!n)
|
|
87
89
|
return null;
|
|
88
|
-
const
|
|
89
|
-
return
|
|
90
|
-
gamification:
|
|
90
|
+
const m = t.getFeature(g.GAMES);
|
|
91
|
+
return m ? /* @__PURE__ */ c(I, {
|
|
92
|
+
gamification: m,
|
|
91
93
|
sidebar: e,
|
|
92
94
|
banner: i,
|
|
93
|
-
layoutMode:
|
|
95
|
+
layoutMode: l,
|
|
94
96
|
isMobileScreen: o,
|
|
95
97
|
persistent: a
|
|
96
98
|
}) : null;
|
|
97
99
|
};
|
|
98
100
|
export {
|
|
99
101
|
L as AdvertisementUIWrap,
|
|
100
|
-
|
|
102
|
+
P as StreamLayerSDKAdvertisement
|
|
101
103
|
};
|
|
@@ -1,62 +1,69 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import { FeatureType as h, QuestionStatus as
|
|
6
|
-
import { Question as
|
|
7
|
-
import { useAppApp as
|
|
8
|
-
import { ShowIn as
|
|
9
|
-
const
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { styled as d } from "@linaria/react";
|
|
3
|
+
import { useStore as S } from "@nanostores/react";
|
|
4
|
+
import { useEffect as l, useRef as Q } from "react";
|
|
5
|
+
import { FeatureType as h, QuestionStatus as w } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { Question as y } from "../Features/Gamification/Question.js";
|
|
7
|
+
import { useAppApp as A } from "../useApp.js";
|
|
8
|
+
import { ShowIn as V } from "../../../ui/show-in/index.js";
|
|
9
|
+
const v = () => y, x = /* @__PURE__ */ d(v())({
|
|
10
10
|
name: "QuestionWrap",
|
|
11
11
|
class: "q10hhsxv",
|
|
12
12
|
propsAsIs: !0
|
|
13
|
-
}),
|
|
13
|
+
}), E = ({
|
|
14
14
|
gamification: e,
|
|
15
15
|
persistent: t,
|
|
16
|
-
hideHeader:
|
|
16
|
+
hideHeader: f,
|
|
17
|
+
insightId: r
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
|
|
19
|
+
const s = Q(""), n = S(e.openedQuestion.$store);
|
|
20
|
+
return l(() => r ? (!t || e.isOpenedQuestion(r) || (s.current = r, e.getFeedItem(r).then((o) => {
|
|
21
|
+
s.current === r && e.openQuestion(r, o);
|
|
22
|
+
})), () => {
|
|
23
|
+
s.current = "";
|
|
24
|
+
}) : e.feedList.getStore().subscribe(({
|
|
25
|
+
data: u
|
|
21
26
|
}) => {
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
24
|
-
type:
|
|
25
|
-
attributes:
|
|
26
|
-
}) =>
|
|
27
|
-
|
|
27
|
+
if (u) {
|
|
28
|
+
const o = u, p = o == null ? void 0 : o.find(({
|
|
29
|
+
type: m,
|
|
30
|
+
attributes: c
|
|
31
|
+
}) => m === "insight" && (c == null ? void 0 : c.status) === w.ACTIVE);
|
|
32
|
+
p && (!t || e.isOpenedQuestion(p.id) || e.openQuestion(p.id, p));
|
|
28
33
|
}
|
|
29
|
-
}), [e, t]),
|
|
34
|
+
}), [e, t, r]), n ? /* @__PURE__ */ i(V, {
|
|
30
35
|
style: {
|
|
31
36
|
height: "100%"
|
|
32
37
|
},
|
|
33
|
-
children: /* @__PURE__ */
|
|
34
|
-
hideHeader:
|
|
38
|
+
children: /* @__PURE__ */ i(x, {
|
|
39
|
+
hideHeader: f,
|
|
35
40
|
gamification: e,
|
|
36
41
|
hideSponsor: !0
|
|
37
42
|
})
|
|
38
43
|
}) : null;
|
|
39
|
-
},
|
|
44
|
+
}, j = ({
|
|
40
45
|
sdk: e,
|
|
41
46
|
event: t,
|
|
42
|
-
persistent:
|
|
43
|
-
|
|
47
|
+
persistent: f,
|
|
48
|
+
insightId: r,
|
|
49
|
+
hideHeader: s
|
|
44
50
|
}) => {
|
|
45
51
|
const {
|
|
46
|
-
deactivate:
|
|
47
|
-
} =
|
|
48
|
-
if (
|
|
49
|
-
t ? e.createEventSession(t) :
|
|
50
|
-
}, [t,
|
|
52
|
+
deactivate: n
|
|
53
|
+
} = A(e);
|
|
54
|
+
if (l(() => {
|
|
55
|
+
t ? e.createEventSession(t) : n();
|
|
56
|
+
}, [t, n, e]), !S(e.featuresList.getStore()))
|
|
51
57
|
return null;
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
const o = e.getFeature(h.GAMES);
|
|
59
|
+
return o ? /* @__PURE__ */ i(E, {
|
|
60
|
+
insightId: r,
|
|
61
|
+
persistent: f,
|
|
62
|
+
hideHeader: s,
|
|
63
|
+
gamification: o
|
|
57
64
|
}) : null;
|
|
58
65
|
};
|
|
59
66
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
x as QuestionWrap,
|
|
68
|
+
j as StreamLayerSDKInsight
|
|
62
69
|
};
|
|
@@ -1,57 +1,62 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { styled as d } from "@linaria/react";
|
|
3
|
-
import { StreamLayerProvider as
|
|
4
|
-
import { StreamLayerSDKInsight as
|
|
5
|
-
import { StreamLayerThemeProvider as
|
|
6
|
-
import { useStreamLayerDebug as
|
|
7
|
-
import { customTheme as
|
|
8
|
-
import { Video as
|
|
9
|
-
const
|
|
3
|
+
import { StreamLayerProvider as u, useStreamLayer as p } from "@streamlayer/react";
|
|
4
|
+
import { StreamLayerSDKInsight as c } from "../../Insight/index.js";
|
|
5
|
+
import { StreamLayerThemeProvider as y } from "../../../../ui/theme/index.js";
|
|
6
|
+
import { useStreamLayerDebug as f } from "../../../../utils/debug/index.js";
|
|
7
|
+
import { customTheme as l } from "./styles.js";
|
|
8
|
+
import { Video as v } from "./video.js";
|
|
9
|
+
const h = /* @__PURE__ */ d("div")({
|
|
10
10
|
name: "Body",
|
|
11
11
|
class: "buit6hv",
|
|
12
12
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
13
|
+
}), S = ({
|
|
14
14
|
event: o,
|
|
15
|
-
hideHeader: m
|
|
15
|
+
hideHeader: m,
|
|
16
|
+
insightId: n
|
|
16
17
|
}) => {
|
|
17
|
-
const r =
|
|
18
|
-
return r ? /* @__PURE__ */ e(
|
|
19
|
-
customTheme:
|
|
20
|
-
children: /* @__PURE__ */ e(
|
|
18
|
+
const r = p();
|
|
19
|
+
return r ? /* @__PURE__ */ e(y, {
|
|
20
|
+
customTheme: l,
|
|
21
|
+
children: /* @__PURE__ */ e(c, {
|
|
21
22
|
hideHeader: m,
|
|
22
23
|
event: o,
|
|
23
24
|
sdk: r,
|
|
25
|
+
insightId: n,
|
|
24
26
|
persistent: !0
|
|
25
27
|
})
|
|
26
28
|
}) : null;
|
|
27
|
-
},
|
|
29
|
+
}, D = ({
|
|
28
30
|
sdkKey: o,
|
|
29
31
|
eventId: m,
|
|
30
|
-
layoutMode:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
layoutMode: n,
|
|
33
|
+
insightId: r,
|
|
34
|
+
production: s,
|
|
35
|
+
onlyInsight: i,
|
|
36
|
+
hideHeader: a
|
|
34
37
|
}) => {
|
|
35
|
-
const t =
|
|
38
|
+
const t = f({
|
|
36
39
|
sdkKey: o,
|
|
37
40
|
eventId: m,
|
|
38
|
-
production:
|
|
41
|
+
production: s
|
|
39
42
|
});
|
|
40
|
-
return /* @__PURE__ */ e(
|
|
43
|
+
return /* @__PURE__ */ e(u, {
|
|
41
44
|
sdkKey: t.sdkKey,
|
|
42
45
|
production: t.env === "production",
|
|
43
46
|
autoEnable: !0,
|
|
44
|
-
children:
|
|
45
|
-
|
|
47
|
+
children: i ? /* @__PURE__ */ e(S, {
|
|
48
|
+
insightId: r,
|
|
49
|
+
hideHeader: a,
|
|
46
50
|
event: t.event
|
|
47
|
-
}) : /* @__PURE__ */ e(
|
|
48
|
-
children: /* @__PURE__ */ e(
|
|
49
|
-
|
|
51
|
+
}) : /* @__PURE__ */ e(h, {
|
|
52
|
+
children: /* @__PURE__ */ e(v, {
|
|
53
|
+
insightId: r,
|
|
54
|
+
layoutMode: n,
|
|
50
55
|
event: t.event
|
|
51
56
|
})
|
|
52
57
|
})
|
|
53
58
|
});
|
|
54
59
|
};
|
|
55
60
|
export {
|
|
56
|
-
|
|
61
|
+
D as InsightStory
|
|
57
62
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, Fragment as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as h } from "react";
|
|
3
|
-
import { useStreamLayer as
|
|
4
|
-
import { StreamLayerSDKInsight as
|
|
5
|
-
import { StreamLayerThemeProvider as
|
|
6
|
-
import { VideoFrame as
|
|
7
|
-
const
|
|
8
|
-
const r =
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */ e(
|
|
12
|
-
/* @__PURE__ */ e(
|
|
3
|
+
import { useStreamLayer as c } from "@streamlayer/react";
|
|
4
|
+
import { StreamLayerSDKInsight as n } from "../../Insight/index.js";
|
|
5
|
+
import { StreamLayerThemeProvider as s } from "../../../../ui/theme/index.js";
|
|
6
|
+
import { VideoFrame as p, customTheme as a, VideoPlayerWrap as u, InsightContainerMobile as f, InsightContainerOverlay as g, InsightContainerLBar as y } from "./styles.js";
|
|
7
|
+
const F = ({ event: t, insightId: o, layoutMode: m }) => {
|
|
8
|
+
const r = c(), d = h(null);
|
|
9
|
+
return /* @__PURE__ */ i(l, { children: [
|
|
10
|
+
/* @__PURE__ */ i(p, { ref: d, "data-testid": "video-frame", children: [
|
|
11
|
+
/* @__PURE__ */ e(m === "cover" ? g : y, { children: r && /* @__PURE__ */ e(s, { customTheme: a, children: /* @__PURE__ */ e(n, { event: t, sdk: r, insightId: o, persistent: !0 }) }) }),
|
|
12
|
+
/* @__PURE__ */ e(u, { children: /* @__PURE__ */ e("div", { className: "divAnchor", children: /* @__PURE__ */ e(
|
|
13
13
|
"video",
|
|
14
14
|
{
|
|
15
15
|
src: "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
|
|
@@ -22,9 +22,9 @@ const x = ({ event: t, layoutMode: a }) => {
|
|
|
22
22
|
}
|
|
23
23
|
) }) })
|
|
24
24
|
] }),
|
|
25
|
-
/* @__PURE__ */ e(
|
|
25
|
+
/* @__PURE__ */ e(f, { children: r && /* @__PURE__ */ e(s, { customTheme: a, children: /* @__PURE__ */ e(n, { event: t, sdk: r, insightId: o, persistent: !0 }) }) })
|
|
26
26
|
] });
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
F as Video
|
|
30
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@lottiefiles/react-lottie-player": "^3.5.4",
|
|
49
|
-
"@streamlayer/sl-eslib": "^5.
|
|
49
|
+
"@streamlayer/sl-eslib": "^5.122.0",
|
|
50
50
|
"@types/lodash.throttle": "^4.1.9",
|
|
51
51
|
"lodash.throttle": "^4.1.1",
|
|
52
52
|
"nanoid": "3.3.7",
|
|
@@ -54,18 +54,18 @@
|
|
|
54
54
|
"react-virtualized-auto-sizer": "^1.0.24",
|
|
55
55
|
"react-window": "^1.8.10",
|
|
56
56
|
"react-window-infinite-loader": "^1.0.9",
|
|
57
|
-
"@streamlayer/
|
|
58
|
-
"@streamlayer/sdk-web": "^1.
|
|
59
|
-
"@streamlayer/
|
|
60
|
-
"@streamlayer/sdk-web-anonymous-auth": "^1.0.
|
|
61
|
-
"@streamlayer/sdk-web-
|
|
62
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
63
|
-
"@streamlayer/sdk-web-core": "^1.
|
|
64
|
-
"@streamlayer/sdk-web-interfaces": "^1.1.
|
|
65
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
66
|
-
"@streamlayer/sdk-web-notifications": "^1.1.
|
|
67
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
68
|
-
"@streamlayer/sdk-web-types": "^1.
|
|
57
|
+
"@streamlayer/sdk-web": "^1.2.0",
|
|
58
|
+
"@streamlayer/sdk-web-analytics": "^1.2.0",
|
|
59
|
+
"@streamlayer/feature-gamification": "^1.4.0",
|
|
60
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.0.9",
|
|
61
|
+
"@streamlayer/sdk-web-api": "^1.3.0",
|
|
62
|
+
"@streamlayer/sdk-web-features": "^1.0.9",
|
|
63
|
+
"@streamlayer/sdk-web-core": "^1.2.0",
|
|
64
|
+
"@streamlayer/sdk-web-interfaces": "^1.1.4",
|
|
65
|
+
"@streamlayer/sdk-web-logger": "^1.0.9",
|
|
66
|
+
"@streamlayer/sdk-web-notifications": "^1.1.4",
|
|
67
|
+
"@streamlayer/sdk-web-storage": "^1.0.9",
|
|
68
|
+
"@streamlayer/sdk-web-types": "^1.3.0"
|
|
69
69
|
},
|
|
70
70
|
"nx": {
|
|
71
71
|
"implicitDependencies": [
|
|
@@ -106,6 +106,6 @@
|
|
|
106
106
|
"vite-plugin-svgr": "^4.2.0",
|
|
107
107
|
"vite-svg-loader": "^5.1.0",
|
|
108
108
|
"vite-tsconfig-paths": "^5.0.1",
|
|
109
|
-
"@streamlayer/react": "^1.
|
|
109
|
+
"@streamlayer/react": "^1.2.0"
|
|
110
110
|
}
|
|
111
111
|
}
|