@momo-kits/native-kits 0.89.33-beta.36 → 0.89.33-beta.38

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.
@@ -14,9 +14,7 @@ val AppNavigator = staticCompositionLocalOf<Navigator> {
14
14
  error("no navigator provided!")
15
15
  }
16
16
 
17
- val PlatformApi = staticCompositionLocalOf<ComposeApi> {
18
- error("no api provided!")
19
- }
17
+ val PlatformApi = staticCompositionLocalOf<ComposeApi?> { null }
20
18
 
21
19
  class Navigator {
22
20
  fun push(content: @Composable () -> Unit) {
@@ -85,9 +85,9 @@ fun Screen(
85
85
  }
86
86
 
87
87
  val platformApi = PlatformApi.current
88
- val rawData = platformApi.request("GetConfig", "DESIGN_SYSTEM")
88
+ val rawData = platformApi?.request("GetConfig", "DESIGN_SYSTEM")
89
89
  val json = Json { ignoreUnknownKeys = true }
90
- val headerBanner = json.decodeFromString<ConfigData>(rawData).headerBanner
90
+ val headerBanner = rawData?.let { json.decodeFromString<ConfigData>(it).headerBanner }
91
91
 
92
92
  val indicator = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
93
93
  val bottomPadding = min(indicator, 21.dp)
@@ -97,7 +97,9 @@ fun Screen(
97
97
  )
98
98
 
99
99
  val headerAnimated =
100
- @Composable { animatedHeader?.composable?.invoke(scrollState.value) }
100
+ @Composable {
101
+ animatedHeader?.composable?.invoke(scrollState.value)
102
+ }
101
103
 
102
104
  Box(
103
105
  Modifier.fillMaxSize()
@@ -98,6 +98,7 @@ data class InputSearchProps(
98
98
  val keyboardActions: KeyboardActions = KeyboardActions.Default,
99
99
  val modifier: Modifier = Modifier,
100
100
  val iconModifier: Modifier = Modifier,
101
+ val onClearPress: () -> Unit = {}
101
102
  )
102
103
 
103
104
  @Composable
@@ -195,7 +196,10 @@ fun InputSearch(
195
196
  size = 16.dp,
196
197
  color = AppTheme.current.colors.text.hint,
197
198
  modifier = Modifier.clickable(
198
- onClick = { inputSearchProps.text.value = "" },
199
+ onClick = {
200
+ inputSearchProps.text.value = ""
201
+ inputSearchProps.onClearPress.invoke()
202
+ },
199
203
  interactionSource = remember { MutableInteractionSource() },
200
204
  indication = null
201
205
  )
@@ -106,7 +106,7 @@ val defaultTheme = Theme(
106
106
  ),
107
107
  font = "SFProText",
108
108
  assets = ThemeAssets(
109
- headerBackground = "https://static.momocdn.net/app/img/kits/background/header/header_Tet_2024_transparent.png"
109
+ headerBackground = null
110
110
  )
111
111
  )
112
112
 
@@ -162,7 +162,7 @@ val darkTheme = Theme(
162
162
  ),
163
163
  font = "SFProText",
164
164
  assets = ThemeAssets(
165
- headerBackground = "https://static.momocdn.net/app/img/kits/background/header/header_Tet_2024_transparent.png"
165
+ headerBackground = "https://static.momocdn.net/app/img/app/img/header-background.png"
166
166
  )
167
167
  )
168
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.89.33-beta.36",
3
+ "version": "0.89.33-beta.38",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},