turbo-native-initializer 0.0.9 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +3 -1
  4. data/lib/turbo_native_initializer/generator.rb +1 -0
  5. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/base/NavDestination.kt.tt +17 -2
  6. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebFragment.kt.tt +38 -0
  7. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebModalFragment.kt.tt +2 -2
  8. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainActivity.kt.tt +7 -0
  9. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainSessionNavHostFragment.kt.tt +5 -5
  10. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/BridgeComponentFactories.kt.tt +9 -0
  11. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/FlashMessageComponent.kt.tt +41 -0
  12. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/FormComponent.kt.tt +87 -0
  13. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/NavButtonComponent.kt.tt +70 -0
  14. data/lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/util/Extension.kt.tt +19 -0
  15. data/lib/turbo_native_initializer/templates/android_stack/base/app/build.gradle.kts.tt +9 -3
  16. data/lib/turbo_native_initializer/templates/android_stack/base/app/src/main/assets/json/configuration.json +1 -1
  17. data/lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/form_component_submit.xml +12 -0
  18. data/lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/nav_button_component.xml +14 -0
  19. data/lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/values/colors.xml +1 -1
  20. data/lib/turbo_native_initializer/templates/android_stack/base/build.gradle.kts +2 -1
  21. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/base/NavDestination.kt.tt +17 -2
  22. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebFragment.kt.tt +38 -0
  23. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebModalFragment.kt.tt +2 -2
  24. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/BaseSessionNavHostFragment.kt.tt +5 -5
  25. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainActivity.kt.tt +4 -0
  26. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/BridgeComponentFactories.kt.tt +9 -0
  27. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/FlashMessageComponent.kt.tt +41 -0
  28. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/FormComponent.kt.tt +87 -0
  29. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/NavButtonComponent.kt.tt +70 -0
  30. data/lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/util/Extension.kt.tt +19 -0
  31. data/lib/turbo_native_initializer/templates/android_tabs/base/app/build.gradle.kts.tt +9 -3
  32. data/lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/assets/json/configuration.json +1 -1
  33. data/lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/form_component_submit.xml +12 -0
  34. data/lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/nav_button_component.xml +14 -0
  35. data/lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/values/colors.xml +1 -1
  36. data/lib/turbo_native_initializer/templates/android_tabs/base/build.gradle.kts +2 -1
  37. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Configuration/path-configuration.json +1 -1
  38. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/TurboNavigationController.swift +10 -1
  39. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/TurboWebViewController.swift +65 -0
  40. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/UIViewController+Toast.swift +59 -0
  41. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/WKWebViewConfiguration+App.swift +21 -0
  42. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Delegates/SceneDelegate.swift.tt +5 -5
  43. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/AccentColor.colorset/Contents.json +8 -8
  44. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Base.lproj/{Main.storyboard.tt → Main.storyboard} +1 -1
  45. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Strada/BridgeComponent+App.swift +8 -0
  46. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Strada/FlashMessageComponent.swift +47 -0
  47. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Strada/FormComponent.swift +78 -0
  48. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Strada/NavButtonComponent.swift +60 -0
  49. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject.xcodeproj/project.pbxproj.tt +55 -6
  50. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +9 -0
  51. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Configuration/path-configuration.json +1 -1
  52. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/TurboNavigationController.swift +10 -1
  53. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/TurboWebViewController.swift +65 -0
  54. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/UIViewController+Toast.swift +59 -0
  55. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/WKWebViewConfiguration+App.swift +21 -0
  56. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Delegates/SceneDelegate.swift.tt +5 -5
  57. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/AccentColor.colorset/Contents.json +8 -8
  58. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Base.lproj/Main.storyboard +2 -2
  59. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Strada/BridgeComponent+App.swift +8 -0
  60. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Strada/FlashMessageComponent.swift +47 -0
  61. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Strada/FormComponent.swift +78 -0
  62. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Strada/NavButtonComponent.swift +60 -0
  63. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject.xcodeproj/project.pbxproj.tt +55 -6
  64. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +9 -0
  65. data/lib/turbo_native_initializer/version.rb +1 -1
  66. metadata +32 -6
  67. data/lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/ViewController.swift +0 -22
  68. data/lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/ViewController.swift +0 -22
@@ -0,0 +1,47 @@
1
+ import Foundation
2
+ import Strada
3
+ import UIKit
4
+
5
+ final class FlashMessageComponent: BridgeComponent {
6
+ override class var name: String { "flash-message" }
7
+
8
+ override func onReceive(message: Message) {
9
+ guard let event = Event(rawValue: message.event) else {
10
+ return
11
+ }
12
+
13
+ if event == .connect {
14
+ handleConnectEvent(message: message)
15
+ }
16
+ }
17
+
18
+ @objc func performAction() {
19
+ reply(to: Event.connect.rawValue)
20
+ }
21
+
22
+ // MARK: Private
23
+
24
+ private var viewController: UIViewController? {
25
+ delegate.destination as? UIViewController
26
+ }
27
+
28
+ private func handleConnectEvent(message: Message) {
29
+ guard let data: MessageData = message.data() else { return }
30
+ guard let viewController else { return }
31
+ viewController.parent?.presentToast(data.title)
32
+ }
33
+ }
34
+
35
+ // MARK: Events
36
+
37
+ private extension FlashMessageComponent {
38
+ enum Event: String { case connect }
39
+ }
40
+
41
+ // MARK: Message data
42
+
43
+ private extension FlashMessageComponent {
44
+ struct MessageData: Decodable {
45
+ let title: String
46
+ }
47
+ }
@@ -0,0 +1,78 @@
1
+ import Foundation
2
+ import Strada
3
+ import UIKit
4
+
5
+ final class FormComponent: BridgeComponent {
6
+ override class var name: String { "form" }
7
+
8
+ override func onReceive(message: Message) {
9
+ guard let event = Event(rawValue: message.event) else {
10
+ return
11
+ }
12
+
13
+ switch event {
14
+ case .connect:
15
+ handleConnectEvent(message: message)
16
+ case .submitEnabled:
17
+ handleSubmitEnabled()
18
+ case .submitDisabled:
19
+ handleSubmitDisabled()
20
+ }
21
+ }
22
+
23
+ @objc func performAction() {
24
+ reply(to: Event.connect.rawValue)
25
+ }
26
+
27
+ // MARK: Private
28
+
29
+ private weak var submitBarButtonItem: UIBarButtonItem?
30
+
31
+ private var viewController: UIViewController? {
32
+ delegate.destination as? UIViewController
33
+ }
34
+
35
+ private func handleConnectEvent(message: Message) {
36
+ guard let data: MessageData = message.data() else { return }
37
+ configureBarButton(with: data.title)
38
+ }
39
+
40
+ private func handleSubmitEnabled() {
41
+ submitBarButtonItem?.isEnabled = true
42
+ }
43
+
44
+ private func handleSubmitDisabled() {
45
+ submitBarButtonItem?.isEnabled = false
46
+ }
47
+
48
+ private func configureBarButton(with title: String) {
49
+ guard let viewController else { return }
50
+
51
+ let button = UIButton(configuration: .filled())
52
+ button.setTitle(title, for: .normal)
53
+ button.addTarget(self, action: #selector(performAction), for: .touchUpInside)
54
+
55
+ let item = UIBarButtonItem(customView: button)
56
+
57
+ viewController.navigationItem.rightBarButtonItem = item
58
+ submitBarButtonItem = item
59
+ }
60
+ }
61
+
62
+ // MARK: Events
63
+
64
+ private extension FormComponent {
65
+ enum Event: String {
66
+ case connect
67
+ case submitEnabled
68
+ case submitDisabled
69
+ }
70
+ }
71
+
72
+ // MARK: Message data
73
+
74
+ private extension FormComponent {
75
+ struct MessageData: Decodable {
76
+ let title: String
77
+ }
78
+ }
@@ -0,0 +1,60 @@
1
+ import Foundation
2
+ import Strada
3
+ import UIKit
4
+
5
+ final class NavButtonComponent: BridgeComponent {
6
+ override class var name: String { "nav-button" }
7
+
8
+ override func onReceive(message: Message) {
9
+ guard let event = Event(rawValue: message.event) else {
10
+ return
11
+ }
12
+
13
+ if event == .connect {
14
+ handleConnectEvent(message: message)
15
+ }
16
+ }
17
+
18
+ @objc func performAction() {
19
+ reply(to: Event.connect.rawValue)
20
+ }
21
+
22
+ // MARK: Private
23
+
24
+ private weak var navBarButtonItem: UIBarButtonItem?
25
+
26
+ private var viewController: UIViewController? {
27
+ delegate.destination as? UIViewController
28
+ }
29
+
30
+ private func handleConnectEvent(message: Message) {
31
+ guard let data: MessageData = message.data() else { return }
32
+ configureBarButton(with: data.title)
33
+ }
34
+
35
+ private func configureBarButton(with title: String) {
36
+ guard let viewController else { return }
37
+
38
+ let item = UIBarButtonItem(title: title,
39
+ style: .plain,
40
+ target: self,
41
+ action: #selector(performAction))
42
+
43
+ viewController.navigationItem.rightBarButtonItem = item
44
+ navBarButtonItem = item
45
+ }
46
+ }
47
+
48
+ // MARK: Events
49
+
50
+ private extension NavButtonComponent {
51
+ enum Event: String { case connect }
52
+ }
53
+
54
+ // MARK: Message data
55
+
56
+ private extension NavButtonComponent {
57
+ struct MessageData: Decodable {
58
+ let title: String
59
+ }
60
+ }
@@ -7,10 +7,17 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
+ 5D0735D42AC514F800AC547A /* UIViewController+Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D0735D32AC514F800AC547A /* UIViewController+Toast.swift */; };
10
11
  5D0D861F2A9AA70500A525E9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D0D86212A9AA70500A525E9 /* Main.storyboard */; };
12
+ 5D1F2EC12ABEB12300B2819A /* NavButtonComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1F2EC02ABEB12300B2819A /* NavButtonComponent.swift */; };
13
+ 5D2381412AC53D8900FABA1F /* FlashMessageComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D2381402AC53D8900FABA1F /* FlashMessageComponent.swift */; };
14
+ 5D8AB2FB2ABC117F00C6A82F /* FormComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D8AB2F92ABC117F00C6A82F /* FormComponent.swift */; };
15
+ 5D8AB2FC2ABC117F00C6A82F /* BridgeComponent+App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D8AB2FA2ABC117F00C6A82F /* BridgeComponent+App.swift */; };
16
+ 5D8AB2FE2ABC119900C6A82F /* WKWebViewConfiguration+App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D8AB2FD2ABC119900C6A82F /* WKWebViewConfiguration+App.swift */; };
17
+ 5D8AB3012ABC127300C6A82F /* Strada in Frameworks */ = {isa = PBXBuildFile; productRef = 5D8AB3002ABC127300C6A82F /* Strada */; };
11
18
  5DCC50D42A959DF900B529A0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC50D32A959DF900B529A0 /* AppDelegate.swift */; };
12
19
  5DCC50D62A959DF900B529A0 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC50D52A959DF900B529A0 /* SceneDelegate.swift */; };
13
- 5DCC50D82A959DF900B529A0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC50D72A959DF900B529A0 /* ViewController.swift */; };
20
+ 5DCC50D82A959DF900B529A0 /* TurboWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC50D72A959DF900B529A0 /* TurboWebViewController.swift */; };
14
21
  5DCC50DD2A959DFA00B529A0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5DCC50DC2A959DFA00B529A0 /* Assets.xcassets */; };
15
22
  5DCC50E02A959DFA00B529A0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5DCC50DE2A959DFA00B529A0 /* LaunchScreen.storyboard */; };
16
23
  5DCC50E82A95A0D900B529A0 /* TurboNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC50E72A95A0D900B529A0 /* TurboNavigationController.swift */; };
@@ -22,11 +29,17 @@
22
29
  /* End PBXBuildFile section */
23
30
 
24
31
  /* Begin PBXFileReference section */
32
+ 5D0735D32AC514F800AC547A /* UIViewController+Toast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Toast.swift"; sourceTree = "<group>"; };
25
33
  5D0D86202A9AA70500A525E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
34
+ 5D1F2EC02ABEB12300B2819A /* NavButtonComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavButtonComponent.swift; sourceTree = "<group>"; };
35
+ 5D2381402AC53D8900FABA1F /* FlashMessageComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashMessageComponent.swift; sourceTree = "<group>"; };
36
+ 5D8AB2F92ABC117F00C6A82F /* FormComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormComponent.swift; sourceTree = "<group>"; };
37
+ 5D8AB2FA2ABC117F00C6A82F /* BridgeComponent+App.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BridgeComponent+App.swift"; sourceTree = "<group>"; };
38
+ 5D8AB2FD2ABC119900C6A82F /* WKWebViewConfiguration+App.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "WKWebViewConfiguration+App.swift"; sourceTree = "<group>"; };
26
39
  5DCC50D02A959DF900B529A0 /* <%= name %>.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = <%= name %>.app; sourceTree = BUILT_PRODUCTS_DIR; };
27
40
  5DCC50D32A959DF900B529A0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
28
41
  5DCC50D52A959DF900B529A0 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
29
- 5DCC50D72A959DF900B529A0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
42
+ 5DCC50D72A959DF900B529A0 /* TurboWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TurboWebViewController.swift; sourceTree = "<group>"; };
30
43
  5DCC50DC2A959DFA00B529A0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
31
44
  5DCC50DF2A959DFA00B529A0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
32
45
  5DCC50E12A959DFA00B529A0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -43,6 +56,7 @@
43
56
  buildActionMask = 2147483647;
44
57
  files = (
45
58
  5DCC50F12A95A66700B529A0 /* Turbo in Frameworks */,
59
+ 5D8AB3012ABC127300C6A82F /* Strada in Frameworks */,
46
60
  );
47
61
  runOnlyForDeploymentPostprocessing = 0;
48
62
  };
@@ -58,6 +72,17 @@
58
72
  path = Configuration;
59
73
  sourceTree = "<group>";
60
74
  };
75
+ 5D8AB2F82ABC117400C6A82F /* Strada */ = {
76
+ isa = PBXGroup;
77
+ children = (
78
+ 5D8AB2FA2ABC117F00C6A82F /* BridgeComponent+App.swift */,
79
+ 5D8AB2F92ABC117F00C6A82F /* FormComponent.swift */,
80
+ 5D1F2EC02ABEB12300B2819A /* NavButtonComponent.swift */,
81
+ 5D2381402AC53D8900FABA1F /* FlashMessageComponent.swift */,
82
+ );
83
+ path = Strada;
84
+ sourceTree = "<group>";
85
+ };
61
86
  5DCC50C72A959DF800B529A0 = {
62
87
  isa = PBXGroup;
63
88
  children = (
@@ -77,6 +102,7 @@
77
102
  5DCC50D22A959DF900B529A0 /* <%= name %> */ = {
78
103
  isa = PBXGroup;
79
104
  children = (
105
+ 5D8AB2F82ABC117400C6A82F /* Strada */,
80
106
  5D2FA5CD2A9DB1AB001AF2F1 /* Configuration */,
81
107
  5DCC50F42A95AC4E00B529A0 /* Controllers */,
82
108
  5DCC50FB2A95B55200B529A0 /* Delegates */,
@@ -89,9 +115,11 @@
89
115
  5DCC50F42A95AC4E00B529A0 /* Controllers */ = {
90
116
  isa = PBXGroup;
91
117
  children = (
118
+ 5D8AB2FD2ABC119900C6A82F /* WKWebViewConfiguration+App.swift */,
119
+ 5D0735D32AC514F800AC547A /* UIViewController+Toast.swift */,
92
120
  5DCC50ED2A95A27600B529A0 /* ErrorPresenter.swift */,
93
121
  5DCC50E72A95A0D900B529A0 /* TurboNavigationController.swift */,
94
- 5DCC50D72A959DF900B529A0 /* ViewController.swift */,
122
+ 5DCC50D72A959DF900B529A0 /* TurboWebViewController.swift */,
95
123
  5DDD58802AA9A8BE00FAC961 /* NumbersViewController.swift */,
96
124
  );
97
125
  path = Controllers;
@@ -134,6 +162,7 @@
134
162
  name = <%= name %>;
135
163
  packageProductDependencies = (
136
164
  5DCC50F02A95A66700B529A0 /* Turbo */,
165
+ 5D8AB3002ABC127300C6A82F /* Strada */,
137
166
  );
138
167
  productName = <%= name %>;
139
168
  productReference = 5DCC50D02A959DF900B529A0 /* <%= name %>.app */;
@@ -165,6 +194,7 @@
165
194
  mainGroup = 5DCC50C72A959DF800B529A0;
166
195
  packageReferences = (
167
196
  5DCC50EF2A95A66700B529A0 /* XCRemoteSwiftPackageReference "turbo-ios" */,
197
+ 5D8AB2FF2ABC127300C6A82F /* XCRemoteSwiftPackageReference "strada-ios" */,
168
198
  );
169
199
  productRefGroup = 5DCC50D12A959DF900B529A0 /* Products */;
170
200
  projectDirPath = "";
@@ -194,12 +224,18 @@
194
224
  isa = PBXSourcesBuildPhase;
195
225
  buildActionMask = 2147483647;
196
226
  files = (
197
- 5DCC50D82A959DF900B529A0 /* ViewController.swift in Sources */,
227
+ 5DCC50D82A959DF900B529A0 /* TurboWebViewController.swift in Sources */,
198
228
  5DDD58812AA9A8BE00FAC961 /* NumbersViewController.swift in Sources */,
229
+ 5D2381412AC53D8900FABA1F /* FlashMessageComponent.swift in Sources */,
230
+ 5D1F2EC12ABEB12300B2819A /* NavButtonComponent.swift in Sources */,
199
231
  5DCC50D42A959DF900B529A0 /* AppDelegate.swift in Sources */,
200
232
  5DCC50E82A95A0D900B529A0 /* TurboNavigationController.swift in Sources */,
233
+ 5D8AB2FE2ABC119900C6A82F /* WKWebViewConfiguration+App.swift in Sources */,
201
234
  5DCC50D62A959DF900B529A0 /* SceneDelegate.swift in Sources */,
235
+ 5D8AB2FB2ABC117F00C6A82F /* FormComponent.swift in Sources */,
236
+ 5D8AB2FC2ABC117F00C6A82F /* BridgeComponent+App.swift in Sources */,
202
237
  5DCC50F32A95A7E600B529A0 /* <%= name %>.swift in Sources */,
238
+ 5D0735D42AC514F800AC547A /* UIViewController+Toast.swift in Sources */,
203
239
  5DCC50EE2A95A27600B529A0 /* ErrorPresenter.swift in Sources */,
204
240
  );
205
241
  runOnlyForDeploymentPostprocessing = 0;
@@ -418,17 +454,30 @@
418
454
  /* End XCConfigurationList section */
419
455
 
420
456
  /* Begin XCRemoteSwiftPackageReference section */
457
+ 5D8AB2FF2ABC127300C6A82F /* XCRemoteSwiftPackageReference "strada-ios" */ = {
458
+ isa = XCRemoteSwiftPackageReference;
459
+ repositoryURL = "https://github.com/hotwired/strada-ios";
460
+ requirement = {
461
+ kind = exactVersion;
462
+ version = "1.0.0-beta1";
463
+ };
464
+ };
421
465
  5DCC50EF2A95A66700B529A0 /* XCRemoteSwiftPackageReference "turbo-ios" */ = {
422
466
  isa = XCRemoteSwiftPackageReference;
423
467
  repositoryURL = "https://github.com/hotwired/turbo-ios";
424
468
  requirement = {
425
- kind = upToNextMajorVersion;
426
- minimumVersion = 7.0.0;
469
+ kind = exactVersion;
470
+ version = 7.0.0;
427
471
  };
428
472
  };
429
473
  /* End XCRemoteSwiftPackageReference section */
430
474
 
431
475
  /* Begin XCSwiftPackageProductDependency section */
476
+ 5D8AB3002ABC127300C6A82F /* Strada */ = {
477
+ isa = XCSwiftPackageProductDependency;
478
+ package = 5D8AB2FF2ABC127300C6A82F /* XCRemoteSwiftPackageReference "strada-ios" */;
479
+ productName = Strada;
480
+ };
432
481
  5DCC50F02A95A66700B529A0 /* Turbo */ = {
433
482
  isa = XCSwiftPackageProductDependency;
434
483
  package = 5DCC50EF2A95A66700B529A0 /* XCRemoteSwiftPackageReference "turbo-ios" */;
@@ -1,5 +1,14 @@
1
1
  {
2
2
  "pins" : [
3
+ {
4
+ "identity" : "strada-ios",
5
+ "kind" : "remoteSourceControl",
6
+ "location" : "https://github.com/hotwired/strada-ios",
7
+ "state" : {
8
+ "revision" : "d8c1bcf1d9511c03e7beed07c05d29f33f9b6cde",
9
+ "version" : "1.0.0-beta1"
10
+ }
11
+ },
3
12
  {
4
13
  "identity" : "turbo-ios",
5
14
  "kind" : "remoteSourceControl",
@@ -1,3 +1,3 @@
1
1
  module TurboNativeInitializer
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.11"
3
3
  end
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.9
4
+ version: 0.0.11
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 00:00:00.000000000 Z
11
+ date: 2023-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -49,7 +49,12 @@ files:
49
49
  - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebModalFragment.kt.tt
50
50
  - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainActivity.kt.tt
51
51
  - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainSessionNavHostFragment.kt.tt
52
+ - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/BridgeComponentFactories.kt.tt
53
+ - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/FlashMessageComponent.kt.tt
54
+ - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/FormComponent.kt.tt
55
+ - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/NavButtonComponent.kt.tt
52
56
  - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/util/Constants.kt.tt
57
+ - lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/util/Extension.kt.tt
53
58
  - lib/turbo_native_initializer/templates/android_stack/base/app/.gitignore
54
59
  - lib/turbo_native_initializer/templates/android_stack/base/app/build.gradle.kts.tt
55
60
  - lib/turbo_native_initializer/templates/android_stack/base/app/proguard-rules.pro
@@ -65,8 +70,10 @@ files:
65
70
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/drawable/ic_launcher_foreground.xml
66
71
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/activity_main.xml.tt
67
72
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/error_web.xml
73
+ - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/form_component_submit.xml
68
74
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/fragment_native.xml
69
75
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/fragment_web_home.xml
76
+ - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/nav_button_component.xml
70
77
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
71
78
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
72
79
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/mipmap-xhdpi/ic_launcher.png
@@ -95,7 +102,12 @@ files:
95
102
  - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/MainActivity.kt.tt
96
103
  - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/TabOneSessionNavHostFragment.kt.tt
97
104
  - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/main/TabTwoSessionNavHostFragment.kt.tt
105
+ - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/BridgeComponentFactories.kt.tt
106
+ - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/FlashMessageComponent.kt.tt
107
+ - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/FormComponent.kt.tt
108
+ - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/strada/NavButtonComponent.kt.tt
98
109
  - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/util/Constants.kt.tt
110
+ - lib/turbo_native_initializer/templates/android_tabs/app/src/main/java/dev/hotwire/turbo/turbonativeproject/util/Extension.kt.tt
99
111
  - lib/turbo_native_initializer/templates/android_tabs/base/app/.gitignore
100
112
  - lib/turbo_native_initializer/templates/android_tabs/base/app/build.gradle.kts.tt
101
113
  - lib/turbo_native_initializer/templates/android_tabs/base/app/proguard-rules.pro
@@ -113,8 +125,10 @@ files:
113
125
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/drawable/ic_settings.xml
114
126
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/activity_main.xml.tt
115
127
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/error_web.xml
128
+ - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/form_component_submit.xml
116
129
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/fragment_native.xml
117
130
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/fragment_web_home.xml
131
+ - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/nav_button_component.xml
118
132
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/menu/bottom_navigation_menu.xml
119
133
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
120
134
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -143,7 +157,9 @@ files:
143
157
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/ErrorPresenter.swift
144
158
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/NumbersViewController.swift
145
159
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/TurboNavigationController.swift
146
- - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/ViewController.swift
160
+ - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/TurboWebViewController.swift
161
+ - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/UIViewController+Toast.swift
162
+ - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Controllers/WKWebViewConfiguration+App.swift
147
163
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Delegates/AppDelegate.swift
148
164
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Delegates/SceneDelegate.swift.tt
149
165
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/AccentColor.colorset/Contents.json
@@ -153,7 +169,11 @@ files:
153
169
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/SplashIcon.imageset/Contents.json
154
170
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Assets.xcassets/SplashIcon.imageset/turbo.png
155
171
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Base.lproj/LaunchScreen.storyboard
156
- - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Base.lproj/Main.storyboard.tt
172
+ - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Resources/Base.lproj/Main.storyboard
173
+ - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Strada/BridgeComponent+App.swift
174
+ - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Strada/FlashMessageComponent.swift
175
+ - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Strada/FormComponent.swift
176
+ - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/Strada/NavButtonComponent.swift
157
177
  - lib/turbo_native_initializer/templates/ios_stack/TurboNativeProject/TurboNativeProject.swift.tt
158
178
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject.xcodeproj/project.pbxproj.tt
159
179
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -164,7 +184,9 @@ files:
164
184
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/ErrorPresenter.swift
165
185
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/NumbersViewController.swift
166
186
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/TurboNavigationController.swift
167
- - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/ViewController.swift
187
+ - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/TurboWebViewController.swift
188
+ - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/UIViewController+Toast.swift
189
+ - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Controllers/WKWebViewConfiguration+App.swift
168
190
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Delegates/AppDelegate.swift
169
191
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Delegates/SceneDelegate.swift.tt
170
192
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/AccentColor.colorset/Contents.json
@@ -175,6 +197,10 @@ files:
175
197
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Assets.xcassets/SplashIcon.imageset/turbo.png
176
198
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Base.lproj/LaunchScreen.storyboard
177
199
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Resources/Base.lproj/Main.storyboard
200
+ - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Strada/BridgeComponent+App.swift
201
+ - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Strada/FlashMessageComponent.swift
202
+ - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Strada/FormComponent.swift
203
+ - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/Strada/NavButtonComponent.swift
178
204
  - lib/turbo_native_initializer/templates/ios_tabs/TurboNativeProject/TurboNativeProject.swift.tt
179
205
  - lib/turbo_native_initializer/version.rb
180
206
  homepage: https://github.com/lazaronixon/turbo-native-initializer
@@ -199,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
225
  - !ruby/object:Gem::Version
200
226
  version: '0'
201
227
  requirements: []
202
- rubygems_version: 3.4.10
228
+ rubygems_version: 3.4.19
203
229
  signing_key:
204
230
  specification_version: 4
205
231
  summary: A turbo native project generator
@@ -1,22 +0,0 @@
1
- import UIKit
2
- import Turbo
3
-
4
- final class ViewController: VisitableViewController, ErrorPresenter {
5
- override func viewDidLoad() {
6
- super.viewDidLoad()
7
-
8
- navigationItem.backButtonTitle = "Back"
9
-
10
- if presentingViewController != nil {
11
- navigationItem.leftBarButtonItem = dismissModalButton
12
- }
13
- }
14
-
15
- private lazy var dismissModalButton = {
16
- UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
17
- }()
18
-
19
- @objc private func dismissModal() {
20
- dismiss(animated: true)
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- import UIKit
2
- import Turbo
3
-
4
- final class ViewController: VisitableViewController, ErrorPresenter {
5
- override func viewDidLoad() {
6
- super.viewDidLoad()
7
-
8
- navigationItem.backButtonTitle = "Back"
9
-
10
- if presentingViewController != nil {
11
- navigationItem.leftBarButtonItem = dismissModalButton
12
- }
13
- }
14
-
15
- private lazy var dismissModalButton = {
16
- UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
17
- }()
18
-
19
- @objc private func dismissModal() {
20
- dismiss(animated: true)
21
- }
22
- }