@momo-kits/native-kits 0.169.6 → 0.169.7-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/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 +19 -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 +1067 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +267 -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 +82 -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 +356 -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 +482 -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 +224 -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 +473 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +113 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +263 -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 +228 -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 +183 -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 +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +82 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +39 -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 +307 -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 +88 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +306 -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 +457 -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 +205 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +89 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +542 -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 +120 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +201 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -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 +210 -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 +12 -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 +292 -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 +184 -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 +397 -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 +727 -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 +167 -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 +218 -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 +67 -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/Application/ApplicationEnvironment.swift +2 -3
- package/ios/Application/DesignSystemKits.swift +4 -20
- package/ios/Application/DesignSystemKitsPayload.swift +0 -8
- package/ios/Application/LanguageSource.swift +0 -8
- package/ios/Application/Localize.swift +7 -31
- package/ios/Application/LocalizeModifier.swift +0 -8
- package/ios/Application/MaxApi.swift +3 -11
- package/ios/Avatar/Avatar.swift +0 -1
- package/ios/Badge/Badge.swift +0 -1
- package/ios/Badge/BadgeRibbon.swift +2 -5
- package/ios/Button/Button.swift +2 -5
- package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +2 -2
- package/ios/Carousel/Carousel.swift +5 -17
- package/ios/Checkbox/Checkbox.swift +0 -2
- package/ios/Colors+Radius+Spacing/Theme.swift +0 -7
- package/ios/DateTimePicker/DateTimePicker.swift +4 -10
- package/ios/DateTimePicker/DateTimePickerTypes.swift +1 -3
- package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -3
- package/ios/DateTimePicker/WheelPicker.swift +2 -4
- package/ios/Extensions/SkeletonUICompat.swift +0 -8
- package/ios/Icon/Icon.swift +1 -3
- package/ios/IconButton/IconButton.swift +0 -2
- package/ios/Input/ErrorView.swift +0 -7
- package/ios/Input/Input.swift +6 -19
- package/ios/Input/InputPhoneNumber.swift +0 -11
- package/ios/Input/InputSearch.swift +0 -6
- package/ios/Input/InputTextArea.swift +1 -12
- package/ios/InputDropDown/InputDropDown.swift +1 -11
- package/ios/InputMoney/InputMoney.swift +9 -28
- package/ios/InputOTP/InputOTP.swift +2 -9
- package/ios/Layout/Item.swift +1 -2
- package/ios/Layout/ModalLayout.swift +7 -14
- package/ios/Layout/ScreenLayout.swift +2 -7
- package/ios/Loader/Loader.swift +3 -12
- package/ios/Lottie/LottieView.swift +0 -11
- package/ios/Navigation/BottomSheet.swift +14 -35
- package/ios/Navigation/BottomTab/BottomTab.swift +10 -19
- package/ios/Navigation/BottomTab/BottomTabBar.swift +4 -10
- package/ios/Navigation/BottomTab/CurvedContainer.swift +5 -11
- package/ios/Navigation/BottomTab/DuoBarCompression.swift +6 -12
- package/ios/Navigation/BottomTab/DuoTabBar.swift +2 -7
- package/ios/Navigation/BottomTab/TabBarMetrics.swift +3 -9
- package/ios/Navigation/Component/FloatingButton.swift +4 -11
- package/ios/Navigation/Component/Header.swift +4 -8
- package/ios/Navigation/Component/HeaderBackground.swift +2 -8
- package/ios/Navigation/Component/HeaderJourney.swift +2 -7
- package/ios/Navigation/Component/HeaderLocation.swift +2 -7
- package/ios/Navigation/Component/HeaderRight.swift +2 -7
- package/ios/Navigation/Component/HeaderTitle.swift +1 -6
- package/ios/Navigation/Component/HeaderUser.swift +2 -9
- package/ios/Navigation/Component/SideBar.swift +3 -8
- package/ios/Navigation/Component/SnackBar.swift +5 -13
- package/ios/Navigation/HostBackGestureBridge.swift +3 -9
- package/ios/Navigation/ModalScreen.swift +2 -8
- package/ios/Navigation/Navigation.swift +2 -15
- package/ios/Navigation/NavigationContainer.swift +3 -12
- package/ios/Navigation/Navigator.swift +15 -27
- package/ios/Navigation/StackScreen.swift +8 -28
- package/ios/Navigation/StackTransition.swift +3 -11
- package/ios/Navigation/SwipeBackHaptic.swift +2 -7
- package/ios/Navigation/Tracking/ScreenTracker.swift +2 -7
- package/ios/Pagination/PaginationDot.swift +0 -9
- package/ios/Pagination/PaginationNumber.swift +1 -9
- package/ios/Pagination/PaginationScroll.swift +2 -14
- package/ios/Pagination/PaginationWhiteDot.swift +1 -10
- package/ios/Popup/PopupDisplay.swift +3 -3
- package/ios/Popup/PopupInput.swift +1 -1
- package/ios/Popup/PopupLayout.swift +3 -3
- package/ios/PopupView/FullscreenPopup.swift +3 -4
- package/ios/PopupView/PopupView.swift +2 -2
- package/ios/PopupView/Utils++.swift +1 -2
- package/ios/ProgressInfo/ProgressInfo.swift +2 -13
- package/ios/Skeleton/Skeleton.swift +2 -10
- package/ios/Slider/Slider.swift +5 -12
- package/ios/StatusBarTap/StatusBarTap.h +2 -3
- package/ios/StatusBarTap/StatusBarTap.m +3 -16
- package/ios/Stepper/Stepper.swift +8 -27
- package/ios/Steps/Steps.swift +9 -11
- package/ios/Swipeable/SwipeCell.swift +2 -2
- package/ios/Swipeable/SwipeCellModel.swift +3 -6
- package/ios/TabView/TabView.swift +12 -25
- package/ios/Template/TrustBanner/TrustBanner.swift +2 -9
- package/ios/Tooltip/Tooltip.swift +2 -7
- package/ios/Typography/FontScale.swift +3 -15
- package/ios/Typography/Text.swift +2 -7
- package/ios/Typography/Typography.swift +8 -10
- package/ios/Uploader/Uploader.swift +2 -17
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/ios-demo/README.md +120 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +0 -8
- package/package.json +1 -1
- package/settings.gradle.kts +64 -0
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// Port of RN `BottomTab/DuoBarCompression.tsx` (HIG, Designing for iPhone Duo: Vertical controls):
|
|
6
|
-
// keeps the side bar's toolbar and tab bar clear of each other.
|
|
7
|
-
//
|
|
1
|
+
// Port of RN `BottomTab/DuoBarCompression.tsx` (HIG, Designing for iPhone Duo: Vertical controls):
|
|
2
|
+
// keeps the side bar's toolbar and tab bar clear of each other.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
11
|
-
/// iPhone Duo: which side bar
|
|
6
|
+
/// iPhone Duo: which of the side bar's bars starts compressed when the strip cannot hold both whole.
|
|
12
7
|
public enum DuoBarCompressionBehavior {
|
|
13
8
|
case toolbar, tabBar
|
|
14
9
|
}
|
|
@@ -36,10 +31,9 @@ struct DuoBarCompression {
|
|
|
36
31
|
/// Back, then the single button the toolbar folds into.
|
|
37
32
|
private static let compressedToolbarHeight = 2 * DuoMetrics.controlSize + Spacing.M
|
|
38
33
|
|
|
39
|
-
///
|
|
40
|
-
///
|
|
41
|
-
///
|
|
42
|
-
/// again once a tab is picked)
|
|
34
|
+
/// Both fit: both stay whole. One fits beside the other compressed: it is compressed and tapping it
|
|
35
|
+
/// swaps them. Otherwise both rest compressed; tapping one opens it for a moment (the rail closes
|
|
36
|
+
/// again once a tab is picked).
|
|
43
37
|
static func resolve(
|
|
44
38
|
layout: ScreenLayout,
|
|
45
39
|
tabCount: Int,
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// iPhone Duo tab bar, port of RN `BottomTab/DuoTabBar.tsx` (Figma "Specs Navigation", DS-984):
|
|
6
|
-
// a rail in the side bar, or the horizontal bar at 65% of the short side when unfolded portrait.
|
|
7
|
-
//
|
|
1
|
+
// iPhone Duo tab bar, port of RN `BottomTab/DuoTabBar.tsx` (Figma "Specs Navigation", DS-984):
|
|
2
|
+
// a rail in the side bar, or the horizontal bar at 65% of the short side when unfolded portrait.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// Navigation bar measurements (Figma "Specs Navigation", DS-984), mirrored from Compose's
|
|
6
|
-
// `navigation/bottomtab/TabBarMetrics.kt` and RN `BottomTab/metrics.ts`.
|
|
7
|
-
// Horizontal: floating container with items split evenly, center action in a notch.
|
|
8
|
-
// Vertical: iPhone Duo rail, center action under the container.
|
|
9
|
-
//
|
|
1
|
+
// Navigation bar measurements (Figma "Specs Navigation", DS-984), mirrored from Compose's
|
|
2
|
+
// `navigation/bottomtab/TabBarMetrics.kt` and RN `BottomTab/metrics.ts`. Horizontal: floating
|
|
3
|
+
// container, center action in a notch; vertical: iPhone Duo rail, center action under it.
|
|
10
4
|
|
|
11
5
|
import SwiftUI
|
|
12
6
|
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/FloatingButton.kt`: the screen FAB, whose
|
|
6
|
-
// label collapses while the content scrolls down.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/FloatingButton.kt`: the screen FAB, whose
|
|
2
|
+
// label collapses while the content scrolls down.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
11
6
|
public enum FABSize {
|
|
12
7
|
case small
|
|
13
8
|
case `default`
|
|
14
|
-
///
|
|
15
|
-
/// size `DEFAULT`.
|
|
9
|
+
/// Older iOS name for `default` (Compose `DEFAULT`), kept for existing call sites.
|
|
16
10
|
case large
|
|
17
11
|
}
|
|
18
12
|
|
|
19
13
|
public enum FABPosition {
|
|
20
14
|
case end
|
|
21
|
-
///
|
|
22
|
-
/// position `END`.
|
|
15
|
+
/// Older iOS name for `end` (Compose `END`), kept for existing call sites.
|
|
23
16
|
case right
|
|
24
17
|
case center
|
|
25
18
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/Header.kt`: the header bar (back button,
|
|
6
|
-
// title, header right), its colors, opacity and the header models.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/Header.kt`: the header bar (back button,
|
|
2
|
+
// title, header right), its colors, opacity and the header models.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
@@ -354,7 +349,8 @@ public struct NavigationHeader: View {
|
|
|
354
349
|
/// iPhone Duo inner portrait: the row sits on the status bar, between its clusters, with 48pt controls.
|
|
355
350
|
private var statusBarRow: Bool { layout.statusBarClearance != nil && !useSideBar }
|
|
356
351
|
|
|
357
|
-
/// Max centered title width; on the status bar row the clusters are lopsided, so both sides
|
|
352
|
+
/// Max centered title width; on the status bar row the clusters are lopsided, so both sides
|
|
353
|
+
/// keep the wider one's room.
|
|
358
354
|
private var centerTitleMaxWidth: CGFloat {
|
|
359
355
|
guard let clearance = layout.statusBarClearance else { return (layout.contentWidth - Spacing.M * 2) / 2 }
|
|
360
356
|
let back = goBack == nil || useSideBar ? 0 : DuoMetrics.controlSize + Spacing.S
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/HeaderBackground.kt`: the band behind the
|
|
6
|
-
// header — the pink gradient (or the theme's header image) fading into the screen background.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/HeaderBackground.kt`: the band behind the
|
|
2
|
+
// header — the pink gradient (or the theme's header image) fading into the screen background.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
@@ -143,7 +138,6 @@ struct DuoScrollGradient: View {
|
|
|
143
138
|
.allowsHitTesting(false)
|
|
144
139
|
}
|
|
145
140
|
|
|
146
|
-
/// The fade spans the gradient box.
|
|
147
141
|
private var gradient: LinearGradient {
|
|
148
142
|
LinearGradient(
|
|
149
143
|
colors: [theme.colors.gradient, theme.colors.gradient.opacity(0)],
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/HeaderJourney.kt`: a "start → end" title
|
|
6
|
-
// with an optional description below.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/HeaderJourney.kt`: a "start → end" title
|
|
2
|
+
// with an optional description below.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/HeaderLocation.kt`: a description above a
|
|
6
|
-
// tappable location with a chevron.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/HeaderLocation.kt`: a description above a
|
|
2
|
+
// tappable location with a chevron.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/HeaderRight.kt`: the mini-app toolkit
|
|
6
|
-
// (shortcut / more / single tool, help center and close) in the bar or the iPhone Duo side bar.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/HeaderRight.kt`: the mini-app toolkit
|
|
2
|
+
// (shortcut / more / single tool, help center and close) in the bar or the iPhone Duo side bar.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// HeaderTitle.swift
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/HeaderTitle.kt`: the plain header title.
|
|
6
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/HeaderTitle.kt`: the plain header title.
|
|
7
2
|
|
|
8
3
|
import SwiftUI
|
|
9
4
|
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/HeaderUser.kt`.
|
|
6
|
-
// Renders a `HeaderTitle.User`: an avatar group (1..n avatars with overflow),
|
|
7
|
-
// a title with optional inline icons, and an optional subtitle. Shows a
|
|
8
|
-
// skeleton shimmer placeholder while `isLoading`.
|
|
9
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/HeaderUser.kt`: avatar group, title with
|
|
2
|
+
// inline icons and an optional subtitle, or a skeleton while `isLoading`.
|
|
10
3
|
|
|
11
4
|
import SwiftUI
|
|
12
5
|
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/SideBar.kt`. iPhone Duo: back and toolkit
|
|
6
|
-
// leave the header bar for a column in the side safe area, as the system bars do.
|
|
7
|
-
// Port of RN `SideBarButton.tsx` + `useSideBarItemStyle`.
|
|
8
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/SideBar.kt`. iPhone Duo: back and toolkit
|
|
2
|
+
// leave the header bar for a column in the side safe area, as the system bars do.
|
|
3
|
+
// Port of RN `SideBarButton.tsx` + `useSideBarItemStyle`.
|
|
9
4
|
|
|
10
5
|
import SwiftUI
|
|
11
6
|
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/component/SnackBar.kt`: slides up above the screen's
|
|
6
|
-
// footer (or the home indicator), stays for `duration`, then slides back down.
|
|
7
|
-
// `Navigator.showSnackBar(_:)` drives it through the overplay host.
|
|
8
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/component/SnackBar.kt`, driven by
|
|
2
|
+
// `Navigator.showSnackBar(_:)` through the overplay host.
|
|
9
3
|
|
|
10
4
|
import Foundation
|
|
11
5
|
import SwiftUI
|
|
@@ -38,8 +32,7 @@ public struct SnackBar {
|
|
|
38
32
|
SnackBar(style: .custom, duration: duration, content: { AnyView(content()) })
|
|
39
33
|
}
|
|
40
34
|
|
|
41
|
-
/// Mirrors `SnackBar.Toast
|
|
42
|
-
/// Compose where `Toast` currently renders nothing).
|
|
35
|
+
/// Mirrors `SnackBar.Toast`, which renders nothing in Compose either.
|
|
43
36
|
public static func toast(duration: TimeInterval? = 3.0) -> SnackBar {
|
|
44
37
|
SnackBar(style: .toast, duration: duration, content: nil)
|
|
45
38
|
}
|
|
@@ -106,7 +99,7 @@ struct SnackBarView: View {
|
|
|
106
99
|
}
|
|
107
100
|
}
|
|
108
101
|
|
|
109
|
-
//
|
|
102
|
+
// Compose's `openEvent`.
|
|
110
103
|
private func open() {
|
|
111
104
|
DispatchQueue.main.async {
|
|
112
105
|
withAnimation(.easeOut(duration: 0.35)) {
|
|
@@ -115,7 +108,7 @@ struct SnackBarView: View {
|
|
|
115
108
|
}
|
|
116
109
|
}
|
|
117
110
|
|
|
118
|
-
//
|
|
111
|
+
// Slides down, then removes the overplay (Compose's `closeEvent` / `hideSnackBar`).
|
|
119
112
|
private func close() {
|
|
120
113
|
guard !isClosing else { return }
|
|
121
114
|
isClosing = true
|
|
@@ -137,7 +130,6 @@ struct SnackBarView: View {
|
|
|
137
130
|
private func scheduleAutoDismiss() {
|
|
138
131
|
guard let duration = snackBar.duration else { return }
|
|
139
132
|
let workItem = DispatchWorkItem {
|
|
140
|
-
// Only auto-dismiss if this snack bar is still the active overplay.
|
|
141
133
|
if navigator.overplay?.id == overplayId {
|
|
142
134
|
navigator.hideSnackBar()
|
|
143
135
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/HostBackGestureBridge.kt`: the host owns the edge-pan
|
|
6
|
-
// recogniser and routes a back into the topmost kit stack. NavigationContainer attaches itself.
|
|
7
|
-
// `started` / `progressed` / `completed` / `cancelled` scrub the pop transition with the finger;
|
|
8
|
-
// a host that only calls `pop` gets the regular animated back.
|
|
9
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/HostBackGestureBridge.kt`: the host owns the edge-pan
|
|
2
|
+
// recogniser and routes a back into the topmost kit stack (NavigationContainer attaches itself).
|
|
3
|
+
// `started` ... `cancelled` scrub the pop with the finger; a plain `pop` plays the regular back.
|
|
10
4
|
|
|
11
5
|
import UIKit
|
|
12
6
|
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `ModalScreen` (navigation/ModalScreen.kt).
|
|
6
|
-
// A centered overlay that fades + scales in over a dimmed scrim, and animates
|
|
7
|
-
// back out before the overplay is removed. Driven by `Navigator.showModal`.
|
|
8
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/ModalScreen.kt`, driven by `Navigator.showModal`: a
|
|
2
|
+
// centered overlay that fades + scales in over a dimmed scrim and animates out before removal.
|
|
9
3
|
|
|
10
4
|
import SwiftUI
|
|
11
5
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/Navigation.kt`: a screen's `NavigationOptions` and the
|
|
6
|
-
// per-screen `Navigation` that updates them at runtime.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/Navigation.kt`: a screen's `NavigationOptions` and the
|
|
2
|
+
// per-screen `Navigation` that updates them at runtime.
|
|
8
3
|
|
|
9
4
|
import SwiftUI
|
|
10
5
|
|
|
@@ -66,11 +61,9 @@ public struct NavigationOptions {
|
|
|
66
61
|
public var fullScreenContent: Bool
|
|
67
62
|
public var hiddenBack: Bool
|
|
68
63
|
public var backgroundColor: Color?
|
|
69
|
-
// AI-GENERATED START: custom screen background view (Compose backgroundComponent)
|
|
70
64
|
/// Drawn instead of `backgroundColor` over the whole window: under the header and the status bar,
|
|
71
65
|
/// across the iPhone Duo side strips, and not shrunk by the keyboard. Pair with `headerTransparent`.
|
|
72
66
|
public var background: (() -> AnyView)?
|
|
73
|
-
// AI-GENERATED END: custom screen background view (Compose backgroundComponent)
|
|
74
67
|
public var tintColor: Color?
|
|
75
68
|
public var scrollable: Bool
|
|
76
69
|
/// Compose's `ScrollData.scrollToTopCallback`, fired on a status-bar tap.
|
|
@@ -103,9 +96,7 @@ public struct NavigationOptions {
|
|
|
103
96
|
fullScreenContent: Bool = false,
|
|
104
97
|
hiddenBack: Bool = false,
|
|
105
98
|
backgroundColor: Color? = nil,
|
|
106
|
-
// AI-GENERATED START: custom screen background view (Compose backgroundComponent)
|
|
107
99
|
background: (() -> AnyView)? = nil,
|
|
108
|
-
// AI-GENERATED END: custom screen background view (Compose backgroundComponent)
|
|
109
100
|
tintColor: Color? = Colors.black17,
|
|
110
101
|
scrollable: Bool = true,
|
|
111
102
|
scrollToTopCallback: (() -> Void)? = nil,
|
|
@@ -133,9 +124,7 @@ public struct NavigationOptions {
|
|
|
133
124
|
self.fullScreenContent = fullScreenContent
|
|
134
125
|
self.hiddenBack = hiddenBack
|
|
135
126
|
self.backgroundColor = backgroundColor
|
|
136
|
-
// AI-GENERATED START: custom screen background view (Compose backgroundComponent)
|
|
137
127
|
self.background = background
|
|
138
|
-
// AI-GENERATED END: custom screen background view (Compose backgroundComponent)
|
|
139
128
|
self.tintColor = tintColor
|
|
140
129
|
self.scrollable = scrollable
|
|
141
130
|
self.scrollToTopCallback = scrollToTopCallback
|
|
@@ -172,9 +161,7 @@ struct OptionsStackScreen: View {
|
|
|
172
161
|
var body: some View {
|
|
173
162
|
StackScreen(
|
|
174
163
|
backgroundColor: options.backgroundColor,
|
|
175
|
-
// AI-GENERATED START: custom screen background view (Compose backgroundComponent)
|
|
176
164
|
background: options.background,
|
|
177
|
-
// AI-GENERATED END: custom screen background view (Compose backgroundComponent)
|
|
178
165
|
headerTransparent: options.headerTransparent,
|
|
179
166
|
fullScreenContent: options.fullScreenContent,
|
|
180
167
|
tintColor: options.tintColor ?? Colors.black17,
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/NavigationContainer.kt`: hosts the kit stack
|
|
6
|
-
// (`StackHost`, the NavHost counterpart), injects Navigator, theme, localize and font scale, and
|
|
7
|
-
// renders every registered screen inside `StackScreen` chrome built from its options.
|
|
8
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/NavigationContainer.kt`: hosts the kit stack
|
|
2
|
+
// (`StackHost`, the NavHost counterpart), injects Navigator, theme, localize and font scale, and
|
|
3
|
+
// renders every registered screen inside `StackScreen` chrome built from its options.
|
|
9
4
|
|
|
10
5
|
import SwiftUI
|
|
11
6
|
|
|
@@ -50,9 +45,7 @@ public struct NavigationContainer<Initial: View>: View {
|
|
|
50
45
|
maxApi: maxApi
|
|
51
46
|
)
|
|
52
47
|
)
|
|
53
|
-
// AI-GENERATED START: default to the app-language-observing shared Localize
|
|
54
48
|
_localize = StateObject(wrappedValue: localize ?? Localize.shared)
|
|
55
|
-
// AI-GENERATED END: default to the app-language-observing shared Localize
|
|
56
49
|
self.composeApi = composeApi
|
|
57
50
|
self.maxApi = maxApi
|
|
58
51
|
self.initialTheme = initialTheme
|
|
@@ -91,7 +84,6 @@ public struct NavigationContainer<Initial: View>: View {
|
|
|
91
84
|
setNavigator?(navigator)
|
|
92
85
|
// Idempotent, so a re-appear won't double-count.
|
|
93
86
|
HostBackGestureBridge.shared.attach(navigator)
|
|
94
|
-
// AI-GENERATED START: demote the MaxApi language pull to a seed of last resort
|
|
95
87
|
// Only a seed: a Localize with a language source already tracks the host in both
|
|
96
88
|
// directions, so asking maxApi would just race it. `changeLanguage` normalizes the
|
|
97
89
|
// raw response and hops to main itself.
|
|
@@ -99,7 +91,6 @@ public struct NavigationContainer<Initial: View>: View {
|
|
|
99
91
|
maxApi?.getLanguage { data in
|
|
100
92
|
localize.changeLanguage(data?["response"] as? String)
|
|
101
93
|
}
|
|
102
|
-
// AI-GENERATED END: demote the MaxApi language pull to a seed of last resort
|
|
103
94
|
}
|
|
104
95
|
.onDisappear {
|
|
105
96
|
HostBackGestureBridge.shared.detach(navigator)
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/Navigator.kt`: Navigator, DynamicScreenRegistry and
|
|
6
|
-
// the overplay model. Screens are registered by Int id; the stack paths store routes by id and
|
|
7
|
-
// content is looked up from the registry on render.
|
|
8
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/Navigator.kt`: Navigator, DynamicScreenRegistry and
|
|
2
|
+
// the overplay model. Screens are registered by Int id; the stack paths store routes by id and
|
|
3
|
+
// content is looked up from the registry on render.
|
|
9
4
|
|
|
10
5
|
import SwiftUI
|
|
11
6
|
import Combine
|
|
@@ -124,15 +119,12 @@ public final class Navigator: ObservableObject {
|
|
|
124
119
|
}
|
|
125
120
|
@Published public var overplay: OverplayItem?
|
|
126
121
|
|
|
127
|
-
///
|
|
128
|
-
///
|
|
129
|
-
/// navigator itself deallocates, instead of accumulating in a process-wide singleton.
|
|
122
|
+
/// Per navigator, as Compose's `remember { DynamicScreenRegistry() }`: its screens go with
|
|
123
|
+
/// the navigator instead of piling up in a process-wide singleton.
|
|
130
124
|
public let registry = DynamicScreenRegistry()
|
|
131
125
|
|
|
132
|
-
///
|
|
133
|
-
///
|
|
134
|
-
/// dismiss request runs the component's exit animation before the item is
|
|
135
|
-
/// actually removed via `finishOverplayDismiss`.
|
|
126
|
+
/// Exit animation of the active overplay (Compose's `OverplayComponentRegistry.bindClose`);
|
|
127
|
+
/// the component calls `finishOverplayDismiss` once it has played.
|
|
136
128
|
private var overplayDismissHandler: (() -> Void)?
|
|
137
129
|
|
|
138
130
|
public var rootRoute: DynamicScreenRoute { DynamicScreenRoute(id: entries[0].id) }
|
|
@@ -224,10 +216,9 @@ public final class Navigator: ObservableObject {
|
|
|
224
216
|
popStep(remaining: count, callback: callback)
|
|
225
217
|
}
|
|
226
218
|
|
|
227
|
-
/// One `pop` iteration. Compose
|
|
228
|
-
///
|
|
229
|
-
///
|
|
230
|
-
/// the overplay that is still animating out and never pop the screen.
|
|
219
|
+
/// One `pop` iteration. Like Compose's coroutine loop it waits out the overplay's exit
|
|
220
|
+
/// animation, or a `pop(2)` (prevent-back: close the popup, then leave) would spend both
|
|
221
|
+
/// steps on the closing overplay and never pop the screen.
|
|
231
222
|
private func popStep(remaining: Int, callback: (() -> Void)?) {
|
|
232
223
|
guard remaining > 0 else {
|
|
233
224
|
callback?()
|
|
@@ -235,9 +226,8 @@ public final class Navigator: ObservableObject {
|
|
|
235
226
|
}
|
|
236
227
|
|
|
237
228
|
if overplay?.type == .snackBar {
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
// snackbar immediately, without playing its dismiss animation.
|
|
229
|
+
// As in Compose, a snack bar doesn't block back: the screen under it pops and the
|
|
230
|
+
// snack bar clears without its exit animation.
|
|
241
231
|
replaceOverplay(with: nil)
|
|
242
232
|
guard popScreen() else {
|
|
243
233
|
callback?()
|
|
@@ -316,7 +306,7 @@ public final class Navigator: ObservableObject {
|
|
|
316
306
|
return
|
|
317
307
|
}
|
|
318
308
|
if let preventBack = latest?.options?.headerBackProps?.preventBack {
|
|
319
|
-
//
|
|
309
|
+
// Stored in `overplay`, so a strong self would cycle until the popup closes.
|
|
320
310
|
showModal { [weak self] in
|
|
321
311
|
PopupNotify(
|
|
322
312
|
props: PopupNotifyProps(
|
|
@@ -477,9 +467,8 @@ public final class Navigator: ObservableObject {
|
|
|
477
467
|
overplayDismissHandler = handler
|
|
478
468
|
}
|
|
479
469
|
|
|
480
|
-
/// Removes the overplay and fires its `onDismiss` (
|
|
481
|
-
///
|
|
482
|
-
/// has completed.
|
|
470
|
+
/// Removes the overplay and fires its `onDismiss` (Compose's `hardClearAfterDismiss`);
|
|
471
|
+
/// called by the component once its exit animation has played.
|
|
483
472
|
public func finishOverplayDismiss() {
|
|
484
473
|
replaceOverplay(with: nil)
|
|
485
474
|
}
|
|
@@ -502,7 +491,6 @@ public final class Navigator: ObservableObject {
|
|
|
502
491
|
|
|
503
492
|
public func hideOverplay() {
|
|
504
493
|
if let close = overplayDismissHandler {
|
|
505
|
-
// Component runs its exit animation, then calls finishOverplayDismiss.
|
|
506
494
|
overplayDismissHandler = nil
|
|
507
495
|
close()
|
|
508
496
|
} else {
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/StackScreen.kt`: header layer, scrollable content
|
|
6
|
-
// (`StackScreenContent`), animated search, floating button, footer (`NavigationFooter`) and the
|
|
7
|
-
// iPhone Duo side bar.
|
|
8
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/StackScreen.kt`: header layer, scrollable content
|
|
2
|
+
// (`StackScreenContent`), animated search, floating button, footer (`NavigationFooter`) and the
|
|
3
|
+
// iPhone Duo side bar.
|
|
9
4
|
|
|
10
5
|
import SwiftUI
|
|
11
6
|
|
|
@@ -13,9 +8,7 @@ public struct StackScreen<Content: View>: View {
|
|
|
13
8
|
// MARK: - Properties
|
|
14
9
|
|
|
15
10
|
var backgroundColor: Color?
|
|
16
|
-
// AI-GENERATED START: custom screen background view (Compose backgroundComponent)
|
|
17
11
|
var background: (() -> AnyView)?
|
|
18
|
-
// AI-GENERATED END: custom screen background view (Compose backgroundComponent)
|
|
19
12
|
var headerTransparent: Bool = false
|
|
20
13
|
var fullScreenContent: Bool = false
|
|
21
14
|
var tintColor: Color? = Colors.black17
|
|
@@ -46,9 +39,7 @@ public struct StackScreen<Content: View>: View {
|
|
|
46
39
|
|
|
47
40
|
public init(
|
|
48
41
|
backgroundColor: Color? = nil,
|
|
49
|
-
// AI-GENERATED START: custom screen background view (Compose backgroundComponent)
|
|
50
42
|
background: (() -> AnyView)? = nil,
|
|
51
|
-
// AI-GENERATED END: custom screen background view (Compose backgroundComponent)
|
|
52
43
|
headerTransparent: Bool = false,
|
|
53
44
|
fullScreenContent: Bool = false,
|
|
54
45
|
tintColor: Color = Colors.black17,
|
|
@@ -78,9 +69,7 @@ public struct StackScreen<Content: View>: View {
|
|
|
78
69
|
@ViewBuilder content: @escaping () -> Content
|
|
79
70
|
) {
|
|
80
71
|
self.backgroundColor = backgroundColor
|
|
81
|
-
// AI-GENERATED START: custom screen background view (Compose backgroundComponent)
|
|
82
72
|
self.background = background
|
|
83
|
-
// AI-GENERATED END: custom screen background view (Compose backgroundComponent)
|
|
84
73
|
self.headerTransparent = headerTransparent
|
|
85
74
|
self.fullScreenContent = fullScreenContent
|
|
86
75
|
self.tintColor = tintColor
|
|
@@ -245,7 +234,6 @@ public struct StackScreen<Content: View>: View {
|
|
|
245
234
|
public var body: some View {
|
|
246
235
|
GeometryReader { _ in
|
|
247
236
|
ZStack(alignment: .top) {
|
|
248
|
-
// AI-GENERATED START: custom screen background view (Compose backgroundComponent)
|
|
249
237
|
Group {
|
|
250
238
|
if let background {
|
|
251
239
|
background()
|
|
@@ -254,7 +242,6 @@ public struct StackScreen<Content: View>: View {
|
|
|
254
242
|
}
|
|
255
243
|
}
|
|
256
244
|
.edgesIgnoringSafeArea(.all)
|
|
257
|
-
// AI-GENERATED END: custom screen background view (Compose backgroundComponent)
|
|
258
245
|
|
|
259
246
|
VStack(spacing: 0) {
|
|
260
247
|
ZStack(alignment: fabProps?.position == .center ? .bottom : .bottomTrailing) {
|
|
@@ -853,15 +840,9 @@ public struct NavigationFooter: View {
|
|
|
853
840
|
max(navigationBarInset + Spacing.S - safeAreaBottom, 0)
|
|
854
841
|
}
|
|
855
842
|
|
|
856
|
-
///
|
|
857
|
-
///
|
|
858
|
-
///
|
|
859
|
-
/// the safe area over-reserves compared to Compose. `FloatingContent` rides the same
|
|
860
|
-
/// amount so the FAB keeps its distance above the band.
|
|
861
|
-
///
|
|
862
|
-
/// Natural position is `safeAreaBottom + bottomPadding` above the bottom of the screen;
|
|
863
|
-
/// Compose puts it at `(AppNavigationBar - keyboard).coerceAtLeast(0) + Spacing.S` on
|
|
864
|
-
/// top of the `imePadding()` lift — i.e. `max(navigationBar, keyboard) + Spacing.S`.
|
|
843
|
+
/// An offset, not padding: growing the footer feeds back into SwiftUI's keyboard avoidance and
|
|
844
|
+
/// never settles. Lands at Compose's `max(navigationBar, keyboard) + Spacing.S` from the bottom;
|
|
845
|
+
/// `FloatingContent` rides the same amount so the FAB keeps its distance above the band.
|
|
865
846
|
static func verticalOffset(keyboardSize: CGFloat) -> CGFloat {
|
|
866
847
|
(safeAreaBottom + bottomPadding) - (max(navigationBarInset, keyboardSize) + Spacing.S)
|
|
867
848
|
}
|
|
@@ -878,9 +859,8 @@ public struct NavigationFooter: View {
|
|
|
878
859
|
// without the margin the Spacing.S under the content goes too: negative, so the
|
|
879
860
|
// content sinks into the reserve while the frame keeps its bottom edge
|
|
880
861
|
.padding(.bottom, Self.bottomPadding - (Spacing.S - margin))
|
|
881
|
-
// Compose paints the surface
|
|
882
|
-
//
|
|
883
|
-
// With side insets (iPhone Duo) it stays inside them, off the side bar.
|
|
862
|
+
// Compose paints the surface down to the screen bottom: only the fill bleeds past the
|
|
863
|
+
// safe area, and with side insets (iPhone Duo) it stays inside them, off the side bar.
|
|
884
864
|
.background(
|
|
885
865
|
(transparent ? Color.clear : theme.colors.background.surface)
|
|
886
866
|
.ignoresSafeArea(.container, edges: hasSideInsets ? .bottom : [.bottom, .horizontal])
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/StackTransition.kt` (a 1:1 port of the RN kit's
|
|
6
|
-
// `forStackTransitionWithOverlay`) and of the NavHost it decorates. Every stack entry lives in
|
|
7
|
-
// its own UIHostingController, kept while the entry is on the stack and taken out of the window
|
|
8
|
-
// while covered, as UINavigationController does: a covered screen keeps its state, stops
|
|
9
|
-
// rendering and gets onDisappear / onAppear. The motion itself is drawn in SwiftUI, because an
|
|
10
|
-
// `offset` never moves the safe area the way a UIKit transform would.
|
|
11
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/StackTransition.kt` (RN `forStackTransitionWithOverlay`)
|
|
2
|
+
// and its NavHost. Each entry has its own UIHostingController, out of the window while covered as
|
|
3
|
+
// with UINavigationController; motion is a SwiftUI `offset`, which unlike a transform keeps the safe area.
|
|
12
4
|
|
|
13
5
|
import SwiftUI
|
|
14
6
|
import UIKit
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/SwipeBackHaptic.kt`: one light tick when the host back
|
|
6
|
-
// gesture has dragged the screen 50pt, re-armed once it goes back under.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/SwipeBackHaptic.kt`: one light tick when the host back
|
|
2
|
+
// gesture has dragged the screen 50pt, re-armed once it goes back under.
|
|
8
3
|
|
|
9
4
|
import UIKit
|
|
10
5
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// MoMoUIKits
|
|
4
|
-
//
|
|
5
|
-
// SwiftUI mirror of Compose's `navigation/tracking/ScreenTracker.kt`. Pure
|
|
6
|
-
// logic, no platform dependency beyond the `MaxApi` bridge.
|
|
7
|
-
//
|
|
1
|
+
// SwiftUI mirror of Compose's `navigation/tracking/ScreenTracker.kt`. Pure
|
|
2
|
+
// logic, no platform dependency beyond the `MaxApi` bridge.
|
|
8
3
|
|
|
9
4
|
import Foundation
|
|
10
5
|
|