@momo-kits/native-kits 0.167.1-duo.2-debug → 0.167.1-duo.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.
Files changed (171) hide show
  1. package/.claude/scheduled_tasks.lock +1 -0
  2. package/.claude/settings.local.json +185 -0
  3. package/CLAUDE.md +8 -3
  4. package/ios/Application/HeaderRight.swift +25 -12
  5. package/ios/Application/Layout/ScreenLayout.swift +196 -0
  6. package/ios/Application/Navigation/BottomTab/BottomTab.swift +30 -9
  7. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +5 -2
  8. package/ios/Application/Navigation/BottomTab/DuoTabBar.swift +275 -0
  9. package/ios/Application/Navigation/HeaderUser.swift +4 -1
  10. package/ios/Application/Navigation/NavigationContainer.swift +3 -0
  11. package/ios/Application/Navigation/Overplay/BottomSheet.swift +41 -4
  12. package/ios/Application/Navigation/Overplay/ModalScreen.swift +5 -1
  13. package/ios/Application/Navigation/component/DuoScrollGradient.swift +55 -0
  14. package/ios/Application/Navigation/component/Header.swift +9 -3
  15. package/ios/Application/Navigation/component/HeaderBackground.swift +3 -2
  16. package/ios/Application/Navigation/component/NavigationFooter.swift +1 -1
  17. package/ios/Application/Navigation/component/NavigationHeaderRight.swift +61 -9
  18. package/ios/Application/Navigation/component/SideBar.swift +155 -0
  19. package/ios/Application/StackScreen.swift +135 -18
  20. package/ios/Popup/PopupDisplay.swift +84 -68
  21. package/ios/Popup/PopupLayout.swift +45 -0
  22. package/ios/Popup/PopupNotify.swift +43 -32
  23. package/ios/Popup/PopupPromotion.swift +17 -5
  24. package/ios/native-kits.podspec +1 -1
  25. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  26. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DuoTabDemo.swift +76 -0
  27. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +1 -0
  28. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IPhoneDuoDemo.swift +170 -0
  29. package/package.json +1 -1
  30. package/build.gradle.kts +0 -11
  31. package/compose/build.gradle.kts +0 -190
  32. package/compose/build.gradle.kts.backup +0 -190
  33. package/compose/compose.podspec +0 -47
  34. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -19
  35. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  36. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +0 -12
  37. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  38. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -151
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -52
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -124
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -183
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -207
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -39
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -293
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -831
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -269
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -110
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -378
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -82
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -356
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -113
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -542
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -49
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -231
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -189
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -475
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -114
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -266
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -240
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -223
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -264
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -185
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -84
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -334
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -98
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -310
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -90
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -323
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -220
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -473
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -199
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -91
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -552
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -88
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -125
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -207
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -498
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -176
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -234
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -188
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -16
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitDesignSystem.kt +0 -18
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +0 -22
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -188
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -297
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -54
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -50
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -157
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -41
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -299
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +0 -58
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -129
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -106
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -205
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -393
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -622
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +0 -148
  135. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +0 -35
  136. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -175
  137. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -232
  138. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
  139. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -169
  140. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -381
  141. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -83
  142. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -105
  143. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +0 -74
  144. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -347
  145. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -37
  146. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -363
  147. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +0 -169
  148. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -132
  149. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -127
  150. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +0 -12
  151. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -91
  152. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  153. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -71
  154. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  155. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
  156. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  157. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -118
  158. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -40
  159. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +0 -45
  160. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -32
  161. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +0 -38
  162. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
  163. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -213
  164. package/gradle/libs.versions.toml +0 -69
  165. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  166. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  167. package/gradle.properties +0 -26
  168. package/gradlew +0 -252
  169. package/gradlew.bat +0 -94
  170. package/ios-demo/README.md +0 -120
  171. package/settings.gradle.kts +0 -64
@@ -0,0 +1 @@
1
+ {"sessionId":"611d4121-c353-42bf-a58b-2fe5f02b02bb","pid":99784,"procStart":"Sun Oct 4 12:12:05 2026","acquiredAt":1791116444172}
@@ -0,0 +1,185 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
5
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/maven-metadata.xml\")",
6
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko/maven-metadata.xml\")",
7
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko/0.144.6/skiko-0.144.6.module\")",
8
+ "Bash(curl -s -o /dev/null -w '%{http_code}' https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.__TRACKED_VAR__)",
9
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/\")",
10
+ "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/\")",
11
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.148.1/skiko-android-0.148.1.pom\")",
12
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.5/skiko-android-0.144.5.pom\")",
13
+ "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://dl.google.com/dl/android/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
14
+ "Bash(curl -s \"https://search.maven.org/solrsearch/select?q=a:skiko-android&rows=5&wt=json\")",
15
+ "Bash(curl -sL -o /dev/null -w \"%{http_code} %{url_effective}\\\\n\" \"https://repo1.maven.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
16
+ "Bash(curl *)",
17
+ "Bash(./gradlew :sample:androidApp:dependencies --configuration debugRuntimeClasspath)",
18
+ "Bash(./gradlew :sample:shared:compileDebugKotlinAndroid)",
19
+ "Bash(./gradlew :sample:androidApp:compileDebugKotlin)",
20
+ "Bash(ls -d *.xcodeproj)",
21
+ "Bash(grep -c ChipDemo.swift __TRACKED_VAR__/project.pbxproj)",
22
+ "Bash(grep -c PBXFileSystemSynchronizedRootGroup __TRACKED_VAR__/project.pbxproj)",
23
+ "Bash(grep -c InformationDemo.swift __TRACKED_VAR__/project.pbxproj)",
24
+ "Bash(plutil -lint project.pbxproj)",
25
+ "Bash(xcode-select -p)",
26
+ "Bash(/usr/bin/xcrun xcodebuild *)",
27
+ "Bash(echo \"exit: $?\")",
28
+ "Bash(/Applications/Xcode26.app/Contents/Developer/usr/bin/xcodebuild -version)",
29
+ "Bash(./gradlew :compose:tasks --all)",
30
+ "Bash(grep -n \"vanniktech\\\\|mavenPublishing\\\\|^publishing\\\\|version = gitlabVersion\\\\|namespace =\\\\|compileSdk =\\\\|minSdk =\\\\|GitLabPackages\\\\|name = \\\\\"\\\\${gitlabRepo}Packages\\\\\"\")",
31
+ "Bash(git checkout *)",
32
+ "Bash(./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository --dry-run)",
33
+ "Bash(git fetch *)",
34
+ "Bash(git pull *)",
35
+ "Bash(git push *)",
36
+ "Bash(git branch *)",
37
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -list)",
38
+ "Bash(xcrun simctl *)",
39
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
40
+ "Bash(pod install *)",
41
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'id=1E6F9A79-5E64-4590-BEA2-828D75D99393' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
42
+ "Bash(xcrun swiftc *)",
43
+ "Bash(echo \"=== exit: $? \\(1=none found\\) ===\")",
44
+ "Bash(cat Radius.swift)",
45
+ "Bash(cat Spacing.swift)",
46
+ "Bash(echo \"exit=$?\")",
47
+ "Bash(ruby *)",
48
+ "Bash(xcodebuild -list -workspace iosApp.xcworkspace)",
49
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' build)",
50
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
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 *)",
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 *)",
67
+ "Read(//Users/sophia/Workspace/momo/momo-app/**)",
68
+ "Bash(git log *)",
69
+ "Bash(xcodebuild -version)",
70
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
71
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
72
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug clean build CODE_SIGNING_ALLOWED=NO)",
73
+ "Bash(git commit *)",
74
+ "Bash(npm view *)",
75
+ "Bash(echo \"EXIT=$? -> not resolvable\")",
76
+ "Bash(yarn install *)",
77
+ "Bash(RCT_NEW_ARCH_ENABLED=1 pod install)",
78
+ "Bash(xcodebuild -workspace MoMoPlatform.xcworkspace -list)",
79
+ "Bash(git --no-pager diff --stat ios/Application/Localize.swift ios/Application/Navigation/NavigationContainer.swift ios/Popup/PopupDisplay.swift ios/Popup/PopupNotify.swift ios/Template/TrustBanner/TrustBanner.swift)",
80
+ "Bash(git rm *)",
81
+ "Bash(echo \"EXIT=$?\")",
82
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits diff sample/iosApp/iosApp/Demo/ButtonDemo.swift)",
83
+ "Bash(python3 *)",
84
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits status --short)",
85
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits log --oneline -3)",
86
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits log --oneline -5 -- ios/Button/Button.swift)",
87
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits diff ios/native-kits.podspec compose/compose.podspec gradle.properties package.json)",
88
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits show HEAD:ios/Button/Button.swift)",
89
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits diff package.json ios/native-kits.podspec)",
90
+ "Bash(grep -n \"must be a \\\\`.background\\\\` of the label\" /Users/sophia/Workspace/momo/momo-app/node_modules/@momo-kits/native-kits/ios/Button/Button.swift)",
91
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits show -s --format=\"%h %ci %s\" 953b234d)",
92
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-app show -s --format=\"%h %ci %s\" f8757a14437)",
93
+ "Bash(git -C /Users/sophia/Workspace/momo/momo-app log -S '\"@momo-kits/native-kits\": \"0.163.1-beta.18\"' --format=\"%h %ci %s\" -- package.json)",
94
+ "Bash(swiftc -O repro_isfull.swift -o repro_isfull)",
95
+ "Bash(./repro_isfull)",
96
+ "Bash(grep -n '^\\\\[32;1m$\\\\|section_start\\\\|xcodebuild.*-workspace\\\\|xcodebuild.*archive\\\\|Prebuilt\\\\|prebuilt\\\\|framework.*download\\\\|rugby\\\\|Rugby' /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/7e2b5bd7-f8b3-42f7-b242-127fa8eabd12/scratchpad/job_trace.log)",
97
+ "Bash(grep -n '\\\\[32;1m\\\\$' /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/7e2b5bd7-f8b3-42f7-b242-127fa8eabd12/scratchpad/job_trace.log)",
98
+ "Bash(npm pack *)",
99
+ "Bash(mkdir -p b13 b18)",
100
+ "Bash(tar xzf *)",
101
+ "Bash(git *)",
102
+ "Bash(tar -tzf momo-kits-native-kits-0.163.1-beta.18.tgz)",
103
+ "Bash(tar -xzf momo-kits-native-kits-0.163.1-beta.18.tgz package/ios/Button/Button.swift)",
104
+ "Bash(tar -xzf momo-kits-native-kits-0.162.28.tgz package/ios/Button/Button.swift -C .)",
105
+ "Bash(mkdir -p old)",
106
+ "Bash(tar -xzf momo-kits-native-kits-0.162.28.tgz -C old package/ios/Button/Button.swift)",
107
+ "Bash(nm '/private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/7e2b5bd7-f8b3-42f7-b242-127fa8eabd12/scratchpad/ipa_extract/Payload/MoMoPlatform UAT.app/MoMoPlatform UAT')",
108
+ "Bash(xcodebuild -workspace /Users/sophia/Workspace/momo/momo-native-kits/sample/iosApp/iosApp.xcworkspace -list)",
109
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' build)",
110
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build-verify build)",
111
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build-verify build)",
112
+ "Bash(./gradlew :sample:shared:syncComposeResourcesForIos)",
113
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' -derivedDataPath build-verify build)",
114
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -quiet build)",
115
+ "Bash(xcodebuild -workspace sample/iosApp/iosApp.xcworkspace -list)",
116
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -destination 'id=0228A4B2-57E0-4E56-BFAD-DB9E95044AD9' -derivedDataPath /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/6986983a-795d-419d-9d78-fcc100e87876/scratchpad/dd build)",
117
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -destination 'id=1E6F9A79-5E64-4590-BEA2-828D75D99393' -derivedDataPath /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/6986983a-795d-419d-9d78-fcc100e87876/scratchpad/dd build)",
118
+ "Bash([ -s $S/kb.png ])",
119
+ "Bash(sips -g pixelWidth -g pixelHeight /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/6986983a-795d-419d-9d78-fcc100e87876/scratchpad/kb.png)",
120
+ "Bash(defaults read *)",
121
+ "Bash(defaults write *)",
122
+ "Bash(xcrun xcodebuild *)",
123
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -quiet build)",
124
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' -quiet build)",
125
+ "Read(//tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/3e8adc08-a7e7-4169-aee6-8b22a6996f38/scratchpad/**)",
126
+ "Bash(echo \"parse-exit=$?\")",
127
+ "Bash(echo \"=== exit $?\")",
128
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build)",
129
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' -configuration Debug build)",
130
+ "Bash(./gradlew :sample:shared:compileCommonMainKotlinMetadata -q)",
131
+ "Bash(echo \"gradle=$?\")",
132
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'id=0228A4B2-57E0-4E56-BFAD-DB9E95044AD9' -derivedDataPath build/dd build)",
133
+ "Bash(osascript *)",
134
+ "Bash(screencapture -x -R253,53,452,950 win.png)",
135
+ "Bash(sips -g pixelWidth -g pixelHeight win.png)",
136
+ "Bash(screencapture -x -R\"253,53,452,950\" win.png)",
137
+ "Bash(screencapture -x full.png)",
138
+ "Bash(sips -g pixelWidth -g pixelHeight full.png)",
139
+ "Bash(sips -c 1900 904 --cropOffset 106 506 full.png --out crop.png)",
140
+ "Bash(swiftc -O mouse.swift -o mouse)",
141
+ "Bash(./mouse click *)",
142
+ "Bash(./mouse drag *)",
143
+ "Bash(sips -c 900 924 --cropOffset 0 0 s12.png --out s12crop.png)",
144
+ "Bash(sips -c 300 1170 --cropOffset 300 0 s12.png --out s12top.png)",
145
+ "Bash(sips -c 700 1170 --cropOffset 250 0 t1.png --out t1c.png)",
146
+ "Bash(sips -c 700 1170 --cropOffset 250 0 t2.png --out t2c.png)",
147
+ "Bash(sips -c 700 1170 --cropOffset 150 0 t3.png --out t3c.png)",
148
+ "Bash(sips -c 1200 1170 --cropOffset 600 0 t4.png --out t4c.png)",
149
+ "Bash(sips -c 600 1170 --cropOffset 150 0 t5.png --out t5c.png)",
150
+ "Bash(sips -c 500 1170 --cropOffset 150 0 u1.png --out u1c.png)",
151
+ "Bash(cp /Users/sophia/Workspace/momo/momo-native-kits/ios/Application/Navigation/NavigationContainer.swift /Users/sophia/Workspace/momo/momo-app/node_modules/@momo-kits/native-kits/ios/Application/Navigation/NavigationContainer.swift)",
152
+ "Bash(cp /Users/sophia/Workspace/momo/momo-native-kits/ios/Application/Navigation/Navigator.swift /Users/sophia/Workspace/momo/momo-app/node_modules/@momo-kits/native-kits/ios/Application/Navigation/Navigator.swift)",
153
+ "Bash(cp /Users/sophia/Workspace/momo/momo-native-kits/ios/Application/Navigation/NavigatorManager.swift /Users/sophia/Workspace/momo/momo-app/node_modules/@momo-kits/native-kits/ios/Application/Navigation/NavigatorManager.swift)",
154
+ "Bash(cp /Users/sophia/Workspace/momo/momo-native-kits/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift /Users/sophia/Workspace/momo/momo-app/node_modules/@momo-kits/native-kits/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift)",
155
+ "Bash(xcodebuild -workspace MoMoPlatform.xcworkspace -scheme MoMoPlatform-UAT -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build/DerivedData build)",
156
+ "Bash(cp android/gradle/libs.versions.toml /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/bfb380ee-54cb-4a02-bc5f-d152cce4b727/scratchpad/libs.versions.toml.bak)",
157
+ "Bash(sed -i '' 's/kits = \"0.163.1-sp.8\"/kits = \"0.163.1-sp.7\"/' android/gradle/libs.versions.toml)",
158
+ "Bash(xcrun --sdk iphonesimulator --show-sdk-path)",
159
+ "Bash(chmod +x /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/62b6dcd2-247f-4111-98ef-3847c8914676/scratchpad/tc.sh)",
160
+ "Bash(/private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/62b6dcd2-247f-4111-98ef-3847c8914676/scratchpad/tc.sh)",
161
+ "Bash(perl -0pi -e 's{^ static let \\(\\\\w+\\) = \\(appFont\\\\\\(size: [\\\\d.]+\\\\\\)\\(?:\\\\.weight\\\\\\(\\\\.\\\\w+\\\\\\)\\)?\\)\\(\\\\s*//.*\\)?$}{ static var $1: Font { $2 }$3}mg' ios/Typography/Typography.swift)",
162
+ "Bash(perl -0pi -e 's{\\(\\\\s*\\)// AI-GENERATED START: route Localize injection through the observing modifier\\\\n\\(\\\\s*\\)\\\\.momoLocalize\\\\\\(localize\\\\\\)\\\\n\\(\\\\s*\\)// AI-GENERATED END: route Localize injection through the observing modifier}{$1// AI-GENERATED START: route Localize + font-scale injection through the observing modifiers\\\\n$2.momoLocalize\\(localize\\)\\\\n$2.momoFontScale\\(\\)\\\\n$3// AI-GENERATED END: route Localize + font-scale injection through the observing modifiers}g' ios/Application/Navigation/NavigationContainer.swift)",
163
+ "Bash(perl -pi -e 's/Mirrors Compose.s `fontScale\\\\\\(\\\\.\\\\.\\\\.\\\\\\)`/Mirrors Compose'\"'\"'s `scaleSize\\(...\\)`/' ios/Chip/Chip.swift)",
164
+ "Bash(perl -pi -e 's/fontScale\\\\\\(\\(size == \\\\.small \\\\? 48 : 56\\), 1\\\\.1\\\\\\)/fontScale\\($1\\)/' ios/Input/Input.swift ios/Input/InputPhoneNumber.swift)",
165
+ "Bash(perl -pi -e 's/^\\(\\\\s*\\)\\\\.momoFontScale\\\\\\(\\\\\\)$/$1.momoFontScale\\(context: applicationEnvironment.applicationContext\\)/' ios/Application/Navigation/NavigationContainer.swift)",
166
+ "Bash(chmod +x /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/62b6dcd2-247f-4111-98ef-3847c8914676/scratchpad/tcdemo.sh)",
167
+ "Bash(/private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/62b6dcd2-247f-4111-98ef-3847c8914676/scratchpad/tcdemo.sh)",
168
+ "Bash(\"/Users/sophia/Workspace/momo-glab/momo-agent-flows/momo-agent/scripts/repo.sh\" find *)",
169
+ "Read(//Users/sophia/.momo-agent/**)",
170
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -derivedDataPath /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/62b6dcd2-247f-4111-98ef-3847c8914676/scratchpad/dd build)",
171
+ "Bash(\"/Users/sophia/Workspace/momo-glab/momo-agent-flows/momo-agent/scripts/repo.sh\" prep *)",
172
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -configuration Debug -destination id=1E6F9A79-5E64-4590-BEA2-828D75D99393 -derivedDataPath /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/62b6dcd2-247f-4111-98ef-3847c8914676/scratchpad/dd build)",
173
+ "Bash(find /private/tmp/claude-503/-Users-sophia-Workspace-momo-momo-native-kits/62b6dcd2-247f-4111-98ef-3847c8914676/scratchpad/dd/Build/Products -maxdepth 2 -name *.app)",
174
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -configuration Debug -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build/dd build)",
175
+ "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -configuration Debug -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build/dd ARCHS=arm64 ONLY_ACTIVE_ARCH=YES build)",
176
+ "Bash(./gradlew :compose:generateDummyFramework)",
177
+ "Bash(break)",
178
+ "Bash(\"/Users/sophia/Workspace/momo-glab/momo-agent-flows/momo-agent/scripts/gitlab.sh\" mr-view *)",
179
+ "Bash(\"/Users/sophia/Workspace/momo-glab/momo-agent-flows/momo-agent/scripts/gitlab.sh\" mr-discussions *)",
180
+ "Bash(command -v glab)",
181
+ "Bash(glab --version)",
182
+ "Bash(/Users/sophia/Workspace/momo-glab/momo-agent-flows/momo-agent/scripts/jira.sh transitions *)"
183
+ ]
184
+ }
185
+ }
package/CLAUDE.md CHANGED
@@ -47,11 +47,16 @@ Publishing is automated (`publish.sh` + GitLab CI on `[ci build]` / `main`). Do
47
47
  - Navigation uses a runtime `DynamicScreenRegistry`; overlays (modal/bottom-sheet/snackbar) go through `Navigator` + `OverplayComponentRegistry`.
48
48
  - **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.
49
49
 
50
- ## Screen layout / iPhone Duo (port of RN `useScreenLayout`)
50
+ ## Screen layout / iPhone Duo (port of RN `useScreenLayout`, momo-kits !664)
51
51
 
52
- - `layout/ScreenLayout.kt`: `getScreenLayout()` returns window size, side safe-area insets, `contentWidth`, header geometry and the iPhone Duo `sideBar`. `NavigationContainer` computes it once and provides `LocalScreenLayout`; reactive to fold/unfold and rotation (window size + `WindowInsets`). Metrics (`DuoMetrics`, 72pt iPhone header floor, 20pt status-bar threshold) mirror RN `Layout/utils.ts` — change both together.
52
+ - `layout/ScreenLayout.kt`: `getScreenLayout()` returns window size, raw top/bottom + side insets, `contentWidth`, header geometry, the iPhone Duo `sideBar` and `duoTopInset`. `NavigationContainer` computes it once and provides `LocalScreenLayout`; reactive to fold/unfold and rotation (window size + `WindowInsets`). Metrics (`DuoMetrics`, 72pt iPhone header floor, 20pt status-bar threshold) mirror RN `Layout/utils.ts` — change both together.
53
+ - iPhone-only: everything gates on `isPhoneIdiom()` (`platform/`), never on "iOS", so iPad windows keep the regular layout. Two detectors, as in RN: `isIPhoneDuo` (window aspect < 1.6 or asymmetric side insets) drives layout; `isIPhoneDuoDevice` (short side of screen or window > 440, RN `device.ts`) drives popups, modal and bottom sheet.
53
54
  - Header height is `headerHeight` (not `AppStatusBar + HEADER_HEIGHT`); the bar row is `headerBarHeight`. When the status bar is off the top edge (iPhone landscape, iPhone Duo) `headerStatusBarHeight` is 0 so the title stays centered.
54
- - iPhone Duo with a side strip ≥ 60pt: back + toolkit leave the bar for `HeaderSideBar` (`navigation/component/SideBar.kt`, 48pt glass controls); custom header-right stays in the bar. The column starts below the camera / status-bar cluster: 170pt portrait, 120pt in any landscape (folded too — RN still uses 170 there), below the header when the status bar is on top; UIKit's `statusBarFrame` is useless on Duo. Unlike RN it is clamped 24pt above footer / tab bar, so a long toolkit (shortcut + group) never covers the footer.
55
+ - iPhone Duo with a side strip ≥ 60pt: back + toolkit leave the bar for `HeaderSideBar` (`navigation/component/SideBar.kt`, 48pt glass controls); custom header-right stays in the bar. The column starts at 120pt when the inner display is landscape (height ≥ 600), else 170pt, or below the header when the status bar is on top; UIKit's `statusBarFrame` is useless on Duo. Unlike RN it is clamped 24pt above footer / tab bar / rail.
56
+ - Tab bar on Duo is `bottomtab/DuoTabBar.kt`: a rail in the side strip (anchored 24pt from the bottom, QR below it) or, without a side bar, a floating bar spanning 6/8 grid columns. Both overlay the content; `duoFloatingTabBarInset` pads tab content, footer and FAB.
57
+ - Glass header: on Duo with a side bar, Default/Extended headers without search and with a `ScrollState` let content scroll under the bar (`usesDuoGlassHeader`); the bar fades in a translucent surface + hairline over 16pt (Compose has no backdrop blur — RN's fallback look), the gradient scrolls away / collapses.
58
+ - Overlays on Duo: popups cap at 440pt wide and the room between `duoTopInset` and the bottom inset (body scrolls, actions stay); modal centers inside that room; bottom sheet uses the window height, centers at width ≥ 600 and pads by side insets in landscape.
59
+ - Font scale deliberately uses the short side (`min(w, h)`), unlike RN which reads the window width — landscape must not inflate every font.
55
60
  - `StackScreen` pads content/footer/search/FAB by the side insets and provides an inset-consumed layout to its content; a bottom-tab root stays full width (tab bar + each tab's StackScreen handle insets). Grid columns use `contentWidth`.
56
61
 
57
62
  ## i18n / Localize (port of RN `Localize`)
@@ -7,20 +7,31 @@ public struct HeaderRightData {
7
7
  var tools: [ToolGroup]
8
8
  var toolCallback: ((String) -> Void)?
9
9
  var useSystemTools: Bool
10
+ var useCloseIcon: Bool
10
11
 
11
12
  public init(
12
13
  useShortcut: Bool = false,
13
14
  useMore: Bool = false,
14
15
  tools: [ToolGroup] = [],
15
16
  toolCallback: ((String) -> Void)? = nil,
16
- useSystemTools: Bool = true
17
+ useSystemTools: Bool = true,
18
+ useCloseIcon: Bool = false
17
19
  ) {
18
20
  self.useShortcut = useShortcut
19
21
  self.useMore = useMore
20
22
  self.tools = tools
21
23
  self.toolCallback = toolCallback
22
24
  self.useSystemTools = useSystemTools
25
+ self.useCloseIcon = useCloseIcon
23
26
  }
27
+
28
+ /// Close-circle instead of home, as RN `headerRight.useCloseIcon`.
29
+ var closeIcon: String { useCloseIcon ? "16_navigation_close_circle" : "16_basic_home" }
30
+ }
31
+
32
+ /// The Help Center mini-app hides its own help-center button.
33
+ func showsHelpCenter(_ context: MiniAppContext?) -> Bool {
34
+ context?.appId != "vn.momo.helpcenter"
24
35
  }
25
36
 
26
37
  public struct Tool {
@@ -238,17 +249,19 @@ struct ToolkitHeaderRight: View {
238
249
  }
239
250
 
240
251
  HStack(alignment: .center, spacing: 0) {
241
- Icon(source: "help_center", size: 20, color: tintColor ?? Colors.black17)
242
- .padding(4)
243
- .onTapGesture {
244
- onPressHelpCenter()
245
- }
246
-
247
- Rectangle()
248
- .fill(tintColor ?? Colors.black20)
249
- .frame(width: 0.5, height: 12)
250
-
251
- Icon(source: "16_basic_home", size: 20, color: tintColor ?? Colors.black17)
252
+ if showsHelpCenter(environment.applicationContext) {
253
+ Icon(source: "help_center", size: 20, color: tintColor ?? Colors.black17)
254
+ .padding(4)
255
+ .onTapGesture {
256
+ onPressHelpCenter()
257
+ }
258
+
259
+ Rectangle()
260
+ .fill(tintColor ?? Colors.black20)
261
+ .frame(width: 0.5, height: 12)
262
+ }
263
+
264
+ Icon(source: headerRight?.closeIcon ?? "16_basic_home", size: 20, color: tintColor ?? Colors.black17)
252
265
  .padding(4)
253
266
  .onTapGesture {
254
267
  onPressClose()
@@ -0,0 +1,196 @@
1
+ //
2
+ // ScreenLayout.swift
3
+ // MoMoUIKits
4
+ //
5
+ // Port of momo-kits RN `useScreenLayout` (Layout/utils.ts) and `Application/device.ts`:
6
+ // window size, safe-area insets, content width, header geometry and the iPhone Duo side bar.
7
+ //
8
+
9
+ import SwiftUI
10
+ import UIKit
11
+
12
+ public enum SideBarEdge: Equatable {
13
+ case left, right
14
+ }
15
+
16
+ public struct SideBarLayout: Equatable {
17
+ public let edge: SideBarEdge
18
+ public let width: CGFloat
19
+ /// Preferred window y of the first control; StackScreen still keeps the column above the bottom bars.
20
+ public let top: CGFloat
21
+ }
22
+
23
+ public struct ScreenLayout: Equatable {
24
+ public let width: CGFloat
25
+ public let height: CGFloat
26
+ public let isIPhoneDuo: Bool
27
+ public let insets: EdgeInsets
28
+ public let insetLeft: CGFloat
29
+ public let insetRight: CGFloat
30
+ public let contentWidth: CGFloat
31
+ public let headerHeight: CGFloat
32
+ /// 0 when the status bar is off the top edge, so the bar row fills the header and keeps the title centered.
33
+ public let headerStatusBarHeight: CGFloat
34
+ /// iPhone Duo moves back and toolkit into a column in the side safe area; nil while they stay in the bar.
35
+ public let sideBar: SideBarLayout?
36
+
37
+ public var headerBarHeight: CGFloat { headerHeight - headerStatusBarHeight }
38
+ }
39
+
40
+ // Measured by momo-kits RN (Layout/utils.ts) on the iOS 27.1 iPhone Duo simulator; keep both in sync.
41
+ enum DuoMetrics {
42
+ // Inner display is ~1.42, outer ~1.45; every slab iPhone is 1.77 or taller.
43
+ static let maxAspectRatio: CGFloat = 1.6
44
+ // Outer display is 466pt tall in landscape, inner 669pt.
45
+ static let innerMinHeight: CGFloat = 600
46
+ static let controlSize: CGFloat = 48
47
+ static let itemPitch: CGFloat = 50
48
+ static let firstItemTop: CGFloat = 170
49
+ static let firstItemTopLandscape: CGFloat = 120
50
+ // Widest short side of any single-display iPhone.
51
+ static let iPhoneMaxShortSide: CGFloat = 440
52
+ }
53
+
54
+ enum HeaderMetrics {
55
+ static let barHeight: CGFloat = HEADER_HEIGHT
56
+ static let iPhoneMinHeight: CGFloat = 72
57
+ // A smaller top inset means the status bar is not on the top edge.
58
+ static let statusBarMinInset: CGFloat = 20
59
+ }
60
+
61
+ private var isPhoneIdiom: Bool { UIDevice.current.userInterfaceIdiom == .phone }
62
+
63
+ private var keyWindow: UIWindow? {
64
+ UIApplication.shared.connectedScenes
65
+ .compactMap { ($0 as? UIWindowScene)?.keyWindow }
66
+ .first
67
+ }
68
+
69
+ extension ScreenLayout {
70
+ /// Snapshot of the key window; not reactive, so views read `\.screenLayout` instead.
71
+ public static var current: ScreenLayout {
72
+ guard let window = keyWindow else {
73
+ return make(size: UIScreen.main.bounds.size, insets: EdgeInsets())
74
+ }
75
+ let inset = window.safeAreaInsets
76
+ return make(
77
+ size: window.bounds.size,
78
+ insets: EdgeInsets(top: inset.top, leading: inset.left, bottom: inset.bottom, trailing: inset.right)
79
+ )
80
+ }
81
+
82
+ static func make(size: CGSize, insets: EdgeInsets, isPhone: Bool = isPhoneIdiom) -> ScreenLayout {
83
+ let width = size.width
84
+ let height = size.height
85
+ let (headerHeight, headerStatusBarHeight) = headerGeometry(topInset: insets.top, isPhone: isPhone)
86
+ let isDuo = isPhone && isIPhoneDuoWindow(width: width, height: height, insets: insets)
87
+ guard isDuo else {
88
+ return ScreenLayout(
89
+ width: width, height: height, isIPhoneDuo: false, insets: insets,
90
+ insetLeft: 0, insetRight: 0, contentWidth: width,
91
+ headerHeight: headerHeight, headerStatusBarHeight: headerStatusBarHeight, sideBar: nil
92
+ )
93
+ }
94
+
95
+ var sideBar: SideBarLayout?
96
+ let sideInset = max(insets.leading, insets.trailing)
97
+ // narrower strips cannot host a control 12pt from the inner edge
98
+ if sideInset >= DuoMetrics.controlSize + Spacing.M {
99
+ var top = insets.top + HeaderMetrics.barHeight + Spacing.M
100
+ if insets.top < HeaderMetrics.statusBarMinInset {
101
+ // status bar lives in the strip: start under its cluster, as the native bar does
102
+ let isInnerLandscape = width > height && height >= DuoMetrics.innerMinHeight
103
+ top = isInnerLandscape ? DuoMetrics.firstItemTopLandscape : DuoMetrics.firstItemTop
104
+ }
105
+ sideBar = SideBarLayout(
106
+ edge: insets.trailing >= insets.leading ? .right : .left,
107
+ width: sideInset,
108
+ top: top
109
+ )
110
+ }
111
+
112
+ return ScreenLayout(
113
+ width: width, height: height, isIPhoneDuo: true, insets: insets,
114
+ insetLeft: insets.leading, insetRight: insets.trailing,
115
+ contentWidth: width - insets.leading - insets.trailing,
116
+ headerHeight: headerHeight, headerStatusBarHeight: headerStatusBarHeight, sideBar: sideBar
117
+ )
118
+ }
119
+
120
+ private static func headerGeometry(topInset: CGFloat, isPhone: Bool) -> (CGFloat, CGFloat) {
121
+ let height = topInset + HeaderMetrics.barHeight
122
+ guard isPhone else { return (height, topInset) }
123
+ return (
124
+ max(height, HeaderMetrics.iPhoneMinHeight),
125
+ topInset < HeaderMetrics.statusBarMinInset ? 0 : topInset
126
+ )
127
+ }
128
+
129
+ // Slab iPhones report equal side insets in landscape; iPhone Duo moves the status bar to one side.
130
+ private static func isIPhoneDuoWindow(width: CGFloat, height: CGFloat, insets: EdgeInsets) -> Bool {
131
+ let shortSide = min(width, height)
132
+ let isSquare = shortSide > 0 && max(width, height) / shortSide < DuoMetrics.maxAspectRatio
133
+ return isSquare || insets.leading != insets.trailing
134
+ }
135
+
136
+ /// Below the side status bar: in portrait it is about twice as tall as its inset is wide.
137
+ public var duoTopInset: CGFloat {
138
+ max(insets.top, height > width ? max(insets.leading, insets.trailing) * 2 : 0)
139
+ }
140
+ }
141
+
142
+ /// Port of RN `device.ts` `isIPhoneDuo()`: UIScreen stays on the outer display, so this
143
+ /// still matches when Split View narrows the window. Used by popups and overlays.
144
+ public func isIPhoneDuoDevice(windowSize: CGSize? = nil) -> Bool {
145
+ guard isPhoneIdiom else { return false }
146
+ let screen = UIScreen.main.bounds.size
147
+ let window = windowSize ?? keyWindow?.bounds.size ?? screen
148
+ return max(min(screen.width, screen.height), min(window.width, window.height)) > DuoMetrics.iPhoneMaxShortSide
149
+ }
150
+
151
+ // MARK: - Environment
152
+
153
+ private struct ScreenLayoutKey: EnvironmentKey {
154
+ // Computed so an un-injected subtree (bare UIHostingController) still reads the live window.
155
+ static var defaultValue: ScreenLayout { .current }
156
+ }
157
+
158
+ public extension EnvironmentValues {
159
+ var screenLayout: ScreenLayout {
160
+ get { self[ScreenLayoutKey.self] }
161
+ set { self[ScreenLayoutKey.self] = newValue }
162
+ }
163
+ }
164
+
165
+ /// Re-reads the window whenever this view's size changes (rotation, fold/unfold, Split View).
166
+ private struct ScreenLayoutReader: ViewModifier {
167
+ @State private var layout: ScreenLayout = .current
168
+
169
+ func body(content: Content) -> some View {
170
+ content
171
+ .environment(\.screenLayout, layout)
172
+ .background(
173
+ GeometryReader { proxy in
174
+ Color.clear
175
+ .onAppear { refresh() }
176
+ .onChange(of: proxy.size) { _ in refresh() }
177
+ .onChange(of: proxy.safeAreaInsets) { _ in refresh() }
178
+ }
179
+ )
180
+ .onReceive(NotificationCenter.default.publisher(for: UIDevice.orientationDidChangeNotification)) { _ in
181
+ refresh()
182
+ }
183
+ }
184
+
185
+ private func refresh() {
186
+ let next = ScreenLayout.current
187
+ if next != layout { layout = next }
188
+ }
189
+ }
190
+
191
+ public extension View {
192
+ /// Provides `\.screenLayout`; NavigationContainer applies it, a bare UIHostingController root should too.
193
+ func momoScreenLayout() -> some View {
194
+ modifier(ScreenLayoutReader())
195
+ }
196
+ }
@@ -16,6 +16,7 @@ public struct BottomTab: View {
16
16
  private let floatingButton: BottomTabFloatingButton?
17
17
 
18
18
  @EnvironmentObject private var navigator: Navigator
19
+ @Environment(\.screenLayout) private var layout
19
20
  @State private var selectedIndex: Int = 0
20
21
 
21
22
  public init(items: [BottomTabItem], floatingButton: BottomTabFloatingButton? = nil) {
@@ -24,7 +25,14 @@ public struct BottomTab: View {
24
25
  }
25
26
 
26
27
  private var bottomInset: CGFloat { safeAreaBottomInset() }
27
- private var reservedBottom: CGFloat { BOTTOM_TAB_BAR_HEIGHT + bottomInset + Spacing.S }
28
+ // the Duo bars overlay the content or sit in the side strip, so only the home indicator is kept clear
29
+ private var reservedBottom: CGFloat {
30
+ layout.isIPhoneDuo ? layout.insets.bottom : BOTTOM_TAB_BAR_HEIGHT + bottomInset + Spacing.S
31
+ }
32
+
33
+ private var duoInsets: DuoTabBarInsets {
34
+ layout.duoTabBarInsets(itemCount: items.count, hasFloatingButton: floatingButton != nil)
35
+ }
28
36
 
29
37
  public var body: some View {
30
38
  ZStack(alignment: .bottom) {
@@ -38,20 +46,29 @@ public struct BottomTab: View {
38
46
  }
39
47
  }
40
48
  .padding(.bottom, reservedBottom)
49
+ .environment(\.duoTabBarInsets, duoInsets)
41
50
  .animation(.easeInOut(duration: 0.2), value: selectedIndex)
42
51
 
43
- // Tab bar + home-indicator filler.
44
- VStack(spacing: 0) {
45
- BottomTabBar(
52
+ if layout.isIPhoneDuo {
53
+ DuoTabBar(
46
54
  items: items,
47
55
  floatingButton: floatingButton,
48
56
  selectedIndex: selectedIndex,
49
- onTabSelected: { index in
50
- if index != selectedIndex { selectedIndex = index }
51
- }
57
+ onTabSelected: selectTab
52
58
  )
53
- Colors.black01
54
- .frame(height: bottomInset + Spacing.S)
59
+ } else {
60
+ // Tab bar + home-indicator filler.
61
+ VStack(spacing: 0) {
62
+ BottomTabBar(
63
+ items: items,
64
+ floatingButton: floatingButton,
65
+ selectedIndex: selectedIndex,
66
+ onTabSelected: selectTab
67
+ )
68
+ Colors.black01
69
+ .frame(height: bottomInset + Spacing.S)
70
+ .ignoresSafeArea(edges: .horizontal)
71
+ }
55
72
  }
56
73
  }
57
74
  .frame(maxWidth: .infinity, maxHeight: .infinity)
@@ -59,6 +76,10 @@ public struct BottomTab: View {
59
76
  .preference(key: IsBottomTabRootKey.self, value: true)
60
77
  }
61
78
 
79
+ private func selectTab(_ index: Int) {
80
+ if index != selectedIndex { selectedIndex = index }
81
+ }
82
+
62
83
  @ViewBuilder
63
84
  private func tabScreen(for index: Int) -> some View {
64
85
  let item = items[index]
@@ -65,7 +65,10 @@ struct BottomTabBar: View {
65
65
  let selectedIndex: Int
66
66
  let onTabSelected: (Int) -> Void
67
67
 
68
- private var screenWidth: CGFloat { UIScreen.main.bounds.width }
68
+ @Environment(\.screenLayout) private var layout
69
+
70
+ // the bar sits between the side safe areas
71
+ private var screenWidth: CGFloat { layout.width - layout.insets.leading - layout.insets.trailing }
69
72
  private var mid: Int { items.count / 2 }
70
73
 
71
74
  private var tabWidth: CGFloat {
@@ -95,7 +98,7 @@ struct BottomTabBar: View {
95
98
  }
96
99
  .frame(maxWidth: .infinity)
97
100
  .frame(height: BOTTOM_TAB_BAR_HEIGHT)
98
- .background(Colors.black01)
101
+ .background(Colors.black01.ignoresSafeArea(edges: .horizontal))
99
102
 
100
103
  // Animated selection indicator.
101
104
  RoundedRectangle(cornerRadius: 2)