@analytics/activity-utils
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.1.9](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-activity/compare/@analytics/activity-utils@0.1.8...@analytics/activity-utils@0.1.9) (2021-12-12) | ||
**Note:** Version bump only for package @analytics/activity-utils | ||
## [0.1.8](https://github.com/DavidWells/analytics/tree/master/packages/analytics-util-activity/compare/@analytics/activity-utils@0.1.7...@analytics/activity-utils@0.1.8) (2021-10-24) | ||
@@ -8,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
var utilActivity=function(n){function t(){return(t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n}).apply(this,arguments)}var e=function(){},r="undefined"!=typeof window;function o(n,t){if("string"==typeof n)return t?o(document.querySelectorAll(n)):n.split(" ").map(function(n){return n.trim()});if(NodeList.prototype.isPrototypeOf(n)){for(var e=[],r=n.length>>>0;r--;)e[r]=n[r];return e}return"[object Array]"===Object.prototype.toString.call(n)?n:[n]}function i(n,t){return t&&t.once?function(n,t){var e;return function(){return n&&(e=n.apply(this,arguments),n=null),e}}(n):n}var u=function(n,t,u,c){var a=u||e;if(!r)return a;var f=c||!1,l=o(t),d=o(n,!0),v=[];if(!d.length)throw new Error("noElements");if(!l.length)throw new Error("noEvent");return function n(t){var e=t?"addEventListener":"removeEventListener";t&&(v=[]);for(var r=0;r<d.length;r++){var o=d[r];v[r]=t?i(a,f):v[r]||a;for(var u=0;u<l.length;u++)o[e]?o[e](l[u],v[r],f):o["on"+l[u]]=t?v[r]:null}return n.bind(null,!t)}("Event")},c="undefined"==typeof window,a="hidden",f=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function l(n,t){void 0===t&&(t={});var e=function(n,t){var e=this,r=!1;return function(o){r||(n.call(e,o),r=!0,setTimeout(function(){return r=!1},t))}}(n,t.throttle||1e4),r=[];function o(){var n=function(n){if(c)return!1;var t=c||a in document?a:["webkit","moz","ms","o"].reduce(function(n,t){var e=t+"Hidden";return!n&&e in document?e:n},null),e="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return n(Boolean(document[t]))},o=function(){return document.addEventListener(e,r)};return o(),function(){return document.removeEventListener(e,r),o}}(function(n){n||e({type:"tabVisible"})});return r=[n].concat(f.map(function(n){return u(document,n,e)})).concat(u(window,"load",e)).concat(u(window,"scroll",e,{capture:!0,passive:!0})),i}function i(){r.map(function(n){return n()})}return o(),function(){return i(),o}}function d(n){var t,e,r=n.onIdle,o=n.onWakeUp,i=n.onHeartbeat,u=n.timeout,c=void 0===u?1e4:u,a=n.throttle,f=void 0===a?2e3:a,d=!1,s=!1,p=new Date,m=function(){return clearTimeout(t)};function h(n){m(),i&&!d&&i(v(p),n),o&&d&&(d=!1,o(v(e),n),p=new Date),t=setTimeout(function(){d=!0,r&&(e=new Date,r(v(p),n))},c)}var w=l(h,{throttle:f});return{disable:function(){s=!0,d=!1,m();var n=w();return function(){return s=!1,p=new Date,h({type:"load"}),n()}},getStatus:function(){return{isIdle:d,isDisabled:s,active:d?0:v(p,s),idle:d?v(e,s):0}}}}function v(n,t){return t?0:Math.round((new Date-n)/1e3)}return n.onDomActivity=l,n.onIdle=function(n,e){return void 0===e&&(e={}),d(t({onIdle:n},e))},n.onUserActivity=d,n.onWakeUp=function(n,e){return void 0===e&&(e={}),d(t({onWakeUp:n},e))},n}({}); | ||
var utilActivity=function(n){function t(){return(t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n}).apply(this,arguments)}var e=function(){},r="undefined"!=typeof window;function o(n,t){if(function(n){return"string"==typeof n}(n))return t?o(document.querySelectorAll(n)):n.split(" ").map(function(n){return n.trim()});if(NodeList.prototype.isPrototypeOf(n)){for(var e=[],r=n.length>>>0;r--;)e[r]=n[r];return e}return function(n){return"[object Array]"===Object.prototype.toString.call(n)}(n)?n:[n]}function i(n,t){return t&&t.once?function(n,t){var e;return function(){return n&&(e=n.apply(this,arguments),n=null),e}}(n):n}"undefined"!=typeof process&&null!=process.versions&&process,"undefined"!=typeof Deno&&Deno,r&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var u=function(n,t,u,c){var a=u||e;if(!r)return a;var f=c||!1,d=o(t),l=o(n,!0),s=[];if(!l.length)throw new Error("noElements");if(!d.length)throw new Error("noEvent");return function n(t){var e=t?"addEventListener":"removeEventListener";t&&(s=[]);for(var r=0;r<l.length;r++){var o=l[r];s[r]=t?i(a,f):s[r]||a;for(var u=0;u<d.length;u++)o[e]?o[e](d[u],s[r],f):o["on"+d[u]]=t?s[r]:null}return n.bind(null,!t)}("Event")},c="undefined"==typeof window,a="hidden",f=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function d(n,t){void 0===t&&(t={});var e=function(n,t){var e=this,r=!1;return function(o){r||(n.call(e,o),r=!0,setTimeout(function(){return r=!1},t))}}(n,t.throttle||1e4),r=[];function o(){var n=function(n){if(c)return!1;var t=c||a in document?a:["webkit","moz","ms","o"].reduce(function(n,t){var e=t+"Hidden";return!n&&e in document?e:n},null),e="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return n(Boolean(document[t]))},o=function(){return document.addEventListener(e,r)};return o(),function(){return document.removeEventListener(e,r),o}}(function(n){n||e({type:"tabVisible"})});return r=[n].concat(f.map(function(n){return u(document,n,e)})).concat(u(window,"load",e)).concat(u(window,"scroll",e,{capture:!0,passive:!0})),i}function i(){r.map(function(n){return n()})}return o(),function(){return i(),o}}function l(n){var t,e,r=n.onIdle,o=n.onWakeUp,i=n.onHeartbeat,u=n.timeout,c=void 0===u?1e4:u,a=n.throttle,f=void 0===a?2e3:a,l=!1,v=!1,p=new Date,m=function(){return clearTimeout(t)};function w(n){m(),i&&!l&&i(s(p),n),o&&l&&(l=!1,o(s(e),n),p=new Date),t=setTimeout(function(){l=!0,r&&(e=new Date,r(s(p),n))},c)}var h=d(w,{throttle:f});return{disable:function(){v=!0,l=!1,m();var n=h();return function(){return v=!1,p=new Date,w({type:"load"}),n()}},getStatus:function(){return{isIdle:l,isDisabled:v,active:l?0:s(p,v),idle:l?s(e,v):0}}}}function s(n,t){return t?0:Math.round((new Date-n)/1e3)}return n.onDomActivity=d,n.onIdle=function(n,e){return void 0===e&&(e={}),l(t({onIdle:n},e))},n.onUserActivity=l,n.onWakeUp=function(n,e){return void 0===e&&(e={}),l(t({onWakeUp:n},e))},n}({}); | ||
//# sourceMappingURL=activity-utils.js.map |
@@ -1,2 +0,2 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n||self).utilActivity={})}(this,function(n){function t(){return(t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n}).apply(this,arguments)}var e=function(){},o="undefined"!=typeof window;function r(n,t){if("string"==typeof n)return t?r(document.querySelectorAll(n)):n.split(" ").map(function(n){return n.trim()});if(NodeList.prototype.isPrototypeOf(n)){for(var e=[],o=n.length>>>0;o--;)e[o]=n[o];return e}return"[object Array]"===Object.prototype.toString.call(n)?n:[n]}function i(n,t){return t&&t.once?function(n,t){var e;return function(){return n&&(e=n.apply(this,arguments),n=null),e}}(n):n}var u=function(n,t,u,c){var a=u||e;if(!o)return a;var f=c||!1,d=r(t),l=r(n,!0),v=[];if(!l.length)throw new Error("noElements");if(!d.length)throw new Error("noEvent");return function n(t){var e=t?"addEventListener":"removeEventListener";t&&(v=[]);for(var o=0;o<l.length;o++){var r=l[o];v[o]=t?i(a,f):v[o]||a;for(var u=0;u<d.length;u++)r[e]?r[e](d[u],v[o],f):r["on"+d[u]]=t?v[o]:null}return n.bind(null,!t)}("Event")},c="undefined"==typeof window,a="hidden",f=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function d(n,t){void 0===t&&(t={});var e=function(n,t){var e=this,o=!1;return function(r){o||(n.call(e,r),o=!0,setTimeout(function(){return o=!1},t))}}(n,t.throttle||1e4),o=[];function r(){var n=function(n){if(c)return!1;var t=c||a in document?a:["webkit","moz","ms","o"].reduce(function(n,t){var e=t+"Hidden";return!n&&e in document?e:n},null),e="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),o=function(){return n(Boolean(document[t]))},r=function(){return document.addEventListener(e,o)};return r(),function(){return document.removeEventListener(e,o),r}}(function(n){n||e({type:"tabVisible"})});return o=[n].concat(f.map(function(n){return u(document,n,e)})).concat(u(window,"load",e)).concat(u(window,"scroll",e,{capture:!0,passive:!0})),i}function i(){o.map(function(n){return n()})}return r(),function(){return i(),r}}function l(n){var t,e,o=n.onIdle,r=n.onWakeUp,i=n.onHeartbeat,u=n.timeout,c=void 0===u?1e4:u,a=n.throttle,f=void 0===a?2e3:a,l=!1,s=!1,p=new Date,m=function(){return clearTimeout(t)};function h(n){m(),i&&!l&&i(v(p),n),r&&l&&(l=!1,r(v(e),n),p=new Date),t=setTimeout(function(){l=!0,o&&(e=new Date,o(v(p),n))},c)}var y=d(h,{throttle:f});return{disable:function(){s=!0,l=!1,m();var n=y();return function(){return s=!1,p=new Date,h({type:"load"}),n()}},getStatus:function(){return{isIdle:l,isDisabled:s,active:l?0:v(p,s),idle:l?v(e,s):0}}}}function v(n,t){return t?0:Math.round((new Date-n)/1e3)}n.onDomActivity=d,n.onIdle=function(n,e){return void 0===e&&(e={}),l(t({onIdle:n},e))},n.onUserActivity=l,n.onWakeUp=function(n,e){return void 0===e&&(e={}),l(t({onWakeUp:n},e))}}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n||self).utilActivity={})}(this,function(n){function e(){return(e=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n}).apply(this,arguments)}var t=function(){},o="undefined"!=typeof window;function r(n,e){if(function(n){return"string"==typeof n}(n))return e?r(document.querySelectorAll(n)):n.split(" ").map(function(n){return n.trim()});if(NodeList.prototype.isPrototypeOf(n)){for(var t=[],o=n.length>>>0;o--;)t[o]=n[o];return t}return function(n){return"[object Array]"===Object.prototype.toString.call(n)}(n)?n:[n]}function i(n,e){return e&&e.once?function(n,e){var t;return function(){return n&&(t=n.apply(this,arguments),n=null),t}}(n):n}"undefined"!=typeof process&&null!=process.versions&&process,"undefined"!=typeof Deno&&Deno,o&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var u=function(n,e,u,c){var a=u||t;if(!o)return a;var f=c||!1,d=r(e),l=r(n,!0),s=[];if(!l.length)throw new Error("noElements");if(!d.length)throw new Error("noEvent");return function n(e){var t=e?"addEventListener":"removeEventListener";e&&(s=[]);for(var o=0;o<l.length;o++){var r=l[o];s[o]=e?i(a,f):s[o]||a;for(var u=0;u<d.length;u++)r[t]?r[t](d[u],s[o],f):r["on"+d[u]]=e?s[o]:null}return n.bind(null,!e)}("Event")},c="undefined"==typeof window,a="hidden",f=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function d(n,e){void 0===e&&(e={});var t=function(n,e){var t=this,o=!1;return function(r){o||(n.call(t,r),o=!0,setTimeout(function(){return o=!1},e))}}(n,e.throttle||1e4),o=[];function r(){var n=function(n){if(c)return!1;var e=c||a in document?a:["webkit","moz","ms","o"].reduce(function(n,e){var t=e+"Hidden";return!n&&t in document?t:n},null),t="".concat(e.replace(/[H|h]idden/,""),"visibilitychange"),o=function(){return n(Boolean(document[e]))},r=function(){return document.addEventListener(t,o)};return r(),function(){return document.removeEventListener(t,o),r}}(function(n){n||t({type:"tabVisible"})});return o=[n].concat(f.map(function(n){return u(document,n,t)})).concat(u(window,"load",t)).concat(u(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){o.map(function(n){return n()})}return r(),function(){return i(),r}}function l(n){var e,t,o=n.onIdle,r=n.onWakeUp,i=n.onHeartbeat,u=n.timeout,c=void 0===u?1e4:u,a=n.throttle,f=void 0===a?2e3:a,l=!1,v=!1,p=new Date,m=function(){return clearTimeout(e)};function y(n){m(),i&&!l&&i(s(p),n),r&&l&&(l=!1,r(s(t),n),p=new Date),e=setTimeout(function(){l=!0,o&&(t=new Date,o(s(p),n))},c)}var h=d(y,{throttle:f});return{disable:function(){v=!0,l=!1,m();var n=h();return function(){return v=!1,p=new Date,y({type:"load"}),n()}},getStatus:function(){return{isIdle:l,isDisabled:v,active:l?0:s(p,v),idle:l?s(t,v):0}}}}function s(n,e){return e?0:Math.round((new Date-n)/1e3)}n.onDomActivity=d,n.onIdle=function(n,t){return void 0===t&&(t={}),l(e({onIdle:n},t))},n.onUserActivity=l,n.onWakeUp=function(n,t){return void 0===t&&(t={}),l(e({onWakeUp:n},t))}}); | ||
//# sourceMappingURL=activity-utils.umd.js.map |
{ | ||
"name": "@analytics/activity-utils", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "User activity listener utilities", | ||
@@ -52,6 +52,6 @@ "author": "David Wells", | ||
"dependencies": { | ||
"@analytics/listener-utils": "^0.2.6", | ||
"@analytics/listener-utils": "^0.2.7", | ||
"analytics-plugin-tab-events": "^0.2.0" | ||
}, | ||
"gitHead": "22ac7f7b874ec96a434880456b405188a9e31c99" | ||
"gitHead": "23a39489d2d73ad8a6fe36e22596b8ea0067e45e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
346284
6513