@posthog/rrweb-record 0.0.30 → 0.0.33

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.
@@ -1430,8 +1430,8 @@ function getAugmentedNamespace$1(n2) {
1430
1430
  if (n2.__esModule) return n2;
1431
1431
  var f2 = n2.default;
1432
1432
  if (typeof f2 == "function") {
1433
- var a2 = function a22() {
1434
- if (this instanceof a22) {
1433
+ var a2 = function a3() {
1434
+ if (this instanceof a3) {
1435
1435
  return Reflect.construct(f2, arguments, this.constructor);
1436
1436
  }
1437
1437
  return f2.apply(this, arguments);
@@ -1440,8 +1440,8 @@ function getAugmentedNamespace$1(n2) {
1440
1440
  } else a2 = {};
1441
1441
  Object.defineProperty(a2, "__esModule", { value: true });
1442
1442
  Object.keys(n2).forEach(function(k) {
1443
- var d = Object.getOwnPropertyDescriptor(n2, k);
1444
- Object.defineProperty(a2, k, d.get ? d : {
1443
+ var d2 = Object.getOwnPropertyDescriptor(n2, k);
1444
+ Object.defineProperty(a2, k, d2.get ? d2 : {
1445
1445
  enumerable: true,
1446
1446
  get: function() {
1447
1447
  return n2[k];
@@ -1817,8 +1817,8 @@ function requireStringifier$1() {
1817
1817
  if (root2.raws.indent) return root2.raws.indent;
1818
1818
  let value;
1819
1819
  root2.walk((i2) => {
1820
- let p = i2.parent;
1821
- if (p && p !== root2 && p.parent && p.parent === root2) {
1820
+ let p2 = i2.parent;
1821
+ if (p2 && p2 !== root2 && p2.parent && p2.parent === root2) {
1822
1822
  if (typeof i2.raws.before !== "undefined") {
1823
1823
  let parts = i2.raws.before.split("\n");
1824
1824
  value = parts[parts.length - 1];
@@ -1916,7 +1916,7 @@ function requireNode$1() {
1916
1916
  } else if (i2 === "source") {
1917
1917
  cloned[i2] = value;
1918
1918
  } else if (Array.isArray(value)) {
1919
- cloned[i2] = value.map((j) => cloneNode(j, cloned));
1919
+ cloned[i2] = value.map((j2) => cloneNode(j2, cloned));
1920
1920
  } else {
1921
1921
  if (type === "object" && value !== null) value = cloneNode(value);
1922
1922
  cloned[i2] = value;
@@ -2702,10 +2702,10 @@ function requireAtRule$1() {
2702
2702
  Container.registerAtRule(AtRule);
2703
2703
  return atRule$1;
2704
2704
  }
2705
- var document$1$1;
2705
+ var document$2;
2706
2706
  var hasRequiredDocument$1;
2707
2707
  function requireDocument$1() {
2708
- if (hasRequiredDocument$1) return document$1$1;
2708
+ if (hasRequiredDocument$1) return document$2;
2709
2709
  hasRequiredDocument$1 = 1;
2710
2710
  let Container = requireContainer$1();
2711
2711
  let LazyResult, Processor;
@@ -2727,9 +2727,9 @@ function requireDocument$1() {
2727
2727
  Document2.registerProcessor = (dependant) => {
2728
2728
  Processor = dependant;
2729
2729
  };
2730
- document$1$1 = Document2;
2730
+ document$2 = Document2;
2731
2731
  Document2.default = Document2;
2732
- return document$1$1;
2732
+ return document$2;
2733
2733
  }
2734
2734
  var nonSecure$1;
2735
2735
  var hasRequiredNonSecure$1;
@@ -3432,9 +3432,9 @@ function requireMapGenerator$1() {
3432
3432
  column += str.length;
3433
3433
  }
3434
3434
  if (node2 && type !== "start") {
3435
- let p = node2.parent || { raws: {} };
3435
+ let p2 = node2.parent || { raws: {} };
3436
3436
  let childless = node2.type === "decl" || node2.type === "atrule" && !node2.nodes;
3437
- if (!childless || node2 !== p.last || p.raws.semicolon) {
3437
+ if (!childless || node2 !== p2.last || p2.raws.semicolon) {
3438
3438
  if (node2.source && node2.source.end) {
3439
3439
  mapping.source = this.sourcePath(node2);
3440
3440
  mapping.original.line = node2.source.end.line;
@@ -3927,8 +3927,8 @@ function requireParser$1() {
3927
3927
  if (colon === false) return;
3928
3928
  let founded = 0;
3929
3929
  let token;
3930
- for (let j = colon - 1; j >= 0; j--) {
3931
- token = tokens[j];
3930
+ for (let j2 = colon - 1; j2 >= 0; j2--) {
3931
+ token = tokens[j2];
3932
3932
  if (token[0] !== "space") {
3933
3933
  founded += 1;
3934
3934
  if (founded === 2) break;
@@ -4046,8 +4046,8 @@ function requireParser$1() {
4046
4046
  } else if (token[1].toLowerCase() === "important") {
4047
4047
  let cache = tokens.slice(0);
4048
4048
  let str = "";
4049
- for (let j = i2; j > 0; j--) {
4050
- let type = cache[j][0];
4049
+ for (let j2 = i2; j2 > 0; j2--) {
4050
+ let type = cache[j2][0];
4051
4051
  if (str.trim().startsWith("!") && type !== "space") {
4052
4052
  break;
4053
4053
  }
@@ -4635,8 +4635,8 @@ function requireLazyResult$1() {
4635
4635
  let pluginVer = plugin.postcssVersion;
4636
4636
  let runtimeVer = this.result.processor.version;
4637
4637
  let a2 = pluginVer.split(".");
4638
- let b = runtimeVer.split(".");
4639
- if (a2[0] !== b[0] || parseInt(a2[1]) > parseInt(b[1])) {
4638
+ let b2 = runtimeVer.split(".");
4639
+ if (a2[0] !== b2[0] || parseInt(a2[1]) > parseInt(b2[1])) {
4640
4640
  console.error(
4641
4641
  "Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below."
4642
4642
  );
@@ -5345,8 +5345,8 @@ function getAugmentedNamespace(n2) {
5345
5345
  if (n2.__esModule) return n2;
5346
5346
  var f2 = n2.default;
5347
5347
  if (typeof f2 == "function") {
5348
- var a2 = function a22() {
5349
- if (this instanceof a22) {
5348
+ var a2 = function a3() {
5349
+ if (this instanceof a3) {
5350
5350
  return Reflect.construct(f2, arguments, this.constructor);
5351
5351
  }
5352
5352
  return f2.apply(this, arguments);
@@ -5355,8 +5355,8 @@ function getAugmentedNamespace(n2) {
5355
5355
  } else a2 = {};
5356
5356
  Object.defineProperty(a2, "__esModule", { value: true });
5357
5357
  Object.keys(n2).forEach(function(k) {
5358
- var d = Object.getOwnPropertyDescriptor(n2, k);
5359
- Object.defineProperty(a2, k, d.get ? d : {
5358
+ var d2 = Object.getOwnPropertyDescriptor(n2, k);
5359
+ Object.defineProperty(a2, k, d2.get ? d2 : {
5360
5360
  enumerable: true,
5361
5361
  get: function() {
5362
5362
  return n2[k];
@@ -5732,8 +5732,8 @@ function requireStringifier() {
5732
5732
  if (root2.raws.indent) return root2.raws.indent;
5733
5733
  let value;
5734
5734
  root2.walk((i2) => {
5735
- let p = i2.parent;
5736
- if (p && p !== root2 && p.parent && p.parent === root2) {
5735
+ let p2 = i2.parent;
5736
+ if (p2 && p2 !== root2 && p2.parent && p2.parent === root2) {
5737
5737
  if (typeof i2.raws.before !== "undefined") {
5738
5738
  let parts = i2.raws.before.split("\n");
5739
5739
  value = parts[parts.length - 1];
@@ -5831,7 +5831,7 @@ function requireNode() {
5831
5831
  } else if (i2 === "source") {
5832
5832
  cloned[i2] = value;
5833
5833
  } else if (Array.isArray(value)) {
5834
- cloned[i2] = value.map((j) => cloneNode(j, cloned));
5834
+ cloned[i2] = value.map((j2) => cloneNode(j2, cloned));
5835
5835
  } else {
5836
5836
  if (type === "object" && value !== null) value = cloneNode(value);
5837
5837
  cloned[i2] = value;
@@ -7347,9 +7347,9 @@ function requireMapGenerator() {
7347
7347
  column += str.length;
7348
7348
  }
7349
7349
  if (node2 && type !== "start") {
7350
- let p = node2.parent || { raws: {} };
7350
+ let p2 = node2.parent || { raws: {} };
7351
7351
  let childless = node2.type === "decl" || node2.type === "atrule" && !node2.nodes;
7352
- if (!childless || node2 !== p.last || p.raws.semicolon) {
7352
+ if (!childless || node2 !== p2.last || p2.raws.semicolon) {
7353
7353
  if (node2.source && node2.source.end) {
7354
7354
  mapping.source = this.sourcePath(node2);
7355
7355
  mapping.original.line = node2.source.end.line;
@@ -7842,8 +7842,8 @@ function requireParser() {
7842
7842
  if (colon === false) return;
7843
7843
  let founded = 0;
7844
7844
  let token;
7845
- for (let j = colon - 1; j >= 0; j--) {
7846
- token = tokens[j];
7845
+ for (let j2 = colon - 1; j2 >= 0; j2--) {
7846
+ token = tokens[j2];
7847
7847
  if (token[0] !== "space") {
7848
7848
  founded += 1;
7849
7849
  if (founded === 2) break;
@@ -7961,8 +7961,8 @@ function requireParser() {
7961
7961
  } else if (token[1].toLowerCase() === "important") {
7962
7962
  let cache = tokens.slice(0);
7963
7963
  let str = "";
7964
- for (let j = i2; j > 0; j--) {
7965
- let type = cache[j][0];
7964
+ for (let j2 = i2; j2 > 0; j2--) {
7965
+ let type = cache[j2][0];
7966
7966
  if (str.trim().startsWith("!") && type !== "space") {
7967
7967
  break;
7968
7968
  }
@@ -8550,8 +8550,8 @@ function requireLazyResult() {
8550
8550
  let pluginVer = plugin.postcssVersion;
8551
8551
  let runtimeVer = this.result.processor.version;
8552
8552
  let a2 = pluginVer.split(".");
8553
- let b = runtimeVer.split(".");
8554
- if (a2[0] !== b[0] || parseInt(a2[1]) > parseInt(b[1])) {
8553
+ let b2 = runtimeVer.split(".");
8554
+ if (a2[0] !== b2[0] || parseInt(a2[1]) > parseInt(b2[1])) {
8555
8555
  console.error(
8556
8556
  "Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below."
8557
8557
  );
@@ -11501,6 +11501,7 @@ class IframeManager {
11501
11501
  __publicField(this, "recordCrossOriginIframes");
11502
11502
  __publicField(this, "messageHandler");
11503
11503
  __publicField(this, "nestedIframeListeners", /* @__PURE__ */ new Map());
11504
+ __publicField(this, "attachedIframes", /* @__PURE__ */ new Map());
11504
11505
  this.mutationCb = options.mutationCb;
11505
11506
  this.wrappedEmit = options.wrappedEmit;
11506
11507
  this.stylesheetManager = options.stylesheetManager;
@@ -11529,6 +11530,7 @@ class IframeManager {
11529
11530
  }
11530
11531
  attachIframe(iframeEl, childSn) {
11531
11532
  var _a2;
11533
+ this.attachedIframes.set(iframeEl, childSn);
11532
11534
  this.mutationCb({
11533
11535
  adds: [
11534
11536
  {
@@ -11584,6 +11586,7 @@ class IframeManager {
11584
11586
  const rootId = e2.data.node.id;
11585
11587
  this.crossOriginIframeRootIdMap.set(iframeEl, rootId);
11586
11588
  this.patchRootIdOnNode(e2.data.node, rootId);
11589
+ this.attachedIframes.set(iframeEl, e2.data.node);
11587
11590
  return {
11588
11591
  timestamp: e2.timestamp,
11589
11592
  type: EventType.IncrementalSnapshot,
@@ -11726,6 +11729,32 @@ class IframeManager {
11726
11729
  });
11727
11730
  }
11728
11731
  }
11732
+ reattachIframes() {
11733
+ this.attachedIframes.forEach((content, iframe) => {
11734
+ if (!iframe.isConnected) {
11735
+ this.attachedIframes.delete(iframe);
11736
+ return;
11737
+ }
11738
+ const parentId = this.mirror.getId(iframe);
11739
+ if (parentId === -1) {
11740
+ this.attachedIframes.delete(iframe);
11741
+ return;
11742
+ }
11743
+ this.mutationCb({
11744
+ adds: [
11745
+ {
11746
+ parentId,
11747
+ nextId: null,
11748
+ node: content
11749
+ }
11750
+ ],
11751
+ removes: [],
11752
+ texts: [],
11753
+ attributes: [],
11754
+ isAttachIframe: true
11755
+ });
11756
+ });
11757
+ }
11729
11758
  destroy() {
11730
11759
  if (this.recordCrossOriginIframes) {
11731
11760
  window.removeEventListener("message", this.messageHandler);
@@ -11736,6 +11765,7 @@ class IframeManager {
11736
11765
  this.nestedIframeListeners.clear();
11737
11766
  this.crossOriginIframeMirror.reset();
11738
11767
  this.crossOriginIframeStyleMirror.reset();
11768
+ this.attachedIframes.clear();
11739
11769
  }
11740
11770
  }
11741
11771
  class ShadowDomManager {
@@ -12818,6 +12848,9 @@ function record(options = {}) {
12818
12848
  isCheckout
12819
12849
  );
12820
12850
  mutationBuffers.forEach((buf) => buf.unlock());
12851
+ if (recordCrossOriginIframes) {
12852
+ iframeManager.reattachIframes();
12853
+ }
12821
12854
  if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
12822
12855
  stylesheetManager.adoptStyleSheets(
12823
12856
  document.adoptedStyleSheets,