@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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.159.1-beta.12-debug"
43
+ version = "0.159.1-beta.14-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.159.1-beta.12'
3
+ spec.version = '0.159.1-beta.7'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
@@ -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 = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
107
- val bottomPadding = min(indicator, if (isKeyboardVisible) 0.dp else 21.dp)
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
- min(navigationBar, 21.dp).toPx()
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 = onChangeText,
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()) {
@@ -33,7 +33,7 @@ import kotlin.math.max
33
33
  import kotlin.math.min
34
34
 
35
35
  const val DEFAULT_SCREEN_SIZE = 375f
36
- const val MAX_FONT_SCALE = 1.2f
36
+ const val MAX_FONT_SCALE = 1.5f
37
37
  const val MAX_DEVICE_SCALE = 5
38
38
 
39
39
  @Composable
@@ -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.animation.fadeIn
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.AppConfig
26
- import vn.momo.kits.application.AppLanguage
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 = if (AppNavigationBar.current == 0.dp) {
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 = min(AppNavigationBar.current, if (isKeyboardVisible) 0.dp else 21.dp)
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(min(AppNavigationBar.current, 21.dp) + Spacing.S).background(AppTheme.current.colors.background.surface))
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){ min(navigationBar, 21.dp).toPx() }
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, ExperimentalComposeUiApi::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.clearColor)
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.clearColor)
140
+ view.setBackgroundColor(bgColor?.toUIColor() ?: UIColor.whiteColor)
144
141
 
145
142
  if (tintColor != null) {
146
143
  val uiColor = tintColor.toUIColor()
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.159.1-beta.12
21
+ version=0.159.1-beta.8
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
@@ -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.2
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.159.1-beta.12-debug",
3
+ "version": "0.159.1-beta.14-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},
@@ -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