@appsurify-testmap/rrweb-all 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;
@@ -1990,7 +2036,7 @@ function cloneNode$1(obj, parent) {
1990
2036
  }
1991
2037
  return cloned;
1992
2038
  }
1993
- let Node$4$1 = class Node2 {
2039
+ let Node$5$1 = class Node2 {
1994
2040
  constructor(defaults = {}) {
1995
2041
  this.raws = {};
1996
2042
  this[isClean$2$1] = false;
@@ -2282,10 +2328,10 @@ let Node$4$1 = class Node2 {
2282
2328
  return this;
2283
2329
  }
2284
2330
  };
2285
- var node$1 = Node$4$1;
2286
- Node$4$1.default = Node$4$1;
2287
- let Node$3$1 = node$1;
2288
- 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 {
2289
2335
  constructor(defaults) {
2290
2336
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2291
2337
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -2941,8 +2987,8 @@ let MapGenerator$2$1 = class MapGenerator {
2941
2987
  }
2942
2988
  };
2943
2989
  var mapGenerator$1 = MapGenerator$2$1;
2944
- let Node$2$1 = node$1;
2945
- 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 {
2946
2992
  constructor(defaults) {
2947
2993
  super(defaults);
2948
2994
  this.type = "comment";
@@ -2953,7 +2999,7 @@ Comment$4$1.default = Comment$4$1;
2953
2999
  let { isClean: isClean$1$1, my: my$1$1 } = symbols$1;
2954
3000
  let Declaration$3$1 = declaration$1;
2955
3001
  let Comment$3$1 = comment$1;
2956
- let Node$1$1 = node$1;
3002
+ let Node$2$1 = node$1;
2957
3003
  let parse$4$1;
2958
3004
  let Rule$4$1;
2959
3005
  let AtRule$4$1;
@@ -2973,7 +3019,7 @@ function markDirtyUp$1(node2) {
2973
3019
  }
2974
3020
  }
2975
3021
  }
2976
- let Container$7$1 = class Container extends Node$1$1 {
3022
+ let Container$7$1 = class Container extends Node$2$1 {
2977
3023
  append(...children) {
2978
3024
  for (let child of children) {
2979
3025
  let nodes = this.normalize(child, this.last);
@@ -5001,7 +5047,7 @@ let parse$5 = parse_1$1;
5001
5047
  let list$3 = list_1$1;
5002
5048
  let Rule2$1 = rule$1;
5003
5049
  let Root2$1 = root$1;
5004
- let Node2$1 = node$1;
5050
+ let Node$1$1 = node$1;
5005
5051
  function postcss$3(...plugins) {
5006
5052
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
5007
5053
  plugins = plugins[0];
@@ -5061,7 +5107,7 @@ postcss$3.Result = Result2$1;
5061
5107
  postcss$3.Input = Input2$1;
5062
5108
  postcss$3.Rule = Rule2$1;
5063
5109
  postcss$3.Root = Root2$1;
5064
- postcss$3.Node = Node2$1;
5110
+ postcss$3.Node = Node$1$1;
5065
5111
  LazyResult2$1.registerPostcss(postcss$3);
5066
5112
  var postcss_1$1 = postcss$3;
5067
5113
  postcss$3.default = postcss$3;
@@ -5991,7 +6037,7 @@ function cloneNode(obj, parent) {
5991
6037
  }
5992
6038
  return cloned;
5993
6039
  }
5994
- let Node$4 = class Node3 {
6040
+ let Node$5 = class Node22 {
5995
6041
  constructor(defaults = {}) {
5996
6042
  this.raws = {};
5997
6043
  this[isClean$2] = false;
@@ -6283,10 +6329,10 @@ let Node$4 = class Node3 {
6283
6329
  return this;
6284
6330
  }
6285
6331
  };
6286
- var node = Node$4;
6287
- Node$4.default = Node$4;
6288
- let Node$3 = node;
6289
- 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 {
6290
6336
  constructor(defaults) {
6291
6337
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
6292
6338
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -6942,8 +6988,8 @@ let MapGenerator$2 = class MapGenerator2 {
6942
6988
  }
6943
6989
  };
6944
6990
  var mapGenerator = MapGenerator$2;
6945
- let Node$2 = node;
6946
- let Comment$4 = class Comment2 extends Node$2 {
6991
+ let Node$3 = node;
6992
+ let Comment$4 = class Comment2 extends Node$3 {
6947
6993
  constructor(defaults) {
6948
6994
  super(defaults);
6949
6995
  this.type = "comment";
@@ -6954,7 +7000,7 @@ Comment$4.default = Comment$4;
6954
7000
  let { isClean: isClean$1, my: my$1 } = symbols;
6955
7001
  let Declaration$3 = declaration;
6956
7002
  let Comment$3 = comment;
6957
- let Node$1 = node;
7003
+ let Node$2 = node;
6958
7004
  let parse$4;
6959
7005
  let Rule$4;
6960
7006
  let AtRule$4;
@@ -6974,7 +7020,7 @@ function markDirtyUp(node2) {
6974
7020
  }
6975
7021
  }
6976
7022
  }
6977
- let Container$7 = class Container2 extends Node$1 {
7023
+ let Container$7 = class Container2 extends Node$2 {
6978
7024
  append(...children) {
6979
7025
  for (let child of children) {
6980
7026
  let nodes = this.normalize(child, this.last);
@@ -9002,7 +9048,7 @@ let parse = parse_1;
9002
9048
  let list = list_1;
9003
9049
  let Rule22 = rule;
9004
9050
  let Root22 = root;
9005
- let Node22 = node;
9051
+ let Node$1 = node;
9006
9052
  function postcss(...plugins) {
9007
9053
  if (plugins.length === 1 && Array.isArray(plugins[0])) {
9008
9054
  plugins = plugins[0];
@@ -9062,7 +9108,7 @@ postcss.Result = Result22;
9062
9108
  postcss.Input = Input22;
9063
9109
  postcss.Rule = Rule22;
9064
9110
  postcss.Root = Root22;
9065
- postcss.Node = Node22;
9111
+ postcss.Node = Node$1;
9066
9112
  LazyResult22.registerPostcss(postcss);
9067
9113
  var postcss_1 = postcss;
9068
9114
  postcss.default = postcss;