@protobase/mobile 0.45.8 → 0.45.10
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.swift
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
// Protobase's iOS plugin, which `cap add ios` compiles into the app's CapApp-SPM package by the name it gives
|
|
5
|
+
// @protobase/mobile: ProtobaseMobile.
|
|
6
|
+
let package = Package(
|
|
7
|
+
name: "ProtobaseMobile",
|
|
8
|
+
platforms: [.iOS(.v15)],
|
|
9
|
+
products: [
|
|
10
|
+
.library(name: "ProtobaseMobile", targets: ["ProtobaseMobile"])
|
|
11
|
+
],
|
|
12
|
+
dependencies: [
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
|
+
],
|
|
15
|
+
targets: [
|
|
16
|
+
.target(
|
|
17
|
+
name: "ProtobaseMobile",
|
|
18
|
+
dependencies: [.product(name: "Capacitor", package: "capacitor-swift-pm")],
|
|
19
|
+
path: "ios/Sources/ProtobaseMobile")
|
|
20
|
+
]
|
|
21
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Capacitor
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Gives the page back the bounce of a native iOS app at its top and bottom edges. Capacitor turns it off on every
|
|
5
|
+
* WebView it creates (CAPBridgeViewController.swift:301) and has no setting for it, and the page scrolls the WebView's
|
|
6
|
+
* own scroll view. A short page bounces too, as a native list does; sideways it never does. The space a bounce shows
|
|
7
|
+
* takes the page's background, as in Safari, instead of the system's that Capacitor gives the scroll view, which is
|
|
8
|
+
* black under a dark page that is not. The bridge loads plugins once the WebView exists, on the main thread.
|
|
9
|
+
*/
|
|
10
|
+
@objc(ProtobaseBounce)
|
|
11
|
+
public class ProtobaseBounce: CAPPlugin, CAPBridgedPlugin {
|
|
12
|
+
public let identifier = "ProtobaseBounce"
|
|
13
|
+
public let jsName = "ProtobaseBounce"
|
|
14
|
+
public let pluginMethods: [CAPPluginMethod] = []
|
|
15
|
+
|
|
16
|
+
override public func load() {
|
|
17
|
+
guard let scrollView = bridge?.webView?.scrollView else { return }
|
|
18
|
+
scrollView.bounces = true
|
|
19
|
+
scrollView.alwaysBounceVertical = true
|
|
20
|
+
scrollView.alwaysBounceHorizontal = false
|
|
21
|
+
scrollView.backgroundColor = nil
|
|
22
|
+
}
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/mobile",
|
|
3
|
-
"version": "0.45.
|
|
4
|
-
"description": "The Capacitor that protobase mobile builds a Protobase app's iOS and Android projects with, at fixed versions, and the native
|
|
3
|
+
"version": "0.45.10",
|
|
4
|
+
"description": "The Capacitor that protobase mobile builds a Protobase app's iOS and Android projects with, at fixed versions, and the native plugins that keep page script away from the session and give the iOS app its bounce; installed by the CLI on first use.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -15,13 +15,18 @@
|
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"LICENSE",
|
|
18
|
+
"Package.swift",
|
|
19
|
+
"ios/Sources/",
|
|
18
20
|
"android/src/main/",
|
|
19
21
|
"android/src/liveupdate/",
|
|
20
22
|
"android/build.gradle",
|
|
21
23
|
"icon"
|
|
22
24
|
],
|
|
23
|
-
"nativeContract":
|
|
25
|
+
"nativeContract": 3,
|
|
24
26
|
"capacitor": {
|
|
27
|
+
"ios": {
|
|
28
|
+
"src": "ios"
|
|
29
|
+
},
|
|
25
30
|
"android": {
|
|
26
31
|
"src": "android"
|
|
27
32
|
}
|