@cloudparse/up-miniapps-sdk 0.5.3 → 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.cjs CHANGED
@@ -410,6 +410,7 @@ var resolveHeightToPixels = (height, containerHeight) => {
410
410
  };
411
411
  var CONTENT_EDGE_PULL_THRESHOLD_PX = 24;
412
412
  var HANDLE_BAR_HEIGHT_PX = 32;
413
+ var HANDLE_TAP_CLICK_SUPPRESSION_MS = 400;
413
414
  var MapDrawer = (0, import_react2.forwardRef)(
414
415
  ({
415
416
  menuItems,
@@ -674,7 +675,7 @@ var MapDrawer = (0, import_react2.forwardRef)(
674
675
  suppressNextClickRef.current = true;
675
676
  setTimeout(() => {
676
677
  suppressNextClickRef.current = false;
677
- }, 500);
678
+ }, HANDLE_TAP_CLICK_SUPPRESSION_MS);
678
679
  }
679
680
  setTouchStartY(null);
680
681
  setCurrentTouchY(null);
@@ -738,6 +739,12 @@ var MapDrawer = (0, import_react2.forwardRef)(
738
739
  }
739
740
  });
740
741
  };
742
+ const handleNativeClickCapture = (e) => {
743
+ if (!suppressNextClickRef.current) return;
744
+ suppressNextClickRef.current = false;
745
+ e.preventDefault();
746
+ e.stopPropagation();
747
+ };
741
748
  container.addEventListener("touchstart", handleNativeTouchStart, {
742
749
  passive: true
743
750
  });
@@ -747,10 +754,16 @@ var MapDrawer = (0, import_react2.forwardRef)(
747
754
  container.addEventListener("touchend", handleNativeTouchEnd, {
748
755
  passive: true
749
756
  });
757
+ container.addEventListener("click", handleNativeClickCapture, {
758
+ capture: true
759
+ });
750
760
  return () => {
751
761
  container.removeEventListener("touchstart", handleNativeTouchStart);
752
762
  container.removeEventListener("touchmove", handleNativeTouchMove);
753
763
  container.removeEventListener("touchend", handleNativeTouchEnd);
764
+ container.removeEventListener("click", handleNativeClickCapture, {
765
+ capture: true
766
+ });
754
767
  };
755
768
  }, [
756
769
  side,
@@ -3499,7 +3512,7 @@ var RoutingService = {
3499
3512
  };
3500
3513
 
3501
3514
  // package.json
3502
- var version = "0.5.3";
3515
+ var version = "0.5.5";
3503
3516
 
3504
3517
  // src/sdk.ts
3505
3518
  function deepFreeze(obj) {
@@ -3608,6 +3621,20 @@ var MiniAppSDK = class {
3608
3621
  return this.bridge.send("REQUEST_PERMISSION", { fields, type });
3609
3622
  })
3610
3623
  });
3624
+ /**
3625
+ * Media & Gallery integration.
3626
+ */
3627
+ media = Object.freeze({
3628
+ /**
3629
+ * Saves a base64-encoded image to the device's photo gallery via the Host Shell.
3630
+ * A plain browser `<a download>` does not work inside the native WebView (no
3631
+ * download manager is wired up) — this is the only way to persist an image
3632
+ * generated inside a Mini-App (e.g. a QR code) to the device.
3633
+ * @param base64 Base64-encoded image data, with or without the `data:image/...;base64,` prefix.
3634
+ * @param filename Suggested filename (without extension).
3635
+ */
3636
+ saveImage: (base64, filename) => this.bridge.send("SAVE_IMAGE", { base64, filename })
3637
+ });
3611
3638
  /**
3612
3639
  * Payments integration.
3613
3640
  */