@momo-kits/native-kits 0.169.6 → 0.169.7

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.
Files changed (91) hide show
  1. package/ios/Application/ApplicationEnvironment.swift +2 -3
  2. package/ios/Application/DesignSystemKits.swift +4 -20
  3. package/ios/Application/DesignSystemKitsPayload.swift +0 -8
  4. package/ios/Application/LanguageSource.swift +0 -8
  5. package/ios/Application/Localize.swift +7 -31
  6. package/ios/Application/LocalizeModifier.swift +0 -8
  7. package/ios/Application/MaxApi.swift +3 -11
  8. package/ios/Avatar/Avatar.swift +0 -1
  9. package/ios/Badge/Badge.swift +0 -1
  10. package/ios/Badge/BadgeRibbon.swift +2 -5
  11. package/ios/Button/Button.swift +2 -5
  12. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +2 -2
  13. package/ios/Carousel/Carousel.swift +5 -17
  14. package/ios/Checkbox/Checkbox.swift +0 -2
  15. package/ios/Colors+Radius+Spacing/Theme.swift +0 -7
  16. package/ios/DateTimePicker/DateTimePicker.swift +4 -10
  17. package/ios/DateTimePicker/DateTimePickerTypes.swift +1 -3
  18. package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -3
  19. package/ios/DateTimePicker/WheelPicker.swift +2 -4
  20. package/ios/Extensions/SkeletonUICompat.swift +0 -8
  21. package/ios/Icon/Icon.swift +1 -3
  22. package/ios/IconButton/IconButton.swift +0 -2
  23. package/ios/Input/ErrorView.swift +0 -7
  24. package/ios/Input/Input.swift +6 -19
  25. package/ios/Input/InputPhoneNumber.swift +0 -11
  26. package/ios/Input/InputSearch.swift +0 -6
  27. package/ios/Input/InputTextArea.swift +1 -12
  28. package/ios/InputDropDown/InputDropDown.swift +1 -11
  29. package/ios/InputMoney/InputMoney.swift +9 -28
  30. package/ios/InputOTP/InputOTP.swift +2 -9
  31. package/ios/Layout/Item.swift +1 -2
  32. package/ios/Layout/ModalLayout.swift +7 -14
  33. package/ios/Layout/ScreenLayout.swift +2 -7
  34. package/ios/Loader/Loader.swift +3 -12
  35. package/ios/Lottie/LottieView.swift +0 -11
  36. package/ios/Navigation/BottomSheet.swift +14 -35
  37. package/ios/Navigation/BottomTab/BottomTab.swift +10 -19
  38. package/ios/Navigation/BottomTab/BottomTabBar.swift +4 -10
  39. package/ios/Navigation/BottomTab/CurvedContainer.swift +5 -11
  40. package/ios/Navigation/BottomTab/DuoBarCompression.swift +6 -12
  41. package/ios/Navigation/BottomTab/DuoTabBar.swift +2 -7
  42. package/ios/Navigation/BottomTab/TabBarMetrics.swift +3 -9
  43. package/ios/Navigation/Component/FloatingButton.swift +4 -11
  44. package/ios/Navigation/Component/Header.swift +4 -8
  45. package/ios/Navigation/Component/HeaderBackground.swift +2 -8
  46. package/ios/Navigation/Component/HeaderJourney.swift +2 -7
  47. package/ios/Navigation/Component/HeaderLocation.swift +2 -7
  48. package/ios/Navigation/Component/HeaderRight.swift +2 -7
  49. package/ios/Navigation/Component/HeaderTitle.swift +1 -6
  50. package/ios/Navigation/Component/HeaderUser.swift +2 -9
  51. package/ios/Navigation/Component/SideBar.swift +3 -8
  52. package/ios/Navigation/Component/SnackBar.swift +5 -13
  53. package/ios/Navigation/HostBackGestureBridge.swift +3 -9
  54. package/ios/Navigation/ModalScreen.swift +2 -8
  55. package/ios/Navigation/Navigation.swift +2 -15
  56. package/ios/Navigation/NavigationContainer.swift +3 -12
  57. package/ios/Navigation/Navigator.swift +15 -27
  58. package/ios/Navigation/StackScreen.swift +8 -28
  59. package/ios/Navigation/StackTransition.swift +3 -11
  60. package/ios/Navigation/SwipeBackHaptic.swift +2 -7
  61. package/ios/Navigation/Tracking/ScreenTracker.swift +2 -7
  62. package/ios/Pagination/PaginationDot.swift +0 -9
  63. package/ios/Pagination/PaginationNumber.swift +1 -9
  64. package/ios/Pagination/PaginationScroll.swift +2 -14
  65. package/ios/Pagination/PaginationWhiteDot.swift +1 -10
  66. package/ios/Popup/PopupDisplay.swift +3 -3
  67. package/ios/Popup/PopupInput.swift +1 -1
  68. package/ios/Popup/PopupLayout.swift +3 -3
  69. package/ios/PopupView/FullscreenPopup.swift +3 -4
  70. package/ios/PopupView/PopupView.swift +2 -2
  71. package/ios/PopupView/Utils++.swift +1 -2
  72. package/ios/ProgressInfo/ProgressInfo.swift +2 -13
  73. package/ios/Skeleton/Skeleton.swift +2 -10
  74. package/ios/Slider/Slider.swift +5 -12
  75. package/ios/StatusBarTap/StatusBarTap.h +2 -3
  76. package/ios/StatusBarTap/StatusBarTap.m +3 -16
  77. package/ios/Stepper/Stepper.swift +8 -27
  78. package/ios/Steps/Steps.swift +9 -11
  79. package/ios/Swipeable/SwipeCell.swift +2 -2
  80. package/ios/Swipeable/SwipeCellModel.swift +3 -6
  81. package/ios/TabView/TabView.swift +12 -25
  82. package/ios/Template/TrustBanner/TrustBanner.swift +2 -9
  83. package/ios/Tooltip/Tooltip.swift +2 -7
  84. package/ios/Typography/FontScale.swift +3 -15
  85. package/ios/Typography/Text.swift +2 -7
  86. package/ios/Typography/Typography.swift +8 -10
  87. package/ios/Uploader/Uploader.swift +2 -17
  88. package/ios/native-kits.podspec +1 -1
  89. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  90. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +0 -8
  91. package/package.json +1 -1
@@ -1,9 +1,8 @@
1
1
  import SwiftUI
2
2
 
3
- // ---------------------------------------------------------------------------
4
- // Style enums (prefixed with `Tab` to avoid collisions with existing public
5
- // types like ButtonSize / InputSize / TagColor)
6
- // ---------------------------------------------------------------------------
3
+ // MARK: - Style enums
4
+
5
+ // Prefixed to avoid colliding with other public kit types (ButtonSize, InputSize, TagColor).
7
6
 
8
7
  public enum TabViewType {
9
8
  case `default`
@@ -15,10 +14,9 @@ public enum TabViewDirection {
15
14
  case column
16
15
  }
17
16
 
18
- // ---------------------------------------------------------------------------
19
- // Data model — mirrors Compose `TabViewItem`
20
- // ---------------------------------------------------------------------------
17
+ // MARK: - Data model
21
18
 
19
+ /// Mirrors Compose `TabViewItem`.
22
20
  public struct TabViewItem {
23
21
  public let title: String
24
22
  public let icon: String?
@@ -72,10 +70,9 @@ public struct TabViewItem {
72
70
  }
73
71
  }
74
72
 
75
- // ---------------------------------------------------------------------------
76
- // Public component — named `MomoTabView` to avoid shadowing SwiftUI.TabView
77
- // ---------------------------------------------------------------------------
73
+ // MARK: - MomoTabView
78
74
 
75
+ /// Named `MomoTabView` to avoid shadowing SwiftUI's `TabView`.
79
76
  public struct MomoTabView: View {
80
77
  @Environment(\.appTheme) private var theme
81
78
 
@@ -213,9 +210,7 @@ public struct MomoTabView: View {
213
210
  }
214
211
  }
215
212
 
216
- // ---------------------------------------------------------------------------
217
- // Default fixed-width tab bar (equal-width items + animated underline)
218
- // ---------------------------------------------------------------------------
213
+ // MARK: - Default tab bar (equal-width items)
219
214
 
220
215
  private struct DefaultTabBar: View {
221
216
  @Environment(\.appTheme) private var theme
@@ -266,9 +261,7 @@ private struct DefaultTabBar: View {
266
261
  }
267
262
  }
268
263
 
269
- // ---------------------------------------------------------------------------
270
- // Scrollable tab bar (wrap-width items, horizontal scroll, animated underline)
271
- // ---------------------------------------------------------------------------
264
+ // MARK: - Scrollable tab bar (wrap-width items)
272
265
 
273
266
  private struct ScrollableTabBar: View {
274
267
  @Environment(\.appTheme) private var theme
@@ -347,9 +340,7 @@ private struct TabFramePreferenceKey: PreferenceKey {
347
340
  }
348
341
  }
349
342
 
350
- // ---------------------------------------------------------------------------
351
- // Card tab bar
352
- // ---------------------------------------------------------------------------
343
+ // MARK: - Card tab bar
353
344
 
354
345
  private let cardTabHeight: CGFloat = 40
355
346
  private let cardTabActiveHeight: CGFloat = 44
@@ -480,9 +471,7 @@ private struct CardTabEarShape: Shape {
480
471
  }
481
472
  }
482
473
 
483
- // ---------------------------------------------------------------------------
484
- // Shared tab item (Default + Scrollable bars)
485
- // ---------------------------------------------------------------------------
474
+ // MARK: - Shared tab item (default + scrollable bars)
486
475
 
487
476
  private struct TabItemView: View {
488
477
  let tab: TabViewItem
@@ -563,9 +552,7 @@ private struct TabItemView: View {
563
552
  }
564
553
  }
565
554
 
566
- // ---------------------------------------------------------------------------
567
- // Shared helpers
568
- // ---------------------------------------------------------------------------
555
+ // MARK: - Shared helpers
569
556
 
570
557
  private func barHeight(_ direction: TabViewDirection) -> CGFloat {
571
558
  direction == .column ? 68 : 48
@@ -1,10 +1,3 @@
1
- //
2
- // TrustBanner.swift
3
- // MoMoUIKits
4
- //
5
- // Created by Nguyễn Hoàng Sơn on 14/12/2023.
6
- //
7
-
8
1
  import Foundation
9
2
  import SwiftUI
10
3
  import SDWebImageSwiftUI
@@ -131,7 +124,7 @@ public struct TrustBanner: View {
131
124
  MomoText(
132
125
  localize.translateData(banner.content),
133
126
  typography: .descriptionDefaultRegular,
134
- color: Color(hex: "484848"),
127
+ color: Colors.black15,
135
128
  maxLines: 2
136
129
  )
137
130
  .padding(.bottom, 8)
@@ -166,7 +159,7 @@ public struct TrustBanner: View {
166
159
  }
167
160
  }
168
161
  .padding(.all, 12)
169
- .background(Color(hex: "F2F8FF"))
162
+ .background(Colors.blue10)
170
163
  .cornerRadius(12)
171
164
  .contentShape(Rectangle())
172
165
  .onTapGesture {
@@ -41,17 +41,14 @@ public final class TooltipState: ObservableObject {
41
41
 
42
42
  public init() {}
43
43
 
44
- /// Shows the tooltip.
45
44
  public func show() {
46
45
  isVisible = true
47
46
  }
48
47
 
49
- /// Hides the tooltip.
50
48
  public func hide() {
51
49
  isVisible = false
52
50
  }
53
51
 
54
- /// Toggles the tooltip visibility.
55
52
  public func toggle() {
56
53
  isVisible.toggle()
57
54
  }
@@ -126,10 +123,8 @@ private struct TooltipAnchorBoundsKey: PreferenceKey {
126
123
 
127
124
  // MARK: - Tooltip
128
125
 
129
- /// A tooltip component that wraps `content` (the anchor) and shows a positioned
130
- /// tooltip popup with title, description, close button, and action buttons.
131
- ///
132
- /// Port of the Compose / React Native `Tooltip` component.
126
+ /// Port of the Compose / RN `Tooltip`: wraps `content` (the anchor) and shows a positioned popup
127
+ /// with title, description, close button and action buttons.
133
128
  public struct Tooltip<Content: View>: View {
134
129
  @ObservedObject private var state: TooltipState
135
130
  private let title: String?
@@ -1,10 +1,3 @@
1
- // File: ios/Typography/FontScale.swift
2
- // Created At: 2026-08-06 10:00:00 +07:00
3
- // Created By: AI
4
- // AI Agent: Claude Code
5
- // Model: claude-opus-5
6
-
7
- // AI-GENERATED START: reactive font-scale snapshot injected through the environment
8
1
  import SwiftUI
9
2
 
10
3
  /// Immutable snapshot of the kit's font-scale inputs. The formula is a 1:1 port of Compose's
@@ -19,11 +12,10 @@ public struct FontScale: Equatable {
19
12
  public let useOSScaleRate: Bool
20
13
  /// OS Dynamic Type factor at the time the snapshot was taken.
21
14
  public let osFontScale: CGFloat
22
- // AI-GENERATED START: device scale from the app window, not UIScreen.main (fixed to one display on iPhone Duo)
15
+ /// From the app window, not UIScreen.main (which stays on one display on iPhone Duo).
23
16
  public let windowShortSide: CGFloat
24
- /// Opt-in ceiling (Compose's `MiniAppContext.scaleSizeMaxRate`): when set, the result never
25
- /// exceeds size × maxScaleRate, in both the userScaleRate path and the OS path. nil keeps the
26
- /// old behavior. Used by `CappedFontScale` for the bottom-tab labels.
17
+ /// Opt-in ceiling (Compose's `MiniAppContext.scaleSizeMaxRate`): caps the result at size × maxScaleRate
18
+ /// on both the userScaleRate and OS paths; nil means no cap. Used by `CappedFontScale` for tab labels.
27
19
  public let maxScaleRate: CGFloat?
28
20
 
29
21
  public init(
@@ -50,7 +42,6 @@ public struct FontScale: Equatable {
50
42
 
51
43
  // Short side, not width: landscape must not inflate every font (and so every popup's height).
52
44
  let deviceScale = windowShortSide / Self.defaultScreenSize
53
- // AI-GENERATED END: device scale from the app window, not UIScreen.main (fixed to one display on iPhone Duo)
54
45
 
55
46
  var deviceScaled = size
56
47
  var osScaled = size
@@ -89,9 +80,7 @@ public struct FontScale: Equatable {
89
80
  userScaleRate: userScaleRate ?? self.userScaleRate,
90
81
  useOSScaleRate: useOSScaleRate ?? self.useOSScaleRate,
91
82
  osFontScale: osFontScale,
92
- // AI-GENERATED START: keep the window size through context overrides
93
83
  windowShortSide: windowShortSide,
94
- // AI-GENERATED END: keep the window size through context overrides
95
84
  maxScaleRate: maxScaleRate
96
85
  )
97
86
  }
@@ -137,4 +126,3 @@ private struct MomoFontScaleModifier: ViewModifier {
137
126
  .environment(\.designSystemKitsConfigs, store.getConfigs())
138
127
  }
139
128
  }
140
- // AI-GENERATED END: reactive font-scale snapshot injected through the environment
@@ -107,7 +107,7 @@ private enum MomoFontFace {
107
107
  /// Port of Compose `getFontFamily`; SF Pro Text is the iOS system font, so the legacy family is `.system`.
108
108
  private func momoFontFace(family: String, weight: Font.Weight, isWhiteList: Bool) -> MomoFontFace? {
109
109
  let isNewFamily = family == "MomoTrustSans" || family == headerFontFamily
110
- // Outside the whitelist the new DS families drop to the legacy font, as before DS-791.
110
+ // Outside the whitelist the DS-791 families fall back to the legacy font.
111
111
  if family == "SFProText" || (isNewFamily && !isWhiteList) { return .system }
112
112
  // single-file families (Compose maps every weight to the same .otf)
113
113
  if family == headerFontFamily || family == "MoMoSignature" { return .named(family) }
@@ -264,8 +264,6 @@ public struct MomoText: View {
264
264
  self.textAlign = textAlign
265
265
  self.maxLines = maxLines
266
266
  self.minLines = minLines
267
- // SwiftUI's range-based `lineLimit` is iOS 16+ only; keep the range for
268
- // newer OS versions and fall back to the legacy single-value overload.
269
267
  if maxLines == Int.max && minLines <= 1 {
270
268
  self.lineLimitRange = nil
271
269
  } else {
@@ -345,8 +343,6 @@ public struct MomoText: View {
345
343
 
346
344
  public var body: some View {
347
345
  let textColor = color ?? theme.colors.text.default
348
- // Strikethrough is driven either by the typography variant (mirrors Compose
349
- // *Strikethrough styles) or the explicit `strikethrough` flag.
350
346
  let isStrikethrough = strikethrough || typography.isStrikethrough
351
347
 
352
348
  // lineSpacing is added on top of the font's natural line height, not on top of fontSize.
@@ -379,8 +375,7 @@ public struct MomoText: View {
379
375
  }
380
376
  }
381
377
 
382
- // Applies a line-limit range only on iOS 16+. Older targets use the legacy
383
- // single-value overload so the file still compiles for iOS 15.
378
+ // Range-based `lineLimit` is iOS 16+; iOS 15 gets the upper bound only.
384
379
  private struct LineLimitModifier: ViewModifier {
385
380
  let range: ClosedRange<Int>?
386
381
 
@@ -1,19 +1,17 @@
1
1
  import SwiftUI
2
2
 
3
3
  public extension View {
4
- /// Forces SwiftUI to ignore the OS "Bold Text" accessibility setting so the
5
- /// kit's typography weight stays fixed and matches the Compose implementation
6
- /// (which does not honor that OS setting). Apply it wherever a `.font(...)` is set.
4
+ /// Ignores the OS "Bold Text" setting so weights stay fixed, as in Compose (which doesn't honor it).
5
+ /// Apply it wherever a `.font(...)` is set.
7
6
  func ignoreBoldTextSetting() -> some View {
8
7
  environment(\.legibilityWeight, .regular)
9
8
  }
10
9
  }
11
10
 
12
11
  public extension Font {
13
- /// Non-reactive: resolves against the current `DesignSystemKits` font scale at each access. The
14
- /// styles below are computed properties for that reason — as stored `static let`s they would
15
- /// freeze the scale at first access and never pick up a Dynamic Type change.
16
- /// Inside a view, `@Environment(\.momoFontScale)` + `fontScale.font(size:weight:)` also re-renders.
12
+ /// Non-reactive: reads the `DesignSystemKits` font scale on each access, so the styles below are computed
13
+ /// (a `static let` would freeze the scale). Inside a view, `@Environment(\.momoFontScale)` +
14
+ /// `fontScale.font(size:weight:)` also re-renders on change.
17
15
  static func appFont(size: CGFloat) -> Font {
18
16
  DesignSystemKits.shared.fontScale.font(size: size)
19
17
  }
@@ -62,17 +60,17 @@ public extension Font {
62
60
  static var action_s: Font { appFont(size: 15).weight(.bold) }
63
61
 
64
62
  // deprecated
65
- static var h1: Font { appFont(size: 36).weight(.semibold) } //headline_xl
63
+ static var h1: Font { appFont(size: 36).weight(.semibold) } // headline_xl
66
64
  static var h2: Font { appFont(size: 32).weight(.semibold) }
67
65
  static var h3: Font { appFont(size: 28).weight(.semibold) }
68
66
  static var h4: Font { appFont(size: 24).weight(.semibold) }
69
67
  static var title1: Font { appFont(size: 20).weight(.bold) }
70
68
  static var title2: Font { appFont(size: 18).weight(.bold) }
71
69
  static var title3: Font { appFont(size: 16).weight(.bold) }
72
- static var headerText1: Font { appFont(size: 15).weight(.semibold) } //header_default
70
+ static var headerText1: Font { appFont(size: 15).weight(.semibold) } // header_default
73
71
  static var headerText2: Font { appFont(size: 14).weight(.semibold) }
74
72
  static var headerText3: Font { appFont(size: 12).weight(.semibold) }
75
- static var paragraph: Font { appFont(size: 15).weight(.regular) } //paragraph_default
73
+ static var paragraph: Font { appFont(size: 15).weight(.regular) } // paragraph_default
76
74
  static var description1: Font { appFont(size: 14).weight(.regular) }
77
75
  static var description2: Font { appFont(size: 12).weight(.regular) }
78
76
  static var description3: Font { appFont(size: 10).weight(.regular) }
@@ -1,21 +1,5 @@
1
1
  import SwiftUI
2
2
 
3
- /// Native SwiftUI port of the Compose `Uploader` component.
4
- ///
5
- /// Renders a horizontal row with an optional dashed "add image" picker cell
6
- /// followed by a horizontally scrollable list of uploaded image thumbnails.
7
- /// Each thumbnail can show a loading shimmer overlay and an optional cancel
8
- /// button.
9
- ///
10
- /// Mirrors the Compose surface in
11
- /// `compose/.../components/Uploader.kt`:
12
- /// - `images`, `numberOfImages`, `disabled`, `width`, `height`
13
- /// - callbacks `onAdd`, `onCancel`, `onPressImage`
14
- ///
15
- /// Note: like Compose, this component does NOT perform any native photo-picker
16
- /// or file-system access. It exposes the `onAdd` callback so the host can
17
- /// present a picker and supply the resulting image data back via the `images`
18
- /// list (the demo passes mock image URLs).
19
3
  public struct UploadImage: Identifiable {
20
4
  public let id = UUID()
21
5
  public var uri: String?
@@ -27,6 +11,8 @@ public struct UploadImage: Identifiable {
27
11
  }
28
12
  }
29
13
 
14
+ /// Compose `Uploader`: an optional dashed "add image" cell, then a scrollable row of thumbnails.
15
+ /// Like Compose it opens no picker: the host handles `onAdd` and passes the result back in `images`.
30
16
  public struct Uploader: View {
31
17
  // MARK: Properties
32
18
 
@@ -108,7 +94,6 @@ private struct UploaderPickerCell: View {
108
94
  let height: CGFloat
109
95
  let onAdd: () -> Void
110
96
 
111
- // text.disable / text.hint and border.disable / border.default tokens.
112
97
  private var mainColor: Color { disabled ? theme.colors.text.disable : theme.colors.text.hint }
113
98
  private var borderColor: Color { disabled ? theme.colors.border.disable : theme.colors.border.default }
114
99
 
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.169.6'
3
+ s.version = '0.169.7'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.169.6'
3
+ s.version = '0.169.7'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -24,14 +24,11 @@ private let AppTranslations = LocalizationObject(
24
24
  )
25
25
 
26
26
  struct LocalizeDemo: View {
27
- // AI-GENERATED START: observe the app language and drive it through the real platform API
28
27
  @Environment(\.localize) private var localize
29
28
  @Environment(\.applicationEnvironment) private var applicationEnvironment
30
- // AI-GENERATED END: observe the app language and drive it through the real platform API
31
29
 
32
30
  private var isEnglish: Bool { localize.currentLanguage == Localize.EN }
33
31
 
34
- // AI-GENERATED START: observe the app language and drive it through the real platform API
35
32
  private var storedLanguage: String {
36
33
  UserDefaults.standard.string(forKey: UserDefaultsLanguageSource.defaultKey) ?? "nil"
37
34
  }
@@ -45,7 +42,6 @@ struct LocalizeDemo: View {
45
42
  localize.changeLanguage(language) // #Preview / sample app: no host bridge
46
43
  }
47
44
  }
48
- // AI-GENERATED END: observe the app language and drive it through the real platform API
49
45
 
50
46
  var body: some View {
51
47
  ScrollView {
@@ -65,7 +61,6 @@ struct LocalizeDemo: View {
65
61
  MomoText("currentLanguage = \(localize.currentLanguage)", typography: .labelDefaultMedium)
66
62
  }
67
63
 
68
- // AI-GENERATED START: prove the observation loop, not kit-local state, drives updates
69
64
  LocalizeSectionBox(title: "Nguồn thật: UserDefaults") {
70
65
  MomoText(
71
66
  "Ghi thẳng vào UserDefaults, bỏ qua mọi API của kit — màn hình vẫn đổi, chứng minh "
@@ -88,7 +83,6 @@ struct LocalizeDemo: View {
88
83
  isFull: false
89
84
  )
90
85
  }
91
- // AI-GENERATED END: prove the observation loop, not kit-local state, drives updates
92
86
 
93
87
  LocalizeSectionBox(title: "translate(key) — từ điển mặc định của kit") {
94
88
  TranslationRow(key: "confirm", value: localize.translate("confirm"))
@@ -224,10 +218,8 @@ private struct TranslationRow: View {
224
218
  #Preview {
225
219
  if #available(iOS 16.0, *) {
226
220
  NavigationStack {
227
- // AI-GENERATED START: preview needs the observing provider or the toggle will not update
228
221
  LocalizeDemo()
229
222
  .momoLocalize(Localize())
230
- // AI-GENERATED END: preview needs the observing provider or the toggle will not update
231
223
  }
232
224
  } else {
233
225
  // Fallback on earlier versions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.169.6",
3
+ "version": "0.169.7",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "publish:local": "bash publish.sh local"