react-use-hotjar
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.1.1](https://github.com/olavoparno/react-use-hotjar/compare/v1.1.0...v1.1.1) (2021-04-27) | ||
### Bug Fixes | ||
* check for window's existance ([8976a27](https://github.com/olavoparno/react-use-hotjar/commit/8976a27b7d027bed7ed7b5c4a1ffccd4781ffefd)) | ||
## [1.1.0](https://github.com/olavoparno/react-use-hotjar/compare/v1.0.13...v1.1.0) (2021-04-21) | ||
@@ -7,0 +14,0 @@ |
@@ -1,2 +0,2 @@ | ||
import{useState as t,useMemo as r,useCallback as n}from"react";function o(t,r){if(function(t,r){try{var n=document.getElementById(r)||document.createElement("script");return n.id=r,n.innerText=t,n.crossOrigin="anonymous",document.head.appendChild(n),!0}catch(t){return!1}}("(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:"+t+",hjsv:"+r+"};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');","hotjar-init-script")&&window&&window.hj)return!0;throw Error("Hotjar initialization failed!")}function e(){var e=!(!window||!window.hj),i=t(r((function(){return e}),[e])),a=i[0],h=i[1],c=n((function(t,r,n){try{return o(t,r),h(!0),n&&"function"==typeof n&&n("Hotjar ready: true"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]),u=n((function(t,r,n){try{return function(t,r){if(window&&window.hj)return window.hj("identify",t,r);throw Error("Hotjar is not available! Is Hotjar initialized?")}(t,r),n&&"function"==typeof n&&n("Hotjar identified"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]),d=n((function(t,r){try{return function(t){if(window&&window.hj)return window.hj("stateChange",t);throw Error("Hotjar is not available! Is Hotjar initialized?")}(t),r&&"function"==typeof r&&r("Hotjar stateChanged"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]);return r((function(){return{readyState:a,stateChange:d,initHotjar:c,identifyHotjar:u}}),[a,d,c,u])}export default e; | ||
import{useState as t,useMemo as r,useCallback as n}from"react";function e(t,r){var n="undefined"!=typeof window;if(!n)return!1;if(function(t,r){try{var n=document.getElementById(r)||document.createElement("script");return n.id=r,n.innerText=t,n.crossOrigin="anonymous",document.head.appendChild(n),!0}catch(t){return!1}}("(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:"+t+",hjsv:"+r+"};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');","hotjar-init-script")&&n&&window.hj)return!0;throw Error("Hotjar initialization failed!")}function o(){var o=!("undefined"==typeof window||!window.hj),i=t(r((function(){return o}),[o])),a=i[0],d=i[1],h=n((function(t,r,n){try{return e(t,r),d(!0),n&&"function"==typeof n&&n("Hotjar ready: true"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]),u=n((function(t,r,n){try{return function(t,r){if("undefined"!=typeof window&&window.hj)return window.hj("identify",t,r);throw Error("Hotjar is not available! Is Hotjar initialized?")}(t,r),n&&"function"==typeof n&&n("Hotjar identified"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]),c=n((function(t,r){try{return function(t){if("undefined"!=typeof window&&window.hj)return window.hj("stateChange",t);throw Error("Hotjar is not available! Is Hotjar initialized?")}(t),r&&"function"==typeof r&&r("Hotjar stateChanged"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]);return r((function(){return{readyState:a,stateChange:c,initHotjar:h,identifyHotjar:u}}),[a,c,h,u])}export default o; | ||
//# sourceMappingURL=index.es.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react");function r(t,r){if(function(t,r){try{var e=document.getElementById(r)||document.createElement("script");return e.id=r,e.innerText=t,e.crossOrigin="anonymous",document.head.appendChild(e),!0}catch(t){return!1}}("(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:"+t+",hjsv:"+r+"};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');","hotjar-init-script")&&window&&window.hj)return!0;throw Error("Hotjar initialization failed!")}exports.default=function(){var e=!(!window||!window.hj),n=t.useState(t.useMemo((function(){return e}),[e])),o=n[0],i=n[1],a=t.useCallback((function(t,e,n){try{return r(t,e),i(!0),n&&"function"==typeof n&&n("Hotjar ready: true"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]),u=t.useCallback((function(t,r,e){try{return function(t,r){if(window&&window.hj)return window.hj("identify",t,r);throw Error("Hotjar is not available! Is Hotjar initialized?")}(t,r),e&&"function"==typeof e&&e("Hotjar identified"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]),c=t.useCallback((function(t,r){try{return function(t){if(window&&window.hj)return window.hj("stateChange",t);throw Error("Hotjar is not available! Is Hotjar initialized?")}(t),r&&"function"==typeof r&&r("Hotjar stateChanged"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]);return t.useMemo((function(){return{readyState:o,stateChange:c,initHotjar:a,identifyHotjar:u}}),[o,c,a,u])}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react");function e(t,e){var r="undefined"!=typeof window;if(!r)return!1;if(function(t,e){try{var r=document.getElementById(e)||document.createElement("script");return r.id=e,r.innerText=t,r.crossOrigin="anonymous",document.head.appendChild(r),!0}catch(t){return!1}}("(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:"+t+",hjsv:"+e+"};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');","hotjar-init-script")&&r&&window.hj)return!0;throw Error("Hotjar initialization failed!")}exports.default=function(){var r=!("undefined"==typeof window||!window.hj),n=t.useState(t.useMemo((function(){return r}),[r])),o=n[0],i=n[1],a=t.useCallback((function(t,r,n){try{return e(t,r),i(!0),n&&"function"==typeof n&&n("Hotjar ready: true"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]),u=t.useCallback((function(t,e,r){try{return function(t,e){if("undefined"!=typeof window&&window.hj)return window.hj("identify",t,e);throw Error("Hotjar is not available! Is Hotjar initialized?")}(t,e),r&&"function"==typeof r&&r("Hotjar identified"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]),c=t.useCallback((function(t,e){try{return function(t){if("undefined"!=typeof window&&window.hj)return window.hj("stateChange",t);throw Error("Hotjar is not available! Is Hotjar initialized?")}(t),e&&"function"==typeof e&&e("Hotjar stateChanged"),!0}catch(t){return console.error("Hotjar error:",t),!1}}),[]);return t.useMemo((function(){return{readyState:o,stateChange:c,initHotjar:a,identifyHotjar:u}}),[o,c,a,u])}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "react-use-hotjar", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Adds Hotjar capabilities as custom hooks", | ||
@@ -5,0 +5,0 @@ "author": "Olavo Parno", |
@@ -143,2 +143,3 @@ <img align="right" alt="traffic" src="https://pv-badge.herokuapp.com/total.svg?repo_id=olavoparno-react-use-hotjar"/> | ||
<td align="center"><a href="https://github.com/gianpietro1"><img src="https://avatars.githubusercontent.com/u/10046142?v=4?s=70" width="70px;" alt=""/><br /><sub><b>Gianpietro Lavado</b></sub></a><br /><a href="https://github.com/olavoparno/react-use-hotjar/commits?author=gianpietro1" title="Documentation">📖</a></td> | ||
<td align="center"><a href="https://paqmind.com"><img src="https://avatars.githubusercontent.com/u/2128182?v=4?s=70" width="70px;" alt=""/><br /><sub><b>Ivan Kleshnin</b></sub></a><br /><a href="https://github.com/olavoparno/react-use-hotjar/commits?author=ivan-kleshnin" title="Code">💻</a> <a href="#ideas-ivan-kleshnin" title="Ideas, Planning, & Feedback">🤔</a></td> | ||
</tr> | ||
@@ -145,0 +146,0 @@ </table> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
20651
163