@applitools/snippets 2.2.2 → 2.2.3

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.
@@ -24,7 +24,7 @@
24
24
  "getUserAgent": "function(arg){var s=function(){\"use strict\";return function(){return window.navigator.userAgent}}();\nreturn s(arg)}",
25
25
  "getViewportScale": "function(arg){var s=function(){\"use strict\";return function(){return window.visualViewport&&window.visualViewport.scale}}();\nreturn s(arg)}",
26
26
  "getViewportSize": "function(arg){var s=function(){\"use strict\";return function(){var 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),{width:e,height:t}}}();\nreturn s(arg)}",
27
- "isElementScrollable": "function(arg){var s=function(){\"use strict\";return function(t){var i=(void 0===t?[]:t)[0];return i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight}}();\nreturn s(arg)}",
27
+ "isElementScrollable": "function(arg){var s=function(){\"use strict\";var t=function(t){var o=void 0===t?[]:t,r=o[0],e=o[1],i=void 0===e?[]:e,n=window.getComputedStyle(r);return n?i.map((function(t){return n.getPropertyValue(t)})):[]};return function(o){var r=(void 0===o?[]:o)[0],e=t([r,[\"overflow-x\",\"overflow-y\",\"overflow\"]]);return(\"scroll\"===e[0]||\"auto\"===e[0]||\"hidden\"===e[2])&&r.scrollWidth>r.clientWidth||(\"scroll\"===e[1]||\"auto\"===e[1]||\"hidden\"===e[2])&&r.scrollHeight>r.clientHeight}}();\nreturn s(arg)}",
28
28
  "isEqualElements": "function(arg){var s=function(){\"use strict\";return function(r){var n=void 0===r?[]:r;return n[0]===n[1]}}();\nreturn s(arg)}",
29
29
  "scrollTo": "function(arg){var s=function(){\"use strict\";var t=function(t){var r=void 0===t?[]:t,o=r[0],e=r[1],l=Object.keys(e).sort(),n=l.reduce((function(t,r){return t[r]={value:o.style.getPropertyValue(r),important:Boolean(o.style.getPropertyPriority(r))},t}),{});return l.forEach((function(t){o.style.setProperty(t,\"string\"!=typeof e[t]&&e[t]?e[t].value:e[t],e[t]&&e[t].important?\"important\":\"\")})),n};return function(r){var o=void 0===r?[]:r,e=o[0],l=o[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}}}();\nreturn s(arg)}",
30
30
  "setElementAttributes": "function(arg){var s=function(){\"use strict\";return function(t){var e=void 0===t?[]:t,r=e[0],u=e[1];return Object.keys(u).reduce((function(t,e){return t[e]=r.getAttribute(e),r.setAttribute(e,u[e]),t}),{})}}();\nreturn s(arg)}",
package/dist/index.js CHANGED
@@ -99,7 +99,7 @@ var s=function(){"use strict";return function(){var e=0,t=0;return window.innerH
99
99
  return s(arg)
100
100
  }
101
101
  exports.isElementScrollable=function(arg){
102
- var s=function(){"use strict";return function(t){var i=(void 0===t?[]:t)[0];return i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight}}();
102
+ var s=function(){"use strict";var t=function(t){var o=void 0===t?[]:t,r=o[0],e=o[1],i=void 0===e?[]:e,n=window.getComputedStyle(r);return n?i.map((function(t){return n.getPropertyValue(t)})):[]};return function(o){var r=(void 0===o?[]:o)[0],e=t([r,["overflow-x","overflow-y","overflow"]]);return("scroll"===e[0]||"auto"===e[0]||"hidden"===e[2])&&r.scrollWidth>r.clientWidth||("scroll"===e[1]||"auto"===e[1]||"hidden"===e[2])&&r.scrollHeight>r.clientHeight}}();
103
103
  return s(arg)
104
104
  }
105
105
  exports.isEqualElements=function(arg){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/snippets",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "main": "./dist/index.js",
6
6
  "files": [
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {},
33
33
  "devDependencies": {
34
- "@applitools/sdk-release-kit": "^0.3.3",
34
+ "@applitools/bongo": "^2.0.3",
35
35
  "@babel/core": "^7.11.6",
36
36
  "@babel/preset-env": "^7.11.5",
37
37
  "@rollup/plugin-babel": "^5.2.1",
package/CHANGELOG.md DELETED
@@ -1,128 +0,0 @@
1
-
2
- # Changelog
3
-
4
- ## Unreleased
5
-
6
-
7
- ## 2.2.2 - 2022/3/13
8
-
9
- - adjust getContextInfo to work with Cypress Universal (return isRoot=true for context with document which is marked as "[applitools-marker]=root-context")
10
-
11
- ## 2.2.1 - 2022/3/12
12
-
13
- - consider dynamic scrollingElement in other snippets
14
-
15
- ## 2.2.0 - 2022/3/6
16
-
17
- - support assigning 'scrollingElement' as 'body' or 'html' dom element
18
-
19
- ## 2.1.15 - 2022/2/16
20
-
21
- - revert 2.1.14
22
-
23
- ## 2.1.14 - 2022/2/15
24
-
25
- - fix `getElementRect` for `document.scrollingElement`
26
-
27
- ## 2.1.13 - 2022/2/15
28
-
29
- - add `getViewportScale` snippet
30
- - remove auto scaling from `getViewportSize` and `addPageMarker`
31
- - marker mask and size have to be passed as arguments in `addPageMarker`
32
-
33
- ## 2.1.12 - 2021/12/22
34
-
35
- - round fractional values in `getViewportSize`
36
-
37
- ## 2.1.11 - 2021/12/22
38
-
39
- - add neutral color border around marker in `addPageMarker`
40
- - improve handling of pages without viewport tag in `addPageMarker` and `getViewportSize`
41
-
42
- ## 2.1.10 - 2021/12/20
43
-
44
- - overwrite `transform` style property with `!important` in `translateTo`
45
-
46
- ## 2.1.9 - 2021/12/17
47
-
48
- - fix `scrollTo` which was returning the wrong actual scroll position due to `scroll-behavior: smooth` style on the scrollable element
49
-
50
- ## 2.1.8 - 2021/12/16
51
-
52
- - fix `addPageMarker` to handle different pixel densities
53
- - change shape and size of marker added by `addPageMarker`
54
-
55
- ## 2.1.7 - 2021/9/9
56
-
57
- - fix `getShadowRoot` to follow convention for arguments
58
-
59
- ## 2.1.6 - 2021/9/6
60
-
61
- - return array instead of object from `addElementIds`
62
-
63
- ## 2.1.5 - 2021/9/6
64
-
65
- - add `getShadowRoot` snippet
66
- - replace `setElementMarkers` with `addElementIds` snippet, which will return a selector mapping
67
-
68
- ## 2.1.4 - 2021/8/4
69
-
70
- - add `isEqualElements` snippet
71
-
72
- ## 2.1.3 - 2021/3/11
73
-
74
- - fix exception thrown in getElementTranslateOffset [Trello](https://trello.com/c/duAwaupv)
75
-
76
- ## 2.1.1 - 2021/1/26
77
-
78
- - handle translated html elements during content size extracting
79
- - chore: add husky
80
-
81
- ## 2.1.0 - 2020/10/23
82
-
83
- - fix `blurElement`: use default value if element passed as `null`
84
- - fix `getElementRect`: extract element fixed ancestor inner offset even if it not scrollable
85
- - fix `setElementMarkers`: concat ids instead of override
86
-
87
- ## 2.0.3 - 2020/10/6
88
-
89
- - publish with dist folder
90
-
91
- ## 2.0.2 - 2020/10/6
92
-
93
- - added `addPageMarker` and `cleanupPageMarker` snippets
94
- - handle priority of the style properties in `getElementStyleProperties` and `setElementStyleProperties`
95
-
96
- ## 2.0.1 - 2020/9/28
97
-
98
- - remove yarn workspaces
99
-
100
- ## 2.0.0 - 2020/9/14
101
-
102
- - Breaking change: changed snippets argument format from object to array
103
- - Breaking change: changed snippets return value format from object to array
104
- - add ios tests
105
-
106
- ## 1.1.1 - 2020/8/30
107
-
108
- - nothing added, technical issue with unreleased commits
109
-
110
- ## 1.1.0 - 2020/8/30
111
-
112
- - add `markElements` and `cleanupElementIds`
113
-
114
- ## 1.0.3 - 2020/8/10
115
-
116
- - bumped sdk-release-kit version to latest
117
-
118
- ## 1.0.2 - 2020/8/4
119
-
120
- - Fix git tagging
121
-
122
- ## 1.0.1 - 2020/8/4
123
-
124
- - Fix IE capabilities
125
-
126
- ## 1.0.0 - 2020/8/4
127
-
128
- - First release