@appsurify-testmap/rrweb 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.
@@ -202,23 +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
- const parentNode2 = index$1.parentNode(n2);
213
- if (!parentNode2 || !(parentNode2 instanceof Element)) {
214
- 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}`;
215
235
  }
216
- const siblings = Array.from(parentNode2.children).filter(
217
- (node2) => node2.tagName === n2.tagName
218
- );
219
- const index$1$1 = siblings.length > 1 ? `[${siblings.indexOf(n2) + 1}]` : "";
220
- const path = getXPath(parentNode2) + "/" + n2.tagName.toLowerCase() + index$1$1;
221
- return path;
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}`;
246
+ }
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 "";
222
270
  }
223
271
  function isElement(n2) {
224
272
  return n2.nodeType === n2.ELEMENT_NODE;
@@ -1988,7 +2036,7 @@ function cloneNode$1(obj, parent) {
1988
2036
  }
1989
2037
  return cloned;
1990
2038
  }
1991
- let Node$4$1 = class Node2 {
2039
+ let Node$5$1 = class Node2 {
1992
2040
  constructor(defaults = {}) {
1993
2041
  this.raws = {};
1994
2042
  this[isClean$2$1] = false;
@@ -2280,10 +2328,10 @@ let Node$4$1 = class Node2 {
2280
2328
  return this;
2281
2329
  }
2282
2330
  };
2283
- var node$1 = Node$4$1;
2284
- Node$4$1.default = Node$4$1;
2285
- let Node$3$1 = node$1;
2286
- let Declaration$4$1 = class Declaration extends Node$3$1 {
2331
+ var node$1 = Node$5$1;
2332
+ Node$5$1.default = Node$5$1;
2333
+ let Node$4$1 = node$1;
2334
+ let Declaration$4$1 = class Declaration extends Node$4$1 {
2287
2335
  constructor(defaults) {
2288
2336
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2289
2337
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -2939,8 +2987,8 @@ let MapGenerator$2$1 = class MapGenerator {
2939
2987
  }
2940
2988
  };
2941
2989
  var mapGenerator$1 = MapGenerator$2$1;
2942
- let Node$2$1 = node$1;
2943
- let Comment$4$1 = class Comment extends Node$2$1 {
2990
+ let Node$3$1 = node$1;
2991
+ let Comment$4$1 = class Comment extends Node$3$1 {
2944
2992
  constructor(defaults) {
2945
2993
  super(defaults);
2946
2994
  this.type = "comment";
@@ -2951,7 +2999,7 @@ Comment$4$1.default = Comment$4$1;
2951
2999
  let { isClean: isClean$1$1, my: my$1$1 } = symbols$1;
2952
3000
  let Declaration$3$1 = declaration$1;
2953
3001
  let Comment$3$1 = comment$1;
2954
- let Node$1$1 = node$1;
3002
+ let Node$2$1 = node$1;
2955
3003
  let parse$4$1;
2956
3004
  let Rule$4$1;
2957
3005
  let AtRule$4$1;
@@ -2971,7 +3019,7 @@ function markDirtyUp$1(node2) {
2971
3019
  }
2972
3020
  }
2973
3021
  }
2974
- let Container$7$1 = class Container extends Node$1$1 {
3022
+ let Container$7$1 = class Container extends Node$2$1 {
2975
3023
  append(...children) {
2976
3024
  for (let child of children) {
2977
3025
  let nodes = this.normalize(child, this.last);
@@ -4999,7 +5047,7 @@ let parse$5 = parse_1$1;
4999
5047
  let list$3 = list_1$1;
5000
5048
  let Rule2$1 = rule$1;
5001
5049
  let Root2$1 = root$1;
5002
- let Node2$1 = node$1;
5050
+ let Node$1$1 = node$1;
5003
5051
  function postcss$3(...plugins) {
5004
5052
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
5005
5053
  plugins = plugins[0];
@@ -5059,7 +5107,7 @@ postcss$3.Result = Result2$1;
5059
5107
  postcss$3.Input = Input2$1;
5060
5108
  postcss$3.Rule = Rule2$1;
5061
5109
  postcss$3.Root = Root2$1;
5062
- postcss$3.Node = Node2$1;
5110
+ postcss$3.Node = Node$1$1;
5063
5111
  LazyResult2$1.registerPostcss(postcss$3);
5064
5112
  var postcss_1$1 = postcss$3;
5065
5113
  postcss$3.default = postcss$3;
@@ -5989,7 +6037,7 @@ function cloneNode(obj, parent) {
5989
6037
  }
5990
6038
  return cloned;
5991
6039
  }
5992
- let Node$4 = class Node3 {
6040
+ let Node$5 = class Node22 {
5993
6041
  constructor(defaults = {}) {
5994
6042
  this.raws = {};
5995
6043
  this[isClean$2] = false;
@@ -6281,10 +6329,10 @@ let Node$4 = class Node3 {
6281
6329
  return this;
6282
6330
  }
6283
6331
  };
6284
- var node = Node$4;
6285
- Node$4.default = Node$4;
6286
- let Node$3 = node;
6287
- let Declaration$4 = class Declaration2 extends Node$3 {
6332
+ var node = Node$5;
6333
+ Node$5.default = Node$5;
6334
+ let Node$4 = node;
6335
+ let Declaration$4 = class Declaration2 extends Node$4 {
6288
6336
  constructor(defaults) {
6289
6337
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
6290
6338
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -6940,8 +6988,8 @@ let MapGenerator$2 = class MapGenerator2 {
6940
6988
  }
6941
6989
  };
6942
6990
  var mapGenerator = MapGenerator$2;
6943
- let Node$2 = node;
6944
- let Comment$4 = class Comment2 extends Node$2 {
6991
+ let Node$3 = node;
6992
+ let Comment$4 = class Comment2 extends Node$3 {
6945
6993
  constructor(defaults) {
6946
6994
  super(defaults);
6947
6995
  this.type = "comment";
@@ -6952,7 +7000,7 @@ Comment$4.default = Comment$4;
6952
7000
  let { isClean: isClean$1, my: my$1 } = symbols;
6953
7001
  let Declaration$3 = declaration;
6954
7002
  let Comment$3 = comment;
6955
- let Node$1 = node;
7003
+ let Node$2 = node;
6956
7004
  let parse$4;
6957
7005
  let Rule$4;
6958
7006
  let AtRule$4;
@@ -6972,7 +7020,7 @@ function markDirtyUp(node2) {
6972
7020
  }
6973
7021
  }
6974
7022
  }
6975
- let Container$7 = class Container2 extends Node$1 {
7023
+ let Container$7 = class Container2 extends Node$2 {
6976
7024
  append(...children) {
6977
7025
  for (let child of children) {
6978
7026
  let nodes = this.normalize(child, this.last);
@@ -9000,7 +9048,7 @@ let parse = parse_1;
9000
9048
  let list = list_1;
9001
9049
  let Rule22 = rule;
9002
9050
  let Root22 = root;
9003
- let Node22 = node;
9051
+ let Node$1 = node;
9004
9052
  function postcss(...plugins) {
9005
9053
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
9006
9054
  plugins = plugins[0];
@@ -9060,7 +9108,7 @@ postcss.Result = Result22;
9060
9108
  postcss.Input = Input22;
9061
9109
  postcss.Rule = Rule22;
9062
9110
  postcss.Root = Root22;
9063
- postcss.Node = Node22;
9111
+ postcss.Node = Node$1;
9064
9112
  LazyResult22.registerPostcss(postcss);
9065
9113
  var postcss_1 = postcss;
9066
9114
  postcss.default = postcss;