@expo/ui 57.0.12 → 57.0.14
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/CHANGELOG.md +33 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +17 -3
- package/android/src/main/java/expo/modules/ui/ModalBottomSheetView.kt +50 -0
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +31 -0
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +141 -11
- package/build/PresentedContentContext.d.ts +18 -0
- package/build/PresentedContentContext.d.ts.map +1 -0
- package/build/community/pager-view/PagerView.android.d.ts.map +1 -1
- package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
- package/build/jetpack-compose/BasicAlertDialog/index.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -1
- package/build/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.d.ts.map +1 -1
- package/build/jetpack-compose/Host/index.d.ts +3 -0
- package/build/jetpack-compose/Host/index.d.ts.map +1 -1
- package/build/jetpack-compose/ModalBottomSheet/index.d.ts.map +1 -1
- package/build/jetpack-compose/Progress/index.d.ts +25 -2
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/RNHostView/index.d.ts +0 -6
- package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -1
- package/build/jetpack-compose/TextField/shared.d.ts +2 -1
- package/build/jetpack-compose/TextField/shared.d.ts.map +1 -1
- package/build/jetpack-compose/Tooltip/index.d.ts.map +1 -1
- package/build/keyboard/index.d.ts +43 -0
- package/build/keyboard/index.d.ts.map +1 -0
- package/build/keyboard/interop.d.ts +16 -0
- package/build/keyboard/interop.d.ts.map +1 -0
- package/build/keyboard/textInputState.d.ts +2 -0
- package/build/keyboard/textInputState.d.ts.map +1 -0
- package/build/keyboard/textInputState.web.d.ts +11 -0
- package/build/keyboard/textInputState.web.d.ts.map +1 -0
- package/build/swift-ui/Background/index.d.ts +18 -0
- package/build/swift-ui/Background/index.d.ts.map +1 -0
- package/build/swift-ui/BottomSheet/index.d.ts.map +1 -1
- package/build/swift-ui/Host/index.d.ts +3 -0
- package/build/swift-ui/Host/index.d.ts.map +1 -1
- package/build/swift-ui/Popover/index.d.ts.map +1 -1
- package/build/swift-ui/RNHostView.d.ts +2 -1
- package/build/swift-ui/RNHostView.d.ts.map +1 -1
- package/build/swift-ui/SecureField/index.d.ts.map +1 -1
- package/build/swift-ui/TextField/index.d.ts.map +1 -1
- package/build/swift-ui/index.d.ts +1 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +21 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.android.d.ts +1 -1
- package/build/universal/BottomSheet/index.android.d.ts.map +1 -1
- package/build/universal/BottomSheet/types.d.ts +14 -0
- package/build/universal/BottomSheet/types.d.ts.map +1 -1
- package/build/utils/useMergeRefs.d.ts +12 -0
- package/build/utils/useMergeRefs.d.ts.map +1 -0
- package/expo-module.config.json +1 -1
- package/ios/BackgroundView.swift +34 -0
- package/ios/ColorPickerView.swift +1 -1
- package/ios/ExpoUIModule.swift +4 -0
- package/ios/HostView.swift +7 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +48 -0
- package/ios/RNHostView.swift +65 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.12/expo.modules.ui-57.0.12-sources.jar → 57.0.14/expo.modules.ui-57.0.14-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.12/expo.modules.ui-57.0.12.module → 57.0.14/expo.modules.ui-57.0.14.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.12/expo.modules.ui-57.0.12.pom → 57.0.14/expo.modules.ui-57.0.14.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +4 -4
- package/src/PresentedContentContext.tsx +22 -0
- package/src/community/pager-view/PagerView.android.tsx +1 -7
- package/src/jetpack-compose/AlertDialog/index.tsx +6 -1
- package/src/jetpack-compose/BasicAlertDialog/index.tsx +7 -1
- package/src/jetpack-compose/DropdownMenu/index.tsx +7 -1
- package/src/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.tsx +3 -1
- package/src/jetpack-compose/Host/index.tsx +28 -17
- package/src/jetpack-compose/ModalBottomSheet/index.tsx +8 -1
- package/src/jetpack-compose/Progress/index.tsx +32 -2
- package/src/jetpack-compose/RNHostView/index.tsx +16 -13
- package/src/jetpack-compose/TextField/shared.ts +7 -1
- package/src/jetpack-compose/Tooltip/index.tsx +2 -1
- package/src/keyboard/index.tsx +243 -0
- package/src/keyboard/interop.ts +99 -0
- package/src/keyboard/textInputState.ts +2 -0
- package/src/keyboard/textInputState.web.ts +16 -0
- package/src/swift-ui/Background/index.tsx +38 -0
- package/src/swift-ui/BottomSheet/index.tsx +4 -1
- package/src/swift-ui/Host/index.tsx +33 -18
- package/src/swift-ui/Popover/index.tsx +7 -1
- package/src/swift-ui/RNHostView.tsx +17 -3
- package/src/swift-ui/SecureField/index.tsx +8 -2
- package/src/swift-ui/TextField/index.tsx +8 -1
- package/src/swift-ui/index.tsx +1 -0
- package/src/swift-ui/modifiers/index.ts +25 -0
- package/src/ts-declarations/react-native-text-input-state.d.ts +26 -0
- package/src/universal/BottomSheet/index.android.tsx +4 -1
- package/src/universal/BottomSheet/types.ts +17 -0
- package/src/utils/useMergeRefs.ts +47 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,39 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 57.0.14 — 2026-08-26
|
|
14
|
+
|
|
15
|
+
### 🛠 Breaking changes
|
|
16
|
+
|
|
17
|
+
- [Android] Removed the `style` prop from `RNHostView`. It set a React Native style on a view that Jetpack Compose positions and sizes; use `modifiers` instead. Hosted views are now measured where Compose drew them, so a style is no longer needed to keep `measure()` and the drawn position in agreement. ([#48970](https://github.com/expo/expo/pull/48970) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
18
|
+
|
|
19
|
+
### 🎉 New features
|
|
20
|
+
|
|
21
|
+
- [iOS] Added the `Background` component, which draws any view behind another view with an optional `alignment`, matching SwiftUI's `background(alignment:content:)`. ([#48904](https://github.com/expo/expo/pull/48904) by [@Den1Marshall](https://github.com/Den1Marshall))
|
|
22
|
+
- [android] Added the `amplitude`, `wavelength` and `waveSpeed` props to `LinearWavyProgressIndicator` and `CircularWavyProgressIndicator`, so the Material 3 wave can be configured instead of always using the Compose defaults. ([#49265](https://github.com/expo/expo/pull/49265) by [@felipe-software](https://github.com/felipe-software))
|
|
23
|
+
|
|
24
|
+
### 🐛 Bug fixes
|
|
25
|
+
|
|
26
|
+
- [iOS] Fixed a crash when a focused `TextField` or `SecureField` is unmounted inside a list row that is being removed, for example closing a modal with the keyboard up on a field nested in `SwipeActions`. Hosted text inputs now blur before React removes their native views. ([#49348](https://github.com/expo/expo/issues/49348) by [@nishan](https://github.com/intergalacticspacehighway)) ([#49357](https://github.com/expo/expo/pull/49357) by [@expo-tuft[bot]](https://github.com/apps/expo-tuft))
|
|
27
|
+
- Fixed the keyboard staying open when tapping outside a text field hosted by `<Host>`. A parent `ScrollView`'s tap-to-dismiss, its `keyboardShouldPersistTaps` setting, and `Keyboard.dismiss()` now reach hosted text fields. React Native treats the whole `<Host>` as the input, so a tap on other content inside the same host still keeps the keyboard open. ([#48788](https://github.com/expo/expo/pull/48788) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
28
|
+
- [iOS] Fix a hosted `Pressable` dropping its press when the finger moves, by measuring hosted React Native views where SwiftUI placed them. ([#48969](https://github.com/expo/expo/pull/48969) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
29
|
+
- [iOS] Fix hosted React Native views receiving no touches inside a `BottomSheet` or `Popover`. ([#48969](https://github.com/expo/expo/pull/48969) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
30
|
+
- [Android] Fix touch handling for hosted React Native views: a `Pressable` dropped its press when the finger moved, hosted content stole gestures from enclosing scrollables, a back gesture was reported as a long press, a press fired after a Jetpack Compose pager or scrollable had already claimed the gesture, and content inside `AlertDialog`, `DropdownMenu`, `ExposedDropdownMenu` and `TooltipBox` received no touches at all. Hosted views are now measured where Jetpack Compose placed them, and dispatch their own touches only when presented in their own window. ([#48970](https://github.com/expo/expo/pull/48970) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
31
|
+
- [Android] Fix a hosted `Pressable` in a `PagerView` ignoring presses on pages after the first, where a re-parented host kept the bounds of the holder it left and answered for a screen area it no longer occupied. ([#46386](https://github.com/expo/expo/issues/46386) by [@TomCorvus](https://github.com/TomCorvus)) ([#48970](https://github.com/expo/expo/pull/48970) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
32
|
+
- [iOS] Fix `ColorPicker` reporting every color one value too low, because `colorToHex` truncated instead of rounding. Apps feed the reported value back into `selection`, so the error compounded and each interaction moved all three channels down by one. ([#49356](https://github.com/expo/expo/pull/49356) by [@batuhandemir98](https://github.com/batuhandemir98))
|
|
33
|
+
|
|
34
|
+
## 57.0.13 — 2026-08-24
|
|
35
|
+
|
|
36
|
+
### 🎉 New features
|
|
37
|
+
|
|
38
|
+
- [iOS] Added the `alignmentGuide` modifier, so the `listRowSeparatorLeading` guide can set where a list row separator starts. ([#49246](https://github.com/expo/expo/issues/49246) by [@marco242424](https://github.com/marco242424)) ([#49247](https://github.com/expo/expo/pull/49247) by [@expo-bot](https://github.com/expo-bot))
|
|
39
|
+
- [android] Add `shouldDismissOnClickOutside` and `scrimColor` props to the universal `BottomSheet` component, forwarding them to `ModalBottomSheet` via `properties.shouldDismissOnClickOutside` and `scrimColor`. ([#48986](https://github.com/expo/expo/pull/48986) by [@webdevsamran](https://github.com/webdevsamran))
|
|
40
|
+
|
|
41
|
+
### 🐛 Bug fixes
|
|
42
|
+
|
|
43
|
+
- [Android] Fix the dev menu not opening with the menu key (Cmd+M) while a `BottomSheet` is open. Material3 shows the sheet in its own dialog window, so key events did not reach the activity. The sheet now forwards them, as React Native's `Modal` does, unless a view in the sheet is accepting text. ([#49215](https://github.com/expo/expo/pull/49215) by [@expo-bot](https://github.com/expo-bot))
|
|
44
|
+
- [iOS] Fix an empty `RNHostView` (e.g. one hosting a hidden RN `Modal`, which renders null until `visible` is true) taking up space in SwiftUI containers — such as a spurious empty row in a `FieldGroup`/`Form` section that shifts the other components. It now renders nothing until a child is mounted, which also lets the touch handler attach when the child mounts after the host appeared. ([#48666](https://github.com/expo/expo/issues/48666) by [@lochnessopensource](https://github.com/lochnessopensource)) ([#48735](https://github.com/expo/expo/pull/48735) by [@brentvatne](https://github.com/brentvatne))
|
|
45
|
+
|
|
13
46
|
## 57.0.12 — 2026-08-20
|
|
14
47
|
|
|
15
48
|
### 🎉 New features
|
package/android/build.gradle
CHANGED
|
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
|
|
|
12
12
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
13
13
|
|
|
14
14
|
group = 'expo.modules.ui'
|
|
15
|
-
version = '57.0.
|
|
15
|
+
version = '57.0.14'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "57.0.
|
|
21
|
+
versionName "57.0.14"
|
|
22
22
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
23
23
|
}
|
|
24
24
|
buildFeatures {
|
|
@@ -35,6 +35,7 @@ import expo.modules.ui.menu.DropdownMenuContent
|
|
|
35
35
|
import expo.modules.ui.menu.DropdownMenuProps
|
|
36
36
|
import expo.modules.ui.menu.DropdownMenuItemContent
|
|
37
37
|
import expo.modules.ui.menu.DropdownMenuItemProps
|
|
38
|
+
import expo.modules.kotlin.jni.fabric.NativeStatePropsGetter
|
|
38
39
|
import expo.modules.kotlin.jni.worklets.Worklet
|
|
39
40
|
import expo.modules.ui.state.ObservableState
|
|
40
41
|
import expo.modules.ui.state.WorkletCallback
|
|
@@ -72,6 +73,11 @@ class ExpoUIModule : Module() {
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
OnDestroy {
|
|
76
|
+
// `RNHostView` publishes its content origin into a process-global registry keyed by view tag.
|
|
77
|
+
// Tags restart in the next app context, so an entry whose view was never torn down would be
|
|
78
|
+
// read by an unrelated view after a reload.
|
|
79
|
+
NativeStatePropsGetter().clearAllContentOrigins()
|
|
80
|
+
|
|
75
81
|
imageLoader?.close()
|
|
76
82
|
imageLoader = null
|
|
77
83
|
okHttpClient?.dispatcher?.executorService?.shutdown()
|
|
@@ -173,9 +179,17 @@ class ExpoUIModule : Module() {
|
|
|
173
179
|
}
|
|
174
180
|
|
|
175
181
|
View(RNHostView::class) {
|
|
176
|
-
//
|
|
177
|
-
// `RootNodeKind` trait
|
|
178
|
-
|
|
182
|
+
// Also consumed by `ExpoViewShadowNode` in C++, which marks the shadow node with the
|
|
183
|
+
// `RootNodeKind` trait so `measure()` reports positions relative to this view. Kotlin reads
|
|
184
|
+
// the same prop to decide whether this view dispatches its subtree's touches, so the
|
|
185
|
+
// position in `measure()` and the dispatcher can never disagree.
|
|
186
|
+
Prop("layoutRoot") { view: RNHostView, layoutRoot: Boolean ->
|
|
187
|
+
view.setLayoutRoot(layoutRoot)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
OnViewDestroys { view: RNHostView ->
|
|
191
|
+
view.clearPublishedContentOrigin()
|
|
192
|
+
}
|
|
179
193
|
}
|
|
180
194
|
|
|
181
195
|
View(SlotView::class) {
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
package expo.modules.ui
|
|
4
4
|
|
|
5
|
+
import android.app.Activity
|
|
6
|
+
import android.app.Dialog
|
|
7
|
+
import android.content.Context
|
|
5
8
|
import android.graphics.Color
|
|
9
|
+
import android.view.KeyEvent
|
|
10
|
+
import android.view.inputmethod.InputMethodManager
|
|
6
11
|
import androidx.compose.material3.BottomSheetDefaults
|
|
7
12
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
8
13
|
import androidx.compose.material3.ModalBottomSheet
|
|
@@ -10,8 +15,11 @@ import androidx.compose.material3.ModalBottomSheetProperties
|
|
|
10
15
|
import androidx.compose.material3.contentColorFor
|
|
11
16
|
import androidx.compose.material3.rememberModalBottomSheetState
|
|
12
17
|
import androidx.compose.runtime.Composable
|
|
18
|
+
import androidx.compose.runtime.DisposableEffect
|
|
13
19
|
import androidx.compose.runtime.LaunchedEffect
|
|
14
20
|
import androidx.compose.runtime.rememberCoroutineScope
|
|
21
|
+
import androidx.compose.ui.platform.LocalView
|
|
22
|
+
import androidx.compose.ui.window.DialogWindowProvider
|
|
15
23
|
import expo.modules.kotlin.records.Field
|
|
16
24
|
import expo.modules.kotlin.records.Record
|
|
17
25
|
import expo.modules.kotlin.types.OptimizedRecord
|
|
@@ -41,6 +49,47 @@ data class ModalBottomSheetViewProps(
|
|
|
41
49
|
val modifiers: ModifierList = emptyList()
|
|
42
50
|
) : ComposeProps
|
|
43
51
|
|
|
52
|
+
/**
|
|
53
|
+
* True while the input method has an active connection to a view that accepts text, for example a
|
|
54
|
+
* focused TextInput. `expo-dev-menu` makes the same check in `DevMenuFragment.onKeyUp`.
|
|
55
|
+
*/
|
|
56
|
+
private fun Activity.isAcceptingText(): Boolean {
|
|
57
|
+
val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager
|
|
58
|
+
return inputMethodManager?.isAcceptingText == true
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Material3 shows [ModalBottomSheet] in its own dialog window. Android sends key events to the
|
|
63
|
+
* focused window, so the activity does not get them while the sheet is open. Key triggers that
|
|
64
|
+
* the activity owns then stop working, for example KEYCODE_MENU, which opens the dev menu.
|
|
65
|
+
* React Native's own Modal sends every other key up to the activity for this reason. Do the same.
|
|
66
|
+
*
|
|
67
|
+
* Do not forward while a view in the sheet accepts text. React Native turns a double press of R
|
|
68
|
+
* into a reload and only skips it when `Activity.getCurrentFocus()` is an EditText. That focus
|
|
69
|
+
* belongs to the activity window, so it never sees a TextInput in the sheet's own dialog window.
|
|
70
|
+
* Without this check, typing "rr" in a sheet TextInput reloads the app.
|
|
71
|
+
*/
|
|
72
|
+
@Composable
|
|
73
|
+
private fun ForwardKeyEventsToActivity(activity: Activity?) {
|
|
74
|
+
val dialog = (LocalView.current.parent as? DialogWindowProvider)?.window?.callback as? Dialog
|
|
75
|
+
if (dialog == null || activity == null) {
|
|
76
|
+
return
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
DisposableEffect(dialog, activity) {
|
|
80
|
+
dialog.setOnKeyListener { _, keyCode, event ->
|
|
81
|
+
val isForwardable = event.action == KeyEvent.ACTION_UP &&
|
|
82
|
+
keyCode != KeyEvent.KEYCODE_BACK &&
|
|
83
|
+
keyCode != KeyEvent.KEYCODE_ESCAPE &&
|
|
84
|
+
!activity.isAcceptingText()
|
|
85
|
+
isForwardable && activity.onKeyUp(keyCode, event)
|
|
86
|
+
}
|
|
87
|
+
onDispose {
|
|
88
|
+
dialog.setOnKeyListener(null)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
44
93
|
@Composable
|
|
45
94
|
fun FunctionalComposableScope.ModalBottomSheetContent(
|
|
46
95
|
props: ModalBottomSheetViewProps,
|
|
@@ -112,6 +161,7 @@ fun FunctionalComposableScope.ModalBottomSheetContent(
|
|
|
112
161
|
),
|
|
113
162
|
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
114
163
|
) {
|
|
164
|
+
ForwardKeyEventsToActivity(appContext.currentActivity)
|
|
115
165
|
Children(UIComposableScope(), filter = { !isSlotView(it) })
|
|
116
166
|
}
|
|
117
167
|
|
|
@@ -150,6 +150,9 @@ data class LinearWavyProgressIndicatorProps(
|
|
|
150
150
|
val color: Color? = null,
|
|
151
151
|
val trackColor: Color? = null,
|
|
152
152
|
val stopSize: Float? = null,
|
|
153
|
+
val amplitude: Float? = null,
|
|
154
|
+
val wavelength: Float? = null,
|
|
155
|
+
val waveSpeed: Float? = null,
|
|
153
156
|
val modifiers: ModifierList = emptyList()
|
|
154
157
|
) : ComposeProps
|
|
155
158
|
|
|
@@ -161,17 +164,27 @@ fun FunctionalComposableScope.LinearWavyProgressIndicatorContent(props: LinearWa
|
|
|
161
164
|
val stopSize = props.stopSize?.dp ?: WavyProgressIndicatorDefaults.LinearTrackStopIndicatorSize
|
|
162
165
|
|
|
163
166
|
if (props.progress != null) {
|
|
167
|
+
val wavelength = props.wavelength?.dp ?: WavyProgressIndicatorDefaults.LinearDeterminateWavelength
|
|
168
|
+
|
|
164
169
|
LinearWavyProgressIndicator(
|
|
165
170
|
progress = { props.progress },
|
|
166
171
|
color = color,
|
|
167
172
|
trackColor = trackColor,
|
|
168
173
|
stopSize = stopSize,
|
|
174
|
+
amplitude = props.amplitude.toAmplitude(),
|
|
175
|
+
wavelength = wavelength,
|
|
176
|
+
waveSpeed = props.waveSpeed?.dp ?: wavelength,
|
|
169
177
|
modifier = modifier
|
|
170
178
|
)
|
|
171
179
|
} else {
|
|
180
|
+
val wavelength = props.wavelength?.dp ?: WavyProgressIndicatorDefaults.LinearIndeterminateWavelength
|
|
181
|
+
|
|
172
182
|
LinearWavyProgressIndicator(
|
|
173
183
|
color = color,
|
|
174
184
|
trackColor = trackColor,
|
|
185
|
+
amplitude = props.amplitude ?: IndeterminateAmplitude,
|
|
186
|
+
wavelength = wavelength,
|
|
187
|
+
waveSpeed = props.waveSpeed?.dp ?: wavelength,
|
|
175
188
|
modifier = modifier
|
|
176
189
|
)
|
|
177
190
|
}
|
|
@@ -186,6 +199,9 @@ data class CircularWavyProgressIndicatorProps(
|
|
|
186
199
|
val progress: Float? = null,
|
|
187
200
|
val color: Color? = null,
|
|
188
201
|
val trackColor: Color? = null,
|
|
202
|
+
val amplitude: Float? = null,
|
|
203
|
+
val wavelength: Float? = null,
|
|
204
|
+
val waveSpeed: Float? = null,
|
|
189
205
|
val modifiers: ModifierList = emptyList()
|
|
190
206
|
) : ComposeProps
|
|
191
207
|
|
|
@@ -193,6 +209,8 @@ data class CircularWavyProgressIndicatorProps(
|
|
|
193
209
|
fun FunctionalComposableScope.CircularWavyProgressIndicatorContent(props: CircularWavyProgressIndicatorProps) {
|
|
194
210
|
val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
195
211
|
val color = props.color.composeOrNull ?: ProgressIndicatorDefaults.circularColor
|
|
212
|
+
val wavelength = props.wavelength?.dp ?: WavyProgressIndicatorDefaults.CircularWavelength
|
|
213
|
+
val waveSpeed = props.waveSpeed?.dp ?: wavelength
|
|
196
214
|
|
|
197
215
|
if (props.progress != null) {
|
|
198
216
|
val trackColor = props.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularDeterminateTrackColor
|
|
@@ -201,6 +219,9 @@ fun FunctionalComposableScope.CircularWavyProgressIndicatorContent(props: Circul
|
|
|
201
219
|
progress = { props.progress },
|
|
202
220
|
color = color,
|
|
203
221
|
trackColor = trackColor,
|
|
222
|
+
amplitude = props.amplitude.toAmplitude(),
|
|
223
|
+
wavelength = wavelength,
|
|
224
|
+
waveSpeed = waveSpeed,
|
|
204
225
|
modifier = modifier
|
|
205
226
|
)
|
|
206
227
|
} else {
|
|
@@ -209,6 +230,9 @@ fun FunctionalComposableScope.CircularWavyProgressIndicatorContent(props: Circul
|
|
|
209
230
|
CircularWavyProgressIndicator(
|
|
210
231
|
color = color,
|
|
211
232
|
trackColor = trackColor,
|
|
233
|
+
amplitude = props.amplitude ?: IndeterminateAmplitude,
|
|
234
|
+
wavelength = wavelength,
|
|
235
|
+
waveSpeed = waveSpeed,
|
|
212
236
|
modifier = modifier
|
|
213
237
|
)
|
|
214
238
|
}
|
|
@@ -218,6 +242,13 @@ fun FunctionalComposableScope.CircularWavyProgressIndicatorContent(props: Circul
|
|
|
218
242
|
|
|
219
243
|
// Utility
|
|
220
244
|
|
|
245
|
+
private const val IndeterminateAmplitude = 1f
|
|
246
|
+
|
|
247
|
+
private fun Float?.toAmplitude(): (Float) -> Float {
|
|
248
|
+
val amplitude = this ?: return WavyProgressIndicatorDefaults.indicatorAmplitude
|
|
249
|
+
return { amplitude }
|
|
250
|
+
}
|
|
251
|
+
|
|
221
252
|
private fun String?.toStrokeCap(): StrokeCap? {
|
|
222
253
|
return when (this?.lowercase()) {
|
|
223
254
|
"round" -> StrokeCap.Round
|
|
@@ -14,7 +14,9 @@ import androidx.compose.runtime.Composable
|
|
|
14
14
|
import androidx.compose.runtime.MutableState
|
|
15
15
|
import androidx.compose.runtime.mutableStateOf
|
|
16
16
|
import androidx.compose.ui.Modifier
|
|
17
|
+
import androidx.compose.ui.layout.onGloballyPositioned
|
|
17
18
|
import androidx.compose.ui.layout.onSizeChanged
|
|
19
|
+
import androidx.compose.ui.layout.positionInRoot
|
|
18
20
|
import androidx.compose.ui.platform.LocalDensity
|
|
19
21
|
import androidx.compose.ui.unit.IntSize
|
|
20
22
|
import androidx.compose.ui.viewinterop.AndroidView
|
|
@@ -54,6 +56,31 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
54
56
|
private val childViewState = mutableStateOf<View?>(null)
|
|
55
57
|
private val wrapperState = mutableStateOf<TouchDispatchingRootViewGroup?>(null)
|
|
56
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Whether this view owns its subtree's touches. False everywhere except content presented in its
|
|
61
|
+
* own window, where no React root sits above us to dispatch.
|
|
62
|
+
*
|
|
63
|
+
* Snapshot state because `publishContentOriginModifier` reads it during composition, and the prop
|
|
64
|
+
* can arrive after the first composition. A plain field would leave that composition publishing an
|
|
65
|
+
* origin from a coordinate space this view no longer measures from.
|
|
66
|
+
*/
|
|
67
|
+
private val layoutRootState = mutableStateOf(false)
|
|
68
|
+
private val layoutRoot: Boolean
|
|
69
|
+
get() = layoutRootState.value
|
|
70
|
+
|
|
71
|
+
private var lastContentOriginX = Double.NaN
|
|
72
|
+
private var lastContentOriginY = Double.NaN
|
|
73
|
+
|
|
74
|
+
internal fun setLayoutRoot(value: Boolean) {
|
|
75
|
+
val changed = layoutRootState.value != value
|
|
76
|
+
layoutRootState.value = value
|
|
77
|
+
wrapperState.value?.dispatchesTouchesToJS = value
|
|
78
|
+
if (changed && value) {
|
|
79
|
+
// As a layout root this view stops publishing an origin, so drop the one it already published.
|
|
80
|
+
clearPublishedContentOrigin()
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
57
84
|
private val childSizeState = mutableStateOf(IntSize.Zero)
|
|
58
85
|
private val childLayoutListener = View.OnLayoutChangeListener { _, l, t, r, b, _, _, _, _ ->
|
|
59
86
|
childSizeState.value = IntSize(r - l, b - t)
|
|
@@ -68,6 +95,7 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
68
95
|
}
|
|
69
96
|
child.addOnLayoutChangeListener(childLayoutListener)
|
|
70
97
|
val wrapper = TouchDispatchingRootViewGroup(child.context).apply {
|
|
98
|
+
dispatchesTouchesToJS = layoutRoot
|
|
71
99
|
val reactContext = child.context as? ReactContext
|
|
72
100
|
if (reactContext != null) {
|
|
73
101
|
eventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(reactContext, child.id)
|
|
@@ -83,6 +111,7 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
83
111
|
if (view == childViewState.value) {
|
|
84
112
|
view.removeOnLayoutChangeListener(childLayoutListener)
|
|
85
113
|
wrapperState.value?.removeView(view)
|
|
114
|
+
clearPublishedContentOrigin()
|
|
86
115
|
childViewState.value = null
|
|
87
116
|
wrapperState.value = null
|
|
88
117
|
} else {
|
|
@@ -95,10 +124,22 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
95
124
|
child.removeOnLayoutChangeListener(childLayoutListener)
|
|
96
125
|
wrapperState.value?.removeView(child)
|
|
97
126
|
}
|
|
127
|
+
clearPublishedContentOrigin()
|
|
98
128
|
childViewState.value = null
|
|
99
129
|
wrapperState.value = null
|
|
100
130
|
}
|
|
101
131
|
|
|
132
|
+
/**
|
|
133
|
+
* The removal paths above do not run when React unmounts this view with its child still attached,
|
|
134
|
+
* so the module also calls this when the view is destroyed in OnViewDestroys. Without it the entry would stay in the
|
|
135
|
+
* process-global registry
|
|
136
|
+
*/
|
|
137
|
+
internal fun clearPublishedContentOrigin() {
|
|
138
|
+
lastContentOriginX = Double.NaN
|
|
139
|
+
lastContentOriginY = Double.NaN
|
|
140
|
+
shadowNodeProxy.clearContentOrigin()
|
|
141
|
+
}
|
|
142
|
+
|
|
102
143
|
@Composable
|
|
103
144
|
override fun ComposableScope.Content() {
|
|
104
145
|
val matchContents = props.matchContents.value ?: false
|
|
@@ -113,12 +154,15 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
113
154
|
.fillMaxSize()
|
|
114
155
|
.then(reportSizeToYogaNodeModifier())
|
|
115
156
|
}
|
|
157
|
+
// Origin last: a chain applies outside-in, so a caller `padding` or `offset` has to shift the
|
|
158
|
+
// content before it is read.
|
|
116
159
|
val modifiers = sizingModifier
|
|
117
160
|
.then(ModifierRegistry.applyModifiers(props.modifiers, appContext, scope, globalEventDispatcher))
|
|
161
|
+
.then(publishContentOriginModifier())
|
|
118
162
|
|
|
119
163
|
AndroidView(
|
|
120
164
|
factory = {
|
|
121
|
-
(wrapper
|
|
165
|
+
detachForReuse(wrapper)
|
|
122
166
|
wrapper
|
|
123
167
|
},
|
|
124
168
|
modifier = modifiers
|
|
@@ -144,6 +188,32 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
144
188
|
}
|
|
145
189
|
}
|
|
146
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Publishes where Compose placed this view inside its `Host`, which Yoga has no way to know:
|
|
193
|
+
* Yoga puts the box at the `Host`'s origin while Compose may draw it anywhere inside. Without
|
|
194
|
+
* this, `measure()` reports the Yoga box, this makes Pressable cancel its press when the finger moves.
|
|
195
|
+
*/
|
|
196
|
+
@Composable
|
|
197
|
+
private fun publishContentOriginModifier(): Modifier {
|
|
198
|
+
// When layoutRoot is true, we don't set content origin because view acts like root and measure uses the view's origin as the origin.
|
|
199
|
+
if (layoutRoot) {
|
|
200
|
+
return Modifier
|
|
201
|
+
}
|
|
202
|
+
val density = LocalDensity.current
|
|
203
|
+
return Modifier.onGloballyPositioned { coordinates ->
|
|
204
|
+
val position = coordinates.positionInRoot()
|
|
205
|
+
with(density) {
|
|
206
|
+
val x = position.x.toDp().value.toDouble()
|
|
207
|
+
val y = position.y.toDp().value.toDouble()
|
|
208
|
+
if (x != lastContentOriginX || y != lastContentOriginY) {
|
|
209
|
+
lastContentOriginX = x
|
|
210
|
+
lastContentOriginY = y
|
|
211
|
+
shadowNodeProxy.setContentOrigin(x, y)
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
147
217
|
// Sets Yoga node size from Compose view size
|
|
148
218
|
// Listens Compose view size changes and updates the Yoga node size
|
|
149
219
|
@Composable
|
|
@@ -160,6 +230,21 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
160
230
|
}
|
|
161
231
|
}
|
|
162
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Removes [wrapper] from the view that currently contains it, and clears its bounds.
|
|
235
|
+
*
|
|
236
|
+
* `AndroidView` hands back this same wrapper every time Compose rebuilds it, but Compose puts it
|
|
237
|
+
* inside a brand new container each time, so it has to leave the old one first. A removed view keeps
|
|
238
|
+
* the bounds that container gave it, and React Native finds touch targets by bounds — so until
|
|
239
|
+
* Compose lays the wrapper out again it would claim a screen area it no longer occupies and swallow
|
|
240
|
+
* presses meant for whatever is really there. Clearing the bounds keeps it out of the way.
|
|
241
|
+
* This causes https://github.com/expo/expo/issues/46386
|
|
242
|
+
*/
|
|
243
|
+
internal fun detachForReuse(wrapper: View) {
|
|
244
|
+
(wrapper.parent as? ViewGroup)?.removeView(wrapper)
|
|
245
|
+
wrapper.layout(0, 0, 0, 0)
|
|
246
|
+
}
|
|
247
|
+
|
|
163
248
|
/**
|
|
164
249
|
* A thin FrameLayout that intercepts touch events and dispatches them to JS via
|
|
165
250
|
* JSTouchDispatcher/JSPointerDispatcher, replicating the pattern from React Native's
|
|
@@ -190,6 +275,17 @@ private class TouchDispatchingRootViewGroup(
|
|
|
190
275
|
|
|
191
276
|
var eventDispatcher: EventDispatcher? = null
|
|
192
277
|
|
|
278
|
+
/**
|
|
279
|
+
* Whether this view streams its subtree's touches to JavaScript.
|
|
280
|
+
*
|
|
281
|
+
* When false, an ancestor React root is already streaming them, and dispatching a second time
|
|
282
|
+
* would produce two streams in two coordinate spaces — the ancestor's moves land outside the
|
|
283
|
+
* host-relative responder region and `Pressable` drops the press on the first movement. The
|
|
284
|
+
* nested-scroll cooperation below stays active either way; only the JavaScript dispatch and the
|
|
285
|
+
* ancestor suppression are conditional.
|
|
286
|
+
*/
|
|
287
|
+
var dispatchesTouchesToJS: Boolean = false
|
|
288
|
+
|
|
193
289
|
private val reactContext: ThemedReactContext
|
|
194
290
|
get() = context as ThemedReactContext
|
|
195
291
|
|
|
@@ -215,12 +311,26 @@ private class TouchDispatchingRootViewGroup(
|
|
|
215
311
|
}
|
|
216
312
|
|
|
217
313
|
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
|
314
|
+
if (ev.actionMasked == MotionEvent.ACTION_CANCEL && !dispatchesTouchesToJS) {
|
|
315
|
+
// Compose cancels this subtree when a gesture detector above it claims the gesture. The
|
|
316
|
+
// ancestor root, which dispatches this subtree's touches, keeps streaming moves, so a
|
|
317
|
+
// `Pressable` still fires on release. Tell it a native child took over.
|
|
318
|
+
//
|
|
319
|
+
// No child: the gesture is gone from here, so no end call follows, and naming one would leave
|
|
320
|
+
// the root's pointer dispatcher armed for good. Its pointer stream stays live as a result.
|
|
321
|
+
notifyAncestorRootViews { it.onChildStartedNativeGesture(null, ev) }
|
|
322
|
+
}
|
|
218
323
|
if (ev.actionMasked == MotionEvent.ACTION_DOWN) {
|
|
219
324
|
// Ancestor React roots (the surface root, outer hosts) also see this gesture and dispatch a
|
|
220
325
|
// duplicate JS touch stream in their own coordinate space. Their moves land outside the
|
|
221
326
|
// host-relative responder region and break `Pressable`. Tell them a native child owns the
|
|
222
327
|
// gesture, before dispatching our own start, so their stream ends ahead of it.
|
|
223
|
-
|
|
328
|
+
//
|
|
329
|
+
// Only when we are the one dispatching. Otherwise their stream is the only one there is, and
|
|
330
|
+
// suppressing it would leave this subtree with no touches at all.
|
|
331
|
+
if (dispatchesTouchesToJS) {
|
|
332
|
+
notifyAncestorRootViews { it.onChildStartedNativeGesture(this, ev) }
|
|
333
|
+
}
|
|
224
334
|
// dispatchTouchEvent is the true start of every gesture, so reset all per-gesture state here.
|
|
225
335
|
getLocationInWindow(gestureStartLocation)
|
|
226
336
|
trackingGestureOffset = true
|
|
@@ -247,7 +357,9 @@ private class TouchDispatchingRootViewGroup(
|
|
|
247
357
|
|
|
248
358
|
if (ev.actionMasked == MotionEvent.ACTION_UP || ev.actionMasked == MotionEvent.ACTION_CANCEL) {
|
|
249
359
|
trackingGestureOffset = false
|
|
250
|
-
|
|
360
|
+
if (dispatchesTouchesToJS) {
|
|
361
|
+
notifyAncestorRootViews { it.onChildEndedNativeGesture(this, ev) }
|
|
362
|
+
}
|
|
251
363
|
}
|
|
252
364
|
return handled
|
|
253
365
|
}
|
|
@@ -261,35 +373,49 @@ private class TouchDispatchingRootViewGroup(
|
|
|
261
373
|
}
|
|
262
374
|
|
|
263
375
|
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
376
|
+
if (dispatchesTouchesToJS) {
|
|
377
|
+
eventDispatcher?.let { dispatcher ->
|
|
378
|
+
jsTouchDispatcher.handleTouchEvent(event, dispatcher, reactContext)
|
|
379
|
+
jsPointerDispatcher?.handleMotionEvent(event, dispatcher, true)
|
|
380
|
+
}
|
|
267
381
|
}
|
|
268
382
|
return super.onInterceptTouchEvent(event)
|
|
269
383
|
}
|
|
270
384
|
|
|
271
385
|
@SuppressLint("ClickableViewAccessibility")
|
|
272
386
|
override fun onTouchEvent(event: MotionEvent): Boolean {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
387
|
+
if (dispatchesTouchesToJS) {
|
|
388
|
+
eventDispatcher?.let { dispatcher ->
|
|
389
|
+
jsTouchDispatcher.handleTouchEvent(event, dispatcher, reactContext)
|
|
390
|
+
jsPointerDispatcher?.handleMotionEvent(event, dispatcher, false)
|
|
391
|
+
}
|
|
276
392
|
}
|
|
277
393
|
super.onTouchEvent(event)
|
|
278
394
|
return true
|
|
279
395
|
}
|
|
280
396
|
|
|
281
397
|
override fun onInterceptHoverEvent(event: MotionEvent): Boolean {
|
|
282
|
-
|
|
398
|
+
if (dispatchesTouchesToJS) {
|
|
399
|
+
eventDispatcher?.let { jsPointerDispatcher?.handleMotionEvent(event, it, true) }
|
|
400
|
+
}
|
|
283
401
|
return super.onInterceptHoverEvent(event)
|
|
284
402
|
}
|
|
285
403
|
|
|
286
404
|
override fun onHoverEvent(event: MotionEvent): Boolean {
|
|
287
|
-
|
|
405
|
+
if (dispatchesTouchesToJS) {
|
|
406
|
+
eventDispatcher?.let { jsPointerDispatcher?.handleMotionEvent(event, it, false) }
|
|
407
|
+
}
|
|
288
408
|
return super.onHoverEvent(event)
|
|
289
409
|
}
|
|
290
410
|
|
|
291
411
|
@OptIn(UnstableReactNativeAPI::class)
|
|
292
412
|
override fun onChildStartedNativeGesture(childView: View?, ev: MotionEvent) {
|
|
413
|
+
if (!dispatchesTouchesToJS) {
|
|
414
|
+
// React Native notifies only the first RootView above the child, which is us. Relay it to the
|
|
415
|
+
// root that actually dispatches, or a Pressable inside a hosted scrollable fires after a scroll.
|
|
416
|
+
notifyAncestorRootViews { it.onChildStartedNativeGesture(childView, ev) }
|
|
417
|
+
return
|
|
418
|
+
}
|
|
293
419
|
eventDispatcher?.let { dispatcher ->
|
|
294
420
|
jsTouchDispatcher.onChildStartedNativeGesture(ev, dispatcher, reactContext)
|
|
295
421
|
jsPointerDispatcher?.onChildStartedNativeGesture(childView, ev, dispatcher)
|
|
@@ -297,6 +423,10 @@ private class TouchDispatchingRootViewGroup(
|
|
|
297
423
|
}
|
|
298
424
|
|
|
299
425
|
override fun onChildEndedNativeGesture(childView: View, ev: MotionEvent) {
|
|
426
|
+
if (!dispatchesTouchesToJS) {
|
|
427
|
+
notifyAncestorRootViews { it.onChildEndedNativeGesture(childView, ev) }
|
|
428
|
+
return
|
|
429
|
+
}
|
|
300
430
|
eventDispatcher?.let { jsTouchDispatcher.onChildEndedNativeGesture(ev, it) }
|
|
301
431
|
jsPointerDispatcher?.onChildEndedNativeGesture()
|
|
302
432
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export declare const PresentedContentContext: import("react").Context<boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* Whether the surrounding content is presented in its own view controller — a sheet, a popover
|
|
5
|
+
* — rather than in the React Native surface.
|
|
6
|
+
*
|
|
7
|
+
* `RNHostView` needs this because nothing above such content dispatches React Native touches: the
|
|
8
|
+
* surface root is not one of its ancestors. A hosted view there has to dispatch its own touches and
|
|
9
|
+
* be the origin its content is measured from, and both of those come from a single `layoutRoot`
|
|
10
|
+
* prop.
|
|
11
|
+
*
|
|
12
|
+
* Defaults to `false`, so content that is not wrapped keeps deferring to the surface root.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useIsPresentedInOwnWindow(): boolean;
|
|
15
|
+
export declare function PresentedContent({ children }: {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=PresentedContentContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresentedContentContext.d.ts","sourceRoot":"","sources":["../src/PresentedContentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,eAAO,MAAM,uBAAuB,kCAAuB,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagerView.android.d.ts","sourceRoot":"","sources":["../../../src/community/pager-view/PagerView.android.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAO/D;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"PagerView.android.d.ts","sourceRoot":"","sources":["../../../src/community/pager-view/PagerView.android.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAO/D;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAwH9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/AlertDialog/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/AlertDialog/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAkB,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGzF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;CAC/B,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA2BD;;GAEG;AACH,iBAAS,gBAAgB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE7D;AAED;;GAEG;AACH,iBAAS,eAAe,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE5D;AAED;;GAEG;AACH,iBAAS,wBAAwB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAErE;AAED;;GAEG;AACH,iBAAS,wBAAwB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAErE;AAED;;GAEG;AACH,iBAAS,eAAe,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE5D;AAED;;;;GAIG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,2CAOpD;kBAPQ,oBAAoB;;;;;;;AAe7B,OAAO,EAAE,oBAAoB,IAAI,WAAW,EAAE,CAAC;AAG/C,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/BasicAlertDialog/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/BasicAlertDialog/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGzF,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B;AAyBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAO5D;AAGD,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/DropdownMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/DropdownMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAclD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE9B;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B;AAWD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAOnD;yBAPe,KAAK;;;AAUrB;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAErD;yBAFe,OAAO;;;AAKvB;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAErD;AAED,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAW7C;kBAXQ,YAAY;;;;;AAiBrB,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExposedDropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ExposedDropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAWlE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
1
2
|
import { type ColorSchemeName, type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
3
|
import { type PrimitiveBaseProps } from '../layout';
|
|
3
4
|
export interface HostProps extends PrimitiveBaseProps {
|
|
@@ -54,6 +55,8 @@ export interface HostProps extends PrimitiveBaseProps {
|
|
|
54
55
|
children: React.ReactNode;
|
|
55
56
|
style?: StyleProp<ViewStyle>;
|
|
56
57
|
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto';
|
|
58
|
+
/** @hidden */
|
|
59
|
+
ref?: Ref<any>;
|
|
57
60
|
}
|
|
58
61
|
export declare function Host(props: HostProps): import("react/jsx-runtime").JSX.Element;
|
|
59
62
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Host/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Host/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EAGf,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,WAAW,SAAU,SAAQ,kBAAkB;IACnD;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAEvE;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAEtF;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAE9B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;;OAGG;IACH,eAAe,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IAEhD;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IAEvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1D,cAAc;IACd,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;CAChB;AAeD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CA6CpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ModalBottomSheet/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/ModalBottomSheet/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAUlD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;OAEG;IACH,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B;;;OAGG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,UAAU,CAAC,EAAE,0BAA0B,CAAC;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B;AAmCD;;GAEG;AACH,iBAAS,yBAAyB,CAAC,KAAK,EAAE,qBAAqB,2CAQ9D;kBARQ,yBAAyB;4BAPP;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE;;AAmBlD,eAAO,MAAM,gBAAgB,kCAA4B,CAAC"}
|