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

@abtasty/scroll-tracking

Package Overview
Dependencies
Maintainers
31
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abtasty/scroll-tracking - npm Package Compare versions

Comparing version 3.3.0-0 to 3.4.0-0

2

dist/form.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).widgetForm=t()}(this,function(){"use strict";const e="conditions",t="paragraph";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,l=new Array(t);r<t;r++)l[r]=e[r];return l}var l,a=ABTASTY_S.CLIENT_MANAGER,n=a.getDocument,o={category:e,type:t,text:"widget_trackingWidget_note"};return[{category:e,type:"switch",propName:"defaultTarget",label:"widget_scrollTracking_label_useDefaultTarget",value:!0},{category:e,type:t,text:"widget_scrollTracking_descriptionTarget",condition:function(e){return!e.defaultTarget}},{category:e,type:"selectelement",propName:"scrollTarget",label:"widget_scrollTracking_label_target",value:(0,a.getCssSelector)((l=n().querySelectorAll("body *"),function(e){if(Array.isArray(e))return r(e)}(l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var l=Object.prototype.toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?r(e,t):void 0}}(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).reduce(function(e,t){var r=getComputedStyle(t).overflowY,l=t.scrollHeight,a=t.parentElement,n=l>e.scrollHeight,o=["auto","scroll"].includes(r),i=l>a.scrollHeight;return n&&o&&i?t:e},document.body)),condition:function(e){return!e.defaultTarget}},o,{category:e,propName:"engagementGoal",type:"replicable",children:[{type:"text",propName:"name",label:"widget_scrollTracking_label_trackerName",defaultValue:"widget_scrollTracking_label_trackerName_default",value:"widget_scrollTracking_label_trackerName_default"},{type:"slider",propName:"percentage",label:"widget_scrollTracking_label_scrollPercentage",unit:"%",min:0,max:100,defaultValue:50,value:50}]}]});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).widgetForm=t()}(this,function(){"use strict";const e="conditions",t="paragraph";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,l=new Array(t);r<t;r++)l[r]=e[r];return l}var l,a=ABTASTY_S.CLIENT_MANAGER,o=a.getDocument,n=a.getCssSelector,i=(l=o().querySelectorAll("body *"),function(e){if(Array.isArray(e))return r(e)}(l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var l=Object.prototype.toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?r(e,t):void 0}}(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).reduce(function(e,t){var r=getComputedStyle(t).overflowY,l=t.scrollHeight,a=t.parentElement,o=l>e.scrollHeight,n=["auto","scroll"].includes(r),i=l>a.scrollHeight;return o&&n&&i?t:e},document.body),c={category:e,type:t,text:"widget_trackingWidget_note"};return[{category:e,type:"switch",propName:"defaultTarget",label:"widget_scrollTracking_label_useDefaultTarget",value:i===o().body},{category:e,type:t,text:"widget_scrollTracking_descriptionTarget",condition:function(e){return!e.defaultTarget}},{category:e,type:"selectelement",propName:"scrollTarget",label:"widget_scrollTracking_label_target",value:n(i),condition:function(e){return!e.defaultTarget}},c,{category:e,propName:"engagementGoal",type:"replicable",children:[{type:"text",propName:"name",label:"widget_scrollTracking_label_trackerName",defaultValue:"widget_scrollTracking_label_trackerName_default",value:"widget_scrollTracking_label_trackerName_default"},{type:"slider",propName:"percentage",label:"widget_scrollTracking_label_scrollPercentage",unit:"%",min:0,max:100,defaultValue:50,value:50}]}]});

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

!function(){"use strict";const e=()=>Object.prototype.hasOwnProperty.call(window,"ABTastyEditor"),t=()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t},n=()=>!e()&&(t()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),r="abtasty_resetActionTracking",s="remove",i="rebuild",c=n=>{if((()=>{if(e()||t())return!1;const n=ABTasty.getTestsOnPage()[TEST_ID];return!!n&&Object.keys(n.targetings.qaParameters).length>0})()){const e=(()=>{const e=(()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`})();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")})();window.console.log(`%c${e} - QA Mode for campaign ${TEST_ID}\n${n}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}};class o{constructor(e,t,n,s){this.recurrence=e,this.isWidgetApplied=t,this.callback=n,this.shouldUpdate=s,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=[r,this.eventHandler.bind(this),{passive:!0}],this.elementsWaiters=[]}recurrenceIsDone(){return!this.recurrence||this.recurrence.isOver()}decisionHandler(e){const t=n(),{type:r}=this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1};let c;const o=this.isWidgetApplied(),a=(()=>{const t=this.recurrenceIsDone();return e&&"display"===r||t})(),u=!o&&t&&a,l=o&&(!t||!a),d=!o&&!t;return this.shouldUpdate&&!e&&t&&a?c="update":u?c=i:(l||d)&&(c=s),"string"==typeof c&&(this.clearWatcher(),this.callback(c,e),this.watch()),this}eventHandler(){let e=n();return[250,500].forEach(t=>{setTimeout(()=>{const r=n();return 500===t&&r===e?this:(e=r,this.decisionHandler(!1))},t)}),this}observerHandler(e){return e.some(e=>["removedNodes","addedNodes"].some(t=>e[t]&&e[t].length))?this.decisionHandler(!0):this}watch(){if(e())return this;this.clearWatcher(),document.addEventListener(...this.eventListenerParams);const t=()=>{const e=[document.body,{childList:!0,subtree:!0}];this.observer.observe(...e)};return document.body?t():(()=>{const e=((e,t)=>{const n=()=>{try{return document.querySelector(e)}catch(e){return null}};let r=n();const s=[document.body||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],i=()=>o.disconnect(),c=()=>o.observe(...s),o=new MutationObserver(()=>(r=n(),r&&!i()&&t()));return r?setTimeout(()=>t(),0):c(),{selector:e,clear:i,observe:c}})("body",()=>{t(),this.elementsWaiters=this.elementsWaiters.filter(t=>t!==e)});this.elementsWaiters.push(e)})(),this}clearWatcher(){return document.removeEventListener(...this.eventListenerParams),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[]),this.observer.disconnect(),this}}var a,u,l=!1,d=DATA.engagementGoal,h=function(){return d.sort(function(e,t){return e.percentage-t.percentage})},m=["scroll",function(){return y()},{passive:!0}],p=[r,function(){u=h()},{passive:!0}],g=function(){(a=a||new o(!1,function(){return l},f)).watch()},v=function(){var e,t;l=!1,(e=window).removeEventListener.apply(e,m),(t=document).removeEventListener.apply(t,p),g()},b=function(){var e,t;l=!0,u=h(),(e=window).addEventListener.apply(e,m),(t=document).addEventListener.apply(t,p),g()},y=function(){var e=100*(document.body.scrollTop||document.documentElement.scrollTop)/(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)-window.innerHeight);(u=u.filter(function(t){var n=t.percentage,r=t.name;return!(e>=n&&(ABTastyEvent(r,null,TEST_ID),c('Engagement goal "'.concat(r,'" sent to campaign ').concat(TEST_ID,".")),1))})).length||v()},f=function(e,t){switch(e){case s:v();break;case i:t?g():b()}};e()||(b(),g(),c("Widget launch"))}();
!function(){"use strict";const e=()=>Object.prototype.hasOwnProperty.call(window,"ABTastyEditor"),t=()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t},r=()=>!e()&&(t()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),n="abtasty_resetActionTracking",s="remove",i="rebuild",c=r=>{if((()=>{if(e()||t())return!1;const r=ABTasty.getTestsOnPage()[TEST_ID];return!!r&&Object.keys(r.targetings.qaParameters).length>0})()){const e=(()=>{const e=(()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`})();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")})();window.console.log(`%c${e} - QA Mode for campaign ${TEST_ID}\n${r}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}};class o{constructor(e,t,r,s){this.recurrence=e,this.isWidgetApplied=t,this.callback=r,this.shouldUpdate=s,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=[n,this.eventHandler.bind(this),{passive:!0}],this.elementsWaiters=[]}recurrenceIsDone(){return!this.recurrence||this.recurrence.isOver()}decisionHandler(e){const t=r(),{type:n}=this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1};let c;const o=this.isWidgetApplied(),a=(()=>{const t=this.recurrenceIsDone();return e&&"display"===n||t})(),l=!o&&t&&a,u=o&&(!t||!a),d=!o&&!t;return this.shouldUpdate&&!e&&t&&a?c="update":l?c=i:(u||d)&&(c=s),"string"==typeof c&&(this.clearWatcher(),this.callback(c,e),this.watch()),this}eventHandler(){let e=r();return[250,500].forEach(t=>{setTimeout(()=>{const n=r();return 500===t&&n===e?this:(e=n,this.decisionHandler(!1))},t)}),this}observerHandler(e){return e.some(e=>["removedNodes","addedNodes"].some(t=>e[t]&&e[t].length))?this.decisionHandler(!0):this}watch(){if(e())return this;this.clearWatcher(),document.addEventListener(...this.eventListenerParams);const t=()=>{const e=[document.body,{childList:!0,subtree:!0}];this.observer.observe(...e)};return document.body?t():(()=>{const e=((e,t)=>{const r=()=>{try{return document.querySelector(e)}catch(e){return null}};let n=r();const s=[document.body||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],i=()=>o.disconnect(),c=()=>o.observe(...s),o=new MutationObserver(()=>(n=r(),n&&!i()&&t()));return n?setTimeout(()=>t(),0):c(),{selector:e,clear:i,observe:c}})("body",()=>{t(),this.elementsWaiters=this.elementsWaiters.filter(t=>t!==e)});this.elementsWaiters.push(e)})(),this}clearWatcher(){return document.removeEventListener(...this.eventListenerParams),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[]),this.observer.disconnect(),this}}var a,l,u=!1,d=DATA.engagementGoal,h=function(){return d.sort(function(e,t){return e.percentage-t.percentage})},g=["scroll",function(){return b()},{passive:!0}],m=[n,function(){l=h()},{passive:!0}],v=function(){(a=a||new o(!1,function(){return u},y)).watch()},p=function(){var e;u=!1;var t=DATA.defaultTarget?window:document.querySelector(DATA.scrollTarget);t.removeEventListener.apply(t,g),(e=document).removeEventListener.apply(e,m),v()},T=function(){var e;u=!0,l=h();var t=DATA.defaultTarget?window:document.querySelector(DATA.scrollTarget);t.addEventListener.apply(t,g),(e=document).addEventListener.apply(e,m),v()},b=function(){var e,t=100*(e=DATA.defaultTarget?document.body:document.querySelector(DATA.scrollTarget)).scrollTop/(Math.max(e.scrollHeight,e.offsetHeight,e.clientHeight)-(DATA.defaultTarget?window.innerHeight:e.innerHeight));(l=l.filter(function(e){var r=e.percentage,n=e.name;return!(t>=r&&(ABTastyEvent(n,null,TEST_ID),c('Engagement goal "'.concat(n,'" sent to campaign ').concat(TEST_ID,".")),1))})).length||p()},y=function(e,t){switch(e){case s:p();break;case i:t?v():T()}};e()||(T(),v(),c("Widget launch"))}();
{
"name": "@abtasty/scroll-tracking",
"description": "AB Tasty Widget",
"version": "3.3.0-0",
"version": "3.4.0-0",
"form": "dist/form.js",

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

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