@momo-kits/native-kits 0.168.1-beta.4 → 0.168.1-beta.40-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/CLAUDE.md +15 -10
- package/README.md +2 -10
- package/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +198 -0
- package/compose/build.gradle.kts.backup +198 -0
- package/compose/compose.podspec +47 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +20 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +154 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +62 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1071 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +81 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +357 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +542 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +195 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +478 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +265 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +223 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +265 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +185 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +363 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +308 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +90 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +330 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +220 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +207 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +560 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +125 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +207 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +501 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +176 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +236 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +194 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +287 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +187 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +316 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +393 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +153 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +113 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +205 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +422 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +739 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +148 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +35 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +389 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +94 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +97 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +203 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +104 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +455 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +105 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +399 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +192 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +127 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +22 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +118 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +219 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +144 -0
- package/gradle/libs.versions.toml +69 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/gradle.properties +26 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/ios/Application/ApplicationEnvironment.swift +7 -6
- package/ios/Application/DesignSystemKits.swift +163 -0
- package/ios/Application/DesignSystemKitsPayload.swift +68 -0
- package/ios/Badge/BadgeRibbon.swift +8 -1
- package/ios/Extensions/Color++.swift +2 -4
- package/ios/Input/Input.swift +16 -4
- package/ios/Input/InputPhoneNumber.swift +1 -3
- package/ios/Input/InputSearch.swift +1 -2
- package/ios/Input/InputTextArea.swift +8 -4
- package/ios/InputMoney/InputMoney.swift +6 -7
- package/ios/Layout/ModalLayout.swift +152 -0
- package/ios/Layout/ScreenLayout.swift +77 -18
- package/ios/Navigation/BottomSheet.swift +56 -53
- package/ios/Navigation/BottomTab/BottomTab.swift +46 -52
- package/ios/Navigation/BottomTab/BottomTabBar.swift +281 -115
- package/ios/Navigation/BottomTab/CurvedContainer.swift +51 -47
- package/ios/Navigation/BottomTab/DuoBarCompression.swift +2 -3
- package/ios/Navigation/BottomTab/DuoTabBar.swift +64 -172
- package/ios/Navigation/BottomTab/TabBarMetrics.swift +84 -0
- package/ios/Navigation/Component/HeaderBackground.swift +22 -1
- package/ios/Navigation/Component/HeaderRight.swift +1 -1
- package/ios/Navigation/Component/SnackBar.swift +4 -0
- package/ios/Navigation/ModalScreen.swift +20 -5
- package/ios/Navigation/StackScreen.swift +6 -8
- package/ios/Popup/PopupDisplay.swift +6 -4
- package/ios/Popup/PopupInput.swift +6 -4
- package/ios/Popup/PopupLayout.swift +17 -11
- package/ios/Popup/PopupNotify.swift +32 -25
- package/ios/Stepper/Stepper.swift +1 -2
- package/ios/Template/TrustBanner/TrustBanner.swift +4 -2
- package/ios/Typography/FontScale.swift +29 -15
- package/ios/Typography/Text.swift +88 -14
- package/ios/Typography/Typography.swift +2 -2
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/ios-demo/README.md +120 -0
- package/ios-demo/Resources/tabbar_scan_qr_button.json +1 -0
- package/ios-demo/Resources/tabbar_scan_qr_label.json +1 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +272 -59
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +103 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +29 -1
- package/package.json +1 -1
- package/publish.sh +2 -33
- package/settings.gradle.kts +64 -0
- package/ios/Typography/FontScaleStore.swift +0 -58
- package/ios/Typography/KitDesignSystem.swift +0 -17
|
@@ -202,6 +202,13 @@ private struct NavigationDemoContent: View {
|
|
|
202
202
|
)
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
row("Header Types") {
|
|
206
|
+
navigator.push(
|
|
207
|
+
{ HeaderTypesScreen() },
|
|
208
|
+
options: NavigationOptions(title: "Header Types")
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
|
|
205
212
|
row("Bottom Tabs") {
|
|
206
213
|
navigator.push(
|
|
207
214
|
{ BottomTabDemoContent() },
|
|
@@ -253,6 +260,102 @@ private struct UpdateOptionsScreen: View {
|
|
|
253
260
|
}
|
|
254
261
|
}
|
|
255
262
|
|
|
263
|
+
/// Header options switched at runtime (Compose `HeaderTypeUsage`).
|
|
264
|
+
@available(iOS 16.0, *)
|
|
265
|
+
private struct HeaderTypesScreen: View {
|
|
266
|
+
private enum Kind: String, CaseIterable {
|
|
267
|
+
case none = "None", `default` = "Default", extended = "Extended", transparent = "Transparent"
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
private enum HeaderRightOption: String, CaseIterable {
|
|
271
|
+
case toolkit = "Toolkit", homeOnly = "Home only", none = "None"
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
@EnvironmentObject private var navigation: Navigation
|
|
275
|
+
@Environment(\.applicationEnvironment) private var applicationEnvironment
|
|
276
|
+
@State private var kind: AnyHashable = Kind.default
|
|
277
|
+
@State private var titlePosition: AnyHashable = TitlePosition.left
|
|
278
|
+
@State private var showBack = true
|
|
279
|
+
@State private var headerRight: AnyHashable = HeaderRightOption.toolkit
|
|
280
|
+
@State private var isAnimated = false
|
|
281
|
+
@State private var isHeader = false
|
|
282
|
+
@State private var isFullScreenContent = false
|
|
283
|
+
@State private var searchText = ""
|
|
284
|
+
|
|
285
|
+
var body: some View {
|
|
286
|
+
VStack(alignment: .leading, spacing: Spacing.M) {
|
|
287
|
+
ForEach(Kind.allCases, id: \.self) { item in
|
|
288
|
+
Radio(value: item, groupValue: $kind, onChange: applyHeader, label: item.rawValue)
|
|
289
|
+
}
|
|
290
|
+
Divider()
|
|
291
|
+
MomoText("Title Position")
|
|
292
|
+
ForEach([TitlePosition.left, TitlePosition.center], id: \.self) { position in
|
|
293
|
+
Radio(value: position, groupValue: $titlePosition, onChange: {
|
|
294
|
+
navigation.setOptions { $0.titlePosition = position }
|
|
295
|
+
}, label: position == .left ? "LEFT" : "CENTER")
|
|
296
|
+
}
|
|
297
|
+
Divider()
|
|
298
|
+
Checkbox($showBack, onChange: { checked in
|
|
299
|
+
navigation.setOptions { $0.hiddenBack = !checked }
|
|
300
|
+
}, title: "Show Back")
|
|
301
|
+
MomoText("Header Right")
|
|
302
|
+
ForEach(HeaderRightOption.allCases, id: \.self) { option in
|
|
303
|
+
Radio(value: option, groupValue: $headerRight, onChange: { applyHeaderRight(option) }, label: option.rawValue)
|
|
304
|
+
}
|
|
305
|
+
Divider()
|
|
306
|
+
Checkbox($isAnimated, onChange: { checked in
|
|
307
|
+
if checked { isHeader = false }
|
|
308
|
+
applyHeader()
|
|
309
|
+
}, title: "Search Animated")
|
|
310
|
+
Checkbox($isHeader, onChange: { checked in
|
|
311
|
+
if checked { isAnimated = false }
|
|
312
|
+
applyHeader()
|
|
313
|
+
}, title: "Search Header")
|
|
314
|
+
if kind == AnyHashable(Kind.transparent) {
|
|
315
|
+
Checkbox($isFullScreenContent, onChange: { _ in applyHeader() }, title: "Is Full Screen Content")
|
|
316
|
+
}
|
|
317
|
+
Color.clear.frame(height: 1600)
|
|
318
|
+
}
|
|
319
|
+
.padding(Spacing.M)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
private func applyHeaderRight(_ option: HeaderRightOption) {
|
|
323
|
+
let maxApi = applicationEnvironment.maxApi
|
|
324
|
+
navigation.setOptions {
|
|
325
|
+
$0.headerRightData = option == .toolkit ? HeaderRightData() : nil
|
|
326
|
+
$0.headerRight = option == .homeOnly ? {
|
|
327
|
+
NavigationButton(icon: "16_basic_home") { maxApi?.dismissAll(completion: nil) }
|
|
328
|
+
} : nil
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
private func applyHeader() {
|
|
333
|
+
let selected = kind.base as? Kind ?? .default
|
|
334
|
+
var search: InputSearchProps?
|
|
335
|
+
if isAnimated {
|
|
336
|
+
search = InputSearchProps(text: $searchText, placeholder: "Search input")
|
|
337
|
+
} else if isHeader {
|
|
338
|
+
search = InputSearchProps(text: $searchText, buttonText: "Huỷ", showButtonText: true, placeholder: "Search input")
|
|
339
|
+
}
|
|
340
|
+
navigation.setOptions {
|
|
341
|
+
switch selected {
|
|
342
|
+
case .none:
|
|
343
|
+
$0.headerType = .none
|
|
344
|
+
case .default, .extended:
|
|
345
|
+
$0.headerType = selected == .default ? .default : .extended
|
|
346
|
+
$0.useAnimated = isAnimated
|
|
347
|
+
$0.inputSearchProps = search
|
|
348
|
+
case .transparent:
|
|
349
|
+
$0.headerType = .default
|
|
350
|
+
$0.useAnimated = false
|
|
351
|
+
$0.inputSearchProps = nil
|
|
352
|
+
}
|
|
353
|
+
$0.headerTransparent = selected == .transparent
|
|
354
|
+
$0.fullScreenContent = selected == .transparent && isFullScreenContent
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
256
359
|
@available(iOS 16.0, *)
|
|
257
360
|
private struct DemoLeafScreen: View {
|
|
258
361
|
@EnvironmentObject private var navigator: Navigator
|
|
@@ -13,6 +13,14 @@ struct PopupNotifyDemo: View {
|
|
|
13
13
|
|
|
14
14
|
// MARK: - Preview
|
|
15
15
|
|
|
16
|
+
// Figma Risk - eKYC (node 51445-177824)
|
|
17
|
+
private let popupHighlightTitle = "Tạm khoá giao dịch để báo vệ bạn"
|
|
18
|
+
private let popupHighlightSentence =
|
|
19
|
+
"Mỗi ngày có ít nhất 20 người bị lừa đảo hơn 100 triệu đồng trong các giao dịch có dấu hiệu tương tự"
|
|
20
|
+
private let popupHighlightDescription =
|
|
21
|
+
"Hệ thống AI của MoMo đánh giá giao dịch này có dấu hiệu rủi ro. \(popupHighlightSentence)\n"
|
|
22
|
+
+ "Hãy kiểm tra lại người nhận và lý do chuyển tiền trước khi quyết định tiếp tục."
|
|
23
|
+
|
|
16
24
|
@available(iOS 16.0, *)
|
|
17
25
|
private struct PopupNotifyPreview: View {
|
|
18
26
|
@EnvironmentObject private var navigator: Navigator
|
|
@@ -21,6 +29,22 @@ private struct PopupNotifyPreview: View {
|
|
|
21
29
|
BasicColumnBox("PopupNotify", alignment: .leading) {
|
|
22
30
|
MoMoUIKits.Button(title: "Show popup", action: { show() }, size: .large)
|
|
23
31
|
}
|
|
32
|
+
BasicColumnBox("Highlight text", alignment: .leading) {
|
|
33
|
+
MoMoUIKits.Button(title: "Show highlight popup", action: { showHighlight() }, type: .secondary, size: .large)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private func showHighlight() {
|
|
38
|
+
navigator.showModal {
|
|
39
|
+
PopupNotify(props: PopupNotifyProps(
|
|
40
|
+
title: popupHighlightTitle,
|
|
41
|
+
description: popupHighlightDescription,
|
|
42
|
+
primary: PopupAction(title: "Primary", onPress: { navigator.hideOverplay() }),
|
|
43
|
+
secondary: PopupAction(title: "Secondary", onPress: { navigator.hideOverplay() }),
|
|
44
|
+
onIconClose: { navigator.hideOverplay() },
|
|
45
|
+
highlightText: [popupHighlightSentence]
|
|
46
|
+
))
|
|
47
|
+
}
|
|
24
48
|
}
|
|
25
49
|
|
|
26
50
|
private func show() {
|
|
@@ -53,6 +77,7 @@ private struct PopupNotifyPlayground: View {
|
|
|
53
77
|
@State private var image = "https://static.momocdn.net/app/img/popup_permission/img_permission_popup_camera.png"
|
|
54
78
|
@State private var title = "Title"
|
|
55
79
|
@State private var description = "Check lại một nhịp auto chuyển sang dạng CTA."
|
|
80
|
+
@State private var highlightText = ""
|
|
56
81
|
@State private var error = "9004"
|
|
57
82
|
@State private var primaryTitle = "Primary"
|
|
58
83
|
@State private var secondaryTitle = "Secondary"
|
|
@@ -68,6 +93,7 @@ private struct PopupNotifyPlayground: View {
|
|
|
68
93
|
.string("Image", $image),
|
|
69
94
|
.string("Title", $title),
|
|
70
95
|
.string("Description", $description),
|
|
96
|
+
.string("HighlightText: [String] (comma-separated)", $highlightText),
|
|
71
97
|
.string("Error", $error),
|
|
72
98
|
.string("PrimaryTitle", $primaryTitle),
|
|
73
99
|
.string("SecondaryTitle", $secondaryTitle),
|
|
@@ -88,7 +114,9 @@ private struct PopupNotifyPlayground: View {
|
|
|
88
114
|
secondary: PopupAction(title: secondaryTitle, onPress: { navigator.hideOverplay() }),
|
|
89
115
|
buttonDirection: (direction?.value as? PopupActionDirection) ?? .auto,
|
|
90
116
|
onIconClose: { navigator.hideOverplay() },
|
|
91
|
-
isShowCloseIcon: showClose
|
|
117
|
+
isShowCloseIcon: showClose,
|
|
118
|
+
highlightText: highlightText.components(separatedBy: ",")
|
|
119
|
+
.map { $0.trimmingCharacters(in: .whitespaces) }
|
|
92
120
|
))
|
|
93
121
|
}
|
|
94
122
|
}
|
package/package.json
CHANGED
package/publish.sh
CHANGED
|
@@ -379,12 +379,6 @@ phase_publish_npm() {
|
|
|
379
379
|
exit 1
|
|
380
380
|
fi
|
|
381
381
|
|
|
382
|
-
# AI-GENERATED START: preserve an existing credential backup owned by another run
|
|
383
|
-
if [ -e gradle.properties.npm-backup ]; then
|
|
384
|
-
echo "❌ Error: gradle.properties.npm-backup already exists; recover it before publishing."
|
|
385
|
-
exit 1
|
|
386
|
-
fi
|
|
387
|
-
# AI-GENERATED END: preserve an existing credential backup owned by another run
|
|
388
382
|
echo "🔧 Preparing debug version with compose kits..."
|
|
389
383
|
|
|
390
384
|
# Create debug version
|
|
@@ -395,9 +389,6 @@ phase_publish_npm() {
|
|
|
395
389
|
restore_npm_workspace() {
|
|
396
390
|
[ -f .npmignore.backup ] && mv .npmignore.backup .npmignore
|
|
397
391
|
[ -f compose/build.gradle.kts.backup ] && mv compose/build.gradle.kts.backup compose/build.gradle.kts
|
|
398
|
-
# AI-GENERATED START: restore private publishing credentials after npm packaging
|
|
399
|
-
[ -f gradle.properties.npm-backup ] && mv gradle.properties.npm-backup gradle.properties
|
|
400
|
-
# AI-GENERATED END: restore private publishing credentials after npm packaging
|
|
401
392
|
local pkg_version
|
|
402
393
|
pkg_version=$(node -p "require('./package.json').version")
|
|
403
394
|
if [ "$pkg_version" != "$VERSION" ]; then
|
|
@@ -409,16 +400,6 @@ phase_publish_npm() {
|
|
|
409
400
|
fi
|
|
410
401
|
}
|
|
411
402
|
trap restore_npm_workspace EXIT
|
|
412
|
-
# AI-GENERATED START: keep private Maven credentials out of the debug npm package
|
|
413
|
-
cp gradle.properties gradle.properties.npm-backup
|
|
414
|
-
node <<'NODE'
|
|
415
|
-
const fs = require('fs');
|
|
416
|
-
const path = 'gradle.properties';
|
|
417
|
-
const sanitized = fs.readFileSync(path, 'utf8')
|
|
418
|
-
.replace(/^(gitlab\.(?:user|password)\s*=).*$/gm, '$1');
|
|
419
|
-
fs.writeFileSync(path, sanitized);
|
|
420
|
-
NODE
|
|
421
|
-
# AI-GENERATED END: keep private Maven credentials out of the debug npm package
|
|
422
403
|
echo "📦 Debug version: $DEBUG_VERSION"
|
|
423
404
|
|
|
424
405
|
# Get current version from package.json (in case it's different from $VERSION)
|
|
@@ -455,18 +436,12 @@ NODE
|
|
|
455
436
|
echo "🔧 Modifying android configuration for debug version..."
|
|
456
437
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
457
438
|
sed -i '' 's/namespace = "\$gitlabGroup\.\$gitlabArtifactId"/namespace = "vn.momo.kits.kits"/' compose/build.gradle.kts
|
|
458
|
-
|
|
459
|
-
sed -i '' \
|
|
460
|
-
's/compileSdk = libs\.versions\.android\.compileSdk\.get()\.toInt()/compileSdk = 36/' compose/build.gradle.kts
|
|
461
|
-
# AI-GENERATED END: keep the debug package on the approved SDK 36 toolchain
|
|
439
|
+
sed -i '' 's/compileSdk = libs\.versions\.android\.compileSdk\.get()\.toInt()/compileSdk = 35/' compose/build.gradle.kts
|
|
462
440
|
sed -i '' 's/minSdk = libs\.versions\.android\.minSdk\.get()\.toInt()/minSdk = 24/' compose/build.gradle.kts
|
|
463
441
|
sed -i '' "s/version = gitlabVersion/version = \"$DEBUG_VERSION\"/" compose/build.gradle.kts
|
|
464
442
|
else
|
|
465
443
|
sed -i 's/namespace = "\$gitlabGroup\.\$gitlabArtifactId"/namespace = "vn.momo.kits.kits"/' compose/build.gradle.kts
|
|
466
|
-
|
|
467
|
-
sed -i \
|
|
468
|
-
's/compileSdk = libs\.versions\.android\.compileSdk\.get()\.toInt()/compileSdk = 36/' compose/build.gradle.kts
|
|
469
|
-
# AI-GENERATED END: keep the debug package on the approved SDK 36 toolchain
|
|
444
|
+
sed -i 's/compileSdk = libs\.versions\.android\.compileSdk\.get()\.toInt()/compileSdk = 35/' compose/build.gradle.kts
|
|
470
445
|
sed -i 's/minSdk = libs\.versions\.android\.minSdk\.get()\.toInt()/minSdk = 24/' compose/build.gradle.kts
|
|
471
446
|
sed -i "s/version = gitlabVersion/version = \"$DEBUG_VERSION\"/" compose/build.gradle.kts
|
|
472
447
|
fi
|
|
@@ -488,9 +463,6 @@ build/
|
|
|
488
463
|
.gitattributes
|
|
489
464
|
.gitlab-ci.yml
|
|
490
465
|
.npmignore.backup
|
|
491
|
-
# AI-GENERATED START: exclude the private credential backup from debug npm packages
|
|
492
|
-
gradle.properties.npm-backup
|
|
493
|
-
# AI-GENERATED END: exclude the private credential backup from debug npm packages
|
|
494
466
|
EOF
|
|
495
467
|
|
|
496
468
|
echo "📤 Publishing debug version (with compose)..."
|
|
@@ -505,9 +477,6 @@ EOF
|
|
|
505
477
|
# Restore compose/build.gradle.kts
|
|
506
478
|
mv compose/build.gradle.kts.backup compose/build.gradle.kts
|
|
507
479
|
echo "✅ compose/build.gradle.kts restored"
|
|
508
|
-
# AI-GENERATED START: restore credentials before leaving the debug packaging phase
|
|
509
|
-
mv gradle.properties.npm-backup gradle.properties
|
|
510
|
-
# AI-GENERATED END: restore credentials before leaving the debug packaging phase
|
|
511
480
|
|
|
512
481
|
# Restore package.json version to original
|
|
513
482
|
# Verify current version is debug version before restoring
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import org.gradle.kotlin.dsl.maven
|
|
2
|
+
|
|
3
|
+
rootProject.name = "momo-native-kits"
|
|
4
|
+
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
|
5
|
+
|
|
6
|
+
pluginManagement {
|
|
7
|
+
repositories {
|
|
8
|
+
google {
|
|
9
|
+
mavenContent {
|
|
10
|
+
includeGroupAndSubgroups("androidx")
|
|
11
|
+
includeGroupAndSubgroups("com.android")
|
|
12
|
+
includeGroupAndSubgroups("com.google")
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
mavenCentral()
|
|
16
|
+
gradlePluginPortal()
|
|
17
|
+
maven {
|
|
18
|
+
url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
|
|
19
|
+
credentials {username = "download_packages"; password = "gldt-bjDqLpU_sPcHDuXau2ws" }
|
|
20
|
+
}
|
|
21
|
+
maven {
|
|
22
|
+
url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
|
|
23
|
+
credentials {
|
|
24
|
+
username = "viewer"
|
|
25
|
+
password = "viewer"
|
|
26
|
+
}
|
|
27
|
+
isAllowInsecureProtocol = true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
dependencyResolutionManagement {
|
|
33
|
+
repositories {
|
|
34
|
+
google {
|
|
35
|
+
mavenContent {
|
|
36
|
+
includeGroupAndSubgroups("androidx")
|
|
37
|
+
includeGroupAndSubgroups("com.android")
|
|
38
|
+
includeGroupAndSubgroups("com.google")
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
mavenCentral()
|
|
42
|
+
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
|
|
43
|
+
maven {
|
|
44
|
+
url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
|
|
45
|
+
credentials {
|
|
46
|
+
username = "download_packages";
|
|
47
|
+
password = "gldt-bjDqLpU_sPcHDuXau2ws"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
maven {
|
|
51
|
+
url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
|
|
52
|
+
credentials {
|
|
53
|
+
username = "viewer"
|
|
54
|
+
password = "viewer"
|
|
55
|
+
}
|
|
56
|
+
isAllowInsecureProtocol = true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
include(":compose")
|
|
62
|
+
|
|
63
|
+
include(":sample:androidApp")
|
|
64
|
+
include(":sample:shared")
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
|
|
3
|
-
/// App-wide font-scale inputs for the SwiftUI kit, and the single place they publish from.
|
|
4
|
-
/// The host writes `update(...)` at startup (from the cache-backed `FontScaleProvider`) and again
|
|
5
|
-
/// whenever the in-app font-size preference changes; the OS Dynamic Type factor is tracked here.
|
|
6
|
-
/// Mirrors Compose's `KitFontScale` + `ProvideOsFontScale` pair, including its live behaviour —
|
|
7
|
-
/// views re-render on change as long as the subtree got `.momoFontScale()` (`NavigationContainer`
|
|
8
|
-
/// applies it). When `useOSScaleRate` is false the kit applies `userScaleRate` instead of the OS factor.
|
|
9
|
-
public final class FontScaleStore: ObservableObject {
|
|
10
|
-
public static let shared = FontScaleStore()
|
|
11
|
-
|
|
12
|
-
@Published public private(set) var userScaleRate: CGFloat = 1
|
|
13
|
-
@Published public private(set) var useOSScaleRate: Bool = true
|
|
14
|
-
@Published public private(set) var osFontScale: CGFloat = FontScaleStore.currentOsFontScale()
|
|
15
|
-
|
|
16
|
-
private init() {
|
|
17
|
-
NotificationCenter.default.addObserver(
|
|
18
|
-
self,
|
|
19
|
-
selector: #selector(contentSizeCategoryDidChange),
|
|
20
|
-
name: UIContentSizeCategory.didChangeNotification,
|
|
21
|
-
object: nil
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public var snapshot: FontScale {
|
|
26
|
-
FontScale(
|
|
27
|
-
userScaleRate: userScaleRate,
|
|
28
|
-
useOSScaleRate: useOSScaleRate,
|
|
29
|
-
osFontScale: osFontScale
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public func update(userScaleRate: CGFloat, useOSScaleRate: Bool) {
|
|
34
|
-
onMain {
|
|
35
|
-
// Re-assigning an unchanged value would still publish and invalidate every kit subtree.
|
|
36
|
-
if self.userScaleRate != userScaleRate { self.userScaleRate = userScaleRate }
|
|
37
|
-
if self.useOSScaleRate != useOSScaleRate { self.useOSScaleRate = useOSScaleRate }
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@objc private func contentSizeCategoryDidChange() {
|
|
42
|
-
let next = Self.currentOsFontScale()
|
|
43
|
-
guard next != osFontScale else { return }
|
|
44
|
-
osFontScale = next
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/// Same factor Compose's iOS `ProvideOsFontScale` derives from
|
|
48
|
-
/// `UIFont.preferredFont(forTextStyle: .body).pointSize / 17`, so both iOS surfaces scale alike.
|
|
49
|
-
static func currentOsFontScale() -> CGFloat {
|
|
50
|
-
let base = UIFont.systemFont(ofSize: UIFont.labelFontSize)
|
|
51
|
-
return UIFontMetrics.default.scaledFont(for: base).pointSize / base.pointSize
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/// Synchronous when already on main — an async hop would defer the change by a frame.
|
|
55
|
-
private func onMain(_ work: @escaping () -> Void) {
|
|
56
|
-
if Thread.isMainThread { work() } else { DispatchQueue.main.async(execute: work) }
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
|
|
3
|
-
/// Design-system rollout flag for the SwiftUI kit, mirroring Compose's `KitDesignSystem`.
|
|
4
|
-
/// The kit is sandboxed and can't read the host config, so the host writes `update(_:)` once at
|
|
5
|
-
/// startup from `DesignSystemConfig`. Startup-only and non-reactive, like `FontScaleStore` was
|
|
6
|
-
/// before it gained live updates: there is no SwiftUI navigation container to re-render from.
|
|
7
|
-
public final class KitDesignSystem {
|
|
8
|
-
public static let shared = KitDesignSystem()
|
|
9
|
-
|
|
10
|
-
public private(set) var isWhiteList: Bool = false
|
|
11
|
-
|
|
12
|
-
private init() {}
|
|
13
|
-
|
|
14
|
-
public func update(isWhiteList: Bool) {
|
|
15
|
-
self.isWhiteList = isWhiteList
|
|
16
|
-
}
|
|
17
|
-
}
|