@expo/ui 58.0.14 → 58.0.16
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 +24 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +35 -2
- package/android/src/main/java/expo/modules/ui/DateRangePickerView.kt +35 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +3 -0
- package/android/src/main/java/expo/modules/ui/HostView.kt +21 -0
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +2 -2
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +117 -1
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +8 -1
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +13 -1
- package/build/NativeTreeContext.d.ts +10 -0
- package/build/NativeTreeContext.js +25 -0
- package/build/NativeTreeContext.js.map +1 -0
- package/build/State/useWorkletCallback.d.ts +1 -1
- package/build/community/bottom-sheet/BottomSheet.ios.js +11 -4
- package/build/community/bottom-sheet/BottomSheet.ios.js.map +1 -1
- package/build/community/datetime-picker/DateTimePicker.android.js +4 -0
- package/build/community/datetime-picker/DateTimePicker.android.js.map +1 -1
- package/build/community/menu/MenuView.android.js +6 -0
- package/build/community/menu/MenuView.android.js.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +38 -0
- package/build/jetpack-compose/DatePicker/index.js.map +1 -1
- package/build/jetpack-compose/DropdownMenu/index.d.ts +8 -1
- package/build/jetpack-compose/DropdownMenu/index.js.map +1 -1
- package/build/jetpack-compose/Host/index.js +8 -2
- package/build/jetpack-compose/Host/index.js.map +1 -1
- package/build/jetpack-compose/RNHostView/index.js +5 -1
- package/build/jetpack-compose/RNHostView/index.js.map +1 -1
- package/build/swift-ui/Chart/index.d.ts +10 -0
- package/build/swift-ui/Chart/index.js.map +1 -1
- package/build/swift-ui/Host/index.js +8 -2
- package/build/swift-ui/Host/index.js.map +1 -1
- package/build/swift-ui/RNHostView.js +5 -1
- package/build/swift-ui/RNHostView.js.map +1 -1
- package/build/swift-ui/Toolbar/index.d.ts +2 -0
- package/build/swift-ui/Toolbar/index.js +2 -0
- package/build/swift-ui/Toolbar/index.js.map +1 -1
- package/build/swift-ui/modifiers/hingeObservation.d.ts +1 -1
- package/build/swift-ui/modifiers/hingeObservation.js +1 -1
- package/build/swift-ui/modifiers/index.d.ts +1 -0
- package/build/swift-ui/modifiers/index.js +1 -0
- package/build/swift-ui/modifiers/index.js.map +1 -1
- package/build/swift-ui/modifiers/presentationModifiers.d.ts +17 -1
- package/build/swift-ui/modifiers/presentationModifiers.js +4 -2
- package/build/swift-ui/modifiers/presentationModifiers.js.map +1 -1
- package/build/swift-ui/modifiers/searchable.d.ts +83 -0
- package/build/swift-ui/modifiers/searchable.js +74 -0
- package/build/swift-ui/modifiers/searchable.js.map +1 -0
- package/build/types.d.ts +27 -0
- package/build/types.js +1 -1
- package/build/types.js.map +1 -1
- package/build/universal/BottomSheet/index.android.js +26 -18
- package/build/universal/BottomSheet/index.android.js.map +1 -1
- package/build/universal/BottomSheet/index.ios.js +20 -12
- package/build/universal/BottomSheet/index.ios.js.map +1 -1
- package/ios/ChartView.swift +15 -10
- package/ios/DataListForEachView.swift +1 -0
- package/ios/GridView.swift +1 -0
- package/ios/HostView.swift +27 -4
- package/ios/Modifiers/PresentationModifiers.swift +20 -4
- package/ios/Modifiers/SearchToolbarBehaviorModifier.swift +35 -0
- package/ios/Modifiers/SearchableModifier.swift +94 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
- package/ios/NamespaceView.swift +1 -0
- package/ios/Picker/PickerView.swift +9 -7
- package/ios/RNHostView.swift +19 -4
- package/ios/SlotView.swift +1 -0
- package/ios/TabView/TabView.swift +2 -0
- package/ios/ToolbarView.swift +2 -1
- package/ios/UIBaseView.swift +13 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.14/expo.modules.ui-58.0.14-sources.jar → 58.0.16/expo.modules.ui-58.0.16-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.14/expo.modules.ui-58.0.14.module → 58.0.16/expo.modules.ui-58.0.16.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.14/expo.modules.ui-58.0.14.pom → 58.0.16/expo.modules.ui-58.0.16.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.pom.sha512 +1 -0
- package/package.json +2 -2
- package/prebuilds/output/debug/xcframeworks/ExpoUI.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoUI.tar.gz +0 -0
- package/src/NativeTreeContext.tsx +31 -0
- package/src/State/useWorkletCallback.ts +1 -1
- package/src/community/bottom-sheet/BottomSheet.ios.tsx +7 -6
- package/src/community/datetime-picker/DateTimePicker.android.tsx +4 -0
- package/src/community/menu/MenuView.android.tsx +12 -2
- package/src/jetpack-compose/DatePicker/index.tsx +38 -0
- package/src/jetpack-compose/DropdownMenu/index.tsx +12 -1
- package/src/jetpack-compose/Host/index.tsx +6 -2
- package/src/jetpack-compose/RNHostView/index.tsx +3 -1
- package/src/swift-ui/Chart/index.tsx +10 -0
- package/src/swift-ui/Host/index.tsx +6 -2
- package/src/swift-ui/RNHostView.tsx +3 -1
- package/src/swift-ui/Toolbar/index.tsx +2 -0
- package/src/swift-ui/modifiers/hingeObservation.ts +1 -1
- package/src/swift-ui/modifiers/index.ts +1 -0
- package/src/swift-ui/modifiers/presentationModifiers.ts +18 -2
- package/src/swift-ui/modifiers/searchable.ts +107 -0
- package/src/types.ts +28 -0
- package/src/universal/BottomSheet/index.android.tsx +23 -12
- package/src/universal/BottomSheet/index.ios.tsx +20 -9
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.14/expo.modules.ui-58.0.14.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 58.0.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [Internal] Bump precompiled artifacts due to ABI breakage in expo-modules-jsi, which makes `JavaScriptValue` a non-copyable struct. ([#51368](https://github.com/expo/expo/pull/51368) by [@tsapeta](https://github.com/tsapeta))
|
|
8
|
+
- [iOS] Fix the community `BottomSheet` clipping its content when the sheet is narrower than the window, as on iPhone Duo. When the sheet sized itself to its content, the content was pinned to the window width and centered in the sheet, so its leading edge was cut off. The content now takes its width from the sheet and its height from the content. `presentationSizing` takes a `fitted` option (`{ horizontal, vertical }`) to fit a sheet to its content on one axis only. ([#51319](https://github.com/expo/expo/pull/51319) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
9
|
+
- [Android] Fix an `RNHostView` that ignores touches when a Compose button with a ripple in the same `Host` was pressed earlier. The ripple container that Compose adds was found first during React Native's touch-target search, so the touch went to the `Host` instead of the hosted view. ([#51237](https://github.com/expo/expo/pull/51237) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
10
|
+
- Fixed `measure()` of views hosted in `RNHostView` inside SwiftUI and Jetpack Compose containers. ([#50715](https://github.com/expo/expo/pull/50715) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
11
|
+
- Added a development warning when a `Host` renders directly inside another `Host` without an `RNHostView`. The universal `BottomSheet` no longer adds its own `Host` when it renders inside one. ([#50715](https://github.com/expo/expo/pull/50715) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
12
|
+
- [iOS] Fixed `measure()` of views hosted in `RNHostView` when SwiftUI insets the `Host`'s content, for example by the safe area. ([#50727](https://github.com/expo/expo/pull/50727) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
13
|
+
- [Android] Fix the community `MenuView` opening detached above its anchor near the bottom of the screen, and add a `properties` prop to the Jetpack Compose `DropdownMenu`. ([#51412](https://github.com/expo/expo/pull/51412) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
14
|
+
- [Android] Fix a numeric `width()` modifier crashing the app on launch with `FieldCastException: Cannot cast value for field 'width'` since the `IntrinsicSize` support added in 57.0.22 / 58.0.9. JS numbers reach the modifier record as `Double`, which matched neither branch of `Either<Int, IntrinsicSizeType>`; the field is now `Either<Double, IntrinsicSizeType>`, so numeric widths convert again and `width(IntrinsicSize.Min|Max)` keeps working. ([#51322](https://github.com/expo/expo/pull/51322) by [@expo-bot](https://github.com/expo-bot))
|
|
15
|
+
- [iOS] Add `cornerRadius` and `opacity` to `Chart`'s `pieStyle`. Pie slices could not have rounded corners, and their opacity was fixed at 0.8, so a chart drawn in solid colors always looked washed out. Both default to the previous behavior. Rounded corners let a single-slice donut work as a progress ring with rounded ends. ([#51351](https://github.com/expo/expo/pull/51351) by [@jsg2021](https://github.com/jsg2021))
|
|
16
|
+
|
|
17
|
+
## 58.0.15
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [iOS] Fix `Chart` ignoring `lineStyle.width` on line charts. The line mark applied `.lineStyle` twice (once for the dash pattern, once for the width), and the first one wins, so lines always rendered at 1 pt. The width and the dash pattern are now set in one `StrokeStyle`. ([#51283](https://github.com/expo/expo/pull/51283) by [@brentvatne](https://github.com/brentvatne))
|
|
22
|
+
- [Android] Add `showTitle` and `showHeadline` to the Jetpack Compose `DateTimePicker`, `DatePickerDialog`, `DateRangePicker`, and `DateRangePickerDialog` to hide Material 3's title and headline. The community `DateTimePicker` with `presentation="inline"` now hides both on Android, matching iOS. To keep the title and headline, use `DateTimePicker` from `@expo/ui/jetpack-compose` instead. ([#51274](https://github.com/expo/expo/pull/51274) by [@IGx89](https://github.com/IGx89))
|
|
23
|
+
- [Android] Fix a `Pressable` (or any JS responder) being cancelled when a `MaskedView`, or any other component that renders a `Host`, is laid over it. Once React Native grants the JS responder, the responder's view intercepts the touch stream and sends `ACTION_CANCEL` to its native children, including that `Host`. The `Host` reported this cancel as Compose claiming the gesture, which cancelled the press it belonged to. Holds longer than about 30 ms never fired `onPress`. ([#51163](https://github.com/expo/expo/pull/51163) by [@1kuko3](https://github.com/1kuko3))
|
|
24
|
+
- Fix iOS `Picker` not reporting a selection that equals the last `selection` prop when the user changes it again before the prop updates. ([#51196](https://github.com/expo/expo/pull/51196) by [@expo-bot](https://github.com/expo-bot))
|
|
25
|
+
- [iOS] Add `searchable` and `searchToolbarBehavior` SwiftUI modifiers. ([#50369](https://github.com/expo/expo/pull/50369) by [@expo-bot](https://github.com/expo-bot))
|
|
26
|
+
|
|
3
27
|
## 58.0.14
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
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 = '58.0.
|
|
15
|
+
version = '58.0.16'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "58.0.
|
|
21
|
+
versionName "58.0.16"
|
|
22
22
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
23
23
|
}
|
|
24
24
|
buildFeatures {
|
|
@@ -4,6 +4,7 @@ import androidx.compose.material3.AlertDialog
|
|
|
4
4
|
import androidx.compose.ui.res.stringResource
|
|
5
5
|
import androidx.compose.material3.ButtonDefaults
|
|
6
6
|
import androidx.compose.material3.DatePicker
|
|
7
|
+
import androidx.compose.material3.DatePickerColors
|
|
7
8
|
import androidx.compose.material3.DatePickerDefaults
|
|
8
9
|
import androidx.compose.material3.DatePickerDialog
|
|
9
10
|
import androidx.compose.material3.DatePickerState
|
|
@@ -158,6 +159,8 @@ data class DateTimePickerProps(
|
|
|
158
159
|
val variant: Variant = Variant.PICKER,
|
|
159
160
|
val displayedComponents: DisplayedComponents = DisplayedComponents.DATE,
|
|
160
161
|
val showVariantToggle: Boolean = true,
|
|
162
|
+
val showTitle: Boolean = true,
|
|
163
|
+
val showHeadline: Boolean = true,
|
|
161
164
|
val is24Hour: Boolean = true,
|
|
162
165
|
val color: AndroidColor? = null,
|
|
163
166
|
val elementColors: DateTimePickerColorOverrides = DateTimePickerColorOverrides(),
|
|
@@ -170,6 +173,8 @@ data class DatePickerDialogProps(
|
|
|
170
173
|
val initialDate: Long? = null,
|
|
171
174
|
val variant: Variant = Variant.PICKER,
|
|
172
175
|
val showVariantToggle: Boolean = true,
|
|
176
|
+
val showTitle: Boolean = true,
|
|
177
|
+
val showHeadline: Boolean = true,
|
|
173
178
|
val confirmButtonLabel: String? = null,
|
|
174
179
|
val dismissButtonLabel: String? = null,
|
|
175
180
|
val color: AndroidColor? = null,
|
|
@@ -396,7 +401,7 @@ fun ExpoDatePickerDialogContent(props: DatePickerDialogProps, onDateSelected: (D
|
|
|
396
401
|
// Material3's year-selector chevron tints from the ambient LocalContentColor (which defaults to
|
|
397
402
|
// black), not `navigationContentColor`; bind the local so the chevron honors the navigation color.
|
|
398
403
|
CompositionLocalProvider(LocalContentColor provides colors.navigationContentColor) {
|
|
399
|
-
|
|
404
|
+
MaterialDatePicker(
|
|
400
405
|
modifier = if (displayMode == DisplayMode.Picker) {
|
|
401
406
|
Modifier.wrapContentHeight(align = Alignment.Top, unbounded = true)
|
|
402
407
|
} else {
|
|
@@ -404,6 +409,8 @@ fun ExpoDatePickerDialogContent(props: DatePickerDialogProps, onDateSelected: (D
|
|
|
404
409
|
},
|
|
405
410
|
state = state,
|
|
406
411
|
showModeToggle = props.showVariantToggle,
|
|
412
|
+
showTitle = props.showTitle,
|
|
413
|
+
showHeadline = props.showHeadline,
|
|
407
414
|
colors = colors
|
|
408
415
|
)
|
|
409
416
|
}
|
|
@@ -507,15 +514,41 @@ fun ExpoDatePicker(modifier: Modifier = Modifier, props: DateTimePickerProps, on
|
|
|
507
514
|
// Material3's year-selector chevron tints from the ambient LocalContentColor (which defaults to
|
|
508
515
|
// black), not `navigationContentColor`; bind the local so the chevron honors the navigation color.
|
|
509
516
|
CompositionLocalProvider(LocalContentColor provides colors.navigationContentColor) {
|
|
510
|
-
|
|
517
|
+
MaterialDatePicker(
|
|
511
518
|
modifier = modifier,
|
|
512
519
|
state = state,
|
|
513
520
|
showModeToggle = props.showVariantToggle,
|
|
521
|
+
showTitle = props.showTitle,
|
|
522
|
+
showHeadline = props.showHeadline,
|
|
514
523
|
colors = colors
|
|
515
524
|
)
|
|
516
525
|
}
|
|
517
526
|
}
|
|
518
527
|
|
|
528
|
+
// Material 3 hides the title or headline when its slot is `null`. Its default slots pad themselves
|
|
529
|
+
// with private constants, so branch on the call instead of copying them, keeping the defaults exact.
|
|
530
|
+
@OptIn(ExperimentalMaterial3Api::class)
|
|
531
|
+
@Composable
|
|
532
|
+
private fun MaterialDatePicker(
|
|
533
|
+
modifier: Modifier = Modifier,
|
|
534
|
+
state: DatePickerState,
|
|
535
|
+
showModeToggle: Boolean,
|
|
536
|
+
showTitle: Boolean,
|
|
537
|
+
showHeadline: Boolean,
|
|
538
|
+
colors: DatePickerColors
|
|
539
|
+
) {
|
|
540
|
+
when {
|
|
541
|
+
showTitle && showHeadline ->
|
|
542
|
+
DatePicker(state = state, modifier = modifier, colors = colors, showModeToggle = showModeToggle)
|
|
543
|
+
showTitle ->
|
|
544
|
+
DatePicker(state = state, modifier = modifier, colors = colors, headline = null, showModeToggle = showModeToggle)
|
|
545
|
+
showHeadline ->
|
|
546
|
+
DatePicker(state = state, modifier = modifier, colors = colors, title = null, showModeToggle = showModeToggle)
|
|
547
|
+
else ->
|
|
548
|
+
DatePicker(state = state, modifier = modifier, colors = colors, title = null, headline = null, showModeToggle = showModeToggle)
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
519
552
|
@OptIn(ExperimentalMaterial3Api::class)
|
|
520
553
|
@Composable
|
|
521
554
|
fun ExpoTimePicker(modifier: Modifier = Modifier, props: DateTimePickerProps, onDateSelected: (DatePickerResult) -> Unit) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package expo.modules.ui
|
|
2
2
|
|
|
3
3
|
import androidx.compose.material3.ButtonDefaults
|
|
4
|
+
import androidx.compose.material3.DatePickerColors
|
|
4
5
|
import androidx.compose.material3.DatePickerDefaults
|
|
5
6
|
import androidx.compose.material3.DatePickerDialog
|
|
6
7
|
import androidx.compose.material3.DateRangePicker
|
|
@@ -13,6 +14,7 @@ import androidx.compose.runtime.Composable
|
|
|
13
14
|
import androidx.compose.runtime.CompositionLocalProvider
|
|
14
15
|
import androidx.compose.runtime.LaunchedEffect
|
|
15
16
|
import androidx.compose.runtime.remember
|
|
17
|
+
import androidx.compose.ui.Modifier
|
|
16
18
|
import androidx.compose.ui.platform.LocalConfiguration
|
|
17
19
|
import androidx.compose.ui.res.stringResource
|
|
18
20
|
import expo.modules.kotlin.records.Field
|
|
@@ -38,6 +40,8 @@ data class DateRangePickerProps(
|
|
|
38
40
|
val initialEndDate: Long? = null,
|
|
39
41
|
val variant: Variant = Variant.PICKER,
|
|
40
42
|
val showVariantToggle: Boolean = true,
|
|
43
|
+
val showTitle: Boolean = true,
|
|
44
|
+
val showHeadline: Boolean = true,
|
|
41
45
|
val color: AndroidColor? = null,
|
|
42
46
|
val elementColors: DateTimePickerColorOverrides = DateTimePickerColorOverrides(),
|
|
43
47
|
val selectableDates: SelectableDatesRecord? = null,
|
|
@@ -50,6 +54,8 @@ data class DateRangePickerDialogProps(
|
|
|
50
54
|
val initialEndDate: Long? = null,
|
|
51
55
|
val variant: Variant = Variant.PICKER,
|
|
52
56
|
val showVariantToggle: Boolean = true,
|
|
57
|
+
val showTitle: Boolean = true,
|
|
58
|
+
val showHeadline: Boolean = true,
|
|
53
59
|
val confirmButtonLabel: String? = null,
|
|
54
60
|
val dismissButtonLabel: String? = null,
|
|
55
61
|
val color: AndroidColor? = null,
|
|
@@ -147,9 +153,11 @@ fun ExpoDateRangePickerDialogContent(
|
|
|
147
153
|
ApplyDatePickerDialogKeyboardBehavior(displayMode)
|
|
148
154
|
|
|
149
155
|
CompositionLocalProvider(LocalContentColor provides colors.navigationContentColor) {
|
|
150
|
-
|
|
156
|
+
MaterialDateRangePicker(
|
|
151
157
|
state = state,
|
|
152
158
|
showModeToggle = props.showVariantToggle,
|
|
159
|
+
showTitle = props.showTitle,
|
|
160
|
+
showHeadline = props.showHeadline,
|
|
153
161
|
colors = colors
|
|
154
162
|
)
|
|
155
163
|
}
|
|
@@ -181,11 +189,36 @@ fun FunctionalComposableScope.DateRangePickerContent(
|
|
|
181
189
|
|
|
182
190
|
val colors = buildDatePickerColors(props.elementColors, props.color.composeOrNull)
|
|
183
191
|
CompositionLocalProvider(LocalContentColor provides colors.navigationContentColor) {
|
|
184
|
-
|
|
192
|
+
MaterialDateRangePicker(
|
|
185
193
|
modifier = modifier,
|
|
186
194
|
state = state,
|
|
187
195
|
showModeToggle = props.showVariantToggle,
|
|
196
|
+
showTitle = props.showTitle,
|
|
197
|
+
showHeadline = props.showHeadline,
|
|
188
198
|
colors = colors
|
|
189
199
|
)
|
|
190
200
|
}
|
|
191
201
|
}
|
|
202
|
+
|
|
203
|
+
// See MaterialDatePicker: branching keeps Material 3's own default title and headline slots.
|
|
204
|
+
@OptIn(ExperimentalMaterial3Api::class)
|
|
205
|
+
@Composable
|
|
206
|
+
private fun MaterialDateRangePicker(
|
|
207
|
+
modifier: Modifier = Modifier,
|
|
208
|
+
state: DateRangePickerState,
|
|
209
|
+
showModeToggle: Boolean,
|
|
210
|
+
showTitle: Boolean,
|
|
211
|
+
showHeadline: Boolean,
|
|
212
|
+
colors: DatePickerColors
|
|
213
|
+
) {
|
|
214
|
+
when {
|
|
215
|
+
showTitle && showHeadline ->
|
|
216
|
+
DateRangePicker(state = state, modifier = modifier, colors = colors, showModeToggle = showModeToggle)
|
|
217
|
+
showTitle ->
|
|
218
|
+
DateRangePicker(state = state, modifier = modifier, colors = colors, headline = null, showModeToggle = showModeToggle)
|
|
219
|
+
showHeadline ->
|
|
220
|
+
DateRangePicker(state = state, modifier = modifier, colors = colors, title = null, showModeToggle = showModeToggle)
|
|
221
|
+
else ->
|
|
222
|
+
DateRangePicker(state = state, modifier = modifier, colors = colors, title = null, headline = null, showModeToggle = showModeToggle)
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
package expo.modules.ui
|
|
4
4
|
|
|
5
|
+
import android.os.Handler
|
|
5
6
|
import android.os.Looper
|
|
6
7
|
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
|
7
8
|
import androidx.compose.material3.SwitchDefaults
|
|
@@ -77,6 +78,8 @@ class ExpoUIModule : Module() {
|
|
|
77
78
|
// Tags restart in the next app context, so an entry whose view was never torn down would be
|
|
78
79
|
// read by an unrelated view after a reload.
|
|
79
80
|
NativeStatePropsGetter().clearAllContentOrigins()
|
|
81
|
+
// React Native destroys modules on a background thread, but `ZeroContentOrigins` is UI-thread only.
|
|
82
|
+
Handler(Looper.getMainLooper()).post { ZeroContentOrigins.clear() }
|
|
80
83
|
|
|
81
84
|
imageLoader?.close()
|
|
82
85
|
imageLoader = null
|
|
@@ -4,6 +4,7 @@ package expo.modules.ui
|
|
|
4
4
|
|
|
5
5
|
import android.annotation.SuppressLint
|
|
6
6
|
import android.content.Context
|
|
7
|
+
import android.view.MotionEvent
|
|
7
8
|
import androidx.compose.foundation.isSystemInDarkTheme
|
|
8
9
|
import androidx.compose.foundation.layout.WindowInsets
|
|
9
10
|
import androidx.compose.foundation.layout.displayCutout
|
|
@@ -120,6 +121,26 @@ internal class HostView(context: Context, appContext: AppContext) :
|
|
|
120
121
|
private val onLayoutContent by EventDispatcher<LayoutContentEvent>()
|
|
121
122
|
private var lastDispatchedContentSize: IntSize? = null
|
|
122
123
|
|
|
124
|
+
/**
|
|
125
|
+
* True while this view passes down an `ACTION_CANCEL` that came from its React Native parent,
|
|
126
|
+
* not from a Compose gesture detector. React Native already owns that gesture: the usual cause is
|
|
127
|
+
* the JS responder's view intercepting the stream, which cancels its native children.
|
|
128
|
+
*/
|
|
129
|
+
internal var isDispatchingCancelFromParent = false
|
|
130
|
+
private set
|
|
131
|
+
|
|
132
|
+
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
|
133
|
+
if (ev.actionMasked != MotionEvent.ACTION_CANCEL) {
|
|
134
|
+
return super.dispatchTouchEvent(ev)
|
|
135
|
+
}
|
|
136
|
+
isDispatchingCancelFromParent = true
|
|
137
|
+
try {
|
|
138
|
+
return super.dispatchTouchEvent(ev)
|
|
139
|
+
} finally {
|
|
140
|
+
isDispatchingCancelFromParent = false
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
123
144
|
@Composable
|
|
124
145
|
override fun ComposableScope.Content() {
|
|
125
146
|
val context = LocalContext.current
|
|
@@ -147,7 +147,7 @@ internal enum class IntrinsicSizeType(val value: String) : Enumerable {
|
|
|
147
147
|
|
|
148
148
|
@OptimizedRecord
|
|
149
149
|
internal data class ComposeWidthParams(
|
|
150
|
-
@Field val width: Either<
|
|
150
|
+
@Field val width: Either<Double, IntrinsicSizeType>? = null
|
|
151
151
|
) : Record
|
|
152
152
|
|
|
153
153
|
@OptimizedRecord
|
|
@@ -496,7 +496,7 @@ object ModifierRegistry {
|
|
|
496
496
|
if (width?.`is`(IntrinsicSizeType::class) == true) {
|
|
497
497
|
Modifier.width(width.second().toComposeIntrinsicSize())
|
|
498
498
|
} else {
|
|
499
|
-
Modifier.width((width?.first() ?: 0).dp)
|
|
499
|
+
Modifier.width((width?.first() ?: 0.0).dp)
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
|
|
@@ -8,6 +8,7 @@ import android.view.View
|
|
|
8
8
|
import android.view.ViewGroup
|
|
9
9
|
import android.view.ViewParent
|
|
10
10
|
import android.widget.FrameLayout
|
|
11
|
+
import androidx.annotation.UiThread
|
|
11
12
|
import androidx.compose.foundation.layout.fillMaxHeight
|
|
12
13
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
13
14
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
@@ -25,6 +26,7 @@ import androidx.compose.ui.Modifier
|
|
|
25
26
|
import androidx.compose.ui.layout.onGloballyPositioned
|
|
26
27
|
import androidx.compose.ui.layout.onSizeChanged
|
|
27
28
|
import androidx.compose.ui.layout.positionInRoot
|
|
29
|
+
import androidx.compose.ui.platform.AbstractComposeView
|
|
28
30
|
import androidx.compose.ui.platform.LocalDensity
|
|
29
31
|
import androidx.compose.ui.unit.IntSize
|
|
30
32
|
import androidx.compose.ui.viewinterop.AndroidView
|
|
@@ -45,6 +47,7 @@ import expo.modules.kotlin.views.ComposableScope
|
|
|
45
47
|
import expo.modules.kotlin.views.ComposeProps
|
|
46
48
|
import expo.modules.kotlin.views.ExpoComposeView
|
|
47
49
|
import expo.modules.kotlin.views.OptimizedComposeProps
|
|
50
|
+
import java.util.WeakHashMap
|
|
48
51
|
|
|
49
52
|
@OptimizedComposeProps
|
|
50
53
|
internal data class RNHostViewProps(
|
|
@@ -151,6 +154,25 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
151
154
|
shadowNodeProxy.clearContentOrigin()
|
|
152
155
|
}
|
|
153
156
|
|
|
157
|
+
// Compose places the views between this view and its `Host`, so `measure()` must skip their Yoga
|
|
158
|
+
// origins. A zero content origin on each one does that while this view is attached.
|
|
159
|
+
private var composeAncestors: List<ExpoComposeView<*>> = emptyList()
|
|
160
|
+
|
|
161
|
+
override fun onAttachedToWindow() {
|
|
162
|
+
super.onAttachedToWindow()
|
|
163
|
+
composeAncestors = generateSequence(parent) { it.parent }
|
|
164
|
+
.takeWhile { it is ExpoComposeView<*> && !it.shouldUseAndroidLayout }
|
|
165
|
+
.filterIsInstance<ExpoComposeView<*>>()
|
|
166
|
+
.toList()
|
|
167
|
+
composeAncestors.forEach(ZeroContentOrigins::acquire)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
override fun onDetachedFromWindow() {
|
|
171
|
+
super.onDetachedFromWindow()
|
|
172
|
+
composeAncestors.forEach(ZeroContentOrigins::release)
|
|
173
|
+
composeAncestors = emptyList()
|
|
174
|
+
}
|
|
175
|
+
|
|
154
176
|
@Composable
|
|
155
177
|
override fun ComposableScope.Content() {
|
|
156
178
|
val matchContentsHorizontal = props.matchContentsHorizontal.value ?: false
|
|
@@ -294,6 +316,44 @@ internal class RNHostView(context: Context, appContext: AppContext) :
|
|
|
294
316
|
}
|
|
295
317
|
}
|
|
296
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Counts, for each Compose ancestor, the attached `RNHostView`s below it. Several can share an
|
|
321
|
+
* ancestor, so the ancestor's zero content origin is set when its count becomes 1 and cleared when
|
|
322
|
+
* it returns to 0.
|
|
323
|
+
*/
|
|
324
|
+
internal object ZeroContentOrigins {
|
|
325
|
+
private val counts = WeakHashMap<ExpoComposeView<*>, Int>()
|
|
326
|
+
|
|
327
|
+
@UiThread
|
|
328
|
+
fun acquire(view: ExpoComposeView<*>) {
|
|
329
|
+
val count = counts[view] ?: 0
|
|
330
|
+
if (count == 0) {
|
|
331
|
+
view.shadowNodeProxy.setContentOrigin(0.0, 0.0)
|
|
332
|
+
}
|
|
333
|
+
counts[view] = count + 1
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
@UiThread
|
|
337
|
+
fun release(view: ExpoComposeView<*>) {
|
|
338
|
+
val count = counts[view] ?: return
|
|
339
|
+
if (count > 1) {
|
|
340
|
+
counts[view] = count - 1
|
|
341
|
+
return
|
|
342
|
+
}
|
|
343
|
+
counts.remove(view)
|
|
344
|
+
view.shadowNodeProxy.clearContentOrigin()
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Called on reload, after the content origins themselves are cleared. A late `release` from the
|
|
349
|
+
* old app context then finds no count and can't clear an entry for a reused tag.
|
|
350
|
+
*/
|
|
351
|
+
@UiThread
|
|
352
|
+
fun clear() {
|
|
353
|
+
counts.clear()
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
297
357
|
/**
|
|
298
358
|
* Removes [wrapper] from the view that currently contains it, and clears its bounds.
|
|
299
359
|
*
|
|
@@ -309,6 +369,28 @@ internal fun detachForReuse(wrapper: View) {
|
|
|
309
369
|
wrapper.layout(0, 0, 0, 0)
|
|
310
370
|
}
|
|
311
371
|
|
|
372
|
+
/**
|
|
373
|
+
* React Native looks for touch targets from the last child to the first, and Compose appends helper
|
|
374
|
+
* views such as ripple containers to its owner view after the hosted views. Those helpers have no
|
|
375
|
+
* React tag, so a touch on them goes to the `Host` instead of the hosted view.
|
|
376
|
+
* This is a workaround: React Native has no way to let the `Host` choose the touch target.
|
|
377
|
+
* This causes https://github.com/expo/expo/issues/51159
|
|
378
|
+
*/
|
|
379
|
+
internal fun keepLastForTouchTargeting(composeOwnerView: ViewGroup, hostedViewsContainer: View) {
|
|
380
|
+
if (composeOwnerView.indexOfChild(hostedViewsContainer) != composeOwnerView.childCount - 1) {
|
|
381
|
+
composeOwnerView.bringChildToFront(hostedViewsContainer)
|
|
382
|
+
}
|
|
383
|
+
composeOwnerView.setOnHierarchyChangeListener(object : ViewGroup.OnHierarchyChangeListener {
|
|
384
|
+
override fun onChildViewAdded(parent: View, child: View) {
|
|
385
|
+
if (child !== hostedViewsContainer) {
|
|
386
|
+
composeOwnerView.bringChildToFront(hostedViewsContainer)
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
override fun onChildViewRemoved(parent: View, child: View) = Unit
|
|
391
|
+
})
|
|
392
|
+
}
|
|
393
|
+
|
|
312
394
|
/**
|
|
313
395
|
* A thin FrameLayout that intercepts touch events and dispatches them to JS via
|
|
314
396
|
* JSTouchDispatcher/JSPointerDispatcher, replicating the pattern from React Native's
|
|
@@ -379,8 +461,25 @@ private class TouchDispatchingRootViewGroup(
|
|
|
379
461
|
// and we must not override those values.
|
|
380
462
|
}
|
|
381
463
|
|
|
464
|
+
override fun onAttachedToWindow() {
|
|
465
|
+
super.onAttachedToWindow()
|
|
466
|
+
// Walk up until the parent is the ComposeView. That ancestor is the Compose owner view, and the
|
|
467
|
+
// child we came from is the container that Compose keeps all hosted views in.
|
|
468
|
+
var hostedViewsContainer: View = this
|
|
469
|
+
var composeOwnerView = parent as? ViewGroup
|
|
470
|
+
while (composeOwnerView != null && composeOwnerView.parent !is AbstractComposeView) {
|
|
471
|
+
hostedViewsContainer = composeOwnerView
|
|
472
|
+
composeOwnerView = composeOwnerView.parent as? ViewGroup
|
|
473
|
+
}
|
|
474
|
+
composeOwnerView?.let { keepLastForTouchTargeting(it, hostedViewsContainer) }
|
|
475
|
+
}
|
|
476
|
+
|
|
382
477
|
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
|
383
|
-
if (
|
|
478
|
+
if (
|
|
479
|
+
ev.actionMasked == MotionEvent.ACTION_CANCEL &&
|
|
480
|
+
!dispatchesTouchesToJS &&
|
|
481
|
+
!isCancelFromReactNative()
|
|
482
|
+
) {
|
|
384
483
|
// Compose cancels this subtree when a gesture detector above it claims the gesture. The
|
|
385
484
|
// ancestor root, which dispatches this subtree's touches, keeps streaming moves, so a
|
|
386
485
|
// `Pressable` still fires on release. Tell it a native child took over.
|
|
@@ -434,6 +533,23 @@ private class TouchDispatchingRootViewGroup(
|
|
|
434
533
|
return handled
|
|
435
534
|
}
|
|
436
535
|
|
|
536
|
+
/**
|
|
537
|
+
* Whether this cancel reached the `Host` from React Native rather than from Compose. The JS
|
|
538
|
+
* responder's view intercepts the stream once it's granted, which cancels its native children,
|
|
539
|
+
* including the `Host` of a `MaskedView` laid over a `Pressable`. JS still owns that gesture, so
|
|
540
|
+
* reporting it as a native one would cancel the press it belongs to.
|
|
541
|
+
*/
|
|
542
|
+
private fun isCancelFromReactNative(): Boolean {
|
|
543
|
+
var current: ViewParent? = parent
|
|
544
|
+
while (current != null) {
|
|
545
|
+
if (current is HostView) {
|
|
546
|
+
return current.isDispatchingCancelFromParent
|
|
547
|
+
}
|
|
548
|
+
current = current.parent
|
|
549
|
+
}
|
|
550
|
+
return false
|
|
551
|
+
}
|
|
552
|
+
|
|
437
553
|
private inline fun notifyAncestorRootViews(block: (RootView) -> Unit) {
|
|
438
554
|
var current: ViewParent? = parent
|
|
439
555
|
while (current != null) {
|
|
@@ -6,6 +6,7 @@ import androidx.compose.material3.DropdownMenu
|
|
|
6
6
|
import androidx.compose.material3.MenuDefaults
|
|
7
7
|
import androidx.compose.runtime.Composable
|
|
8
8
|
import androidx.compose.ui.unit.dp
|
|
9
|
+
import androidx.compose.ui.window.PopupProperties
|
|
9
10
|
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
10
11
|
import expo.modules.ui.UIComposableScope
|
|
11
12
|
import expo.modules.ui.ModifierRegistry
|
|
@@ -29,7 +30,13 @@ fun FunctionalComposableScope.DropdownMenuContent(
|
|
|
29
30
|
shape = props.cornerRadius?.let { RoundedCornerShape(it.dp) } ?: MenuDefaults.shape,
|
|
30
31
|
shadowElevation = props.shadowElevation?.dp ?: MenuDefaults.ShadowElevation,
|
|
31
32
|
expanded = props.expanded,
|
|
32
|
-
onDismissRequest = onDismissRequest
|
|
33
|
+
onDismissRequest = onDismissRequest,
|
|
34
|
+
properties = PopupProperties(
|
|
35
|
+
focusable = props.properties.focusable,
|
|
36
|
+
dismissOnBackPress = props.properties.dismissOnBackPress,
|
|
37
|
+
dismissOnClickOutside = props.properties.dismissOnClickOutside,
|
|
38
|
+
clippingEnabled = props.properties.clippingEnabled
|
|
39
|
+
)
|
|
33
40
|
) {
|
|
34
41
|
itemsSlotView?.let {
|
|
35
42
|
with(UIComposableScope()) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
package expo.modules.ui.menu
|
|
2
2
|
|
|
3
3
|
import android.graphics.Color
|
|
4
|
+
import expo.modules.kotlin.records.Field
|
|
5
|
+
import expo.modules.kotlin.records.Record
|
|
4
6
|
import expo.modules.kotlin.types.Enumerable
|
|
7
|
+
import expo.modules.kotlin.types.OptimizedRecord
|
|
5
8
|
import expo.modules.kotlin.views.ComposeProps
|
|
6
9
|
import expo.modules.ui.ModifierList
|
|
7
10
|
import expo.modules.kotlin.views.OptimizedComposeProps
|
|
@@ -11,6 +14,14 @@ enum class ActivationMethod(val value: String) : Enumerable {
|
|
|
11
14
|
LONG_PRESS("longPress")
|
|
12
15
|
}
|
|
13
16
|
|
|
17
|
+
@OptimizedRecord
|
|
18
|
+
data class ExpoPopupProperties(
|
|
19
|
+
@Field val focusable: Boolean = true,
|
|
20
|
+
@Field val dismissOnBackPress: Boolean = true,
|
|
21
|
+
@Field val dismissOnClickOutside: Boolean = true,
|
|
22
|
+
@Field val clippingEnabled: Boolean = true
|
|
23
|
+
) : Record
|
|
24
|
+
|
|
14
25
|
@OptimizedComposeProps
|
|
15
26
|
data class DropdownMenuProps(
|
|
16
27
|
val activationMethod: ActivationMethod = ActivationMethod.SINGLE_PRESS,
|
|
@@ -18,5 +29,6 @@ data class DropdownMenuProps(
|
|
|
18
29
|
val color: Color? = null,
|
|
19
30
|
val cornerRadius: Float? = null,
|
|
20
31
|
val modifiers: ModifierList = emptyList(),
|
|
21
|
-
val shadowElevation: Float? = null
|
|
32
|
+
val shadowElevation: Float? = null,
|
|
33
|
+
val properties: ExpoPopupProperties = ExpoPopupProperties()
|
|
22
34
|
) : ComposeProps
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `true` inside a `Host`, where SwiftUI or Jetpack Compose renders the content. `RNHostView` sets it
|
|
3
|
+
* back to `false`, because its children are React Native views again.
|
|
4
|
+
*/
|
|
5
|
+
export declare const NativeTreeContext: import("react").Context<boolean>;
|
|
6
|
+
export declare function useIsInsideNativeTree(): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Warns once in development when a `Host` renders directly inside another `Host`'s native content.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useWarnIfNestedHost(layoutSystem: 'SwiftUI' | 'Jetpack Compose'): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `true` inside a `Host`, where SwiftUI or Jetpack Compose renders the content. `RNHostView` sets it
|
|
4
|
+
* back to `false`, because its children are React Native views again.
|
|
5
|
+
*/ export const NativeTreeContext = /*#__PURE__*/ createContext(false);
|
|
6
|
+
export function useIsInsideNativeTree() {
|
|
7
|
+
return useContext(NativeTreeContext);
|
|
8
|
+
}
|
|
9
|
+
let warned = false;
|
|
10
|
+
/**
|
|
11
|
+
* Warns once in development when a `Host` renders directly inside another `Host`'s native content.
|
|
12
|
+
*/ export function useWarnIfNestedHost(layoutSystem) {
|
|
13
|
+
const isNested = useIsInsideNativeTree();
|
|
14
|
+
useEffect(()=>{
|
|
15
|
+
if (__DEV__ && isNested && !warned) {
|
|
16
|
+
warned = true;
|
|
17
|
+
console.warn(`[@expo/ui] A \`Host\` is rendered directly inside another \`Host\`'s ${layoutSystem} content. ` + `${layoutSystem} places it, but React Native can't see where, so its layout and \`measure()\` ` + `can be wrong, and a \`Pressable\` inside it can cancel its press. Wrap the nested \`Host\` in ` + `\`RNHostView\`, or render its ${layoutSystem} components directly in the outer \`Host\`.`);
|
|
18
|
+
}
|
|
19
|
+
}, [
|
|
20
|
+
isNested,
|
|
21
|
+
layoutSystem
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=NativeTreeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["NativeTreeContext.tsx"],"sourcesContent":[null],"names":["createContext","useContext","useEffect","NativeTreeContext","useIsInsideNativeTree","warned","useWarnIfNestedHost","layoutSystem","isNested","__DEV__","console","warn"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,SAAS,QAAQ,QAAQ;AAE7D;;;CAGC,GACD,OAAO,MAAMC,kCAAoBH,cAAc,OAAO;AAEtD,OAAO,SAASI;IACd,OAAOH,WAAWE;AACpB;AAEA,IAAIE,SAAS;AAEb;;CAEC,GACD,OAAO,SAASC,oBAAoBC,YAA2C;IAC7E,MAAMC,WAAWJ;IACjBF,UAAU;QACR,IAAIO,WAAWD,YAAY,CAACH,QAAQ;YAClCA,SAAS;YACTK,QAAQC,IAAI,CACV,CAAC,qEAAqE,EAAEJ,aAAa,UAAU,CAAC,GAC9F,GAAGA,aAAa,8EAA8E,CAAC,GAC/F,CAAC,8FAA8F,CAAC,GAChG,CAAC,8BAA8B,EAAEA,aAAa,2CAA2C,CAAC;QAEhG;IACF,GAAG;QAACC;QAAUD;KAAa;AAC7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SharedObject } from 'expo';
|
|
2
2
|
/**
|
|
3
|
-
* A worklet function wrapped for native code, returned by [`useWorkletCallback`](#
|
|
3
|
+
* A worklet function wrapped for native code, returned by [`useWorkletCallback`](#useworkletcallbackcallback).
|
|
4
4
|
* Pass it to a modifier or prop that accepts worklet callbacks, which then runs it synchronously on
|
|
5
5
|
* the UI thread.
|
|
6
6
|
*/
|
|
@@ -177,8 +177,14 @@ function findNearestDetentIndex(detents, position) {
|
|
|
177
177
|
const modifiers = useMemo(()=>{
|
|
178
178
|
const bg = extractBackgroundColor(backgroundStyle);
|
|
179
179
|
return [
|
|
180
|
-
...fitToContents ?
|
|
181
|
-
|
|
180
|
+
...fitToContents ? // the system choose the width.
|
|
181
|
+
[
|
|
182
|
+
presentationSizing('automatic', {
|
|
183
|
+
fitted: {
|
|
184
|
+
horizontal: false,
|
|
185
|
+
vertical: true
|
|
186
|
+
}
|
|
187
|
+
})
|
|
182
188
|
] : [
|
|
183
189
|
presentationDetents(detents, {
|
|
184
190
|
selection: selectedDetent,
|
|
@@ -218,10 +224,11 @@ function findNearestDetentIndex(detents, position) {
|
|
|
218
224
|
children: /*#__PURE__*/ _jsx(Group, {
|
|
219
225
|
modifiers: modifiers,
|
|
220
226
|
children: /*#__PURE__*/ _jsx(RNHostView, {
|
|
221
|
-
matchContents: fitToContents
|
|
227
|
+
matchContents: fitToContents ? {
|
|
228
|
+
vertical: true
|
|
229
|
+
} : false,
|
|
222
230
|
children: /*#__PURE__*/ _jsx(View, {
|
|
223
231
|
style: fitToContents ? {
|
|
224
|
-
width,
|
|
225
232
|
paddingTop: handleComponent !== null ? 16 : 0
|
|
226
233
|
} : {
|
|
227
234
|
flexGrow: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/bottom-sheet/BottomSheet.ios.tsx"],"sourcesContent":[null],"names":["useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","useWindowDimensions","View","StyleSheet","BottomSheet","NativeBottomSheet","Group","Host","RNHostView","interactiveDismissDisabled","presentationBackground","presentationDetents","presentationDragIndicator","presentationSizing","BottomSheetContext","BottomSheetInternalContext","SheetScrollContextReset","parseSnapPoint","useBottomSheet","extractBackgroundColor","style","undefined","flat","flatten","color","backgroundColor","snapPointToDetent","point","parsed","type","fraction","value","height","detentsAreEqual","a","b","findDetentIndex","detents","detent","findIndex","d","findNearestDetentIndex","position","nearestIndex","nearestDist","Infinity","forEach","i","pValue","dValue","dist","Math","abs","props","ref","snapPoints","snapPointsProp","index","indexProp","onChange","onClose","onDismiss","enablePanDownToClose","enableDynamicSizing","handleComponent","backgroundStyle","children","width","isPresented","setIsPresented","currentIndex","setCurrentIndex","max","currentIndexRef","closedRef","onChangeRef","current","onCloseRef","onDismissRef","length","map","selectedDetent","fitToContents","internalContextValue","fireCloseCallbacks","clampedIndex","min","handlePresentedChange","presented","handleDetentChange","newIndex","methods","snapToIndex","close","snapToPosition","expand","collapse","forceClose","present","dismiss","modifiers","bg","selection","onSelectionChange","Provider","pointerEvents","onIsPresentedChange","matchContents","paddingTop","flexGrow"],"mappings":";AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAC/F,SAASC,mBAAmB,EAAEC,IAAI,EAAEC,UAA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C,MAAMoD,WAAWtD,gBAAgBC,SAASC;QAC1C,IAAIoD,YAAY,KAAKA,aAAajB,gBAAgBG,OAAO,EAAE;YACzDH,gBAAgBG,OAAO,GAAGc;YAC1BnB,gBAAgBmB;YAChBf,YAAYC,OAAO,GAAGc;QACxB;IACF,GACA;QAACrD;KAAQ;IAGX,MAAMsD,UAA8B7F,QAAQ;QAC1C,MAAM8F,cAAc,CAACnC;YACnB,IAAIA,UAAU,CAAC,GAAG;gBAChBY,eAAe;gBACf;YACF;YACA,MAAMgB,eAAelC,KAAKmC,GAAG,CAACnC,KAAKqB,GAAG,CAACf,OAAO,IAAIpB,QAAQ0C,MAAM,GAAG;YACnEL,UAAUE,OAAO,GAAG;YACpBP,eAAe;YACfI,gBAAgBG,OAAO,GAAGS;YAC1Bd,gBAAgBc;YAChBV,YAAYC,OAAO,GAAGS;QACxB;QAEA,oFAAoF;QACpF,qFAAqF;QACrF,6DAA6D;QAC7D,MAAMQ,QAAQ;YACZxB,eAAe;QACjB;QAEA,OAAO;YACLuB;YACAE,gBAAgB,CAACpD,WACfkD,YAAYnD,uBAAuBJ,SAASK;YAC9CqD,QAAQ,IAAMH,YAAYvD,QAAQ0C,MAAM,GAAG;YAC3CiB,UAAU,IAAMJ,YAAY;YAC5BC;YACAI,YAAYJ;YACZK,SAAS,IAAMN,YAAY;YAC3BO,SAASN;QACX;IACF,GAAG;QAACxD;KAAQ;IAEZxC,oBAAoByD,KAAK,IAAMqC,SAAS;QAACA;KAAQ;IAEjD,MAAMS,YAAYtG,QAAQ;QACxB,MAAMuG,KAAKlF,uBAAuB8C;QAClC,OAAO;eACDiB,gBAEA;gBAACrE,mBAAmB;
|
|
1
|
+
{"version":3,"sources":["community/bottom-sheet/BottomSheet.ios.tsx"],"sourcesContent":[null],"names":["useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","useWindowDimensions","View","StyleSheet","BottomSheet","NativeBottomSheet","Group","Host","RNHostView","interactiveDismissDisabled","presentationBackground","presentationDetents","presentationDragIndicator","presentationSizing","BottomSheetContext","BottomSheetInternalContext","SheetScrollContextReset","parseSnapPoint","useBottomSheet","extractBackgroundColor","style","undefined","flat","flatten","color","backgroundColor","snapPointToDetent","point","parsed","type","fraction","value","height","detentsAreEqual","a","b","findDetentIndex","detents","detent","findIndex","d","findNearestDetentIndex","position","nearestIndex","nearestDist","Infinity","forEach","i","pValue","dValue","dist","Math","abs","props","ref","snapPoints","snapPointsProp","index","indexProp","onChange","onClose","onDismiss","enablePanDownToClose","enableDynamicSizing","handleComponent","backgroundStyle","children","width","isPresented","setIsPresented","currentIndex","setCurrentIndex","max","currentIndexRef","closedRef","onChangeRef","current","onCloseRef","onDismissRef","length","map","selectedDetent","fitToContents","internalContextValue","fireCloseCallbacks","clampedIndex","min","handlePresentedChange","presented","handleDetentChange","newIndex","methods","snapToIndex","close","snapToPosition","expand","collapse","forceClose","present","dismiss","modifiers","bg","fitted","horizontal","vertical","selection","onSelectionChange","Provider","pointerEvents","onIsPresentedChange","matchContents","paddingTop","flexGrow"],"mappings":";AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAC/F,SAASC,mBAAmB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,eAAe;AAGrE,SAASC,eAAeC,iBAAiB,QAAQ,6BAA6B;AAC9E,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAEEC,0BAA0B,EAC1BC,sBAAsB,EACtBC,mBAAmB,EACnBC,yBAAyB,EACzBC,kBAAkB,QACb,iDAAiD;AACxD,SAASC,kBAAkB,EAAEC,0BAA0B,QAAQ,YAAY;AAC3E,SAASC,uBAAuB,QAAQ,uBAAuB;AAE/D,SAASC,cAAc,QAAQ,UAAU;AAEzC,SAASC,cAAc,QAAQ,YAAY;AAE3C,kBAAkB;AAElB,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;8BACf,cAAA,KAAC5E;wBAAM8F,WAAWA;kCAChB,cAAA,KAAC5F;4BAAWsG,eAAe5B,gBAAgB;gCAAEsB,UAAU;4BAAK,IAAI;sCAM9D,cAAA,KAACtG;gCACCkB,OACE8D,gBACI;oCAAE6B,YAAY/C,oBAAoB,OAAO,KAAK;gCAAE,IAChD;oCAAEgD,UAAU;oCAAGhF,QAAQ;oCAAG+E,YAAY/C,oBAAoB,OAAO,KAAK;gCAAE;0CAE9E,cAAA,KAAChD;8CAAyBkD;;;;;;;;;AAS5C"}
|
|
@@ -98,6 +98,10 @@ export function DateTimePicker(props) {
|
|
|
98
98
|
color: accentColor,
|
|
99
99
|
onDateSelected: onDateSelected,
|
|
100
100
|
showVariantToggle: false,
|
|
101
|
+
// Match iOS, where the inline picker has no label: hide Material 3's "Select date" title
|
|
102
|
+
// and its selected-date headline.
|
|
103
|
+
showTitle: false,
|
|
104
|
+
showHeadline: false,
|
|
101
105
|
...testID ? {
|
|
102
106
|
testID
|
|
103
107
|
} : undefined
|