@highfivve/ad-tag 5.11.0 → 5.11.2
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/ads/modules/sticky-footer-ad-v2/footerStickyAd.js +8 -5
- package/lib/ads/modules/sticky-footer-ad-v2/index.js +2 -1
- package/lib/ads/modules/sticky-header-ad/index.js +2 -1
- package/lib/ads/modules/sticky-header-ad/renderResult.js +5 -2
- package/lib/console/components/globalConfig.js +1 -1
- package/lib/gen/packageJson.js +1 -1
- package/package.json +1 -1
|
@@ -5,12 +5,15 @@ const adStickyCloseButtonContent = '.h5v-closeButtonContent';
|
|
|
5
5
|
const adStickyHidingClass = 'h5v-footerAd--hidden';
|
|
6
6
|
const desktopInitialHidingClass = 'h5v-footerAd--hidden-d';
|
|
7
7
|
const mobileInitialHidingClass = 'h5v-footerAd--hidden-m';
|
|
8
|
-
const stickyRenderedEvent = (mobileStickyDomId, disallowedAdvertiserIds, window) => new Promise(resolve => {
|
|
8
|
+
const stickyRenderedEvent = (mobileStickyDomId, disallowedAdvertiserIds, channel, window) => new Promise(resolve => {
|
|
9
9
|
const listener = (event) => {
|
|
10
10
|
if (event.slot.getSlotElementId() !== mobileStickyDomId) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
if (
|
|
13
|
+
if (channel === 'gam') {
|
|
14
|
+
resolve('disallowed');
|
|
15
|
+
}
|
|
16
|
+
else if (event.isEmpty) {
|
|
14
17
|
resolve('empty');
|
|
15
18
|
}
|
|
16
19
|
else if (isAdvertiserIncluded(event, disallowedAdvertiserIds)) {
|
|
@@ -41,7 +44,7 @@ const hideAdSlot = (element) => {
|
|
|
41
44
|
const showAdSlot = (element) => {
|
|
42
45
|
element.classList.remove(adStickyHidingClass, desktopInitialHidingClass, mobileInitialHidingClass);
|
|
43
46
|
};
|
|
44
|
-
export const initAdSticky = (window, env, log, footerStickyDomId, disallowedAdvertiserIds, closingButtonText) => {
|
|
47
|
+
export const initAdSticky = (window, env, log, footerStickyDomId, disallowedAdvertiserIds, channel, closingButtonText) => {
|
|
45
48
|
const stickyAd = 'sticky-ad';
|
|
46
49
|
const adSticky = window.document.querySelector(adStickyContainerDataRef);
|
|
47
50
|
const closeButton = window.document.querySelector(adStickyCloseButtonDataRef);
|
|
@@ -88,7 +91,7 @@ export const initAdSticky = (window, env, log, footerStickyDomId, disallowedAdve
|
|
|
88
91
|
else if (renderResult === 'standard') {
|
|
89
92
|
showAdSlot(adSticky);
|
|
90
93
|
const stickyOnLoadEventPromise = stickyOnLoadEvent(footerStickyDomId, window);
|
|
91
|
-
return stickyRenderedEvent(footerStickyDomId, disallowedAdvertiserIds, window)
|
|
94
|
+
return stickyRenderedEvent(footerStickyDomId, disallowedAdvertiserIds, channel, window)
|
|
92
95
|
.then(result => result === 'empty' || result === 'disallowed'
|
|
93
96
|
? Promise.resolve(result)
|
|
94
97
|
: stickyOnLoadEventPromise.then(() => result))
|
|
@@ -99,7 +102,7 @@ export const initAdSticky = (window, env, log, footerStickyDomId, disallowedAdve
|
|
|
99
102
|
if (env === 'production') {
|
|
100
103
|
if (footerStickyDomId) {
|
|
101
104
|
const stickyOnLoadEventPromise = stickyOnLoadEvent(footerStickyDomId, window);
|
|
102
|
-
stickyRenderedEvent(footerStickyDomId, disallowedAdvertiserIds, window)
|
|
105
|
+
stickyRenderedEvent(footerStickyDomId, disallowedAdvertiserIds, channel, window)
|
|
103
106
|
.then(result => result === 'empty' || result === 'disallowed'
|
|
104
107
|
? Promise.resolve(result)
|
|
105
108
|
: stickyOnLoadEventPromise.then(() => result))
|
|
@@ -21,7 +21,8 @@ export const createStickyFooterAdsV2 = () => {
|
|
|
21
21
|
ctx.logger__.warn(name, 'mobile and desktop sticky footer are called!');
|
|
22
22
|
}
|
|
23
23
|
if (footerAdSlot) {
|
|
24
|
-
|
|
24
|
+
const channel = ctx.auction__.anchorBottomChannel(footerAdSlot.moliSlot.domId);
|
|
25
|
+
initAdSticky(ctx.window__, ctx.env__, ctx.logger__, footerAdSlot.moliSlot.domId, config.disallowedAdvertiserIds, channel, config.closingButtonText);
|
|
25
26
|
}
|
|
26
27
|
return Promise.resolve();
|
|
27
28
|
})
|
|
@@ -64,7 +64,8 @@ export const createStickyHeaderAd = () => {
|
|
|
64
64
|
? ctx.window__.document.querySelector(navbarConfig.selector)
|
|
65
65
|
: null;
|
|
66
66
|
if (target) {
|
|
67
|
-
const
|
|
67
|
+
const channel = ctx.auction__.anchorTopChannel();
|
|
68
|
+
const adRenderResultPromise = adRenderResult(ctx, headerSlot.moliSlot, config.disallowedAdvertiserIds, channel, minVisibleDuration);
|
|
68
69
|
observer = new IntersectionObserver(intersectionObserverFadeOutCallback(container, target, adRenderResultPromise, navbar, navbarHiddenClass, config.fadeOutClassName), options);
|
|
69
70
|
observeTargetTimeoutId = ctx.window__.setTimeout(() => {
|
|
70
71
|
if (observer) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isAdvertiserIncluded } from 'ad-tag/ads/isAdvertiserIncluded';
|
|
2
|
-
export const adRenderResult = (ctx, headerSlot, disallowedAdvertiserIds, minVisibleDuration) => new Promise(resolve => {
|
|
2
|
+
export const adRenderResult = (ctx, headerSlot, disallowedAdvertiserIds, channel, minVisibleDuration) => new Promise(resolve => {
|
|
3
3
|
if (ctx.env__ === 'test') {
|
|
4
4
|
resolve('standard');
|
|
5
5
|
return;
|
|
@@ -8,7 +8,10 @@ export const adRenderResult = (ctx, headerSlot, disallowedAdvertiserIds, minVisi
|
|
|
8
8
|
if (event.slot.getSlotElementId() !== headerSlot.domId) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
if (
|
|
11
|
+
if (channel === 'gam') {
|
|
12
|
+
resolve('disallowed');
|
|
13
|
+
}
|
|
14
|
+
else if (isAdvertiserIncluded(event, disallowedAdvertiserIds)) {
|
|
12
15
|
resolve('disallowed');
|
|
13
16
|
}
|
|
14
17
|
else if (event.isEmpty) {
|
|
@@ -127,7 +127,7 @@ export class GlobalConfig extends Component {
|
|
|
127
127
|
}) }),
|
|
128
128
|
"Show only rendered slots")),
|
|
129
129
|
config.slots.map((slot, index) => this.isSlotRendered(slot) || !showOnlyRenderedSlots ? (React.createElement("div", { key: index, ref: el => {
|
|
130
|
-
if (el && selectedSlotDomId === slot.domId) {
|
|
130
|
+
if (el && selectedSlotDomId && selectedSlotDomId === slot.domId) {
|
|
131
131
|
el.scrollIntoView({ block: 'start' });
|
|
132
132
|
this.setState({ selectedSlotDomId: undefined });
|
|
133
133
|
}
|
package/lib/gen/packageJson.js
CHANGED