@applitools/snippets 2.7.1 → 2.8.1
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 +14 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.8.1](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.8.0...js/snippets@2.8.1) (2026-03-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* exclude CHANGELOG.md from all published npm packages | AD-10793 ([#3682](https://github.com/Applitools-Dev/sdk/issues/3682)) ([95a0a80](https://github.com/Applitools-Dev/sdk/commit/95a0a8063fc2e1809c1bef1fc651d6deceda6e7e))
|
|
9
|
+
|
|
10
|
+
## [2.8.0](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.7.1...js/snippets@2.8.0) (2026-03-12)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* support coded regions within iframes and shadow DOM | FLD-4019 ([#3542](https://github.com/Applitools-Dev/sdk/issues/3542)) ([7c5639a](https://github.com/Applitools-Dev/sdk/commit/7c5639a8a4c135bc9331d9ff93f1824906549568))
|
|
16
|
+
|
|
3
17
|
## [2.7.1](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.7.0...js/snippets@2.7.1) (2026-03-08)
|
|
4
18
|
|
|
5
19
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
exports.addElementIds=function(arg){
|
|
2
|
-
var s=function(){"use strict";function
|
|
2
|
+
var s=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t=function(e){var t=e&&e[0]||null;return!t||("isConnected"in window.Node.prototype?!t.isConnected:document.documentElement.contains?!document.documentElement.contains(t):!t.ownerDocument.documentElement.contains(t))},r=t;var n=function(e){if(!e.hasAttribute("data-applitools-fallback-selector")){if(r([e]))throw new Error("The element is not connected to the DOM: "+function(e){var t=e.attributes,r=e.tagName,n=e.children.length,o=[].slice.call(t).map((function(e){return e.name+'="'+e.value+'"'})).join(" ");return"<"+r+" "+o+(n?">":"/>")}(e));e.setAttribute("data-applitools-fallback-selector",function(e){var t=[];for(;e&&e.nodeType===Node.ELEMENT_NODE;)try{var r,n=e.tagName.toLowerCase(),o=[].slice.call((null==(r=e.parentNode)?void 0:r.children)||[]).indexOf(e);o>-1&&(n+=":nth-child("+(o+1)+")"),t.unshift(n),e=e.parentNode}catch(e){break}return t.length?t.join(" > "):"html"}(e))}},o=t;function a(e,t){if(o([e])){var r=function(e){if(null==e||!e.getAttribute)return{error:"invalid element: "+JSON.stringify(e)};var t=e.getAttribute("data-applitools-fallback-selector");return t}(e);if(!r)return{error:"Failed to recover from stale element"};if(r.error)return r;var l=document.querySelectorAll(r);if(!l||1!==l.length)return{error:"Failed to recover from stale element - selector found: "+r};var i=l[0];return i.setAttribute("data-applitools-selector",t),i.setAttribute("data-applitools-recovered",!0),a(i,t)}n(e);var u=e.getAttribute("data-applitools-selector"),c=u?u+" "+t:t;return e.setAttribute("data-applitools-selector",c),'[data-applitools-selector~="'+t+'"]'}return e((function(e){return e.map((function(e){var t=e[0],r=e[1];return t.map((function(e){var t=function(e){var t=[{element:e,kind:"root"}],r=new Set([e]),n=e;for(;n;){var o,a=n.getRootNode&&n.getRootNode();if(!a)break;if(a.constructor&&"ShadowRoot"===a.constructor.name?(n=a.host,o="shadow"):(n=a.defaultView?a.defaultView.frameElement:null,o="frame"),n){if(r.has(n))break;r.add(n),t.push({element:n,kind:o})}}return t}(e);return t.map((function(e){return{selector:a(e.element,r),kind:e.kind}}))}))}))}))}();
|
|
3
3
|
return s(arg)
|
|
4
4
|
}
|
|
5
5
|
exports.addFallbackSelectorIfNeeded=function(arg){
|
|
@@ -15,7 +15,7 @@ var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.proto
|
|
|
15
15
|
return s(arg)
|
|
16
16
|
}
|
|
17
17
|
exports.cleanupElementIds=function(arg){
|
|
18
|
-
var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}return t((function(t){(t=t&&t[0])&&"function"==typeof t.forEach&&t.forEach((function(t){
|
|
18
|
+
var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}return t((function(t){(t=t&&t[0])&&"function"==typeof t.forEach&&t.forEach((function(t){t.removeAttribute("data-applitools-selector");var o=t;if(o.getRootNode)try{for(;o;){var e=o.getRootNode();if(!e)break;(o=e.constructor&&"ShadowRoot"===e.constructor.name?e.host:e.defaultView?e.defaultView.frameElement:null)&&o.removeAttribute("data-applitools-selector")}}catch(t){}}))}))}();
|
|
19
19
|
return s(arg)
|
|
20
20
|
}
|
|
21
21
|
exports.cleanupPageMarker=function(arg){
|