clarity-visualize 0.8.33 → 0.8.35

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.
@@ -705,7 +705,7 @@ class InteractionHelper {
705
705
  };
706
706
  this.visibility = (event) => {
707
707
  let doc = this.state.window.document;
708
- if (doc && doc.documentElement && event.data.visible !== "visible" /* Constant.Visible */) {
708
+ if (doc && doc.documentElement && event.data.visible === 0 /* BooleanFlag.False */) {
709
709
  // if the website has styles on the <html> node then we need to save the reference to them before we change them
710
710
  // to indicate the window was hidden. This is to ensure that we can restore the original styles when the window is visible again.
711
711
  const bg = doc.documentElement.style.backgroundColor;
@@ -1380,8 +1380,10 @@ class LayoutHelper {
1380
1380
  }
1381
1381
  };
1382
1382
  this.customElement = (event) => {
1383
- this.state.window.customElements.define(event.data.name, class extends this.state.window.HTMLElement {
1384
- });
1383
+ if (!this.state.window.customElements.get(event.data.name)) {
1384
+ this.state.window.customElements.define(event.data.name, class extends this.state.window.HTMLElement {
1385
+ });
1386
+ }
1385
1387
  };
1386
1388
  this.exists = (hash) => {
1387
1389
  if (hash) {
@@ -1917,6 +1919,9 @@ class Visualizer {
1917
1919
  case 46 /* Data.Event.StyleSheetUpdate */:
1918
1920
  this.layout.styleChange(entry);
1919
1921
  break;
1922
+ case 51 /* Data.Event.CustomElement */:
1923
+ this.layout.customElement(entry);
1924
+ break;
1920
1925
  case 6 /* Data.Event.Mutation */:
1921
1926
  let domEvent = entry;
1922
1927
  this.renderTime = domEvent.time;