@erkamyaman/capacitor-foldable 8.4.2 → 9.0.0-beta.0

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.
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.resource_bundles = { 'ErkamyamanCapacitorFoldablePrivacy' => ['ios/Sources/FoldablePlugin/Resources/PrivacyInfo.xcprivacy'] }
15
- s.ios.deployment_target = '14.0'
15
+ s.ios.deployment_target = '16.0'
16
16
  s.dependency 'Capacitor'
17
17
  s.swift_version = '5.1'
18
18
  end
package/Package.swift CHANGED
@@ -3,21 +3,20 @@ import PackageDescription
3
3
 
4
4
  let package = Package(
5
5
  name: "ErkamyamanCapacitorFoldable",
6
- platforms: [.iOS(.v14)],
6
+ platforms: [.iOS(.v16)],
7
7
  products: [
8
8
  .library(
9
9
  name: "ErkamyamanCapacitorFoldable",
10
10
  targets: ["FoldablePlugin"])
11
11
  ],
12
12
  dependencies: [
13
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", "8.0.0"..<"9.0.0")
13
+ .package(name: "capacitor", path: "example-app/node_modules/@capacitor/ios")
14
14
  ],
15
15
  targets: [
16
16
  .target(
17
17
  name: "FoldablePlugin",
18
18
  dependencies: [
19
- .product(name: "Capacitor", package: "capacitor-swift-pm"),
20
- .product(name: "Cordova", package: "capacitor-swift-pm")
19
+ .product(name: "Capacitor", package: "capacitor")
21
20
  ],
22
21
  path: "ios/Sources/FoldablePlugin",
23
22
  resources: [.copy("Resources/PrivacyInfo.xcprivacy")]),
package/README.md CHANGED
@@ -68,6 +68,7 @@ Also ships in the npm package under [`skills/`](skills/capacitor-foldable), and
68
68
  ## Used by
69
69
 
70
70
  - [Capacitor Native UI](https://github.com/rdlabo-dev/ionic-theme-ios27/tree/main/packages/capacitor-native-ui) and [Ionic Theme iOS 27](https://github.com/rdlabo-dev/ionic-theme-ios27) by rdlabo
71
+ - [RecipeSage](https://github.com/julianpoy/RecipeSage), a collaborative recipe keeper and meal planner, moves its native tab bar to the side on iPhone Duo with it
71
72
  - [Hinge Guess](https://github.com/erkamyaman/hinge-guess), a game where the phone's hinge is the controller
72
73
 
73
74
  ## Trademarks and licence
@@ -9,26 +9,22 @@ ext {
9
9
  }
10
10
 
11
11
  buildscript {
12
- ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.1.21'
13
12
  repositories {
14
13
  google()
15
14
  mavenCentral()
16
15
  }
17
16
  dependencies {
18
- classpath 'com.android.tools.build:gradle:8.13.0'
19
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
17
+ classpath 'com.android.tools.build:gradle:9.4.1'
20
18
  }
21
19
  }
22
20
 
23
21
  apply plugin: 'com.android.library'
24
- apply plugin: 'kotlin-android'
25
22
 
26
23
  android {
27
24
  namespace = "io.github.erkamyaman.foldable"
28
- compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
25
+ compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 37
29
26
  defaultConfig {
30
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
31
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
27
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 26
32
28
  versionCode 1
33
29
  versionName "1.0"
34
30
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erkamyaman/capacitor-foldable",
3
- "version": "8.4.2",
3
+ "version": "9.0.0-beta.0",
4
4
  "description": "Fold-state and dual-display APIs for foldable devices in Capacitor apps",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -82,10 +82,10 @@
82
82
  "prepublishOnly": "npm run build"
83
83
  },
84
84
  "devDependencies": {
85
- "@capacitor/android": "^8.0.0",
86
- "@capacitor/core": "^8.0.0",
85
+ "@capacitor/android": "9.0.0-beta.0",
86
+ "@capacitor/core": "9.0.0-beta.0",
87
87
  "@capacitor/docgen": "^0.3.1",
88
- "@capacitor/ios": "^8.0.0",
88
+ "@capacitor/ios": "9.0.0-beta.0",
89
89
  "@ionic/eslint-config": "^0.4.0",
90
90
  "@ionic/prettier-config": "^4.0.0",
91
91
  "@ionic/swiftlint-config": "^2.0.0",
@@ -98,7 +98,7 @@
98
98
  "typescript": "^5.9.3"
99
99
  },
100
100
  "peerDependencies": {
101
- "@capacitor/core": "^8.0.0"
101
+ "@capacitor/core": "^9.0.0-beta.0"
102
102
  },
103
103
  "prettier": "@ionic/prettier-config",
104
104
  "swiftlint": "@ionic/swiftlint-config",
@@ -30,16 +30,25 @@ The system moves bars to the side, and the web view's safe areas follow. Measure
30
30
 
31
31
  So for most layouts, padding with the safe-area insets is enough, and `getBarPlacement()` is for when you are positioning your own chrome to match the system's.
32
32
 
33
- The opt-out needs the plugin's view controller in `ios/App/App/SceneDelegate.swift`:
33
+ The opt-out needs the plugin's view controller. Capacitor 9 starts the app from SwiftUI, so return it from `ios/App/App/CapacitorView.swift`:
34
34
 
35
35
  ```swift
36
+ import SwiftUI
36
37
  import Capacitor
37
38
  import FoldablePlugin
38
39
 
39
- window?.rootViewController = FoldableBridgeViewController()
40
+ public struct CapacitorView: UIViewControllerRepresentable {
41
+ public func makeUIViewController(context: Context) -> CAPBridgeViewController {
42
+ FoldableBridgeViewController()
43
+ }
44
+
45
+ public func updateUIViewController(_ vc: CAPBridgeViewController, context: Context) {}
46
+ }
40
47
  ```
41
48
 
42
- `FoldablePlugin` is the module name for a Swift Package install, which is what `npx cap add ios` sets up for a new Capacitor 8 app. On a CocoaPods install the module is `ErkamyamanCapacitorFoldable`. Older apps that build the controller in `Main.storyboard` set the class there instead.
49
+ On Capacitor 8, set it in `ios/App/App/SceneDelegate.swift` instead: `window?.rootViewController = FoldableBridgeViewController()`. After `npx cap migrate` to Capacitor 9, delete that window setup, because the SwiftUI app owns the window and a second one would cover it.
50
+
51
+ `FoldablePlugin` is the module name for a Swift Package install, which is what `npx cap add ios` sets up for a new app. On a CocoaPods install the module is `ErkamyamanCapacitorFoldable`. Older apps that build the controller in `Main.storyboard` set the class there instead.
43
52
 
44
53
  ## The web view pauses between displays
45
54