@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.
@@ -1,20 +1,20 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { cx as g } from "@linaria/core";
2
+ import { cx as b } from "@linaria/core";
3
3
  import { styled as L } from "@linaria/react";
4
- import { useStore as h } from "@nanostores/react";
5
- import { useAnalyticsListener as w } from "../../../hooks/analytics.js";
6
- import { useEffect as I, useRef as E } from "react";
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 T, NotificationPromotionMode as U, PromotionType as N } from "@streamlayer/sdk-web-types";
9
- import { AdvertisementUI as V } from "../../../ui/advertisement/index.js";
10
- const W = /* @__PURE__ */ L("div")({
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
- }), j = (r) => {
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") || N.UNSET;
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
- }, k = ({
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: c,
41
- persistent: l,
42
- externalAd: p,
43
- controlVideo: u
40
+ isMobileScreen: l,
41
+ persistent: c,
42
+ externalAd: u,
43
+ controlVideo: p
44
44
  }) => {
45
45
  var f, v, y;
46
- const n = E(null), e = h(r.advertisement.$store);
47
- w(n, {
46
+ const n = I(null), e = g(r.advertisement.$store);
47
+ P(n, {
48
48
  enabled: !!e.data,
49
49
  event: "click",
50
- listener: j
50
+ listener: W
51
51
  });
52
- const S = !d && !a;
53
- if (e.data === void 0 || !l && e.isViewed)
52
+ const h = !d && !a;
53
+ if (e.data === void 0 || !c && e.isViewed)
54
54
  return null;
55
- const b = ((y = (v = (f = e == null ? void 0 : e.data) == null ? void 0 : f.notification) == null ? void 0 : v.promotion) == null ? void 0 : y.mode) === U.LOWER_THIRD;
56
- return /* @__PURE__ */ s(W, {
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: S ? "auto" : "100%"
59
+ height: h ? "auto" : "100%"
60
60
  },
61
- className: g("SL-AdvertisementUIWrap", c && "mobile-view", b && "SL-AdvertisementUIWrap--lower-third"),
62
- children: /* @__PURE__ */ s(V, {
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: p ? e.externalAd : void 0,
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: u
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: c,
86
- persistent: l,
87
- notification: p
87
+ isMobileScreen: l,
88
+ persistent: c,
89
+ notification: u
88
90
  }) => {
89
- const u = h(r.featuresList.getStore());
90
- if (I(() => {
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 (!u)
111
+ if (!p)
110
112
  return null;
111
- const n = r.getFeature(T.GAMES);
112
- return n ? /* @__PURE__ */ s(k, {
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: c,
118
- persistent: l,
119
- notification: p,
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
- W as AdvertisementUIWrap,
129
+ V as AdvertisementUIWrap,
128
130
  _ as StreamLayerSDKAdvertisement
129
131
  };