@momo-kits/native-kits 0.167.1-beta.18-debug → 0.167.1-beta.19-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 +14 -1
- package/compose/build.gradle.kts.backup +13 -0
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +17 -25
- package/gradle.properties +1 -1
- package/ios/Title/Title.swift +3 -8
- package/ios/Typography/Text.swift +2 -16
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/local.properties +2 -2
- package/package.json +1 -1
package/compose/build.gradle.kts
CHANGED
|
@@ -40,7 +40,7 @@ kotlin {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
cocoapods {
|
|
43
|
-
version = "0.167.1-beta.
|
|
43
|
+
version = "0.167.1-beta.19-debug"
|
|
44
44
|
summary = "IOS Shared module"
|
|
45
45
|
homepage = "https://momo.vn"
|
|
46
46
|
ios.deploymentTarget = "15.0"
|
|
@@ -188,3 +188,16 @@ compose {
|
|
|
188
188
|
// }
|
|
189
189
|
// }
|
|
190
190
|
// }
|
|
191
|
+
|
|
192
|
+
// KGP's synthetic Podfile only raises pods to iOS 12 (KT-57741); Xcode 27 rejects anything below 15, which breaks lottie-ios (13.0).
|
|
193
|
+
tasks.matching { it.name.startsWith("podGen") }.configureEach {
|
|
194
|
+
doLast {
|
|
195
|
+
outputs.files.asFileTree.matching { include("**/Podfile") }.forEach { podfile ->
|
|
196
|
+
val signingLine = "config.build_settings['CODE_SIGNING_ALLOWED'] = \"NO\""
|
|
197
|
+
val text = podfile.readText()
|
|
198
|
+
if ("IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'" !in text) {
|
|
199
|
+
podfile.writeText(text.replace(signingLine, "$signingLine\n config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'"))
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -188,3 +188,16 @@ mavenPublishing {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
+
|
|
192
|
+
// KGP's synthetic Podfile only raises pods to iOS 12 (KT-57741); Xcode 27 rejects anything below 15, which breaks lottie-ios (13.0).
|
|
193
|
+
tasks.matching { it.name.startsWith("podGen") }.configureEach {
|
|
194
|
+
doLast {
|
|
195
|
+
outputs.files.asFileTree.matching { include("**/Podfile") }.forEach { podfile ->
|
|
196
|
+
val signingLine = "config.build_settings['CODE_SIGNING_ALLOWED'] = \"NO\""
|
|
197
|
+
val text = podfile.readText()
|
|
198
|
+
if ("IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'" !in text) {
|
|
199
|
+
podfile.writeText(text.replace(signingLine, "$signingLine\n config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'"))
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
package/compose/compose.podspec
CHANGED
|
@@ -126,17 +126,10 @@ internal fun RowScope.RenderTabBarItem(
|
|
|
126
126
|
|
|
127
127
|
@Composable
|
|
128
128
|
internal fun TabBarItem(item: BottomTabItem, selected: Boolean, onClick: () -> Unit) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
fun formatLabel(label: String): String? {
|
|
134
|
-
if (isNumber(label) && label.toInt() == 0) {
|
|
135
|
-
return null
|
|
136
|
-
}
|
|
137
|
-
return label
|
|
138
|
-
}
|
|
139
|
-
val badgeLabel = item.badgeLabel?.let { formatLabel(it) }
|
|
129
|
+
// RN parity: "0" hides the badge, "" renders a dot.
|
|
130
|
+
val badgeLabel = item.badgeLabel?.takeUnless { it.toIntOrNull() == 0 }
|
|
131
|
+
val isNumber = badgeLabel?.toIntOrNull() != null
|
|
132
|
+
val showDot = badgeLabel?.isEmpty() ?: item.showDot
|
|
140
133
|
|
|
141
134
|
Box(modifier = Modifier
|
|
142
135
|
.fillMaxSize()
|
|
@@ -159,11 +152,19 @@ internal fun TabBarItem(item: BottomTabItem, selected: Boolean, onClick: () -> U
|
|
|
159
152
|
horizontalAlignment = Alignment.CenterHorizontally,
|
|
160
153
|
verticalArrangement = Arrangement.Center
|
|
161
154
|
) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
155
|
+
Box(modifier = Modifier.padding(Spacing.XS)) {
|
|
156
|
+
Icon(
|
|
157
|
+
source = item.icon,
|
|
158
|
+
size = 28.dp,
|
|
159
|
+
color = if (selected) AppTheme.current.colors.primary else AppTheme.current.colors.text.hint)
|
|
160
|
+
// Anchored to the icon (not the tab cell) so it stays put whatever the tab width; matchParentSize + unbounded wrap keeps it from resizing the icon slot.
|
|
161
|
+
val badgeAnchor = Modifier.matchParentSize().wrapContentSize(Alignment.TopEnd, unbounded = true)
|
|
162
|
+
if (showDot) {
|
|
163
|
+
BadgeDot(size = DotSize.Small, modifier = badgeAnchor.offset(x = 4.dp, y = (-4).dp))
|
|
164
|
+
} else if (!badgeLabel.isNullOrEmpty()) {
|
|
165
|
+
Badge(badgeLabel, modifier = badgeAnchor.offset(x = if (isNumber) 8.dp else 12.dp, y = (-8).dp))
|
|
166
|
+
}
|
|
167
|
+
}
|
|
167
168
|
Text(
|
|
168
169
|
text = item.label,
|
|
169
170
|
color = if (selected) AppTheme.current.colors.primary else AppTheme.current.colors.text.hint,
|
|
@@ -172,15 +173,6 @@ internal fun TabBarItem(item: BottomTabItem, selected: Boolean, onClick: () -> U
|
|
|
172
173
|
overflow = TextOverflow.Ellipsis
|
|
173
174
|
)
|
|
174
175
|
}
|
|
175
|
-
if (badgeLabel != null) {
|
|
176
|
-
if (badgeLabel.isEmpty())
|
|
177
|
-
BadgeDot(
|
|
178
|
-
size = DotSize.Small,
|
|
179
|
-
modifier = Modifier.offset(x = 50.dp, y = (-48).dp)
|
|
180
|
-
)
|
|
181
|
-
else
|
|
182
|
-
Badge(badgeLabel, modifier = Modifier.offset(x = 44.dp, y = (-42).dp))
|
|
183
|
-
}
|
|
184
176
|
}
|
|
185
177
|
}
|
|
186
178
|
|
package/gradle.properties
CHANGED
package/ios/Title/Title.swift
CHANGED
|
@@ -152,16 +152,11 @@ public struct Title: View {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
private var titleText: some View {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
let lineSpacing = max(0, fontScale(titleLineHeight)
|
|
158
|
-
- UIFont.systemFont(ofSize: fontSize).lineHeight)
|
|
159
|
-
|
|
160
|
-
return SwiftUI.Text(title)
|
|
161
|
-
.font(.system(size: fontSize, weight: titleFontWeight))
|
|
155
|
+
SwiftUI.Text(title)
|
|
156
|
+
.font(.system(size: fontScale(titleFontSize), weight: titleFontWeight))
|
|
162
157
|
.ignoreBoldTextSetting()
|
|
163
158
|
.foregroundColor(theme.colors.text.default)
|
|
164
|
-
.lineSpacing(
|
|
159
|
+
.lineSpacing(fontScale(titleLineHeight) - fontScale(titleFontSize))
|
|
165
160
|
.lineLimit(titleMaxLines)
|
|
166
161
|
.truncationMode(.tail)
|
|
167
162
|
}
|
|
@@ -123,15 +123,6 @@ private func momoFont(size: CGFloat, weight: Font.Weight, family: String) -> Fon
|
|
|
123
123
|
return .custom(name, fixedSize: size)
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// lineHeight is identical across weights of a family, so the regular face is enough.
|
|
127
|
-
private func momoLineHeight(size: CGFloat, family: String) -> CGFloat {
|
|
128
|
-
if let name = momoFontName(family: family, weight: .regular),
|
|
129
|
-
let font = UIFont(name: name, size: size) {
|
|
130
|
-
return font.lineHeight
|
|
131
|
-
}
|
|
132
|
-
return UIFont.systemFont(ofSize: size).lineHeight
|
|
133
|
-
}
|
|
134
|
-
|
|
135
126
|
public struct MomoText: View {
|
|
136
127
|
@Environment(\.appTheme) private var theme
|
|
137
128
|
@Environment(\.momoFontScale) private var fontScale
|
|
@@ -231,13 +222,8 @@ public struct MomoText: View {
|
|
|
231
222
|
// *Strikethrough styles) or the explicit `strikethrough` flag.
|
|
232
223
|
let isStrikethrough = strikethrough || typography.isStrikethrough
|
|
233
224
|
|
|
234
|
-
let fontSize = fontScale(typography.fontSize)
|
|
235
|
-
// lineSpacing is added on top of the font's natural line height, not on top of fontSize.
|
|
236
|
-
let lineSpacing = max(0, fontScale(typography.lineHeight)
|
|
237
|
-
- momoLineHeight(size: fontSize, family: theme.font))
|
|
238
|
-
|
|
239
225
|
var text = baseText
|
|
240
|
-
.font(momoFont(size: fontSize, weight: typography.fontWeight, family: theme.font))
|
|
226
|
+
.font(momoFont(size: fontScale(typography.fontSize), weight: typography.fontWeight, family: theme.font))
|
|
241
227
|
.foregroundColor(textColor)
|
|
242
228
|
.strikethrough(isStrikethrough, color: textColor)
|
|
243
229
|
.underline(underline, color: textColor)
|
|
@@ -248,7 +234,7 @@ public struct MomoText: View {
|
|
|
248
234
|
|
|
249
235
|
return text
|
|
250
236
|
.multilineTextAlignment(textAlign)
|
|
251
|
-
.lineSpacing(
|
|
237
|
+
.lineSpacing(fontScale(typography.lineHeight) - fontScale(typography.fontSize))
|
|
252
238
|
.modifier(LineLimitModifier(range: lineLimitRange))
|
|
253
239
|
.truncationMode(truncationMode)
|
|
254
240
|
.fixedSize(horizontal: !softWrap, vertical: false)
|
package/ios/native-kits.podspec
CHANGED
package/local.properties
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
# Location of the SDK. This is only used by Gradle.
|
|
5
5
|
# For customization when using a Version Control System, please read the
|
|
6
6
|
# header note.
|
|
7
|
-
#
|
|
8
|
-
sdk.dir=/Users/
|
|
7
|
+
#Thu Jun 04 17:11:56 ICT 2026
|
|
8
|
+
sdk.dir=/Users/open.design/Library/Android/sdk
|