@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 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 t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e=function(t){var e=t&&t[0]||null;return!e||("isConnected"in window.Node.prototype?!e.isConnected:document.documentElement.contains?!document.documentElement.contains(e):!e.ownerDocument.documentElement.contains(e))},r=e;var o=function(t){if(!t.hasAttribute("data-applitools-fallback-selector")){if(r([t]))throw new Error("The element is not connected to the DOM: "+function(t){var e=t.attributes,r=t.tagName,o=t.children.length,n=[].slice.call(e).map((function(t){return t.name+'="'+t.value+'"'})).join(" ");return"<"+r+" "+n+(o?">":"/>")}(t));t.setAttribute("data-applitools-fallback-selector",function(t){var e=[];for(;t&&t.nodeType===Node.ELEMENT_NODE;)try{var r,o=t.tagName.toLowerCase(),n=[].slice.call((null==(r=t.parentNode)?void 0:r.children)||[]).indexOf(t);n>-1&&(o+=":nth-child("+(n+1)+")"),e.unshift(o),t=t.parentNode}catch(t){break}return e.length?e.join(" > "):"html"}(t))}},n=e;function a(t,e){if(n([t])){var r=function(t){if(null==t||!t.getAttribute)return{error:"invalid element: "+JSON.stringify(t)};var e=t.getAttribute("data-applitools-fallback-selector");return e}(t);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",e),i.setAttribute("data-applitools-recovered",!0),a(i,e)}o(t);var u=t.getAttribute("data-applitools-selector"),c=u?u+" "+e:e;return t.setAttribute("data-applitools-selector",c),'[data-applitools-selector~="'+e+'"]'}return t((function(t){return t.map((function(t){var e=t[0],r=t[1];return e.map((function(t){var e=function(t){var e=[t];if(t.getRootNode)for(var r=t.getRootNode();r!==document&&r.constructor&&"ShadowRoot"===r.constructor.name;r=r.host.getRootNode())e.push(r.host);return e}(t);return e.map((function(t){return a(t,r)}))}))}))}))}();
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){if(t.removeAttribute("data-applitools-selector"),t.getRootNode)try{for(var o=t.getRootNode();o!==document&&o.constructor&&"ShadowRoot"===o.constructor.name;o=o.host.getRootNode())o.host.removeAttribute("data-applitools-selector")}catch(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){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/snippets",
3
- "version": "2.7.1",
3
+ "version": "2.8.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1.git",