@momo-kits/native-kits 0.162.6 → 0.163.1-beta.1-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.
Files changed (166) hide show
  1. package/CLAUDE.md +78 -0
  2. package/build.gradle.kts +11 -0
  3. package/compose/build.gradle.kts +186 -0
  4. package/compose/build.gradle.kts.backup +186 -0
  5. package/compose/compose.podspec +47 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +123 -0
  8. package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
  9. package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
  10. package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
  11. package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
  12. package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
  13. package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
  14. package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
  15. package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
  16. package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
  17. package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
  18. package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
  19. package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
  20. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
  21. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +57 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +109 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +201 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +222 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +48 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +305 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +921 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +120 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +403 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +85 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +340 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +198 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +357 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +123 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +94 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +136 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +543 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +148 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +188 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +116 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +452 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +172 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +255 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +233 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +259 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +241 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +364 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +92 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +352 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +103 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +338 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +70 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +96 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +348 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +96 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +531 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +92 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +135 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +214 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +590 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +177 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +205 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +239 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +191 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +306 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +188 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +285 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +35 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +57 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +68 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +14 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +253 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +133 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +104 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +135 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +345 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +556 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +161 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +243 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +187 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +315 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +80 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +306 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +34 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +370 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +131 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +167 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +72 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +66 -0
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +70 -0
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +105 -0
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +33 -0
  129. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +186 -0
  130. package/example/ios/Example.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  131. package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  132. package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +5 -0
  133. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +58 -0
  134. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/Pods-Example.xcscheme +58 -0
  135. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImage.xcscheme +58 -0
  136. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +58 -0
  137. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SkeletonUI.xcscheme +58 -0
  138. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +46 -0
  139. package/gradle/libs.versions.toml +67 -0
  140. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  141. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  142. package/gradle.properties +26 -0
  143. package/gradlew +252 -0
  144. package/gradlew.bat +94 -0
  145. package/ios/Application/ApplicationEnvironment.swift +0 -1
  146. package/ios/Application/Components.swift +0 -1
  147. package/ios/Application/FloatingButton.swift +0 -1
  148. package/ios/Badge/Badge.swift +0 -1
  149. package/ios/Badge/BadgeRibbon.swift +0 -2
  150. package/ios/Button/Button.swift +1 -1
  151. package/ios/Checkbox/Checkbox.swift +0 -1
  152. package/ios/Input/Input.swift +0 -1
  153. package/ios/Input/InputPhoneNumber.swift +0 -1
  154. package/ios/Input/InputSearch.swift +0 -3
  155. package/ios/Input/InputTextArea.swift +0 -1
  156. package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
  157. package/ios/Popup/PopupDisplay.swift +0 -6
  158. package/ios/Popup/PopupInput.swift +0 -2
  159. package/ios/Template/TrustBanner/TrustBanner.swift +0 -2
  160. package/ios/Typography/Text.swift +7 -13
  161. package/ios/Typography/Typography.swift +8 -22
  162. package/local.properties +8 -0
  163. package/package.json +1 -1
  164. package/settings.gradle.kts +64 -0
  165. package/ios/Application/FontScaleStore.swift +0 -59
  166. package/ios/Information/Information.swift +0 -151
@@ -0,0 +1,269 @@
1
+ package vn.momo.kits.application
2
+
3
+ import androidx.compose.runtime.Immutable
4
+ import androidx.compose.runtime.Stable
5
+ import androidx.compose.runtime.getValue
6
+ import androidx.compose.runtime.mutableStateOf
7
+ import androidx.compose.runtime.setValue
8
+ import androidx.compose.runtime.staticCompositionLocalOf
9
+
10
+ /** Translation dictionary keyed by language; both `vi` and `en` are required. */
11
+ @Immutable
12
+ data class LocalizationObject(
13
+ val vi: Map<String, String> = emptyMap(),
14
+ val en: Map<String, String> = emptyMap(),
15
+ )
16
+
17
+ /**
18
+ * Translation gateway, ported from momo-kits React Native (`Application/Localize.ts`).
19
+ * Holds the merged dictionary (kit defaults + host overrides) and the active language,
20
+ * switched at runtime via [changeLanguage]. Language is snapshot-backed, so a switch
21
+ * recomposes consumers of [translate]/[translateData].
22
+ */
23
+ @Stable
24
+ class Localize(translations: LocalizationObject = LocalizationObject()) {
25
+
26
+ private var assets by mutableStateOf(merge(defaultLanguage, translations))
27
+
28
+ private var language by mutableStateOf(VI)
29
+
30
+ val currentLanguage: String get() = language
31
+
32
+ fun changeLanguage(language: String?) {
33
+ this.language = if (language == EN) EN else VI
34
+ }
35
+
36
+ fun translate(key: String): String {
37
+ val dictionary = if (language == EN) assets.en else assets.vi
38
+ return dictionary[key]?.takeIf { it.isNotEmpty() } ?: key
39
+ }
40
+
41
+ fun translateData(data: Map<String, String>): String =
42
+ data[language] ?: data.entries.joinToString(prefix = "{", postfix = "}") {
43
+ "\"${it.key}\":\"${it.value}\""
44
+ }
45
+
46
+ fun translateData(vi: String, en: String): String = if (language == EN) en else vi
47
+
48
+ fun addTranslations(translations: LocalizationObject) {
49
+ assets = merge(translations, assets)
50
+ }
51
+
52
+ companion object {
53
+ const val VI = "vi"
54
+ const val EN = "en"
55
+
56
+ private fun merge(base: LocalizationObject, override: LocalizationObject) = LocalizationObject(vi = base.vi + override.vi, en = base.en + override.en)
57
+
58
+ private val defaultLanguage = LocalizationObject(
59
+ vi = mapOf(
60
+ "errorCode" to "Mã lỗi: ",
61
+ "seeMore" to "Xem thêm",
62
+ "cancel" to "Huỷ",
63
+ "done" to "Xong",
64
+ "confirm" to "Xác nhận",
65
+ "month" to "tháng",
66
+ "day" to "ngày",
67
+ "choose" to "Chọn",
68
+ "sent" to "Đã gửi",
69
+ "received" to "Đã tiếp nhận",
70
+ "processing" to "Đang xử lý",
71
+ "processed" to "Đã xử lý",
72
+ "addImg" to "Thêm hình",
73
+ "chooseBtn" to "Chọn button",
74
+ "imgEg" to "Hình ảnh tham khảo",
75
+ "filter" to "Sắp xếp",
76
+ "shipping" to "Đang giao hàng",
77
+ "men" to "Nam",
78
+ "women" to "Nữ",
79
+ "more" to "Khác",
80
+ "expDate" to "Ngày hết hạn",
81
+ "exp" to "HSD",
82
+ "inActive" to "Chưa kích hoạt",
83
+ "voucherRemindHour" to "Hết hạn sau {hours} giờ",
84
+ "voucherRemindMinute" to "Hết hạn sau {minutes} phút",
85
+ "voucherRemindSecond" to "Hết hạn sau {seconds} giây",
86
+ "voucherRemindDay" to "Hết hạn sau {days} ngày",
87
+ "chooseRoundtrip" to "Chọn vé khứ hồi",
88
+ "depart" to "Ngày đi",
89
+ "return" to "Ngày về",
90
+ "departing" to "Đi",
91
+ "returning" to "Về",
92
+ "jan" to "Tháng 1",
93
+ "feb" to "Tháng 2",
94
+ "mar" to "Tháng 3",
95
+ "apr" to "Tháng 4",
96
+ "may" to "Tháng 5",
97
+ "jun" to "Tháng 6",
98
+ "jul" to "Tháng 7",
99
+ "aug" to "Tháng 8",
100
+ "sep" to "Tháng 9",
101
+ "oct" to "Tháng 10",
102
+ "nov" to "Tháng 11",
103
+ "dec" to "Tháng 12",
104
+ "mon" to "T2",
105
+ "tue" to "T3",
106
+ "wed" to "T4",
107
+ "thu" to "T5",
108
+ "fri" to "T6",
109
+ "sat" to "T7",
110
+ "sun" to "CN",
111
+ "showLunar" to "Hiển thị lịch âm",
112
+ "newYear" to "Tết Dương lịch",
113
+ "valentine" to "Ngày Lễ Tình nhân",
114
+ "womenDay" to "Ngày Quốc tế Phụ nữ",
115
+ "liberationDay" to "Ngày giải phóng Miền Nam thống nhất đất nước",
116
+ "laborDay" to "Ngày Quốc tế Lao động",
117
+ "childrenDay" to "Ngày Quốc tế Thiếu nhi",
118
+ "nationalDay" to "Quốc khánh nước CHXHCN Việt Nam",
119
+ "womenDayVN" to "Ngày Phụ nữ Việt Nam",
120
+ "teacherDay" to "Ngày Nhà giáo Việt Nam",
121
+ "christmasEve" to "Ngày Lễ Giáng Sinh",
122
+ "christmas" to "Ngày Lễ Giáng Sinh",
123
+ "lunarNewYear" to "Tết Nguyên Đán",
124
+ "hungKingDay" to "Giỗ Tổ Hùng Vương",
125
+ "balance" to "Số dư trong ví",
126
+ "chooseDate" to "Chọn ngày tháng năm",
127
+ "year" to "năm",
128
+ "hour" to "giờ",
129
+ "minute" to "phút",
130
+ "from" to "Từ",
131
+ "to" to "Đến",
132
+ "connected" to "Đã kết nối",
133
+ "disconnected" to "Mất kết nối",
134
+ "hide" to "Ẩn",
135
+ "viewAllTitle" to "Xem tất cả",
136
+ "headerTitle" to "Lịch sử thanh toán",
137
+ "SHORTEN" to "THU GỌN",
138
+ "viewMoreBank" to "XEM THÊM (\${otherItemCount} ngân hàng)",
139
+ "transaction_success" to "Thành công",
140
+ "transaction_fail" to "Thất bại",
141
+ "transaction_processing" to "Đang xử lý",
142
+ "viewMore" to "Xem thêm",
143
+ "shorten" to "Thu gọn",
144
+ "Payment" to "Thanh toán \${serviceName}",
145
+ "currencyUnit" to "đ",
146
+ "Month" to "Tháng",
147
+ "save" to "Lưu",
148
+ "favoriteIn" to "Thêm dịch vụ yêu thích",
149
+ "favoriteOut" to "Xóa dịch vụ yêu thích",
150
+ "deviceIn" to "Thêm vào thiết bị",
151
+ "setting" to "Cài đặt",
152
+ "transaction" to "Lịch sử giao dịch",
153
+ "share" to "Chia sẽ dịch vụ",
154
+ "information" to "Thông tin chung",
155
+ "tutorial" to "Hướng dẫn sử dụng",
156
+ "question" to "Câu hỏi thường gặp",
157
+ "support" to "Trung tâm hỗ trợ",
158
+ "skip" to "Bỏ qua",
159
+ "enterPhoneNumber" to "Vui lòng nhập số điện thoại",
160
+ "invalidPhoneNumber" to "Số điện thoại không đúng",
161
+ ),
162
+ en = mapOf(
163
+ "seeMore" to "See more",
164
+ "cancel" to "Cancel",
165
+ "done" to "Done",
166
+ "confirm" to "Confirm",
167
+ "month" to "month",
168
+ "day" to "day",
169
+ "choose" to "Choose",
170
+ "sent" to "Sent",
171
+ "received" to "Received",
172
+ "processing" to "Processing",
173
+ "processed" to "Done",
174
+ "addImg" to "Add image",
175
+ "chooseBtn" to "Choose button",
176
+ "imgEg" to "Example images",
177
+ "filter" to "Filter",
178
+ "shipping" to "Shipping",
179
+ "men" to "Men",
180
+ "women" to "Women",
181
+ "more" to "More",
182
+ "expDate" to "Expiration date",
183
+ "exp" to "EXP",
184
+ "inActive" to "Not Activated",
185
+ "voucherRemindHour" to "Revoke after {hours} hours",
186
+ "voucherRemindMinute" to "Revoke after {minutes} minutes",
187
+ "voucherRemindSecond" to "Revoke after {seconds} seconds",
188
+ "voucherRemindDay" to "Revoke after {days} days",
189
+ "chooseRoundtrip" to "Choose roundtrip ticket",
190
+ "depart" to "Departing",
191
+ "return" to "Returning",
192
+ "departing" to "De",
193
+ "returning" to "Re",
194
+ "jan" to "January",
195
+ "feb" to "February",
196
+ "mar" to "March",
197
+ "apr" to "April",
198
+ "may" to "May",
199
+ "jun" to "June",
200
+ "jul" to "July",
201
+ "aug" to "August",
202
+ "sep" to "September",
203
+ "oct" to "October",
204
+ "nov" to "November",
205
+ "dec" to "December",
206
+ "mon" to "Mon",
207
+ "tue" to "Tue",
208
+ "wed" to "Wed",
209
+ "thu" to "Thu",
210
+ "fri" to "Fri",
211
+ "sat" to "Sat",
212
+ "sun" to "Sun",
213
+ "showLunar" to "Show Lunar Calendar",
214
+ "newYear" to "New Year's Day",
215
+ "valentine" to "Valentine's Day",
216
+ "womenDay" to "International Women's Day",
217
+ "liberationDay" to "Liberation Day",
218
+ "laborDay" to "Internation Labor's Day",
219
+ "childrenDay" to "International Labor's Day",
220
+ "nationalDay" to "National Day",
221
+ "womenDayVN" to "Vietnamese Women's Day",
222
+ "teacherDay" to "Teacher's Day",
223
+ "christmasEve" to "Christmas Eve",
224
+ "christmas" to "Christmas Day",
225
+ "lunarNewYear" to "Lunar New Year",
226
+ "hungKingDay" to "Hung Kings' Festival",
227
+ "balance" to "Wallet Balance",
228
+ "chooseDate" to "Choose date",
229
+ "year" to "year",
230
+ "hour" to "hour",
231
+ "minute" to "minute",
232
+ "from" to "From",
233
+ "to" to "To",
234
+ "connected" to "Connected",
235
+ "disconnected" to "Disconnected",
236
+ "hide" to "Hide",
237
+ "viewAllTitle" to "View all",
238
+ "headerTitle" to "Transaction history",
239
+ "SHORTEN" to "SHORTEN",
240
+ "viewMoreBank" to "VIEW MORE (\${otherItemCount} banks)",
241
+ "transaction_success" to "Success",
242
+ "transaction_fail" to "Fail",
243
+ "transaction_processing" to "Processing",
244
+ "viewMore" to "View more",
245
+ "shorten" to "Shorten",
246
+ "Payment" to "\${serviceName} payment",
247
+ "currencyUnit" to "VND",
248
+ "Month" to "Month",
249
+ "save" to "Save",
250
+ "favoriteIn" to "Add to favorite services",
251
+ "favoriteOut" to "Remove to favorite services",
252
+ "deviceIn" to "Add to device",
253
+ "setting" to "Settings",
254
+ "transaction" to "Transaction History",
255
+ "share" to "Share",
256
+ "information" to "Information",
257
+ "tutorial" to "Instruction",
258
+ "question" to "FAQ",
259
+ "support" to "Support center",
260
+ "errorCode" to "Error code: ",
261
+ "skip" to "Skip",
262
+ "enterPhoneNumber" to "Please enter your phone number",
263
+ "invalidPhoneNumber" to "Invalid phone number",
264
+ ),
265
+ )
266
+ }
267
+ }
268
+
269
+ val LocalLocalize = staticCompositionLocalOf { Localize() }
@@ -0,0 +1,120 @@
1
+ package vn.momo.kits.application
2
+
3
+ import androidx.compose.foundation.layout.Box
4
+ import androidx.compose.foundation.layout.wrapContentSize
5
+ import androidx.compose.runtime.Composable
6
+ import androidx.compose.runtime.CompositionLocalProvider
7
+ import androidx.compose.runtime.LaunchedEffect
8
+ import androidx.compose.runtime.getValue
9
+ import androidx.compose.runtime.mutableStateOf
10
+ import androidx.compose.runtime.remember
11
+ import androidx.compose.runtime.setValue
12
+ import androidx.compose.runtime.staticCompositionLocalOf
13
+ import androidx.compose.ui.Modifier
14
+ import androidx.compose.ui.unit.Dp
15
+ import vn.momo.kits.const.AppStatusBar
16
+ import vn.momo.kits.const.AppTheme
17
+ import vn.momo.kits.const.Theme
18
+ import vn.momo.kits.const.ThemeAssets
19
+ import vn.momo.kits.const.defaultTheme
20
+ import vn.momo.kits.modifier.DeprecatedModifier
21
+ import vn.momo.kits.platform.getStatusBarHeight
22
+
23
+ @Deprecated("Use IMaxApi instead", ReplaceWith("IMaxApi"))
24
+ interface ComposeApi {
25
+ fun request(funcName: String, params: Any?): String
26
+ fun request(funcName: String, params: Any?, onResponse: ((String) -> Unit)?): String
27
+ fun requestCallback(funcName: String, params: Any?, onResponse: ((String) -> Unit)?)
28
+ fun removeCallback(id: String)
29
+ }
30
+
31
+ class Navigator {
32
+ fun push(content: @Composable () -> Unit) {
33
+ //implement
34
+ }
35
+
36
+ fun present(content: @Composable () -> Unit) {
37
+ //implement
38
+ }
39
+
40
+ fun reset(content: @Composable () -> Unit) {
41
+ //implement
42
+ }
43
+
44
+ fun pop() {
45
+ //implement
46
+ }
47
+
48
+ fun replace(content: @Composable () -> Unit) {
49
+ //implement
50
+ }
51
+
52
+ fun popToTop() {
53
+ //implement
54
+ }
55
+
56
+ fun showModal(
57
+ onClose: () -> Unit = {},
58
+ canBackgroundClose: Boolean = true,
59
+ content: @Composable () -> Unit,
60
+ ) {
61
+ //implement
62
+ }
63
+
64
+ fun showBottomSheet(content: @Composable () -> Unit) {
65
+ //implement
66
+ }
67
+ }
68
+
69
+
70
+
71
+
72
+ @Deprecated("Use LocalApi instead", ReplaceWith("LocalApi"))
73
+ val PlatformApi = staticCompositionLocalOf<Any?> { null }
74
+
75
+
76
+ @Deprecated("Use NavigationContainer instead", ReplaceWith("NavigationContainer"))
77
+ @Composable
78
+ fun ApplicationContainer(
79
+ theme: Theme = defaultTheme,
80
+ composeApi: ComposeApi? = null,
81
+ statusBarHeight: Dp? = AppStatusBar.current,
82
+ applicationContext: MiniAppContext? = null,
83
+ config: DesignSystemConfig? = null,
84
+ language: String? = null,
85
+ isWhiteList: Boolean = false,
86
+ content: @Composable () -> Unit,
87
+ ) {
88
+ var appTheme by remember { mutableStateOf(theme) }
89
+
90
+ LaunchedEffect(Unit) {
91
+ try {
92
+ val headerBar = config?.headerBar
93
+ if (headerBar != null && appTheme.assets.headerBackground == null) {
94
+ appTheme = appTheme.copy(
95
+ assets = ThemeAssets(
96
+ headerBackground = headerBar
97
+ )
98
+ )
99
+ }
100
+ } catch (e: Exception) {
101
+ print("@@ == NavigationContainer get config error $e")
102
+ }
103
+ }
104
+
105
+ val appStatusBarHeight = statusBarHeight ?: getStatusBarHeight()
106
+
107
+ CompositionLocalProvider(
108
+ AppTheme provides appTheme,
109
+ PlatformApi provides composeApi,
110
+ AppStatusBar provides appStatusBarHeight,
111
+ ApplicationContext provides applicationContext,
112
+ AppConfig provides config,
113
+ AppLanguage provides language,
114
+ ) {
115
+ Box(Modifier.wrapContentSize().then(DeprecatedModifier())) {
116
+ content()
117
+ }
118
+ }
119
+
120
+ }