@streamlayer/react-ui 1.13.0 → 1.13.1
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 +40 -38
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/index.d.ts +2 -0
- package/lib/ui/advertisement/index.js +32 -26
- package/lib/ui/advertisement/overlay/index.d.ts +2 -0
- package/lib/ui/advertisement/overlay/index.js +73 -61
- package/lib/ui/gamification/question/notification/index.js +32 -24
- package/lib/ui/gamification/vote/vote-option/index.js +56 -54
- package/lib/ui/theme/constants.d.ts +3 -0
- package/lib/ui/theme/constants.js +20 -17
- package/lib/ui/theme/masters-theme.js +16 -10
- package/lib/ui/theme/theme.js +5 -3
- package/package.json +14 -14
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { cx as
|
|
2
|
+
import { cx as b } from "@linaria/core";
|
|
3
3
|
import { styled as L } from "@linaria/react";
|
|
4
|
-
import { useStore as
|
|
5
|
-
import { useAnalyticsListener as
|
|
6
|
-
import { useEffect as
|
|
4
|
+
import { useStore as g } from "@nanostores/react";
|
|
5
|
+
import { useAnalyticsListener as P } from "../../../hooks/analytics.js";
|
|
6
|
+
import { useEffect as w, useRef as I } from "react";
|
|
7
7
|
import { eventBus as A } from "@streamlayer/sdk-web-interfaces";
|
|
8
|
-
import { FeatureType as
|
|
9
|
-
import { AdvertisementUI as
|
|
10
|
-
const
|
|
8
|
+
import { FeatureType as E, NotificationPromotionMode as T, PromotionType as U } from "@streamlayer/sdk-web-types";
|
|
9
|
+
import { AdvertisementUI as N } from "../../../ui/advertisement/index.js";
|
|
10
|
+
const V = /* @__PURE__ */ L("div")({
|
|
11
11
|
name: "AdvertisementUIWrap",
|
|
12
12
|
class: "aa6pjif",
|
|
13
13
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
14
|
+
}), W = (r) => {
|
|
15
15
|
const t = r.target;
|
|
16
16
|
if (t instanceof HTMLAnchorElement && t.target === "_blank") {
|
|
17
|
-
const o = t.getAttribute("data-promo-id") || "", i = t.getAttribute("data-promo-type") ||
|
|
17
|
+
const o = t.getAttribute("data-promo-id") || "", i = t.getAttribute("data-promo-type") || U.UNSET;
|
|
18
18
|
t.getAttribute("data-analytics") === "button" && A.emit("advertisement", {
|
|
19
19
|
action: "buttonSelect",
|
|
20
20
|
payload: {
|
|
@@ -29,7 +29,7 @@ const W = /* @__PURE__ */ L("div")({
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
},
|
|
32
|
+
}, j = ({
|
|
33
33
|
gamification: r,
|
|
34
34
|
layoutMode: t,
|
|
35
35
|
skipAutoClose: o,
|
|
@@ -37,41 +37,43 @@ const W = /* @__PURE__ */ L("div")({
|
|
|
37
37
|
sidebar: a,
|
|
38
38
|
banner: d,
|
|
39
39
|
notification: m,
|
|
40
|
-
isMobileScreen:
|
|
41
|
-
persistent:
|
|
42
|
-
externalAd:
|
|
43
|
-
controlVideo:
|
|
40
|
+
isMobileScreen: l,
|
|
41
|
+
persistent: c,
|
|
42
|
+
externalAd: u,
|
|
43
|
+
controlVideo: p
|
|
44
44
|
}) => {
|
|
45
45
|
var f, v, y;
|
|
46
|
-
const n =
|
|
47
|
-
|
|
46
|
+
const n = I(null), e = g(r.advertisement.$store);
|
|
47
|
+
P(n, {
|
|
48
48
|
enabled: !!e.data,
|
|
49
49
|
event: "click",
|
|
50
|
-
listener:
|
|
50
|
+
listener: W
|
|
51
51
|
});
|
|
52
|
-
const
|
|
53
|
-
if (e.data === void 0 || !
|
|
52
|
+
const h = !d && !a;
|
|
53
|
+
if (e.data === void 0 || !c && e.isViewed)
|
|
54
54
|
return null;
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */ s(
|
|
55
|
+
const S = ((y = (v = (f = e == null ? void 0 : e.data) == null ? void 0 : f.notification) == null ? void 0 : v.promotion) == null ? void 0 : y.mode) === T.LOWER_THIRD;
|
|
56
|
+
return /* @__PURE__ */ s(V, {
|
|
57
57
|
ref: n,
|
|
58
58
|
style: {
|
|
59
|
-
height:
|
|
59
|
+
height: h ? "auto" : "100%"
|
|
60
60
|
},
|
|
61
|
-
className:
|
|
62
|
-
children: /* @__PURE__ */ s(
|
|
61
|
+
className: b("SL-AdvertisementUIWrap", l && "mobile-view", S && "SL-AdvertisementUIWrap--lower-third"),
|
|
62
|
+
children: /* @__PURE__ */ s(N, {
|
|
63
63
|
skipTypeCheck: i,
|
|
64
64
|
sidebar: a,
|
|
65
65
|
banner: d,
|
|
66
66
|
advertisement: e.data,
|
|
67
|
+
advertisementPaused: e.isPaused,
|
|
68
|
+
togglePause: e.togglePause,
|
|
67
69
|
close: e.close,
|
|
68
|
-
externalAd:
|
|
70
|
+
externalAd: u ? e.externalAd : void 0,
|
|
69
71
|
markAsViewed: r.advertisement.markAsViewed,
|
|
70
72
|
open: r.advertisement.open,
|
|
71
73
|
layoutMode: t,
|
|
72
74
|
isNotification: m,
|
|
73
75
|
skipAutoClose: o,
|
|
74
|
-
controlVideo:
|
|
76
|
+
controlVideo: p
|
|
75
77
|
})
|
|
76
78
|
});
|
|
77
79
|
}, _ = ({
|
|
@@ -82,12 +84,12 @@ const W = /* @__PURE__ */ L("div")({
|
|
|
82
84
|
skipAutoClose: a,
|
|
83
85
|
skipTypeCheck: d,
|
|
84
86
|
layoutMode: m,
|
|
85
|
-
isMobileScreen:
|
|
86
|
-
persistent:
|
|
87
|
-
notification:
|
|
87
|
+
isMobileScreen: l,
|
|
88
|
+
persistent: c,
|
|
89
|
+
notification: u
|
|
88
90
|
}) => {
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
+
const p = g(r.featuresList.getStore());
|
|
92
|
+
if (w(() => {
|
|
91
93
|
if (o) {
|
|
92
94
|
const e = document.createElement("script");
|
|
93
95
|
e.async = !0, e.src = "https://imasdk.googleapis.com/js/sdkloader/ima3.js", document.body.appendChild(e);
|
|
@@ -106,17 +108,17 @@ const W = /* @__PURE__ */ L("div")({
|
|
|
106
108
|
},
|
|
107
109
|
children: "externalAd is not supported with banner"
|
|
108
110
|
});
|
|
109
|
-
if (!
|
|
111
|
+
if (!p)
|
|
110
112
|
return null;
|
|
111
|
-
const n = r.getFeature(
|
|
112
|
-
return n ? /* @__PURE__ */ s(
|
|
113
|
+
const n = r.getFeature(E.GAMES);
|
|
114
|
+
return n ? /* @__PURE__ */ s(j, {
|
|
113
115
|
gamification: n,
|
|
114
116
|
sidebar: t,
|
|
115
117
|
banner: i,
|
|
116
118
|
layoutMode: m,
|
|
117
|
-
isMobileScreen:
|
|
118
|
-
persistent:
|
|
119
|
-
notification:
|
|
119
|
+
isMobileScreen: l,
|
|
120
|
+
persistent: c,
|
|
121
|
+
notification: u,
|
|
120
122
|
skipTypeCheck: d,
|
|
121
123
|
skipAutoClose: a,
|
|
122
124
|
externalAd: o,
|
|
@@ -124,6 +126,6 @@ const W = /* @__PURE__ */ L("div")({
|
|
|
124
126
|
}) : null;
|
|
125
127
|
};
|
|
126
128
|
export {
|
|
127
|
-
|
|
129
|
+
V as AdvertisementUIWrap,
|
|
128
130
|
_ as StreamLayerSDKAdvertisement
|
|
129
131
|
};
|