@momo-kits/native-kits 0.162.44 → 0.162.45
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 +45 -3
- package/README.md +2 -2
- package/ios/Application/ApplicationEnvironment.swift +17 -0
- package/ios/Application/MaxApi.swift +30 -3
- package/ios/Avatar/Avatar.swift +4 -3
- package/ios/Badge/Badge.swift +6 -4
- package/ios/Badge/BadgeDot.swift +1 -1
- package/ios/Badge/BadgeRibbon.swift +0 -1
- package/ios/Button/Button.swift +15 -12
- package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +64 -18
- package/ios/Carousel/Carousel.swift +29 -12
- package/ios/Checkbox/Checkbox.swift +7 -3
- package/ios/Chip/Chip.swift +5 -4
- package/ios/Collapse/Collapse.swift +70 -19
- package/ios/Colors+Radius+Spacing/Colors.swift +10 -1
- package/ios/Colors+Radius+Spacing/Radius.swift +6 -0
- package/ios/DateTimePicker/DateTimePicker.swift +54 -20
- package/ios/DateTimePicker/WheelPicker.swift +103 -105
- package/ios/Divider/Divider.swift +37 -4
- package/ios/Extensions/Color++.swift +38 -9
- package/ios/Extensions/OptionalEnvironmentObject.swift +12 -0
- package/ios/Extensions/SkeletonUICompat.swift +11 -0
- package/ios/Icon/Icon.swift +21 -23
- package/ios/Icon/Icons.swift +1329 -0
- package/ios/IconButton/IconButton.swift +15 -7
- package/ios/Image/Image.swift +7 -23
- package/ios/Information/Information.swift +27 -9
- package/ios/Input/ErrorView.swift +2 -2
- package/ios/Input/Input.swift +160 -147
- package/ios/Input/InputPhoneNumber.swift +12 -9
- package/ios/Input/InputSearch.swift +107 -77
- package/ios/Input/InputTextArea.swift +128 -145
- package/ios/InputDropDown/InputDropDown.swift +10 -7
- package/ios/InputMoney/InputMoney.swift +33 -11
- package/ios/InputOTP/InputOTP.swift +22 -12
- package/ios/Layout/Card.swift +50 -0
- package/ios/Layout/GridContext.swift +187 -3
- package/ios/Layout/Item.swift +5 -4
- package/ios/Layout/ScreenLayout.swift +385 -0
- package/ios/Layout/Section.swift +4 -100
- package/ios/Loader/Loader.swift +5 -9
- package/ios/Lottie/LottieView.swift +14 -2
- package/ios/{Application/Navigation/Overplay → Navigation}/BottomSheet.swift +169 -29
- package/ios/Navigation/BottomTab/BottomTab.swift +332 -0
- package/ios/{Application/Navigation → Navigation}/BottomTab/BottomTabBar.swift +18 -7
- package/ios/Navigation/BottomTab/DuoBarCompression.swift +104 -0
- package/ios/Navigation/BottomTab/DuoTabBar.swift +329 -0
- package/ios/{Application → Navigation/Component}/FloatingButton.swift +43 -54
- package/ios/Navigation/Component/Header.swift +545 -0
- package/ios/Navigation/Component/HeaderBackground.swift +154 -0
- package/ios/Navigation/Component/HeaderJourney.swift +73 -0
- package/ios/Navigation/Component/HeaderLocation.swift +48 -0
- package/ios/Navigation/Component/HeaderRight.swift +425 -0
- package/ios/Navigation/Component/HeaderTitle.swift +36 -0
- package/ios/{Application/Navigation → Navigation/Component}/HeaderUser.swift +21 -24
- package/ios/Navigation/Component/SideBar.swift +183 -0
- package/ios/{Application/Navigation/Overplay → Navigation/Component}/SnackBar.swift +8 -8
- package/ios/Navigation/HostBackGestureBridge.swift +78 -0
- package/ios/{Application/Navigation/Overplay → Navigation}/ModalScreen.swift +9 -2
- package/ios/Navigation/Navigation.swift +204 -0
- package/ios/Navigation/NavigationContainer.swift +195 -0
- package/ios/{Application/Navigation → Navigation}/Navigator.swift +207 -107
- package/ios/Navigation/StackScreen.swift +930 -0
- package/ios/Navigation/StackTransition.swift +400 -0
- package/ios/Navigation/SwipeBackHaptic.swift +33 -0
- package/ios/{Application/Navigation → Navigation}/Tracking/ScreenTracker.swift +12 -5
- package/ios/OTPKeyboard/OTPKeyboard.swift +8 -11
- package/ios/Pagination/PaginationScroll.swift +2 -2
- package/ios/Popup/PopupDisplay.swift +72 -135
- package/ios/Popup/PopupInput.swift +10 -13
- package/ios/Popup/PopupLayout.swift +140 -0
- package/ios/Popup/PopupNotify.swift +59 -69
- package/ios/Popup/PopupPromotion.swift +31 -47
- package/ios/PopupView/FullscreenPopup.swift +13 -19
- package/ios/PopupView/PopupView.swift +1 -1
- package/ios/PopupView/Utils++.swift +0 -8
- package/ios/ProgressInfo/ProgressInfo.swift +4 -2
- package/ios/Radio/Radio.swift +2 -1
- package/ios/Rating/Rating.swift +9 -1
- package/ios/Resources/dot_loading.json +558 -0
- package/ios/Resources/lottie_circle_loader.json +1 -0
- package/ios/ScrollIndicator/ScrollIndicator.swift +11 -10
- package/ios/Skeleton/Skeleton.swift +22 -27
- package/ios/Slider/Slider.swift +16 -18
- package/ios/Stepper/Stepper.swift +6 -1
- package/ios/Steps/Steps.swift +8 -6
- package/ios/SuggestAction/SuggestAction.swift +5 -0
- package/ios/Swipeable/SwipeCell.swift +10 -6
- package/ios/Switch/Switch.swift +22 -20
- package/ios/TabView/TabView.swift +102 -21
- package/ios/Tag/Tag.swift +15 -4
- package/ios/Template/Logo/Logo.swift +2 -1
- package/ios/Template/TrustBanner/TrustBanner.swift +106 -54
- package/ios/Title/Title.swift +6 -17
- package/ios/Tooltip/Tooltip.swift +29 -14
- package/ios/Typography/FontScale.swift +3 -3
- package/ios/Typography/Text.swift +81 -19
- package/ios/Uploader/Uploader.swift +3 -1
- package/ios/native-kits.podspec +2 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +1 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DuoTabDemo.swift +80 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +2 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IPhoneDuoDemo.swift +173 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +77 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +1 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +2 -2
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +2 -0
- package/package.json +1 -1
- package/scripts/gen-ios-icons.mjs +36 -0
- package/ios/Application/Components.swift +0 -270
- package/ios/Application/ComposeApi.swift +0 -22
- package/ios/Application/HeaderRight.swift +0 -306
- package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -104
- package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
- package/ios/Application/Navigation/HeaderTitle.swift +0 -57
- package/ios/Application/Navigation/NavigationContainer.swift +0 -213
- package/ios/Application/Navigation/NavigationOptions.swift +0 -109
- package/ios/Application/Navigation/NavigatorManager.swift +0 -22
- package/ios/Application/Navigation/component/Header.swift +0 -178
- package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
- package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
- package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +0 -11
- package/ios/Application/Navigation/component/NavigationFooter.swift +0 -90
- package/ios/Application/Navigation/component/NavigationHeaderRight.swift +0 -196
- package/ios/Application/Screen.swift +0 -250
- package/ios/Application/StackScreen.swift +0 -492
- /package/ios/{Application/Navigation → Navigation}/BottomTab/CurvedContainer.swift +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// File: ios/Extensions/SkeletonUICompat.swift
|
|
2
|
+
// Created At: 2026-10-07 12:03:28 +07:00
|
|
3
|
+
// Created By: AI
|
|
4
|
+
// AI Agent: Claude Code
|
|
5
|
+
// Model: claude-opus-5-5
|
|
6
|
+
|
|
7
|
+
// AI-GENERATED START: keep SkeletonUI extensions visible to MoMoUIKits clients
|
|
8
|
+
// Unused here on purpose: Swift 5 exposes extension members of every module a dependency imports, so clients
|
|
9
|
+
// that only `import MoMoUIKits` rely on SkeletonUI's (e.g. `Text(String?)` in NativeWidget). Removing it breaks them.
|
|
10
|
+
import SkeletonUI
|
|
11
|
+
// AI-GENERATED END: keep SkeletonUI extensions visible to MoMoUIKits clients
|
package/ios/Icon/Icon.swift
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
|
+
import SDWebImageSwiftUI
|
|
1
2
|
import SwiftUI
|
|
2
3
|
|
|
3
4
|
struct IconSource: Codable {
|
|
4
5
|
let uri: String
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
// The compiled-in map (Icons.swift) wins; a host `icon.json` in the main bundle only adds keys
|
|
9
|
+
// the kit doesn't know, so hosts that shipped one keep their extra icons.
|
|
10
|
+
let iconSources: [String: String] = {
|
|
11
|
+
guard let url = Bundle.main.url(forResource: "icon", withExtension: "json"),
|
|
12
|
+
let data = try? Data(contentsOf: url),
|
|
13
|
+
let hostIcons = try? JSONDecoder().decode([String: IconSource].self, from: data) else {
|
|
14
|
+
return kitIcons
|
|
11
15
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let data = try Data(contentsOf: url)
|
|
15
|
-
let decoded = try JSONDecoder().decode([String: IconSource].self, from: data)
|
|
16
|
-
return decoded
|
|
17
|
-
} catch {
|
|
18
|
-
print("Error decoding icon.json: \(error)")
|
|
19
|
-
return [:]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Load the JSON data into a global variable
|
|
24
|
-
let iconSources: [String: IconSource] = loadIconSources()
|
|
25
|
-
|
|
26
|
-
// Icons that must never be tinted (mirror Compose `noThemeIcons`)
|
|
27
|
-
let noThemeIcons: [String] = ["ic_round_momo_tiny"]
|
|
16
|
+
return kitIcons.merging(hostIcons.mapValues(\.uri)) { kit, _ in kit }
|
|
17
|
+
}()
|
|
28
18
|
|
|
29
19
|
// Compose defaults `color` to the theme text color while `color = null` means "no tint".
|
|
30
20
|
// Swift can't tell an omitted argument from an explicit `nil`, so the default is this
|
|
@@ -53,16 +43,24 @@ public struct Icon: View {
|
|
|
53
43
|
}
|
|
54
44
|
|
|
55
45
|
public var body: some View {
|
|
56
|
-
// Mirror Compose: an https source is used as-is, anything else is a key into icon
|
|
57
|
-
if let uri = source.contains("https") ? source : iconSources[source]
|
|
46
|
+
// Mirror Compose: an https source is used as-is, anything else is a key into the icon map
|
|
47
|
+
if let uri = source.contains("https") ? source : iconSources[source] {
|
|
58
48
|
let requestedColor = color == iconThemeColor ? theme.colors.text.default : color
|
|
59
49
|
// Mirror Compose: certain icons (e.g. branded glyphs) are never tinted
|
|
60
50
|
let resolvedColor = noThemeIcons.contains(source) ? nil : requestedColor
|
|
61
|
-
|
|
51
|
+
// Bare WebImage like Compose's AsyncImage: no skeleton while loading, nothing on failure.
|
|
52
|
+
WebImage(url: URL(string: uri), isAnimating: .constant(true))
|
|
53
|
+
.resizable()
|
|
54
|
+
.renderingMode(resolvedColor != nil ? .template : .original)
|
|
55
|
+
.scaledToFit()
|
|
56
|
+
.foregroundColor(resolvedColor)
|
|
62
57
|
.frame(width: size, height: size)
|
|
63
58
|
// Mirrors Compose's auto-generated `contentDescription = "img|$iconUrl"`
|
|
64
59
|
// when no explicit label is provided.
|
|
65
60
|
.accessibilityLabel(accessibilityLabel ?? "img|\(uri)")
|
|
61
|
+
} else {
|
|
62
|
+
// Compose keeps the sized box for an unknown key, so layouts don't collapse.
|
|
63
|
+
Color.clear.frame(width: size, height: size)
|
|
66
64
|
}
|
|
67
65
|
}
|
|
68
66
|
}
|