@abtasty/scroll-tracking
Advanced tools
Comparing version 3.4.7 to 3.4.8
@@ -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="inlinenotification",{getDocument:l,getCssSelector:r}=ABTASTY_S.CLIENT_MANAGER,o=[...l().querySelectorAll("body *")].reduce((e,t)=>{const{overflowY:l}=getComputedStyle(t),{scrollHeight:r,parentElement:o}=t,a=r>e.scrollHeight,c=["auto","scroll"].includes(l),n=r>o.scrollHeight;return a&&c&&n?t:e},l().body),a={category:e,type:t,label:"widget_trackingWidget_note",hrefUrl:""};return[{category:e,type:"switch",propName:"customTarget",label:"widget_scrollTracking_label_useCustomTarget",value:o!==l().body},{category:e,type:t,label:"widget_scrollTracking_descriptionTarget",hrefUrl:"",condition:e=>{let{customTarget:t}=e;return t}},{category:e,type:"selectelement",propName:"scrollTarget",label:"widget_scrollTracking_label_target",value:r(o),condition:e=>{let{customTarget:t}=e;return t}},{category:e,type:"short-separator"},a,{category:e,propName:"engagementGoal",type:"replicable",children:[{type:"text",propName:"name",label:"widget_scrollTracking_label_trackerName",defaultValue:"Scroll 50%",value:"Scroll 50%"},{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="inlinenotification";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}var o,l=ABTASTY_S.CLIENT_MANAGER,n=l.getDocument,a=l.getCssSelector,i=(o=n().querySelectorAll("body *"),function(e){if(Array.isArray(e))return r(e)}(o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}}(o)||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,o=t.scrollHeight,l=t.parentElement,n=o>e.scrollHeight,a=["auto","scroll"].includes(r),i=o>l.scrollHeight;return n&&a&&i?t:e},n().body),c={category:e,type:t,label:"widget_trackingWidget_note",hrefUrl:""};return[{category:e,type:"switch",propName:"customTarget",label:"widget_scrollTracking_label_useCustomTarget",value:i!==n().body},{category:e,type:t,label:"widget_scrollTracking_descriptionTarget",hrefUrl:"",condition:function(e){return e.customTarget}},{category:e,type:"selectelement",propName:"scrollTarget",label:"widget_scrollTracking_label_target",value:a(i),condition:function(e){return e.customTarget}},{category:e,type:"short-separator"},c,{category:e,propName:"engagementGoal",type:"replicable",children:[{type:"text",propName:"name",label:"widget_scrollTracking_label_trackerName",defaultValue:"Scroll 50%",value:"Scroll 50%"},{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=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;")}},t="abtasty_executedCampaign";let n,o=()=>null;const{engagementGoal:r,customTarget:c,scrollTarget:a}=DATA,s=()=>r.sort((e,t)=>e.percentage-t.percentage),i=["scroll",()=>u(),{passive:!0}],l=()=>{const e=c?document.querySelector(a):window;e&&e.removeEventListener(...i)},d=t=>{e("Widget launch"),n=s(),(c?t:window).addEventListener(...i)},u=()=>{const t=(()=>{const e=c?document.querySelector(a):document.body.scrollTop>0?document.body:document.documentElement;return e?100*e.scrollTop/(Math.max(e.scrollHeight,e.offsetHeight,e.clientHeight)-(c?e.parentElement.clientHeight:window.innerHeight)):0})();n=n.filter(n=>{let{percentage:o,name:r}=n;return!(t>=o&&(ABTastyEvent(r,null,TEST_ID),e(`Goal "${r}" sent to campaign ${TEST_ID}.`),1))}),n.length||l()},g=()=>{const e=((e,t)=>{const n=()=>{try{return document.querySelector(e)}catch(e){return null}};let o=n();const r=[document.querySelector("body")||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],c=()=>s.disconnect(),a=()=>s.observe(...r),s=new MutationObserver(()=>(o=n(),o&&!c()&&t(o)));return o?setTimeout(()=>t(o),0):a(),{selector:e,clear:c,observe:a}})(c?a:"body",d);o=e.clear},p=e=>{let{detail:{campaignId:t}}=e;t===TEST_ID&&(g(),b())},m=()=>{window.removeEventListener(t,p),l(),o(),n=s(),window.addEventListener(t,p)},b=()=>document.addEventListener("abtasty_resetActionTracking",m,{once:!0});g(),b()}(); | ||
!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()}(); |
{ | ||
"name": "@abtasty/scroll-tracking", | ||
"description": "AB Tasty Widget", | ||
"version": "3.4.7", | ||
"form": "dist/form.js", | ||
"main": "dist/main.js", | ||
"type": "module", | ||
"files": [ | ||
"dist" | ||
], | ||
"author": "ABTasty", | ||
"license": "MIT", | ||
"scripts": { | ||
"cloneConfig": "scp ../rollup.default.config.js ./rollup.config.js && scp ../babel.default.config.json ./babel.config.json", | ||
"publish:staging": "npm version prerelease && yarn && yarn build && npm publish", | ||
"publish:prod": "npm version patch && yarn && yarn build && npm publish", | ||
"publish:staging:breaking:minor": "npm version preminor && yarn && yarn build && npm publish", | ||
"publish:breaking:minor": "npm version minor && yarn && yarn build && npm publish", | ||
"publish:staging:breaking:major": "npm version premajor && yarn && yarn build && npm publish", | ||
"publish:breaking:major": "npm version major && yarn && yarn build && npm publish", | ||
"watch": "yarn run cloneConfig && rollup -c --watch", | ||
"build": "yarn run cloneConfig && rollup -c" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.24.0", | ||
"@babel/eslint-parser": "^7.23.10", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.18.6", | ||
"@babel/preset-env": "^7.24.0", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@rollup/plugin-eslint": "^9.0.1", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"babel-plugin-minify-dead-code-elimination": "^0.5.2", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-import-resolver-node": "^0.3.2", | ||
"eslint-plugin-import": "^2.29.1", | ||
"rollup": "^4.12.0" | ||
}, | ||
"dependencies": { | ||
"@abtasty/widget-utils": "0.0.0" | ||
} | ||
} | ||
"name": "@abtasty/scroll-tracking", | ||
"description": "AB Tasty Widget", | ||
"version": "3.4.8", | ||
"form": "dist/form.js", | ||
"main": "dist/main.js", | ||
"type": "module", | ||
"files": [ | ||
"dist" | ||
], | ||
"author": "ABTasty", | ||
"license": "MIT", | ||
"scripts": { | ||
"cloneConfig": "scp ../rollup.default.config.js ./rollup.config.js && scp ../babel.default.config.json ./babel.config.json", | ||
"publish:package": "yarn build && yarn npm publish --access public", | ||
"publish:staging": "yarn && yarn version prerelease && yarn run publish:package", | ||
"publish:prod": "yarn && yarn version patch && yarn run publish:package", | ||
"publish:staging:breaking:minor": "yarn && yarn version preminor && yarn run publish:package", | ||
"publish:breaking:minor": "yarn && yarn version minor && yarn run publish:package", | ||
"publish:staging:breaking:major": "yarn && yarn version premajor && yarn run publish:package", | ||
"publish:breaking:major": "yarn && yarn version major && yarn run publish:package", | ||
"watch": "yarn && yarn run cloneConfig && rollup -c --watch", | ||
"build": "yarn && yarn run cloneConfig && rollup -c" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.24.0", | ||
"@babel/eslint-parser": "^7.23.10", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.18.6", | ||
"@babel/preset-env": "^7.24.0", | ||
"@rollup/plugin-alias": "5.1.0", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@rollup/plugin-eslint": "^9.0.1", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"babel-plugin-minify-dead-code-elimination": "^0.5.2", | ||
"caniuse-lite": "^1.0.30001434", | ||
"cssnano": "^5.1.12", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-import-resolver-node": "^0.3.2", | ||
"eslint-plugin-import": "^2.29.1", | ||
"postcss": "^8.4.19", | ||
"postcss-cssnext": "^3.1.1", | ||
"rollup": "^4.12.0", | ||
"rollup-plugin-postcss": "^4.0.2" | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6481
0
19
0
20
- Removed@abtasty/widget-utils@0.0.0