@applitools/snippets 2.4.21 → 2.4.23

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 ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## [2.4.23](https://github.com/applitools/eyes.sdk.javascript1/compare/js/snippets@2.4.22...js/snippets@2.4.23) (2023-08-18)
4
+
5
+
6
+ ### Code Refactoring
7
+
8
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
9
+
10
+ ## [2.4.22](https://github.com/applitools/eyes.sdk.javascript1/compare/js/snippets-v2.4.21...js/snippets@2.4.22) (2023-08-03)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * 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||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)}}}();
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,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$/,"")}}}();
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],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)}}}();
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.21",
3
+ "version": "2.4.23",
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": "node ../../node_modules/.bin/mocha './test/*.spec.js' -r ./test/util/hook.js",
22
- "test:chrome": "MOCHA_GROUP=chrome node ../../node_modules/.bin/mocha './test/*.spec.js' --grep chrome -r ./test/util/hook.js",
23
- "test:ie": "MOCHA_GROUP=ie node ../../node_modules/.bin/mocha './test/*.spec.js' --grep 'internet explorer' -r ./test/util/hook.js",
24
- "test:ios": "MOCHA_GROUP=ios node ../../node_modules/.bin/mocha './test/*.spec.js' --grep 'ios safari' -r ./test/util/hook.js",
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.27.1",
45
- "prettier": "1.19.0",
30
+ "playwright": "^1.37.0",
46
31
  "rollup": "^2.26.11",
47
32
  "rollup-plugin-terser": "^7.0.2",
48
- "webdriverio": "^7.25.4",
49
- "yargs": "^16.0.3"
50
- },
51
- "resolutions": {
52
- "chromedriver": "^98.0.0"
33
+ "webdriverio": "^7.31.1",
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
+ }