@momo-kits/native-kits 0.154.1-beta.5 → 0.154.1-beta.7
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/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +9 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +4 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +1 -4
- package/local.properties +2 -2
- package/package.json +1 -1
|
@@ -16,7 +16,6 @@ import vn.momo.kits.const.AppTheme
|
|
|
16
16
|
import vn.momo.kits.const.Theme
|
|
17
17
|
import vn.momo.kits.const.ThemeAssets
|
|
18
18
|
import vn.momo.kits.const.defaultTheme
|
|
19
|
-
import vn.momo.kits.navigation.IsBaselineViewEnabled
|
|
20
19
|
import vn.momo.kits.platform.getStatusBarHeight
|
|
21
20
|
|
|
22
21
|
@Deprecated("Use IMaxApi instead", ReplaceWith("IMaxApi"))
|
|
@@ -76,7 +75,7 @@ data class MiniAppContext(
|
|
|
76
75
|
val toolkitConfig: Map<String, Any?> = emptyMap(),
|
|
77
76
|
val providerId: String = "",
|
|
78
77
|
val permissions: List<Map<String, Any>>? = emptyList(),
|
|
79
|
-
val
|
|
78
|
+
val features: FeatureFlags? = null,
|
|
80
79
|
) {
|
|
81
80
|
companion object {
|
|
82
81
|
private const val KEY_ICON = "icon"
|
|
@@ -88,7 +87,6 @@ data class MiniAppContext(
|
|
|
88
87
|
private const val KEY_TOOLKIT_CFG = "toolkitConfig"
|
|
89
88
|
private const val KEY_PERMISSIONS = "permissions"
|
|
90
89
|
private const val KEY_ORIGIN_APP = "originAppId"
|
|
91
|
-
private const val KEY_BASELINE_ENABLED = "isBaselineEnabled"
|
|
92
90
|
|
|
93
91
|
fun toMap(context: MiniAppContext?): Map<String, Any?> = mapOf(
|
|
94
92
|
"icon" to (context?.appIcon ?: ""),
|
|
@@ -96,11 +94,10 @@ data class MiniAppContext(
|
|
|
96
94
|
"appId" to (context?.appId ?: ""),
|
|
97
95
|
"code" to (context?.appCode ?: ""),
|
|
98
96
|
"description" to (context?.description ?: ""),
|
|
99
|
-
"support" to (context?.support ?: emptyMap
|
|
100
|
-
"toolkitConfig" to (context?.toolkitConfig ?: emptyMap
|
|
97
|
+
"support" to (context?.support ?: emptyMap()),
|
|
98
|
+
"toolkitConfig" to (context?.toolkitConfig ?: emptyMap()),
|
|
101
99
|
"providerId" to (context?.providerId ?: ""),
|
|
102
|
-
"permissions" to (context?.permissions ?: emptyList
|
|
103
|
-
"isBaselineEnabled" to (context?.isBaselineEnabled ?: false)
|
|
100
|
+
"permissions" to (context?.permissions ?: emptyList()),
|
|
104
101
|
)
|
|
105
102
|
|
|
106
103
|
fun fromMap(data: Map<String, Any?>?): MiniAppContext = MiniAppContext(
|
|
@@ -116,7 +113,6 @@ data class MiniAppContext(
|
|
|
116
113
|
appId = data.string(KEY_APP_ID)
|
|
117
114
|
),
|
|
118
115
|
permissions = data.listOfMapStringAny(KEY_PERMISSIONS),
|
|
119
|
-
isBaselineEnabled = data?.get(KEY_BASELINE_ENABLED) as Boolean
|
|
120
116
|
)
|
|
121
117
|
|
|
122
118
|
private fun computeProviderId(originAppId: String?, appId: String?): String {
|
|
@@ -163,6 +159,11 @@ val AppLanguage = staticCompositionLocalOf<String?> {
|
|
|
163
159
|
null
|
|
164
160
|
}
|
|
165
161
|
|
|
162
|
+
@Immutable
|
|
163
|
+
data class FeatureFlags(
|
|
164
|
+
val showBaseLineDebug: Boolean? = false,
|
|
165
|
+
)
|
|
166
|
+
|
|
166
167
|
@Immutable
|
|
167
168
|
data class KitConfig(
|
|
168
169
|
val trustBanner: TrustBannerData? = null,
|
|
@@ -203,7 +204,6 @@ fun ApplicationContainer(
|
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
val appStatusBarHeight = statusBarHeight ?: getStatusBarHeight()
|
|
206
|
-
val isBaselineEnabled = applicationContext?.isBaselineEnabled ?: false
|
|
207
207
|
|
|
208
208
|
CompositionLocalProvider(
|
|
209
209
|
AppTheme provides appTheme,
|
|
@@ -213,7 +213,6 @@ fun ApplicationContainer(
|
|
|
213
213
|
ApplicationContext provides applicationContext,
|
|
214
214
|
AppConfig provides config,
|
|
215
215
|
AppLanguage provides language,
|
|
216
|
-
IsBaselineViewEnabled provides isBaselineEnabled
|
|
217
216
|
) {
|
|
218
217
|
content()
|
|
219
218
|
}
|
|
@@ -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,6 +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
|
|
15
|
+
import vn.momo.kits.application.ApplicationContext
|
|
16
16
|
import vn.momo.kits.const.AppTheme
|
|
17
17
|
import vn.momo.kits.const.Colors
|
|
18
18
|
import vn.momo.kits.const.Typography
|
|
@@ -20,7 +20,6 @@ import vn.momo.kits.const.getFontFamily
|
|
|
20
20
|
import vn.momo.kits.const.scaleSize
|
|
21
21
|
import vn.momo.kits.modifier.conditional
|
|
22
22
|
import vn.momo.kits.modifier.setAutomationId
|
|
23
|
-
import vn.momo.kits.navigation.IsBaselineViewEnabled
|
|
24
23
|
|
|
25
24
|
@Composable
|
|
26
25
|
fun Text(
|
|
@@ -39,6 +38,7 @@ fun Text(
|
|
|
39
38
|
softWrap: Boolean = true,
|
|
40
39
|
accessibilityId: String? = null
|
|
41
40
|
) {
|
|
41
|
+
val application = ApplicationContext.current
|
|
42
42
|
// Cache theme access to avoid repeated lookups
|
|
43
43
|
val theme = AppTheme.current
|
|
44
44
|
|
|
@@ -71,10 +71,10 @@ fun Text(
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// on/off baseline config value, default will be false
|
|
74
|
-
val
|
|
74
|
+
val showBaseLineDebug = application?.features?.showBaseLineDebug == true
|
|
75
75
|
|
|
76
76
|
androidx.compose.material3.Text(
|
|
77
|
-
modifier = modifier.conditional(
|
|
77
|
+
modifier = modifier.conditional(showBaseLineDebug){
|
|
78
78
|
border(1.dp, Colors.blue_03)
|
|
79
79
|
}.setAutomationId(automationId, text),
|
|
80
80
|
text = text,
|
|
@@ -47,7 +47,7 @@ fun NavigationContainer(
|
|
|
47
47
|
setNavigator: ((Navigator) -> Unit)? = null,
|
|
48
48
|
statusBarHeight: Dp? = null,
|
|
49
49
|
config: KitConfig? = null,
|
|
50
|
-
language: String? = null
|
|
50
|
+
language: String? = null
|
|
51
51
|
){
|
|
52
52
|
val navController = rememberNavController()
|
|
53
53
|
val navigator = remember { Navigator(navController = navController, maxApi = maxApi) }
|
|
@@ -72,7 +72,6 @@ fun NavigationContainer(
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
val startDestination = DynamicScreenRegistry.register(initialScreen, options)
|
|
75
|
-
val isBaselineEnabled = applicationContext?.isBaselineEnabled ?: false
|
|
76
75
|
|
|
77
76
|
CompositionLocalProvider(
|
|
78
77
|
LocalNavigator provides navigator,
|
|
@@ -84,7 +83,6 @@ fun NavigationContainer(
|
|
|
84
83
|
ApplicationContext provides applicationContext,
|
|
85
84
|
AppConfig provides config,
|
|
86
85
|
AppLanguage provides language,
|
|
87
|
-
IsBaselineViewEnabled provides isBaselineEnabled
|
|
88
86
|
) {
|
|
89
87
|
LaunchedEffect(Unit) {
|
|
90
88
|
setNavigator?.invoke(navigator)
|
|
@@ -160,4 +158,3 @@ val LocalMaxApi = staticCompositionLocalOf<IMaxApi?> {
|
|
|
160
158
|
error("No MaxApi provided")
|
|
161
159
|
}
|
|
162
160
|
|
|
163
|
-
val IsBaselineViewEnabled = staticCompositionLocalOf<Boolean> { false }
|
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
|
-
#
|
|
8
|
-
sdk.dir=/Users/
|
|
7
|
+
#Wed Aug 21 14:20:12 ICT 2024
|
|
8
|
+
sdk.dir=/Users/huynhdung/Library/Android/sdk
|