@glimt/record 0.0.78 → 0.0.79

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.
@@ -10337,6 +10337,8 @@ const _ObserveManager = class _ObserveManager2 {
10337
10337
  __publicField(this, "shadowRootsObservers", /* @__PURE__ */ new WeakSet());
10338
10338
  __publicField(this, "mutationOptions");
10339
10339
  __publicField(this, "emitter", null);
10340
+ __publicField(this, "isSnapshottingShadowRoots", false);
10341
+ __publicField(this, "isSnapshottingDocs", false);
10340
10342
  if (_ObserveManager2.instance) {
10341
10343
  return _ObserveManager2.instance;
10342
10344
  }
@@ -10417,6 +10419,7 @@ const _ObserveManager = class _ObserveManager2 {
10417
10419
  this.emitShadowRoot(serialized, shadowRoot2);
10418
10420
  }
10419
10421
  onDocObserver(doc) {
10422
+ if (this.isSnapshottingDocs) return false;
10420
10423
  if (!this.usable) return false;
10421
10424
  if (!this.docsObservers.has(doc)) {
10422
10425
  this.docsObservers.add(doc);
@@ -10426,10 +10429,13 @@ const _ObserveManager = class _ObserveManager2 {
10426
10429
  "onDocObserver: doc already observed, emitting full snapshot for doc",
10427
10430
  doc
10428
10431
  );
10432
+ this.isSnapshottingDocs = true;
10429
10433
  this.serializeAndEmitDoc(doc);
10434
+ this.isSnapshottingDocs = false;
10430
10435
  return false;
10431
10436
  }
10432
10437
  onShadowRootObserver(shadowRoot2) {
10438
+ if (this.isSnapshottingShadowRoots) return false;
10433
10439
  if (!this.usable) return false;
10434
10440
  if (!this.shadowRootsObservers.has(shadowRoot2)) {
10435
10441
  this.shadowRootsObservers.add(shadowRoot2);
@@ -10439,7 +10445,9 @@ const _ObserveManager = class _ObserveManager2 {
10439
10445
  "onShadowRootObserver: shadowRoot already observed, emitting full snapshot for shadowRoot",
10440
10446
  shadowRoot2
10441
10447
  );
10448
+ this.isSnapshottingShadowRoots = true;
10442
10449
  this.serializeAndEmitShadowRoot(shadowRoot2);
10450
+ this.isSnapshottingShadowRoots = false;
10443
10451
  return false;
10444
10452
  }
10445
10453
  // canObserveDoc(doc: Document) {