@momo-kits/native-kits 0.163.1-sp.6-debug → 0.163.1-sp.7-debug

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.
@@ -139,7 +139,15 @@
139
139
  "Bash(sips -c 1900 904 --cropOffset 106 506 full.png --out crop.png)",
140
140
  "Bash(swiftc -O mouse.swift -o mouse)",
141
141
  "Bash(./mouse click *)",
142
- "Bash(./mouse drag *)"
142
+ "Bash(./mouse drag *)",
143
+ "Bash(sips -c 900 924 --cropOffset 0 0 s12.png --out s12crop.png)",
144
+ "Bash(sips -c 300 1170 --cropOffset 300 0 s12.png --out s12top.png)",
145
+ "Bash(sips -c 700 1170 --cropOffset 250 0 t1.png --out t1c.png)",
146
+ "Bash(sips -c 700 1170 --cropOffset 250 0 t2.png --out t2c.png)",
147
+ "Bash(sips -c 700 1170 --cropOffset 150 0 t3.png --out t3c.png)",
148
+ "Bash(sips -c 1200 1170 --cropOffset 600 0 t4.png --out t4c.png)",
149
+ "Bash(sips -c 600 1170 --cropOffset 150 0 t5.png --out t5c.png)",
150
+ "Bash(sips -c 500 1170 --cropOffset 150 0 u1.png --out u1c.png)"
143
151
  ]
144
152
  }
145
153
  }
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.163.1-sp.6-debug"
43
+ version = "0.163.1-sp.7-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |spec|
2
2
  spec.name = 'compose'
3
- spec.version = '0.163.1-sp.6-debug'
3
+ spec.version = '0.163.1-sp.7-debug'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.163.1-sp.6
21
+ version=0.163.1-sp.7
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
@@ -194,23 +194,46 @@ public final class Navigator: ObservableObject {
194
194
  }
195
195
 
196
196
  public func pop(_ count: Int = 1, callback: (() -> Void)? = nil) {
197
- var remaining = count
198
- while remaining > 0 {
199
- if overplay?.type == .snackBar {
200
- // Mirrors Kotlin: a snackbar doesn't block back-navigation, so popping
201
- // while one is showing pops the screen underneath and clears the
202
- // snackbar immediately, without playing its dismiss animation.
203
- overplayDismissHandler = nil
204
- overplay = nil
205
- if !popScreen() { break }
206
- } else if overplay != nil {
207
- hideOverplay()
208
- } else if !popScreen() {
209
- break
197
+ popStep(remaining: count, callback: callback)
198
+ }
199
+
200
+ /// One `pop` iteration. Compose runs the loop in a coroutine and suspends over the
201
+ /// overplay's exit animation before the next step; the same wait is needed here, or
202
+ /// a `pop(2)` (prevent-back: close the popup, then leave) would spend both steps on
203
+ /// the overplay that is still animating out and never pop the screen.
204
+ private func popStep(remaining: Int, callback: (() -> Void)?) {
205
+ guard remaining > 0 else {
206
+ callback?()
207
+ return
208
+ }
209
+
210
+ if overplay?.type == .snackBar {
211
+ // Mirrors Kotlin: a snackbar doesn't block back-navigation, so popping
212
+ // while one is showing pops the screen underneath and clears the
213
+ // snackbar immediately, without playing its dismiss animation.
214
+ overplayDismissHandler = nil
215
+ overplay = nil
216
+ guard popScreen() else {
217
+ callback?()
218
+ return
219
+ }
220
+ popStep(remaining: remaining - 1, callback: callback)
221
+ } else if overplay != nil {
222
+ hideOverplay()
223
+ DispatchQueue.main.asyncAfter(deadline: .now() + Self.overplayDismissDelay) { [weak self] in
224
+ guard let self else { return }
225
+ // The component reports back through `finishOverplayDismiss` once its exit
226
+ // animation ends; clear it here if it never did, so the step is not wasted.
227
+ if self.overplay != nil { self.finishOverplayDismiss() }
228
+ self.popStep(remaining: remaining - 1, callback: callback)
210
229
  }
211
- remaining -= 1
230
+ } else {
231
+ guard popScreen() else {
232
+ callback?()
233
+ return
234
+ }
235
+ popStep(remaining: remaining - 1, callback: callback)
212
236
  }
213
- callback?()
214
237
  }
215
238
 
216
239
  /// Pops the topmost presented screen or stack entry. Returns `false` (and requests
@@ -432,6 +455,10 @@ public final class Navigator: ObservableObject {
432
455
  /// with headroom for the slower interactive swipe.
433
456
  private static let screenDisposeDelay: TimeInterval = 0.35
434
457
 
458
+ /// Longest overplay exit animation (the bottom sheet's), so a queued pop step runs
459
+ /// after the component has taken itself down.
460
+ private static let overplayDismissDelay: TimeInterval = 0.3
461
+
435
462
  private func disposeScreens(droppedFrom previous: [DynamicScreenRoute]) {
436
463
  let live = Set(path.map(\.id))
437
464
  disposeScreens(previous.map(\.id).filter { !live.contains($0) })
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.163.1-sp.6'
3
+ s.version = '0.163.1-sp.7'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.163.1-sp.6'
3
+ s.version = '0.163.1-sp.7'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -101,9 +101,21 @@ private struct NavigationDemoContent: View {
101
101
 
102
102
  Divider().padding(.vertical, 4)
103
103
 
104
+ row("Custom Back Handler") {
105
+ // The screen owns back: the header button and the edge swipe both
106
+ // run this instead of popping (mirrors Compose's onBackHandler).
107
+ navigator.push(
108
+ { DemoLeafScreen(title: "Back is intercepted — swipe from the edge", color: Colors.blue09) },
109
+ options: NavigationOptions(
110
+ title: "Custom Back",
111
+ onBackHandler: { print("back intercepted") }
112
+ )
113
+ )
114
+ }
115
+
104
116
  row("Prevent Back") {
105
- // Tapping the header back button shows a confirm popup before
106
- // leaving (mirrors Compose's headerBackProps.preventBack).
117
+ // The header back button and the edge swipe both show a confirm popup
118
+ // before leaving (mirrors Compose's headerBackProps.preventBack).
107
119
  navigator.push(
108
120
  { DemoLeafScreen(title: "Tap the header back button", color: Colors.pink09) },
109
121
  options: NavigationOptions(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.163.1-sp.6-debug",
3
+ "version": "0.163.1-sp.7-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},