@expo/ui 58.0.15 → 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 +14 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +3 -0
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +2 -2
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +95 -0
- 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/community/bottom-sheet/BottomSheet.ios.js +11 -4
- package/build/community/bottom-sheet/BottomSheet.ios.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/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/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/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 +7 -4
- 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/NamespaceView.swift +1 -0
- 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.15/expo.modules.ui-58.0.15-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.15/expo.modules.ui-58.0.15.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.15/expo.modules.ui-58.0.15.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 +1 -1
- 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/community/bottom-sheet/BottomSheet.ios.tsx +7 -6
- package/src/community/menu/MenuView.android.tsx +12 -2
- 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/modifiers/presentationModifiers.ts +18 -2
- 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.15/expo.modules.ui-58.0.15-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
3
17
|
## 58.0.15
|
|
4
18
|
|
|
5
19
|
### 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 {
|
|
@@ -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
|
|
@@ -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,6 +461,19 @@ 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
478
|
if (
|
|
384
479
|
ev.actionMasked == MotionEvent.ACTION_CANCEL &&
|
|
@@ -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"}
|
|
@@ -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,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AqB9F,YACzB,CAAC2C;QACC,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,YAA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B,WAAWuB;oBACXF,eAAeA;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"}
|
|
@@ -9,6 +9,10 @@ import { Icon } from '../../jetpack-compose/Icon';
|
|
|
9
9
|
import { RNHostView } from '../../jetpack-compose/RNHostView';
|
|
10
10
|
import { Text as ComposeText } from '../../jetpack-compose/Text';
|
|
11
11
|
import { useMaterialColors } from '../../jetpack-compose/colors';
|
|
12
|
+
// Clipped popups drop the status bar offset, so edge-to-edge menus near the bottom detach from the anchor.
|
|
13
|
+
const POPUP_PROPERTIES = {
|
|
14
|
+
clippingEnabled: false
|
|
15
|
+
};
|
|
12
16
|
function actionId(action) {
|
|
13
17
|
return action.id ?? action.title;
|
|
14
18
|
}
|
|
@@ -64,6 +68,7 @@ function MenuActionItem({ action, onPressAction, dismissAll, destructiveColor })
|
|
|
64
68
|
return /*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
65
69
|
expanded: submenuExpanded,
|
|
66
70
|
onDismissRequest: ()=>setSubmenuExpanded(false),
|
|
71
|
+
properties: POPUP_PROPERTIES,
|
|
67
72
|
children: [
|
|
68
73
|
/*#__PURE__*/ _jsx(DropdownMenu.Trigger, {
|
|
69
74
|
children: /*#__PURE__*/ _jsxs(DropdownMenuItem, {
|
|
@@ -175,6 +180,7 @@ function MenuActionItem({ action, onPressAction, dismissAll, destructiveColor })
|
|
|
175
180
|
children: /*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
176
181
|
expanded: expanded,
|
|
177
182
|
onDismissRequest: dismissAll,
|
|
183
|
+
properties: POPUP_PROPERTIES,
|
|
178
184
|
children: [
|
|
179
185
|
/*#__PURE__*/ _jsx(DropdownMenu.Trigger, {
|
|
180
186
|
children: /*#__PURE__*/ _jsx(RNHostView, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/menu/MenuView.android.tsx"],"sourcesContent":[null],"names":["React","Pressable","View","HorizontalDivider","DropdownMenu","DropdownMenuItem","Host","Icon","RNHostView","Text","ComposeText","useMaterialColors","actionId","action","id","title","makeEvent","nativeEvent","event","buildElementColors","destructiveColor","isDestructive","attributes","destructive","textColor","titleColor","undefined","leadingIconColor","disabledTextColor","disabledLeadingIconColor","MenuActionItem","onPressAction","dismissAll","submenuExpanded","setSubmenuExpanded","useState","hidden","subactions","displayInline","state","image","imageColor","leadingIconSource","elementColors","length","map","sub","expanded","onDismissRequest","Trigger","enabled","disabled","onClick","LeadingIcon","source","size","tint","Items","TrailingIcon","MenuView","props","ref","actions","colorScheme","onOpenMenu","onCloseMenu","shouldOpenOnLongPress","style","children","testID","setExpanded","expandedRef","useRef","open","useCallback","current","useImperativeHandle","show","error","matchContents","onPress","onLongPress","android_disableSound","focusable","accessible"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAE/C,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SACEC,gBAAgB,QAEX,sDAAsD;AAC7D,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,UAAU,QAAQ,mCAAmC;AAC9D,SAASC,QAAQC,WAAW,QAAQ,6BAA6B;AACjE,SAASC,iBAAiB,QAAQ,+BAA+B;
|
|
1
|
+
{"version":3,"sources":["community/menu/MenuView.android.tsx"],"sourcesContent":[null],"names":["React","Pressable","View","HorizontalDivider","DropdownMenu","DropdownMenuItem","Host","Icon","RNHostView","Text","ComposeText","useMaterialColors","POPUP_PROPERTIES","clippingEnabled","actionId","action","id","title","makeEvent","nativeEvent","event","buildElementColors","destructiveColor","isDestructive","attributes","destructive","textColor","titleColor","undefined","leadingIconColor","disabledTextColor","disabledLeadingIconColor","MenuActionItem","onPressAction","dismissAll","submenuExpanded","setSubmenuExpanded","useState","hidden","subactions","displayInline","state","image","imageColor","leadingIconSource","elementColors","length","map","sub","expanded","onDismissRequest","properties","Trigger","enabled","disabled","onClick","LeadingIcon","source","size","tint","Items","TrailingIcon","MenuView","props","ref","actions","colorScheme","onOpenMenu","onCloseMenu","shouldOpenOnLongPress","style","children","testID","setExpanded","expandedRef","useRef","open","useCallback","current","useImperativeHandle","show","error","matchContents","onPress","onLongPress","android_disableSound","focusable","accessible"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAE/C,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SACEC,gBAAgB,QAEX,sDAAsD;AAC7D,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,UAAU,QAAQ,mCAAmC;AAC9D,SAASC,QAAQC,WAAW,QAAQ,6BAA6B;AACjE,SAASC,iBAAiB,QAAQ,+BAA+B;AAIjE,2GAA2G;AAC3G,MAAMC,mBAAoC;IAAEC,iBAAiB;AAAM;AAEnE,SAASC,SAASC,MAAkB;IAClC,OAAOA,OAAOC,EAAE,IAAID,OAAOE,KAAK;AAClC;AAEA,SAASC,UAAUH,MAAkB;IACnC,OAAO;QAAEI,aAAa;YAAEC,OAAON,SAASC;QAAQ;IAAE;AACpD;AAEA,SAASM,mBACPN,MAAkB,EAClBO,gBAAwB;IAExB,MAAMC,gBAAgBR,OAAOS,UAAU,EAAEC,gBAAgB;IACzD,MAAMC,YAAYX,OAAOY,UAAU,IAAKJ,CAAAA,gBAAgBD,mBAA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AAO,EAAE;QAC1BJ,YAAYI,OAAO,GAAG;QACtBL,YAAY;QACZL;IACF,GAAG;QAACA;KAAY;IAEhBpE,MAAM+E,mBAAmB,CAACf,KAAK,IAAO,CAAA;YAAEgB,MAAMJ;QAAK,CAAA,GAAI;QAACA;KAAK;IAE7D,MAAMtD,mBAAmBX,oBAAoBsE,KAAK;IAElD,qBACE,KAAC/E;QAAKoE,OAAOA;QAAOE,QAAQA;kBAC1B,cAAA,KAAClE;YAAK4D,aAAaA;YAAagB,aAAa;sBAC3C,cAAA,MAAC9E;gBACC6C,UAAUA;gBACVC,kBAAkBhB;gBAClBiB,YAAYvC;;kCACZ,KAACR,aAAagD,OAAO;kCACnB,cAAA,KAAC5C;4BAAW0E,aAAa;sCACvB,cAAA,KAACjF;gCACCkF,SAASd,wBAAwBzC,YAAYgD;gCAC7CQ,aAAaf,wBAAwBO,OAAOhD;gCAC5C,sEAAsE;gCACtE,gEAAgE;gCAChE,mEAAmE;gCACnEyD,oBAAoB;gCACpBC,WAAW;gCACXC,YAAY;0CACXhB;;;;kCAIP,KAACnE,aAAawD,KAAK;kCAChBK,QAAQlB,GAAG,CAAC,CAAChC,uBACZ,KAACiB;gCAECjB,QAAQA;gCACRkB,eAAeA;gCACfC,YAAYA;gCACZZ,kBAAkBA;+BAJbR,SAASC;;;;;;AAY9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle, ColorValue } from 'react-native';
|
|
3
|
-
import type { ModifierConfig } from '../../types';
|
|
3
|
+
import type { ModifierConfig, PopupProperties } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Props of the `DropdownMenu` component.
|
|
6
6
|
*/
|
|
@@ -37,6 +37,12 @@ export interface DropdownMenuProps {
|
|
|
37
37
|
* @platform android
|
|
38
38
|
*/
|
|
39
39
|
shadowElevation?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Properties for the popup window of the dropdown menu.
|
|
42
|
+
*
|
|
43
|
+
* @platform android
|
|
44
|
+
*/
|
|
45
|
+
properties?: PopupProperties;
|
|
40
46
|
/**
|
|
41
47
|
* Optional styles to apply to the `DropdownMenu`.
|
|
42
48
|
*/
|
|
@@ -79,3 +85,4 @@ declare namespace DropdownMenu {
|
|
|
79
85
|
}
|
|
80
86
|
export { DropdownMenu };
|
|
81
87
|
export { DropdownMenuItem } from './DropdownMenuItem';
|
|
88
|
+
export type { PopupProperties };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/DropdownMenu/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","PresentedContent","createViewModifierEventListener","MenuNativeView","SlotNativeView","Items","props","slotName","children","tag","Trigger","Preview","DropdownMenu","modifiers","restProps","style","undefined","DropdownMenuItem"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,gBAAgB,QAAQ,gCAAgC;AAEjE,SAASC,+BAA+B,QAAQ,qBAAqB;AAErE,MAAMC,iBAAuDH,kBAC3D,UACA;AAGF,2DAA2D;AAC3D,MAAMI,iBAGDJ,kBAAkB,UAAU;
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/DropdownMenu/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","PresentedContent","createViewModifierEventListener","MenuNativeView","SlotNativeView","Items","props","slotName","children","tag","Trigger","Preview","DropdownMenu","modifiers","restProps","style","undefined","DropdownMenuItem"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,gBAAgB,QAAQ,gCAAgC;AAEjE,SAASC,+BAA+B,QAAQ,qBAAqB;AAErE,MAAMC,iBAAuDH,kBAC3D,UACA;AAGF,2DAA2D;AAC3D,MAAMI,iBAGDJ,kBAAkB,UAAU;AA0EjC;;;CAGC,GACD,OAAO,SAASK,MAAMC,KAA8B;IAClD,oGAAoG;IACpG,qBACE,KAACF;QAAeG,UAAS;kBACvB,cAAA,KAACN;sBAAkBK,MAAME,QAAQ;;;AAGvC;AACAH,MAAMI,GAAG,GAAG;AAEZ;;CAEC,GACD,OAAO,SAASC,QAAQJ,KAA8B;IACpD,qBAAO;kBAAGA,MAAME,QAAQ;;AAC1B;AACAE,QAAQD,GAAG,GAAG;AAEd;;CAEC,GACD,OAAO,SAASE,QAAQL,KAA8B;IACpD,qBAAO;AACT;AAEA,SAASM,aAAaN,KAAwB;IAC5C,MAAM,EAAEO,SAAS,EAAE,GAAGC,WAAW,GAAGR;IACpC,qBACE,KAACH;QACCY,OAAOT,MAAMS,KAAK;QAClBF,WAAWA;QACV,GAAIA,YAAYX,gCAAgCW,aAAaG,SAAS;QACtE,GAAGF,SAAS;kBACZR,MAAME,QAAQ;;AAGrB;AAEAI,aAAaF,OAAO,GAAGA;AACvBE,aAAaD,OAAO,GAAGA;AACvBC,aAAaP,KAAK,GAAGA;AAErB,SAASO,YAAY,GAAG;AACxB,SAASK,gBAAgB,QAAQ,qBAAqB"}
|
|
@@ -2,12 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { requireNativeView } from 'expo';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { I18nManager, useColorScheme as useRNColorScheme } from 'react-native';
|
|
5
|
+
import { NativeTreeContext, useWarnIfNestedHost } from '../../NativeTreeContext';
|
|
5
6
|
import { TextInputHostProvider, useTextInputHostRef } from '../../keyboard';
|
|
6
7
|
import { useMergeRefs } from '../../utils/useMergeRefs';
|
|
7
8
|
import { getMaterialColors, HostPaletteContext } from '../colors';
|
|
8
9
|
const HostNativeView = requireNativeView('ExpoUI', 'HostView');
|
|
9
10
|
export function Host(props) {
|
|
10
|
-
const { matchContents, modifiers, onLayoutContent, layoutDirection, colorScheme, seedColor, ref, ...restProps } = props;
|
|
11
|
+
const { matchContents, modifiers, onLayoutContent, layoutDirection, colorScheme, seedColor, ref, children, ...restProps } = props;
|
|
11
12
|
const schemeString = colorScheme === 'light' || colorScheme === 'dark' ? colorScheme : undefined;
|
|
12
13
|
const systemScheme = useRNColorScheme();
|
|
13
14
|
const resolvedScheme = schemeString ?? (systemScheme === 'dark' ? 'dark' : 'light');
|
|
@@ -20,6 +21,7 @@ export function Host(props) {
|
|
|
20
21
|
]);
|
|
21
22
|
const hostRef = useTextInputHostRef();
|
|
22
23
|
const mergedRef = useMergeRefs(ref, hostRef);
|
|
24
|
+
useWarnIfNestedHost('Jetpack Compose');
|
|
23
25
|
return /*#__PURE__*/ _jsx(HostPaletteContext.Provider, {
|
|
24
26
|
value: palette,
|
|
25
27
|
children: /*#__PURE__*/ _jsx(TextInputHostProvider, {
|
|
@@ -33,7 +35,11 @@ export function Host(props) {
|
|
|
33
35
|
seedColor: seedColor,
|
|
34
36
|
onLayoutContent: onLayoutContent,
|
|
35
37
|
layoutDirection: layoutDirection ?? (I18nManager.getConstants().isRTL ? 'rightToLeft' : 'leftToRight'),
|
|
36
|
-
ref: mergedRef
|
|
38
|
+
ref: mergedRef,
|
|
39
|
+
children: /*#__PURE__*/ _jsx(NativeTreeContext.Provider, {
|
|
40
|
+
value: true,
|
|
41
|
+
children: children
|
|
42
|
+
})
|
|
37
43
|
})
|
|
38
44
|
})
|
|
39
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","useMemo","I18nManager","useColorScheme","useRNColorScheme","TextInputHostProvider","useTextInputHostRef","useMergeRefs","getMaterialColors","HostPaletteContext","HostNativeView","Host","props","matchContents","modifiers","onLayoutContent","layoutDirection","colorScheme","seedColor","ref","restProps","schemeString","undefined","systemScheme","resolvedScheme","palette","scheme","hostRef","mergedRef","Provider","value","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AACzC,SAASC,OAAO,QAAkB,QAAQ;AAC1C,SAKEC,WAAW,EACXC,kBAAkBC,gBAAgB,QAC7B,eAAe;AAEtB,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,YAAY;AAoElE,MAAMC,
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","useMemo","I18nManager","useColorScheme","useRNColorScheme","NativeTreeContext","useWarnIfNestedHost","TextInputHostProvider","useTextInputHostRef","useMergeRefs","getMaterialColors","HostPaletteContext","HostNativeView","Host","props","matchContents","modifiers","onLayoutContent","layoutDirection","colorScheme","seedColor","ref","children","restProps","schemeString","undefined","systemScheme","resolvedScheme","palette","scheme","hostRef","mergedRef","Provider","value","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AACzC,SAASC,OAAO,QAAkB,QAAQ;AAC1C,SAKEC,WAAW,EACXC,kBAAkBC,gBAAgB,QAC7B,eAAe;AAEtB,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACjF,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,YAAY;AAoElE,MAAMC,iBAAuDZ,kBAC3D,UACA;AAGF,OAAO,SAASa,KAAKC,KAAgB;IACnC,MAAM,EACJC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,WAAW,EACXC,SAAS,EACTC,GAAG,EACHC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IACJ,MAAMU,eAAeL,gBAAgB,WAAWA,gBAAgB,SAASA,cAAcM;IAEvF,MAAMC,eAAetB;IACrB,MAAMuB,iBAAiBH,gBAAiBE,CAAAA,iBAAiB,SAAS,SAAS,OAAM;IACjF,MAAME,UAAU3B,QACd,IAAMS,kBAAkB;YAAEmB,QAAQF;YAAgBP;QAAU,IAC5D;QAACO;QAAgBP;KAAU;IAE7B,MAAMU,UAAUtB;IAChB,MAAMuB,YAAYtB,aAAaY,KAAKS;IACpCxB,oBAAoB;IAEpB,qBACE,KAACK,mBAAmBqB,QAAQ;QAACC,OAAOL;kBAClC,cAAA,KAACrB;YAAsBuB,SAASA;sBAC9B,cAAA,KAAClB;gBACE,GAAGW,SAAS;gBACbP,WAAWA;gBACXkB,uBACE,OAAOnB,kBAAkB,WAAWA,cAAcoB,QAAQ,GAAGpB;gBAE/DqB,yBACE,OAAOrB,kBAAkB,WAAWA,cAAcsB,UAAU,GAAGtB;gBAEjEI,aAAaK;gBACbJ,WAAWA;gBACXH,iBAAiBA;gBACjBC,iBACEA,mBAAoBhB,CAAAA,YAAYoC,YAAY,GAAGC,KAAK,GAAG,gBAAgB,aAAY;gBAErFlB,KAAKU;0BACL,cAAA,KAAC1B,kBAAkB2B,QAAQ;oBAACC,KAAK;8BAAEX;;;;;AAK7C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
3
|
import { requireNativeView } from 'expo';
|
|
4
|
+
import { NativeTreeContext } from '../../NativeTreeContext';
|
|
4
5
|
import { PresentedContentContext, useIsPresentedInOwnWindow } from '../../PresentedContentContext';
|
|
5
6
|
import { resolveMatchContents } from '../../utils/matchContents';
|
|
6
7
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
@@ -32,7 +33,10 @@ export function RNHostView(props) {
|
|
|
32
33
|
key: `${nativeProps.matchContentsHorizontal}-${nativeProps.matchContentsVertical}`
|
|
33
34
|
}, /*#__PURE__*/ _jsx(PresentedContentContext.Provider, {
|
|
34
35
|
value: false,
|
|
35
|
-
children:
|
|
36
|
+
children: /*#__PURE__*/ _jsx(NativeTreeContext.Provider, {
|
|
37
|
+
value: false,
|
|
38
|
+
children: props.children
|
|
39
|
+
})
|
|
36
40
|
}));
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/RNHostView/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","PresentedContentContext","useIsPresentedInOwnWindow","resolveMatchContents","createViewModifierEventListener","NativeRNHostView","transformProps","props","layoutRoot","modifiers","matchContents","restProps","horizontal","matchContentsHorizontal","vertical","matchContentsVertical","undefined","expoInternalSizeFromChildren","RNHostView","nativeProps","key","Provider","value","children"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,uBAAuB,EAAEC,yBAAyB,QAAQ,gCAAgC;AAEnG,SAASC,oBAAoB,QAAQ,4BAA4B;AAEjE,SAASC,+BAA+B,QAAQ,qBAAqB;AAqCrE,MAAMC,
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/RNHostView/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","NativeTreeContext","PresentedContentContext","useIsPresentedInOwnWindow","resolveMatchContents","createViewModifierEventListener","NativeRNHostView","transformProps","props","layoutRoot","modifiers","matchContents","restProps","horizontal","matchContentsHorizontal","vertical","matchContentsVertical","undefined","expoInternalSizeFromChildren","RNHostView","nativeProps","key","Provider","value","children"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,uBAAuB,EAAEC,yBAAyB,QAAQ,gCAAgC;AAEnG,SAASC,oBAAoB,QAAQ,4BAA4B;AAEjE,SAASC,+BAA+B,QAAQ,qBAAqB;AAqCrE,MAAMC,mBAAqDN,kBACzD,UACA;AAGF,SAASO,eAAeC,KAAkB,EAAEC,UAAmB;IAC7D,MAAM,EAAEC,SAAS,EAAEC,aAAa,EAAE,GAAGC,WAAW,GAAGJ;IACnD,MAAM,EAAEK,YAAYC,uBAAuB,EAAEC,UAAUC,qBAAqB,EAAE,GAC5EZ,qBAAqBO;IACvB,OAAO;QACLD;QACA,GAAIA,YAAYL,gCAAgCK,aAAaO,SAAS;QACtE,GAAGL,SAAS;QACZH;QACAK;QACAE;QACAE,8BAA8BJ,2BAA2BE;IAC3D;AACF;AAEA,OAAO,SAASG,WAAWX,KAAkB;IAC3C,iGAAiG;IACjG,gGAAgG;IAChG,gGAAgG;IAChG,2EAA2E;IAC3E,MAAMC,aAAaN;IAEnB,MAAMiB,cAAcb,eAAeC,OAAOC;IAE1C,qBACE,eAACH;QACE,GAAGc,WAAW;QACf,iDAAiD;QACjD,mEAAmE;QACnEC,KAAK,GAAGD,YAAYN,uBAAuB,CAAC,CAAC,EAAEM,YAAYJ,qBAAqB,EAAE;qBAElF,KAACd,wBAAwBoB,QAAQ;QAACC,OAAO;kBAEvC,cAAA,KAACtB,kBAAkBqB,QAAQ;YAACC,OAAO;sBAAQf,MAAMgB,QAAQ;;;AAIjE"}
|
|
@@ -92,6 +92,16 @@ export type PieChartStyle = {
|
|
|
92
92
|
* Space between slices in points.
|
|
93
93
|
*/
|
|
94
94
|
angularInset?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Corner radius of each slice in points. On a donut, half the ring's thickness gives fully rounded ends.
|
|
97
|
+
* @default 0
|
|
98
|
+
*/
|
|
99
|
+
cornerRadius?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Opacity of each slice, from 0 to 1.
|
|
102
|
+
* @default 0.8
|
|
103
|
+
*/
|
|
104
|
+
opacity?: number;
|
|
95
105
|
};
|
|
96
106
|
/**
|
|
97
107
|
* Point chart specific styling options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["swift-ui/Chart/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createViewModifierEventListener","ChartNativeView","Chart","style","data","modifiers","referenceLines","props","undefined"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAGzC,SAASC,+BAA+B,QAAQ,qBAAqB;
|
|
1
|
+
{"version":3,"sources":["swift-ui/Chart/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createViewModifierEventListener","ChartNativeView","Chart","style","data","modifiers","referenceLines","props","undefined"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAGzC,SAASC,+BAA+B,QAAQ,qBAAqB;AAoNrE,MAAMC,kBAAmDF,kBAAkB,UAAU;AAErF;;;;CAIC,GACD,OAAO,SAASG,MAAM,EACpBC,KAAK,EACLC,IAAI,EACJC,SAAS,EACTC,cAAc,EACd,GAAGC,OAC2C;IAC9C,qBACE,KAACN;QACCG,MAAMA;QACNE,gBAAgBA;QAChBD,WAAWA;QACV,GAAIA,YAAYL,gCAAgCK,aAAaG,SAAS;QACtE,GAAGD,KAAK;;AAGf"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { requireNativeView } from 'expo';
|
|
3
3
|
import { I18nManager } from 'react-native';
|
|
4
|
+
import { NativeTreeContext, useWarnIfNestedHost } from '../../NativeTreeContext';
|
|
4
5
|
import { TextInputHostProvider, useTextInputHostRef } from '../../keyboard';
|
|
5
6
|
import { useMergeRefs } from '../../utils/useMergeRefs';
|
|
6
7
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
@@ -8,9 +9,10 @@ const HostNativeView = requireNativeView('ExpoUI', 'HostView');
|
|
|
8
9
|
/**
|
|
9
10
|
* A hosting component for SwiftUI views.
|
|
10
11
|
*/ export function Host(props) {
|
|
11
|
-
const { matchContents, onLayoutContent, ignoreSafeArea, modifiers, layoutDirection, seedColor, ref, ...restProps } = props;
|
|
12
|
+
const { matchContents, onLayoutContent, ignoreSafeArea, modifiers, layoutDirection, seedColor, ref, children, ...restProps } = props;
|
|
12
13
|
const hostRef = useTextInputHostRef();
|
|
13
14
|
const mergedRef = useMergeRefs(ref, hostRef);
|
|
15
|
+
useWarnIfNestedHost('SwiftUI');
|
|
14
16
|
return /*#__PURE__*/ _jsx(TextInputHostProvider, {
|
|
15
17
|
hostRef: hostRef,
|
|
16
18
|
children: /*#__PURE__*/ _jsx(HostNativeView, {
|
|
@@ -23,7 +25,11 @@ const HostNativeView = requireNativeView('ExpoUI', 'HostView');
|
|
|
23
25
|
ignoreSafeArea: ignoreSafeArea,
|
|
24
26
|
seedColor: seedColor,
|
|
25
27
|
...restProps,
|
|
26
|
-
ref: mergedRef
|
|
28
|
+
ref: mergedRef,
|
|
29
|
+
children: /*#__PURE__*/ _jsx(NativeTreeContext.Provider, {
|
|
30
|
+
value: true,
|
|
31
|
+
children: children
|
|
32
|
+
})
|
|
27
33
|
})
|
|
28
34
|
});
|
|
29
35
|
}
|