craft-native 0.0.101 → 0.0.104

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/cli.js CHANGED
@@ -4621,7 +4621,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
4621
4621
  `);
4622
4622
  }
4623
4623
  // package.json
4624
- var version = "0.0.101";
4624
+ var version = "0.0.104";
4625
4625
 
4626
4626
  // bin/cli.ts
4627
4627
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -310,7 +310,7 @@ function craftBinaryNotFoundMessage(triedPath) {
310
310
  `);
311
311
  }
312
312
  // package.json
313
- var version = "0.0.101";
313
+ var version = "0.0.104";
314
314
 
315
315
  // src/sdk-version.ts
316
316
  var SDK_VERSION = version;
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ function craftBinaryNotFoundMessage(triedPath) {
58
58
  `);
59
59
  }
60
60
  // package.json
61
- var version = "0.0.101";
61
+ var version = "0.0.104";
62
62
 
63
63
  // src/sdk-version.ts
64
64
  var SDK_VERSION = version;
@@ -1703,12 +1703,32 @@ struct CraftWebView: UIViewRepresentable {
1703
1703
  decisionHandler(.allow)
1704
1704
  return
1705
1705
  }
1706
+ // An iframe the app's page embeds loads in place. Only the main
1707
+ // frame's navigations leave for Safari: cancelling the frame's
1708
+ // too left every embed blank, a YouTube or Vimeo player among them.
1709
+ if let frame = navigationAction.targetFrame, !frame.isMainFrame, isEmbeddableFrameURL(url) {
1710
+ decisionHandler(.allow)
1711
+ return
1712
+ }
1706
1713
  if navigationAction.targetFrame?.isMainFrame != false {
1707
1714
  UIApplication.shared.open(url)
1708
1715
  }
1709
1716
  decisionHandler(.cancel)
1710
1717
  }
1711
1718
 
1719
+ /// What an iframe inside the app's page may load: a video player, a
1720
+ /// payment form, a map. It stays inside its frame, and the bridge
1721
+ /// answers only `isTrustedOrigin`, so loading one reaches nothing
1722
+ /// native. Plain http is left to the trusted local origins.
1723
+ private func isEmbeddableFrameURL(_ url: URL) -> Bool {
1724
+ switch url.scheme?.lowercased() {
1725
+ case "https", "about", "data", "blob":
1726
+ return true
1727
+ default:
1728
+ return false
1729
+ }
1730
+ }
1731
+
1712
1732
  func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
1713
1733
  webView.reload()
1714
1734
  }
@@ -4244,6 +4264,10 @@ struct CraftWebView: UIViewRepresentable {
4244
4264
  }
4245
4265
  isLocationRecordingPaused = false
4246
4266
  persistLocationRecordingState()
4267
+ // Set here too: a recording restored at launch while paused never
4268
+ // got a delegate, so resuming it started updates nobody received
4269
+ // and the route stopped at the pause.
4270
+ locationManager?.delegate = self
4247
4271
  requestLocationAuthorization()
4248
4272
  configureBackgroundLocationIfNeeded()
4249
4273
  locationManager?.startUpdatingLocation()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.101",
3
+ "version": "0.0.104",
4
4
  "type": "module",
5
5
  "description": "Build desktop apps with web languages - TypeScript SDK for Craft",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",