@cloudparse/up-miniapps-sdk 0.5.4 → 0.5.5

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
@@ -355,6 +355,7 @@ var resolveHeightToPixels = (height, containerHeight) => {
355
355
  };
356
356
  var CONTENT_EDGE_PULL_THRESHOLD_PX = 24;
357
357
  var HANDLE_BAR_HEIGHT_PX = 32;
358
+ var HANDLE_TAP_CLICK_SUPPRESSION_MS = 400;
358
359
  var MapDrawer = forwardRef3(
359
360
  ({
360
361
  menuItems,
@@ -619,7 +620,7 @@ var MapDrawer = forwardRef3(
619
620
  suppressNextClickRef.current = true;
620
621
  setTimeout(() => {
621
622
  suppressNextClickRef.current = false;
622
- }, 500);
623
+ }, HANDLE_TAP_CLICK_SUPPRESSION_MS);
623
624
  }
624
625
  setTouchStartY(null);
625
626
  setCurrentTouchY(null);
@@ -683,6 +684,12 @@ var MapDrawer = forwardRef3(
683
684
  }
684
685
  });
685
686
  };
687
+ const handleNativeClickCapture = (e) => {
688
+ if (!suppressNextClickRef.current) return;
689
+ suppressNextClickRef.current = false;
690
+ e.preventDefault();
691
+ e.stopPropagation();
692
+ };
686
693
  container.addEventListener("touchstart", handleNativeTouchStart, {
687
694
  passive: true
688
695
  });
@@ -692,10 +699,16 @@ var MapDrawer = forwardRef3(
692
699
  container.addEventListener("touchend", handleNativeTouchEnd, {
693
700
  passive: true
694
701
  });
702
+ container.addEventListener("click", handleNativeClickCapture, {
703
+ capture: true
704
+ });
695
705
  return () => {
696
706
  container.removeEventListener("touchstart", handleNativeTouchStart);
697
707
  container.removeEventListener("touchmove", handleNativeTouchMove);
698
708
  container.removeEventListener("touchend", handleNativeTouchEnd);
709
+ container.removeEventListener("click", handleNativeClickCapture, {
710
+ capture: true
711
+ });
699
712
  };
700
713
  }, [
701
714
  side,
@@ -3278,7 +3291,7 @@ function renderMap(containerId, props = {}) {
3278
3291
  }
3279
3292
 
3280
3293
  // package.json
3281
- var version = "0.5.4";
3294
+ var version = "0.5.5";
3282
3295
 
3283
3296
  // src/sdk.ts
3284
3297
  function deepFreeze(obj) {