@appsurify-testmap/rrweb-record 2.0.0-alpha.21 → 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,23 +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
- const parentNode2 = index$1.parentNode(n2);
169
- if (!parentNode2 || !(parentNode2 instanceof Element)) {
170
- 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}`;
171
191
  }
172
- const siblings = Array.from(parentNode2.children).filter(
173
- (node2) => node2.tagName === n2.tagName
174
- );
175
- const index$1$1 = siblings.length > 1 ? `[${siblings.indexOf(n2) + 1}]` : "";
176
- const path = getXPath(parentNode2) + "/" + n2.tagName.toLowerCase() + index$1$1;
177
- return path;
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}`;
202
+ }
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 "";
178
226
  }
179
227
  function isElement(n2) {
180
228
  return n2.nodeType === n2.ELEMENT_NODE;
@@ -1897,7 +1945,7 @@ function cloneNode$1(obj, parent) {
1897
1945
  }
1898
1946
  return cloned;
1899
1947
  }
1900
- let Node$4$1 = class Node2 {
1948
+ let Node$5$1 = class Node2 {
1901
1949
  constructor(defaults = {}) {
1902
1950
  this.raws = {};
1903
1951
  this[isClean$2$1] = false;
@@ -2189,10 +2237,10 @@ let Node$4$1 = class Node2 {
2189
2237
  return this;
2190
2238
  }
2191
2239
  };
2192
- var node$1 = Node$4$1;
2193
- Node$4$1.default = Node$4$1;
2194
- let Node$3$1 = node$1;
2195
- 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 {
2196
2244
  constructor(defaults) {
2197
2245
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2198
2246
  defaults = { ...defaults, value: String(defaults.value) };
@@ -2848,8 +2896,8 @@ let MapGenerator$2$1 = class MapGenerator {
2848
2896
  }
2849
2897
  };
2850
2898
  var mapGenerator$1 = MapGenerator$2$1;
2851
- let Node$2$1 = node$1;
2852
- 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 {
2853
2901
  constructor(defaults) {
2854
2902
  super(defaults);
2855
2903
  this.type = "comment";
@@ -2860,7 +2908,7 @@ Comment$4$1.default = Comment$4$1;
2860
2908
  let { isClean: isClean$1$1, my: my$1$1 } = symbols$1;
2861
2909
  let Declaration$3$1 = declaration$1;
2862
2910
  let Comment$3$1 = comment$1;
2863
- let Node$1$1 = node$1;
2911
+ let Node$2$1 = node$1;
2864
2912
  let parse$4$1, Rule$4$1, AtRule$4$1, Root$6$1;
2865
2913
  function cleanSource$1(nodes) {
2866
2914
  return nodes.map((i2) => {
@@ -2877,7 +2925,7 @@ function markDirtyUp$1(node2) {
2877
2925
  }
2878
2926
  }
2879
2927
  }
2880
- let Container$7$1 = class Container extends Node$1$1 {
2928
+ let Container$7$1 = class Container extends Node$2$1 {
2881
2929
  append(...children) {
2882
2930
  for (let child of children) {
2883
2931
  let nodes = this.normalize(child, this.last);
@@ -4904,7 +4952,7 @@ let parse$5 = parse_1$1;
4904
4952
  let list$3 = list_1$1;
4905
4953
  let Rule2$1 = rule$1;
4906
4954
  let Root2$1 = root$1;
4907
- let Node2$1 = node$1;
4955
+ let Node$1$1 = node$1;
4908
4956
  function postcss$3(...plugins) {
4909
4957
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
4910
4958
  plugins = plugins[0];
@@ -4964,7 +5012,7 @@ postcss$3.Result = Result2$1;
4964
5012
  postcss$3.Input = Input2$1;
4965
5013
  postcss$3.Rule = Rule2$1;
4966
5014
  postcss$3.Root = Root2$1;
4967
- postcss$3.Node = Node2$1;
5015
+ postcss$3.Node = Node$1$1;
4968
5016
  LazyResult2$1.registerPostcss(postcss$3);
4969
5017
  var postcss_1$1 = postcss$3;
4970
5018
  postcss$3.default = postcss$3;
@@ -5449,7 +5497,7 @@ function cloneNode(obj, parent) {
5449
5497
  }
5450
5498
  return cloned;
5451
5499
  }
5452
- let Node$4 = class Node3 {
5500
+ let Node$5 = class Node22 {
5453
5501
  constructor(defaults = {}) {
5454
5502
  this.raws = {};
5455
5503
  this[isClean$2] = false;
@@ -5741,10 +5789,10 @@ let Node$4 = class Node3 {
5741
5789
  return this;
5742
5790
  }
5743
5791
  };
5744
- var node = Node$4;
5745
- Node$4.default = Node$4;
5746
- let Node$3 = node;
5747
- 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 {
5748
5796
  constructor(defaults) {
5749
5797
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
5750
5798
  defaults = { ...defaults, value: String(defaults.value) };
@@ -6400,8 +6448,8 @@ let MapGenerator$2 = class MapGenerator2 {
6400
6448
  }
6401
6449
  };
6402
6450
  var mapGenerator = MapGenerator$2;
6403
- let Node$2 = node;
6404
- let Comment$4 = class Comment2 extends Node$2 {
6451
+ let Node$3 = node;
6452
+ let Comment$4 = class Comment2 extends Node$3 {
6405
6453
  constructor(defaults) {
6406
6454
  super(defaults);
6407
6455
  this.type = "comment";
@@ -6412,7 +6460,7 @@ Comment$4.default = Comment$4;
6412
6460
  let { isClean: isClean$1, my: my$1 } = symbols;
6413
6461
  let Declaration$3 = declaration;
6414
6462
  let Comment$3 = comment;
6415
- let Node$1 = node;
6463
+ let Node$2 = node;
6416
6464
  let parse$4, Rule$4, AtRule$4, Root$6;
6417
6465
  function cleanSource(nodes) {
6418
6466
  return nodes.map((i2) => {
@@ -6429,7 +6477,7 @@ function markDirtyUp(node2) {
6429
6477
  }
6430
6478
  }
6431
6479
  }
6432
- let Container$7 = class Container2 extends Node$1 {
6480
+ let Container$7 = class Container2 extends Node$2 {
6433
6481
  append(...children) {
6434
6482
  for (let child of children) {
6435
6483
  let nodes = this.normalize(child, this.last);
@@ -8456,7 +8504,7 @@ let parse = parse_1;
8456
8504
  let list = list_1;
8457
8505
  let Rule22 = rule;
8458
8506
  let Root22 = root;
8459
- let Node22 = node;
8507
+ let Node$1 = node;
8460
8508
  function postcss(...plugins) {
8461
8509
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
8462
8510
  plugins = plugins[0];
@@ -8516,7 +8564,7 @@ postcss.Result = Result22;
8516
8564
  postcss.Input = Input22;
8517
8565
  postcss.Rule = Rule22;
8518
8566
  postcss.Root = Root22;
8519
- postcss.Node = Node22;
8567
+ postcss.Node = Node$1;
8520
8568
  LazyResult22.registerPostcss(postcss);
8521
8569
  var postcss_1 = postcss;
8522
8570
  postcss.default = postcss;