@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.
@@ -158,25 +158,71 @@ const index$1 = {
158
158
  querySelectorAll: querySelectorAll$1,
159
159
  mutationObserver: mutationObserverCtor$1
160
160
  };
161
- function getXPath(n2) {
162
- if (n2.id) {
163
- return `//*[@id="${n2.id}"]`;
161
+ function getXPath(node2) {
162
+ if (node2.nodeType === Node.DOCUMENT_NODE) {
163
+ return "/";
164
164
  }
165
- if (n2 === document.body) {
166
- return "/html/body";
165
+ if (node2.nodeType === Node.DOCUMENT_TYPE_NODE) {
166
+ return "/html/doctype";
167
167
  }
168
- if (!n2.tagName) {
169
- return "";
168
+ if (node2.nodeType === Node.ELEMENT_NODE) {
169
+ const element = node2;
170
+ if (element.id) {
171
+ return `//*[@id="${element.id}"]`;
172
+ }
173
+ if (element.tagName && element.tagName.toLowerCase() === "html") {
174
+ return "/html";
175
+ }
176
+ if (element === document.head) {
177
+ return "/html/head";
178
+ }
179
+ if (element === document.body) {
180
+ return "/html/body";
181
+ }
182
+ const parentNode2 = element.parentNode;
183
+ if (!parentNode2 || !(parentNode2 instanceof Element)) {
184
+ return "";
185
+ }
186
+ const siblings = Array.from(parentNode2.children).filter(
187
+ (sibling) => sibling.tagName === element.tagName
188
+ );
189
+ const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
190
+ return `${getXPath(parentNode2)}/${element.tagName.toLowerCase()}${index2}`;
170
191
  }
171
- const parentNode2 = index$1.parentNode(n2);
172
- if (!parentNode2 || !(parentNode2 instanceof Element)) {
173
- return "";
192
+ if (node2.nodeType === Node.TEXT_NODE) {
193
+ const parent = node2.parentNode;
194
+ if (!parent) {
195
+ return "";
196
+ }
197
+ const textSiblings = Array.from(parent.childNodes).filter(
198
+ (sibling) => sibling.nodeType === Node.TEXT_NODE
199
+ );
200
+ const index2 = textSiblings.length > 1 ? `[${textSiblings.indexOf(node2) + 1}]` : "";
201
+ return `${getXPath(parent)}/text()${index2}`;
174
202
  }
175
- const siblings = Array.from(parentNode2.children).filter(
176
- (node2) => node2.tagName && node2.tagName === n2.tagName
177
- );
178
- const index$1$1 = siblings.length > 1 ? `[${siblings.indexOf(n2) + 1}]` : "";
179
- return getXPath(parentNode2) + "/" + n2.tagName.toLowerCase() + index$1$1;
203
+ if (node2.nodeType === Node.CDATA_SECTION_NODE) {
204
+ const parent = node2.parentNode;
205
+ if (!parent) {
206
+ return "";
207
+ }
208
+ const cdataSiblings = Array.from(parent.childNodes).filter(
209
+ (sibling) => sibling.nodeType === Node.CDATA_SECTION_NODE
210
+ );
211
+ const index2 = cdataSiblings.length > 1 ? `[${cdataSiblings.indexOf(node2) + 1}]` : "";
212
+ return `${getXPath(parent)}/text()${index2}`;
213
+ }
214
+ if (node2.nodeType === Node.COMMENT_NODE) {
215
+ const parent = node2.parentNode;
216
+ if (!parent) {
217
+ return "";
218
+ }
219
+ const commentSiblings = Array.from(parent.childNodes).filter(
220
+ (sibling) => sibling.nodeType === Node.COMMENT_NODE
221
+ );
222
+ const index2 = commentSiblings.length > 1 ? `[${commentSiblings.indexOf(node2) + 1}]` : "";
223
+ return `${getXPath(parent)}/comment()${index2}`;
224
+ }
225
+ return "";
180
226
  }
181
227
  function isElement(n2) {
182
228
  return n2.nodeType === n2.ELEMENT_NODE;
@@ -1899,7 +1945,7 @@ function cloneNode$1(obj, parent) {
1899
1945
  }
1900
1946
  return cloned;
1901
1947
  }
1902
- let Node$4$1 = class Node2 {
1948
+ let Node$5$1 = class Node2 {
1903
1949
  constructor(defaults = {}) {
1904
1950
  this.raws = {};
1905
1951
  this[isClean$2$1] = false;
@@ -2191,10 +2237,10 @@ let Node$4$1 = class Node2 {
2191
2237
  return this;
2192
2238
  }
2193
2239
  };
2194
- var node$1 = Node$4$1;
2195
- Node$4$1.default = Node$4$1;
2196
- let Node$3$1 = node$1;
2197
- let Declaration$4$1 = class Declaration extends Node$3$1 {
2240
+ var node$1 = Node$5$1;
2241
+ Node$5$1.default = Node$5$1;
2242
+ let Node$4$1 = node$1;
2243
+ let Declaration$4$1 = class Declaration extends Node$4$1 {
2198
2244
  constructor(defaults) {
2199
2245
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2200
2246
  defaults = { ...defaults, value: String(defaults.value) };
@@ -2850,8 +2896,8 @@ let MapGenerator$2$1 = class MapGenerator {
2850
2896
  }
2851
2897
  };
2852
2898
  var mapGenerator$1 = MapGenerator$2$1;
2853
- let Node$2$1 = node$1;
2854
- let Comment$4$1 = class Comment extends Node$2$1 {
2899
+ let Node$3$1 = node$1;
2900
+ let Comment$4$1 = class Comment extends Node$3$1 {
2855
2901
  constructor(defaults) {
2856
2902
  super(defaults);
2857
2903
  this.type = "comment";
@@ -2862,7 +2908,7 @@ Comment$4$1.default = Comment$4$1;
2862
2908
  let { isClean: isClean$1$1, my: my$1$1 } = symbols$1;
2863
2909
  let Declaration$3$1 = declaration$1;
2864
2910
  let Comment$3$1 = comment$1;
2865
- let Node$1$1 = node$1;
2911
+ let Node$2$1 = node$1;
2866
2912
  let parse$4$1, Rule$4$1, AtRule$4$1, Root$6$1;
2867
2913
  function cleanSource$1(nodes) {
2868
2914
  return nodes.map((i2) => {
@@ -2879,7 +2925,7 @@ function markDirtyUp$1(node2) {
2879
2925
  }
2880
2926
  }
2881
2927
  }
2882
- let Container$7$1 = class Container extends Node$1$1 {
2928
+ let Container$7$1 = class Container extends Node$2$1 {
2883
2929
  append(...children) {
2884
2930
  for (let child of children) {
2885
2931
  let nodes = this.normalize(child, this.last);
@@ -4906,7 +4952,7 @@ let parse$5 = parse_1$1;
4906
4952
  let list$3 = list_1$1;
4907
4953
  let Rule2$1 = rule$1;
4908
4954
  let Root2$1 = root$1;
4909
- let Node2$1 = node$1;
4955
+ let Node$1$1 = node$1;
4910
4956
  function postcss$3(...plugins) {
4911
4957
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
4912
4958
  plugins = plugins[0];
@@ -4966,7 +5012,7 @@ postcss$3.Result = Result2$1;
4966
5012
  postcss$3.Input = Input2$1;
4967
5013
  postcss$3.Rule = Rule2$1;
4968
5014
  postcss$3.Root = Root2$1;
4969
- postcss$3.Node = Node2$1;
5015
+ postcss$3.Node = Node$1$1;
4970
5016
  LazyResult2$1.registerPostcss(postcss$3);
4971
5017
  var postcss_1$1 = postcss$3;
4972
5018
  postcss$3.default = postcss$3;
@@ -5451,7 +5497,7 @@ function cloneNode(obj, parent) {
5451
5497
  }
5452
5498
  return cloned;
5453
5499
  }
5454
- let Node$4 = class Node3 {
5500
+ let Node$5 = class Node22 {
5455
5501
  constructor(defaults = {}) {
5456
5502
  this.raws = {};
5457
5503
  this[isClean$2] = false;
@@ -5743,10 +5789,10 @@ let Node$4 = class Node3 {
5743
5789
  return this;
5744
5790
  }
5745
5791
  };
5746
- var node = Node$4;
5747
- Node$4.default = Node$4;
5748
- let Node$3 = node;
5749
- let Declaration$4 = class Declaration2 extends Node$3 {
5792
+ var node = Node$5;
5793
+ Node$5.default = Node$5;
5794
+ let Node$4 = node;
5795
+ let Declaration$4 = class Declaration2 extends Node$4 {
5750
5796
  constructor(defaults) {
5751
5797
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
5752
5798
  defaults = { ...defaults, value: String(defaults.value) };
@@ -6402,8 +6448,8 @@ let MapGenerator$2 = class MapGenerator2 {
6402
6448
  }
6403
6449
  };
6404
6450
  var mapGenerator = MapGenerator$2;
6405
- let Node$2 = node;
6406
- let Comment$4 = class Comment2 extends Node$2 {
6451
+ let Node$3 = node;
6452
+ let Comment$4 = class Comment2 extends Node$3 {
6407
6453
  constructor(defaults) {
6408
6454
  super(defaults);
6409
6455
  this.type = "comment";
@@ -6414,7 +6460,7 @@ Comment$4.default = Comment$4;
6414
6460
  let { isClean: isClean$1, my: my$1 } = symbols;
6415
6461
  let Declaration$3 = declaration;
6416
6462
  let Comment$3 = comment;
6417
- let Node$1 = node;
6463
+ let Node$2 = node;
6418
6464
  let parse$4, Rule$4, AtRule$4, Root$6;
6419
6465
  function cleanSource(nodes) {
6420
6466
  return nodes.map((i2) => {
@@ -6431,7 +6477,7 @@ function markDirtyUp(node2) {
6431
6477
  }
6432
6478
  }
6433
6479
  }
6434
- let Container$7 = class Container2 extends Node$1 {
6480
+ let Container$7 = class Container2 extends Node$2 {
6435
6481
  append(...children) {
6436
6482
  for (let child of children) {
6437
6483
  let nodes = this.normalize(child, this.last);
@@ -8458,7 +8504,7 @@ let parse = parse_1;
8458
8504
  let list = list_1;
8459
8505
  let Rule22 = rule;
8460
8506
  let Root22 = root;
8461
- let Node22 = node;
8507
+ let Node$1 = node;
8462
8508
  function postcss(...plugins) {
8463
8509
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
8464
8510
  plugins = plugins[0];
@@ -8518,7 +8564,7 @@ postcss.Result = Result22;
8518
8564
  postcss.Input = Input22;
8519
8565
  postcss.Rule = Rule22;
8520
8566
  postcss.Root = Root22;
8521
- postcss.Node = Node22;
8567
+ postcss.Node = Node$1;
8522
8568
  LazyResult22.registerPostcss(postcss);
8523
8569
  var postcss_1 = postcss;
8524
8570
  postcss.default = postcss;