@applitools/snippets 2.4.21 → 2.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +3 -3
- package/package.json +13 -28
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.4.22](https://github.com/applitools/eyes.sdk.javascript1/compare/js/snippets-v2.4.21...js/snippets@2.4.22) (2023-08-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* improve orientation extraction for ios devices ([378d989](https://github.com/applitools/eyes.sdk.javascript1/commit/378d9894e4fbc7247087ccb8c46266dc4737e2e5))
|
package/dist/index.js
CHANGED
|
@@ -87,11 +87,11 @@ var s=function(){"use strict";return function(n){return n[0].innerText}}();
|
|
|
87
87
|
return s(arg)
|
|
88
88
|
}
|
|
89
89
|
exports.getUserAgent=function(arg){
|
|
90
|
-
var s=function(){"use strict";function t(){return t=Object.assign
|
|
90
|
+
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])}}}();
|
|
91
91
|
return s(arg)
|
|
92
92
|
}
|
|
93
93
|
exports.getViewport=function(arg){
|
|
94
|
-
var s=function(){"use strict";return function(){var e=0,
|
|
94
|
+
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}}}();
|
|
95
95
|
return s(arg)
|
|
96
96
|
}
|
|
97
97
|
exports.isElementScrollable=function(arg){
|
|
@@ -103,7 +103,7 @@ var s=function(){"use strict";return function(r){var n=void 0===r?[]:r;return n[
|
|
|
103
103
|
return s(arg)
|
|
104
104
|
}
|
|
105
105
|
exports.lazyLoad=function(arg){
|
|
106
|
-
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],
|
|
106
|
+
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])}}}();
|
|
107
107
|
return s(arg)
|
|
108
108
|
}
|
|
109
109
|
exports.reloadPage=function(arg){
|
package/package.json
CHANGED
|
@@ -1,57 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/snippets",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.22",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1.git",
|
|
7
7
|
"directory": "js/packages/snippets"
|
|
8
8
|
},
|
|
9
9
|
"license": "SEE LICENSE IN LICENSE",
|
|
10
|
-
"aliases": [
|
|
11
|
-
"snippets"
|
|
12
|
-
],
|
|
13
10
|
"main": "./dist/index.js",
|
|
14
11
|
"files": [
|
|
15
12
|
"dist"
|
|
16
13
|
],
|
|
17
14
|
"scripts": {
|
|
18
|
-
"lint": "eslint '**/*.js'",
|
|
15
|
+
"lint": "run --top-level eslint '**/*.js'",
|
|
19
16
|
"build": "node ./rollup/cli bundle --format snippet",
|
|
20
17
|
"build:watch": "node ./rollup/cli watch --format snippet",
|
|
21
|
-
"test": "
|
|
22
|
-
"test:chrome": "MOCHA_GROUP=chrome
|
|
23
|
-
"test:ie": "MOCHA_GROUP=ie
|
|
24
|
-
"test:ios": "MOCHA_GROUP=ios
|
|
25
|
-
"test:sanity": "yarn test:chrome",
|
|
26
|
-
"deps": "bongo deps",
|
|
27
|
-
"preversion": "bongo preversion",
|
|
28
|
-
"version": "bongo version",
|
|
29
|
-
"postversion": "bongo postversion"
|
|
18
|
+
"test": "run --top-level mocha './test/*.spec.js' -r ./test/util/hook.js",
|
|
19
|
+
"test:chrome": "MOCHA_GROUP=chrome run --top-level mocha './test/*.spec.js' --grep chrome -r ./test/util/hook.js",
|
|
20
|
+
"test:ie": "MOCHA_GROUP=ie run --top-level mocha './test/*.spec.js' --grep 'internet explorer' -r ./test/util/hook.js",
|
|
21
|
+
"test:ios": "MOCHA_GROUP=ios run --top-level mocha './test/*.spec.js' --grep 'ios safari' -r ./test/util/hook.js"
|
|
30
22
|
},
|
|
31
|
-
"dependencies": {},
|
|
32
23
|
"devDependencies": {
|
|
33
|
-
"@applitools/bongo": "^3.0.3",
|
|
34
24
|
"@babel/core": "^7.11.6",
|
|
35
25
|
"@babel/preset-env": "^7.11.5",
|
|
36
26
|
"@rollup/plugin-babel": "^5.2.1",
|
|
37
27
|
"@rollup/plugin-commonjs": "^15.0.0",
|
|
38
28
|
"chalk": "^4.1.0",
|
|
39
|
-
"eslint": "^7.9.0",
|
|
40
|
-
"eslint-plugin-mocha-no-only": "^1.1.1",
|
|
41
|
-
"eslint-plugin-node": "^11.1.0",
|
|
42
|
-
"eslint-plugin-prettier": "^3.1.4",
|
|
43
29
|
"glob": "^7.1.6",
|
|
44
|
-
"playwright": "1.
|
|
45
|
-
"prettier": "1.19.0",
|
|
30
|
+
"playwright": "^1.34.3",
|
|
46
31
|
"rollup": "^2.26.11",
|
|
47
32
|
"rollup-plugin-terser": "^7.0.2",
|
|
48
|
-
"webdriverio": "^7.25.
|
|
49
|
-
"yargs": "^
|
|
50
|
-
},
|
|
51
|
-
"resolutions": {
|
|
52
|
-
"chromedriver": "^98.0.0"
|
|
33
|
+
"webdriverio": "^7.25.0",
|
|
34
|
+
"yargs": "^17.7.2"
|
|
53
35
|
},
|
|
54
36
|
"engines": {
|
|
55
37
|
"node": ">=12.13.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
56
41
|
}
|
|
57
|
-
}
|
|
42
|
+
}
|