@appsurify-testmap/rrweb-record 2.0.0-alpha.22 → 2.0.0-alpha.23

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.
@@ -202,25 +202,71 @@ const index$1 = {
202
202
  querySelectorAll: querySelectorAll$1,
203
203
  mutationObserver: mutationObserverCtor$1
204
204
  };
205
- function getXPath(n2) {
206
- if (n2.id) {
207
- return `//*[@id="${n2.id}"]`;
205
+ function getXPath(node2) {
206
+ if (node2.nodeType === Node.DOCUMENT_NODE) {
207
+ return "/";
208
208
  }
209
- if (n2 === document.body) {
210
- return "/html/body";
209
+ if (node2.nodeType === Node.DOCUMENT_TYPE_NODE) {
210
+ return "/html/doctype";
211
211
  }
212
- if (!n2.tagName) {
213
- return "";
212
+ if (node2.nodeType === Node.ELEMENT_NODE) {
213
+ const element = node2;
214
+ if (element.id) {
215
+ return `//*[@id="${element.id}"]`;
216
+ }
217
+ if (element.tagName && element.tagName.toLowerCase() === "html") {
218
+ return "/html";
219
+ }
220
+ if (element === document.head) {
221
+ return "/html/head";
222
+ }
223
+ if (element === document.body) {
224
+ return "/html/body";
225
+ }
226
+ const parentNode2 = element.parentNode;
227
+ if (!parentNode2 || !(parentNode2 instanceof Element)) {
228
+ return "";
229
+ }
230
+ const siblings = Array.from(parentNode2.children).filter(
231
+ (sibling) => sibling.tagName === element.tagName
232
+ );
233
+ const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
234
+ return `${getXPath(parentNode2)}/${element.tagName.toLowerCase()}${index2}`;
214
235
  }
215
- const parentNode2 = index$1.parentNode(n2);
216
- if (!parentNode2 || !(parentNode2 instanceof Element)) {
217
- return "";
236
+ if (node2.nodeType === Node.TEXT_NODE) {
237
+ const parent = node2.parentNode;
238
+ if (!parent) {
239
+ return "";
240
+ }
241
+ const textSiblings = Array.from(parent.childNodes).filter(
242
+ (sibling) => sibling.nodeType === Node.TEXT_NODE
243
+ );
244
+ const index2 = textSiblings.length > 1 ? `[${textSiblings.indexOf(node2) + 1}]` : "";
245
+ return `${getXPath(parent)}/text()${index2}`;
218
246
  }
219
- const siblings = Array.from(parentNode2.children).filter(
220
- (node2) => node2.tagName && node2.tagName === n2.tagName
221
- );
222
- const index$1$1 = siblings.length > 1 ? `[${siblings.indexOf(n2) + 1}]` : "";
223
- return getXPath(parentNode2) + "/" + n2.tagName.toLowerCase() + index$1$1;
247
+ if (node2.nodeType === Node.CDATA_SECTION_NODE) {
248
+ const parent = node2.parentNode;
249
+ if (!parent) {
250
+ return "";
251
+ }
252
+ const cdataSiblings = Array.from(parent.childNodes).filter(
253
+ (sibling) => sibling.nodeType === Node.CDATA_SECTION_NODE
254
+ );
255
+ const index2 = cdataSiblings.length > 1 ? `[${cdataSiblings.indexOf(node2) + 1}]` : "";
256
+ return `${getXPath(parent)}/text()${index2}`;
257
+ }
258
+ if (node2.nodeType === Node.COMMENT_NODE) {
259
+ const parent = node2.parentNode;
260
+ if (!parent) {
261
+ return "";
262
+ }
263
+ const commentSiblings = Array.from(parent.childNodes).filter(
264
+ (sibling) => sibling.nodeType === Node.COMMENT_NODE
265
+ );
266
+ const index2 = commentSiblings.length > 1 ? `[${commentSiblings.indexOf(node2) + 1}]` : "";
267
+ return `${getXPath(parent)}/comment()${index2}`;
268
+ }
269
+ return "";
224
270
  }
225
271
  function isElement(n2) {
226
272
  return n2.nodeType === n2.ELEMENT_NODE;
@@ -1944,7 +1990,7 @@ function cloneNode$1(obj, parent) {
1944
1990
  }
1945
1991
  return cloned;
1946
1992
  }
1947
- let Node$4$1 = class Node2 {
1993
+ let Node$5$1 = class Node2 {
1948
1994
  constructor(defaults = {}) {
1949
1995
  this.raws = {};
1950
1996
  this[isClean$2$1] = false;
@@ -2236,10 +2282,10 @@ let Node$4$1 = class Node2 {
2236
2282
  return this;
2237
2283
  }
2238
2284
  };
2239
- var node$1 = Node$4$1;
2240
- Node$4$1.default = Node$4$1;
2241
- let Node$3$1 = node$1;
2242
- let Declaration$4$1 = class Declaration extends Node$3$1 {
2285
+ var node$1 = Node$5$1;
2286
+ Node$5$1.default = Node$5$1;
2287
+ let Node$4$1 = node$1;
2288
+ let Declaration$4$1 = class Declaration extends Node$4$1 {
2243
2289
  constructor(defaults) {
2244
2290
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2245
2291
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -2895,8 +2941,8 @@ let MapGenerator$2$1 = class MapGenerator {
2895
2941
  }
2896
2942
  };
2897
2943
  var mapGenerator$1 = MapGenerator$2$1;
2898
- let Node$2$1 = node$1;
2899
- let Comment$4$1 = class Comment extends Node$2$1 {
2944
+ let Node$3$1 = node$1;
2945
+ let Comment$4$1 = class Comment extends Node$3$1 {
2900
2946
  constructor(defaults) {
2901
2947
  super(defaults);
2902
2948
  this.type = "comment";
@@ -2907,7 +2953,7 @@ Comment$4$1.default = Comment$4$1;
2907
2953
  let { isClean: isClean$1$1, my: my$1$1 } = symbols$1;
2908
2954
  let Declaration$3$1 = declaration$1;
2909
2955
  let Comment$3$1 = comment$1;
2910
- let Node$1$1 = node$1;
2956
+ let Node$2$1 = node$1;
2911
2957
  let parse$4$1;
2912
2958
  let Rule$4$1;
2913
2959
  let AtRule$4$1;
@@ -2927,7 +2973,7 @@ function markDirtyUp$1(node2) {
2927
2973
  }
2928
2974
  }
2929
2975
  }
2930
- let Container$7$1 = class Container extends Node$1$1 {
2976
+ let Container$7$1 = class Container extends Node$2$1 {
2931
2977
  append(...children) {
2932
2978
  for (let child of children) {
2933
2979
  let nodes = this.normalize(child, this.last);
@@ -4955,7 +5001,7 @@ let parse$5 = parse_1$1;
4955
5001
  let list$3 = list_1$1;
4956
5002
  let Rule2$1 = rule$1;
4957
5003
  let Root2$1 = root$1;
4958
- let Node2$1 = node$1;
5004
+ let Node$1$1 = node$1;
4959
5005
  function postcss$3(...plugins) {
4960
5006
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
4961
5007
  plugins = plugins[0];
@@ -5015,7 +5061,7 @@ postcss$3.Result = Result2$1;
5015
5061
  postcss$3.Input = Input2$1;
5016
5062
  postcss$3.Rule = Rule2$1;
5017
5063
  postcss$3.Root = Root2$1;
5018
- postcss$3.Node = Node2$1;
5064
+ postcss$3.Node = Node$1$1;
5019
5065
  LazyResult2$1.registerPostcss(postcss$3);
5020
5066
  var postcss_1$1 = postcss$3;
5021
5067
  postcss$3.default = postcss$3;
@@ -5500,7 +5546,7 @@ function cloneNode(obj, parent) {
5500
5546
  }
5501
5547
  return cloned;
5502
5548
  }
5503
- let Node$4 = class Node3 {
5549
+ let Node$5 = class Node22 {
5504
5550
  constructor(defaults = {}) {
5505
5551
  this.raws = {};
5506
5552
  this[isClean$2] = false;
@@ -5792,10 +5838,10 @@ let Node$4 = class Node3 {
5792
5838
  return this;
5793
5839
  }
5794
5840
  };
5795
- var node = Node$4;
5796
- Node$4.default = Node$4;
5797
- let Node$3 = node;
5798
- let Declaration$4 = class Declaration2 extends Node$3 {
5841
+ var node = Node$5;
5842
+ Node$5.default = Node$5;
5843
+ let Node$4 = node;
5844
+ let Declaration$4 = class Declaration2 extends Node$4 {
5799
5845
  constructor(defaults) {
5800
5846
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
5801
5847
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -6451,8 +6497,8 @@ let MapGenerator$2 = class MapGenerator2 {
6451
6497
  }
6452
6498
  };
6453
6499
  var mapGenerator = MapGenerator$2;
6454
- let Node$2 = node;
6455
- let Comment$4 = class Comment2 extends Node$2 {
6500
+ let Node$3 = node;
6501
+ let Comment$4 = class Comment2 extends Node$3 {
6456
6502
  constructor(defaults) {
6457
6503
  super(defaults);
6458
6504
  this.type = "comment";
@@ -6463,7 +6509,7 @@ Comment$4.default = Comment$4;
6463
6509
  let { isClean: isClean$1, my: my$1 } = symbols;
6464
6510
  let Declaration$3 = declaration;
6465
6511
  let Comment$3 = comment;
6466
- let Node$1 = node;
6512
+ let Node$2 = node;
6467
6513
  let parse$4;
6468
6514
  let Rule$4;
6469
6515
  let AtRule$4;
@@ -6483,7 +6529,7 @@ function markDirtyUp(node2) {
6483
6529
  }
6484
6530
  }
6485
6531
  }
6486
- let Container$7 = class Container2 extends Node$1 {
6532
+ let Container$7 = class Container2 extends Node$2 {
6487
6533
  append(...children) {
6488
6534
  for (let child of children) {
6489
6535
  let nodes = this.normalize(child, this.last);
@@ -8511,7 +8557,7 @@ let parse = parse_1;
8511
8557
  let list = list_1;
8512
8558
  let Rule22 = rule;
8513
8559
  let Root22 = root;
8514
- let Node22 = node;
8560
+ let Node$1 = node;
8515
8561
  function postcss(...plugins) {
8516
8562
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
8517
8563
  plugins = plugins[0];
@@ -8571,7 +8617,7 @@ postcss.Result = Result22;
8571
8617
  postcss.Input = Input22;
8572
8618
  postcss.Rule = Rule22;
8573
8619
  postcss.Root = Root22;
8574
- postcss.Node = Node22;
8620
+ postcss.Node = Node$1;
8575
8621
  LazyResult22.registerPostcss(postcss);
8576
8622
  var postcss_1 = postcss;
8577
8623
  postcss.default = postcss;