@capacitor/ios 4.0.0-beta.0 → 4.0.0-beta.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.0.0-beta.1](https://github.com/ionic-team/capacitor/compare/4.0.0-beta.0...4.0.0-beta.1) (2022-06-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ios:** Remove Cordova as an embedded framework ([#5709](https://github.com/ionic-team/capacitor/issues/5709)) ([bbf6d24](https://github.com/ionic-team/capacitor/commit/bbf6d248bf9217a5c5c6c15c7bcfeda209aba5b1))
12
+
13
+
14
+ ### Features
15
+
16
+ * **ios:** Allow to configure popover size ([#5717](https://github.com/ionic-team/capacitor/issues/5717)) ([ca1a125](https://github.com/ionic-team/capacitor/commit/ca1a125e5ab05d6066dd303bc75e99dfe21f210a))
17
+
18
+
19
+
20
+
21
+
6
22
  # [4.0.0-beta.0](https://github.com/ionic-team/capacitor/compare/3.6.0...4.0.0-beta.0) (2022-06-17)
7
23
 
8
24
 
@@ -89,11 +89,11 @@ import Cordova
89
89
  }
90
90
  return descriptor
91
91
  }
92
-
92
+
93
93
  open func router() -> Router {
94
- return _Router()
94
+ return _Router()
95
95
  }
96
-
96
+
97
97
  /**
98
98
  The WKWebViewConfiguration to use for the webview.
99
99
 
@@ -4,7 +4,7 @@ public class CAPLog {
4
4
  public static func print(_ items: Any..., separator: String = " ", terminator: String = "\n") {
5
5
  if enableLogging {
6
6
  for (itemIndex, item) in items.enumerated() {
7
- Swift.print(item, terminator: itemIndex == items.count - 1 ? terminator : separator)
7
+ Swift.print("\(item)".prefix(4068), terminator: itemIndex == items.count - 1 ? terminator : separator)
8
8
  }
9
9
  }
10
10
  }
@@ -48,7 +48,8 @@
48
48
  -(NSString* _Nullable)getString:(CAPPluginCall* _Nonnull)call field:(NSString* _Nonnull)field defaultValue:(NSString* _Nonnull)defaultValue DEPRECATED_MSG_ATTRIBUTE("Use accessors on CAPPluginCall instead. See CAPBridgedJSTypes.h for Obj-C implementations.");
49
49
  -(id _Nullable)getConfigValue:(NSString* _Nonnull)key __deprecated_msg("use getConfig() and access config values using the methods available depending on the type.");
50
50
  -(PluginConfig* _Nonnull)getConfig;
51
- -(void)setCenteredPopover:(UIViewController* _Nonnull)vc;
51
+ -(void)setCenteredPopover:(UIViewController* _Nonnull) vc;
52
+ -(void)setCenteredPopover:(UIViewController* _Nonnull) vc size:(CGSize) size;
52
53
  -(BOOL)supportsPopover DEPRECATED_MSG_ATTRIBUTE("All iOS 13+ devices support popover");
53
54
 
54
55
  @end
@@ -145,6 +145,15 @@
145
145
  }
146
146
  }
147
147
 
148
+ -(void)setCenteredPopover:(UIViewController* _Nonnull) vc size:(CGSize) size {
149
+ if (self.bridge.viewController != nil) {
150
+ vc.popoverPresentationController.sourceRect = CGRectMake(self.bridge.viewController.view.center.x, self.bridge.viewController.view.center.y, 0, 0);
151
+ vc.preferredContentSize = size;
152
+ vc.popoverPresentationController.sourceView = self.bridge.viewController.view;
153
+ vc.popoverPresentationController.permittedArrowDirections = 0;
154
+ }
155
+ }
156
+
148
157
  -(BOOL)supportsPopover {
149
158
  return YES;
150
159
  }
@@ -18,12 +18,12 @@ internal struct _Router: Router {
18
18
  var basePath: String = ""
19
19
  func route(for path: String) -> String {
20
20
  let pathUrl = URL(fileURLWithPath: path)
21
-
21
+
22
22
  // If there's no path extension it also means the path is empty or a SPA route
23
23
  if pathUrl.pathExtension.isEmpty {
24
24
  return basePath + "/index.html"
25
25
  }
26
-
26
+
27
27
  return basePath + path
28
28
  }
29
29
  }
@@ -4,7 +4,7 @@ import MobileCoreServices
4
4
  @objc(CAPWebViewAssetHandler)
5
5
  internal class WebViewAssetHandler: NSObject, WKURLSchemeHandler {
6
6
  private var router: Router
7
-
7
+
8
8
  init(router: Router) {
9
9
  self.router = router
10
10
  super.init()
@@ -18,13 +18,13 @@ internal class WebViewAssetHandler: NSObject, WKURLSchemeHandler {
18
18
  let startPath: String
19
19
  let url = urlSchemeTask.request.url!
20
20
  let stringToLoad = url.path
21
-
21
+
22
22
  if stringToLoad.starts(with: CapacitorBridge.fileStartIdentifier) {
23
23
  startPath = stringToLoad.replacingOccurrences(of: CapacitorBridge.fileStartIdentifier, with: "")
24
24
  } else {
25
25
  startPath = router.route(for: stringToLoad)
26
26
  }
27
-
27
+
28
28
  let localUrl = URL.init(string: url.absoluteString)!
29
29
  let fileUrl = URL.init(fileURLWithPath: startPath)
30
30
 
@@ -46,7 +46,7 @@ internal class WebViewDelegationHandler: NSObject, WKNavigationDelegate, WKUIDel
46
46
  // Reset the bridge on each navigation
47
47
  bridge?.reset()
48
48
  }
49
-
49
+
50
50
  @available(iOS 15, *)
51
51
  func webView(
52
52
  _ webView: WKWebView,
@@ -60,9 +60,9 @@ internal class WebViewDelegationHandler: NSObject, WKNavigationDelegate, WKUIDel
60
60
 
61
61
  @available(iOS 15, *)
62
62
  func webView(_ webView: WKWebView,
63
- requestDeviceOrientationAndMotionPermissionFor origin: WKSecurityOrigin,
64
- initiatedByFrame frame: WKFrameInfo,
65
- decisionHandler: @escaping (WKPermissionDecision) -> Void) {
63
+ requestDeviceOrientationAndMotionPermissionFor origin: WKSecurityOrigin,
64
+ initiatedByFrame frame: WKFrameInfo,
65
+ decisionHandler: @escaping (WKPermissionDecision) -> Void) {
66
66
  decisionHandler(.grant)
67
67
  }
68
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/ios",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -24,10 +24,10 @@
24
24
  "xc:build:CapacitorCordova": "cd CapacitorCordova && xcodebuild && cd .."
25
25
  },
26
26
  "peerDependencies": {
27
- "@capacitor/core": "^3.6.0"
27
+ "@capacitor/core": "next"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "d9e553f76fac74df6ab0f2bf5c3da18e51b2282b"
32
+ "gitHead": "8520516c0883cb11df3b0097ac793290235c27de"
33
33
  }