@momo-kits/native-kits 0.125.1-securityCustom.0 → 0.127.0-rc.1
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/build/kotlin/commonizedNativeDistributionLocation.txt +1 -0
- package/compose/build/generated/compose/resourceGenerator/kotlin/androidMainResourceCollectors/vn/momo/uikits/resources/ActualResourceCollectors.kt +49 -0
- package/compose/build/generated/compose/resourceGenerator/kotlin/commonMainResourceAccessors/vn/momo/uikits/resources/Font0.commonMain.kt +187 -0
- package/compose/build/generated/compose/resourceGenerator/kotlin/commonMainResourceCollectors/vn/momo/uikits/resources/ExpectResourceCollectors.kt +25 -0
- package/compose/build/generated/compose/resourceGenerator/kotlin/commonResClass/vn/momo/uikits/resources/Res.kt +49 -0
- package/compose/build/generated/compose/resourceGenerator/kotlin/iosArm64MainResourceCollectors/vn/momo/uikits/resources/ActualResourceCollectors.kt +49 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/momosignature.otf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_black.otf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
- package/compose/build/generated/compose/resourceGenerator/preparedResources/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
- package/compose/build.gradle.kts +17 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +63 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +12 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +79 -25
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +87 -72
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +33 -20
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +33 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +61 -39
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +70 -52
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +131 -94
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +39 -19
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +54 -38
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +50 -28
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +29 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +6 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +15 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +3 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +3 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +161 -21
- package/local.properties +8 -0
- package/package.json +4 -2
- package/settings.gradle.kts +3 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/PlatformApi.kt +0 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/Users/huynhdung/.konan/kotlin-native-prebuilt-macos-aarch64-2.1.0/klib/commonized/2.1.0
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@file:OptIn(org.jetbrains.compose.resources.InternalResourceApi::class)
|
|
2
|
+
|
|
3
|
+
package vn.momo.uikits.resources
|
|
4
|
+
|
|
5
|
+
import kotlin.OptIn
|
|
6
|
+
import kotlin.String
|
|
7
|
+
import kotlin.collections.Map
|
|
8
|
+
import org.jetbrains.compose.resources.DrawableResource
|
|
9
|
+
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
10
|
+
import org.jetbrains.compose.resources.FontResource
|
|
11
|
+
import org.jetbrains.compose.resources.PluralStringResource
|
|
12
|
+
import org.jetbrains.compose.resources.StringArrayResource
|
|
13
|
+
import org.jetbrains.compose.resources.StringResource
|
|
14
|
+
|
|
15
|
+
@ExperimentalResourceApi
|
|
16
|
+
public actual val Res.allDrawableResources: Map<String, DrawableResource> by lazy {
|
|
17
|
+
val map = mutableMapOf<String, DrawableResource>()
|
|
18
|
+
return@lazy map
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@ExperimentalResourceApi
|
|
23
|
+
public actual val Res.allStringResources: Map<String, StringResource> by lazy {
|
|
24
|
+
val map = mutableMapOf<String, StringResource>()
|
|
25
|
+
return@lazy map
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@ExperimentalResourceApi
|
|
30
|
+
public actual val Res.allStringArrayResources: Map<String, StringArrayResource> by lazy {
|
|
31
|
+
val map = mutableMapOf<String, StringArrayResource>()
|
|
32
|
+
return@lazy map
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@ExperimentalResourceApi
|
|
37
|
+
public actual val Res.allPluralStringResources: Map<String, PluralStringResource> by lazy {
|
|
38
|
+
val map = mutableMapOf<String, PluralStringResource>()
|
|
39
|
+
return@lazy map
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@ExperimentalResourceApi
|
|
44
|
+
public actual val Res.allFontResources: Map<String, FontResource> by lazy {
|
|
45
|
+
val map = mutableMapOf<String, FontResource>()
|
|
46
|
+
_collectCommonMainFont0Resources(map)
|
|
47
|
+
return@lazy map
|
|
48
|
+
}
|
|
49
|
+
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
@file:OptIn(org.jetbrains.compose.resources.InternalResourceApi::class)
|
|
2
|
+
|
|
3
|
+
package vn.momo.uikits.resources
|
|
4
|
+
|
|
5
|
+
import kotlin.OptIn
|
|
6
|
+
import kotlin.String
|
|
7
|
+
import kotlin.collections.MutableMap
|
|
8
|
+
import org.jetbrains.compose.resources.FontResource
|
|
9
|
+
import org.jetbrains.compose.resources.InternalResourceApi
|
|
10
|
+
|
|
11
|
+
private object CommonMainFont0 {
|
|
12
|
+
public val momosignature: FontResource by
|
|
13
|
+
lazy { init_momosignature() }
|
|
14
|
+
|
|
15
|
+
public val momotrustdisplay: FontResource by
|
|
16
|
+
lazy { init_momotrustdisplay() }
|
|
17
|
+
|
|
18
|
+
public val sfprotext_black: FontResource by
|
|
19
|
+
lazy { init_sfprotext_black() }
|
|
20
|
+
|
|
21
|
+
public val sfprotext_bold: FontResource by
|
|
22
|
+
lazy { init_sfprotext_bold() }
|
|
23
|
+
|
|
24
|
+
public val sfprotext_heavy: FontResource by
|
|
25
|
+
lazy { init_sfprotext_heavy() }
|
|
26
|
+
|
|
27
|
+
public val sfprotext_light: FontResource by
|
|
28
|
+
lazy { init_sfprotext_light() }
|
|
29
|
+
|
|
30
|
+
public val sfprotext_medium: FontResource by
|
|
31
|
+
lazy { init_sfprotext_medium() }
|
|
32
|
+
|
|
33
|
+
public val sfprotext_regular: FontResource by
|
|
34
|
+
lazy { init_sfprotext_regular() }
|
|
35
|
+
|
|
36
|
+
public val sfprotext_semibold: FontResource by
|
|
37
|
+
lazy { init_sfprotext_semibold() }
|
|
38
|
+
|
|
39
|
+
public val sfprotext_thin: FontResource by
|
|
40
|
+
lazy { init_sfprotext_thin() }
|
|
41
|
+
|
|
42
|
+
public val sfprotext_ultralight: FontResource by
|
|
43
|
+
lazy { init_sfprotext_ultralight() }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@InternalResourceApi
|
|
47
|
+
internal fun _collectCommonMainFont0Resources(map: MutableMap<String, FontResource>) {
|
|
48
|
+
map.put("momosignature", CommonMainFont0.momosignature)
|
|
49
|
+
map.put("momotrustdisplay", CommonMainFont0.momotrustdisplay)
|
|
50
|
+
map.put("sfprotext_black", CommonMainFont0.sfprotext_black)
|
|
51
|
+
map.put("sfprotext_bold", CommonMainFont0.sfprotext_bold)
|
|
52
|
+
map.put("sfprotext_heavy", CommonMainFont0.sfprotext_heavy)
|
|
53
|
+
map.put("sfprotext_light", CommonMainFont0.sfprotext_light)
|
|
54
|
+
map.put("sfprotext_medium", CommonMainFont0.sfprotext_medium)
|
|
55
|
+
map.put("sfprotext_regular", CommonMainFont0.sfprotext_regular)
|
|
56
|
+
map.put("sfprotext_semibold", CommonMainFont0.sfprotext_semibold)
|
|
57
|
+
map.put("sfprotext_thin", CommonMainFont0.sfprotext_thin)
|
|
58
|
+
map.put("sfprotext_ultralight", CommonMainFont0.sfprotext_ultralight)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public val Res.font.momosignature: FontResource
|
|
62
|
+
get() = CommonMainFont0.momosignature
|
|
63
|
+
|
|
64
|
+
private fun init_momosignature(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
65
|
+
"font:momosignature",
|
|
66
|
+
setOf(
|
|
67
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
68
|
+
"composeResources/vn.momo.uikits.resources/font/momosignature.otf", -1, -1),
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
public val Res.font.momotrustdisplay: FontResource
|
|
73
|
+
get() = CommonMainFont0.momotrustdisplay
|
|
74
|
+
|
|
75
|
+
private fun init_momotrustdisplay(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
76
|
+
"font:momotrustdisplay",
|
|
77
|
+
setOf(
|
|
78
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
79
|
+
"composeResources/vn.momo.uikits.resources/font/momotrustdisplay.otf", -1, -1),
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
public val Res.font.sfprotext_black: FontResource
|
|
84
|
+
get() = CommonMainFont0.sfprotext_black
|
|
85
|
+
|
|
86
|
+
private fun init_sfprotext_black(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
87
|
+
"font:sfprotext_black",
|
|
88
|
+
setOf(
|
|
89
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
90
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_black.otf", -1, -1),
|
|
91
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
92
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_black.ttf", -1, -1),
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
public val Res.font.sfprotext_bold: FontResource
|
|
97
|
+
get() = CommonMainFont0.sfprotext_bold
|
|
98
|
+
|
|
99
|
+
private fun init_sfprotext_bold(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
100
|
+
"font:sfprotext_bold",
|
|
101
|
+
setOf(
|
|
102
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
103
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_bold.ttf", -1, -1),
|
|
104
|
+
)
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
public val Res.font.sfprotext_heavy: FontResource
|
|
108
|
+
get() = CommonMainFont0.sfprotext_heavy
|
|
109
|
+
|
|
110
|
+
private fun init_sfprotext_heavy(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
111
|
+
"font:sfprotext_heavy",
|
|
112
|
+
setOf(
|
|
113
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
114
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_heavy.ttf", -1, -1),
|
|
115
|
+
)
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
public val Res.font.sfprotext_light: FontResource
|
|
119
|
+
get() = CommonMainFont0.sfprotext_light
|
|
120
|
+
|
|
121
|
+
private fun init_sfprotext_light(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
122
|
+
"font:sfprotext_light",
|
|
123
|
+
setOf(
|
|
124
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
125
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_light.ttf", -1, -1),
|
|
126
|
+
)
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
public val Res.font.sfprotext_medium: FontResource
|
|
130
|
+
get() = CommonMainFont0.sfprotext_medium
|
|
131
|
+
|
|
132
|
+
private fun init_sfprotext_medium(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
133
|
+
"font:sfprotext_medium",
|
|
134
|
+
setOf(
|
|
135
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
136
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_medium.ttf", -1, -1),
|
|
137
|
+
)
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
public val Res.font.sfprotext_regular: FontResource
|
|
141
|
+
get() = CommonMainFont0.sfprotext_regular
|
|
142
|
+
|
|
143
|
+
private fun init_sfprotext_regular(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
144
|
+
"font:sfprotext_regular",
|
|
145
|
+
setOf(
|
|
146
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
147
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_regular.ttf", -1, -1),
|
|
148
|
+
)
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
public val Res.font.sfprotext_semibold: FontResource
|
|
152
|
+
get() = CommonMainFont0.sfprotext_semibold
|
|
153
|
+
|
|
154
|
+
private fun init_sfprotext_semibold(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
155
|
+
"font:sfprotext_semibold",
|
|
156
|
+
setOf(
|
|
157
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
158
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_semibold.ttf", -1, -1),
|
|
159
|
+
)
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
public val Res.font.sfprotext_thin: FontResource
|
|
163
|
+
get() = CommonMainFont0.sfprotext_thin
|
|
164
|
+
|
|
165
|
+
private fun init_sfprotext_thin(): FontResource = org.jetbrains.compose.resources.FontResource(
|
|
166
|
+
"font:sfprotext_thin",
|
|
167
|
+
setOf(
|
|
168
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
169
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_thin.otf", -1, -1),
|
|
170
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
171
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_thin.ttf", -1, -1),
|
|
172
|
+
)
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
public val Res.font.sfprotext_ultralight: FontResource
|
|
176
|
+
get() = CommonMainFont0.sfprotext_ultralight
|
|
177
|
+
|
|
178
|
+
private fun init_sfprotext_ultralight(): FontResource =
|
|
179
|
+
org.jetbrains.compose.resources.FontResource(
|
|
180
|
+
"font:sfprotext_ultralight",
|
|
181
|
+
setOf(
|
|
182
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
183
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_ultralight.otf", -1, -1),
|
|
184
|
+
org.jetbrains.compose.resources.ResourceItem(setOf(),
|
|
185
|
+
"composeResources/vn.momo.uikits.resources/font/sfprotext_ultralight.ttf", -1, -1),
|
|
186
|
+
)
|
|
187
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package vn.momo.uikits.resources
|
|
2
|
+
|
|
3
|
+
import kotlin.String
|
|
4
|
+
import kotlin.collections.Map
|
|
5
|
+
import org.jetbrains.compose.resources.DrawableResource
|
|
6
|
+
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
7
|
+
import org.jetbrains.compose.resources.FontResource
|
|
8
|
+
import org.jetbrains.compose.resources.PluralStringResource
|
|
9
|
+
import org.jetbrains.compose.resources.StringArrayResource
|
|
10
|
+
import org.jetbrains.compose.resources.StringResource
|
|
11
|
+
|
|
12
|
+
@ExperimentalResourceApi
|
|
13
|
+
public expect val Res.allDrawableResources: Map<String, DrawableResource>
|
|
14
|
+
|
|
15
|
+
@ExperimentalResourceApi
|
|
16
|
+
public expect val Res.allStringResources: Map<String, StringResource>
|
|
17
|
+
|
|
18
|
+
@ExperimentalResourceApi
|
|
19
|
+
public expect val Res.allStringArrayResources: Map<String, StringArrayResource>
|
|
20
|
+
|
|
21
|
+
@ExperimentalResourceApi
|
|
22
|
+
public expect val Res.allPluralStringResources: Map<String, PluralStringResource>
|
|
23
|
+
|
|
24
|
+
@ExperimentalResourceApi
|
|
25
|
+
public expect val Res.allFontResources: Map<String, FontResource>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@file:OptIn(
|
|
2
|
+
org.jetbrains.compose.resources.InternalResourceApi::class,
|
|
3
|
+
org.jetbrains.compose.resources.ExperimentalResourceApi::class,
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
package vn.momo.uikits.resources
|
|
7
|
+
|
|
8
|
+
import kotlin.ByteArray
|
|
9
|
+
import kotlin.OptIn
|
|
10
|
+
import kotlin.String
|
|
11
|
+
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
12
|
+
import org.jetbrains.compose.resources.getResourceUri
|
|
13
|
+
import org.jetbrains.compose.resources.readResourceBytes
|
|
14
|
+
|
|
15
|
+
public object Res {
|
|
16
|
+
/**
|
|
17
|
+
* Reads the content of the resource file at the specified path and returns it as a byte array.
|
|
18
|
+
*
|
|
19
|
+
* Example: `val bytes = Res.readBytes("files/key.bin")`
|
|
20
|
+
*
|
|
21
|
+
* @param path The path of the file to read in the compose resource's directory.
|
|
22
|
+
* @return The content of the file as a byte array.
|
|
23
|
+
*/
|
|
24
|
+
@ExperimentalResourceApi
|
|
25
|
+
public suspend fun readBytes(path: String): ByteArray =
|
|
26
|
+
readResourceBytes("composeResources/vn.momo.uikits.resources/" + path)
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns the URI string of the resource file at the specified path.
|
|
30
|
+
*
|
|
31
|
+
* Example: `val uri = Res.getUri("files/key.bin")`
|
|
32
|
+
*
|
|
33
|
+
* @param path The path of the file in the compose resource's directory.
|
|
34
|
+
* @return The URI string of the file.
|
|
35
|
+
*/
|
|
36
|
+
@ExperimentalResourceApi
|
|
37
|
+
public fun getUri(path: String): String =
|
|
38
|
+
getResourceUri("composeResources/vn.momo.uikits.resources/" + path)
|
|
39
|
+
|
|
40
|
+
public object drawable
|
|
41
|
+
|
|
42
|
+
public object string
|
|
43
|
+
|
|
44
|
+
public object array
|
|
45
|
+
|
|
46
|
+
public object plurals
|
|
47
|
+
|
|
48
|
+
public object font
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@file:OptIn(org.jetbrains.compose.resources.InternalResourceApi::class)
|
|
2
|
+
|
|
3
|
+
package vn.momo.uikits.resources
|
|
4
|
+
|
|
5
|
+
import kotlin.OptIn
|
|
6
|
+
import kotlin.String
|
|
7
|
+
import kotlin.collections.Map
|
|
8
|
+
import org.jetbrains.compose.resources.DrawableResource
|
|
9
|
+
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
10
|
+
import org.jetbrains.compose.resources.FontResource
|
|
11
|
+
import org.jetbrains.compose.resources.PluralStringResource
|
|
12
|
+
import org.jetbrains.compose.resources.StringArrayResource
|
|
13
|
+
import org.jetbrains.compose.resources.StringResource
|
|
14
|
+
|
|
15
|
+
@ExperimentalResourceApi
|
|
16
|
+
public actual val Res.allDrawableResources: Map<String, DrawableResource> by lazy {
|
|
17
|
+
val map = mutableMapOf<String, DrawableResource>()
|
|
18
|
+
return@lazy map
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@ExperimentalResourceApi
|
|
23
|
+
public actual val Res.allStringResources: Map<String, StringResource> by lazy {
|
|
24
|
+
val map = mutableMapOf<String, StringResource>()
|
|
25
|
+
return@lazy map
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@ExperimentalResourceApi
|
|
30
|
+
public actual val Res.allStringArrayResources: Map<String, StringArrayResource> by lazy {
|
|
31
|
+
val map = mutableMapOf<String, StringArrayResource>()
|
|
32
|
+
return@lazy map
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@ExperimentalResourceApi
|
|
37
|
+
public actual val Res.allPluralStringResources: Map<String, PluralStringResource> by lazy {
|
|
38
|
+
val map = mutableMapOf<String, PluralStringResource>()
|
|
39
|
+
return@lazy map
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@ExperimentalResourceApi
|
|
44
|
+
public actual val Res.allFontResources: Map<String, FontResource> by lazy {
|
|
45
|
+
val map = mutableMapOf<String, FontResource>()
|
|
46
|
+
_collectCommonMainFont0Resources(map)
|
|
47
|
+
return@lazy map
|
|
48
|
+
}
|
|
49
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/compose/build.gradle.kts
CHANGED
|
@@ -15,11 +15,16 @@ kotlin {
|
|
|
15
15
|
publishLibraryVariants("release")
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
val isDebug = (project.findProperty("kotlin.native.cocoapods.platform") as? String)
|
|
19
|
+
?.contains("iphoneos", ignoreCase = true) == false
|
|
20
|
+
|
|
21
|
+
val iosTargets = if (isDebug) {
|
|
22
|
+
listOf(iosX64(), iosSimulatorArm64())
|
|
23
|
+
} else {
|
|
24
|
+
listOf(iosArm64())
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
iosTargets.forEach { iosTarget ->
|
|
23
28
|
iosTarget.binaries.framework {
|
|
24
29
|
baseName = "lib"
|
|
25
30
|
isStatic = true
|
|
@@ -42,6 +47,7 @@ kotlin {
|
|
|
42
47
|
implementation(libs.coil.multiplatform.network.ktor)
|
|
43
48
|
implementation(libs.jetbrains.serialization.json)
|
|
44
49
|
implementation(libs.kotlinx.datetime)
|
|
50
|
+
api(project(":NativeMaxApi"))
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
53
|
val androidMain by getting {
|
|
@@ -51,10 +57,12 @@ kotlin {
|
|
|
51
57
|
api("androidx.activity:activity-compose:1.8.2")
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
if (isDebug) {
|
|
61
|
+
val iosX64Main by getting
|
|
62
|
+
val iosSimulatorArm64Main by getting
|
|
63
|
+
} else {
|
|
64
|
+
val iosArm64Main by getting
|
|
65
|
+
}
|
|
58
66
|
iosMain.dependencies {
|
|
59
67
|
implementation(libs.ktor.client.darwin)
|
|
60
68
|
}
|
|
@@ -73,7 +73,69 @@ data class MiniAppContext(
|
|
|
73
73
|
val toolkitConfig: Map<String, Any?> = emptyMap(),
|
|
74
74
|
val providerId: String = "",
|
|
75
75
|
val permissions: List<Map<String, Any>>? = emptyList()
|
|
76
|
-
)
|
|
76
|
+
) {
|
|
77
|
+
companion object {
|
|
78
|
+
private const val KEY_ICON = "icon"
|
|
79
|
+
private const val KEY_NAME = "name"
|
|
80
|
+
private const val KEY_APP_ID = "appId"
|
|
81
|
+
private const val KEY_CODE = "code"
|
|
82
|
+
private const val KEY_DESCRIPTION = "description"
|
|
83
|
+
private const val KEY_SUPPORT = "support"
|
|
84
|
+
private const val KEY_TOOLKIT_CFG = "toolkitConfig"
|
|
85
|
+
private const val KEY_PERMISSIONS = "permissions"
|
|
86
|
+
private const val KEY_ORIGIN_APP = "originAppId"
|
|
87
|
+
|
|
88
|
+
fun toMap(context: MiniAppContext?): Map<String, Any?> = mapOf(
|
|
89
|
+
"icon" to (context?.appIcon ?: ""),
|
|
90
|
+
"name" to context?.appName,
|
|
91
|
+
"appId" to (context?.appId ?: ""),
|
|
92
|
+
"code" to (context?.appCode ?: ""),
|
|
93
|
+
"description" to (context?.description ?: ""),
|
|
94
|
+
"support" to (context?.support ?: emptyMap<String, Any?>()),
|
|
95
|
+
"toolkitConfig" to (context?.toolkitConfig ?: emptyMap<String, Any?>()),
|
|
96
|
+
"providerId" to (context?.providerId ?: ""),
|
|
97
|
+
"permissions" to (context?.permissions ?: emptyList<Map<String, Any>>())
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
fun fromMap(data: Map<String, Any?>?): MiniAppContext = MiniAppContext(
|
|
101
|
+
appIcon = data.string(KEY_ICON) ?: "",
|
|
102
|
+
appName = data?.get(KEY_NAME),
|
|
103
|
+
appId = data.string(KEY_APP_ID) ?: "",
|
|
104
|
+
appCode = data.string(KEY_CODE) ?: "",
|
|
105
|
+
description = data?.get(KEY_DESCRIPTION),
|
|
106
|
+
support = data.mapStringAny(KEY_SUPPORT),
|
|
107
|
+
toolkitConfig = data.mapStringAny(KEY_TOOLKIT_CFG),
|
|
108
|
+
providerId = computeProviderId(
|
|
109
|
+
originAppId = data.string(KEY_ORIGIN_APP),
|
|
110
|
+
appId = data.string(KEY_APP_ID)
|
|
111
|
+
),
|
|
112
|
+
permissions = data.listOfMapStringAny(KEY_PERMISSIONS)
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
private fun computeProviderId(originAppId: String?, appId: String?): String {
|
|
116
|
+
val id = when {
|
|
117
|
+
!originAppId.isNullOrBlank() -> originAppId
|
|
118
|
+
!appId.isNullOrBlank() -> appId
|
|
119
|
+
else -> null
|
|
120
|
+
} ?: return "unknown"
|
|
121
|
+
|
|
122
|
+
val parts = id.split('.')
|
|
123
|
+
return parts.getOrNull(1) ?: "unknown"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private fun Map<String, Any?>?.string(key: String): String? =
|
|
129
|
+
(this?.get(key) as? String)
|
|
130
|
+
|
|
131
|
+
@Suppress("UNCHECKED_CAST")
|
|
132
|
+
private fun Map<String, Any?>?.mapStringAny(key: String): Map<String, Any?> =
|
|
133
|
+
(this?.get(key) as? Map<String, Any?>) ?: emptyMap()
|
|
134
|
+
|
|
135
|
+
@Suppress("UNCHECKED_CAST")
|
|
136
|
+
private fun Map<String, Any?>?.listOfMapStringAny(key: String): List<Map<String, Any>> =
|
|
137
|
+
(this?.get(key) as? List<Map<String, Any>>) ?: emptyList()
|
|
138
|
+
|
|
77
139
|
|
|
78
140
|
val PlatformApi = staticCompositionLocalOf<Any?> { null }
|
|
79
141
|
|
|
@@ -21,6 +21,8 @@ import androidx.compose.foundation.rememberScrollState
|
|
|
21
21
|
import androidx.compose.foundation.verticalScroll
|
|
22
22
|
import androidx.compose.runtime.Composable
|
|
23
23
|
import androidx.compose.runtime.getValue
|
|
24
|
+
import androidx.compose.runtime.mutableStateOf
|
|
25
|
+
import androidx.compose.runtime.remember
|
|
24
26
|
import androidx.compose.ui.Alignment
|
|
25
27
|
import androidx.compose.ui.Modifier
|
|
26
28
|
import androidx.compose.ui.graphics.Color
|
|
@@ -79,17 +81,20 @@ fun Screen(
|
|
|
79
81
|
) {
|
|
80
82
|
val statusBarHeight = getAppStatusBarHeight()
|
|
81
83
|
val keyboardController = LocalSoftwareKeyboardController.current
|
|
82
|
-
val keyboardHeight = WindowInsets.ime.asPaddingValues().calculateBottomPadding()
|
|
83
|
-
val keyboardSize = when {
|
|
84
|
-
!useAvoidKeyboard -> 0.dp
|
|
85
|
-
keyboardHeight > 100.dp && footer == null -> keyboardHeight
|
|
86
|
-
keyboardHeight > 100.dp && footer != null -> keyboardHeight - 21.dp
|
|
87
|
-
else -> 0.dp
|
|
88
|
-
}
|
|
89
84
|
|
|
90
85
|
val indicator = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
|
|
91
86
|
val bottomPadding = min(indicator, 21.dp)
|
|
92
87
|
|
|
88
|
+
val keyboardHeight = WindowInsets.ime.asPaddingValues().calculateBottomPadding()
|
|
89
|
+
val keyboardSize by remember { mutableStateOf(
|
|
90
|
+
when {
|
|
91
|
+
!useAvoidKeyboard || keyboardController == null -> 0.dp
|
|
92
|
+
keyboardHeight > 100.dp && footer == null -> keyboardHeight
|
|
93
|
+
keyboardHeight > 100.dp && footer != null -> keyboardHeight - bottomPadding
|
|
94
|
+
else -> 0.dp
|
|
95
|
+
}
|
|
96
|
+
) }
|
|
97
|
+
|
|
93
98
|
val headerHeight = if (animatedHeader !== null)
|
|
94
99
|
with(LocalDensity.current) { layoutOffset.roundToPx() }
|
|
95
100
|
else HEADER_HEIGHT
|