turbo-native-initializer 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebFragment.kt.tt +3 -1
- data/lib/turbo_native_initializer/templates/android_stack/base/app/src/main/assets/json/configuration.json +2 -2
- data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebFragment.kt.tt +2 -0
- data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Configuration/path-configuration.json +2 -2
- data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/TurboNavigationController.swift +4 -4
- data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/ViewController.swift +7 -5
- data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/TurboNavigationController.swift +4 -4
- data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/ViewController.swift +7 -5
- data/lib/turbo_native_initializer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 893bf3c34e0baf61bb3ee5b7ce006ce9946bddc156bb8d95ea9a255d01c93d7e
|
4
|
+
data.tar.gz: 8d9677132ab1956eba6332539cddec223b6f66ffac6e5ed9b766553d104344bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b25e7862afa00d50783f259dceb567a439b807832e2f73984033f80aef10de767e13fc3c6f75b764ba32651a5974d5ebed19cacf368d3c37283f7bb329649c23
|
7
|
+
data.tar.gz: eeaccd07971c2472b78a2b4f1eaff2828f25f23fecad3043d2047de013d636a17ebfc2f7691d45c8acd45a3b7335966b9953530512f7e92010150f641aee40c0
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
package <%= package_name %>.features.web
|
2
2
|
|
3
|
+
import android.view.View
|
3
4
|
import <%= package_name %>.base.NavDestination
|
4
5
|
import <%= package_name %>.util.SIGN_IN_URL
|
5
6
|
import dev.hotwire.turbo.fragments.TurboWebFragment
|
6
7
|
import dev.hotwire.turbo.nav.TurboNavGraphDestination
|
8
|
+
import <%= package_name %>.R
|
7
9
|
import dev.hotwire.turbo.visit.TurboVisitAction.REPLACE
|
8
10
|
import dev.hotwire.turbo.visit.TurboVisitOptions
|
9
11
|
|
@@ -18,5 +20,5 @@ open class WebFragment : TurboWebFragment(), NavDestination {
|
|
18
20
|
|
19
21
|
override fun createErrorView(statusCode: Int): View {
|
20
22
|
return layoutInflater.inflate(R.layout.error_web, null)
|
21
|
-
}
|
23
|
+
}
|
22
24
|
}
|
@@ -5,8 +5,8 @@
|
|
5
5
|
{ "patterns": ["/refresh_historical_location"], "properties": { "presentation": "refresh" } },
|
6
6
|
{ "patterns": ["/recede_historical_location"], "properties": { "presentation": "pop" } },
|
7
7
|
{ "patterns": ["/resume_historical_location"], "properties": { "presentation": "none" } },
|
8
|
-
{ "patterns": ["^/$"], "properties": { "uri": "turbo://fragment/web/home", "presentation": "replace_all" } },
|
9
|
-
{ "patterns": ["/new$", "/edit$"
|
8
|
+
{ "patterns": ["^/$", "/signin$"], "properties": { "uri": "turbo://fragment/web/home", "presentation": "replace_all" } },
|
9
|
+
{ "patterns": ["/new$", "/edit$"], "properties": { "context": "modal", "uri": "turbo://fragment/web/modal" } },
|
10
10
|
{ "patterns": ["/numbers$"], "properties": { "uri": "turbo://fragment/numbers", "title": "Numbers" } }
|
11
11
|
]
|
12
12
|
}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
package <%= package_name %>.features.web
|
2
2
|
|
3
|
+
import android.view.View
|
3
4
|
import <%= package_name %>.base.NavDestination
|
4
5
|
import dev.hotwire.turbo.fragments.TurboWebFragment
|
5
6
|
import dev.hotwire.turbo.nav.TurboNavGraphDestination
|
7
|
+
import <%= package_name %>.R
|
6
8
|
|
7
9
|
@TurboNavGraphDestination(uri = "turbo://fragment/web")
|
8
10
|
open class WebFragment : TurboWebFragment(), NavDestination {
|
@@ -4,8 +4,8 @@
|
|
4
4
|
{ "patterns": ["/refresh_historical_location"], "properties": { "presentation": "refresh", "visitable": false } },
|
5
5
|
{ "patterns": ["/recede_historical_location"], "properties": { "presentation": "pop", "visitable": false } },
|
6
6
|
{ "patterns": ["/resume_historical_location"], "properties": { "presentation": "none", "visitable": false } },
|
7
|
-
{ "patterns": ["^/$"], "properties": { "presentation": "replace-all" } },
|
8
|
-
{ "patterns": ["/new$", "/edit$"
|
7
|
+
{ "patterns": ["^/$", "/signin$"], "properties": { "presentation": "replace-all" } },
|
8
|
+
{ "patterns": ["/new$", "/edit$"], "properties": { "presentation": "modal" } },
|
9
9
|
{ "patterns": ["/numbers$"], "properties": { "view-controller": "numbers" } }
|
10
10
|
]
|
11
11
|
}
|
@@ -38,10 +38,6 @@ extension TurboNavigationController {
|
|
38
38
|
return properties["presentation"] as? String == "modal"
|
39
39
|
}
|
40
40
|
|
41
|
-
private func isClearAll(_ properties: PathProperties) -> Bool {
|
42
|
-
return properties["presentation"] as? String == "clear-all"
|
43
|
-
}
|
44
|
-
|
45
41
|
private func isPop(_ properties: PathProperties) -> Bool {
|
46
42
|
return properties["presentation"] as? String == "pop"
|
47
43
|
}
|
@@ -54,6 +50,10 @@ extension TurboNavigationController {
|
|
54
50
|
return properties["presentation"] as? String == "none"
|
55
51
|
}
|
56
52
|
|
53
|
+
private func isClearAll(_ properties: PathProperties) -> Bool {
|
54
|
+
return properties["presentation"] as? String == "clear-all"
|
55
|
+
}
|
56
|
+
|
57
57
|
private func isReplaceAll(_ properties: PathProperties) -> Bool {
|
58
58
|
return properties["presentation"] as? String == "replace-all"
|
59
59
|
}
|
@@ -5,16 +5,18 @@ final class ViewController: VisitableViewController, ErrorPresenter {
|
|
5
5
|
override func viewDidLoad() {
|
6
6
|
super.viewDidLoad()
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
navigationItem.backButtonDisplayMode = .minimal
|
8
|
+
navigationItem.backButtonTitle = "Back"
|
11
9
|
|
12
10
|
if presentingViewController != nil {
|
13
|
-
navigationItem.leftBarButtonItem =
|
11
|
+
navigationItem.leftBarButtonItem = dismissModalButton
|
14
12
|
}
|
15
13
|
}
|
16
14
|
|
17
|
-
|
15
|
+
private lazy var dismissModalButton = {
|
16
|
+
UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
|
17
|
+
}()
|
18
|
+
|
19
|
+
@objc private func dismissModal() {
|
18
20
|
dismiss(animated: true)
|
19
21
|
}
|
20
22
|
}
|
@@ -38,10 +38,6 @@ extension TurboNavigationController {
|
|
38
38
|
return properties["presentation"] as? String == "modal"
|
39
39
|
}
|
40
40
|
|
41
|
-
private func isClearAll(_ properties: PathProperties) -> Bool {
|
42
|
-
return properties["presentation"] as? String == "clear-all"
|
43
|
-
}
|
44
|
-
|
45
41
|
private func isPop(_ properties: PathProperties) -> Bool {
|
46
42
|
return properties["presentation"] as? String == "pop"
|
47
43
|
}
|
@@ -54,6 +50,10 @@ extension TurboNavigationController {
|
|
54
50
|
return properties["presentation"] as? String == "none"
|
55
51
|
}
|
56
52
|
|
53
|
+
private func isClearAll(_ properties: PathProperties) -> Bool {
|
54
|
+
return properties["presentation"] as? String == "clear-all"
|
55
|
+
}
|
56
|
+
|
57
57
|
private func isReplaceAll(_ properties: PathProperties) -> Bool {
|
58
58
|
return properties["presentation"] as? String == "replace-all"
|
59
59
|
}
|
@@ -5,16 +5,18 @@ final class ViewController: VisitableViewController, ErrorPresenter {
|
|
5
5
|
override func viewDidLoad() {
|
6
6
|
super.viewDidLoad()
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
navigationItem.backButtonDisplayMode = .minimal
|
8
|
+
navigationItem.backButtonTitle = "Back"
|
11
9
|
|
12
10
|
if presentingViewController != nil {
|
13
|
-
navigationItem.leftBarButtonItem =
|
11
|
+
navigationItem.leftBarButtonItem = dismissModalButton
|
14
12
|
}
|
15
13
|
}
|
16
14
|
|
17
|
-
|
15
|
+
private lazy var dismissModalButton = {
|
16
|
+
UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
|
17
|
+
}()
|
18
|
+
|
19
|
+
@objc private func dismissModal() {
|
18
20
|
dismiss(animated: true)
|
19
21
|
}
|
20
22
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbo-native-initializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|