@momo-kits/native-kits 0.169.5-beta.2 → 0.169.5-beta.3-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 +1 -1
- package/PUBLISH_GUIDE.md +11 -4
- package/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +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 +293 -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 +430 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +100 -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 +208 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +129 -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 +456 -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 +204 -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 +114 -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 +24 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/ios/Layout/ModalLayout.swift +2 -2
- package/ios/Navigation/BottomTab/BottomTabBar.swift +8 -2
- package/ios/Navigation/BottomTab/CurvedContainer.swift +13 -12
- package/ios/Navigation/BottomTab/DuoTabBar.swift +5 -1
- package/ios/Navigation/BottomTab/TabBarMetrics.swift +18 -4
- package/ios/Popup/PopupDisplay.swift +3 -3
- package/ios/Popup/PopupInput.swift +1 -1
- package/ios/Popup/PopupLayout.swift +3 -3
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/ios-demo/README.md +120 -0
- package/package.json +4 -1
- package/publish.sh +43 -10
- package/settings.gradle.kts +64 -0
|
@@ -171,7 +171,11 @@ private struct DuoFloatingTabBar: View {
|
|
|
171
171
|
floatingButton: floatingButton,
|
|
172
172
|
selectedIndex: selectedIndex,
|
|
173
173
|
onTabSelected: onTabSelected,
|
|
174
|
-
width: TabBarMetrics.horizontalBarWidth(
|
|
174
|
+
width: TabBarMetrics.horizontalBarWidth(
|
|
175
|
+
layout,
|
|
176
|
+
itemCount: items.count,
|
|
177
|
+
hasCta: TabBarMetrics.hasCenterAction(floatingButton, tabCount: items.count)
|
|
178
|
+
),
|
|
175
179
|
fixedFontScale: true
|
|
176
180
|
)
|
|
177
181
|
.padding(.bottom, layout.duoFloatingTabBarBottom)
|
|
@@ -11,11 +11,18 @@
|
|
|
11
11
|
import SwiftUI
|
|
12
12
|
|
|
13
13
|
enum TabBarMetrics {
|
|
14
|
-
static let height: CGFloat =
|
|
14
|
+
static let height: CGFloat = 60
|
|
15
15
|
static let margin = Spacing.S
|
|
16
|
-
static let paddingVertical = Spacing.
|
|
16
|
+
static let paddingVertical = Spacing.XS
|
|
17
17
|
static let paddingHorizontal = Spacing.M
|
|
18
|
-
static let itemGap =
|
|
18
|
+
static let itemGap: CGFloat = 1
|
|
19
|
+
// gap between the icon slot and the label inside a tab (Figma: none)
|
|
20
|
+
static let itemIconLabelGap: CGFloat = 0
|
|
21
|
+
// .Nav/Background: no backdrop blur, so use the Figma Blur=Off spec (opacity 95%, no blur) plus the 1px
|
|
22
|
+
// border below — nearly solid, matching the frosted sample; surface keeps dark-mode support
|
|
23
|
+
static let backgroundOpacity: CGFloat = 0.95
|
|
24
|
+
// white 60% hairline around the center action button (Figma Icon Button border)
|
|
25
|
+
static let ctaBorderOpacity: CGFloat = 0.6
|
|
19
26
|
static let iconSize: CGFloat = 24
|
|
20
27
|
static let indicatorHeight: CGFloat = 32
|
|
21
28
|
// label_s_medium / label_xs_medium line heights: the label slot keeps this height so a scaled
|
|
@@ -29,6 +36,9 @@ enum TabBarMetrics {
|
|
|
29
36
|
// centered; phones and folded outer displays fill the window
|
|
30
37
|
static let foldableMinShortSide: CGFloat = 600
|
|
31
38
|
static let foldableWidthRatio: CGFloat = 0.65
|
|
39
|
+
// a 2-tab bar doesn't stretch to the full width: each item is this fixed width and the bar is sized
|
|
40
|
+
// to its content, centered (Figma Navigation · 2 Tab: item 100, bar ~225)
|
|
41
|
+
static let twoTabItemWidth: CGFloat = 100
|
|
32
42
|
static let ctaSlotWidth: CGFloat = 92
|
|
33
43
|
static let ctaSize: CGFloat = 48
|
|
34
44
|
// the icon sits 10 inside the 48 button (prototype .cta: 28 icon), 12 inside the 52 rail one
|
|
@@ -70,7 +80,11 @@ enum TabBarMetrics {
|
|
|
70
80
|
|
|
71
81
|
/// Width of the horizontal bar: 65% of the short side on an unfolded foldable, otherwise the window
|
|
72
82
|
/// minus the side safe areas and margins.
|
|
73
|
-
static func horizontalBarWidth(_ layout: ScreenLayout) -> CGFloat {
|
|
83
|
+
static func horizontalBarWidth(_ layout: ScreenLayout, itemCount: Int, hasCta: Bool) -> CGFloat {
|
|
84
|
+
// 2 tabs (no center action) stay content-sized and centered instead of filling the window
|
|
85
|
+
if itemCount == 2 && !hasCta {
|
|
86
|
+
return twoTabItemWidth * 2 + paddingHorizontal * 2 + itemGap
|
|
87
|
+
}
|
|
74
88
|
let shortSide = min(layout.width, layout.height)
|
|
75
89
|
if shortSide >= foldableMinShortSide { return shortSide * foldableWidthRatio }
|
|
76
90
|
return layout.width - layout.insets.leading - layout.insets.trailing - 2 * margin
|
|
@@ -108,7 +108,7 @@ public struct PopupDisplay: View {
|
|
|
108
108
|
}
|
|
109
109
|
.fixedSize(horizontal: false, vertical: true)
|
|
110
110
|
.background(theme.colors.background.surface)
|
|
111
|
-
.clipShape(RoundedRectangle(cornerRadius: layout.popupRadius))
|
|
111
|
+
.clipShape(RoundedRectangle(cornerRadius: layout.popupRadius()))
|
|
112
112
|
|
|
113
113
|
if isShowCloseIcon {
|
|
114
114
|
ModalIconButton(icon: "navigation_close", accessibilityId: "ic_popup_close", action: onClose)
|
|
@@ -116,8 +116,8 @@ public struct PopupDisplay: View {
|
|
|
116
116
|
.padding(.trailing, Spacing.M)
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
.
|
|
119
|
+
.frame(maxWidth: layout.popupMaxWidth)
|
|
120
|
+
.padding(.horizontal, layout.popupHorizontalPadding(12))
|
|
121
121
|
.accessibilityElement(children: .contain)
|
|
122
122
|
.accessibilityIdentifier("popup_notify")
|
|
123
123
|
}
|
|
@@ -61,7 +61,7 @@ public struct PopupInput: View {
|
|
|
61
61
|
.padding(.trailing, Spacing.M)
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
.background(theme.colors.background.surface.cornerRadius(layout.popupRadius))
|
|
64
|
+
.background(theme.colors.background.surface.cornerRadius(layout.popupRadius(8)))
|
|
65
65
|
.shadow(color: .black.opacity(0.08), radius: 2, x: 0, y: 0)
|
|
66
66
|
.shadow(color: .black.opacity(0.16), radius: 24, x: 0, y: 0)
|
|
67
67
|
.frame(maxWidth: layout.popupMaxWidth)
|
|
@@ -19,9 +19,9 @@ extension ScreenLayout {
|
|
|
19
19
|
modalLayout.popup.maxHeight
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
func popupRadius(_ regular: CGFloat = Radius.L) -> CGFloat {
|
|
23
|
+
let modal = modalLayout
|
|
24
|
+
return modal.isFoldable ? modal.popup.radius : regular
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
package/ios/native-kits.podspec
CHANGED
|
@@ -0,0 +1,120 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/native-kits",
|
|
3
|
-
"version": "0.169.5-beta.
|
|
3
|
+
"version": "0.169.5-beta.3-debug",
|
|
4
4
|
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"publish:local": "bash publish.sh local"
|
|
7
|
+
},
|
|
5
8
|
"dependeNavigationncies": {},
|
|
6
9
|
"devDependencies": {},
|
|
7
10
|
"license": "MoMo"
|
package/publish.sh
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
# Build & publish vn.momo.kits:kits / :demo (GitLab Maven) and @momo-kits/native-kits (npm).
|
|
3
3
|
#
|
|
4
4
|
# bash publish.sh build # build everything that gets published, no upload
|
|
5
|
-
# bash publish.sh
|
|
6
|
-
# bash publish.sh beta # <npm latest + 1 patch>-beta.N, npm tag beta
|
|
5
|
+
# bash publish.sh local # beta of the working tree as is (uncommitted too), any branch
|
|
6
|
+
# bash publish.sh beta # CI, other branches: <npm latest + 1 patch>-beta.N, npm tag beta
|
|
7
|
+
# bash publish.sh release [--version 0.169.1] # CI, main only: npm tag latest; default = npm latest + 1 patch
|
|
7
8
|
# --dry-run: resolve the version and pack the npm tarballs, upload nothing
|
|
8
9
|
#
|
|
9
10
|
# The version is never read from the repo; files touched here are put back on exit.
|
|
@@ -26,6 +27,7 @@ MODE="${1:-}"
|
|
|
26
27
|
[ $# -gt 0 ] && shift
|
|
27
28
|
RELEASE_VERSION="${RELEASE_VERSION:-}"
|
|
28
29
|
DRY_RUN=false
|
|
30
|
+
CHANNEL=""
|
|
29
31
|
while [ $# -gt 0 ]; do
|
|
30
32
|
case "$1" in
|
|
31
33
|
--version) RELEASE_VERSION="${2:-}"; shift 2 ;;
|
|
@@ -85,6 +87,11 @@ set_podspec_version() {
|
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
GRADLE_ARGS=(--stacktrace)
|
|
90
|
+
# IMPORTANT: Maven now publishes to MoMo Artifacts, so its PUBLISHING_* credentials win over a legacy
|
|
91
|
+
# MAVEN_USER/MAVEN_TOKEN (GitLab 5400 deploy token) that may still be set on the project.
|
|
92
|
+
# exported so the resolve-version.mjs subprocess reads them from the environment (reads Maven metadata)
|
|
93
|
+
export MAVEN_USER="${PUBLISHING_USER:-${MAVEN_USER:-}}"
|
|
94
|
+
export MAVEN_TOKEN="${PUBLISHING_PASSWORD:-${MAVEN_TOKEN:-}}"
|
|
88
95
|
if [ -n "${MAVEN_USER:-}" ] && [ -n "${MAVEN_TOKEN:-}" ]; then
|
|
89
96
|
GRADLE_ARGS+=("-Pgitlab.user=$MAVEN_USER" "-Pgitlab.password=$MAVEN_TOKEN")
|
|
90
97
|
fi
|
|
@@ -107,17 +114,20 @@ phase_build() {
|
|
|
107
114
|
# ----------------------------------------------------------------------------
|
|
108
115
|
# version: ask the registries, then stamp package.json + podspecs.
|
|
109
116
|
# ----------------------------------------------------------------------------
|
|
110
|
-
|
|
111
|
-
section "📋 VERSION ($MODE)"
|
|
112
|
-
local args=("$MODE")
|
|
113
|
-
if [ -n "$RELEASE_VERSION" ]; then
|
|
114
|
-
[ "$MODE" = "release" ] || die "--version / RELEASE_VERSION is only for release"
|
|
115
|
-
args+=(--version "$RELEASE_VERSION")
|
|
116
|
-
fi
|
|
117
|
+
check_npm_auth() {
|
|
117
118
|
# A bad token only surfaces as a 404 on the PUT, so check auth before anything is uploaded.
|
|
118
119
|
if [ "$DRY_RUN" != true ] && ! npm whoami "${NPM_ARGS[@]}" >/dev/null 2>&1; then
|
|
119
120
|
die "npm auth failed (npm whoami): set NPM_TOKEN or renew the token in .npmrc"
|
|
120
121
|
fi
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
phase_version() {
|
|
125
|
+
section "📋 VERSION ($CHANNEL)"
|
|
126
|
+
local args=("$CHANNEL")
|
|
127
|
+
if [ -n "$RELEASE_VERSION" ]; then
|
|
128
|
+
[ "$CHANNEL" = "release" ] || die "--version / RELEASE_VERSION is only for release"
|
|
129
|
+
args+=(--version "$RELEASE_VERSION")
|
|
130
|
+
fi
|
|
121
131
|
|
|
122
132
|
local resolved
|
|
123
133
|
resolved="$(node scripts/ci/resolve-version.mjs "${args[@]}")"
|
|
@@ -142,6 +152,8 @@ phase_maven() {
|
|
|
142
152
|
echo "⏭️ dry run: skipping Maven upload"
|
|
143
153
|
return
|
|
144
154
|
fi
|
|
155
|
+
# Publishing target is MoMo Artifacts (url in gradle.properties); credentials reach Gradle via GRADLE_ARGS.
|
|
156
|
+
[ -n "${MAVEN_USER:-}" ] && [ -n "${MAVEN_TOKEN:-}" ] || die "Set PUBLISHING_USER/PUBLISHING_PASSWORD for MoMo Artifacts"
|
|
145
157
|
strip_sample_resources
|
|
146
158
|
./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository \
|
|
147
159
|
:sample:shared:publishAllPublicationsToGitLabPackagesRepository \
|
|
@@ -193,6 +205,7 @@ build/
|
|
|
193
205
|
.gitattributes
|
|
194
206
|
.gitlab-ci.yml
|
|
195
207
|
scripts/ci/
|
|
208
|
+
local.properties
|
|
196
209
|
EOF
|
|
197
210
|
npm_publish
|
|
198
211
|
echo "✅ $VERSION-debug done"
|
|
@@ -208,12 +221,32 @@ case "$MODE" in
|
|
|
208
221
|
phase_build
|
|
209
222
|
;;
|
|
210
223
|
release|beta)
|
|
224
|
+
if [ "$MODE" = release ] && [ -z "${GITLAB_CI:-}" ] && [ "$DRY_RUN" != true ]; then
|
|
225
|
+
die "release (npm tag latest) is published by CI from main only; locally use: bash publish.sh local"
|
|
226
|
+
fi
|
|
227
|
+
CHANNEL="$MODE"
|
|
228
|
+
check_npm_auth
|
|
229
|
+
phase_version
|
|
230
|
+
phase_maven
|
|
231
|
+
phase_npm
|
|
232
|
+
section "🎉 $VERSION published (npm tag $NPM_TAG)"
|
|
233
|
+
;;
|
|
234
|
+
local)
|
|
235
|
+
[ -z "$RELEASE_VERSION" ] || die "local only publishes betas; --version / RELEASE_VERSION is for release"
|
|
236
|
+
CHANNEL=beta
|
|
237
|
+
BRANCH="$(git branch --show-current)"
|
|
238
|
+
DIRTY=""
|
|
239
|
+
[ -z "$(git status --porcelain)" ] || DIRTY=" + uncommitted changes"
|
|
240
|
+
section "🏠 LOCAL beta from ${BRANCH:-detached HEAD} @ $(git rev-parse --short HEAD)$DIRTY"
|
|
241
|
+
check_npm_auth
|
|
242
|
+
# Outside CI's kits-publish lock: build first so the number is picked right before the upload.
|
|
243
|
+
[ "$DRY_RUN" = true ] || phase_build
|
|
211
244
|
phase_version
|
|
212
245
|
phase_maven
|
|
213
246
|
phase_npm
|
|
214
247
|
section "🎉 $VERSION published (npm tag $NPM_TAG)"
|
|
215
248
|
;;
|
|
216
249
|
*)
|
|
217
|
-
die "Usage: bash publish.sh build |
|
|
250
|
+
die "Usage: bash publish.sh build | local [--dry-run] | beta [--dry-run] | release [--version x.y.z] (CI)"
|
|
218
251
|
;;
|
|
219
252
|
esac
|
|
@@ -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")
|