@pendo/agent 2.290.1 → 2.291.0

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/dist/dom.esm.js CHANGED
@@ -6366,7 +6366,8 @@ var ConfigReader = (function () {
6366
6366
  /**
6367
6367
  * Use this setting when using `preferMutationObserver` with an application that has Shadow DOM elements.
6368
6368
  * On page load, the Agent will run a full document scan for shadow roots and attach a MutationObserver to
6369
- * all results.
6369
+ * all results. This setting also allows the agent to run CSS selectors in all shadow roots, so CSS selectors
6370
+ * can be written without specifying the full path through all shadow roots with the `::shadow` pseudo-class.
6370
6371
  *
6371
6372
  * @access public
6372
6373
  * @category Config/Core
@@ -7311,7 +7312,7 @@ function getScreenPosition(element) {
7311
7312
  };
7312
7313
  }
7313
7314
 
7314
- var VERSION = '2.290.1_';
7315
+ var VERSION = '2.291.0_';
7315
7316
 
7316
7317
  var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
7317
7318
 
@@ -8857,32 +8858,35 @@ var getBody = function (_document) {
8857
8858
  * @param {HTMLElement} element
8858
8859
  * @returns {boolean}
8859
8860
  */
8860
- function isInDocument(element) {
8861
- if (SizzleProxy.contains(document, element))
8861
+ function isInDocument(element, doc) {
8862
+ if (doc === void 0) { doc = document; }
8863
+ if (SizzleProxy.contains(doc, element))
8862
8864
  return true;
8863
8865
  while (element && element.parentNode || shadowAPI.isElementShadowRoot(element)) {
8864
8866
  element = shadowAPI.getParent(element);
8865
8867
  }
8866
- return element === document;
8868
+ return element === doc;
8867
8869
  }
8868
8870
  var getClientRect = function (element) {
8869
- var pbody = getBody();
8870
- if (element === null) {
8871
+ if (element == null) {
8871
8872
  return;
8872
8873
  }
8873
- else if ((element === document || element === window)) {
8874
+ var doc = element.ownerDocument || document;
8875
+ var win = doc.defaultView || window;
8876
+ var pbody = getBody(doc);
8877
+ if ((element === doc || element === win)) {
8874
8878
  var viewport = {
8875
- left: window.pageXOffset || pbody.scrollLeft,
8876
- top: window.pageYOffset || pbody.scrollTop,
8877
- width: window.innerWidth,
8878
- height: window.innerHeight
8879
+ left: win.pageXOffset || pbody.scrollLeft,
8880
+ top: win.pageYOffset || pbody.scrollTop,
8881
+ width: win.innerWidth,
8882
+ height: win.innerHeight
8879
8883
  };
8880
8884
  viewport.right = viewport.left + viewport.width;
8881
8885
  viewport.bottom = viewport.top + viewport.height;
8882
8886
  return viewport;
8883
8887
  }
8884
8888
  else {
8885
- var clientRect = getOffsetPosition(element);
8889
+ var clientRect = getOffsetPosition(element, win);
8886
8890
  clientRect.right = clientRect.left + clientRect.width;
8887
8891
  clientRect.bottom = clientRect.top + clientRect.height;
8888
8892
  return clientRect;
@@ -9577,7 +9581,7 @@ DomQuery.$ = {
9577
9581
  if (target && target.parentNode) {
9578
9582
  target.parentNode.insertBefore(this[0], target);
9579
9583
  // Execute scripts (if any) when the fragment enters the document
9580
- if (isInDocument(document)) {
9584
+ if (isInDocument(document, this)) {
9581
9585
  _.each(SizzleProxy('script', this[0]), evalScript);
9582
9586
  }
9583
9587
  }