@mjhls/mjh-framework 1.0.874-ad-test-v4 → 1.0.874
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/dist/cjs/AD300x250.js +7 -41
- package/dist/esm/AD300x250.js +8 -42
- package/package.json +1 -1
package/dist/cjs/AD300x250.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('./stringify-f7a37a8d.js');
|
|
3
4
|
var slicedToArray = require('./slicedToArray-067dd3bc.js');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var main = require('./main-025fdc78.js');
|
|
6
7
|
var AdSlot = require('./AdSlot.js');
|
|
7
8
|
require('./_commonjsHelpers-06173234.js');
|
|
8
|
-
require('./web.dom.iterable-d98303e0.js');
|
|
9
9
|
require('./core.get-iterator-method-5643aa10.js');
|
|
10
|
+
require('./web.dom.iterable-d98303e0.js');
|
|
10
11
|
require('./extends-7c86182f.js');
|
|
11
12
|
require('./_object-pie-083f2dd6.js');
|
|
12
13
|
require('prop-types');
|
|
@@ -16,7 +17,6 @@ require('./debounce-d4a2369b.js');
|
|
|
16
17
|
require('./isSymbol-03abbdf0.js');
|
|
17
18
|
require('./toNumber-5e1fac58.js');
|
|
18
19
|
require('./Beam.js');
|
|
19
|
-
require('./stringify-f7a37a8d.js');
|
|
20
20
|
require('./asyncToGenerator-77821af0.js');
|
|
21
21
|
require('./_library-dd23b178.js');
|
|
22
22
|
require('./_iter-detect-b1df62f0.js');
|
|
@@ -42,12 +42,11 @@ var AD300x250 = function AD300x250(_ref) {
|
|
|
42
42
|
pos = 'rec1-mobile';
|
|
43
43
|
mobileView = true;
|
|
44
44
|
}
|
|
45
|
-
var adContainer = React.useRef(null);
|
|
46
45
|
|
|
47
46
|
var _useState = React.useState(true),
|
|
48
|
-
_useState2 = slicedToArray._slicedToArray(_useState, 2)
|
|
49
|
-
|
|
50
|
-
setPreviewAd = _useState2[1];
|
|
47
|
+
_useState2 = slicedToArray._slicedToArray(_useState, 2);
|
|
48
|
+
_useState2[0];
|
|
49
|
+
var setPreviewAd = _useState2[1];
|
|
51
50
|
|
|
52
51
|
React.useEffect(function () {
|
|
53
52
|
var path = window && window.location && window.location.search;
|
|
@@ -72,42 +71,9 @@ var AD300x250 = function AD300x250(_ref) {
|
|
|
72
71
|
var browserSizes = [[300, 600], [300, 250], [300, 100]];
|
|
73
72
|
var mobileSizes = [[300, 250], [300, 100]];
|
|
74
73
|
|
|
75
|
-
// CallBack function to check if ad has got creative or not.
|
|
76
|
-
var checkIsAdFound = function checkIsAdFound(isFound, adData) {
|
|
77
|
-
if (isFound && adData && main.main_43) {
|
|
78
|
-
|
|
79
|
-
if (typeof adData.event.size[1] === "number") {
|
|
80
|
-
adContainer.current.style.minHeight = adData.event.size[1] + 'px';
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// if (isFound) {
|
|
84
|
-
// // Dynamically fetching parent from slotID to display or collapse.
|
|
85
|
-
// const parent = document.getElementById(adData.slotId)
|
|
86
|
-
|
|
87
|
-
// const adSizes = [[1, 1]]
|
|
88
|
-
// // Collapsing ad if the as size is [1,1]
|
|
89
|
-
// if (adData && adData.event && adData.event.size) {
|
|
90
|
-
// const checkAdSize = (size) => {
|
|
91
|
-
// return JSON.stringify(size) === JSON.stringify(adData.event.size)
|
|
92
|
-
// }
|
|
93
|
-
|
|
94
|
-
// if (adSizes.some(checkAdSize)) {
|
|
95
|
-
// // passing slotID to collape
|
|
96
|
-
// collapseAd(adData.slotId)
|
|
97
|
-
// parent.style.display = 'none'
|
|
98
|
-
// } else {
|
|
99
|
-
// parent.style.display = 'block'
|
|
100
|
-
// }
|
|
101
|
-
// }
|
|
102
|
-
// } else {
|
|
103
|
-
// // collapsing ad if no creative is found
|
|
104
|
-
// collapseAd(adData.slotId)
|
|
105
|
-
// }
|
|
106
|
-
};
|
|
107
|
-
|
|
108
74
|
return React__default['default'].createElement(
|
|
109
75
|
'div',
|
|
110
|
-
|
|
76
|
+
null,
|
|
111
77
|
React__default['default'].createElement(AdSlot, {
|
|
112
78
|
networkID: networkID,
|
|
113
79
|
adUnit: adUnit,
|
|
@@ -116,7 +82,7 @@ var AD300x250 = function AD300x250(_ref) {
|
|
|
116
82
|
className: 'AD300x250',
|
|
117
83
|
sizes: mobileView ? mobileSizes : browserSizes
|
|
118
84
|
/* Passing function to check for ad creative only if it is not in preview. */
|
|
119
|
-
|
|
85
|
+
// checkIsAdFound={previewAd ? null : checkIsAdFound}
|
|
120
86
|
// style={{ display: 'none' }}
|
|
121
87
|
}),
|
|
122
88
|
React__default['default'].createElement(
|
package/dist/esm/AD300x250.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import './stringify-c21932b3.js';
|
|
1
2
|
import { _ as _slicedToArray } from './slicedToArray-ca2c8b8d.js';
|
|
2
|
-
import React, {
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
3
4
|
import { m as main_43 } from './main-b5c5aac1.js';
|
|
4
5
|
import DFPAdSlot from './AdSlot.js';
|
|
5
6
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
6
|
-
import './web.dom.iterable-fdf034f5.js';
|
|
7
7
|
import './core.get-iterator-method-e903ff31.js';
|
|
8
|
+
import './web.dom.iterable-fdf034f5.js';
|
|
8
9
|
import './extends-dc6a71fd.js';
|
|
9
10
|
import './_object-pie-133f504a.js';
|
|
10
11
|
import 'prop-types';
|
|
@@ -14,7 +15,6 @@ import './debounce-533d9748.js';
|
|
|
14
15
|
import './isSymbol-a7e9aafe.js';
|
|
15
16
|
import './toNumber-5aeba6e7.js';
|
|
16
17
|
import './Beam.js';
|
|
17
|
-
import './stringify-c21932b3.js';
|
|
18
18
|
import './asyncToGenerator-b4dfe691.js';
|
|
19
19
|
import './_library-528f1934.js';
|
|
20
20
|
import './_iter-detect-f089461c.js';
|
|
@@ -36,12 +36,11 @@ var AD300x250 = function AD300x250(_ref) {
|
|
|
36
36
|
pos = 'rec1-mobile';
|
|
37
37
|
mobileView = true;
|
|
38
38
|
}
|
|
39
|
-
var adContainer = useRef(null);
|
|
40
39
|
|
|
41
40
|
var _useState = useState(true),
|
|
42
|
-
_useState2 = _slicedToArray(_useState, 2)
|
|
43
|
-
|
|
44
|
-
setPreviewAd = _useState2[1];
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2);
|
|
42
|
+
_useState2[0];
|
|
43
|
+
var setPreviewAd = _useState2[1];
|
|
45
44
|
|
|
46
45
|
useEffect(function () {
|
|
47
46
|
var path = window && window.location && window.location.search;
|
|
@@ -66,42 +65,9 @@ var AD300x250 = function AD300x250(_ref) {
|
|
|
66
65
|
var browserSizes = [[300, 600], [300, 250], [300, 100]];
|
|
67
66
|
var mobileSizes = [[300, 250], [300, 100]];
|
|
68
67
|
|
|
69
|
-
// CallBack function to check if ad has got creative or not.
|
|
70
|
-
var checkIsAdFound = function checkIsAdFound(isFound, adData) {
|
|
71
|
-
if (isFound && adData && main_43) {
|
|
72
|
-
|
|
73
|
-
if (typeof adData.event.size[1] === "number") {
|
|
74
|
-
adContainer.current.style.minHeight = adData.event.size[1] + 'px';
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// if (isFound) {
|
|
78
|
-
// // Dynamically fetching parent from slotID to display or collapse.
|
|
79
|
-
// const parent = document.getElementById(adData.slotId)
|
|
80
|
-
|
|
81
|
-
// const adSizes = [[1, 1]]
|
|
82
|
-
// // Collapsing ad if the as size is [1,1]
|
|
83
|
-
// if (adData && adData.event && adData.event.size) {
|
|
84
|
-
// const checkAdSize = (size) => {
|
|
85
|
-
// return JSON.stringify(size) === JSON.stringify(adData.event.size)
|
|
86
|
-
// }
|
|
87
|
-
|
|
88
|
-
// if (adSizes.some(checkAdSize)) {
|
|
89
|
-
// // passing slotID to collape
|
|
90
|
-
// collapseAd(adData.slotId)
|
|
91
|
-
// parent.style.display = 'none'
|
|
92
|
-
// } else {
|
|
93
|
-
// parent.style.display = 'block'
|
|
94
|
-
// }
|
|
95
|
-
// }
|
|
96
|
-
// } else {
|
|
97
|
-
// // collapsing ad if no creative is found
|
|
98
|
-
// collapseAd(adData.slotId)
|
|
99
|
-
// }
|
|
100
|
-
};
|
|
101
|
-
|
|
102
68
|
return React.createElement(
|
|
103
69
|
'div',
|
|
104
|
-
|
|
70
|
+
null,
|
|
105
71
|
React.createElement(DFPAdSlot, {
|
|
106
72
|
networkID: networkID,
|
|
107
73
|
adUnit: adUnit,
|
|
@@ -110,7 +76,7 @@ var AD300x250 = function AD300x250(_ref) {
|
|
|
110
76
|
className: 'AD300x250',
|
|
111
77
|
sizes: mobileView ? mobileSizes : browserSizes
|
|
112
78
|
/* Passing function to check for ad creative only if it is not in preview. */
|
|
113
|
-
|
|
79
|
+
// checkIsAdFound={previewAd ? null : checkIsAdFound}
|
|
114
80
|
// style={{ display: 'none' }}
|
|
115
81
|
}),
|
|
116
82
|
React.createElement(
|