@momo-kits/native-kits 0.159.1-beta.12-debug → 0.159.1-beta.14-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/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +4 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +5 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +6 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +1 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +2 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +17 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +4 -7
- package/gradle.properties +1 -1
- package/ios/Typography/Text.swift +1 -1
- package/package.json +1 -1
- package/.claude/settings.local.json +0 -15
- package/local.properties +0 -8
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -18,9 +18,9 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
18
18
|
import androidx.compose.foundation.layout.height
|
|
19
19
|
import androidx.compose.foundation.layout.ime
|
|
20
20
|
import androidx.compose.foundation.layout.imePadding
|
|
21
|
+
import androidx.compose.foundation.layout.navigationBars
|
|
21
22
|
import androidx.compose.foundation.layout.offset
|
|
22
23
|
import androidx.compose.foundation.layout.padding
|
|
23
|
-
import androidx.compose.foundation.layout.systemBars
|
|
24
24
|
import androidx.compose.foundation.rememberScrollState
|
|
25
25
|
import androidx.compose.foundation.verticalScroll
|
|
26
26
|
import androidx.compose.runtime.Composable
|
|
@@ -43,7 +43,6 @@ import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
|
43
43
|
import androidx.compose.ui.unit.Dp
|
|
44
44
|
import androidx.compose.ui.unit.IntOffset
|
|
45
45
|
import androidx.compose.ui.unit.dp
|
|
46
|
-
import androidx.compose.ui.unit.min
|
|
47
46
|
import androidx.compose.ui.zIndex
|
|
48
47
|
import kotlinx.coroutines.CoroutineScope
|
|
49
48
|
import kotlinx.coroutines.Dispatchers
|
|
@@ -103,8 +102,8 @@ fun Screen(
|
|
|
103
102
|
val keyboardController = LocalSoftwareKeyboardController.current
|
|
104
103
|
|
|
105
104
|
val isKeyboardVisible = isKeyboardVisible()
|
|
106
|
-
val indicator =
|
|
107
|
-
val bottomPadding =
|
|
105
|
+
val indicator = getAppStatusBarHeight()
|
|
106
|
+
val bottomPadding = if (isKeyboardVisible) 0.dp else indicator
|
|
108
107
|
|
|
109
108
|
val headerHeight = if (animatedHeader !== null)
|
|
110
109
|
with(LocalDensity.current) { layoutOffset.roundToPx() }
|
|
@@ -343,7 +342,7 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
|
343
342
|
footerHeightPx
|
|
344
343
|
} else {
|
|
345
344
|
with(density) {
|
|
346
|
-
|
|
345
|
+
navigationBar.toPx()
|
|
347
346
|
}
|
|
348
347
|
}.toInt()
|
|
349
348
|
|
|
@@ -401,4 +400,3 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
|
401
400
|
|
|
402
401
|
|
|
403
402
|
|
|
404
|
-
|
|
@@ -221,6 +221,7 @@ fun Input(
|
|
|
221
221
|
onBlur: () -> Unit = {},
|
|
222
222
|
loading: Boolean = false,
|
|
223
223
|
required: Boolean = false,
|
|
224
|
+
maxLength: Int? = null,
|
|
224
225
|
fontWeight: InputFontWeight = InputFontWeight.REGULAR,
|
|
225
226
|
keyboardType: KeyboardType = KeyboardType.Text,
|
|
226
227
|
modifier: Modifier = Modifier,
|
|
@@ -319,7 +320,10 @@ fun Input(
|
|
|
319
320
|
onBlur()
|
|
320
321
|
}
|
|
321
322
|
},
|
|
322
|
-
onValueChange =
|
|
323
|
+
onValueChange = { newText ->
|
|
324
|
+
val limitedText = maxLength?.let { newText.take(it) } ?: newText
|
|
325
|
+
onChangeText(limitedText)
|
|
326
|
+
},
|
|
323
327
|
decorationBox = { innerTextField ->
|
|
324
328
|
// Floating label
|
|
325
329
|
if (floatingValue.isNotEmpty() || floatingIcon.isNotEmpty()) {
|
|
@@ -1,41 +1,18 @@
|
|
|
1
1
|
package vn.momo.kits.navigation
|
|
2
2
|
|
|
3
|
+
import androidx.compose.animation.*
|
|
3
4
|
import androidx.compose.animation.core.tween
|
|
4
|
-
import androidx.compose.
|
|
5
|
-
import androidx.compose.animation.slideInHorizontally
|
|
6
|
-
import androidx.compose.animation.slideInVertically
|
|
7
|
-
import androidx.compose.animation.slideOutHorizontally
|
|
8
|
-
import androidx.compose.animation.slideOutVertically
|
|
9
|
-
import androidx.compose.foundation.layout.WindowInsets
|
|
10
|
-
import androidx.compose.foundation.layout.asPaddingValues
|
|
11
|
-
import androidx.compose.foundation.layout.systemBars
|
|
12
|
-
import androidx.compose.runtime.Composable
|
|
13
|
-
import androidx.compose.runtime.CompositionLocalProvider
|
|
14
|
-
import androidx.compose.runtime.DisposableEffect
|
|
15
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
16
|
-
import androidx.compose.runtime.mutableStateOf
|
|
17
|
-
import androidx.compose.runtime.remember
|
|
18
|
-
import androidx.compose.runtime.staticCompositionLocalOf
|
|
5
|
+
import androidx.compose.runtime.*
|
|
19
6
|
import androidx.compose.ui.unit.Dp
|
|
20
|
-
import androidx.compose.ui.unit.dp
|
|
21
7
|
import androidx.navigation.compose.NavHost
|
|
22
8
|
import androidx.navigation.compose.composable
|
|
23
9
|
import androidx.navigation.compose.rememberNavController
|
|
24
10
|
import androidx.navigation.toRoute
|
|
25
|
-
import vn.momo.kits.application
|
|
26
|
-
import vn.momo.kits.
|
|
27
|
-
import vn.momo.kits.application.ApplicationContext
|
|
28
|
-
import vn.momo.kits.application.KitConfig
|
|
29
|
-
import vn.momo.kits.application.MiniAppContext
|
|
30
|
-
import vn.momo.kits.application.ScaleSizeMaxRate
|
|
31
|
-
import vn.momo.kits.const.AppNavigationBar
|
|
32
|
-
import vn.momo.kits.const.AppStatusBar
|
|
33
|
-
import vn.momo.kits.const.AppTheme
|
|
34
|
-
import vn.momo.kits.const.Theme
|
|
35
|
-
import vn.momo.kits.const.ThemeAssets
|
|
36
|
-
import vn.momo.kits.const.defaultTheme
|
|
11
|
+
import vn.momo.kits.application.*
|
|
12
|
+
import vn.momo.kits.const.*
|
|
37
13
|
import vn.momo.kits.platform.ProvideNavigationEventDispatcherOwner
|
|
38
14
|
import vn.momo.kits.utils.getAppStatusBarHeight
|
|
15
|
+
import vn.momo.kits.utils.getNavigationBarHeight
|
|
39
16
|
import vn.momo.maxapi.IMaxApi
|
|
40
17
|
|
|
41
18
|
@Composable
|
|
@@ -54,11 +31,7 @@ fun NavigationContainer(
|
|
|
54
31
|
val navController = rememberNavController()
|
|
55
32
|
val navigator = remember { Navigator(navController = navController, maxApi = maxApi) }
|
|
56
33
|
val statusBarHeight = statusBarHeight ?: getAppStatusBarHeight()
|
|
57
|
-
val navigationBarHeight =
|
|
58
|
-
WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
|
|
59
|
-
} else {
|
|
60
|
-
AppNavigationBar.current
|
|
61
|
-
}
|
|
34
|
+
val navigationBarHeight = getNavigationBarHeight()
|
|
62
35
|
|
|
63
36
|
val parentContext = ApplicationContext.current
|
|
64
37
|
val mergedContext = MiniAppContext.merge(parentContext, applicationContext)
|
|
@@ -289,7 +289,7 @@ fun FooterContent(){
|
|
|
289
289
|
val imeBottom = ime.getBottom(density)
|
|
290
290
|
val thresholdPx = with(density) { 50.dp.toPx() }
|
|
291
291
|
val isKeyboardVisible = imeBottom > thresholdPx
|
|
292
|
-
val bottomPadding =
|
|
292
|
+
val bottomPadding = if (isKeyboardVisible) 0.dp else AppNavigationBar.current
|
|
293
293
|
Footer(footerComponent = options.footerComponent, bottomPadding = bottomPadding)
|
|
294
294
|
}
|
|
295
295
|
}
|
|
@@ -18,7 +18,6 @@ import androidx.compose.runtime.LaunchedEffect
|
|
|
18
18
|
import androidx.compose.ui.Alignment
|
|
19
19
|
import androidx.compose.ui.Modifier
|
|
20
20
|
import androidx.compose.ui.unit.dp
|
|
21
|
-
import androidx.compose.ui.unit.min
|
|
22
21
|
import androidx.navigation.compose.NavHost
|
|
23
22
|
import androidx.navigation.compose.composable
|
|
24
23
|
import androidx.navigation.compose.rememberNavController
|
|
@@ -139,7 +138,7 @@ fun BottomTab(
|
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
)
|
|
142
|
-
Spacer(modifier = Modifier.fillMaxWidth().height(
|
|
141
|
+
Spacer(modifier = Modifier.fillMaxWidth().height(AppNavigationBar.current + Spacing.S).background(AppTheme.current.colors.background.surface))
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
144
|
}
|
|
@@ -19,7 +19,6 @@ import androidx.compose.ui.layout.onGloballyPositioned
|
|
|
19
19
|
import androidx.compose.ui.platform.LocalDensity
|
|
20
20
|
import androidx.compose.ui.unit.IntOffset
|
|
21
21
|
import androidx.compose.ui.unit.dp
|
|
22
|
-
import androidx.compose.ui.unit.min
|
|
23
22
|
import kotlinx.coroutines.delay
|
|
24
23
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
25
24
|
import vn.momo.kits.const.Colors
|
|
@@ -56,7 +55,7 @@ fun SnackBar(
|
|
|
56
55
|
val footerHeight = if (options.footerComponent != null) {
|
|
57
56
|
footerHeightPxState.value
|
|
58
57
|
} else {
|
|
59
|
-
with(density){
|
|
58
|
+
with(density){ navigationBar.toPx() }
|
|
60
59
|
}.toInt()
|
|
61
60
|
|
|
62
61
|
var startPosition by remember { mutableStateOf(Float.MAX_VALUE) }
|
|
@@ -129,4 +128,4 @@ fun SnackBar(
|
|
|
129
128
|
is SnackBar.Toast -> {}
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
|
-
}
|
|
131
|
+
}
|
|
@@ -12,7 +12,10 @@ import androidx.compose.ui.graphics.Color
|
|
|
12
12
|
import androidx.compose.ui.platform.LocalDensity
|
|
13
13
|
import androidx.compose.ui.unit.Dp
|
|
14
14
|
import androidx.compose.ui.unit.dp
|
|
15
|
+
import androidx.compose.ui.unit.min
|
|
16
|
+
import vn.momo.kits.const.AppNavigationBar
|
|
15
17
|
import vn.momo.kits.const.AppStatusBar
|
|
18
|
+
import vn.momo.kits.platform.getPlatformName
|
|
16
19
|
import kotlin.math.abs
|
|
17
20
|
|
|
18
21
|
|
|
@@ -86,3 +89,17 @@ fun getAppStatusBarHeight(): Dp {
|
|
|
86
89
|
AppStatusBar.current
|
|
87
90
|
}
|
|
88
91
|
}
|
|
92
|
+
|
|
93
|
+
@Composable
|
|
94
|
+
fun getNavigationBarHeight(): Dp {
|
|
95
|
+
return if (AppNavigationBar.current == 0.dp) {
|
|
96
|
+
val systemBottomPadding = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
|
|
97
|
+
if (getPlatformName() == "iOS") {
|
|
98
|
+
min(systemBottomPadding, 21.dp)
|
|
99
|
+
} else {
|
|
100
|
+
systemBottomPadding
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
AppNavigationBar.current
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -12,19 +12,17 @@ import androidx.compose.runtime.getValue
|
|
|
12
12
|
import androidx.compose.runtime.mutableStateOf
|
|
13
13
|
import androidx.compose.runtime.remember
|
|
14
14
|
import androidx.compose.runtime.setValue
|
|
15
|
-
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
16
15
|
import androidx.compose.ui.InternalComposeUiApi
|
|
17
16
|
import androidx.compose.ui.Modifier
|
|
18
17
|
import androidx.compose.ui.backhandler.LocalCompatNavigationEventDispatcherOwner
|
|
19
18
|
import androidx.compose.ui.graphics.Color
|
|
20
19
|
import androidx.compose.ui.graphics.NativePaint
|
|
21
20
|
import androidx.compose.ui.graphics.toArgb
|
|
21
|
+
import androidx.compose.ui.interop.UIKitView
|
|
22
22
|
import androidx.compose.ui.semantics.SemanticsPropertyKey
|
|
23
23
|
import androidx.compose.ui.semantics.semantics
|
|
24
24
|
import androidx.compose.ui.unit.Dp
|
|
25
25
|
import androidx.compose.ui.unit.dp
|
|
26
|
-
import androidx.compose.ui.viewinterop.UIKitInteropProperties
|
|
27
|
-
import androidx.compose.ui.viewinterop.UIKitView
|
|
28
26
|
import cocoapods.lottie_ios.CompatibleAnimation
|
|
29
27
|
import cocoapods.lottie_ios.CompatibleAnimationKeypath
|
|
30
28
|
import cocoapods.lottie_ios.CompatibleAnimationView
|
|
@@ -91,7 +89,7 @@ actual fun getOSVersion(): Int {
|
|
|
91
89
|
return UIDevice.currentDevice.systemVersion.substringBefore(".").toIntOrNull() ?: 0
|
|
92
90
|
}
|
|
93
91
|
|
|
94
|
-
@OptIn(ExperimentalForeignApi::class
|
|
92
|
+
@OptIn(ExperimentalForeignApi::class)
|
|
95
93
|
@Composable
|
|
96
94
|
actual fun LottieAnimation(
|
|
97
95
|
path: String,
|
|
@@ -114,12 +112,11 @@ actual fun LottieAnimation(
|
|
|
114
112
|
Box(modifier) {
|
|
115
113
|
UIKitView(
|
|
116
114
|
modifier = Modifier.fillMaxSize(),
|
|
117
|
-
properties = UIKitInteropProperties(placedAsOverlay = true),
|
|
118
115
|
factory = {
|
|
119
116
|
CompatibleAnimationView(value).apply {
|
|
120
117
|
translatesAutoresizingMaskIntoConstraints = true
|
|
121
118
|
|
|
122
|
-
setBackgroundColor(bgColor?.toUIColor() ?: UIColor.
|
|
119
|
+
setBackgroundColor(bgColor?.toUIColor() ?: UIColor.whiteColor)
|
|
123
120
|
|
|
124
121
|
setLoopAnimationCount(-1.0)
|
|
125
122
|
setAnimationSpeed(1.0)
|
|
@@ -140,7 +137,7 @@ actual fun LottieAnimation(
|
|
|
140
137
|
},
|
|
141
138
|
|
|
142
139
|
update = { view ->
|
|
143
|
-
view.setBackgroundColor(bgColor?.toUIColor() ?: UIColor.
|
|
140
|
+
view.setBackgroundColor(bgColor?.toUIColor() ?: UIColor.whiteColor)
|
|
144
141
|
|
|
145
142
|
if (tintColor != null) {
|
|
146
143
|
val uiColor = tintColor.toUIColor()
|
package/gradle.properties
CHANGED
|
@@ -2,7 +2,7 @@ import SwiftUI
|
|
|
2
2
|
|
|
3
3
|
public func scaleSize(_ size: CGFloat, _ scaleRate: CGFloat? = nil) -> CGFloat {
|
|
4
4
|
let defaultScreenSize: CGFloat = 375
|
|
5
|
-
let maxFontScale: CGFloat = scaleRate ?? 1.
|
|
5
|
+
let maxFontScale: CGFloat = scaleRate ?? 1.5
|
|
6
6
|
let maxDeviceScale: CGFloat = 5
|
|
7
7
|
|
|
8
8
|
let deviceWidth = UIScreen.main.bounds.width
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(yarn react-native:*)",
|
|
5
|
-
"Read(//Users/phuc/.claude/skills/ai-skill-generator/**)",
|
|
6
|
-
"Bash(python3 scripts/install_skill.py --update)",
|
|
7
|
-
"Bash(cd /Users/phuc/momo-kits/.claude/skills/design-system-kits && mkdir -p .claude/skills/design-system-kits && mv SKILL.md README.md references .claude/skills/design-system-kits/)",
|
|
8
|
-
"Bash(mv .claude/skills/design-system-kits/* . && rmdir .claude/skills/design-system-kits && rmdir .claude/skills)",
|
|
9
|
-
"WebFetch(domain:via.placeholder.com)",
|
|
10
|
-
"WebFetch(domain:image.tmdb.org)",
|
|
11
|
-
"WebFetch(domain:placehold.co)",
|
|
12
|
-
"WebFetch(domain:dummyimage.com)"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
}
|
package/local.properties
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
-
# as it contains information specific to your local configuration.
|
|
3
|
-
#
|
|
4
|
-
# Location of the SDK. This is only used by Gradle.
|
|
5
|
-
# For customization when using a Version Control System, please read the
|
|
6
|
-
# header note.
|
|
7
|
-
#Thu Oct 02 17:53:13 ICT 2025
|
|
8
|
-
sdk.dir=/Users/phuc/Library/Android/sdk
|