Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-metrics-service

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-metrics-service - npm Package Compare versions

Comparing version 0.0.6-beta to 0.0.7-beta

2

dist/bundle.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.MetricsService=t(require("react")):e.MetricsService=t(e.react)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.tealium=t.googleTagManager=t.googleAnalyticsLegacy=t.googleAnalytics=t.debugLog=t.metricsServiceClick=t.withMetricsServiceClient=t.withMetricsServiceContext=t.MetricsServiceContext=t.Client=t.createClient=void 0;var o=n(3),i=n(10),c=n(11),a=n(9),u=n(4),l=r(u),s=n(6),p=r(s),f=n(5),d=r(f),y=n(7),v=r(y),h=n(8),g=r(h);t.createClient=o.createClient,t.Client=o.Client,t.MetricsServiceContext=i.MetricsServiceContext,t.withMetricsServiceContext=i.withMetricsServiceContext,t.withMetricsServiceClient=c.withMetricsServiceClient,t.metricsServiceClick=a.metricsServiceClick,t.debugLog=l.default,t.googleAnalytics=p.default,t.googleAnalyticsLegacy=d.default,t.googleTagManager=v.default,t.tealium=g.default},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(12),i=r(o),c=function(e,t){return t+"("+(0,i.default)(e)+")"};t.default=c},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=27e3,c=function(){function e(){var t=this,o=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=o.dispatchers,c=o.dispatcher;n(this,e),this._dispatchers=[],i&&i.forEach&&i.forEach(function(e){t.addDispatcher(e)}),c&&"object"===("undefined"==typeof c?"undefined":r(c))&&this.addDispatcher(c)}return o(e,[{key:"addDispatcher",value:function(e){function t(){}return e._dispatcherId||(e._dispatcherId=++i),e.componentWillMount||(e.componentWillMount=t),e.componentDidMount||(e.componentDidMount=t),e.componentWillUnmount||(e.componentWillUnmount=t),this._dispatchers.push(e),this}},{key:"removeDispatcher",value:function(e){return this._dispatchers=this.dispatchers.filter(function(t){return t._dispatcherId!==e._dispatcherId}),this}},{key:"callDispatchers",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=!1,i=[];return this.dispatchers.forEach(function(t){var r=t[e];r&&r.constructor&&r.call&&r.apply&&(i.push(r.apply(void 0,n)),o=!0)}),o||console.warn("react-metrics-service: no dispatcher respond to "+e),i}},{key:"dispatchers",get:function(){return this._dispatchers}}]),e}(),a={get:function(e,t){return e[t]?e[t]:function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.callDispatchers.apply(e,[t].concat(r))}}},u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=void 0;try{r=new Proxy(new(Function.prototype.bind.apply(c,[null].concat(t))),a)}catch(o){console.error("react-metrics-service: your javascript implementation doesn't support Proxy! instead of using 'createClient()', use 'new Client()'"),r=new(Function.prototype.bind.apply(c,[null].concat(t)))}return r};t.createClient=u,t.Client=c},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){var e=void 0;try{e=new Proxy({},{get:function(e,t){return function(){for(var e,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=console).warn.apply(e,["react-metrics-service: called "+t+" with:"].concat(r)),null}}})}catch(t){console.error("react-metrics-service: your javascript implementation doesn't support Proxy! debugLog will not work!"),e={}}return e}();t.debugLog=n,t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){var t=e.trackingID;return{componentDidMount:function(){if(document){var e=document.createElement("script");e.type="text/javascript",e.innerHTML="\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '"+t+"']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n ",document.head.appendChild(e)}},gaPush:function(){var e;(e=window._gaq).push.apply(e,arguments)},gaPageView:function(){window._gaq.push(["_trackPageview"])}}};t.googleAnalyticsLegacy=n,t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){var t=e.trackingID;return{componentDidMount:function(){if(document){var e=document.createElement("script");e.type="text/javascript",e.innerHTML="\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n ga('create', '"+t+"', 'auto');\n ga('send', 'pageview');\n ",document.head.appendChild(e)}},gaSend:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=window).ga.apply(e,["send"].concat(n))},gaPageView:function(){window.ga("send","pageview")}}};t.googleAnalytics=n,t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r=function(e){var t=e.containerID,r=e.dataLayer,o=void 0===r?{}:r;return{componentDidMount:function(){if(document){window.dataLayer=n({},o);var e=document.createElement("noscript");e.innerHTML='\n <iframe src="//www.googletagmanager.com/ns.html?id='+t+'"\n height="0" width="0" style="display:none;visibility:hidden">\n ',document.head.appendChild(e),e=document.createElement("script"),e.type="text/javascript",e.innerHTML="\n (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','"+t+"');\n ",document.head.appendChild(e)}}}};t.googleTagManager=r,t.default=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r=function(e){var t=e.account,r=e.profile,o=e.env,i=e.utag_data,c=void 0===i?{}:i,a=e.url;return{componentDidMount:function(){if(document){window.utag_data=n({},c);var e=a||"//tags.tiqcdn.com/utag/"+t+"/"+r+"/"+o+"/utag.js",i=document.createElement("script");i.type="text/javascript",i.innerHTML="\n (function(a,b,c,d){\n a='"+e+"';\n b=document;c='script';d=b.createElement(c);d.src=a;\n d.type='text/java’+c;d.async=true;\n a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a)\n })();\n ",document.head.appendChild(i)}},utagView:function(){var e;(e=window.utag).view.apply(e,arguments)},utagLink:function(){var e;(e=window.utag).link.apply(e,arguments)}}};t.tealium=r,t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.metricsServiceClick=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(1),s=r(l),p=n(2),f=r(p),d=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(t){var r,p;return p=r=function(r){function l(){return o(this,l),i(this,Object.getPrototypeOf(l).apply(this,arguments))}return c(l,r),u(l,[{key:"handleClick",value:function(){var t;(t=this.context.metricsServiceClient).callDispatchers.apply(t,[e].concat(n))}},{key:"render",value:function(){return s.default.createElement("div",{onClick:this.handleClick.bind(this),__self:this},s.default.createElement(t,a({},this.props,{__self:this})))}}]),l}(l.Component),r.displayName=(0,f.default)(t,"metricsServiceClick"),r.contextTypes={metricsServiceClient:l.PropTypes.object},p}};t.metricsServiceClick=d,t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsServiceContext=t.withMetricsServiceContext=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(1),p=r(s),f=function(e){function t(){return i(this,t),c(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),l(t,[{key:"getChildContext",value:function(){return{metricsServiceClient:this.props.client}}},{key:"componentWillMount",value:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=this.props.client).callDispatchers.apply(e,["componentWillMount"].concat(n))}},{key:"componentDidMount",value:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=this.props.client).callDispatchers.apply(e,["componentDidMount"].concat(n))}},{key:"componentWillUnmount",value:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=this.props.client).callDispatchers.apply(e,["componentWillUnmount"].concat(n))}},{key:"render",value:function(){return p.default.createElement("div",{__self:this},this.props.children)}}]),t}(s.Component);f.propTypes={client:s.PropTypes.object.isRequired,children:s.PropTypes.node},f.childContextTypes={metricsServiceClient:s.PropTypes.object};var d=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.client;return function(e){return function(n){var r=o(n,[]);return p.default.createElement(f,{client:t,__self:void 0},p.default.createElement(e,u({},r,{__self:void 0})))}}};t.withMetricsServiceContext=d,t.MetricsServiceContext=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.withMetricsServiceClient=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(1),s=r(l),p=n(2),f=r(p),d=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.transform,n=void 0===t?function(e){return{metricsServiceClient:e}}:t;return function(e){var t,r;return r=t=function(t){function r(){return o(this,r),i(this,Object.getPrototypeOf(r).apply(this,arguments))}return c(r,t),u(r,[{key:"render",value:function(){return s.default.createElement(e,a({},n(this.context.metricsServiceClient),this.props,{__self:this}))}}]),r}(l.Component),t.displayName=(0,f.default)(e,"withMetricsServiceClient"),t.contextTypes={metricsServiceClient:l.PropTypes.object},r}};t.withMetricsServiceClient=d,t.default=d},function(e,t){"use strict";t.__esModule=!0;var n=function(e){if("string"==typeof e)return e;if(e)return e.displayName||e.name||"Component"};t.default=n}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.MetricsService=t(require("react")):e.MetricsService=t(e.react)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.tealium=t.googleTagManager=t.googleAnalyticsLegacy=t.googleAnalytics=t.debugLog=t.metricsServiceClick=t.withMetricsServiceClient=t.withMetricsServiceContext=t.MetricsServiceContext=t.Client=t.createClient=void 0;var o=n(3),i=n(10),c=n(11),a=n(9),u=n(4),l=r(u),s=n(6),p=r(s),f=n(5),d=r(f),y=n(7),v=r(y),h=n(8),g=r(h);t.createClient=o.createClient,t.Client=o.Client,t.MetricsServiceContext=i.MetricsServiceContext,t.withMetricsServiceContext=i.withMetricsServiceContext,t.withMetricsServiceClient=c.withMetricsServiceClient,t.metricsServiceClick=a.metricsServiceClick,t.debugLog=l.default,t.googleAnalytics=p.default,t.googleAnalyticsLegacy=d.default,t.googleTagManager=v.default,t.tealium=g.default},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(12),i=r(o),c=function(e,t){return t+"("+(0,i.default)(e)+")"};t.default=c},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=27e3,c=function(){function e(){var t=this,o=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=o.dispatchers,c=o.dispatcher;n(this,e),this._dispatchers=[],i&&i.forEach&&i.forEach(function(e){t.addDispatcher(e)}),c&&"object"===("undefined"==typeof c?"undefined":r(c))&&this.addDispatcher(c)}return o(e,[{key:"addDispatcher",value:function(e){function t(){}return e._dispatcherId||(e._dispatcherId=++i),e.componentWillMount||(e.componentWillMount=t),e.componentDidMount||(e.componentDidMount=t),e.componentWillUnmount||(e.componentWillUnmount=t),this._dispatchers.push(e),this}},{key:"removeDispatcher",value:function(e){return this._dispatchers=this.dispatchers.filter(function(t){return t._dispatcherId!==e._dispatcherId}),this}},{key:"callDispatchers",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=!1,i=[];return this.dispatchers.forEach(function(t){var r=t[e];r&&r.constructor&&r.call&&r.apply&&(i.push(r.apply(void 0,n)),o=!0)}),o||console.warn("react-metrics-service: no dispatcher respond to "+e),i}},{key:"dispatchers",get:function(){return this._dispatchers}}]),e}(),a={get:function(e,t){return e[t]?e[t]:function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.callDispatchers.apply(e,[t].concat(r))}}},u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=void 0;try{r=new Proxy(new(Function.prototype.bind.apply(c,[null].concat(t))),a)}catch(o){console.error("react-metrics-service: your javascript implementation doesn't support Proxy! instead of using 'createClient()', use 'new Client()'"),r=new(Function.prototype.bind.apply(c,[null].concat(t)))}return r};t.createClient=u,t.Client=c},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){var e=void 0;try{e=new Proxy({},{get:function(e,t){return function(){for(var e,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=console).warn.apply(e,["react-metrics-service: called "+t+" with:"].concat(r)),null}}})}catch(t){console.error("react-metrics-service: your javascript implementation doesn't support Proxy! debugLog will not work!"),e={}}return e}();t.debugLog=n,t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){var t=e.trackingID,n=void 0===t?"":t;return{componentDidMount:function(){if(document){var e=document.createElement("script");e.type="text/javascript",e.innerHTML="\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '"+n+"']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n ",document.head.appendChild(e)}},2:function(){var e;(e=window._gaq).push.apply(e,arguments)},gaPageView:function(){window._gaq.push(["_trackPageview"])}}};t.googleAnalyticsLegacy=n,t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){var t=e.trackingID,n=void 0===t?"":t;return{componentDidMount:function(){if(document){var e=document.createElement("script");e.type="text/javascript",e.innerHTML="\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n ga('create', '"+n+"', 'auto');\n ga('send', 'pageview');\n ",document.head.appendChild(e)}},gaSend:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=window).ga.apply(e,["send"].concat(n))},gaPageView:function(){window.ga("send","pageview")}}};t.googleAnalytics=n,t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r=function(e){var t=e.containerID,r=void 0===t?"":t,o=e.dataLayer,i=void 0===o?{}:o;return{componentDidMount:function(){if(document){window.dataLayer=n({},i);var e=document.createElement("noscript");e.innerHTML='\n <iframe src="//www.googletagmanager.com/ns.html?id='+r+'"\n height="0" width="0" style="display:none;visibility:hidden">\n ',document.head.appendChild(e),e=document.createElement("script"),e.type="text/javascript",e.innerHTML="\n (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','"+r+"');\n ",document.head.appendChild(e)}}}};t.googleTagManager=r,t.default=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r=function(e){var t=e.account,r=void 0===t?"":t,o=e.profile,i=void 0===o?"":o,c=e.env,a=void 0===c?"":c,u=e.utag_data,l=void 0===u?{}:u,s=e.url;return{componentDidMount:function(){if(document){window.utag_data=n({},l);var e=s||"//tags.tiqcdn.com/utag/"+r+"/"+i+"/"+a+"/utag.js",t=document.createElement("script");t.type="text/javascript",t.innerHTML="\n (function(a,b,c,d){\n a='"+e+"';\n b=document;c='script';d=b.createElement(c);d.src=a;\n d.type='text/java’+c;d.async=true;\n a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a)\n })();\n ",document.head.appendChild(t)}},utagView:function(){var e;(e=window.utag).view.apply(e,arguments)},utagLink:function(){var e;(e=window.utag).link.apply(e,arguments)}}};t.tealium=r,t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.metricsServiceClick=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(1),s=r(l),p=n(2),f=r(p),d=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(t){var r,p;return p=r=function(r){function l(){return o(this,l),i(this,Object.getPrototypeOf(l).apply(this,arguments))}return c(l,r),u(l,[{key:"handleClick",value:function(){var t;(t=this.context.metricsServiceClient).callDispatchers.apply(t,[e].concat(n))}},{key:"render",value:function(){return s.default.createElement("div",{onClick:this.handleClick.bind(this),__self:this},s.default.createElement(t,a({},this.props,{__self:this})))}}]),l}(l.Component),r.displayName=(0,f.default)(t,"metricsServiceClick"),r.contextTypes={metricsServiceClient:l.PropTypes.object},p}};t.metricsServiceClick=d,t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsServiceContext=t.withMetricsServiceContext=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(1),p=r(s),f=function(e){function t(){return i(this,t),c(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),l(t,[{key:"getChildContext",value:function(){return{metricsServiceClient:this.props.client}}},{key:"componentWillMount",value:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=this.props.client).callDispatchers.apply(e,["componentWillMount"].concat(n))}},{key:"componentDidMount",value:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=this.props.client).callDispatchers.apply(e,["componentDidMount"].concat(n))}},{key:"componentWillUnmount",value:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=this.props.client).callDispatchers.apply(e,["componentWillUnmount"].concat(n))}},{key:"render",value:function(){return p.default.createElement("div",{__self:this},this.props.children)}}]),t}(s.Component);f.propTypes={client:s.PropTypes.object.isRequired,children:s.PropTypes.node},f.childContextTypes={metricsServiceClient:s.PropTypes.object};var d=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.client;return function(e){return function(n){var r=o(n,[]);return p.default.createElement(f,{client:t,__self:void 0},p.default.createElement(e,u({},r,{__self:void 0})))}}};t.withMetricsServiceContext=d,t.MetricsServiceContext=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.withMetricsServiceClient=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(1),s=r(l),p=n(2),f=r(p),d=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.transform,n=void 0===t?function(e){return{metricsServiceClient:e}}:t;return function(e){var t,r;return r=t=function(t){function r(){return o(this,r),i(this,Object.getPrototypeOf(r).apply(this,arguments))}return c(r,t),u(r,[{key:"render",value:function(){return s.default.createElement(e,a({},n(this.context.metricsServiceClient),this.props,{__self:this}))}}]),r}(l.Component),t.displayName=(0,f.default)(e,"withMetricsServiceClient"),t.contextTypes={metricsServiceClient:l.PropTypes.object},r}};t.withMetricsServiceClient=d,t.default=d},function(e,t){"use strict";t.__esModule=!0;var n=function(e){if("string"==typeof e)return e;if(e)return e.displayName||e.name||"Component"};t.default=n}])});

@@ -7,3 +7,4 @@ 'use strict';

var googleAnalyticsLegacy = function googleAnalyticsLegacy(_ref) {
var trackingID = _ref.trackingID;
var _ref$trackingID = _ref.trackingID;
var trackingID = _ref$trackingID === undefined ? '' : _ref$trackingID;
return {

@@ -18,3 +19,3 @@ componentDidMount: function componentDidMount() {

},
gaPush: function gaPush() {
2: function _() {
var _window$_gaq;

@@ -21,0 +22,0 @@

@@ -7,3 +7,4 @@ 'use strict';

var googleAnalytics = function googleAnalytics(_ref) {
var trackingID = _ref.trackingID;
var _ref$trackingID = _ref.trackingID;
var trackingID = _ref$trackingID === undefined ? '' : _ref$trackingID;
return {

@@ -10,0 +11,0 @@ componentDidMount: function componentDidMount() {

@@ -12,3 +12,4 @@ 'use strict';

var googleTagManager = function googleTagManager(_ref) {
var containerID = _ref.containerID;
var _ref$containerID = _ref.containerID;
var containerID = _ref$containerID === undefined ? '' : _ref$containerID;
var _ref$dataLayer = _ref.dataLayer;

@@ -15,0 +16,0 @@ var dataLayer = _ref$dataLayer === undefined ? {} : _ref$dataLayer;

@@ -12,5 +12,8 @@ 'use strict';

var tealium = function tealium(_ref) {
var account = _ref.account;
var profile = _ref.profile;
var env = _ref.env;
var _ref$account = _ref.account;
var account = _ref$account === undefined ? '' : _ref$account;
var _ref$profile = _ref.profile;
var profile = _ref$profile === undefined ? '' : _ref$profile;
var _ref$env = _ref.env;
var env = _ref$env === undefined ? '' : _ref$env;
var _ref$utag_data = _ref.utag_data;

@@ -17,0 +20,0 @@ var utag_data = _ref$utag_data === undefined ? {} : _ref$utag_data;

{
"name": "react-metrics-service",
"version": "0.0.6-beta",
"version": "0.0.7-beta",
"description": "React adapter for metrics services like Google Analytics, Tealium or Comcast.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

const googleAnalyticsLegacy = ({
trackingID,
trackingID = '',
}) => ({

@@ -23,3 +23,3 @@ componentDidMount: () => {

},
gaPush: (...args) => {
2: (...args) => {
window._gaq.push(...args)

@@ -26,0 +26,0 @@ },

const googleAnalytics = ({
trackingID,
trackingID = '',
}) => ({

@@ -4,0 +4,0 @@ componentDidMount: () => {

/* eslint-disable quotes, camelcase */
const googleTagManager = ({
containerID,
containerID = '',
dataLayer = {},

@@ -6,0 +6,0 @@ }) => ({

/* eslint-disable quotes, camelcase */
const tealium = ({
account,
profile,
env,
account = '',
profile = '',
env = '',
utag_data = {},

@@ -8,0 +8,0 @@ url,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc