@applitools/snippets 2.5.0 → 2.5.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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.5.1](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.5.0...js/snippets@2.5.1) (2024-10-21)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * isStaleElement error ([#2567](https://github.com/Applitools-Dev/sdk/issues/2567)) ([2675086](https://github.com/Applitools-Dev/sdk/commit/2675086aa28589082249e2958942ee29a5f2ef12))
9
+
3
10
  ## [2.5.0](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.4.27...js/snippets@2.5.0) (2024-09-16)
4
11
 
5
12
 
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=(void 0===t?[null]:t)[0];if(!(e&&e instanceof Node))return!0;for(var o=e;o;){if(o===document)return!1;if(null===o.parentNode&&o!==document)return!0;o=(null==o.getRootNode?void 0:o.getRootNode().host)||o.parentNode||o.host}return!0};function o(t,r){if(e([t])){var n=function(t){if(null==t||!t.getAttribute)throw new Error("invalid element: "+JSON.stringify(t));var e=t.getAttribute("data-applitools-fallback-selector");if(!e)throw new Error("Failed to recover from stale element");return e}(t),a=document.querySelector(n);if(!a)throw new Error("Failed to recover from stale element - selector found: "+n);return a.setAttribute("data-applitools-selector",r),a.setAttribute("data-applitools-recovered",!0),o(a,r)}!function(t){t.hasAttribute("data-applitools-fallback-selector")||t.setAttribute("data-applitools-fallback-selector",function(t){var e=[];for(;t&&t.nodeType===Node.ELEMENT_NODE;){var o=t.tagName.toLowerCase(),r=[].slice.call(t.parentNode.children||[]).indexOf(t)+1;r>1&&(o+=":nth-child("+r+")"),e.unshift(o),t=t.parentNode}return e.length?e.join(" > "):"html"}(t))}(t);var l=t.getAttribute("data-applitools-selector"),u=l?l+" "+r:r;return t.setAttribute("data-applitools-selector",u),'[data-applitools-selector~="'+r+'"]'}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 o=t.getRootNode();o!==document&&o.constructor&&"ShadowRoot"===o.constructor.name;o=o.host.getRootNode())e.push(o.host);return e}(t);return e.map((function(t){return o(t,r)}))}))}))}))}();
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=(void 0===t?[null]:t)[0];if(!e||!e.nodeType)return!0;for(var o=e;o;){if(o===document)return!1;if(null===o.parentNode&&o!==document)return!0;o=(null==o.getRootNode?void 0:o.getRootNode().host)||o.parentNode||o.host}return!0};function o(t,r){if(e([t])){var n=function(t){if(null==t||!t.getAttribute)throw new Error("invalid element: "+JSON.stringify(t));var e=t.getAttribute("data-applitools-fallback-selector");if(!e)throw new Error("Failed to recover from stale element");return e}(t),a=document.querySelector(n);if(!a)throw new Error("Failed to recover from stale element - selector found: "+n);return a.setAttribute("data-applitools-selector",r),a.setAttribute("data-applitools-recovered",!0),o(a,r)}!function(t){t.hasAttribute("data-applitools-fallback-selector")||t.setAttribute("data-applitools-fallback-selector",function(t){var e=[];for(;t&&t.nodeType===Node.ELEMENT_NODE;){var o=t.tagName.toLowerCase(),r=[].slice.call(t.parentNode.children||[]).indexOf(t)+1;r>1&&(o+=":nth-child("+r+")"),e.unshift(o),t=t.parentNode}return e.length?e.join(" > "):"html"}(t))}(t);var l=t.getAttribute("data-applitools-selector"),u=l?l+" "+r:r;return t.setAttribute("data-applitools-selector",u),'[data-applitools-selector~="'+r+'"]'}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 o=t.getRootNode();o!==document&&o.constructor&&"ShadowRoot"===o.constructor.name;o=o.host.getRootNode())e.push(o.host);return e}(t);return e.map((function(t){return o(t,r)}))}))}))}))}();
3
3
  return s(arg)
4
4
  }
5
5
  exports.addPageMarker=function(arg){
@@ -103,7 +103,7 @@ var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.proto
103
103
  return s(arg)
104
104
  }
105
105
  exports.isStaleElement=function(arg){
106
- 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){var e=(void 0===t?[null]:t)[0];if(!(e&&e instanceof Node))return!0;for(var o=e;o;){if(o===document)return!1;if(null===o.parentNode&&o!==document)return!0;o=(null==o.getRootNode?void 0:o.getRootNode().host)||o.parentNode||o.host}return!0}))}();
106
+ 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){var e=(void 0===t?[null]:t)[0];if(!e||!e.nodeType)return!0;for(var o=e;o;){if(o===document)return!1;if(null===o.parentNode&&o!==document)return!0;o=(null==o.getRootNode?void 0:o.getRootNode().host)||o.parentNode||o.host}return!0}))}();
107
107
  return s(arg)
108
108
  }
109
109
  exports.lazyLoad=function(arg){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/snippets",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1.git",