@momo-kits/native-kits 0.154.1-beta.4 → 0.154.1-beta.6

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.
@@ -74,7 +74,8 @@ data class MiniAppContext(
74
74
  val support: Map<String, Any?> = emptyMap(),
75
75
  val toolkitConfig: Map<String, Any?> = emptyMap(),
76
76
  val providerId: String = "",
77
- val permissions: List<Map<String, Any>>? = emptyList()
77
+ val permissions: List<Map<String, Any>>? = emptyList(),
78
+ val isBaselineEnabled: Boolean = false
78
79
  ) {
79
80
  companion object {
80
81
  private const val KEY_ICON = "icon"
@@ -86,6 +87,7 @@ data class MiniAppContext(
86
87
  private const val KEY_TOOLKIT_CFG = "toolkitConfig"
87
88
  private const val KEY_PERMISSIONS = "permissions"
88
89
  private const val KEY_ORIGIN_APP = "originAppId"
90
+ private const val KEY_BASELINE_ENABLED = "isBaselineEnabled"
89
91
 
90
92
  fun toMap(context: MiniAppContext?): Map<String, Any?> = mapOf(
91
93
  "icon" to (context?.appIcon ?: ""),
@@ -96,7 +98,8 @@ data class MiniAppContext(
96
98
  "support" to (context?.support ?: emptyMap<String, Any?>()),
97
99
  "toolkitConfig" to (context?.toolkitConfig ?: emptyMap<String, Any?>()),
98
100
  "providerId" to (context?.providerId ?: ""),
99
- "permissions" to (context?.permissions ?: emptyList<Map<String, Any>>())
101
+ "permissions" to (context?.permissions ?: emptyList<Map<String, Any>>()),
102
+ "isBaselineEnabled" to (context?.isBaselineEnabled ?: false)
100
103
  )
101
104
 
102
105
  fun fromMap(data: Map<String, Any?>?): MiniAppContext = MiniAppContext(
@@ -111,7 +114,8 @@ data class MiniAppContext(
111
114
  originAppId = data.string(KEY_ORIGIN_APP),
112
115
  appId = data.string(KEY_APP_ID)
113
116
  ),
114
- permissions = data.listOfMapStringAny(KEY_PERMISSIONS)
117
+ permissions = data.listOfMapStringAny(KEY_PERMISSIONS),
118
+ isBaselineEnabled = data?.get(KEY_BASELINE_ENABLED) as Boolean
115
119
  )
116
120
 
117
121
  private fun computeProviderId(originAppId: String?, appId: String?): String {
@@ -158,6 +162,17 @@ val AppLanguage = staticCompositionLocalOf<String?> {
158
162
  null
159
163
  }
160
164
 
165
+ val Feature = staticCompositionLocalOf<FeatureFlags?> {
166
+ FeatureFlags(
167
+ showBaseLineDebug = false
168
+ )
169
+ }
170
+
171
+ @Immutable
172
+ data class FeatureFlags(
173
+ val showBaseLineDebug: Boolean? = false,
174
+ )
175
+
161
176
  @Immutable
162
177
  data class KitConfig(
163
178
  val trustBanner: TrustBannerData? = null,
@@ -1,7 +1,6 @@
1
1
  package vn.momo.kits.components
2
2
 
3
3
  import androidx.compose.foundation.border
4
- import androidx.compose.foundation.layout.Box
5
4
  import androidx.compose.runtime.Composable
6
5
  import androidx.compose.runtime.remember
7
6
  import androidx.compose.ui.Modifier
@@ -13,8 +12,7 @@ import androidx.compose.ui.text.style.TextDecoration
13
12
  import androidx.compose.ui.text.style.TextOverflow
14
13
  import androidx.compose.ui.unit.TextUnit
15
14
  import androidx.compose.ui.unit.dp
16
- import vn.momo.kits.application.ComposeApi
17
- import vn.momo.kits.application.PlatformApi
15
+ import vn.momo.kits.application.Feature
18
16
  import vn.momo.kits.const.AppTheme
19
17
  import vn.momo.kits.const.Colors
20
18
  import vn.momo.kits.const.Typography
@@ -72,10 +70,10 @@ fun Text(
72
70
  }
73
71
 
74
72
  // on/off baseline config value, default will be false
75
- val isBaselineViewEnabled = true
73
+ val showBaseLineDebug = Feature.current?.showBaseLineDebug ?: false
76
74
 
77
75
  androidx.compose.material3.Text(
78
- modifier = modifier.conditional(isBaselineViewEnabled){
76
+ modifier = modifier.conditional(showBaseLineDebug){
79
77
  border(1.dp, Colors.blue_03)
80
78
  }.setAutomationId(automationId, text),
81
79
  text = text,
@@ -25,6 +25,8 @@ import androidx.navigation.toRoute
25
25
  import vn.momo.kits.application.AppConfig
26
26
  import vn.momo.kits.application.AppLanguage
27
27
  import vn.momo.kits.application.ApplicationContext
28
+ import vn.momo.kits.application.Feature
29
+ import vn.momo.kits.application.FeatureFlags
28
30
  import vn.momo.kits.application.KitConfig
29
31
  import vn.momo.kits.application.MiniAppContext
30
32
  import vn.momo.kits.const.AppNavigationBar
@@ -48,6 +50,7 @@ fun NavigationContainer(
48
50
  statusBarHeight: Dp? = null,
49
51
  config: KitConfig? = null,
50
52
  language: String? = null,
53
+ featureFlags: FeatureFlags
51
54
  ){
52
55
  val navController = rememberNavController()
53
56
  val navigator = remember { Navigator(navController = navController, maxApi = maxApi) }
@@ -82,7 +85,8 @@ fun NavigationContainer(
82
85
  AppNavigationBar provides navigationBarHeight,
83
86
  ApplicationContext provides applicationContext,
84
87
  AppConfig provides config,
85
- AppLanguage provides language
88
+ AppLanguage provides language,
89
+ Feature provides featureFlags
86
90
  ) {
87
91
  LaunchedEffect(Unit) {
88
92
  setNavigator?.invoke(navigator)
@@ -157,3 +161,4 @@ fun NavigationContainer(
157
161
  val LocalMaxApi = staticCompositionLocalOf<IMaxApi?> {
158
162
  error("No MaxApi provided")
159
163
  }
164
+
package/local.properties CHANGED
@@ -4,5 +4,5 @@
4
4
  # Location of the SDK. This is only used by Gradle.
5
5
  # For customization when using a Version Control System, please read the
6
6
  # header note.
7
- #Thu Jan 09 10:43:10 ICT 2025
8
- sdk.dir=/Users/sophia/Library/Android/sdk
7
+ #Wed Aug 21 14:20:12 ICT 2024
8
+ sdk.dir=/Users/huynhdung/Library/Android/sdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.154.1-beta.4",
3
+ "version": "0.154.1-beta.6",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@momo-platform/native-max-api": "1.0.18"