@appsurify-testmap/rrweb-all 2.1.0-alpha.2 → 2.1.0-alpha.3

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.
@@ -962,6 +962,10 @@ function cleanAttributes(doc, element, ignoreAttribute) {
962
962
  }
963
963
  return attributes;
964
964
  }
965
+ function shouldIgnoreAttribute(ignore, name) {
966
+ if (!ignore) return false;
967
+ return typeof ignore === "string" ? name === ignore : ignore.test(name);
968
+ }
965
969
  function _isBlockedElement(element, blockClass, blockSelector) {
966
970
  try {
967
971
  if (typeof blockClass === "string") {
@@ -10974,9 +10978,8 @@ function hookSetter(target, key, d, isRevoked, win = window) {
10974
10978
  );
10975
10979
  return () => hookSetter(target, key, original || {}, true);
10976
10980
  }
10977
- let nowTimestamp = Date.now;
10978
- if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
10979
- nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
10981
+ function nowTimestamp() {
10982
+ return performance.timeOrigin + performance.now();
10980
10983
  }
10981
10984
  function getWindowScroll(win = window) {
10982
10985
  var _a2, _b2, _c, _d;
@@ -11258,9 +11261,7 @@ const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
11258
11261
  isSerializedStylesheet,
11259
11262
  iterateResolveTree,
11260
11263
  legacy_isTouchEvent,
11261
- get nowTimestamp() {
11262
- return nowTimestamp;
11263
- },
11264
+ nowTimestamp,
11264
11265
  on,
11265
11266
  polyfill: polyfill$1,
11266
11267
  queueToResolveTrees,
@@ -11646,6 +11647,20 @@ class MutationBuffer {
11646
11647
  };
11647
11648
  }).filter((text) => !addedIds.has(text.id)).filter((text) => this.mirror.has(text.id)),
11648
11649
  attributes: this.attributes.map((attribute) => {
11650
+ const element = attribute.node;
11651
+ const filtered = {};
11652
+ for (const [name, value] of Object.entries(attribute.attributes)) {
11653
+ const isIgnored2 = shouldIgnoreAttribute(this.ignoreAttribute, name);
11654
+ const existedBefore = element.hasAttribute(name);
11655
+ const keep = value !== null && !isIgnored2 || value === null && (!isIgnored2 || attribute.attributes[name] !== null || existedBefore);
11656
+ if (keep) {
11657
+ filtered[name] = value;
11658
+ }
11659
+ }
11660
+ return __spreadProps(__spreadValues({}, attribute), {
11661
+ attributes: filtered
11662
+ });
11663
+ }).filter((attribute) => Object.keys(attribute.attributes).length > 0).map((attribute) => {
11649
11664
  const { attributes } = attribute;
11650
11665
  if (typeof attributes.style === "string") {
11651
11666
  const diffAsStr = JSON.stringify(attribute.styleDiff);
@@ -11727,7 +11742,10 @@ class MutationBuffer {
11727
11742
  case "attributes": {
11728
11743
  const target = m.target;
11729
11744
  let attributeName = m.attributeName;
11730
- let value = m.target.getAttribute(attributeName);
11745
+ let value = target.getAttribute(attributeName);
11746
+ if (value === null && m.oldValue === null) {
11747
+ return;
11748
+ }
11731
11749
  if (attributeName === "value") {
11732
11750
  const type = getInputType(target);
11733
11751
  value = maskInputValue({
@@ -11763,7 +11781,8 @@ class MutationBuffer {
11763
11781
  if (attributeName === "type" && target.tagName === "INPUT" && (m.oldValue || "").toLowerCase() === "password") {
11764
11782
  target.setAttribute("data-rr-is-password", "true");
11765
11783
  }
11766
- if (!isIgnoreAttribute(target.tagName, attributeName)) {
11784
+ if (!isIgnoreAttribute(target.tagName, attributeName) && // eslint-disable-next-line @typescript-eslint/no-unsafe-call
11785
+ !shouldIgnoreAttribute(this.ignoreAttribute, attributeName)) {
11767
11786
  item.attributes[attributeName] = transformAttribute(
11768
11787
  this.doc,
11769
11788
  toLowerCase(target.tagName),