@momo-kits/native-kits 0.168.1-beta.2 → 0.168.1-beta.3
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 +4 -4
- package/README.md +10 -2
- package/package.json +1 -1
- package/publish.sh +7 -2
- package/.claude/settings.local.json +0 -9
package/CLAUDE.md
CHANGED
|
@@ -7,7 +7,7 @@ Guidance for working in this repo. Keep it accurate — update it when structure
|
|
|
7
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
8
|
|
|
9
9
|
- Artifact: `vn.momo.kits:kits` (version in `gradle.properties`). NPM mirror: `@momo-kits/native-kits`.
|
|
10
|
-
- Targets: `
|
|
10
|
+
- Targets: AGP KMP `android` target (JVM 17, compile/min SDK 36/24; AGP 9.2.1, Gradle 9.5.0), `iosArm64`, `iosSimulatorArm64` (framework `baseName = "kits"`, `isStatic = true`).
|
|
11
11
|
- Kotlin 2.3.10, Compose MP 1.10.3.
|
|
12
12
|
|
|
13
13
|
## Modules
|
|
@@ -26,11 +26,11 @@ Guidance for working in this repo. Keep it accurate — update it when structure
|
|
|
26
26
|
|
|
27
27
|
## Build & verify
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Run `./gradlew :compose:testAndroidHostTest` for the request ownership tests in `commonTest`. Compile the relevant Android/iOS targets and use the sample app for visual checks.
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
./gradlew :compose:compileCommonMainKotlinMetadata # validate commonMain (fast, do this first)
|
|
33
|
-
./gradlew :compose:
|
|
33
|
+
./gradlew :compose:compileAndroidMain # Android target
|
|
34
34
|
./gradlew :compose:linkDebugFrameworkIosSimulatorArm64 # iOS framework (slow)
|
|
35
35
|
./gradlew :sample:androidApp:installDebug # run demo on device/emulator
|
|
36
36
|
```
|
|
@@ -50,7 +50,7 @@ Publishing is automated (`publish.sh` + GitLab CI on `[ci build]` / `main`). Do
|
|
|
50
50
|
- **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`.
|
|
51
51
|
- **Design-system config** (`trustBanner`, `headerBar`, `headerGradient`): the host seeds `KitDesignSystemConfig.update(...)` once (same pattern as `KitFontScale`); `NavigationContainer` provides it as `LocalDesignSystemConfig` (param `designSystemConfig` → parent → global) and applies `headerBar` as the header image when the theme has none.
|
|
52
52
|
- **Platform code** goes through `expect`/`actual` in `platform/` — never reference Android/iOS APIs from `commonMain` directly.
|
|
53
|
-
- **Native bridge:** `IMaxApi` (`vn.momo.maxapi`, exposed as `LocalMaxApi`) is the host-app bridge
|
|
53
|
+
- **Native bridge:** typed `IMaxApi` from NativeMaxApi `0.3.1` (`vn.momo.maxapi`, exposed as `LocalMaxApi`) is the host-app bridge. Toolkit uses `ToolkitOptions` to preserve custom groups and system-tool policy; pending callbacks are cancelled when their composition is disposed. Containers borrow the host client and must not close it.
|
|
54
54
|
- Navigation uses a runtime `DynamicScreenRegistry`; overlays (modal/bottom-sheet/snackbar) go through `Navigator` + `OverplayComponentRegistry`.
|
|
55
55
|
- **iOS swipe-back:** the host owns the only edge-pan recogniser and replays it through `HostBackGestureBridge` (`navigation/HostBackGestureBridge.kt`; the kit framework is never exported, so the host reaches it through its own Koin-provided facade): `checkCanPop` / `canPopInner` / `pop` route the back into the kit stack, `started` / `progressed` / `completed` / `cancelled` seek the NavHost transition, `shouldUseFloatingArrowBack` is set by bottom tabs. `NavigationContainer` attaches itself automatically (`AttachHostBackGesture`, iOS only, detached by identity on dispose) — hosts need no wrapper and no `setNavigator`. `maxApi` is a required parameter of `NavigationContainer` — every container, nested or root, is handed its host bridge explicitly.
|
|
56
56
|
|
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ ComposeKit là bộ UI Kit đa nền tảng phục vụ Mini App/SDK của MoMo.
|
|
|
53
53
|
---
|
|
54
54
|
|
|
55
55
|
### Yêu cầu môi trường
|
|
56
|
-
- JDK 17
|
|
56
|
+
- JDK 17+ và Android SDK (compileSdk xem `libs.versions.toml`); wrapper Gradle `9.5.0`, AGP `9.2.1`.
|
|
57
57
|
- Kotlin Multiplatform plugin + Compose Multiplatform (JetBrains 1.6.1+).
|
|
58
58
|
- Xcode 15, CocoaPods 1.12+ để build `iosApp` hoặc publish Pod.
|
|
59
59
|
- Truy cập mạng nội bộ GitLab Packages nếu cần publish/consume Maven repo `https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven`.
|
|
@@ -174,4 +174,12 @@ fun SuccessState() {
|
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
- `shared/build.gradle.kts` đã bật `coreLibraryDesugaringEnabled` để tương thích `compottie-dot`/`compottie-network` với `minSdk = 24`.
|
|
177
|
-
- Nếu animation dùng asset/font nội bộ, kết hợp `compottie-resources` (`rememberResourcesAssetsManager`, `rememberResourcesFontManager`) để trỏ về `composeResources`.
|
|
177
|
+
- Nếu animation dùng asset/font nội bộ, kết hợp `compottie-resources` (`rememberResourcesAssetsManager`, `rememberResourcesFontManager`) để trỏ về `composeResources`.
|
|
178
|
+
### NativeMaxApi 0.3.1
|
|
179
|
+
|
|
180
|
+
Compose dùng typed `vn.momo.maxapi.IMaxApi` do host truyền vào `NavigationContainer`.
|
|
181
|
+
Toolkit dùng overload `showToolkit(ToolkitOptions, callback)` để giữ nhóm tool tùy chỉnh,
|
|
182
|
+
nhãn đa ngôn ngữ, icon, badge và `useSystemTools`. Callback trả `actionKey`; request đang chờ
|
|
183
|
+
được hủy khi composition bị gỡ. Kits không đóng client do host sở hữu.
|
|
184
|
+
|
|
185
|
+
Chạy `./gradlew :compose:testAndroidHostTest` để kiểm tra hủy request và callback đến muộn.
|
package/package.json
CHANGED
package/publish.sh
CHANGED
|
@@ -374,8 +374,13 @@ phase_publish_npm() {
|
|
|
374
374
|
echo ""
|
|
375
375
|
# A bad token surfaces as a 404 on the PUT, after the working tree was already rewritten
|
|
376
376
|
# below — so verify auth first, before anything is touched.
|
|
377
|
-
if ! npm whoami --registry https://registry.npmjs.org
|
|
378
|
-
echo "
|
|
377
|
+
if ! NPM_WHOAMI_OUTPUT=$(npm whoami --registry https://registry.npmjs.org 2>&1); then
|
|
378
|
+
echo "$NPM_WHOAMI_OUTPUT"
|
|
379
|
+
if echo "$NPM_WHOAMI_OUTPUT" | grep -qE "E401|ENEEDAUTH"; then
|
|
380
|
+
echo "❌ Error: npm auth failed (npm whoami). Renew the token in .npmrc / ~/.npmrc and retry."
|
|
381
|
+
else
|
|
382
|
+
echo "❌ Error: npm whoami failed (see above) — likely network / VPN to registry.npmjs.org. Retry in a moment."
|
|
383
|
+
fi
|
|
379
384
|
exit 1
|
|
380
385
|
fi
|
|
381
386
|
|