@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.
- package/.claude/settings.local.json +9 -1
- package/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/gradle.properties +1 -1
- package/ios/Application/Navigation/Navigator.swift +42 -15
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +14 -2
- package/package.json +1 -1
|
@@ -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
|
}
|
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
package/gradle.properties
CHANGED
|
@@ -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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
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) })
|
package/ios/native-kits.podspec
CHANGED
|
@@ -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
|
-
//
|
|
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(
|