@momo-kits/native-kits 0.167.1-duo.8-debug → 0.167.1-duo.9
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 +4 -1
- package/ios/Application/ApplicationEnvironment.swift +11 -0
- package/ios/Application/ComposeApi.swift +2 -1
- package/ios/Application/{Components.swift → LegacyHeader.swift} +6 -62
- package/ios/Application/Screen.swift +3 -2
- package/ios/Avatar/Avatar.swift +4 -3
- package/ios/Badge/Badge.swift +6 -4
- package/ios/Badge/BadgeDot.swift +1 -1
- package/ios/Badge/BadgeRibbon.swift +0 -1
- package/ios/Button/Button.swift +15 -12
- package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +12 -20
- package/ios/Carousel/Carousel.swift +29 -12
- package/ios/Checkbox/Checkbox.swift +7 -3
- package/ios/Chip/Chip.swift +5 -4
- package/ios/Collapse/Collapse.swift +70 -19
- package/ios/Colors+Radius+Spacing/Colors.swift +9 -0
- package/ios/DateTimePicker/DateTimePicker.swift +54 -20
- package/ios/DateTimePicker/WheelPicker.swift +103 -105
- package/ios/Divider/Divider.swift +37 -4
- package/ios/Extensions/Color++.swift +18 -0
- package/ios/Icon/Icon.swift +7 -1
- package/ios/IconButton/IconButton.swift +15 -7
- package/ios/Image/Image.swift +7 -34
- package/ios/Information/Information.swift +27 -9
- package/ios/Input/ErrorView.swift +2 -2
- package/ios/Input/Input.swift +160 -147
- package/ios/Input/InputPhoneNumber.swift +12 -9
- package/ios/Input/InputSearch.swift +102 -75
- package/ios/Input/InputTextArea.swift +128 -145
- package/ios/InputDropDown/InputDropDown.swift +10 -7
- package/ios/InputMoney/InputMoney.swift +33 -11
- package/ios/InputOTP/InputOTP.swift +22 -12
- package/ios/Layout/Card.swift +50 -0
- package/ios/Layout/GridContext.swift +123 -3
- package/ios/Layout/Item.swift +5 -4
- package/ios/Layout/Section.swift +4 -100
- package/ios/Loader/Loader.swift +5 -9
- package/ios/Lottie/LottieView.swift +10 -0
- package/ios/{Application/Navigation/Overplay → Navigation}/BottomSheet.swift +61 -9
- package/ios/{Application/Navigation → Navigation}/BottomTab/BottomTab.swift +60 -34
- package/ios/{Application/Navigation → Navigation}/BottomTab/BottomTabBar.swift +11 -6
- package/ios/{Application → Navigation/Component}/FloatingButton.swift +14 -3
- package/ios/Navigation/Component/Header.swift +493 -0
- package/ios/Navigation/Component/HeaderBackground.swift +134 -0
- package/ios/Navigation/Component/HeaderJourney.swift +73 -0
- package/ios/Navigation/Component/HeaderLocation.swift +48 -0
- package/ios/Navigation/Component/HeaderRight.swift +386 -0
- package/ios/Navigation/Component/HeaderTitle.swift +36 -0
- package/ios/{Application/Navigation → Navigation/Component}/HeaderUser.swift +20 -23
- package/ios/{Application/Navigation/component → Navigation/Component}/SideBar.swift +49 -28
- package/ios/{Application/Navigation/Overplay → Navigation/Component}/SnackBar.swift +5 -5
- package/ios/Navigation/HostBackGestureBridge.swift +57 -0
- package/ios/Navigation/Navigation.swift +190 -0
- package/ios/{Application/Navigation → Navigation}/NavigationContainer.swift +46 -41
- package/ios/{Application/Navigation → Navigation}/Navigator.swift +65 -9
- package/ios/{Application → Navigation}/StackScreen.swift +236 -103
- package/ios/{Application/Navigation → Navigation}/Tracking/ScreenTracker.swift +12 -5
- package/ios/OTPKeyboard/OTPKeyboard.swift +8 -11
- package/ios/Pagination/PaginationScroll.swift +2 -2
- package/ios/Popup/PopupDisplay.swift +79 -159
- package/ios/Popup/PopupInput.swift +10 -13
- package/ios/Popup/PopupLayout.swift +97 -2
- package/ios/Popup/PopupNotify.swift +27 -55
- package/ios/Popup/PopupPromotion.swift +22 -50
- package/ios/PopupView/FullscreenPopup.swift +13 -19
- package/ios/PopupView/PopupView.swift +1 -1
- package/ios/PopupView/Utils++.swift +0 -8
- package/ios/ProgressInfo/ProgressInfo.swift +4 -2
- package/ios/Radio/Radio.swift +2 -1
- package/ios/Rating/Rating.swift +9 -1
- package/ios/ScrollIndicator/ScrollIndicator.swift +11 -10
- package/ios/Skeleton/Skeleton.swift +22 -27
- package/ios/Slider/Slider.swift +16 -18
- package/ios/Stepper/Stepper.swift +6 -1
- package/ios/Steps/Steps.swift +8 -6
- package/ios/SuggestAction/SuggestAction.swift +5 -0
- package/ios/Swipeable/SwipeCell.swift +10 -6
- package/ios/Switch/Switch.swift +22 -20
- package/ios/TabView/TabView.swift +102 -21
- package/ios/Tag/Tag.swift +15 -4
- package/ios/Template/Logo/Logo.swift +2 -1
- package/ios/Template/TrustBanner/TrustBanner.swift +41 -27
- package/ios/Title/Title.swift +6 -17
- package/ios/Tooltip/Tooltip.swift +29 -14
- package/ios/Typography/Text.swift +61 -19
- package/ios/Uploader/Uploader.swift +3 -1
- package/ios/native-kits.podspec +1 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +1 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +77 -1
- package/package.json +1 -1
- package/build.gradle.kts +0 -11
- package/compose/build.gradle.kts +0 -204
- package/compose/build.gradle.kts.backup +0 -204
- package/compose/compose.podspec +0 -47
- package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -19
- package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +0 -12
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -153
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +0 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -52
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -124
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -183
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -207
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -39
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -293
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -831
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -269
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -110
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -378
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -82
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -356
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -113
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -542
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -49
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -231
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -189
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -475
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -114
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -266
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -240
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -223
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -264
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -185
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -84
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -361
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -108
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -310
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -90
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -323
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -220
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -473
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -199
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -91
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -552
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -88
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -125
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -207
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -498
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -176
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -234
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -188
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitDesignSystem.kt +0 -18
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +0 -22
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -188
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -297
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -54
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -50
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -232
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -41
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -338
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +0 -58
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -137
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -106
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -205
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -393
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -708
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +0 -148
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +0 -35
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -203
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -232
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +0 -98
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +0 -312
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -169
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -408
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -92
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -105
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +0 -74
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -366
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -37
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -363
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +0 -185
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -132
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -127
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +0 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -91
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -74
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +0 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -118
- package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -40
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +0 -45
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -32
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +0 -38
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -217
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +0 -86
- package/gradle/libs.versions.toml +0 -69
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +0 -8
- package/gradle.properties +0 -26
- package/gradlew +0 -252
- package/gradlew.bat +0 -94
- package/ios/Application/HeaderRight.swift +0 -324
- package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
- package/ios/Application/Navigation/HeaderTitle.swift +0 -57
- package/ios/Application/Navigation/NavigationOptions.swift +0 -109
- package/ios/Application/Navigation/NavigatorManager.swift +0 -29
- package/ios/Application/Navigation/component/DuoScrollGradient.swift +0 -54
- package/ios/Application/Navigation/component/Header.swift +0 -183
- package/ios/Application/Navigation/component/HeaderBackground.swift +0 -84
- package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
- package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +0 -11
- package/ios/Application/Navigation/component/NavigationFooter.swift +0 -90
- package/ios/Application/Navigation/component/NavigationHeaderRight.swift +0 -280
- package/ios-demo/README.md +0 -120
- package/settings.gradle.kts +0 -64
- /package/ios/{Application/Layout → Layout}/ScreenLayout.swift +0 -0
- /package/ios/{Application/Navigation → Navigation}/BottomTab/CurvedContainer.swift +0 -0
- /package/ios/{Application/Navigation → Navigation}/BottomTab/DuoBarCompression.swift +0 -0
- /package/ios/{Application/Navigation → Navigation}/BottomTab/DuoTabBar.swift +0 -0
- /package/ios/{Application/Navigation/Overplay → Navigation}/ModalScreen.swift +0 -0
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
import Foundation
|
|
3
|
-
|
|
4
|
-
/// Keyed (`@Environment(\.applicationEnvironment)`) variant of `HeaderRight`, for hosts
|
|
5
|
-
/// wired through `NavigationContainer`/`KitContainer` (the injection style introduced by
|
|
6
|
-
/// MR 227 / DS-637). Reuses the shared data types (`HeaderRightData`, `Tool`, `ToolGroup`)
|
|
7
|
-
/// and `NavigationButton` from `HeaderRight.swift`. The legacy `HeaderRight` there stays on
|
|
8
|
-
/// `@EnvironmentObject` for hosts that render `Screen` directly with
|
|
9
|
-
/// `.environmentObject(ApplicationEnvironment(...))`. Opt in per screen with
|
|
10
|
-
/// `headerRight: { NavigationHeaderRight() }`.
|
|
11
|
-
public struct NavigationHeaderRight: View {
|
|
12
|
-
public init(headerRight: HeaderRightData? = nil, tintColor: Color? = nil) {
|
|
13
|
-
self.headerRight = headerRight
|
|
14
|
-
self.tintColor = tintColor
|
|
15
|
-
}
|
|
16
|
-
var headerRight: HeaderRightData?
|
|
17
|
-
var tintColor: Color? = nil
|
|
18
|
-
|
|
19
|
-
public var body: some View {
|
|
20
|
-
HStack(alignment: .center) {
|
|
21
|
-
ToolkitNavigationHeaderRight(headerRight: headerRight, tintColor: tintColor)
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
struct ToolkitNavigationHeaderRight: View {
|
|
27
|
-
var headerRight: HeaderRightData?
|
|
28
|
-
var tintColor: Color?
|
|
29
|
-
/// iPhone Duo side bar column instead of the bar row.
|
|
30
|
-
var vertical: Bool = false
|
|
31
|
-
@State private var isFavorite: Bool = false
|
|
32
|
-
@State private var isLoading: Bool = false
|
|
33
|
-
@Environment(\.applicationEnvironment) private var environment
|
|
34
|
-
@Environment(\.duoBarCompression) private var compression
|
|
35
|
-
|
|
36
|
-
private func apiValue(_ value: Any?) -> Any {
|
|
37
|
-
value ?? NSNull()
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private var contextMap: [String: Any] {
|
|
41
|
-
let context = environment.applicationContext
|
|
42
|
-
return [
|
|
43
|
-
"appId": apiValue(context?.appId),
|
|
44
|
-
"code": apiValue(context?.appCode),
|
|
45
|
-
"name": apiValue(context?.appName),
|
|
46
|
-
"icon": apiValue(context?.appIcon),
|
|
47
|
-
"description": apiValue(context?.description),
|
|
48
|
-
"support": apiValue(context?.support),
|
|
49
|
-
"toolkitConfig": apiValue(context?.toolkitConfig),
|
|
50
|
-
"providerId": apiValue(context?.providerId),
|
|
51
|
-
"permissions": apiValue(context?.permissions)
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
private var shouldShowShortcut: Bool {
|
|
56
|
-
headerRight?.useShortcut == true && !(headerRight?.useMore == true && environment.applicationContext == nil)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private func parseResponse(_ response: String) -> Any? {
|
|
60
|
-
guard let jsonData = response.data(using: .utf8),
|
|
61
|
-
let json = try? JSONSerialization.jsonObject(with: jsonData) as? [String: Any] else {
|
|
62
|
-
return nil
|
|
63
|
-
}
|
|
64
|
-
return json["response"]
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// MARK: - Actions
|
|
68
|
-
private func loadFavoriteState() {
|
|
69
|
-
environment.composeApi?.request(
|
|
70
|
-
funcName: "isFavoriteApp",
|
|
71
|
-
params: ["code": apiValue(environment.applicationContext?.appCode)]
|
|
72
|
-
) { response in
|
|
73
|
-
if let isFavorite = parseResponse(response) as? Bool {
|
|
74
|
-
self.isFavorite = isFavorite
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
private func onPressShortcut() {
|
|
80
|
-
environment.composeApi?.request(
|
|
81
|
-
funcName: "onToolAction",
|
|
82
|
-
params: [
|
|
83
|
-
"item": ["key": "onFavorite"],
|
|
84
|
-
"context": contextMap
|
|
85
|
-
]
|
|
86
|
-
) { response in
|
|
87
|
-
if let result = parseResponse(response) as? [String: Any],
|
|
88
|
-
result["success"] as? Bool == true {
|
|
89
|
-
isFavorite.toggle()
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
private func onPressHelpCenter() {
|
|
95
|
-
environment.composeApi?.request(
|
|
96
|
-
funcName: "showHelpCenter",
|
|
97
|
-
params: [
|
|
98
|
-
"appId": apiValue(environment.applicationContext?.appId),
|
|
99
|
-
"code": apiValue(environment.applicationContext?.appCode),
|
|
100
|
-
"name": apiValue(environment.applicationContext?.appName),
|
|
101
|
-
"icon": apiValue(environment.applicationContext?.appIcon),
|
|
102
|
-
"description": apiValue(environment.applicationContext?.description)
|
|
103
|
-
]
|
|
104
|
-
) { _ in }
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
private func onPressClose() {
|
|
108
|
-
environment.composeApi?.request(
|
|
109
|
-
funcName: "dismissAll",
|
|
110
|
-
params: nil
|
|
111
|
-
) { _ in }
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private func onPressMore() {
|
|
115
|
-
let params: [String: Any] = [
|
|
116
|
-
"useSystemTools": headerRight?.useSystemTools ?? true,
|
|
117
|
-
"tools": headerRight?.tools.map { $0.toMap() } ?? [],
|
|
118
|
-
"context": contextMap
|
|
119
|
-
]
|
|
120
|
-
environment.composeApi?.request(
|
|
121
|
-
funcName: "showTools",
|
|
122
|
-
params: params
|
|
123
|
-
) { response in
|
|
124
|
-
if let toolResponse = parseResponse(response) as? String {
|
|
125
|
-
headerRight?.toolCallback?(toolResponse)
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
private func getNavigationButtonConfig() -> NavigationButtonConfig {
|
|
131
|
-
let totalTools = headerRight?.tools.reduce(0) { $0 + $1.items.count } ?? 0
|
|
132
|
-
var icon = isFavorite ? "pin_star_checked" : "pin_star"
|
|
133
|
-
var onClickHandler: () -> Void = onPressShortcut
|
|
134
|
-
|
|
135
|
-
if totalTools > 1 || headerRight?.useMore == true {
|
|
136
|
-
icon = "navigation_more_icon"
|
|
137
|
-
onClickHandler = onPressMore
|
|
138
|
-
} else if totalTools == 1, let singleTool = headerRight?.tools.first?.items.first {
|
|
139
|
-
icon = singleTool.icon
|
|
140
|
-
onClickHandler = {
|
|
141
|
-
headerRight?.toolCallback?(singleTool.key)
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return NavigationButtonConfig(icon: icon, onPress: onClickHandler)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
private var showHelpCenter: Bool {
|
|
149
|
-
environment.applicationContext != nil && showsHelpCenter(environment.applicationContext)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
private var closeIcon: String { headerRight?.closeIcon ?? "16_basic_home" }
|
|
153
|
-
|
|
154
|
-
var body: some View {
|
|
155
|
-
Group {
|
|
156
|
-
if vertical {
|
|
157
|
-
verticalBody
|
|
158
|
-
} else {
|
|
159
|
-
horizontalBody
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
.onAppear {
|
|
163
|
-
loadFavoriteState()
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
private var showBadge: Bool {
|
|
168
|
-
headerRight?.tools.contains { group in
|
|
169
|
-
group.items.contains { $0.showBadge }
|
|
170
|
-
} ?? false
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/// Back slot, the optional shortcut, then the help/home capsule.
|
|
174
|
-
private var fullToolbarHeight: CGFloat {
|
|
175
|
-
DuoMetrics.controlSize + Spacing.M
|
|
176
|
-
+ (shouldShowShortcut ? DuoMetrics.controlSize + Spacing.M : 0)
|
|
177
|
-
+ (showHelpCenter ? 2 * DuoMetrics.itemPitch : DuoMetrics.controlSize)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
@ViewBuilder
|
|
181
|
-
private var verticalBody: some View {
|
|
182
|
-
Group {
|
|
183
|
-
if compression.toolbarHidden {
|
|
184
|
-
// an open tab rail takes this slot for a moment
|
|
185
|
-
EmptyView()
|
|
186
|
-
} else if compression.toolbarCompressed {
|
|
187
|
-
// HIG "Toolbar compressed": tools fold into one button, distinct from the useMore icon
|
|
188
|
-
SideBarButton(
|
|
189
|
-
icon: "navigation_menu",
|
|
190
|
-
tintColor: tintColor,
|
|
191
|
-
showBadge: showBadge,
|
|
192
|
-
accessibilityId: "btn_navigation_toolbar",
|
|
193
|
-
action: compression.expandToolbar
|
|
194
|
-
)
|
|
195
|
-
} else {
|
|
196
|
-
toolbarColumn
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
// full height, so the tab bar compression decision matches this screen's toolkit
|
|
200
|
-
.onAppear { compression.setToolbarHeight(fullToolbarHeight) }
|
|
201
|
-
.onChange(of: fullToolbarHeight) { compression.setToolbarHeight($0) }
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
private var toolbarColumn: some View {
|
|
205
|
-
let navButtonConfig = getNavigationButtonConfig()
|
|
206
|
-
return VStack(spacing: Spacing.M) {
|
|
207
|
-
if shouldShowShortcut {
|
|
208
|
-
SideBarButton(
|
|
209
|
-
icon: navButtonConfig.icon,
|
|
210
|
-
tintColor: tintColor,
|
|
211
|
-
showBadge: showBadge,
|
|
212
|
-
disabled: isLoading,
|
|
213
|
-
action: navButtonConfig.onPress
|
|
214
|
-
)
|
|
215
|
-
}
|
|
216
|
-
SideBarGroup(tintColor: tintColor, itemCount: showHelpCenter ? 2 : 1) {
|
|
217
|
-
if showHelpCenter {
|
|
218
|
-
SideBarGroupItem(
|
|
219
|
-
icon: "help_center",
|
|
220
|
-
tintColor: tintColor,
|
|
221
|
-
accessibilityId: "btn_navigation_help_center",
|
|
222
|
-
action: onPressHelpCenter
|
|
223
|
-
)
|
|
224
|
-
}
|
|
225
|
-
SideBarGroupItem(
|
|
226
|
-
icon: closeIcon,
|
|
227
|
-
tintColor: tintColor,
|
|
228
|
-
accessibilityId: "btn_navigation_close",
|
|
229
|
-
action: onPressClose
|
|
230
|
-
)
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
private var horizontalBody: some View {
|
|
236
|
-
let backgroundButtonColor: Color = tintColor == Colors.black01 ? Colors.black20.opacity(0.6) : Colors.black01.opacity(0.6)
|
|
237
|
-
let borderColor: Color = tintColor == Colors.black01 ? Colors.black01.opacity(0.2) : Colors.black20.opacity(0.2)
|
|
238
|
-
let navButtonConfig = getNavigationButtonConfig()
|
|
239
|
-
|
|
240
|
-
return HStack(alignment: .center, spacing: 0) {
|
|
241
|
-
if shouldShowShortcut {
|
|
242
|
-
NavigationButton(
|
|
243
|
-
disabled: isLoading,
|
|
244
|
-
icon: navButtonConfig.icon,
|
|
245
|
-
showBadge: showBadge,
|
|
246
|
-
onClick: navButtonConfig.onPress,
|
|
247
|
-
tintColor: tintColor
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
HStack(alignment: .center, spacing: 0) {
|
|
252
|
-
if showHelpCenter {
|
|
253
|
-
Icon(source: "help_center", size: 20, color: tintColor ?? Colors.black17)
|
|
254
|
-
.padding(4)
|
|
255
|
-
.onTapGesture {
|
|
256
|
-
onPressHelpCenter()
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
Rectangle()
|
|
260
|
-
.fill(tintColor ?? Colors.black20)
|
|
261
|
-
.frame(width: 0.5, height: 12)
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
Icon(source: closeIcon, size: 20, color: tintColor ?? Colors.black17)
|
|
265
|
-
.padding(4)
|
|
266
|
-
.onTapGesture {
|
|
267
|
-
onPressClose()
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
.frame(width: 65, height: 28)
|
|
271
|
-
.background(backgroundButtonColor)
|
|
272
|
-
.cornerRadius(14)
|
|
273
|
-
.overlay(
|
|
274
|
-
RoundedRectangle(cornerRadius: 14)
|
|
275
|
-
.stroke(borderColor, lineWidth: 0.2)
|
|
276
|
-
)
|
|
277
|
-
.padding(.leading, Spacing.S)
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
package/ios-demo/README.md
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# MoMoUIKitsDemo
|
|
2
|
-
|
|
3
|
-
SwiftUI demo browser for `MoMoUIKits`.
|
|
4
|
-
|
|
5
|
-
The package can optionally host a Compose UIKits screen by receiving a
|
|
6
|
-
`UIViewController` factory from the host app. It does not import the KMP
|
|
7
|
-
`shared` module directly.
|
|
8
|
-
|
|
9
|
-
SwiftUI mode reuses the full demo screen set from
|
|
10
|
-
`sample/iosApp/iosApp/Demo`, including the sample `HomeView` registry and demo
|
|
11
|
-
screens for all currently available components.
|
|
12
|
-
|
|
13
|
-
## CocoaPods
|
|
14
|
-
|
|
15
|
-
In the host app `Podfile`, include both local pods:
|
|
16
|
-
|
|
17
|
-
```ruby
|
|
18
|
-
pod 'MoMoUIKits', :path => '../momo-native-kits/ios/native-kits.podspec'
|
|
19
|
-
pod 'MoMoUIKitsDemo', :path => '../momo-native-kits/ios-demo'
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Adjust the relative paths to match the host app checkout.
|
|
23
|
-
|
|
24
|
-
## Host App Usage
|
|
25
|
-
|
|
26
|
-
```swift
|
|
27
|
-
import MoMoUIKitsDemo
|
|
28
|
-
import shared
|
|
29
|
-
|
|
30
|
-
class UIKitsViewController: BaseComposeAppViewController {
|
|
31
|
-
override func getViewController() -> UIViewController? {
|
|
32
|
-
let params = self.application.data as? [String: Any]
|
|
33
|
-
|
|
34
|
-
return MoMoUIKitsDemoViewControllerFactory.make(
|
|
35
|
-
context: MoMoUIKitsDemoContext(
|
|
36
|
-
appId: params?["appId"] as? String ?? "",
|
|
37
|
-
appCode: params?["code"] as? String ?? "",
|
|
38
|
-
appName: params?["name"] as? String,
|
|
39
|
-
appIcon: params?["icon"] as? String ?? ""
|
|
40
|
-
),
|
|
41
|
-
composeViewController: {
|
|
42
|
-
UIKitsScreenComposeViewControllerKt.UIKitsScreenComposeViewController(
|
|
43
|
-
params: params
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
override func viewDidDisappear(_ animated: Bool) {
|
|
50
|
-
super.viewDidDisappear(animated)
|
|
51
|
-
composeViewController = nil
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
If the host does not pass `composeViewController`, the demo opens directly in
|
|
57
|
-
SwiftUI mode.
|
|
58
|
-
|
|
59
|
-
## Included SwiftUI Demos
|
|
60
|
-
|
|
61
|
-
The pod includes the sample demo screens for:
|
|
62
|
-
|
|
63
|
-
- Animated Header
|
|
64
|
-
- Avatar
|
|
65
|
-
- Badge
|
|
66
|
-
- Baseline View
|
|
67
|
-
- Bottom Tab
|
|
68
|
-
- Button
|
|
69
|
-
- Carousel
|
|
70
|
-
- Checkbox
|
|
71
|
-
- Chip
|
|
72
|
-
- Collapse
|
|
73
|
-
- DateTimePicker
|
|
74
|
-
- Divider
|
|
75
|
-
- Header User
|
|
76
|
-
- Icon Button
|
|
77
|
-
- Image
|
|
78
|
-
- Information
|
|
79
|
-
- Input
|
|
80
|
-
- Input DropDown
|
|
81
|
-
- Input Money
|
|
82
|
-
- Input OTP
|
|
83
|
-
- Input Phone Number
|
|
84
|
-
- Input Search
|
|
85
|
-
- Input TextArea
|
|
86
|
-
- Loader
|
|
87
|
-
- Navigation
|
|
88
|
-
- Pagination
|
|
89
|
-
- Popup Display
|
|
90
|
-
- Popup Notify
|
|
91
|
-
- Popup Promotion
|
|
92
|
-
- Progress Info
|
|
93
|
-
- Radio
|
|
94
|
-
- Rating
|
|
95
|
-
- Skeleton
|
|
96
|
-
- Slider
|
|
97
|
-
- SnackBar
|
|
98
|
-
- Stepper
|
|
99
|
-
- Steps
|
|
100
|
-
- Suggest Action
|
|
101
|
-
- Swipe
|
|
102
|
-
- Switch
|
|
103
|
-
- TabView
|
|
104
|
-
- Tag
|
|
105
|
-
- Theme
|
|
106
|
-
- Title
|
|
107
|
-
- Tooltip
|
|
108
|
-
- Typography
|
|
109
|
-
- Uploader
|
|
110
|
-
|
|
111
|
-
## Validation Notes
|
|
112
|
-
|
|
113
|
-
Validated locally with:
|
|
114
|
-
|
|
115
|
-
```sh
|
|
116
|
-
pod ipc spec ios/MoMoUIKits.podspec
|
|
117
|
-
pod ipc spec ios-demo/MoMoUIKitsDemo.podspec
|
|
118
|
-
pod lib lint ios/MoMoUIKits.podspec --allow-warnings --skip-import-validation
|
|
119
|
-
pod lib lint ios-demo/MoMoUIKitsDemo.podspec --allow-warnings --skip-import-validation --include-podspecs=ios/MoMoUIKits.podspec
|
|
120
|
-
```
|
package/settings.gradle.kts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
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")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|