mod-build 3.6.48 → 3.6.49-beta.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.
@@ -5,15 +5,15 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
5
5
  var sequenceOpts;
6
6
 
7
7
  if (siteData.useTypescript) {
8
- sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'compile-prod', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'add-path-subdirectories', 'copy-resources-to-dist', 'build-stat'];
8
+ sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'compile-prod', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'cache-bust', 'add-path-subdirectories', 'copy-resources-to-dist', 'build-stat'];
9
9
  } else if (siteData.isWhiteLabel) {
10
10
  if (siteData.isQSPage) {
11
- sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'copy-videos', 'grab-theme-json', 'combine-files', 'grab-images', 'copy-json', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'copy-files-to-build-path', 'add-path-subdirectories', 'grab-tooltips-json', 'copy-resources-to-dist', 'build-stat'];
11
+ sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'copy-videos', 'grab-theme-json', 'combine-files', 'grab-images', 'copy-json', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'copy-files-to-build-path', 'cache-bust', 'add-path-subdirectories', 'grab-tooltips-json', 'copy-resources-to-dist', 'build-stat'];
12
12
  } else {
13
- sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'copy-videos', 'combine-files', 'grab-images', 'js-lint', 'html-min','grab-global-images', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'add-path-subdirectories', 'grab-tooltips-json', 'copy-resources-to-dist', 'build-stat'];
13
+ sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'copy-videos', 'combine-files', 'grab-images', 'js-lint', 'html-min','grab-global-images', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'cache-bust', 'add-path-subdirectories', 'grab-tooltips-json', 'copy-resources-to-dist', 'build-stat'];
14
14
  }
15
15
  } else {
16
- sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'copy-videos', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'add-path-subdirectories', 'copy-resources-to-dist', 'build-stat'];
16
+ sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'copy-videos', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'cache-bust', 'add-path-subdirectories', 'copy-resources-to-dist', 'build-stat'];
17
17
  }
18
18
 
19
19
  runSequence(...sequenceOpts, function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.48",
3
+ "version": "3.6.49-beta.2",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -0,0 +1,21 @@
1
+ let privacyPreferencesDetected = false;
2
+ let hasGpcParam = false;
3
+ let gpcPluginEnabled = false;
4
+
5
+ function checkForPrivacyParam() {
6
+ const urlParams = new URLSearchParams(window.location.search);
7
+ return urlParams.has('gpc') && urlParams.get('gpc') === 'yes';
8
+ }
9
+
10
+ function detectPrivacyPreferences() {
11
+ return hasGpcParam && gpcPluginEnabled;
12
+ }
13
+
14
+ document.addEventListener('DOMContentLoaded', () => {
15
+ hasGpcParam = checkForPrivacyParam();
16
+ gpcPluginEnabled = typeof navigator.globalPrivacyControl !== 'undefined' && navigator.globalPrivacyControl === 1;
17
+
18
+ privacyPreferencesDetected = detectPrivacyPreferences();
19
+ });
20
+
21
+ export { privacyPreferencesDetected };
@@ -1,6 +1,6 @@
1
1
  var gtm_container_ID = (window.isQSPage && '{{qs_gtm_container_ID}}'.length > 0) ? '{{qs_gtm_container_ID}}' : '{{gtm_container_ID}}';
2
2
  (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
3
- new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
4
- j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
5
- 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
3
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
4
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
5
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
6
6
  })(window,document,'script','dataLayer',gtm_container_ID);
@@ -1,3 +1,5 @@
1
+ import { privacyPreferencesDetected } from '../detectPrivacyPreferences';
2
+
1
3
  (function() {
2
4
  var heapUserTracking = {
3
5
  /**
@@ -256,5 +258,7 @@
256
258
  }
257
259
  };
258
260
 
259
- heapUserTracking.init();
261
+ if (!privacyPreferencesDetected) {
262
+ heapUserTracking.init();
263
+ }
260
264
  })();
@@ -1,5 +1,9 @@
1
- window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
1
+ import { privacyPreferencesDetected } from '../detectPrivacyPreferences';
2
2
 
3
- var heapIsDevEnv = window.location.host.match(new RegExp('(' + ['qa.', 'staging.', 'localhost', '.local', '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}'].join('|') + ')', 'i'));
3
+ if (!privacyPreferencesDetected) {
4
+ window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
4
5
 
5
- heap.load(heapIsDevEnv ? "3986615799" : "3246578271"); // dynamic tracker ID based on env
6
+ var heapIsDevEnv = window.location.host.match(new RegExp('(' + ['qa.', 'staging.', 'localhost', '.local', '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}'].join('|') + ')', 'i'));
7
+
8
+ heap.load(heapIsDevEnv ? "3986615799" : "3246578271"); // dynamic tracker ID based on env
9
+ }
@@ -1,3 +1,5 @@
1
+ import { privacyPreferencesDetected } from '../detectPrivacyPreferences';
2
+
1
3
  var _vis_opt_queue = window._vis_opt_queue || [],
2
4
  _vis_counter = 0;
3
5
  _vis_opt_queue.push(function() {
@@ -20,8 +22,10 @@ _vis_opt_queue.push(function() {
20
22
  // Use the _vis_data object created above to fetch the data,
21
23
  // key of the object is the Test ID and the value is Variation Name
22
24
  if (_vis_counter) {
23
- heap.addUserProperties(window._vis_data);
25
+ if (!privacyPreferencesDetected) {
26
+ heap.addUserProperties(window._vis_data);
27
+ }
24
28
  }
25
29
  }
26
30
  } catch (err) {};
27
- });
31
+ });
@@ -1,16 +1,4 @@
1
1
  <script>
2
2
  {{ fileInclude 'node_modules/mod-build/src/scripts/has-qs-params.js' }}
3
3
  {{ fileInclude 'node_modules/mod-build/src/scripts/url-cleaner.js' }}
4
- {{#unless noheap}}
5
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-tracking.js' }}
6
- if(window.Modalytics) {
7
- Modalytics.init();
8
- } else {
9
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-addeventproperties-identify.js' }}
10
- }
11
- {{/unless}}
12
-
13
- {{#unless nogtm}}
14
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/google-tag-manager-head.js' }}
15
- {{/unless}}
16
4
  </script>
@@ -32,19 +32,6 @@
32
32
  try {
33
33
  // flag to call Modalytics.initHeapVwo() method in site level js
34
34
  window.initHeapVwo = true;
35
-
36
- {{#unless noheap}}
37
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-tracking.js' }}
38
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-vwo.js' }}
39
- if(window.Modalytics) {
40
- Modalytics.init();
41
- } else {
42
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-addeventproperties-identify.js' }}
43
- }
44
- {{/unless}}
45
- {{#unless nogtm}}
46
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/google-tag-manager-head.js' }}
47
- {{/unless}}
48
35
  } catch (e) {}
49
36
  return;
50
37
  }