prebid-universal-creative 1.14.2 → 1.15.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/gulpfile.js CHANGED
@@ -30,28 +30,48 @@ function clean() {
30
30
  .pipe(gulpClean());
31
31
  }
32
32
 
33
- function buildDev() {
34
- return gulp.src(['src/creative.js'])
35
- .pipe(webpackStream(webpackConfig))
33
+ /**
34
+ * This generic function will compile the file specified as inputFile and will
35
+ * generate an output file in the build directory.
36
+ */
37
+ function buildDev({ inputFile, outputFile }) {
38
+ var cloned = _.cloneDeep(webpackConfig);
39
+ cloned.output.filename = outputFile;
40
+ return gulp.src([inputFile])
41
+ .pipe(webpackStream(cloned))
36
42
  .pipe(gulp.dest('build'));
37
43
  }
38
44
 
39
- function buildNativeDev() {
40
- var cloned = _.cloneDeep(webpackConfig);
41
- cloned.output.filename = 'native-trk.js';
45
+ function buildLegacyDev() {
46
+ return buildDev({ inputFile: 'src/legacy.js', outputFile: 'creative.js' });
47
+ }
42
48
 
43
- return gulp.src(['src/nativeTrackers.js'])
44
- .pipe(webpackStream(cloned))
45
- .pipe(gulp.dest('build'));
49
+ function buildBannerDev() {
50
+ return buildDev({ inputFile: 'src/creative.js', outputFile: 'banner.js' });
51
+ }
52
+
53
+ function buildVideoDev() {
54
+ return buildDev({ inputFile: 'src/creative.js', outputFile: 'video.js' });
55
+ }
56
+
57
+ function buildAmpDev() {
58
+ return buildDev({ inputFile: 'src/ampOrMobile.js', outputFile: 'amp.js' });
59
+ }
60
+
61
+ function buildMobileDev() {
62
+ return buildDev({ inputFile: 'src/ampOrMobile.js', outputFile: 'mobile.js' });
63
+ }
64
+
65
+ function buildNativeDev() {
66
+ return buildDev({ inputFile: 'src/nativeTrackers.js', outputFile: 'native-trk.js' });
46
67
  }
47
68
 
48
69
  function buildNativeRenderDev() {
49
- var cloned = _.cloneDeep(webpackConfig);
50
- cloned.output.filename = 'native-render.js';
70
+ return buildDev({ inputFile: 'src/nativeRender.js', outputFile: 'native.js' });
71
+ }
51
72
 
52
- return gulp.src(['src/nativeRender.js'])
53
- .pipe(webpackStream(cloned))
54
- .pipe(gulp.dest('build'));
73
+ function buildNativeRenderLegacyDev() {
74
+ return buildDev({ inputFile: 'src/legacyNativeRender.js', outputFile: 'native-render.js' });
55
75
  }
56
76
 
57
77
  function buildCookieSync() {
@@ -93,25 +113,19 @@ function buildCookieSyncWithConsent() {
93
113
  }
94
114
 
95
115
  function buildUidDev() {
96
- var cloned = _.cloneDeep(webpackConfig);
97
- delete cloned.devtool;
98
- cloned.output.filename = 'uid.js';
99
-
100
- return gulp.src(['src/ssp-userids/uid.js'])
101
- .pipe(webpackStream(cloned))
102
- .pipe(gulp.dest('build'));
116
+ return buildDev({ inputFile: 'src/ssp-userids/uid.js', outputFile: 'uid.js' });
103
117
  }
104
118
 
105
- function buildProd() {
119
+ function buildProdLegacy() {
106
120
  let cloned = _.cloneDeep(webpackConfig);
107
121
  delete cloned.devtool;
108
122
 
109
- return gulp.src(['src/creative.js'])
123
+ return gulp.src(['src/legacy.js'])
110
124
  .pipe(webpackStream(cloned))
111
125
  .pipe(rename({ extname: '.max.js' }))
112
126
  .pipe(gulp.dest('dist'))
113
127
  .pipe(uglify())
114
- .pipe(header(banner, { creative: creative }))
128
+ .pipe(header('/* v<%= creative.version %>\n' + dateString + '\nDEPRECATED, please use creative based on hb_format targeting */\n', { creative: creative }))
115
129
  .pipe(rename({
116
130
  basename: 'creative',
117
131
  extname: '.js'
@@ -119,28 +133,53 @@ function buildProd() {
119
133
  .pipe(gulp.dest('dist'));
120
134
  }
121
135
 
122
- function buildNative() {
123
- var cloned = _.cloneDeep(webpackConfig);
136
+ function includeStaticVastXmlFile() {
137
+ let target = gulp.src('static/prebid-mobile-rewarded-vast.xml');
138
+ return target.pipe(gulp.dest('dist'));
139
+ }
140
+
141
+ function buildProd({ inputFile, outputFile }) {
142
+ let cloned = _.cloneDeep(webpackConfig);
124
143
  delete cloned.devtool;
125
- cloned.output.filename = 'native-trk.js';
126
144
 
127
- return gulp.src(['src/nativeTrackers.js'])
145
+ return gulp.src([inputFile])
128
146
  .pipe(webpackStream(cloned))
147
+ .pipe(gulp.dest('dist'))
129
148
  .pipe(uglify())
130
- .pipe(header('/* v<%= creative.version %>\n' + dateString + ' */\n', { creative: creative }))
149
+ .pipe(header(banner, { creative: creative }))
150
+ .pipe(rename({
151
+ basename: outputFile.split('.')[0],
152
+ extname: `.${outputFile.split('.')[1]}`
153
+ }))
131
154
  .pipe(gulp.dest('dist'));
132
155
  }
133
156
 
157
+ function buildBanner() {
158
+ return buildProd({ inputFile: 'src/creative.js', outputFile: 'banner.js' });
159
+ }
160
+
161
+ function buildVideo() {
162
+ return buildProd({ inputFile: 'src/creative.js', outputFile: 'video.js' });
163
+ }
164
+
165
+ function buildAmp() {
166
+ return buildProd({ inputFile: 'src/ampOrMobile.js', outputFile: 'amp.js' });
167
+ }
168
+
169
+ function buildMobile() {
170
+ return buildProd({ inputFile: 'src/ampOrMobile.js', outputFile: 'mobile.js' });
171
+ }
172
+
173
+ function buildNative() {
174
+ return buildProd({ inputFile: 'src/nativeTrackers.js', outputFile: 'native-trk.js' });
175
+ }
176
+
134
177
  function buildNativeRender() {
135
- var cloned = _.cloneDeep(webpackConfig);
136
- delete cloned.devtool;
137
- cloned.output.filename = 'native-render.js';
178
+ return buildProd({ inputFile: 'src/nativeRender.js', outputFile: 'native.js' });
179
+ }
138
180
 
139
- return gulp.src(['src/nativeRender.js'])
140
- .pipe(webpackStream(cloned))
141
- .pipe(uglify())
142
- .pipe(header('/* v<%= creative.version %>\n' + dateString + ' */\n', { creative: creative }))
143
- .pipe(gulp.dest('dist'));
181
+ function buildLegacyNativeRender() {
182
+ return buildProd({ inputFile: 'src/legacyNativeRender.js', outputFile: 'native-render.js' });
144
183
  }
145
184
 
146
185
  function buildUid() {
@@ -205,7 +244,9 @@ function setupE2E(done) {
205
244
 
206
245
  gulp.task('test', gulp.series(clean, test));
207
246
 
208
- gulp.task('e2e-test', gulp.series(clean, setupE2E, gulp.parallel(buildDev, buildCookieSync, buildCookieSyncWithConsent, buildNativeDev, buildNativeRenderDev, buildUidDev, includeStaticVastXmlFile, watch), test));
247
+ const buildDevFunctions = [buildLegacyDev, buildBannerDev, buildVideoDev, buildAmpDev, buildMobileDev, buildNativeRenderLegacyDev, buildNativeDev, buildNativeRenderDev, buildCookieSync, buildCookieSyncWithConsent, buildUidDev, includeStaticVastXmlFile];
248
+
249
+ gulp.task('e2e-test', gulp.series(clean, setupE2E, gulp.parallel(...buildDevFunctions, watch), test));
209
250
 
210
251
  function watch(done) {
211
252
  const mainWatcher = gulp.watch([
@@ -220,7 +261,7 @@ function watch(done) {
220
261
  root: './'
221
262
  });
222
263
 
223
- mainWatcher.on('all', gulp.series(clean, gulp.parallel(buildDev, buildNativeDev, buildNativeRenderDev, buildCookieSync, buildCookieSyncWithConsent, buildUidDev, includeStaticVastXmlFile), test));
264
+ mainWatcher.on('all', gulp.series(clean, gulp.parallel(...buildDevFunctions), test));
224
265
  done();
225
266
  }
226
267
 
@@ -228,9 +269,11 @@ function openWebPage() {
228
269
  return opens(`${(argv.https) ? 'https' : 'http'}://localhost:${port}`);
229
270
  }
230
271
 
231
- gulp.task('serve', gulp.series(clean, gulp.parallel(buildDev, buildNativeDev, buildNativeRenderDev, buildCookieSync, buildCookieSyncWithConsent, buildUidDev, includeStaticVastXmlFile, watch, test), openWebPage));
272
+ gulp.task('serve', gulp.series(clean, gulp.parallel(...buildDevFunctions, watch, test), openWebPage));
273
+
274
+ gulp.task('build-dev', gulp.parallel(...buildDevFunctions));
232
275
 
233
- gulp.task('build', gulp.parallel(buildProd, buildCookieSync, buildCookieSyncWithConsent, buildNative, buildNativeRender, buildUid, includeStaticVastXmlFile));
276
+ gulp.task('build', gulp.parallel(buildProdLegacy, buildLegacyNativeRender, buildBanner, buildVideo, buildCookieSync, buildCookieSyncWithConsent, buildNative, buildNativeRender, buildUid, buildAmp, buildMobile, includeStaticVastXmlFile));
234
277
 
235
278
  gulp.task('test-coverage', (done) => {
236
279
  new KarmaServer(karmaConfMaker(true, false, false), newKarmaCallback(done)).start();
package/package.json CHANGED
@@ -1,84 +1,82 @@
1
1
  {
2
- "name": "prebid-universal-creative",
3
- "version": "1.14.2",
4
- "description": "Universal creative for Prebid apps",
5
- "main": "dist/creative.js",
6
- "engines": {
7
- "node": "<=8.7.0"
8
- },
9
- "scripts": {
10
- "test": "echo test",
11
- "prepublish": "gulp build"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "git+https://github.com/prebid/prebid-universal-creative.git"
16
- },
17
- "keywords": [
18
- "Prebid.js"
19
- ],
20
- "globalVarName": "pbjs",
21
- "author": "Prebid.org Contributors",
22
- "license": "Apache-2.0",
23
- "bugs": {
24
- "url": "https://github.com/prebid/prebid-universal-creative/issues"
25
- },
26
- "homepage": "https://github.com/prebid/prebid-universal-creative#readme",
27
- "devDependencies": {
28
- "@babel/core": "^7.2.2",
29
- "@babel/plugin-transform-modules-commonjs": "^7.6.0",
30
- "@babel/preset-env": "^7.2.3",
31
- "@babel/register": "^7.6.2",
32
- "@wdio/browserstack-service": "^6.1.4",
33
- "@wdio/cli": "^6.12.1",
34
- "@wdio/concise-reporter": "^7.5.2",
35
- "@wdio/local-runner": "^7.5.2",
36
- "@wdio/mocha-framework": "^7.5.2",
37
- "@wdio/spec-reporter": "^7.5.2",
38
- "@wdio/sync": "^7.5.2",
39
- "babel-loader": "^8.0.5",
40
- "babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
41
- "babel-plugin-transform-es3-property-literals": "^6.22.0",
42
- "chai": "^4.1.2",
43
- "core-js": "^3.13.0",
44
- "core-js-pure": "^3.13.0",
45
- "del": "^5.0.0",
46
- "execa": "^1.0.0",
47
- "gulp": "^4.0.2",
48
- "gulp-clean": "^0.4.0",
49
- "gulp-connect": "^5.7.0",
50
- "gulp-eslint": "^4.0.2",
51
- "gulp-header": "^2.0.1",
52
- "gulp-inject": "^5.0.2",
53
- "gulp-rename": "^1.2.2",
54
- "gulp-replace": "^0.6.1",
55
- "gulp-uglify": "^3.0.0",
56
- "istanbul": "^0.4.5",
57
- "istanbul-instrumenter-loader": "^3.0.0",
58
- "karma": "^6.4.0",
59
- "karma-browserstack-launcher": "^1.3.0",
60
- "karma-chai": "^0.1.0",
61
- "karma-chrome-launcher": "^2.2.0",
62
- "karma-coverage": "^1.1.2",
63
- "karma-coverage-istanbul-reporter": "^1.4.3",
64
- "karma-mocha": "^1.3.0",
65
- "karma-mocha-reporter": "^2.2.5",
66
- "karma-sinon": "^1.0.5",
67
- "karma-sourcemap-loader": "^0.3.7",
68
- "karma-spec-reporter": "^0.0.31",
69
- "karma-webpack": "^3.0.5",
70
- "lodash": "^4.17.14",
71
- "mocha": "^5.2.0",
72
- "opn": "^6.0.0",
73
- "sinon": "^6.3.4",
74
- "string-replace-webpack-plugin": "^0.1.3",
75
- "webdriverio": "^4.13.2",
76
- "webpack": "^3.12.0",
77
- "webpack-stream": "^4.0.0",
78
- "yargs": "^11.0.0"
79
- },
80
- "dependencies": {
81
- "babel-plugin-transform-object-assign": "^6.22.0",
82
- "postscribe": "^2.0.8"
83
- }
2
+ "name": "prebid-universal-creative",
3
+ "version": "1.15.0",
4
+ "description": "Universal creative for Prebid apps",
5
+ "main": "dist/creative.js",
6
+ "scripts": {
7
+ "test": "echo test",
8
+ "prepublish": "gulp build"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/prebid/prebid-universal-creative.git"
13
+ },
14
+ "keywords": [
15
+ "Prebid.js"
16
+ ],
17
+ "globalVarName": "pbjs",
18
+ "author": "Prebid.org Contributors",
19
+ "license": "Apache-2.0",
20
+ "bugs": {
21
+ "url": "https://github.com/prebid/prebid-universal-creative/issues"
22
+ },
23
+ "homepage": "https://github.com/prebid/prebid-universal-creative#readme",
24
+ "devDependencies": {
25
+ "@babel/core": "^7.2.2",
26
+ "@babel/plugin-transform-modules-commonjs": "^7.6.0",
27
+ "@babel/preset-env": "^7.2.3",
28
+ "@babel/register": "^7.6.2",
29
+ "@wdio/browserstack-service": "^7.25.4",
30
+ "@wdio/cli": "^7.25.4",
31
+ "@wdio/concise-reporter": "^7.25.4",
32
+ "@wdio/local-runner": "^7.25.4",
33
+ "@wdio/mocha-framework": "^7.25.4",
34
+ "@wdio/spec-reporter": "^7.25.4",
35
+ "@wdio/sync": "^7.25.4",
36
+ "babel-loader": "^8.0.5",
37
+ "babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
38
+ "babel-plugin-transform-es3-property-literals": "^6.22.0",
39
+ "chai": "^4.1.2",
40
+ "core-js": "^3.13.0",
41
+ "core-js-pure": "^3.13.0",
42
+ "del": "^5.0.0",
43
+ "execa": "^1.0.0",
44
+ "gulp": "^4.0.2",
45
+ "gulp-clean": "^0.4.0",
46
+ "gulp-connect": "^5.7.0",
47
+ "gulp-eslint": "^4.0.2",
48
+ "gulp-header": "^2.0.1",
49
+ "gulp-inject": "^5.0.2",
50
+ "gulp-rename": "^1.2.2",
51
+ "gulp-replace": "^0.6.1",
52
+ "gulp-uglify": "^3.0.0",
53
+ "istanbul": "^0.4.5",
54
+ "istanbul-instrumenter-loader": "^3.0.0",
55
+ "karma": "^6.4.0",
56
+ "karma-browserstack-launcher": "^1.3.0",
57
+ "karma-chai": "^0.1.0",
58
+ "karma-chrome-launcher": "^2.2.0",
59
+ "karma-coverage": "^1.1.2",
60
+ "karma-coverage-istanbul-reporter": "^1.4.3",
61
+ "karma-mocha": "^1.3.0",
62
+ "karma-mocha-reporter": "^2.2.5",
63
+ "karma-sinon": "^1.0.5",
64
+ "karma-sourcemap-loader": "^0.3.7",
65
+ "karma-spec-reporter": "^0.0.31",
66
+ "karma-webpack": "^3.0.5",
67
+ "lodash": "^4.17.14",
68
+ "mocha": "^5.2.0",
69
+ "opn": "^6.0.0",
70
+ "sinon": "^6.3.4",
71
+ "string-replace-webpack-plugin": "^0.1.3",
72
+ "webdriverio": "^7.25.2",
73
+ "webpack": "^3.12.0",
74
+ "webpack-stream": "^4.0.0",
75
+ "yargs": "^11.0.0",
76
+ "webpack-common-shake": "^1.0.0"
77
+ },
78
+ "dependencies": {
79
+ "babel-plugin-transform-object-assign": "^6.22.0",
80
+ "postscribe": "^2.0.8"
81
+ }
84
82
  }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * creative.js
3
+ *
4
+ * This file is inserted into the prebid creative as a placeholder for the winning prebid creative. It should support the following format:
5
+ * - AMP creatives
6
+ */
7
+
8
+ import { renderAmpOrMobileAd } from './mobileAndAmpRender';
9
+
10
+ window.ucTag = (window.ucTag || {});
11
+
12
+ window.ucTag.renderAd = (doc, dataObject) => {
13
+ renderAmpOrMobileAd(dataObject);
14
+ }
package/src/creative.js CHANGED
@@ -4,18 +4,11 @@
4
4
  * This file is inserted into the prebid creative as a placeholder for the winning prebid creative. It should support the following formats:
5
5
  * - Banner
6
6
  * - Outstream Video
7
- * - Mobile
8
- * - AMP creatives
9
7
  * - All safeFrame creatives
10
8
  */
11
9
 
12
- import { newRenderingManager } from './renderingManager';
13
- import { newEnvironment } from './environment';
10
+ import { renderBannerOrDisplayAd } from './renderingManager';
14
11
 
15
12
  window.ucTag = (window.ucTag || {});
16
13
 
17
- const environment = newEnvironment(window);
18
- const renderCreative = newRenderingManager(window, environment);
19
-
20
-
21
- window.ucTag.renderAd = renderCreative.renderAd;
14
+ window.ucTag.renderAd = renderBannerOrDisplayAd;
@@ -10,88 +10,75 @@
10
10
  * Mobile App: function to detect mobile app environment
11
11
  */
12
12
 
13
+ /**
14
+ * @param {String} uuid key value from auction, contains the cache id of the winning bid stored in prebid cache
15
+ * @returns true if there is an AMP context object
16
+ */
17
+ export function isAmp(uuid, win) {
18
+ // TODO Use amp context once it is available in cross domain
19
+ // https://github.com/ampproject/amphtml/issues/6829
20
+ return typeof uuid === 'string' && uuid !== "" && isCrossDomain(win);
21
+ }
13
22
 
14
- export function newEnvironment(win) {
15
- /**
16
- * @param {String} uuid key value from auction, contains the cache id of the winning bid stored in prebid cache
17
- * @returns true if there is an AMP context object
18
- */
19
- function isAmp(uuid) {
20
- // TODO Use amp context once it is available in cross domain
21
- // https://github.com/ampproject/amphtml/issues/6829
22
- return typeof uuid === 'string' && uuid !== "" && isCrossDomain();
23
- }
24
-
25
- /**
26
- * @returns true if the environment is a SafeFrame.
27
- */
28
- function isSafeFrame() {
29
- return !!(win.$sf && win.$sf.ext);
30
- }
23
+ /**
24
+ * @returns true if the environment is a SafeFrame.
25
+ */
26
+ export function isSafeFrame(win) {
27
+ return !!(win.$sf && win.$sf.ext);
28
+ }
31
29
 
32
- /**
33
- * Return true if we are in an iframe and can't access the top window.
34
- * @returns true if the environment is a Cross Domain
35
- */
36
- function isCrossDomain() {
37
- return win.top !== win && !canInspectWindow(win);
38
- }
30
+ /**
31
+ * Return true if we are in an iframe and can't access the top window.
32
+ * @returns true if the environment is a Cross Domain
33
+ */
34
+ export function isCrossDomain(win) {
35
+ return win.top !== win && !canInspectWindow(win);
36
+ }
39
37
 
40
- /**
41
- * Returns true if win's properties can be accessed and win is defined.
42
- * This functioned is used to determine if a window is cross-domained
43
- * from the perspective of the current window.
44
- * @param {!Window} win
45
- * @return {boolean}
46
- */
47
- function canInspectWindow(win) {
48
- try {
49
- // force an exception in x-domain environments. #1509
50
- win.top.location.toString();
51
- return true;
52
- } catch (e) {
53
- return false;
54
- }
38
+ /**
39
+ * Returns true if win's properties can be accessed and win is defined.
40
+ * This functioned is used to determine if a window is cross-domained
41
+ * from the perspective of the current window.
42
+ * @param {!Window} win
43
+ * @return {boolean}
44
+ */
45
+ export function canInspectWindow(win) {
46
+ try {
47
+ // force an exception in x-domain environments. #1509
48
+ win.top.location.toString();
49
+ return true;
50
+ } catch (e) {
51
+ return false;
55
52
  }
53
+ }
56
54
 
57
- /**
58
- * Returns true if we can find the prebid global object (eg pbjs) as we
59
- * climb the accessible windows. Return false if it's not found.
60
- * @returns {boolean}
61
- */
62
- function canLocatePrebid() {
63
- let result = false;
64
- let currentWindow = win;
65
-
66
- while (!result) {
67
- try {
68
- if (currentWindow.$$PREBID_GLOBAL$$) {
69
- result = true;
70
- break;
71
- }
72
- } catch (e) { }
73
- if (currentWindow === window.top) break;
74
-
75
- currentWindow = currentWindow.parent;
76
- }
77
- return result;
78
- }
55
+ /**
56
+ * Returns true if we can find the prebid global object (eg pbjs) as we
57
+ * climb the accessible windows. Return false if it's not found.
58
+ * @returns {boolean}
59
+ */
60
+ export function canLocatePrebid(win) {
61
+ let result = false;
62
+ let currentWindow = win;
79
63
 
80
- /**
81
- * @param {String} env key value from auction, indicates the environment where tag is served
82
- * @returns true if env exists and is equal to the string 'mobile-app'
83
- */
84
- function isMobileApp(env) {
85
- return env && env === 'mobile-app';
86
- }
64
+ while (!result) {
65
+ try {
66
+ if (currentWindow.$$PREBID_GLOBAL$$) {
67
+ result = true;
68
+ break;
69
+ }
70
+ } catch (e) { }
71
+ if (currentWindow === window.top) break;
87
72
 
88
- return {
89
- isMobileApp,
90
- isCrossDomain,
91
- isSafeFrame,
92
- isAmp,
93
- canLocatePrebid
73
+ currentWindow = currentWindow.parent;
94
74
  }
75
+ return result;
95
76
  }
96
77
 
97
-
78
+ /**
79
+ * @param {String} env key value from auction, indicates the environment where tag is served
80
+ * @returns true if env exists and is equal to the string 'mobile-app'
81
+ */
82
+ export function isMobileApp(env) {
83
+ return env && env === 'mobile-app';
84
+ }
package/src/legacy.js ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * legacy.js
3
+ * This is deprecated code, publishers should not use one .js creative to handle all different types of creative.
4
+ * To reduce bytes transfered for each ad, publishers should use specific .js based on hb_format targeting key-value.
5
+ *
6
+ * This file is inserted into the prebid creative as a placeholder for the winning prebid creative. It should support the following formats:
7
+ * - Banner
8
+ * - AMP
9
+ * - Mobile
10
+ * - Outstream Video
11
+ * - All safeFrame creatives
12
+ */
13
+
14
+ import { transformAuctionTargetingData } from './utils';
15
+ import { renderBannerOrDisplayAd } from './renderingManager';
16
+ import { renderAmpOrMobileAd } from './mobileAndAmpRender';
17
+ import { isMobileApp, isAmp } from './environment';
18
+
19
+ window.ucTag = (window.ucTag || {});
20
+
21
+ window.ucTag.renderAd = (doc, dataObject) => {
22
+ const targetingData = transformAuctionTargetingData(dataObject);
23
+
24
+ if (isMobileApp(targetingData.env) || isAmp(targetingData.uuid, window)) {
25
+ renderAmpOrMobileAd(dataObject);
26
+ } else {
27
+ renderBannerOrDisplayAd(doc, dataObject);
28
+ }
29
+ }
@@ -0,0 +1,6 @@
1
+ import { newNativeRenderManager } from './nativeRenderManager';
2
+
3
+ window.pbNativeTag = (window.pbNativeTag || {});
4
+ window.nativeRenderManager = newNativeRenderManager(window);
5
+
6
+ window.pbNativeTag.renderNativeAd = (args) => nativeRenderManager.renderNativeAd.call(null, document, args);