@abtasty/scroll-tracking
Advanced tools
Comparing version 3.4.8 to 3.4.9-0
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";const e="abtasty_executedCampaign",t=e=>{const t=(()=>{if(Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})(),n=document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(t||n){const n=(()=>{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${n} - ${t?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${e}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}};var n,r=function(){return null},o=DATA,c=o.engagementGoal,a=o.customTarget,i=o.scrollTarget,u=function(){return c.sort(function(e,t){return e.percentage-t.percentage})},s=["scroll",function(){return p()},{passive:!0}],d=function(){var e=a?document.querySelector(i):window;e&&e.removeEventListener.apply(e,s)},l=function(e){t("Widget launch"),n=u();var r=a?e:window;r.addEventListener.apply(r,s)},p=function(){var e=function(){var e=a?document.querySelector(i):document.body.scrollTop>0?document.body:document.documentElement;if(!e)return 0;var t=e.scrollTop,n=Math.min(e.clientHeight,window.innerHeight),r=e.scrollHeight-n;return Math.round(t/r*100)}();(n=n.filter(function(n){var r=n.percentage,o=n.name;return!(e>=r&&(ABTastyEvent(o,null,TEST_ID),t('Goal "'.concat(o,'" sent to campaign ').concat(TEST_ID,".")),1))})).length||d()},g=function(){var e=((e,t)=>{const n=()=>{try{return document.querySelector(e)}catch(e){return null}};let r=n();const o=[document.querySelector("body")||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],c=()=>i.disconnect(),a=()=>i.observe(...o),i=new MutationObserver(()=>(r=n(),r&&!c()&&t(r)));return r?setTimeout(()=>t(r),0):a(),{selector:e,clear:c,observe:a}})(a?i:"body",l);r=e.clear},m=function(e){e.detail.campaignId===TEST_ID&&(g(),y())},b=function(){window.removeEventListener(e,m),d(),r(),n=u(),window.addEventListener(e,m)},y=function(){return document.addEventListener("abtasty_resetActionTracking",b,{once:!0})};g(),y()}(); | ||
!function(){"use strict";const e=()=>Object.prototype.hasOwnProperty.call(top,"ABTastyEditor"),t=t=>{const n=(()=>{if(e()||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})())return!1;const t=ABTasty.getTestsOnPage()[TEST_ID];return!!t&&Object.keys(t.targetings.qaParameters).length>0})(),r=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(n||r){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} - ${n?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${t}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}},n=e=>(e=>{if("string"!=typeof e||!e.trim().length)return null;const[t,n,r]=e.split("[]").map(e=>e.trim()),o=Boolean(r)?r:e,a=n?document.querySelector(t)?.[n]:document;return a?a.querySelector(o):null})(e),r=(e,t)=>{const r=document.querySelector("body")||document.documentElement,o={childList:!0,subtree:!0,attributes:!0},a=()=>c.disconnect(),c=new MutationObserver(()=>{const r=n(t);return r&&!a()&&e(r)});return{clear:a,observe:(e=r)=>c.observe(e,o)}},o=()=>{},a=(t,c)=>{const i=n(t),l={selector:t,clear:o,observe:o};if(i)return setTimeout(()=>c(i),0),l;if(e())return setTimeout(()=>a(t,c),1e3),l;if(t.includes("[]"))return((e,t)=>{const[o,a]=t.split("[]").map(e=>e.trim()),c=n(o),i=c?.[a],{clear:l,observe:u}=r(e,t),s=()=>{const r=n(t);return r&&!d()&&e(r)},d=()=>{l(),c?.removeEventListener("load",s)},v=()=>{u(i),"iframe"===c?.localName&&c.addEventListener("load",s)};return v(),{selector:t,clear:d,observe:v}})(c,t);const{clear:u,observe:s}=r(c,t);return s(),{selector:t,clear:u,observe:s}},c="abtasty_executedCampaign";var i,l=function(){return null},u=DATA,s=u.engagementGoal,d=u.customTarget,v=u.scrollTarget,p=function(){return s.sort(function(e,t){return e.percentage-t.percentage})},m=["scroll",function(){return y()},{passive:!0}],g=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return(null===(e=t.body)||void 0===e?void 0:e.scrollTop)>0?t.body:t.documentElement},f=function(){var e,t,r=d?n(v):window;if("iframe"===r.localName)return null===(e=target)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.removeEventListener.apply(e,m),void(null===(t=target)||void 0===t||t.removeEventListener("load",T));r&&r.removeEventListener.apply(r,m)},b=function(e){var t;if(i=p(),"iframe"===e.localName)return null==e||null===(t=e.contentWindow)||void 0===t||t.addEventListener.apply(t,m),void e.addEventListener("load",T);var n=d?e:window;n.addEventListener.apply(n,m)},y=function(){var e=function(){var e=function(){if(d){var e=n(v);return"iframe"===e.localName?g(e.contentDocument):e}return g()}();if(!e)return 0;var t=e.scrollTop,r=Math.min(e.clientHeight,window.innerHeight),o=e.scrollHeight-r;return Math.round(t/o*100)}();(i=i.filter(function(n){var r=n.percentage,o=n.name;return!(e>=r&&(ABTastyEvent(o,null,TEST_ID),t('Goal "'.concat(o,'" sent to campaign ').concat(TEST_ID,".")),1))})).length||f()},T=function(){l();var e=a(d?v:"body",b);l=e.clear},w=function(e){e.detail.campaignId===TEST_ID&&(T(),h())},E=function(){window.removeEventListener(c,w),f(),l(),i=p(),window.addEventListener(c,w)},h=function(){return document.addEventListener("abtasty_resetActionTracking",E,{once:!0})};t("Widget launch"),T(),h()}(); |
{ | ||
"name": "@abtasty/scroll-tracking", | ||
"description": "AB Tasty Widget", | ||
"version": "3.4.8", | ||
"version": "3.4.9-0", | ||
"form": "dist/form.js", | ||
@@ -46,3 +46,4 @@ "main": "dist/main.js", | ||
"rollup-plugin-postcss": "^4.0.2" | ||
} | ||
}, | ||
"stableVersion": "3.4.8" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
7679
23
2