@momo-kits/native-kits 0.162.2-sp.1 → 0.162.2-sp.10
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/settings.local.json +15 -1
- package/CLAUDE.md +78 -0
- package/ios/Application/ApplicationEnvironment.swift +15 -2
- package/ios/Application/Components.swift +16 -0
- package/ios/Application/HeaderRight.swift +79 -45
- package/ios/Application/Localize.swift +277 -0
- package/ios/Application/MaxApi.swift +18 -0
- package/ios/Application/Navigation/BottomTab/BottomTab.swift +3 -1
- package/ios/Application/Navigation/NavigationContainer.swift +53 -4
- package/ios/Application/Navigation/Navigator.swift +54 -29
- package/ios/Application/Navigation/Overplay/BottomSheet.swift +98 -18
- package/ios/Application/Navigation/Overplay/ModalScreen.swift +6 -0
- package/ios/Application/Navigation/Tracking/ScreenTracker.swift +117 -0
- package/ios/Application/Screen.swift +2 -1
- package/ios/Application/StackScreen.swift +55 -3
- package/ios/Badge/BadgeRibbon.swift +80 -0
- package/ios/Button/Button.swift +67 -11
- package/ios/Carousel/Carousel.swift +16 -1
- package/ios/Checkbox/Checkbox.swift +14 -20
- package/ios/Chip/Chip.swift +35 -26
- package/ios/Collapse/Collapse.swift +11 -1
- package/ios/Colors+Radius+Spacing/Colors.swift +20 -17
- package/ios/Colors+Radius+Spacing/Spacing.swift +3 -1
- package/ios/Colors+Radius+Spacing/Theme.swift +15 -15
- package/ios/DateTimePicker/DateTimePicker.swift +4 -2
- package/ios/DateTimePicker/WheelPicker.swift +7 -3
- package/ios/Extensions/ActiveOpacityButtonStyle.swift +14 -0
- package/ios/Extensions/Color++.swift +32 -0
- package/ios/Icon/Icon.swift +5 -1
- package/ios/IconButton/IconButton.swift +35 -7
- package/ios/Image/Image.swift +16 -3
- package/ios/Information/Information.swift +3 -1
- package/ios/Input/ErrorView.swift +3 -1
- package/ios/Input/Input.swift +31 -8
- package/ios/Input/InputPhoneNumber.swift +14 -3
- package/ios/Input/InputSearch.swift +7 -1
- package/ios/Input/InputTextArea.swift +78 -34
- package/ios/InputDropDown/InputDropDown.swift +4 -1
- package/ios/InputMoney/InputMoney.swift +16 -4
- package/ios/Popup/PopupDisplay.swift +3 -4
- package/ios/Popup/PopupNotify.swift +3 -4
- package/ios/ProgressInfo/ProgressInfo.swift +4 -2
- package/ios/Radio/Radio.swift +12 -13
- package/ios/Rating/Rating.swift +1 -1
- package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +6 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +9 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +38 -0
- package/ios/Stepper/Stepper.swift +2 -2
- package/ios/Steps/Steps.swift +22 -6
- package/ios/SuggestAction/SuggestAction.swift +5 -3
- package/ios/Swipeable/SwipeCell.swift +5 -3
- package/ios/Switch/Switch.swift +53 -28
- package/ios/TabView/TabView.swift +18 -14
- package/ios/Template/TrustBanner/TrustBanner.swift +6 -7
- package/ios/Tooltip/Tooltip.swift +3 -0
- package/ios/Typography/FontScaleStore.swift +19 -0
- package/ios/Typography/Text.swift +3 -0
- package/ios/Typography/Typography.swift +8 -5
- package/ios/Uploader/Uploader.swift +0 -9
- package/ios/native-kits.podspec +6 -3
- package/ios-demo/MoMoUIKitsDemo.podspec +5 -3
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +9 -57
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +21 -3
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +188 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +2 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +5 -4
- package/package.json +1 -1
|
@@ -49,7 +49,21 @@
|
|
|
49
49
|
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' build)",
|
|
50
50
|
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
|
|
51
51
|
"Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
|
|
52
|
-
"Bash(xcodebuild build *)"
|
|
52
|
+
"Bash(xcodebuild build *)",
|
|
53
|
+
"Bash(git stash *)",
|
|
54
|
+
"Bash(plutil -lint sample/iosApp/iosApp.xcodeproj/project.pbxproj)",
|
|
55
|
+
"Bash(git add *)",
|
|
56
|
+
"Bash(git commit -m 'feat: DS-646 [ci build] *)",
|
|
57
|
+
"Bash(git commit -q -m 'fix: DS-656 [ci build] *)",
|
|
58
|
+
"Bash(xargs git log --oneline -1)",
|
|
59
|
+
"Bash(git rev-list *)",
|
|
60
|
+
"Bash(git status *)",
|
|
61
|
+
"Bash(git rebase *)",
|
|
62
|
+
"Bash(git merge *)",
|
|
63
|
+
"Bash(git reset *)",
|
|
64
|
+
"Bash(awk '/^ *)",
|
|
65
|
+
"Bash(git ls-tree *)",
|
|
66
|
+
"Bash(awk *)"
|
|
53
67
|
]
|
|
54
68
|
}
|
|
55
69
|
}
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Guidance for working in this repo. Keep it accurate — update it when structure or commands change.
|
|
4
|
+
|
|
5
|
+
## What this is
|
|
6
|
+
|
|
7
|
+
`momo-native-kits` — MoMo's design-system / UI-kit as a **Kotlin Multiplatform + Compose Multiplatform** library, published for Android (AAR/Maven) and iOS (static framework + CocoaPods). It is the Compose port of the React Native `momo-kits`. Consumed by mini-apps embedded in the host MoMo app.
|
|
8
|
+
|
|
9
|
+
- Artifact: `vn.momo.kits:kits` (version in `gradle.properties`). NPM mirror: `@momo-kits/native-kits`.
|
|
10
|
+
- Targets: `androidTarget` (JVM 17, compile/min/target SDK 36/24/36), `iosArm64`, `iosSimulatorArm64` (framework `baseName = "kits"`, `isStatic = true`).
|
|
11
|
+
- Kotlin 2.3.10, Compose MP 1.10.3.
|
|
12
|
+
|
|
13
|
+
## Modules
|
|
14
|
+
|
|
15
|
+
- `:compose` — the published library. All real code lives here.
|
|
16
|
+
- `:sample:shared` + `:sample:androidApp` — demo app (`UIKitHome` lists all components). iOS demo in `sample/iosApp` (Xcode).
|
|
17
|
+
|
|
18
|
+
## Source layout (`compose/src/commonMain/kotlin/vn/momo/kits/`)
|
|
19
|
+
|
|
20
|
+
- `components/` — ~50 UI components, **one file per component** (`Button.kt`, `Input*.kt`, `PopupNotify.kt`, …).
|
|
21
|
+
- `application/` — app-level context & config: `Context.kt` (CompositionLocals, `MiniAppContext`, `DesignSystemConfig`), `Localize.kt` (i18n: `LocalizationObject`, `Localize`, default dictionary), `Screen.kt`, header pieces. Also holds the **deprecated** `ApplicationContainer`.
|
|
22
|
+
- `navigation/` — `NavigationContainer.kt` (**canonical entry point**), `Navigator.kt`, `Navigation.kt`, `StackScreen.kt`, `bottomtab/`, `component/`, `tracking/`.
|
|
23
|
+
- `const/` — design tokens: `Theme.kt`, `Colors.kt`, `Typography.kt`, `Spacing.kt`, `Radius.kt`.
|
|
24
|
+
- `layout/`, `modifier/`, `utils/`.
|
|
25
|
+
- `platform/` — `Platform.kt` `expect` declarations, actualized in `androidMain` / `iosMain` (`Platform.android.kt`, `Platform.ios.kt`).
|
|
26
|
+
|
|
27
|
+
## Build & verify
|
|
28
|
+
|
|
29
|
+
No unit-test suite is configured. Validate changes by compiling the relevant target(s); use the sample app for visual checks.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
./gradlew :compose:compileCommonMainKotlinMetadata # validate commonMain (fast, do this first)
|
|
33
|
+
./gradlew :compose:compileDebugKotlinAndroid # Android target
|
|
34
|
+
./gradlew :compose:linkDebugFrameworkIosSimulatorArm64 # iOS framework (slow)
|
|
35
|
+
./gradlew :sample:androidApp:installDebug # run demo on device/emulator
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Publishing is automated (`publish.sh` + GitLab CI on `[ci build]` / `main`). Do not publish manually unless asked: `sh publish.sh beta` / `sh publish.sh release` (Maven→GitLab + NPM).
|
|
39
|
+
|
|
40
|
+
## Architecture essentials
|
|
41
|
+
|
|
42
|
+
- **Entry point:** wrap content in `NavigationContainer(...)` from `navigation/`. It builds the `Navigator`, takes a host-supplied `Localize` (falls back to an empty one), and provides the CompositionLocals below. **Do not use** `ApplicationContainer` (`application/NavigationContainer.kt`) — deprecated and does **not** wire `LocalLocalize` / `LocalNavigator` / `LocalMaxApi`.
|
|
43
|
+
- **Configuration flows via CompositionLocals**, not params. Public ones: `AppTheme`, `AppStatusBar`, `AppNavigationBar` (`const/Theme.kt`); `ApplicationContext`, `AppConfig`, `AppLanguage`, `LocalLocalize` (`application/`); `LocalNavigator`, `LocalMaxApi` (`navigation/`). Read with `X.current`.
|
|
44
|
+
- **Platform code** goes through `expect`/`actual` in `platform/` — never reference Android/iOS APIs from `commonMain` directly.
|
|
45
|
+
- **Native bridge:** `IMaxApi` (`vn.momo.maxapi`, exposed as `LocalMaxApi`) is the host-app bridge (dismiss, tracking, device info, language).
|
|
46
|
+
- Navigation uses a runtime `DynamicScreenRegistry`; overlays (modal/bottom-sheet/snackbar) go through `Navigator` + `OverplayComponentRegistry`.
|
|
47
|
+
|
|
48
|
+
## i18n / Localize (port of RN `Localize`)
|
|
49
|
+
|
|
50
|
+
- `application/Localize.kt`: everything i18n. `LocalizationObject` is a data class with required `vi` / `en` maps (`LocalizationObject(vi = mapOf(…), en = mapOf(…))`). `Localize` constructors take a `LocalizationObject` or a `(vi, en)` map pair; the constructor **merges** the kit defaults with the host data (host wins on key clash). Methods: `translate(key)` (missing/empty → returns the key), `translateData(map)` / `translateData(vi, en)`, `addTranslations` (existing keys win), `changeLanguage(lang)`. Default language `"vi"`, `"en"` only on exact match; language is snapshot state so a switch recomposes consumers.
|
|
51
|
+
- The default dictionary lives **inside `Localize`** (companion `defaultLanguage`), **generated 1:1 from `momo-kits` RN `Assets/language.json`** — do not hand-edit that block; edit the RN source and regenerate.
|
|
52
|
+
- The host creates one `Localize` and passes it in: `NavigationContainer(localize = myLocalize, …)`. There is **no** `language` param and `DesignSystemConfig` carries no translations — overrides go through the `Localize` constructor / `addTranslations`. Switch language at runtime with `myLocalize.changeLanguage("en")`.
|
|
53
|
+
- Access in a `@Composable`: `LocalLocalize.current.translate("errorCode")`. Language is host-controlled, never read from the OS locale. `AppLanguage` is still provided (derived from `Localize.currentLanguage`) for older components that read it.
|
|
54
|
+
- Some older components still do ad-hoc `AppLanguage.current` + `Map` lookups; new/changed code should use `LocalLocalize`.
|
|
55
|
+
|
|
56
|
+
## Code conventions
|
|
57
|
+
|
|
58
|
+
- **Tokens, not literals:** use `Colors`, `Typography`, `Spacing`, `Radius` objects and `AppTheme.current` for colors/styles. Per-component sizing is bundled in enums (e.g. `Button.Size(val value: ButtonSpecs)`).
|
|
59
|
+
- **Composable signatures:** required params first, slot lambdas next, `modifier: Modifier = Modifier` **last**; give optional params sensible defaults.
|
|
60
|
+
- **Stability:** annotate token/config data classes `@Stable`/`@Immutable`; memoize derived colors/styles/handlers with `remember(keys) { … }`.
|
|
61
|
+
- **Custom modifiers** are preferred: `conditional(...)`, `setAutomationId(...)`, the `clickable` variants in `modifier/`.
|
|
62
|
+
- Match the surrounding file's style when adding code.
|
|
63
|
+
|
|
64
|
+
## Writing docs in code (follow this)
|
|
65
|
+
|
|
66
|
+
Comments are **sparse and in English**. Document only what is **not obvious from the code** — non-obvious behavior, platform quirks, RN-parity semantics, memoization intent, or important gotchas worth flagging. Do **not**:
|
|
67
|
+
|
|
68
|
+
- write KDoc walls or restate what the signature/code already says;
|
|
69
|
+
- narrate obvious steps or add section-banner noise;
|
|
70
|
+
- use a language other than English in code comments.
|
|
71
|
+
|
|
72
|
+
Prefer one tight line at the surprising spot over a paragraph. Match the (low) comment density already in the codebase.
|
|
73
|
+
|
|
74
|
+
## Gotchas
|
|
75
|
+
|
|
76
|
+
- **Resource qualifier drift:** the generated Compose `Res` namespace is `vn.momo.uikits.resources`, but `utils/Resources.kt` and `platform/Platform.ios.kt` reference `vn.momo.compose.resources`. Keep bundled strings/dictionaries as plain Kotlin (the `defaultLanguage` map in `Localize.kt`), not `composeResources/values`, to avoid iOS framework resource-loading issues.
|
|
77
|
+
- Prefer `NavigationContainer` over the deprecated `ApplicationContainer`; prefer `IMaxApi`/`LocalMaxApi` over the deprecated `PlatformApi`.
|
|
78
|
+
- iOS strings/maps must survive Kotlin/Native framework packaging — keep them compiled-in, not loaded from resource bundles.
|
|
@@ -41,10 +41,23 @@ public class ApplicationEnvironment: ObservableObject {
|
|
|
41
41
|
let applicationContext: MiniAppContext?
|
|
42
42
|
let composeApi: KitComposeApi?
|
|
43
43
|
let config: KitConfig?
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
let maxApi: MaxApi?
|
|
45
|
+
|
|
46
|
+
public init(applicationContext: MiniAppContext? = nil, composeApi: KitComposeApi? = nil, config: KitConfig? = nil, maxApi: MaxApi? = nil) {
|
|
46
47
|
self.applicationContext = applicationContext
|
|
47
48
|
self.composeApi = composeApi
|
|
48
49
|
self.config = config
|
|
50
|
+
self.maxApi = maxApi
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private struct ApplicationEnvironmentKey: EnvironmentKey {
|
|
55
|
+
static let defaultValue = ApplicationEnvironment()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public extension EnvironmentValues {
|
|
59
|
+
var applicationEnvironment: ApplicationEnvironment {
|
|
60
|
+
get { self[ApplicationEnvironmentKey.self] }
|
|
61
|
+
set { self[ApplicationEnvironmentKey.self] = newValue }
|
|
49
62
|
}
|
|
50
63
|
}
|
|
@@ -143,6 +143,22 @@ public struct HeaderRightWidthKey: PreferenceKey {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
// MARK: - Bottom-tab root preference
|
|
147
|
+
|
|
148
|
+
/// Set by `BottomTab` on appear so its enclosing `StackScreen` can detect that
|
|
149
|
+
/// it's hosting a self-contained bottom-tab surface and skip its own bottom
|
|
150
|
+
/// safe-area reservation — mirrors Compose's `Navigation.markAsBottomTabRoot()`
|
|
151
|
+
/// (`navigation.isBottomTabRoot`, read by `StackScreen.kt`'s `MainContent`).
|
|
152
|
+
/// Without this, `BottomTab`'s own internal safe-area handling gets an extra,
|
|
153
|
+
/// unwanted inset stacked on top of it by the outer `StackScreen`, pushing the
|
|
154
|
+
/// tab bar up higher than the true bottom inset.
|
|
155
|
+
public struct IsBottomTabRootKey: PreferenceKey {
|
|
156
|
+
public static var defaultValue: Bool = false
|
|
157
|
+
public static func reduce(value: inout Bool, nextValue: () -> Bool) {
|
|
158
|
+
value = value || nextValue()
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
146
162
|
// MARK: - Header View
|
|
147
163
|
|
|
148
164
|
public struct Header: View {
|
|
@@ -101,69 +101,98 @@ struct ToolkitHeaderRight: View {
|
|
|
101
101
|
var tintColor: Color?
|
|
102
102
|
@State private var isFavorite: Bool = false
|
|
103
103
|
@State private var isLoading: Bool = false
|
|
104
|
-
@
|
|
104
|
+
@Environment(\.applicationEnvironment) private var environment
|
|
105
|
+
|
|
106
|
+
private func apiValue(_ value: Any?) -> Any {
|
|
107
|
+
value ?? NSNull()
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
private var contextMap: [String: Any] {
|
|
111
|
+
let context = environment.applicationContext
|
|
112
|
+
return [
|
|
113
|
+
"appId": apiValue(context?.appId),
|
|
114
|
+
"code": apiValue(context?.appCode),
|
|
115
|
+
"name": apiValue(context?.appName),
|
|
116
|
+
"icon": apiValue(context?.appIcon),
|
|
117
|
+
"description": apiValue(context?.description),
|
|
118
|
+
"support": apiValue(context?.support),
|
|
119
|
+
"toolkitConfig": apiValue(context?.toolkitConfig),
|
|
120
|
+
"providerId": apiValue(context?.providerId),
|
|
121
|
+
"permissions": apiValue(context?.permissions)
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private var shouldShowShortcut: Bool {
|
|
126
|
+
headerRight?.useShortcut == true && !(headerRight?.useMore == true && environment.applicationContext == nil)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
private func parseResponse(_ response: String) -> Any? {
|
|
130
|
+
guard let jsonData = response.data(using: .utf8),
|
|
131
|
+
let json = try? JSONSerialization.jsonObject(with: jsonData) as? [String: Any] else {
|
|
132
|
+
return nil
|
|
133
|
+
}
|
|
134
|
+
return json["response"]
|
|
135
|
+
}
|
|
105
136
|
|
|
106
137
|
// MARK: - Actions
|
|
138
|
+
private func loadFavoriteState() {
|
|
139
|
+
environment.composeApi?.request(
|
|
140
|
+
funcName: "isFavoriteApp",
|
|
141
|
+
params: ["code": apiValue(environment.applicationContext?.appCode)]
|
|
142
|
+
) { response in
|
|
143
|
+
if let isFavorite = parseResponse(response) as? Bool {
|
|
144
|
+
self.isFavorite = isFavorite
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
107
149
|
private func onPressShortcut() {
|
|
108
150
|
environment.composeApi?.request(
|
|
109
151
|
funcName: "onToolAction",
|
|
110
|
-
params: [
|
|
111
|
-
|
|
112
|
-
|
|
152
|
+
params: [
|
|
153
|
+
"item": ["key": "onFavorite"],
|
|
154
|
+
"context": contextMap
|
|
155
|
+
]
|
|
156
|
+
) { response in
|
|
157
|
+
if let result = parseResponse(response) as? [String: Any],
|
|
158
|
+
result["success"] as? Bool == true {
|
|
159
|
+
isFavorite.toggle()
|
|
160
|
+
}
|
|
113
161
|
}
|
|
114
162
|
}
|
|
115
163
|
|
|
116
164
|
private func onPressHelpCenter() {
|
|
117
|
-
let context = environment.applicationContext
|
|
118
|
-
let paramMap: [String: Any] = [
|
|
119
|
-
"appId": context?.appId,
|
|
120
|
-
"code": context?.appCode,
|
|
121
|
-
"name": context?.appName,
|
|
122
|
-
"icon": context?.appIcon,
|
|
123
|
-
"description": context?.description
|
|
124
|
-
]
|
|
125
165
|
environment.composeApi?.request(
|
|
126
166
|
funcName: "showHelpCenter",
|
|
127
|
-
params:
|
|
167
|
+
params: [
|
|
168
|
+
"appId": apiValue(environment.applicationContext?.appId),
|
|
169
|
+
"code": apiValue(environment.applicationContext?.appCode),
|
|
170
|
+
"name": apiValue(environment.applicationContext?.appName),
|
|
171
|
+
"icon": apiValue(environment.applicationContext?.appIcon),
|
|
172
|
+
"description": apiValue(environment.applicationContext?.description)
|
|
173
|
+
]
|
|
128
174
|
) { _ in }
|
|
129
175
|
}
|
|
130
176
|
|
|
131
177
|
private func onPressClose() {
|
|
132
178
|
environment.composeApi?.request(
|
|
133
179
|
funcName: "dismissAll",
|
|
134
|
-
params:
|
|
180
|
+
params: nil
|
|
135
181
|
) { _ in }
|
|
136
182
|
}
|
|
137
183
|
|
|
138
184
|
private func onPressMore() {
|
|
139
|
-
let context = environment.applicationContext
|
|
140
185
|
let params: [String: Any] = [
|
|
141
|
-
"useSystemTools": headerRight?.useSystemTools,
|
|
186
|
+
"useSystemTools": headerRight?.useSystemTools ?? true,
|
|
142
187
|
"tools": headerRight?.tools.map { $0.toMap() } ?? [],
|
|
143
|
-
"context":
|
|
144
|
-
"appId": context?.appId,
|
|
145
|
-
"code": context?.appCode,
|
|
146
|
-
"name": context?.appName,
|
|
147
|
-
"icon": context?.appIcon,
|
|
148
|
-
"description": context?.description,
|
|
149
|
-
"support": context?.support,
|
|
150
|
-
"toolkitConfig": context?.toolkitConfig,
|
|
151
|
-
"providerId": context?.providerId,
|
|
152
|
-
"permissions": context?.permissions
|
|
153
|
-
]
|
|
188
|
+
"context": contextMap
|
|
154
189
|
]
|
|
155
190
|
environment.composeApi?.request(
|
|
156
191
|
funcName: "showTools",
|
|
157
192
|
params: params
|
|
158
193
|
) { response in
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
let json = try JSONSerialization.jsonObject(with: jsonData) as? [String: Any],
|
|
162
|
-
let toolResponse = json["response"] as? String {
|
|
163
|
-
headerRight?.toolCallback?(toolResponse)
|
|
164
|
-
}
|
|
165
|
-
} catch {
|
|
166
|
-
print("Error parsing response:", error)
|
|
194
|
+
if let toolResponse = parseResponse(response) as? String {
|
|
195
|
+
headerRight?.toolCallback?(toolResponse)
|
|
167
196
|
}
|
|
168
197
|
}
|
|
169
198
|
}
|
|
@@ -195,7 +224,7 @@ struct ToolkitHeaderRight: View {
|
|
|
195
224
|
} ?? false
|
|
196
225
|
|
|
197
226
|
HStack(alignment: .center, spacing: 0) {
|
|
198
|
-
if
|
|
227
|
+
if shouldShowShortcut {
|
|
199
228
|
NavigationButton(
|
|
200
229
|
disabled: isLoading,
|
|
201
230
|
icon: navButtonConfig.icon,
|
|
@@ -206,15 +235,17 @@ struct ToolkitHeaderRight: View {
|
|
|
206
235
|
}
|
|
207
236
|
|
|
208
237
|
HStack(alignment: .center, spacing: 0) {
|
|
209
|
-
|
|
210
|
-
.
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
238
|
+
if environment.applicationContext != nil {
|
|
239
|
+
Icon(source: "help_center", size: 20, color: tintColor ?? Colors.black17)
|
|
240
|
+
.padding(4)
|
|
241
|
+
.onTapGesture {
|
|
242
|
+
onPressHelpCenter()
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
Rectangle()
|
|
246
|
+
.fill(tintColor ?? Colors.black20)
|
|
247
|
+
.frame(width: 0.5, height: 12)
|
|
248
|
+
}
|
|
218
249
|
|
|
219
250
|
Icon(source: "16_basic_home", size: 20, color: tintColor ?? Colors.black17)
|
|
220
251
|
.padding(4)
|
|
@@ -231,6 +262,9 @@ struct ToolkitHeaderRight: View {
|
|
|
231
262
|
)
|
|
232
263
|
.padding(.leading, Spacing.S)
|
|
233
264
|
}
|
|
265
|
+
.onAppear {
|
|
266
|
+
loadFavoriteState()
|
|
267
|
+
}
|
|
234
268
|
}
|
|
235
269
|
}
|
|
236
270
|
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Localize.swift
|
|
3
|
+
// MoMoUIKits
|
|
4
|
+
//
|
|
5
|
+
// SwiftUI mirror of Compose's `application/Localize.kt`, itself a port of
|
|
6
|
+
// momo-kits React Native's `Application/Localize.ts`. Holds the merged
|
|
7
|
+
// dictionary (kit defaults + host overrides) and the active language,
|
|
8
|
+
// switched at runtime via `changeLanguage`. `Localize` is an `ObservableObject`
|
|
9
|
+
// so a language switch republishes to consumers of `translate`/`translateData`,
|
|
10
|
+
// mirroring Compose's snapshot-state-backed `language`.
|
|
11
|
+
//
|
|
12
|
+
|
|
13
|
+
import Foundation
|
|
14
|
+
|
|
15
|
+
/// Translation dictionary keyed by language; both `vi` and `en` are required.
|
|
16
|
+
public struct LocalizationObject {
|
|
17
|
+
public var vi: [String: String]
|
|
18
|
+
public var en: [String: String]
|
|
19
|
+
|
|
20
|
+
public init(vi: [String: String] = [:], en: [String: String] = [:]) {
|
|
21
|
+
self.vi = vi
|
|
22
|
+
self.en = en
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public final class Localize: ObservableObject {
|
|
27
|
+
public static let VI = "vi"
|
|
28
|
+
public static let EN = "en"
|
|
29
|
+
|
|
30
|
+
private var assets: LocalizationObject
|
|
31
|
+
@Published public private(set) var currentLanguage: String = Localize.VI
|
|
32
|
+
|
|
33
|
+
public init(_ translations: LocalizationObject = LocalizationObject()) {
|
|
34
|
+
self.assets = Localize.merge(base: Localize.defaultLanguage, override: translations)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public func changeLanguage(_ language: String?) {
|
|
38
|
+
currentLanguage = (language == Localize.EN) ? Localize.EN : Localize.VI
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public func translate(_ key: String) -> String {
|
|
42
|
+
let dictionary = currentLanguage == Localize.EN ? assets.en : assets.vi
|
|
43
|
+
if let value = dictionary[key], !value.isEmpty { return value }
|
|
44
|
+
return key
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public func translateData(_ data: [String: String]) -> String {
|
|
48
|
+
if let value = data[currentLanguage] { return value }
|
|
49
|
+
let body = data.map { "\"\($0.key)\":\"\($0.value)\"" }.joined(separator: ",")
|
|
50
|
+
return "{\(body)}"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public func translateData(vi: String, en: String) -> String {
|
|
54
|
+
currentLanguage == Localize.EN ? en : vi
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/// Existing keys win (mirrors Compose: `merge(translations, assets)`).
|
|
58
|
+
public func addTranslations(_ translations: LocalizationObject) {
|
|
59
|
+
assets = Localize.merge(base: translations, override: assets)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private static func merge(base: LocalizationObject, override: LocalizationObject) -> LocalizationObject {
|
|
63
|
+
LocalizationObject(
|
|
64
|
+
vi: base.vi.merging(override.vi) { _, new in new },
|
|
65
|
+
en: base.en.merging(override.en) { _, new in new }
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private static let defaultLanguage = LocalizationObject(
|
|
70
|
+
vi: [
|
|
71
|
+
"errorCode": "Mã lỗi: ",
|
|
72
|
+
"seeMore": "Xem thêm",
|
|
73
|
+
"cancel": "Huỷ",
|
|
74
|
+
"done": "Xong",
|
|
75
|
+
"confirm": "Xác nhận",
|
|
76
|
+
"month": "tháng",
|
|
77
|
+
"day": "ngày",
|
|
78
|
+
"choose": "Chọn",
|
|
79
|
+
"sent": "Đã gửi",
|
|
80
|
+
"received": "Đã tiếp nhận",
|
|
81
|
+
"processing": "Đang xử lý",
|
|
82
|
+
"processed": "Đã xử lý",
|
|
83
|
+
"addImg": "Thêm hình",
|
|
84
|
+
"chooseBtn": "Chọn button",
|
|
85
|
+
"imgEg": "Hình ảnh tham khảo",
|
|
86
|
+
"filter": "Sắp xếp",
|
|
87
|
+
"shipping": "Đang giao hàng",
|
|
88
|
+
"men": "Nam",
|
|
89
|
+
"women": "Nữ",
|
|
90
|
+
"more": "Khác",
|
|
91
|
+
"expDate": "Ngày hết hạn",
|
|
92
|
+
"exp": "HSD",
|
|
93
|
+
"inActive": "Chưa kích hoạt",
|
|
94
|
+
"voucherRemindHour": "Hết hạn sau {hours} giờ",
|
|
95
|
+
"voucherRemindMinute": "Hết hạn sau {minutes} phút",
|
|
96
|
+
"voucherRemindSecond": "Hết hạn sau {seconds} giây",
|
|
97
|
+
"voucherRemindDay": "Hết hạn sau {days} ngày",
|
|
98
|
+
"chooseRoundtrip": "Chọn vé khứ hồi",
|
|
99
|
+
"depart": "Ngày đi",
|
|
100
|
+
"return": "Ngày về",
|
|
101
|
+
"departing": "Đi",
|
|
102
|
+
"returning": "Về",
|
|
103
|
+
"jan": "Tháng 1",
|
|
104
|
+
"feb": "Tháng 2",
|
|
105
|
+
"mar": "Tháng 3",
|
|
106
|
+
"apr": "Tháng 4",
|
|
107
|
+
"may": "Tháng 5",
|
|
108
|
+
"jun": "Tháng 6",
|
|
109
|
+
"jul": "Tháng 7",
|
|
110
|
+
"aug": "Tháng 8",
|
|
111
|
+
"sep": "Tháng 9",
|
|
112
|
+
"oct": "Tháng 10",
|
|
113
|
+
"nov": "Tháng 11",
|
|
114
|
+
"dec": "Tháng 12",
|
|
115
|
+
"mon": "T2",
|
|
116
|
+
"tue": "T3",
|
|
117
|
+
"wed": "T4",
|
|
118
|
+
"thu": "T5",
|
|
119
|
+
"fri": "T6",
|
|
120
|
+
"sat": "T7",
|
|
121
|
+
"sun": "CN",
|
|
122
|
+
"showLunar": "Hiển thị lịch âm",
|
|
123
|
+
"newYear": "Tết Dương lịch",
|
|
124
|
+
"valentine": "Ngày Lễ Tình nhân",
|
|
125
|
+
"womenDay": "Ngày Quốc tế Phụ nữ",
|
|
126
|
+
"liberationDay": "Ngày giải phóng Miền Nam thống nhất đất nước",
|
|
127
|
+
"laborDay": "Ngày Quốc tế Lao động",
|
|
128
|
+
"childrenDay": "Ngày Quốc tế Thiếu nhi",
|
|
129
|
+
"nationalDay": "Quốc khánh nước CHXHCN Việt Nam",
|
|
130
|
+
"womenDayVN": "Ngày Phụ nữ Việt Nam",
|
|
131
|
+
"teacherDay": "Ngày Nhà giáo Việt Nam",
|
|
132
|
+
"christmasEve": "Ngày Lễ Giáng Sinh",
|
|
133
|
+
"christmas": "Ngày Lễ Giáng Sinh",
|
|
134
|
+
"lunarNewYear": "Tết Nguyên Đán",
|
|
135
|
+
"hungKingDay": "Giỗ Tổ Hùng Vương",
|
|
136
|
+
"balance": "Số dư trong ví",
|
|
137
|
+
"chooseDate": "Chọn ngày tháng năm",
|
|
138
|
+
"year": "năm",
|
|
139
|
+
"hour": "giờ",
|
|
140
|
+
"minute": "phút",
|
|
141
|
+
"from": "Từ",
|
|
142
|
+
"to": "Đến",
|
|
143
|
+
"connected": "Đã kết nối",
|
|
144
|
+
"disconnected": "Mất kết nối",
|
|
145
|
+
"hide": "Ẩn",
|
|
146
|
+
"viewAllTitle": "Xem tất cả",
|
|
147
|
+
"headerTitle": "Lịch sử thanh toán",
|
|
148
|
+
"SHORTEN": "THU GỌN",
|
|
149
|
+
"viewMoreBank": "XEM THÊM (${otherItemCount} ngân hàng)",
|
|
150
|
+
"transaction_success": "Thành công",
|
|
151
|
+
"transaction_fail": "Thất bại",
|
|
152
|
+
"transaction_processing": "Đang xử lý",
|
|
153
|
+
"viewMore": "Xem thêm",
|
|
154
|
+
"shorten": "Thu gọn",
|
|
155
|
+
"Payment": "Thanh toán ${serviceName}",
|
|
156
|
+
"currencyUnit": "đ",
|
|
157
|
+
"Month": "Tháng",
|
|
158
|
+
"save": "Lưu",
|
|
159
|
+
"favoriteIn": "Thêm dịch vụ yêu thích",
|
|
160
|
+
"favoriteOut": "Xóa dịch vụ yêu thích",
|
|
161
|
+
"deviceIn": "Thêm vào thiết bị",
|
|
162
|
+
"setting": "Cài đặt",
|
|
163
|
+
"transaction": "Lịch sử giao dịch",
|
|
164
|
+
"share": "Chia sẽ dịch vụ",
|
|
165
|
+
"information": "Thông tin chung",
|
|
166
|
+
"tutorial": "Hướng dẫn sử dụng",
|
|
167
|
+
"question": "Câu hỏi thường gặp",
|
|
168
|
+
"support": "Trung tâm hỗ trợ",
|
|
169
|
+
"skip": "Bỏ qua",
|
|
170
|
+
"enterPhoneNumber": "Vui lòng nhập số điện thoại",
|
|
171
|
+
"invalidPhoneNumber": "Số điện thoại không đúng",
|
|
172
|
+
],
|
|
173
|
+
en: [
|
|
174
|
+
"seeMore": "See more",
|
|
175
|
+
"cancel": "Cancel",
|
|
176
|
+
"done": "Done",
|
|
177
|
+
"confirm": "Confirm",
|
|
178
|
+
"month": "month",
|
|
179
|
+
"day": "day",
|
|
180
|
+
"choose": "Choose",
|
|
181
|
+
"sent": "Sent",
|
|
182
|
+
"received": "Received",
|
|
183
|
+
"processing": "Processing",
|
|
184
|
+
"processed": "Done",
|
|
185
|
+
"addImg": "Add image",
|
|
186
|
+
"chooseBtn": "Choose button",
|
|
187
|
+
"imgEg": "Example images",
|
|
188
|
+
"filter": "Filter",
|
|
189
|
+
"shipping": "Shipping",
|
|
190
|
+
"men": "Men",
|
|
191
|
+
"women": "Women",
|
|
192
|
+
"more": "More",
|
|
193
|
+
"expDate": "Expiration date",
|
|
194
|
+
"exp": "EXP",
|
|
195
|
+
"inActive": "Not Activated",
|
|
196
|
+
"voucherRemindHour": "Revoke after {hours} hours",
|
|
197
|
+
"voucherRemindMinute": "Revoke after {minutes} minutes",
|
|
198
|
+
"voucherRemindSecond": "Revoke after {seconds} seconds",
|
|
199
|
+
"voucherRemindDay": "Revoke after {days} days",
|
|
200
|
+
"chooseRoundtrip": "Choose roundtrip ticket",
|
|
201
|
+
"depart": "Departing",
|
|
202
|
+
"return": "Returning",
|
|
203
|
+
"departing": "De",
|
|
204
|
+
"returning": "Re",
|
|
205
|
+
"jan": "January",
|
|
206
|
+
"feb": "February",
|
|
207
|
+
"mar": "March",
|
|
208
|
+
"apr": "April",
|
|
209
|
+
"may": "May",
|
|
210
|
+
"jun": "June",
|
|
211
|
+
"jul": "July",
|
|
212
|
+
"aug": "August",
|
|
213
|
+
"sep": "September",
|
|
214
|
+
"oct": "October",
|
|
215
|
+
"nov": "November",
|
|
216
|
+
"dec": "December",
|
|
217
|
+
"mon": "Mon",
|
|
218
|
+
"tue": "Tue",
|
|
219
|
+
"wed": "Wed",
|
|
220
|
+
"thu": "Thu",
|
|
221
|
+
"fri": "Fri",
|
|
222
|
+
"sat": "Sat",
|
|
223
|
+
"sun": "Sun",
|
|
224
|
+
"showLunar": "Show Lunar Calendar",
|
|
225
|
+
"newYear": "New Year's Day",
|
|
226
|
+
"valentine": "Valentine's Day",
|
|
227
|
+
"womenDay": "International Women's Day",
|
|
228
|
+
"liberationDay": "Liberation Day",
|
|
229
|
+
"laborDay": "Internation Labor's Day",
|
|
230
|
+
"childrenDay": "International Labor's Day",
|
|
231
|
+
"nationalDay": "National Day",
|
|
232
|
+
"womenDayVN": "Vietnamese Women's Day",
|
|
233
|
+
"teacherDay": "Teacher's Day",
|
|
234
|
+
"christmasEve": "Christmas Eve",
|
|
235
|
+
"christmas": "Christmas Day",
|
|
236
|
+
"lunarNewYear": "Lunar New Year",
|
|
237
|
+
"hungKingDay": "Hung Kings' Festival",
|
|
238
|
+
"balance": "Wallet Balance",
|
|
239
|
+
"chooseDate": "Choose date",
|
|
240
|
+
"year": "year",
|
|
241
|
+
"hour": "hour",
|
|
242
|
+
"minute": "minute",
|
|
243
|
+
"from": "From",
|
|
244
|
+
"to": "To",
|
|
245
|
+
"connected": "Connected",
|
|
246
|
+
"disconnected": "Disconnected",
|
|
247
|
+
"hide": "Hide",
|
|
248
|
+
"viewAllTitle": "View all",
|
|
249
|
+
"headerTitle": "Transaction history",
|
|
250
|
+
"SHORTEN": "SHORTEN",
|
|
251
|
+
"viewMoreBank": "VIEW MORE (${otherItemCount} banks)",
|
|
252
|
+
"transaction_success": "Success",
|
|
253
|
+
"transaction_fail": "Fail",
|
|
254
|
+
"transaction_processing": "Processing",
|
|
255
|
+
"viewMore": "View more",
|
|
256
|
+
"shorten": "Shorten",
|
|
257
|
+
"Payment": "${serviceName} payment",
|
|
258
|
+
"currencyUnit": "VND",
|
|
259
|
+
"Month": "Month",
|
|
260
|
+
"save": "Save",
|
|
261
|
+
"favoriteIn": "Add to favorite services",
|
|
262
|
+
"favoriteOut": "Remove to favorite services",
|
|
263
|
+
"deviceIn": "Add to device",
|
|
264
|
+
"setting": "Settings",
|
|
265
|
+
"transaction": "Transaction History",
|
|
266
|
+
"share": "Share",
|
|
267
|
+
"information": "Information",
|
|
268
|
+
"tutorial": "Instruction",
|
|
269
|
+
"question": "FAQ",
|
|
270
|
+
"support": "Support center",
|
|
271
|
+
"errorCode": "Error code: ",
|
|
272
|
+
"skip": "Skip",
|
|
273
|
+
"enterPhoneNumber": "Please enter your phone number",
|
|
274
|
+
"invalidPhoneNumber": "Invalid phone number",
|
|
275
|
+
]
|
|
276
|
+
)
|
|
277
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// MaxApi.swift
|
|
3
|
+
// MoMoUIKits
|
|
4
|
+
//
|
|
5
|
+
// Swift mirror of the host-app bridge exposed on Kotlin as `vn.momo.maxapi.IMaxApi`
|
|
6
|
+
// (`LocalMaxApi`). `IMaxApi` itself is an external compiled dependency with no
|
|
7
|
+
// source in this repo, so this protocol intentionally exposes only the methods
|
|
8
|
+
// this kit's Kotlin source actually calls (`track`, `dismiss`, `getLanguage`) —
|
|
9
|
+
// not a full guess at IMaxApi's real surface.
|
|
10
|
+
//
|
|
11
|
+
|
|
12
|
+
import Foundation
|
|
13
|
+
|
|
14
|
+
public protocol MaxApi {
|
|
15
|
+
func track(eventName: String, params: [String: Any?])
|
|
16
|
+
func dismiss(completion: (() -> Void)?)
|
|
17
|
+
func getLanguage(callback: @escaping ([String: Any?]?) -> Void)
|
|
18
|
+
}
|
|
@@ -56,6 +56,7 @@ public struct BottomTab: View {
|
|
|
56
56
|
}
|
|
57
57
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
58
58
|
.ignoresSafeArea(edges: .bottom)
|
|
59
|
+
.preference(key: IsBottomTabRootKey.self, value: true)
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
@ViewBuilder
|
|
@@ -96,7 +97,8 @@ public struct BottomTab: View {
|
|
|
96
97
|
/// Bottom safe-area inset (home indicator).
|
|
97
98
|
@available(iOS 16.0, *)
|
|
98
99
|
private func safeAreaBottomInset() -> CGFloat {
|
|
99
|
-
UIApplication.shared.connectedScenes
|
|
100
|
+
let bottomInset = UIApplication.shared.connectedScenes
|
|
100
101
|
.compactMap { ($0 as? UIWindowScene)?.keyWindow?.safeAreaInsets.bottom }
|
|
101
102
|
.first ?? 0
|
|
103
|
+
return min(bottomInset, 21)
|
|
102
104
|
}
|