@momo-kits/native-kits 0.164.1-trustsans-test.6-debug → 0.164.1-trustsans-9-debug
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/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitDesignSystem.kt +18 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +14 -1
- package/gradle.properties +1 -1
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/package.json +1 -1
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package vn.momo.kits.const
|
|
2
|
+
|
|
3
|
+
import androidx.compose.runtime.getValue
|
|
4
|
+
import androidx.compose.runtime.mutableStateOf
|
|
5
|
+
import androidx.compose.runtime.setValue
|
|
6
|
+
|
|
7
|
+
// Design-system rollout holder, same shape as KitFontScale: the kit is sandboxed and can't read the
|
|
8
|
+
// host config, so the host seeds this once at startup from DesignSystemConfig. getFontFamily() reads
|
|
9
|
+
// it to decide whether the new default font applies, so every screen follows the flag with no prop
|
|
10
|
+
// threading. Backed by snapshot state: writes recompose text automatically.
|
|
11
|
+
object KitDesignSystem {
|
|
12
|
+
var isWhiteList by mutableStateOf(false)
|
|
13
|
+
private set
|
|
14
|
+
|
|
15
|
+
fun update(isWhiteList: Boolean) {
|
|
16
|
+
this.isWhiteList = isWhiteList
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -119,9 +119,22 @@ private val hostFontFiles: Map<String, String> = mapOf(
|
|
|
119
119
|
)
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Font mặc định mới, chỉ áp cho user nằm trong whitelist design system ([KitDesignSystem]).
|
|
124
|
+
* Ngoài whitelist thì quay về [LEGACY_DEFAULT_FONT_FAMILY] như trước.
|
|
125
|
+
*/
|
|
126
|
+
private const val NEW_DEFAULT_FONT_FAMILY = "MomoTrustSans"
|
|
127
|
+
private const val LEGACY_DEFAULT_FONT_FAMILY = "SFProText"
|
|
128
|
+
|
|
122
129
|
@Composable
|
|
123
130
|
fun getFontFamily(fontFamily: String, fontWeight: FontWeight? = FontWeight.Normal): FontFamily {
|
|
124
|
-
val
|
|
131
|
+
val resolvedFamily =
|
|
132
|
+
if (fontFamily == NEW_DEFAULT_FONT_FAMILY && !KitDesignSystem.isWhiteList) {
|
|
133
|
+
LEGACY_DEFAULT_FONT_FAMILY
|
|
134
|
+
} else {
|
|
135
|
+
fontFamily
|
|
136
|
+
}
|
|
137
|
+
val key = "$resolvedFamily-${fontWeight?.weight}"
|
|
125
138
|
val fileName = hostFontFiles[key] ?: DEFAULT_FONT_FILE
|
|
126
139
|
return hostFontFamily(fileName)
|
|
127
140
|
?: hostFontFamily(DEFAULT_FONT_FILE)
|
package/gradle.properties
CHANGED
|
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
|
|
|
18
18
|
name="ComposeKits"
|
|
19
19
|
group=vn.momo.kits
|
|
20
20
|
artifact.id=kits
|
|
21
|
-
version=0.164.1-trustsans-
|
|
21
|
+
version=0.164.1-trustsans-9
|
|
22
22
|
|
|
23
23
|
repo=GitLab
|
|
24
24
|
url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
|
package/ios/native-kits.podspec
CHANGED