@appsurify-testmap/rrweb-all 3.6.0-alpha.1 → 3.10.0-alpha.1

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.
@@ -15902,7 +15902,8 @@ function initInputObserver({
15902
15902
  maskInputOptions,
15903
15903
  maskInputFn,
15904
15904
  sampling,
15905
- userTriggeredOnInput
15905
+ userTriggeredOnInput,
15906
+ trustSyntheticInput
15906
15907
  }) {
15907
15908
  function eventHandler(event) {
15908
15909
  let target = getEventTarget(event);
@@ -15952,34 +15953,53 @@ function initInputObserver({
15952
15953
  function cbWithDedup(target, v2) {
15953
15954
  const lastInputValue = lastInputValueMap.get(target);
15954
15955
  const el = target;
15955
- const hasPlaceholder = el.hasAttribute("placeholder");
15956
- const isEmpty = el.value === "";
15957
- const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
15958
- const isNonUser = !v2.userTriggered;
15959
- const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
15960
- const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
15961
- const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
15962
- const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
15963
- const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
15964
- const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
15965
- if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
15966
- console.debug(
15967
- `[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
15968
- {
15969
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
15970
- node: index.describeNode(el),
15971
- tag: el.tagName,
15972
- nodeType: el.nodeType,
15973
- attribute: el.attributes,
15974
- value: el.value,
15975
- isLikelyPhantom,
15976
- isRenderDrivenTextInput,
15977
- isValueFromDefault,
15978
- isPhantomCheckbox,
15979
- isPhantomRadio
15980
- }
15981
- );
15982
- return;
15956
+ if (trustSyntheticInput) {
15957
+ const isInitialEmpty = !v2.userTriggered && el.value === "" && !v2.isChecked && !lastInputValue;
15958
+ const isSelectDefaultSelection = el.tagName === "SELECT" && !v2.userTriggered && !lastInputValue && el.selectedIndex === 0;
15959
+ if (isInitialEmpty || isSelectDefaultSelection) {
15960
+ console.debug(
15961
+ `[${nowTimestamp()}] [rrweb:record/observer] phantom input ignored (trust mode)`,
15962
+ {
15963
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
15964
+ node: index.describeNode(el),
15965
+ tag: el.tagName,
15966
+ value: el.value,
15967
+ isInitialEmpty,
15968
+ isSelectDefaultSelection
15969
+ }
15970
+ );
15971
+ return;
15972
+ }
15973
+ } else {
15974
+ const hasPlaceholder = el.hasAttribute("placeholder");
15975
+ const isEmpty = el.value === "";
15976
+ const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
15977
+ const isNonUser = !v2.userTriggered;
15978
+ const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
15979
+ const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
15980
+ const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
15981
+ const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
15982
+ const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
15983
+ const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
15984
+ if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
15985
+ console.debug(
15986
+ `[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
15987
+ {
15988
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
15989
+ node: index.describeNode(el),
15990
+ tag: el.tagName,
15991
+ nodeType: el.nodeType,
15992
+ attribute: el.attributes,
15993
+ value: el.value,
15994
+ isLikelyPhantom,
15995
+ isRenderDrivenTextInput,
15996
+ isValueFromDefault,
15997
+ isPhantomCheckbox,
15998
+ isPhantomRadio
15999
+ }
16000
+ );
16001
+ return;
16002
+ }
15983
16003
  }
15984
16004
  if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
15985
16005
  lastInputValueMap.set(target, v2);
@@ -18030,8 +18050,15 @@ class NavigationManager {
18030
18050
  handleNavigation(data) {
18031
18051
  if (this.disabled) return;
18032
18052
  if (this.locked) return;
18033
- this.cancelTimers();
18034
- this.disconnectSettlingObserver();
18053
+ if (this.pendingNavigation) {
18054
+ this.cancelTimers();
18055
+ this.disconnectSettlingObserver();
18056
+ this.pendingNavigation = null;
18057
+ this.onSnapshot(true);
18058
+ } else {
18059
+ this.cancelTimers();
18060
+ this.disconnectSettlingObserver();
18061
+ }
18035
18062
  this.pendingNavigation = data;
18036
18063
  if (this.frozen) {
18037
18064
  return;
@@ -18238,7 +18265,7 @@ class ProcessedNodeManager {
18238
18265
  destroy() {
18239
18266
  }
18240
18267
  }
18241
- const version$1 = "3.6.0-alpha.1";
18268
+ const version$1 = "3.10.0-alpha.1";
18242
18269
  let wrappedEmit;
18243
18270
  let takeFullSnapshot$1;
18244
18271
  let canvasManager;
@@ -18287,6 +18314,7 @@ function record(options = {}) {
18287
18314
  recordAfter = options.recordAfter === "DOMContentLoaded" ? options.recordAfter : "load",
18288
18315
  flushCustomEvent = options.flushCustomEvent !== void 0 ? options.flushCustomEvent : "after",
18289
18316
  userTriggeredOnInput = false,
18317
+ trustSyntheticInput = false,
18290
18318
  collectFonts = false,
18291
18319
  inlineImages = false,
18292
18320
  plugins,
@@ -18826,6 +18854,7 @@ function record(options = {}) {
18826
18854
  recordCanvas,
18827
18855
  inlineImages,
18828
18856
  userTriggeredOnInput,
18857
+ trustSyntheticInput,
18829
18858
  collectFonts,
18830
18859
  doc,
18831
18860
  maskInputFn,
@@ -18902,6 +18931,43 @@ function record(options = {}) {
18902
18931
  );
18903
18932
  }
18904
18933
  return () => {
18934
+ if (recording) {
18935
+ const activeEl = document.activeElement;
18936
+ if (activeEl && INPUT_TAGS.includes(activeEl.tagName)) {
18937
+ const inputEl = activeEl;
18938
+ const id = mirror.getId(inputEl);
18939
+ if (id !== -1) {
18940
+ const lastValue = lastInputValueMap.get(inputEl);
18941
+ let text = inputEl.value;
18942
+ let isChecked = false;
18943
+ const type = getInputType(inputEl) || "";
18944
+ if (type === "radio" || type === "checkbox") {
18945
+ isChecked = inputEl.checked;
18946
+ } else if (maskInputOptions[inputEl.tagName.toLowerCase()] || maskInputOptions[type]) {
18947
+ text = maskInputValue({
18948
+ element: inputEl,
18949
+ maskInputOptions,
18950
+ tagName: inputEl.tagName,
18951
+ type,
18952
+ value: text,
18953
+ maskInputFn
18954
+ });
18955
+ }
18956
+ if (!lastValue || lastValue.text !== text || lastValue.isChecked !== isChecked) {
18957
+ const inputData = userTriggeredOnInput ? { text, isChecked, userTriggered: false } : { text, isChecked };
18958
+ lastInputValueMap.set(inputEl, inputData);
18959
+ wrappedEmit({
18960
+ type: EventType.IncrementalSnapshot,
18961
+ data: {
18962
+ source: IncrementalSource.Input,
18963
+ ...inputData,
18964
+ id
18965
+ }
18966
+ });
18967
+ }
18968
+ }
18969
+ }
18970
+ }
18905
18971
  if (checkoutDebounceTimer) {
18906
18972
  clearTimeout(checkoutDebounceTimer);
18907
18973
  checkoutDebounceTimer = null;
@@ -21833,7 +21899,7 @@ class Replayer {
21833
21899
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
21834
21900
  }
21835
21901
  }
21836
- const version = "3.6.0-alpha.1";
21902
+ const version = "3.10.0-alpha.1";
21837
21903
  const { getVersion } = record;
21838
21904
  const { isRecording } = record;
21839
21905
  const { flushCustomEventQueue } = record;