@livx.cc/appwrap 0.61.14 → 0.61.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livx.cc/appwrap",
3
- "version": "0.61.14",
3
+ "version": "0.61.15",
4
4
  "description": "Wrap any PWA into a native app with native capabilities (appwrap runtime + @livx.cc/native-kit).",
5
5
  "license": "MIT",
6
6
  "author": "Elya Livshitz",
@@ -106,6 +106,17 @@ export function registerHandlers(): void {
106
106
  }
107
107
  });
108
108
 
109
+ // iOS edge-swipe back (WKWebView allowsBackForwardNavigationGestures, on by default). A page turns it
110
+ // off where WebKit's gesture looks wrong: its snapshots are main-frame-only, so a back over an
111
+ // IFRAME's pushState entry shows a stale picture of the page being left. The page then owns that
112
+ // Back itself. Android has no equivalent gesture → applied:false.
113
+ bridge.register('ui.backGesture', ({ enabled = true }: { enabled?: boolean }) => {
114
+ const wk = isIOS ? (bridge.getWebView()?.ios as WKWebView | undefined) : undefined;
115
+ if (!wk) return { applied: false };
116
+ wk.allowsBackForwardNavigationGestures = !!enabled;
117
+ return { applied: true, enabled: wk.allowsBackForwardNavigationGestures };
118
+ });
119
+
109
120
  bridge.register('haptics.notify', ({ type = 'success' }: { type?: string }) => {
110
121
  if (isIOS) {
111
122
  const types: Record<string, UINotificationFeedbackType> = {