@momo-kits/native-kits 0.112.1-beta.6 → 0.112.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.
@@ -62,11 +62,11 @@ class Navigator {
62
62
  }
63
63
 
64
64
  data class MiniAppContext(
65
- private val appIcon: String = "",
66
- private val appName: String = "",
65
+ val icon: String = "",
66
+ val name: String = "",
67
67
  val appId: String = "",
68
- val appCode: String = "",
69
- private val description: String? = "",
68
+ val code: String = "",
69
+ val description: String? = "",
70
70
  )
71
71
 
72
72
  val PlatformApi = staticCompositionLocalOf<Any?> { null }
@@ -86,10 +86,15 @@ fun ToolkitHeaderRight(headerRight: HeaderRightData? = null) {
86
86
  }
87
87
 
88
88
  fun onPressHelpCenter() {
89
- val params = ModelConvertUtils.encodeToJsonFromAny(
90
- mapOf("context" to context),
91
- ).toString()
92
- api?.request("showHelpCenter", params, {})
89
+ val paramMap: Map<String, Any?> = mapOf(
90
+ "appId" to context?.appId,
91
+ "code" to context?.code,
92
+ "name" to context?.name,
93
+ "icon" to context?.icon,
94
+ "description" to context?.description
95
+ )
96
+ val params = ModelConvertUtils.encodeToJsonFromAny(paramMap).toString()
97
+ api?.request("showHelpCenter", params, { _ -> })
93
98
  }
94
99
 
95
100
  fun onPressClose() {
@@ -97,13 +102,19 @@ fun ToolkitHeaderRight(headerRight: HeaderRightData? = null) {
97
102
  }
98
103
 
99
104
  fun onPressMore() {
100
- val params = ModelConvertUtils.encodeToJsonFromAny(
101
- arrayOf(
102
- headerRight?.tools,
103
- emptyMap<Any, Any>()
105
+ val param = listOf(
106
+ headerRight?.tools ?: emptyList<ToolGroup>(),
107
+ mapOf(
108
+ "appId" to context?.appId,
109
+ "code" to context?.code,
110
+ "name" to context?.name,
111
+ "icon" to context?.icon,
112
+ "description" to context?.description
104
113
  )
105
- ).toString()
106
- api?.request("showTools", params, {})
114
+ )
115
+
116
+ val params = ModelConvertUtils.encodeToJsonFromAny(param).toString()
117
+ api?.request("showTools", params, { _ -> })
107
118
  }
108
119
 
109
120
  fun getNavigationButtonConfig(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.112.1-beta.6",
3
+ "version": "0.112.1-beta.7",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},