@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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.164.1-trustsans-test.6-debug"
43
+ version = "0.164.1-trustsans-9-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |spec|
2
2
  spec.name = 'compose'
3
- spec.version = '0.164.1-trustsans-test.6-debug'
3
+ spec.version = '0.164.1-trustsans-9-debug'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
@@ -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 key = "$fontFamily-${fontWeight?.weight}"
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-test.6
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
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.164.1-trustsans-test.6'
3
+ s.version = '0.164.1-trustsans-9'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.164.1-trustsans-test.6'
3
+ s.version = '0.164.1-trustsans-9'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.164.1-trustsans-test.6-debug",
3
+ "version": "0.164.1-trustsans-9-debug",
4
4
  "private": false,
5
5
  "dependeNavigationncies": {},
6
6
  "devDependencies": {},