@apolitical/gtm 1.0.0-rc.0 → 1.0.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/CHANGELOG.md CHANGED
@@ -5,10 +5,6 @@ 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
- ## [0.1.1] - 2021-02-22
9
- ### Fixed
10
- - Initial setup
11
-
12
- ## [0.1.0] - 2021-02-22
8
+ ## [1.0.0] - 2021-04-06
13
9
  ### Added
14
- - Initial setup
10
+ - Initialize Google Tag Manager with GTM container Id
package/build/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ApoliticalGTM=t():e.ApoliticalGTM=t()}(this,(function(){return function(){"use strict";var e={d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{runExample:function(){return a},setContext:function(){return i}});const{APOLITICAL:{WEBSITES:o,ENVIRONMENTS:n}}={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 r={environment:null};const i=({environment:e,origin:t=null})=>{r.environment=e||(e=>{let t,r=null;switch(r="undefined"!=typeof window?window.origin||window.location.origin:e,r){case o.BETA:t=n.BETA;break;case o.BETA_2:t=n.BETA_2;break;case o.LIVE:t=n.LIVE;break;case o.RC:t=n.RC;break;default:t=n.BETA}return t})(t)},c=()=>r,a=()=>{const e=c();return console.warn(e),!0};return t}()}));
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}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/gtm",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0",
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",
@@ -24,8 +24,12 @@
24
24
  "Library",
25
25
  "Template"
26
26
  ],
27
- "dependencies": {},
28
- "peerDependencies": {},
27
+ "dependencies": {
28
+ "react-gtm-module": "2.0.11"
29
+ },
30
+ "peerDependencies": {
31
+ "react-gtm-module": "2.0.11"
32
+ },
29
33
  "devDependencies": {
30
34
  "@apolitical/eslint-config": "1.0.2",
31
35
  "@babel/core": "7.16.12",
@@ -58,6 +62,7 @@
58
62
  ]
59
63
  },
60
64
  "jest": {
65
+ "testEnvironment": "jsdom",
61
66
  "bail": true,
62
67
  "clearMocks": true,
63
68
  "collectCoverage": true,