@momo-kits/native-kits 0.169.5-beta.2-debug → 0.169.5-beta.3
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/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/package.json +4 -1
- package/publish.sh +43 -10
- package/build.gradle.kts +0 -11
- package/compose/build.gradle.kts +0 -198
- package/compose/compose.podspec +0 -47
- package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -20
- 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 -154
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +0 -17
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +0 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -110
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +0 -62
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -1071
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -269
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
- 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 -81
- 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 -357
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -115
- 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 -86
- 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 -195
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -478
- 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 -265
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
- 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 -265
- 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 -363
- 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 -308
- 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 -330
- 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 -207
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -92
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -560
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -86
- 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 -501
- 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 -236
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -180
- 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 -17
- 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 -194
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -293
- 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/ModalLayout.kt +0 -187
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -316
- 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 -397
- 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 -153
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -113
- 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 -422
- 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 -739
- 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 -239
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -423
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -94
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +0 -97
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +0 -203
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +0 -108
- 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 -456
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -105
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -106
- 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 -399
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -39
- 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 -204
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -133
- 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 -114
- 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 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +0 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +0 -22
- 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 -42
- 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 -219
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +0 -48
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +0 -144
- 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 -24
- package/gradlew +0 -252
- package/gradlew.bat +0 -94
- package/ios-demo/README.md +0 -120
- package/settings.gradle.kts +0 -64
package/CLAUDE.md
CHANGED
|
@@ -42,7 +42,7 @@ xcodebuild -project sample/iosApp/Pods/Pods.xcodeproj -scheme MoMoUIKits -sdk ip
|
|
|
42
42
|
-destination 'generic/platform=iOS Simulator' build
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Publishing is automated (`.gitlab-ci.yml` → `publish.sh`; see `PUBLISH_GUIDE.md`): `main` → npm latest + 1 patch (tag `latest`; a manual run with `RELEASE_VERSION` sets the sprint version), other branches on `[ci build]` → `<npm latest + 1 patch>-beta.N`. The version is never stored in the repo — `scripts/ci/resolve-version.mjs` bases it on npm and only takes a number free on **both** npm (incl. `-debug`) and GitLab Maven. Do not publish
|
|
45
|
+
Publishing is automated (`.gitlab-ci.yml` → `publish.sh`; see `PUBLISH_GUIDE.md`): `main` → npm latest + 1 patch (tag `latest`; a manual run with `RELEASE_VERSION` sets the sprint version), other branches on `[ci build]` → `<npm latest + 1 patch>-beta.N`. The version is never stored in the repo — `scripts/ci/resolve-version.mjs` bases it on npm and only takes a number free on **both** npm (incl. `-debug`) and GitLab Maven. Locally, `bash publish.sh local` publishes a beta of the working tree as is (uncommitted changes too, any branch; same beta numbering); `release` is CI-only. Do not publish unless asked; `bash publish.sh local --dry-run` shows the version and packs the tarballs without uploading.
|
|
46
46
|
|
|
47
47
|
## Architecture essentials
|
|
48
48
|
|
package/PUBLISH_GUIDE.md
CHANGED
|
@@ -28,11 +28,18 @@ GitLab → **Build → Pipelines → Run pipeline** → chọn `main` → `RELEA
|
|
|
28
28
|
## Chạy local
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
bash publish.sh build
|
|
32
|
-
bash publish.sh
|
|
33
|
-
bash publish.sh
|
|
31
|
+
bash publish.sh build # build tất cả artifact sẽ publish (không upload)
|
|
32
|
+
bash publish.sh local --dry-run # xem version sẽ ra + pack tarball npm vào build/npm
|
|
33
|
+
bash publish.sh local # publish beta thật từ working tree hiện tại
|
|
34
|
+
yarn publish:local # như trên (thêm --dry-run để chạy thử)
|
|
34
35
|
```
|
|
35
36
|
|
|
37
|
+
- `local` chỉ publish **beta**, ở bất kỳ nhánh nào, và lấy **nguyên working tree**, kể cả thay đổi chưa commit. Dùng khi cần nhanh một version để test mà chưa muốn commit.
|
|
38
|
+
- Version theo đúng quy tắc beta của CI: `<npm latest + 1 patch>-beta.N`, npm tag `beta`, và số phải còn trống trên cả npm lẫn Maven. Beta local và beta CI dùng chung dãy `N`.
|
|
39
|
+
- `release` (npm tag `latest`) chỉ chạy trên CI. Chạy ở local sẽ bị chặn, trừ khi có `--dry-run`.
|
|
40
|
+
- Local không giữ khoá `kits-publish` của CI. Vì vậy script build xong mới chọn version, để khoảng thời gian có thể bị trùng số với một job CI đang chạy là ngắn nhất.
|
|
41
|
+
- `gitHead` trên npm trỏ tới commit HEAD, nhưng package có thể chứa cả thay đổi chưa commit.
|
|
42
|
+
|
|
36
43
|
Các file bị sửa trong lúc publish được trả lại nguyên trạng khi script kết thúc, kể cả khi fail.
|
|
37
44
|
|
|
38
45
|
## CI/CD variables
|
|
@@ -40,6 +47,6 @@ Các file bị sửa trong lúc publish được trả lại nguyên trạng khi
|
|
|
40
47
|
| Biến | Dùng cho |
|
|
41
48
|
|---|---|
|
|
42
49
|
| `NPM_TOKEN` | npm automation token. Nếu không có thì dùng `_authToken` trong `.npmrc`. |
|
|
43
|
-
| `
|
|
50
|
+
| `PUBLISHING_USER` / `PUBLISHING_PASSWORD` | Tài khoản upload Maven lên MoMo Artifacts (ưu tiên). `MAVEN_USER` / `MAVEN_TOKEN` chỉ còn là fallback cũ. |
|
|
44
51
|
|
|
45
52
|
Đặt các biến này ở chế độ **masked**, **không bật protected**, vì beta publish từ các nhánh không được protect. Sau đó xoá token khỏi `.npmrc` / `gradle.properties`.
|
|
@@ -79,8 +79,8 @@ public extension ModalLayout {
|
|
|
79
79
|
return ModalLayout(
|
|
80
80
|
isFoldable: false,
|
|
81
81
|
placement: placement,
|
|
82
|
-
popup: popupGeometry(placementWidth: width, maxHeight: nil, margin: Spacing.XL, radius: Radius.
|
|
83
|
-
sheet: SheetGeometry(width: nil, maxHeight: nil, minHeight: 0, margin: 0, radius: Radius.
|
|
82
|
+
popup: popupGeometry(placementWidth: width, maxHeight: nil, margin: Spacing.XL, radius: Radius.L),
|
|
83
|
+
sheet: SheetGeometry(width: nil, maxHeight: nil, minHeight: 0, margin: 0, radius: Radius.M),
|
|
84
84
|
scrimOpacity: ModalMetrics.phoneScrimOpacity
|
|
85
85
|
)
|
|
86
86
|
}
|
|
@@ -96,7 +96,11 @@ struct BottomTabBar: View {
|
|
|
96
96
|
floatingButton: floatingButton,
|
|
97
97
|
selectedIndex: selectedIndex,
|
|
98
98
|
onTabSelected: onTabSelected,
|
|
99
|
-
width: TabBarMetrics.horizontalBarWidth(
|
|
99
|
+
width: TabBarMetrics.horizontalBarWidth(
|
|
100
|
+
layout,
|
|
101
|
+
itemCount: items.count,
|
|
102
|
+
hasCta: TabBarMetrics.hasCenterAction(floatingButton, tabCount: items.count)
|
|
103
|
+
),
|
|
100
104
|
fixedFontScale: true
|
|
101
105
|
)
|
|
102
106
|
.padding(.bottom, TabBarMetrics.bottomGap(bottomInset))
|
|
@@ -147,7 +151,7 @@ struct HorizontalTabBar: View {
|
|
|
147
151
|
Color.clear.frame(width: TabBarMetrics.ctaSlotWidth)
|
|
148
152
|
}
|
|
149
153
|
SwiftUI.Button { onTabSelected(index) } label: {
|
|
150
|
-
VStack(spacing:
|
|
154
|
+
VStack(spacing: TabBarMetrics.itemIconLabelGap) {
|
|
151
155
|
TabItemContent(item: items[index], selected: index == selectedIndex, fixedFontScale: fixedFontScale)
|
|
152
156
|
}
|
|
153
157
|
.frame(width: itemWidth)
|
|
@@ -359,6 +363,8 @@ struct CenterActionStyle: ButtonStyle {
|
|
|
359
363
|
Circle().inset(by: 16).fill(theme.colors.primary)
|
|
360
364
|
.shadow(color: Color.black.opacity(0.04), radius: 16, x: 0, y: 12)
|
|
361
365
|
Circle().fill(theme.colors.primary)
|
|
366
|
+
// Figma Icon Button border: white 60% hairline
|
|
367
|
+
.overlay(Circle().stroke(Color.white.opacity(TabBarMetrics.ctaBorderOpacity), lineWidth: 1))
|
|
362
368
|
if let iconContent {
|
|
363
369
|
// custom content (e.g. an oversized Lottie) is clipped to the round button
|
|
364
370
|
iconContent
|
|
@@ -45,7 +45,10 @@ struct NotchedBarShape: Shape {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/// Navigation bar container:
|
|
48
|
+
/// Navigation bar container: translucent glass fill (Figma .Nav/Background white 86%, Blur=On) with the
|
|
49
|
+
/// floating shadow following the shape. A single translucent fill keeps the glass see-through — stacking
|
|
50
|
+
/// opaque shadow layers would make it solid — so the two shadows are applied over it (compositingGroup
|
|
51
|
+
/// keeps the first from being re-cast). iOS could back this with a real material later; see Compose note.
|
|
49
52
|
struct TabBarContainer<S: Shape>: ViewModifier {
|
|
50
53
|
let shape: S
|
|
51
54
|
|
|
@@ -53,17 +56,15 @@ struct TabBarContainer<S: Shape>: ViewModifier {
|
|
|
53
56
|
|
|
54
57
|
func body(content: Content) -> some View {
|
|
55
58
|
content.background(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
shape.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
.allowsHitTesting(false)
|
|
59
|
+
shape
|
|
60
|
+
.fill(theme.colors.background.surface.opacity(TabBarMetrics.backgroundOpacity))
|
|
61
|
+
// Figma .Nav/Background: 1px light-gray hairline defining the pill edge
|
|
62
|
+
.overlay(shape.stroke(theme.colors.border.default, lineWidth: 1))
|
|
63
|
+
.compositingGroup()
|
|
64
|
+
// Figma Shadow/floating: 12% blur 24, then 4% blur 32 spread -16 offset y12
|
|
65
|
+
.shadow(color: Color.black.opacity(0.12), radius: 12)
|
|
66
|
+
.shadow(color: Color.black.opacity(0.04), radius: 16, x: 0, y: 12)
|
|
67
|
+
.allowsHitTesting(false)
|
|
67
68
|
)
|
|
68
69
|
}
|
|
69
70
|
}
|
|
@@ -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
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",
|
|
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
|
package/build.gradle.kts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
plugins {
|
|
2
|
-
// this is necessary to avoid the plugins to be loaded multiple times
|
|
3
|
-
// in each subproject's classloader
|
|
4
|
-
alias(libs.plugins.android.application) apply false
|
|
5
|
-
alias(libs.plugins.android.library) apply false
|
|
6
|
-
alias(libs.plugins.compose) apply false
|
|
7
|
-
alias(libs.plugins.kotlin.compose.compiler) apply false
|
|
8
|
-
alias(libs.plugins.jetbrains.kotlin.multiplatform) apply false
|
|
9
|
-
alias(libs.plugins.jetbrains.kotlin.serialization) apply false
|
|
10
|
-
alias(libs.plugins.vanniktech.mavenPublish) apply false
|
|
11
|
-
}
|
package/compose/build.gradle.kts
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
// import com.vanniktech.maven.publish.JavadocJar
|
|
2
|
-
// import com.vanniktech.maven.publish.KotlinMultiplatform
|
|
3
|
-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
4
|
-
|
|
5
|
-
plugins {
|
|
6
|
-
alias(libs.plugins.jetbrains.kotlin.multiplatform)
|
|
7
|
-
alias(libs.plugins.android.library)
|
|
8
|
-
alias(libs.plugins.compose)
|
|
9
|
-
alias(libs.plugins.kotlin.compose.compiler)
|
|
10
|
-
// alias(libs.plugins.vanniktech.mavenPublish)
|
|
11
|
-
id(libs.plugins.jetbrains.kotlin.cocoapods.get().pluginId)
|
|
12
|
-
kotlin("plugin.serialization")
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
val gitlabName: String = findProperty("name") as String? ?: ""
|
|
16
|
-
val gitlabRepo: String = findProperty("repo") as String? ?: ""
|
|
17
|
-
val gitlabUrl: String = findProperty("url") as String? ?: ""
|
|
18
|
-
val gitlabGroup: String = findProperty("group") as String? ?: ""
|
|
19
|
-
val gitlabArtifactId: String = findProperty("artifact.id") as String? ?: ""
|
|
20
|
-
val gitlabVersion: String = findProperty("version") as String? ?: ""
|
|
21
|
-
val gitlabUser: String = findProperty("gitlab.user") as String? ?: ""
|
|
22
|
-
val gitlabKey: String = findProperty("gitlab.password") as String? ?: ""
|
|
23
|
-
|
|
24
|
-
kotlin {
|
|
25
|
-
androidTarget {
|
|
26
|
-
compilerOptions {
|
|
27
|
-
jvmTarget.set(JvmTarget.JVM_17)
|
|
28
|
-
}
|
|
29
|
-
publishLibraryVariants("release")
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
val fwName = gitlabArtifactId
|
|
33
|
-
val iosTargets = listOf(iosArm64(), iosSimulatorArm64())
|
|
34
|
-
iosTargets.forEach {
|
|
35
|
-
it.binaries.framework {
|
|
36
|
-
baseName = fwName
|
|
37
|
-
binaryOption("bundleId", "$gitlabGroup.$fwName")
|
|
38
|
-
isStatic = true
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
cocoapods {
|
|
43
|
-
version = "0.169.5-beta.2-debug"
|
|
44
|
-
summary = "IOS Shared module"
|
|
45
|
-
homepage = "https://momo.vn"
|
|
46
|
-
ios.deploymentTarget = "15.0"
|
|
47
|
-
|
|
48
|
-
framework {
|
|
49
|
-
baseName = fwName
|
|
50
|
-
isStatic = true
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
pod("lottie-ios") {
|
|
54
|
-
moduleName = "Lottie"
|
|
55
|
-
version = "4.4.3"
|
|
56
|
-
extraOpts += listOf("-compiler-option", "-fmodules")
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
sourceSets {
|
|
61
|
-
all {
|
|
62
|
-
languageSettings.optIn("vn.momo.kits.modifier.InternalApi")
|
|
63
|
-
}
|
|
64
|
-
commonMain.dependencies {
|
|
65
|
-
implementation(compose.runtime)
|
|
66
|
-
implementation(compose.material)
|
|
67
|
-
implementation(compose.material3)
|
|
68
|
-
implementation(compose.components.resources)
|
|
69
|
-
implementation(libs.compose.ui.backhandler)
|
|
70
|
-
implementation(libs.ktor.client.core)
|
|
71
|
-
implementation(libs.jetbrains.coroutines.core)
|
|
72
|
-
implementation(libs.navigation.multiplatform)
|
|
73
|
-
implementation(libs.coil.multiplatform.compose)
|
|
74
|
-
implementation(libs.coil.multiplatform.core)
|
|
75
|
-
implementation(libs.coil.multiplatform.network.ktor)
|
|
76
|
-
implementation(libs.jetbrains.serialization.json)
|
|
77
|
-
implementation(libs.kotlinx.datetime)
|
|
78
|
-
api(libs.native.max.api)
|
|
79
|
-
implementation(libs.compottie)
|
|
80
|
-
implementation(libs.gif.image)
|
|
81
|
-
}
|
|
82
|
-
androidMain.dependencies {
|
|
83
|
-
implementation(libs.ktor.client.okhttp)
|
|
84
|
-
implementation(libs.airbnb.lottie)
|
|
85
|
-
}
|
|
86
|
-
iosMain.dependencies {
|
|
87
|
-
implementation(libs.ktor.client.darwin)
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
android {
|
|
93
|
-
namespace = "vn.momo.kits.kits"
|
|
94
|
-
compileSdk = 35
|
|
95
|
-
compileOptions {
|
|
96
|
-
sourceCompatibility = JavaVersion.VERSION_17
|
|
97
|
-
targetCompatibility = JavaVersion.VERSION_17
|
|
98
|
-
}
|
|
99
|
-
defaultConfig {
|
|
100
|
-
minSdk = 24
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
dependencies {
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
repositories {
|
|
108
|
-
google {
|
|
109
|
-
mavenContent {
|
|
110
|
-
includeGroupAndSubgroups("androidx")
|
|
111
|
-
includeGroupAndSubgroups("com.android")
|
|
112
|
-
includeGroupAndSubgroups("com.google")
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
mavenCentral()
|
|
116
|
-
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
|
|
117
|
-
maven {
|
|
118
|
-
url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
|
|
119
|
-
credentials {username = "download_packages"; password = "gldt-bjDqLpU_sPcHDuXau2ws" }
|
|
120
|
-
}
|
|
121
|
-
maven {
|
|
122
|
-
url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
|
|
123
|
-
credentials {
|
|
124
|
-
username = "viewer"
|
|
125
|
-
password = "viewer"
|
|
126
|
-
}
|
|
127
|
-
isAllowInsecureProtocol = true
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
compose {
|
|
132
|
-
resources {
|
|
133
|
-
publicResClass = true
|
|
134
|
-
packageOfResClass = "vn.momo.uikits.resources"
|
|
135
|
-
generateResClass = always
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// publishing {
|
|
140
|
-
// repositories {
|
|
141
|
-
// maven {
|
|
142
|
-
// name = "${gitlabRepo}Packages"
|
|
143
|
-
// credentials {
|
|
144
|
-
// username = gitlabUser
|
|
145
|
-
// password = gitlabKey
|
|
146
|
-
// }
|
|
147
|
-
// url = uri("$gitlabUrl")
|
|
148
|
-
// }
|
|
149
|
-
// }
|
|
150
|
-
// }
|
|
151
|
-
|
|
152
|
-
// mavenPublishing {
|
|
153
|
-
// configure(
|
|
154
|
-
// KotlinMultiplatform(
|
|
155
|
-
// javadocJar = JavadocJar.Empty(),
|
|
156
|
-
// sourcesJar = true,
|
|
157
|
-
// androidVariantsToPublish = listOf("release")
|
|
158
|
-
// )
|
|
159
|
-
// )
|
|
160
|
-
//
|
|
161
|
-
// repositories {
|
|
162
|
-
// maven {
|
|
163
|
-
// name = "${gitlabRepo}Packages"
|
|
164
|
-
// credentials { username = gitlabUser; password = gitlabKey }
|
|
165
|
-
// url = uri("$gitlabUrl")
|
|
166
|
-
// }
|
|
167
|
-
// }
|
|
168
|
-
//
|
|
169
|
-
// coordinates(gitlabGroup.toString(), gitlabArtifactId, gitlabVersion.toString())
|
|
170
|
-
//
|
|
171
|
-
// pom {
|
|
172
|
-
// name = "$gitlabName Klib"
|
|
173
|
-
// description = "$gitlabName"
|
|
174
|
-
// url = "https://gitlab.mservice.com.vn"
|
|
175
|
-
// licenses {
|
|
176
|
-
// license {
|
|
177
|
-
// name = "The Apache License, Version 2.0"
|
|
178
|
-
// url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
|
179
|
-
// distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
|
180
|
-
// }
|
|
181
|
-
// }
|
|
182
|
-
// developers {
|
|
183
|
-
// developer {
|
|
184
|
-
// id = "kotlin-hands-on"
|
|
185
|
-
// name = "Kotlin Developer Advocate"
|
|
186
|
-
// url = "https://github.com/kotlin-hands-on/"
|
|
187
|
-
// }
|
|
188
|
-
// }
|
|
189
|
-
// }
|
|
190
|
-
// }
|
|
191
|
-
|
|
192
|
-
// Xcode 27 rejects iOS < 15; KGP's synthetic Podfile only raises pods to 12 (KT-57741), leaving lottie-ios at 13.
|
|
193
|
-
tasks.named("podGenIos") {
|
|
194
|
-
doLast {
|
|
195
|
-
val podfile = layout.buildDirectory.file("cocoapods/synthetic/ios/Podfile").get().asFile
|
|
196
|
-
podfile.writeText(podfile.readText().replace("major < 12 ||", "major < 15 ||").replace("#{12}", "#{15}"))
|
|
197
|
-
}
|
|
198
|
-
}
|
package/compose/compose.podspec
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
Pod::Spec.new do |spec|
|
|
2
|
-
spec.name = 'compose'
|
|
3
|
-
spec.version = '0.169.5-beta.2-debug'
|
|
4
|
-
spec.homepage = 'https://momo.vn'
|
|
5
|
-
spec.source = { :http=> ''}
|
|
6
|
-
spec.authors = ''
|
|
7
|
-
spec.license = ''
|
|
8
|
-
spec.summary = 'IOS Shared module'
|
|
9
|
-
spec.vendored_frameworks = 'build/cocoapods/framework/kits.framework'
|
|
10
|
-
spec.libraries = 'c++'
|
|
11
|
-
spec.ios.deployment_target = '15.0'
|
|
12
|
-
spec.dependency 'lottie-ios', '4.4.3'
|
|
13
|
-
if !Dir.exist?('build/cocoapods/framework/kits.framework') || Dir.empty?('build/cocoapods/framework/kits.framework')
|
|
14
|
-
raise "
|
|
15
|
-
Kotlin framework 'kits' doesn't exist yet, so a proper Xcode project can't be generated.
|
|
16
|
-
'pod install' should be executed after running ':generateDummyFramework' Gradle task:
|
|
17
|
-
./gradlew :compose:generateDummyFramework
|
|
18
|
-
Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
|
|
19
|
-
end
|
|
20
|
-
spec.xcconfig = {
|
|
21
|
-
'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
|
|
22
|
-
}
|
|
23
|
-
spec.pod_target_xcconfig = {
|
|
24
|
-
'KOTLIN_PROJECT_PATH' => ':compose',
|
|
25
|
-
'PRODUCT_MODULE_NAME' => 'kits',
|
|
26
|
-
}
|
|
27
|
-
spec.script_phases = [
|
|
28
|
-
{
|
|
29
|
-
:name => 'Build compose',
|
|
30
|
-
:execution_position => :before_compile,
|
|
31
|
-
:shell_path => '/bin/sh',
|
|
32
|
-
:script => <<-SCRIPT
|
|
33
|
-
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
|
|
34
|
-
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
|
|
35
|
-
exit 0
|
|
36
|
-
fi
|
|
37
|
-
set -ev
|
|
38
|
-
REPO_ROOT="$PODS_TARGET_SRCROOT"
|
|
39
|
-
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
|
|
40
|
-
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
|
|
41
|
-
-Pkotlin.native.cocoapods.archs="$ARCHS" \
|
|
42
|
-
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
|
|
43
|
-
SCRIPT
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
spec.resources = ['build/compose/cocoapods/compose-resources']
|
|
47
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.const
|
|
2
|
-
|
|
3
|
-
import androidx.compose.runtime.Composable
|
|
4
|
-
import androidx.compose.runtime.remember
|
|
5
|
-
import androidx.compose.ui.platform.LocalContext
|
|
6
|
-
import androidx.compose.ui.text.font.Font
|
|
7
|
-
import androidx.compose.ui.text.font.FontFamily
|
|
8
|
-
import androidx.compose.ui.text.font.FontWeight
|
|
9
|
-
|
|
10
|
-
@Composable
|
|
11
|
-
internal actual fun hostFontFamily(fileName: String, weight: FontWeight): FontFamily? {
|
|
12
|
-
val assets = LocalContext.current.applicationContext.assets
|
|
13
|
-
return remember(fileName, weight) {
|
|
14
|
-
val path = "fonts/$fileName"
|
|
15
|
-
// AssetManager.open ném IOException nếu thiếu file; Font(path, assetManager) thì lỗi
|
|
16
|
-
// muộn lúc render nên phải kiểm tra tồn tại trước.
|
|
17
|
-
val exists = runCatching { assets.open(path).close() }.isSuccess
|
|
18
|
-
if (exists) FontFamily(Font(path = path, assetManager = assets, weight = weight)) else null
|
|
19
|
-
}
|
|
20
|
-
}
|