@absolutejs/beacon 0.6.12 → 0.6.13

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.
package/dist/index.js CHANGED
@@ -690,7 +690,7 @@ var createBeacon = (options) => {
690
690
  const KEYBOARD_VIEWPORT_HEIGHT_RATIO_MAX = 0.8;
691
691
  const SCROLL_JAIL_EVENT_COUNT = 8;
692
692
  const SCROLL_JAIL_WINDOW_MS = 2000;
693
- const SCROLL_JAIL_SETTLE_MS = 50;
693
+ const SCROLL_JAIL_SETTLE_MS = 500;
694
694
  const SCROLL_JAIL_BOUNDARY_TOLERANCE_PX = 2;
695
695
  const AUTH_FAILURE_STORM_DEFAULT_COUNT = 4;
696
696
  const AUTH_FAILURE_STORM_DEFAULT_WINDOW_MS = 30000;
@@ -2732,7 +2732,14 @@ var createBeacon = (options) => {
2732
2732
  let jailScroller = null;
2733
2733
  let jailSettleTimer;
2734
2734
  const reportedScrollers = new Set;
2735
+ const clearJailSettle = () => {
2736
+ if (jailSettleTimer === undefined)
2737
+ return;
2738
+ clearTimeout(jailSettleTimer);
2739
+ jailSettleTimer = undefined;
2740
+ };
2735
2741
  const onWheel = (event) => {
2742
+ clearJailSettle();
2736
2743
  if (event.ctrlKey || event.defaultPrevented || event.deltaY === 0) {
2737
2744
  jailBurst = [];
2738
2745
  return;
@@ -2760,14 +2767,14 @@ var createBeacon = (options) => {
2760
2767
  return;
2761
2768
  const first = jailBurst[0];
2762
2769
  const moved = first === undefined || jailBurst.some((entry) => entry.position !== first.position) || scroller.scrollTop !== first.position;
2763
- jailBurst = [];
2764
- if (moved)
2770
+ if (moved) {
2771
+ jailBurst = [];
2765
2772
  return;
2773
+ }
2766
2774
  const startingPosition = first.position;
2767
- if (jailSettleTimer !== undefined)
2768
- clearTimeout(jailSettleTimer);
2769
2775
  jailSettleTimer = setTimeout(() => {
2770
2776
  jailSettleTimer = undefined;
2777
+ jailBurst = [];
2771
2778
  if (!scroller.isConnected || scroller.scrollTop !== startingPosition)
2772
2779
  return;
2773
2780
  const canStillMove = scrollingDown ? scroller.scrollTop + scroller.clientHeight < scroller.scrollHeight - SCROLL_JAIL_BOUNDARY_TOLERANCE_PX : scroller.scrollTop > SCROLL_JAIL_BOUNDARY_TOLERANCE_PX;
@@ -2785,8 +2792,7 @@ var createBeacon = (options) => {
2785
2792
  document.addEventListener("wheel", onWheel, { passive: true });
2786
2793
  cleanups.push(() => {
2787
2794
  document.removeEventListener("wheel", onWheel);
2788
- if (jailSettleTimer !== undefined)
2789
- clearTimeout(jailSettleTimer);
2795
+ clearJailSettle();
2790
2796
  });
2791
2797
  }
2792
2798
  if (signals.thrashedCursors !== false) {
@@ -3727,5 +3733,5 @@ export {
3727
3733
  BEACON_ATTRIBUTE
3728
3734
  };
3729
3735
 
3730
- //# debugId=43F4A921162661FF64756E2164756E21
3736
+ //# debugId=67D5901DFC5C25F064756E2164756E21
3731
3737
  //# sourceMappingURL=index.js.map