@apolitical/gtm 1.1.0-rc.1 → 1.1.1-rc.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.
package/CHANGELOG.md CHANGED
@@ -5,12 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [1.1.0] - 2021-04-25
9
-
10
- Change to work with implementation on randomized client Id depending on cookie consent status
8
+ ## [1.1.1] - 2021-05-13
9
+ ### Fixed
10
+ - Set context function error handling
11
11
 
12
+ ## [1.1.0] - 2022-05-11
12
13
  ### Changed
13
- - Always initialize TagManager on the frontends, disregarding the stats of cookie consent
14
+ - The `environment` is now defined externally
14
15
 
15
16
  ## [1.0.1] - 2021-04-07
16
17
  ### Changed
package/build/index.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-gtm-module")):"function"==typeof define&&define.amd?define(["react-gtm-module"],e):"object"==typeof exports?exports.ApoliticalGTM=e(require("react-gtm-module")):t.ApoliticalGTM=e(t["react-gtm-module"])}(this,(function(t){return function(){"use strict";var e={273:function(e){e.exports=t}},o={};function n(t){var r=o[t];if(void 0!==r)return r.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return function(){n.r(r),n.d(r,{setContext:function(){return l},setupGTM:function(){return p}});var t=n(273),e=n.n(t);const{APOLITICAL:{WEBSITES:{BETA:o,BETA_2:i,LIVE:c,RC:a}}}={APOLITICAL:{WEBSITES:{BETA:"https://beta.apolitical.co",BETA_2:"https://beta-2.apolitical.co",LIVE:"https://apolitical.co",RC:"https://rc.apolitical.co"},ENVIRONMENTS:{BETA:"beta",BETA_2:"beta",RC:"rc",LIVE:"master"}}};let u=null;const l=({configs:t,origin:e=null})=>{u=((t,e)=>{let n=null,r=null;switch(n="undefined"!=typeof window?window.origin||window.location.origin:e,n){case o:r=t.beta;break;case i:r=t["beta-2"];break;case c:r=t.live;break;case a:r=t.rc;break;default:r=t.local}return r})(t,e)},f=()=>u,p=()=>{const t=f();e().initialize({gtmId:t.id})}}(),r}()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-gtm-module")):"function"==typeof define&&define.amd?define(["react-gtm-module"],t):"object"==typeof exports?exports.ApoliticalGTM=t(require("react-gtm-module")):e.ApoliticalGTM=t(e["react-gtm-module"])}(this,(function(e){return function(){"use strict";var t={273:function(t){t.exports=e}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){o.r(r),o.d(r,{setContext:function(){return i},setupGTM:function(){return f}});var e=o(273),t=o.n(e);let n=null;const i=({configs:e,environment:t})=>{if(!t)throw new Error("Cannot set context: Environment not defined");if(!e)throw new Error("Cannot set context: REACT_APP_GTM_ID not defined");if(!e[t])throw new Error(`Cannot set context: REACT_APP_GTM_ID not defined for environment - ${JSON.stringify({configs:e,environment:t})}`);n=e[t]},u=()=>n,f=e=>{const n=u();"true"===e["performance-cookie-consent"]&&t().initialize({gtmId:n.id})}}(),r}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/gtm",
3
- "version": "1.1.0-rc.1",
3
+ "version": "1.1.1-rc.1",
4
4
  "description": "Browser library to interact with Google Tag Manager (GTM)",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",
@@ -31,16 +31,16 @@
31
31
  "react-gtm-module": "2.0.11"
32
32
  },
33
33
  "devDependencies": {
34
- "@apolitical/eslint-config": "1.0.2",
35
- "@babel/core": "7.16.12",
36
- "@babel/eslint-parser": "7.16.5",
37
- "@babel/plugin-transform-runtime": "7.16.10",
38
- "@babel/preset-env": "7.16.11",
39
- "husky": "7.0.4",
40
- "jest": "27.4.7",
41
- "jest-junit": "13.0.0",
42
- "lint-staged": "12.3.2",
43
- "webpack": "5.67.0",
34
+ "@apolitical/eslint-config": "2.0.1",
35
+ "@babel/core": "7.17.10",
36
+ "@babel/eslint-parser": "7.17.0",
37
+ "@babel/plugin-transform-runtime": "7.17.10",
38
+ "@babel/preset-env": "7.17.10",
39
+ "husky": "8.0.1",
40
+ "jest": "28.1.0",
41
+ "jest-junit": "13.2.0",
42
+ "lint-staged": "12.4.1",
43
+ "webpack": "5.72.1",
44
44
  "webpack-cli": "4.9.2"
45
45
  },
46
46
  "eslintConfig": {
@@ -62,7 +62,6 @@
62
62
  ]
63
63
  },
64
64
  "jest": {
65
- "testEnvironment": "jsdom",
66
65
  "bail": true,
67
66
  "clearMocks": true,
68
67
  "collectCoverage": true,