@streamlayer/react-ui 1.5.0 → 1.6.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.d.ts +1 -0
- package/lib/app/app/Advertisement/index.js +38 -34
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/banner/index.js +13 -11
- package/lib/ui/advertisement/index.d.ts +1 -0
- package/lib/ui/advertisement/index.js +21 -12
- package/lib/ui/advertisement/notification/index.d.ts +7 -0
- package/lib/ui/advertisement/notification/index.js +31 -0
- package/lib/ui/advertisement/notification/styles.d.ts +35 -0
- package/lib/ui/advertisement/notification/styles.js +80 -0
- package/lib/ui/advertisement/overlay/index.js +27 -27
- package/lib/ui/icons/index.d.ts +2 -0
- package/lib/ui/icons/index.js +58 -53
- package/lib/ui/theme/theme.js +31 -24
- package/package.json +14 -14
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { styled as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { useAnalyticsListener as
|
|
5
|
-
import { useEffect as
|
|
6
|
-
import { eventBus as
|
|
7
|
-
import { FeatureType as
|
|
8
|
-
import { useAppApp as
|
|
9
|
-
import { AdvertisementUI as
|
|
10
|
-
const
|
|
2
|
+
import { styled as v } from "@linaria/react";
|
|
3
|
+
import { useStore as p } from "@nanostores/react";
|
|
4
|
+
import { useAnalyticsListener as A } from "../../../hooks/analytics.js";
|
|
5
|
+
import { useEffect as y, useRef as g, useMemo as S } from "react";
|
|
6
|
+
import { eventBus as u } from "@streamlayer/sdk-web-interfaces";
|
|
7
|
+
import { FeatureType as b, PromotionType as h } from "@streamlayer/sdk-web-types";
|
|
8
|
+
import { useAppApp as L } from "../useApp.js";
|
|
9
|
+
import { AdvertisementUI as E } from "../../../ui/advertisement/index.js";
|
|
10
|
+
const I = /* @__PURE__ */ v("div")({
|
|
11
11
|
name: "AdvertisementUIWrap",
|
|
12
12
|
class: "aa6pjif",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
14
|
+
}), T = (t) => {
|
|
15
15
|
const e = t.target;
|
|
16
16
|
if (e instanceof HTMLAnchorElement && e.target === "_blank") {
|
|
17
|
-
const r = e.getAttribute("data-promo-id") || "", i = e.getAttribute("data-promo-type") ||
|
|
18
|
-
e.getAttribute("data-analytics") === "button" &&
|
|
17
|
+
const r = e.getAttribute("data-promo-id") || "", i = e.getAttribute("data-promo-type") || h.UNSET;
|
|
18
|
+
e.getAttribute("data-analytics") === "button" && u.emit("advertisement", {
|
|
19
19
|
action: "buttonSelect",
|
|
20
20
|
payload: {
|
|
21
21
|
advertisementId: r,
|
|
22
22
|
advertisementType: i
|
|
23
23
|
}
|
|
24
|
-
}), e.getAttribute("data-analytics") === "banner" &&
|
|
24
|
+
}), e.getAttribute("data-analytics") === "banner" && u.emit("advertisement", {
|
|
25
25
|
action: "bannerSelect",
|
|
26
26
|
payload: {
|
|
27
27
|
advertisementId: r,
|
|
@@ -29,58 +29,61 @@ const E = /* @__PURE__ */ p("div")({
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
},
|
|
32
|
+
}, N = ({
|
|
33
33
|
gamification: t,
|
|
34
34
|
layoutMode: e,
|
|
35
35
|
skipTypeCheck: r,
|
|
36
36
|
sidebar: i,
|
|
37
37
|
banner: n,
|
|
38
|
-
|
|
38
|
+
notification: d,
|
|
39
|
+
isMobileScreen: f,
|
|
39
40
|
persistent: a
|
|
40
41
|
}) => {
|
|
41
|
-
const s =
|
|
42
|
+
const s = g(null), m = p(t.advertisement.$list), o = S(
|
|
42
43
|
() => t.advertisement.getActiveAdvertisement(a),
|
|
43
44
|
// fire getActiveNotification when notifications were updated
|
|
44
45
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
46
|
[m, a]
|
|
46
47
|
);
|
|
47
|
-
|
|
48
|
+
A(s, {
|
|
48
49
|
enabled: !!o,
|
|
49
50
|
event: "click",
|
|
50
|
-
listener:
|
|
51
|
+
listener: T
|
|
51
52
|
});
|
|
52
53
|
const c = !n && !i;
|
|
53
|
-
return o ? /* @__PURE__ */ l(
|
|
54
|
+
return o ? /* @__PURE__ */ l(I, {
|
|
54
55
|
ref: s,
|
|
55
56
|
style: {
|
|
56
57
|
height: c ? "auto" : "100%"
|
|
57
58
|
},
|
|
58
|
-
className:
|
|
59
|
-
children: /* @__PURE__ */ l(
|
|
59
|
+
className: f ? "mobile-view" : "",
|
|
60
|
+
children: /* @__PURE__ */ l(E, {
|
|
60
61
|
skipTypeCheck: r,
|
|
61
62
|
sidebar: i,
|
|
62
63
|
banner: n,
|
|
63
64
|
advertisement: o,
|
|
64
|
-
layoutMode: e
|
|
65
|
+
layoutMode: e,
|
|
66
|
+
isNotification: d
|
|
65
67
|
})
|
|
66
68
|
}) : null;
|
|
67
|
-
},
|
|
69
|
+
}, w = ({
|
|
68
70
|
sdk: t,
|
|
69
71
|
sidebar: e,
|
|
70
72
|
banner: r,
|
|
71
73
|
skipTypeCheck: i,
|
|
72
74
|
event: n,
|
|
73
75
|
layoutMode: d,
|
|
74
|
-
isMobileScreen:
|
|
75
|
-
persistent:
|
|
76
|
+
isMobileScreen: f,
|
|
77
|
+
persistent: a,
|
|
78
|
+
notification: s
|
|
76
79
|
}) => {
|
|
77
80
|
const {
|
|
78
81
|
deactivate: m
|
|
79
|
-
} =
|
|
80
|
-
|
|
82
|
+
} = L(t);
|
|
83
|
+
y(() => {
|
|
81
84
|
n ? t.createEventSession(n) : m();
|
|
82
85
|
}, [n, m, t]);
|
|
83
|
-
const o =
|
|
86
|
+
const o = p(t.featuresList.getStore());
|
|
84
87
|
if (e && r)
|
|
85
88
|
return /* @__PURE__ */ l("div", {
|
|
86
89
|
style: {
|
|
@@ -90,18 +93,19 @@ const E = /* @__PURE__ */ p("div")({
|
|
|
90
93
|
});
|
|
91
94
|
if (!o)
|
|
92
95
|
return null;
|
|
93
|
-
const c = t.getFeature(
|
|
94
|
-
return c ? /* @__PURE__ */ l(
|
|
96
|
+
const c = t.getFeature(b.GAMES);
|
|
97
|
+
return c ? /* @__PURE__ */ l(N, {
|
|
95
98
|
gamification: c,
|
|
96
99
|
sidebar: e,
|
|
97
100
|
banner: r,
|
|
98
101
|
layoutMode: d,
|
|
99
|
-
isMobileScreen:
|
|
100
|
-
persistent:
|
|
102
|
+
isMobileScreen: f,
|
|
103
|
+
persistent: a,
|
|
104
|
+
notification: s,
|
|
101
105
|
skipTypeCheck: i
|
|
102
106
|
}) : null;
|
|
103
107
|
};
|
|
104
108
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
I as AdvertisementUIWrap,
|
|
110
|
+
w as StreamLayerSDKAdvertisement
|
|
107
111
|
};
|