@applitools/snippets
Advanced tools
Comparing version 2.4.21 to 2.4.22
@@ -90,7 +90,7 @@ exports.addElementIds=function(arg){ | ||
exports.getUserAgent=function(arg){ | ||
var s=function(){"use strict";function t(){return t=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},t.apply(this,arguments)}var n="__EYES__APPLITOOLS__";return window[n]=window[n]||{},function(){try{if(window[n].userAgent){var e=window[n].userAgent;return"WIP"!==e.status&&delete window[n].userAgent,JSON.stringify(e)}return window.navigator.userAgentData?(window[n].userAgent={status:"WIP"},window.navigator.userAgentData.getHighEntropyValues(["brands","platform","platformVersion","model"]).then((function(e){window[n].userAgent={status:"SUCCESS",value:t({legacy:window.navigator.userAgent},e)}})).catch((function(t){window[n].userAgent={status:"ERROR",error:t.message}}))):window[n].userAgent={status:"SUCCESS",value:window.navigator.userAgent},JSON.stringify(window[n].userAgent)}catch(t){return window[n].userAgent={status:"ERROR",error:t.message},JSON.stringify(window[n].userAgent)}}}(); | ||
var s=function(){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},t.apply(this,arguments)}var n="__EYES__APPLITOOLS__",r="userAgent";return window[n]=window[n]||{},function(){try{if(window[n][r]){var i=window[n][r];return"WIP"!==i.status&&delete window[n][r],JSON.stringify(i)}return window.navigator.userAgentData?(window[n][r]={status:"WIP"},window.navigator.userAgentData.getHighEntropyValues(["brands","platform","platformVersion","model"]).then((function(i){window[n][r]={status:"SUCCESS",value:t({legacy:window.navigator.userAgent},i)}})).catch((function(t){window[n][r]={status:"ERROR",error:t.message}}))):window[n][r]={status:"SUCCESS",value:window.navigator.userAgent},JSON.stringify(window[n][r])}catch(t){return window[n][r]={status:"ERROR",error:t.message},JSON.stringify(window[n][r])}}}(); | ||
return s(arg) | ||
} | ||
exports.getViewport=function(arg){ | ||
var s=function(){"use strict";return function(){var e=0,n=0;return window.innerHeight?n=window.innerHeight:document.documentElement&&document.documentElement.clientHeight?n=document.documentElement.clientHeight:document.body&&document.body.clientHeight&&(n=document.body.clientHeight),window.innerWidth?e=window.innerWidth:document.documentElement&&document.documentElement.clientWidth?e=document.documentElement.clientWidth:document.body&&document.body.clientWidth&&(e=document.body.clientWidth),{viewportSize:{width:e,height:n},pixelRatio:window.devicePixelRatio,viewportScale:window.visualViewport&&window.visualViewport.scale,orientation:window.screen&&window.screen.orientation&&window.screen.orientation.type.replace(/-primary$/,"")}}}(); | ||
var s=function(){"use strict";return function(){var n,e=0,t=0;return window.innerHeight?t=window.innerHeight:document.documentElement&&document.documentElement.clientHeight?t=document.documentElement.clientHeight:document.body&&document.body.clientHeight&&(t=document.body.clientHeight),window.innerWidth?e=window.innerWidth:document.documentElement&&document.documentElement.clientWidth?e=document.documentElement.clientWidth:document.body&&document.body.clientWidth&&(e=document.body.clientWidth),window.screen&&window.screen.orientation?n=window.screen.orientation.type.replace(/-primary$/,""):null!=window.orientation&&(0===window.orientation?n="portrait":180===window.orientation?n="portrait-secondary":90===window.orientation?n="landscape":-90===window.orientation&&(n="landscape-secondary")),{viewportSize:{width:e,height:t},pixelRatio:window.devicePixelRatio,viewportScale:window.visualViewport&&window.visualViewport.scale,orientation:n}}}(); | ||
return s(arg) | ||
@@ -107,3 +107,3 @@ } | ||
exports.lazyLoad=function(arg){ | ||
var s=function(){"use strict";var o=function(o){var t=(void 0===o?[]:o)[0];return t?{x:t.scrollLeft,y:t.scrollTop}:{x:window.scrollX||window.pageXOffset,y:window.scrollY||window.pageYOffset}};var t=function(o){var t=void 0===o?[]:o,r=t[0],e=t[1],l=Object.keys(e).sort(),n=l.reduce((function(o,t){return o[t]={value:r.style.getPropertyValue(t),important:Boolean(r.style.getPropertyPriority(t))},o}),{});return l.forEach((function(o){r.style.setProperty(o,"string"!=typeof e[o]&&e[o]?e[o].value:e[o],e[o]&&e[o].important?"important":"")})),n};var r=function(o){var r=void 0===o?[]:o,e=r[0],l=r[1];e=e||document.documentElement;var n=t([e,{"scroll-behavior":{value:"auto",important:!0}}]);return e.scrollTo?e.scrollTo(l.x,l.y):(e.scrollLeft=l.x,e.scrollTop=l.y),t([e,n]),{x:e.scrollLeft,y:e.scrollTop}},e="__EYES__APPLITOOLS__";return window[e]=window[e]||{},function(t){var l=void 0===t?[]:t,n=l[0],i=l[1],a=(i=void 0===i?{}:i).scrollLength,s=i.waitingTime,u=i.maxAmountToScroll;try{if(window[e].lazyLoadResult){var c=window[e].lazyLoadResult;return"WIP"!==c.status&&delete window[e].lazyLoadResult,JSON.stringify(c)}window[e].lazyLoadResult={status:"WIP"};var d=o(),y=[];y.push({maxAmountToScroll:u,scrollLength:a,waitingTime:s,startingScrollPositionX:d.x,startingScrollPositionY:d.y});var w=Date.now();return function o(t){var l=void 0===t?{}:t,i=l.doneScrolling,c=l.previousScrollResult,v=void 0===c?{}:c;setTimeout((function(){try{if(i){var t=r([n,d]),l=t.x,s=t.y;return y.push({x:l,y:s,msSinceStart:Date.now()-w}),void(window[e].lazyLoadResult={status:"SUCCESS",value:y})}var c=r([n,{x:d.x,y:v.y+a}]),f=c.x,S=c.y;y.push({x:f,y:S,msSinceStart:Date.now()-w}),o({doneScrolling:S===v.y||S===u,previousScrollResult:{x:f,y:S}})}catch(o){window[e].lazyLoadResult={status:"ERROR",error:o}}}),s)}(),JSON.stringify(window[e].lazyLoadResult)}catch(o){return window[e].lazyLoadResult={status:"ERROR",error:o},JSON.stringify(window[e].lazyLoadResult)}}}(); | ||
var s=function(){"use strict";var o=function(o){var t=(void 0===o?[]:o)[0];return t?{x:t.scrollLeft,y:t.scrollTop}:{x:window.scrollX||window.pageXOffset,y:window.scrollY||window.pageYOffset}};var t=function(o){var t=void 0===o?[]:o,r=t[0],n=t[1],i=Object.keys(n).sort(),e=i.reduce((function(o,t){return o[t]={value:r.style.getPropertyValue(t),important:Boolean(r.style.getPropertyPriority(t))},o}),{});return i.forEach((function(o){r.style.setProperty(o,"string"!=typeof n[o]&&n[o]?n[o].value:n[o],n[o]&&n[o].important?"important":"")})),e};var r=function(o){var r=void 0===o?[]:o,n=r[0],i=r[1];n=n||document.documentElement;var e=t([n,{"scroll-behavior":{value:"auto",important:!0}}]);return n.scrollTo?n.scrollTo(i.x,i.y):(n.scrollLeft=i.x,n.scrollTop=i.y),t([n,e]),{x:n.scrollLeft,y:n.scrollTop}},n="__EYES__APPLITOOLS__",i="lazyLoadResult";return window[n]=window[n]||{},function(t){var e=void 0===t?[]:t,l=e[0],s=e[1],a=void 0===s?{}:s,u=a.scrollLength,c=a.waitingTime,w=a.maxAmountToScroll;try{if(window[n][i]){var d=window[n][i];return"WIP"!==d.status&&delete window[n][i],JSON.stringify(d)}window[n][i]={status:"WIP"};var v=o(),y=[];y.push({maxAmountToScroll:w,scrollLength:u,waitingTime:c,startingScrollPositionX:v.x,startingScrollPositionY:v.y});var f=Date.now();return function o(t){var e=void 0===t?{}:t,s=e.doneScrolling,a=e.previousScrollResult,d=void 0===a?{}:a;setTimeout((function(){try{if(s){var t=r([l,v]),e=t.x,a=t.y;return y.push({x:e,y:a,msSinceStart:Date.now()-f}),void(window[n][i]={status:"SUCCESS",value:y})}var c=r([l,{x:v.x,y:d.y+u}]),S=c.x,p=c.y;y.push({x:S,y:p,msSinceStart:Date.now()-f}),o({doneScrolling:p===d.y||p===w,previousScrollResult:{x:S,y:p}})}catch(o){window[n][i]={status:"ERROR",error:o}}}),c)}(),JSON.stringify(window[n][i])}catch(o){return window[n][i]={status:"ERROR",error:o},JSON.stringify(window[n][i])}}}(); | ||
return s(arg) | ||
@@ -110,0 +110,0 @@ } |
{ | ||
"name": "@applitools/snippets", | ||
"version": "2.4.21", | ||
"version": "2.4.22", | ||
"repository": { | ||
@@ -10,5 +10,2 @@ "type": "git", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"aliases": [ | ||
"snippets" | ||
], | ||
"main": "./dist/index.js", | ||
@@ -19,18 +16,11 @@ "files": [ | ||
"scripts": { | ||
"lint": "eslint '**/*.js'", | ||
"lint": "run --top-level eslint '**/*.js'", | ||
"build": "node ./rollup/cli bundle --format snippet", | ||
"build:watch": "node ./rollup/cli watch --format snippet", | ||
"test": "node ../../node_modules/.bin/mocha './test/*.spec.js' -r ./test/util/hook.js", | ||
"test:chrome": "MOCHA_GROUP=chrome node ../../node_modules/.bin/mocha './test/*.spec.js' --grep chrome -r ./test/util/hook.js", | ||
"test:ie": "MOCHA_GROUP=ie node ../../node_modules/.bin/mocha './test/*.spec.js' --grep 'internet explorer' -r ./test/util/hook.js", | ||
"test:ios": "MOCHA_GROUP=ios node ../../node_modules/.bin/mocha './test/*.spec.js' --grep 'ios safari' -r ./test/util/hook.js", | ||
"test:sanity": "yarn test:chrome", | ||
"deps": "bongo deps", | ||
"preversion": "bongo preversion", | ||
"version": "bongo version", | ||
"postversion": "bongo postversion" | ||
"test": "run --top-level mocha './test/*.spec.js' -r ./test/util/hook.js", | ||
"test:chrome": "MOCHA_GROUP=chrome run --top-level mocha './test/*.spec.js' --grep chrome -r ./test/util/hook.js", | ||
"test:ie": "MOCHA_GROUP=ie run --top-level mocha './test/*.spec.js' --grep 'internet explorer' -r ./test/util/hook.js", | ||
"test:ios": "MOCHA_GROUP=ios run --top-level mocha './test/*.spec.js' --grep 'ios safari' -r ./test/util/hook.js" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@applitools/bongo": "^3.0.3", | ||
"@babel/core": "^7.11.6", | ||
@@ -41,20 +31,15 @@ "@babel/preset-env": "^7.11.5", | ||
"chalk": "^4.1.0", | ||
"eslint": "^7.9.0", | ||
"eslint-plugin-mocha-no-only": "^1.1.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"glob": "^7.1.6", | ||
"playwright": "1.27.1", | ||
"prettier": "1.19.0", | ||
"playwright": "^1.34.3", | ||
"rollup": "^2.26.11", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"webdriverio": "^7.25.4", | ||
"yargs": "^16.0.3" | ||
"webdriverio": "^7.25.0", | ||
"yargs": "^17.7.2" | ||
}, | ||
"resolutions": { | ||
"chromedriver": "^98.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=12.13.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} | ||
} |
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
11
4
175
35483