@momo-kits/native-kits 0.164.1-trustsans-12-debug → 0.165.1-beta.10-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.
Files changed (31) hide show
  1. package/.codegraph/codegraph.db +0 -0
  2. package/.codegraph/daemon.log +100 -0
  3. package/CLAUDE.md +1 -0
  4. package/compose/build.gradle.kts +1 -1
  5. package/compose/compose.podspec +1 -1
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
  7. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +18 -0
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +30 -4
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +104 -22
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +3 -9
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +8 -4
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +2 -1
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +3 -0
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +66 -31
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +22 -1
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +25 -5
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +148 -0
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +35 -0
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +19 -0
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +13 -2
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +75 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
  24. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +98 -0
  25. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
  26. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +13 -3
  27. package/gradle.properties +1 -1
  28. package/ios/native-kits.podspec +1 -1
  29. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  30. package/package.json +1 -1
  31. package/.codegraph/.gitignore +0 -5
@@ -0,0 +1,38 @@
1
+ package vn.momo.kits.platform
2
+
3
+ import androidx.compose.runtime.Composable
4
+ import androidx.compose.runtime.LaunchedEffect
5
+ import androidx.compose.runtime.State
6
+ import androidx.compose.runtime.mutableStateOf
7
+ import androidx.compose.runtime.remember
8
+ import androidx.compose.ui.InternalComposeUiApi
9
+ import androidx.compose.ui.backhandler.LocalCompatNavigationEventDispatcherOwner
10
+ import androidx.navigationevent.NavigationEventTransitionState
11
+ import vn.momo.kits.navigation.HostBackGestureBridge
12
+
13
+ // transitionState is a passive observer; its progress is touch.x / view width.
14
+ @OptIn(InternalComposeUiApi::class)
15
+ @Composable
16
+ actual fun rememberBackGestureProgress(): State<Float?> {
17
+ val dispatcher = LocalCompatNavigationEventDispatcherOwner.current?.navigationEventDispatcher
18
+ val progress = remember { mutableStateOf<Float?>(null) }
19
+
20
+ LaunchedEffect(dispatcher) {
21
+ if (dispatcher == null) {
22
+ progress.value = null
23
+ return@LaunchedEffect
24
+ }
25
+ dispatcher.transitionState.collect { state ->
26
+ progress.value = (state as? NavigationEventTransitionState.InProgress)
27
+ ?.takeIf { it.direction == NavigationEventTransitionState.TRANSITIONING_BACK }
28
+ ?.latestEvent
29
+ ?.progress
30
+ }
31
+ }
32
+
33
+ return progress
34
+ }
35
+
36
+ actual fun reportFloatingArrowBack(shouldUse: Boolean) {
37
+ HostBackGestureBridge.shouldUseFloatingArrowBack = shouldUse
38
+ }
@@ -17,6 +17,7 @@ import androidx.compose.ui.ExperimentalComposeUiApi
17
17
  import androidx.compose.ui.InternalComposeUiApi
18
18
  import androidx.compose.ui.Modifier
19
19
  import androidx.compose.ui.backhandler.LocalCompatNavigationEventDispatcherOwner
20
+ import androidx.compose.ui.backhandler.BackHandler as ComposeBackHandler
20
21
  import androidx.compose.ui.graphics.Color
21
22
  import androidx.compose.ui.graphics.NativePaint
22
23
  import androidx.compose.ui.graphics.toArgb
@@ -38,6 +39,7 @@ import platform.Foundation.NSBundle
38
39
  import platform.UIKit.UIColor
39
40
  import platform.UIKit.UIDevice
40
41
  import platform.UIKit.UIScreen
42
+ import vn.momo.kits.navigation.AttachHostBackGesture
41
43
 
42
44
  actual fun getPlatformName(): String = "iOS"
43
45
 
@@ -60,21 +62,29 @@ actual fun getStatusBarHeight(): Dp {
60
62
  return WindowInsets.systemBars.asPaddingValues().calculateTopPadding()
61
63
  }
62
64
 
65
+ // Registered inside the NavHost destination, so an enabled one out-ranks NavHost's own
66
+ // predictive-back handler — that is how a screen opts out of swipe-back.
67
+ @Suppress("DEPRECATION")
68
+ @OptIn(ExperimentalComposeUiApi::class)
63
69
  @Composable
64
70
  actual fun BackHandler(enabled: Boolean, onBack: () -> Unit) {
71
+ ComposeBackHandler(enabled = enabled, onBack = onBack)
65
72
  }
66
73
 
67
74
  @OptIn(InternalComposeUiApi::class)
68
75
  @Composable
69
76
  actual fun ProvideNavigationEventDispatcherOwner(content: @Composable () -> Unit) {
77
+ // Detached on purpose: the scene's owner would arm Compose's own recogniser alongside the
78
+ // host's, and UIKit resolves that by driving one to .failed — a fabricated completed back.
79
+ // Enabled on purpose: dispatchOn* early-returns while disabled, muting the host-driven seek.
70
80
  val navigationEventDispatcherOwner = remember {
71
81
  object : NavigationEventDispatcherOwner {
72
- override val navigationEventDispatcher = NavigationEventDispatcher().apply {
73
- isEnabled = false
74
- }
82
+ override val navigationEventDispatcher = NavigationEventDispatcher()
75
83
  }
76
84
  }
77
85
 
86
+ AttachHostBackGesture(navigationEventDispatcherOwner.navigationEventDispatcher)
87
+
78
88
  CompositionLocalProvider(
79
89
  LocalCompatNavigationEventDispatcherOwner provides navigationEventDispatcherOwner,
80
90
  content = content
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.164.1-trustsans-12
21
+ version=0.165.1-beta.10
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.164.1-trustsans-9'
3
+ s.version = '0.165.1-beta.10'
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.164.1-trustsans-9'
3
+ s.version = '0.165.1-beta.10'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.164.1-trustsans-12-debug",
3
+ "version": "0.165.1-beta.10-debug",
4
4
  "private": false,
5
5
  "dependeNavigationncies": {},
6
6
  "devDependencies": {},
@@ -1,5 +0,0 @@
1
- # CodeGraph data files — local to each machine, not for committing.
2
- # Ignore everything in .codegraph/ except this file itself, so transient
3
- # files (the database, daemon.pid, sockets, logs) never show up in git.
4
- *
5
- !.gitignore