turbo-native-initializer 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 518999c4b582f3e174bc3b7f631e3bd51e148349a92693af74a2a9e87dc4851b
4
- data.tar.gz: a9ee896086b2836902c30a725c278c995057db62c96fb232f013e9a978413f5a
3
+ metadata.gz: 52ff35d610a3d846038f5e159c46a04fe6c9426d4975b09654c2a55744b9ae9d
4
+ data.tar.gz: 4646660e51e7e5e6b0721a19f9b74506305a5f119c2d3afe29310991f82fc7e6
5
5
  SHA512:
6
- metadata.gz: cbedfe1b08f53271dd0c5f803654f609320d887f5935a3ab788c4137c738f50f9ac48396fade5be9fbd440e0fc22da62da170bced13e193790c7f5fd3ca1e84f
7
- data.tar.gz: f564171bcc1ca3776e64e752dedf629ddca463a937288eb114beb4331399c54b3f74b1cd02924c89c8eef01780cc0ae1e7cb4f9c40b02d5b8f9ad0dc1735aa7b
6
+ metadata.gz: 5c147b87af14885a7561e407875cbf2b417cd5368409c0ee5e48b1a200c058500e565bd373e922f0e548fa5c27d9923fed2fd93353ea4cb3ac7478f28a38cb3b
7
+ data.tar.gz: b654caa260551c993b93fbb31d52e68ba38e2ae8959c55f6205df49972bf0db81e87482724f5f0fac10e84b0c5c90edc1eb47c4e1bb71b43feb6ea6280a7ec3b
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.0.8] - 2023-09-11
3
+ ## [0.0.10] - 2023-09-12
4
+
5
+ - Replace navigation when going to the same url (iOS)
6
+ - Better looking dismiss modal button (iOS)
7
+ - Disable link previews (iOS)
8
+
9
+ ## [0.0.9] - 2023-09-11
4
10
 
5
11
  - Fix retry button in modals (iOS)
6
12
 
@@ -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": ["^/$", "/signin$"], "properties": { "uri": "turbo://fragment/web/home", "presentation": "replace_all" } },
9
- { "patterns": ["/new$", "/edit$"], "properties": { "context": "modal", "uri": "turbo://fragment/web/modal" } },
8
+ { "patterns": ["^/$"], "properties": { "uri": "turbo://fragment/web/home", "presentation": "replace_all" } },
9
+ { "patterns": ["/new$", "/edit$", "/signin$"], "properties": { "context": "modal", "uri": "turbo://fragment/web/modal" } },
10
10
  { "patterns": ["/numbers$"], "properties": { "uri": "turbo://fragment/numbers", "title": "Numbers" } }
11
11
  ]
12
12
  }
@@ -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": ["^/$", "/signin$"], "properties": { "presentation": "replace-all" } },
8
- { "patterns": ["/new$", "/edit$"], "properties": { "presentation": "modal" } },
7
+ { "patterns": ["^/$"], "properties": { "presentation": "replace-all" } },
8
+ { "patterns": ["/new$", "/edit$", "/signin$"], "properties": { "presentation": "modal" } },
9
9
  { "patterns": ["/numbers$"], "properties": { "view-controller": "numbers" } }
10
10
  ]
11
11
  }
@@ -22,9 +22,14 @@ class TurboNavigationController : UINavigationController {
22
22
  }
23
23
 
24
24
  // - Create view controller appropriate for url/properties
25
- // - Navigate to that with the correct presentation
26
25
  let viewController = makeViewController(for: url, properties: properties)
27
- navigate(to: viewController, action: options.action, properties: properties)
26
+
27
+ // - Navigate to that with the correct presentation
28
+ if session.activeVisitable?.visitableURL != url {
29
+ navigate(to: viewController, action: options.action, properties: properties)
30
+ } else {
31
+ navigate(to: viewController, action: .replace, properties: properties)
32
+ }
28
33
 
29
34
  // Initiate the visit with Turbo
30
35
  if isVisitable(properties) {
@@ -13,7 +13,7 @@ final class ViewController: VisitableViewController, ErrorPresenter {
13
13
  }
14
14
 
15
15
  private lazy var dismissModalButton = {
16
- UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
16
+ UIBarButtonItem(image: UIImage(systemName: "chevron.down"), style: .plain, target: self, action: #selector(dismissModal))
17
17
  }()
18
18
 
19
19
  @objc private func dismissModal() {
@@ -40,6 +40,7 @@ final class SceneDelegate: UIResponder {
40
40
 
41
41
  let webView = WKWebView(frame: .zero, configuration: configuration)
42
42
  webView.uiDelegate = self
43
+ webView.allowsLinkPreview = false
43
44
 
44
45
  let session = Session(webView: webView)
45
46
  session.delegate = self
@@ -24,7 +24,13 @@ class TurboNavigationController : UINavigationController {
24
24
  // - Create view controller appropriate for url/properties
25
25
  // - Navigate to that with the correct presentation
26
26
  let viewController = makeViewController(for: url, properties: properties)
27
- navigate(to: viewController, action: options.action, properties: properties)
27
+
28
+ // - Navigate to that with the correct presentation
29
+ if session.activeVisitable?.visitableURL != url {
30
+ navigate(to: viewController, action: options.action, properties: properties)
31
+ } else {
32
+ navigate(to: viewController, action: .replace, properties: properties)
33
+ }
28
34
 
29
35
  // Initiate the visit with Turbo
30
36
  if isVisitable(properties) {
@@ -13,7 +13,7 @@ final class ViewController: VisitableViewController, ErrorPresenter {
13
13
  }
14
14
 
15
15
  private lazy var dismissModalButton = {
16
- UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
16
+ UIBarButtonItem(image: UIImage(systemName: "chevron.down"), style: .plain, target: self, action: #selector(dismissModal))
17
17
  }()
18
18
 
19
19
  @objc private func dismissModal() {
@@ -54,6 +54,7 @@ final class SceneDelegate: UIResponder {
54
54
 
55
55
  let webView = WKWebView(frame: .zero, configuration: configuration)
56
56
  webView.uiDelegate = self
57
+ webView.allowsLinkPreview = false
57
58
 
58
59
  let session = Session(webView: webView)
59
60
  session.delegate = self
@@ -1,3 +1,3 @@
1
1
  module TurboNativeInitializer
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.10"
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.8
4
+ version: 0.0.10
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-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor