@expo/ui 58.0.8 → 58.0.10
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 -5
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +40 -8
- package/android/src/main/java/expo/modules/ui/ComposeViews.kt +21 -3
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +12 -4
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +5 -1
- package/android/src/main/java/expo/modules/ui/HorizontalPagerView.kt +3 -1
- package/android/src/main/java/expo/modules/ui/HostView.kt +64 -12
- package/android/src/main/java/expo/modules/ui/LazyItemsView.kt +14 -2
- package/android/src/main/java/expo/modules/ui/ModalBottomSheetView.kt +5 -1
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +29 -4
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +68 -17
- package/android/src/main/java/expo/modules/ui/ShapeView.kt +3 -1
- package/android/src/main/java/expo/modules/ui/SlotView.kt +3 -1
- package/android/src/main/java/expo/modules/ui/SnackbarView.kt +5 -1
- package/android/src/main/java/expo/modules/ui/TextView.kt +3 -1
- package/android/src/main/java/expo/modules/ui/Utils.kt +3 -1
- package/android/src/main/java/expo/modules/ui/colors/MaterialColors.kt +5 -1
- package/android/src/main/java/expo/modules/ui/convertibles/AnimationSpecParams.kt +3 -1
- package/android/src/main/java/expo/modules/ui/graphics/ImageLoader.kt +6 -2
- package/android/src/main/java/expo/modules/ui/icon/IconView.kt +5 -1
- package/android/src/main/java/expo/modules/ui/state/ObservableState.kt +3 -1
- package/android/src/main/java/expo/modules/ui/textfield/BasicTextField.kt +10 -2
- package/android/src/main/java/expo/modules/ui/textfield/TextField.kt +20 -4
- package/android/src/main/java/expo/modules/ui/textfield/TextFieldShared.kt +3 -1
- package/build/community/picker/Picker.android.js +7 -0
- package/build/community/picker/Picker.android.js.map +1 -1
- package/build/jetpack-compose/LazyColumn/index.d.ts +2 -1
- package/build/jetpack-compose/LazyColumn/index.js +1 -0
- package/build/jetpack-compose/LazyColumn/index.js.map +1 -1
- package/build/jetpack-compose/LazyItems/index.d.ts +19 -18
- package/build/jetpack-compose/LazyItems/index.js +1 -2
- package/build/jetpack-compose/LazyItems/index.js.map +1 -1
- package/build/jetpack-compose/LazyRow/index.d.ts +2 -1
- package/build/jetpack-compose/LazyRow/index.js +1 -0
- package/build/jetpack-compose/LazyRow/index.js.map +1 -1
- package/build/jetpack-compose/RNHostView/index.d.ts +6 -1
- package/build/jetpack-compose/RNHostView/index.js +9 -4
- package/build/jetpack-compose/RNHostView/index.js.map +1 -1
- package/build/jetpack-compose/index.d.ts +0 -1
- package/build/jetpack-compose/index.js.map +1 -1
- package/build/jetpack-compose/modifiers/index.d.ts +18 -3
- package/build/jetpack-compose/modifiers/index.js +15 -2
- package/build/jetpack-compose/modifiers/index.js.map +1 -1
- package/build/swift-ui/LazyHStack/index.d.ts +45 -0
- package/build/swift-ui/LazyHStack/index.js +9 -0
- package/build/swift-ui/LazyHStack/index.js.map +1 -1
- package/build/swift-ui/LazyStackForEach/index.d.ts +44 -0
- package/build/swift-ui/LazyStackForEach/index.js +54 -0
- package/build/swift-ui/LazyStackForEach/index.js.map +1 -0
- package/build/swift-ui/LazyVStack/index.d.ts +45 -0
- package/build/swift-ui/LazyVStack/index.js +9 -0
- package/build/swift-ui/LazyVStack/index.js.map +1 -1
- package/build/swift-ui/List/DataListForEach.d.ts +6 -7
- package/build/swift-ui/List/DataListForEach.js.map +1 -1
- package/build/swift-ui/List/ListForEach.d.ts +7 -1
- package/build/swift-ui/List/ListForEach.js +1 -5
- package/build/swift-ui/List/ListForEach.js.map +1 -1
- package/build/swift-ui/RNHostView.d.ts +7 -2
- package/build/swift-ui/RNHostView.js +7 -3
- package/build/swift-ui/RNHostView.js.map +1 -1
- package/build/swift-ui/index.d.ts +1 -0
- package/build/swift-ui/index.js.map +1 -1
- package/build/swift-ui/modifiers/containerBackground.d.ts +2 -2
- package/build/swift-ui/modifiers/containerBackground.js +2 -2
- package/build/swift-ui/modifiers/index.d.ts +9 -1
- package/build/swift-ui/modifiers/index.js +9 -0
- package/build/swift-ui/modifiers/index.js.map +1 -1
- package/build/universal/ListItem/ListItem.js +11 -2
- package/build/universal/ListItem/ListItem.js.map +1 -1
- package/build/universal/RNHostView/index.js +12 -5
- package/build/universal/RNHostView/index.js.map +1 -1
- package/build/universal/RNHostView/types.d.ts +9 -4
- package/build/universal/RNHostView/types.js.map +1 -1
- package/build/universal/Switch/index.android.js +5 -1
- package/build/universal/Switch/index.android.js.map +1 -1
- package/build/utils/matchContents.d.ts +10 -0
- package/build/utils/matchContents.js +16 -0
- package/build/utils/matchContents.js.map +1 -0
- package/expo-module.config.json +0 -1
- package/ios/DataListForEachView.swift +65 -28
- package/ios/ExpoUIModule.swift +0 -1
- package/ios/LazyHStackView.swift +3 -0
- package/ios/LazyVStackView.swift +3 -0
- package/ios/ListView.swift +8 -0
- package/ios/Modifiers/ContainerBackgroundModifier.swift +23 -16
- package/ios/Modifiers/PreferredColorSchemeModifier.swift +12 -0
- package/ios/Modifiers/View+ModifierArray.swift +3 -3
- package/ios/Modifiers/ViewModifierRegistry.swift +11 -9
- package/ios/Modifiers/WidgetKitModifiers.swift +13 -0
- package/ios/RNHostView.swift +55 -9
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.8/expo.modules.ui-58.0.8.module → 58.0.10/expo.modules.ui-58.0.10.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.8/expo.modules.ui-58.0.8.pom → 58.0.10/expo.modules.ui-58.0.10.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.pom.sha512 +1 -0
- package/package.json +3 -3
- package/prebuilds/output/debug/xcframeworks/ExpoUI.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoUI.tar.gz +0 -0
- package/src/community/picker/Picker.android.tsx +5 -0
- package/src/jetpack-compose/LazyColumn/index.tsx +2 -0
- package/src/jetpack-compose/LazyItems/index.tsx +18 -21
- package/src/jetpack-compose/LazyRow/index.tsx +2 -0
- package/src/jetpack-compose/RNHostView/index.tsx +17 -6
- package/src/jetpack-compose/index.ts +0 -1
- package/src/jetpack-compose/modifiers/index.ts +16 -3
- package/src/swift-ui/LazyHStack/index.tsx +45 -0
- package/src/swift-ui/LazyStackForEach/index.tsx +110 -0
- package/src/swift-ui/LazyVStack/index.tsx +45 -0
- package/src/swift-ui/List/DataListForEach.tsx +7 -8
- package/src/swift-ui/List/ListForEach.tsx +10 -3
- package/src/swift-ui/RNHostView.tsx +11 -4
- package/src/swift-ui/index.tsx +1 -0
- package/src/swift-ui/modifiers/containerBackground.ts +2 -2
- package/src/swift-ui/modifiers/index.ts +11 -0
- package/src/universal/ListItem/ListItem.tsx +10 -1
- package/src/universal/RNHostView/index.tsx +8 -3
- package/src/universal/RNHostView/types.ts +6 -4
- package/src/universal/Switch/index.android.tsx +11 -2
- package/src/utils/matchContents.ts +14 -0
- package/ios/AccessoryWidgetBackgroundView.swift +0 -27
- package/ios/Modifiers/WidgetModifiers.swift +0 -70
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.pom.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +0 -13
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +0 -1
|
@@ -38,7 +38,11 @@ internal fun Context.isSystemInDarkTheme(): Boolean {
|
|
|
38
38
|
* Allows `expo-widgets` to back `getMaterialColors` inside the widgets JS runtime.
|
|
39
39
|
*/
|
|
40
40
|
fun getMaterialColorTokens(context: Context, isDark: Boolean): Map<String, String> {
|
|
41
|
-
val scheme = if (isDark)
|
|
41
|
+
val scheme = if (isDark) {
|
|
42
|
+
ExpoColorScheme.DARK
|
|
43
|
+
} else {
|
|
44
|
+
ExpoColorScheme.LIGHT
|
|
45
|
+
}
|
|
42
46
|
return scheme.toColorScheme(context).toTokenMap()
|
|
43
47
|
}
|
|
44
48
|
|
|
@@ -87,7 +87,9 @@ internal data class KeyframesSpecParams(
|
|
|
87
87
|
|
|
88
88
|
@Suppress("UNCHECKED_CAST")
|
|
89
89
|
internal fun parseAnimationSpec(raw: Any?, converterContext: ConverterContext): AnimationSpec<Float>? {
|
|
90
|
-
if (raw !is Map<*, *>)
|
|
90
|
+
if (raw !is Map<*, *>) {
|
|
91
|
+
return null
|
|
92
|
+
}
|
|
91
93
|
val map = raw as Map<String, Any?>
|
|
92
94
|
return when (raw["\$type"]) {
|
|
93
95
|
"spring" -> recordFromMap<SpringSpecParams>(map, converterContext).toAnimationSpec()
|
|
@@ -199,7 +199,9 @@ class ImageLoader(
|
|
|
199
199
|
* Detect if byte array contains XML content.
|
|
200
200
|
*/
|
|
201
201
|
private fun isXmlContent(bytes: ByteArray): Boolean {
|
|
202
|
-
if (bytes.size < 5)
|
|
202
|
+
if (bytes.size < 5) {
|
|
203
|
+
return false
|
|
204
|
+
}
|
|
203
205
|
|
|
204
206
|
// Check for UTF-8 BOM
|
|
205
207
|
var offset = 0
|
|
@@ -211,7 +213,9 @@ class ImageLoader(
|
|
|
211
213
|
// Check if content starts with '<' (possibly with leading whitespace)
|
|
212
214
|
for (i in offset until minOf(offset + 10, bytes.size)) {
|
|
213
215
|
val b = bytes[i]
|
|
214
|
-
if (b == '<'.code.toByte())
|
|
216
|
+
if (b == '<'.code.toByte()) {
|
|
217
|
+
return true
|
|
218
|
+
}
|
|
215
219
|
if (b != ' '.code.toByte() && b != '\t'.code.toByte() &&
|
|
216
220
|
b != '\n'.code.toByte() && b != '\r'.code.toByte()
|
|
217
221
|
) {
|
|
@@ -83,7 +83,11 @@ class IconView(context: Context, appContext: AppContext) :
|
|
|
83
83
|
// Render icon if painter available
|
|
84
84
|
if (painter != null) {
|
|
85
85
|
val resolvedTint = tint?.compose
|
|
86
|
-
?: if (inheritTint)
|
|
86
|
+
?: if (inheritTint) {
|
|
87
|
+
LocalContentColor.current
|
|
88
|
+
} else {
|
|
89
|
+
androidx.compose.ui.graphics.Color.Unspecified
|
|
90
|
+
}
|
|
87
91
|
Icon(
|
|
88
92
|
painter = painter,
|
|
89
93
|
contentDescription = contentDescription,
|
|
@@ -19,7 +19,9 @@ class ObservableState(initialValue: Any? = null) : SharedObject() {
|
|
|
19
19
|
set(v) {
|
|
20
20
|
_state.value = v
|
|
21
21
|
// Skip re-invoking onChange if state.value was written from inside onChange.
|
|
22
|
-
if (isNotifying)
|
|
22
|
+
if (isNotifying) {
|
|
23
|
+
return
|
|
24
|
+
}
|
|
23
25
|
isNotifying = true
|
|
24
26
|
try {
|
|
25
27
|
onChange?.invoke(v)
|
|
@@ -145,11 +145,19 @@ fun FunctionalComposableScope.BasicTextFieldContent(
|
|
|
145
145
|
)
|
|
146
146
|
|
|
147
147
|
val singleLine = props.singleLine
|
|
148
|
-
val maxLines = props.maxLines ?: if (singleLine)
|
|
148
|
+
val maxLines = props.maxLines ?: if (singleLine) {
|
|
149
|
+
1
|
|
150
|
+
} else {
|
|
151
|
+
Int.MAX_VALUE
|
|
152
|
+
}
|
|
149
153
|
val minLines = props.minLines ?: 1
|
|
150
154
|
|
|
151
155
|
val textStyle = props.textStyle.toTextStyle(appContext.reactContext).let {
|
|
152
|
-
if (it.color.isUnspecified)
|
|
156
|
+
if (it.color.isUnspecified) {
|
|
157
|
+
it.copy(color = MaterialTheme.colorScheme.onSurface)
|
|
158
|
+
} else {
|
|
159
|
+
it
|
|
160
|
+
}
|
|
153
161
|
}
|
|
154
162
|
val visualTransformation = props.visualTransformation.toVisualTransformation()
|
|
155
163
|
val cursorBrush = SolidColor(props.cursorColor.composeOrNull ?: MaterialTheme.colorScheme.primary)
|
|
@@ -106,7 +106,11 @@ data class TextFieldSelectionColorsRecord(
|
|
|
106
106
|
|
|
107
107
|
@Composable
|
|
108
108
|
fun TextFieldColorsRecord.toColors(isOutlined: Boolean): TextFieldColors {
|
|
109
|
-
val defaults = if (isOutlined)
|
|
109
|
+
val defaults = if (isOutlined) {
|
|
110
|
+
OutlinedTextFieldDefaults.colors()
|
|
111
|
+
} else {
|
|
112
|
+
TextFieldDefaults.colors()
|
|
113
|
+
}
|
|
110
114
|
// Outlined and Filled TextField both use TextFieldDefault.colors
|
|
111
115
|
return TextFieldDefaults.colors(
|
|
112
116
|
focusedTextColor = focusedTextColor.composeOrNull ?: defaults.focusedTextColor,
|
|
@@ -229,14 +233,26 @@ fun FunctionalComposableScope.TextFieldContent(
|
|
|
229
233
|
|
|
230
234
|
// Lines
|
|
231
235
|
val singleLine = props.singleLine
|
|
232
|
-
val maxLines = props.maxLines ?: if (singleLine)
|
|
236
|
+
val maxLines = props.maxLines ?: if (singleLine) {
|
|
237
|
+
1
|
|
238
|
+
} else {
|
|
239
|
+
Int.MAX_VALUE
|
|
240
|
+
}
|
|
233
241
|
val minLines = props.minLines ?: 1
|
|
234
242
|
|
|
235
243
|
val isOutlined = props.variant == TextFieldVariant.OUTLINED
|
|
236
244
|
val shape = shapeFromShapeRecord(props.shape)
|
|
237
|
-
?: if (isOutlined)
|
|
245
|
+
?: if (isOutlined) {
|
|
246
|
+
OutlinedTextFieldDefaults.shape
|
|
247
|
+
} else {
|
|
248
|
+
TextFieldDefaults.shape
|
|
249
|
+
}
|
|
238
250
|
val baseColors = props.colors?.toColors(isOutlined)
|
|
239
|
-
?: if (isOutlined)
|
|
251
|
+
?: if (isOutlined) {
|
|
252
|
+
OutlinedTextFieldDefaults.colors()
|
|
253
|
+
} else {
|
|
254
|
+
TextFieldDefaults.colors()
|
|
255
|
+
}
|
|
240
256
|
val colors = props.textSelectionColors?.let { record ->
|
|
241
257
|
val handle = record.handleColor.composeOrNull
|
|
242
258
|
val background = record.backgroundColor.composeOrNull
|
|
@@ -119,7 +119,9 @@ internal fun String?.toVisualTransformation(): VisualTransformation = when (this
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
internal fun TextFieldTextStyleRecord?.toTextStyle(context: Context?): TextStyle {
|
|
122
|
-
if (this == null)
|
|
122
|
+
if (this == null) {
|
|
123
|
+
return TextStyle.Default
|
|
124
|
+
}
|
|
123
125
|
return TextStyle(
|
|
124
126
|
color = colorToComposeColorOrNull(color) ?: androidx.compose.ui.graphics.Color.Unspecified,
|
|
125
127
|
fontSize = fontSize?.sp ?: TextUnit.Unspecified,
|
|
@@ -22,6 +22,13 @@ import { extractPickerItems, PickerItem } from './types';
|
|
|
22
22
|
const selectedItem = items.find((item)=>item.value === selectedValue);
|
|
23
23
|
const selectedLabel = selectedItem?.label ?? '';
|
|
24
24
|
const labelState = useNativeState(selectedLabel);
|
|
25
|
+
// `useNativeState` only captures its initial value, so push later changes to the field.
|
|
26
|
+
React.useEffect(()=>{
|
|
27
|
+
labelState.set(selectedLabel);
|
|
28
|
+
}, [
|
|
29
|
+
labelState,
|
|
30
|
+
selectedLabel
|
|
31
|
+
]);
|
|
25
32
|
return /*#__PURE__*/ _jsx(Host, {
|
|
26
33
|
style: style,
|
|
27
34
|
matchContents: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/picker/Picker.android.tsx"],"sourcesContent":[null],"names":["React","useNativeState","DropdownMenuItem","ExposedDropdownMenuBox","ExposedDropdownMenu","Host","Text","TextField","menuAnchor","extractPickerItems","PickerItem","Picker","props","selectedValue","onValueChange","enabled","style","children","ref","items","expanded","setExpanded","useState","useImperativeHandle","focus","blur","selectedItem","find","item","value","selectedLabel","label","labelState","matchContents","vertical","onExpandedChange","undefined","readOnly","modifiers","onDismissRequest","map","index","onClick","color","fontFamily","fontSize","background","backgroundColor","String","Item"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,gBAAgB,QAAQ,sDAAsD;AACvF,SACEC,sBAAsB,EACtBC,mBAAmB,QACd,+CAA+C;AACtD,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,UAAU,QAAQ,kCAAkC;AAC7D,SACEC,kBAAkB,EAClBC,UAAU,QAIL,UAAU;AAEjB;;;CAGC,GACD,OAAO,SAASC,OAAkCC,KAAqB;IACrE,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,GAAG,EAAE,GAAGN;IACxE,MAAMO,QAAQV,mBAAsBQ;IACpC,MAAM,CAACG,UAAUC,YAAY,GAAGrB,MAAMsB,QAAQ,CAAC;IAE/CtB,MAAMuB,mBAAmB,CAACL,KAAK,IAAO,CAAA;YACpCM,OAAO,IAAMH,YAAY;YACzBI,MAAM,IAAMJ,YAAY;QAC1B,CAAA;IAEA,MAAMK,eAAeP,MAAMQ,IAAI,CAAC,CAACC,OAASA,KAAKC,KAAK,KAAKhB;IACzD,MAAMiB,gBAAgBJ,cAAcK,SAAS;IAC7C,MAAMC,aAAa/B,eAAe6B;IAElC,qBACE,KAACzB;QAAKW,OAAOA;
|
|
1
|
+
{"version":3,"sources":["community/picker/Picker.android.tsx"],"sourcesContent":[null],"names":["React","useNativeState","DropdownMenuItem","ExposedDropdownMenuBox","ExposedDropdownMenu","Host","Text","TextField","menuAnchor","extractPickerItems","PickerItem","Picker","props","selectedValue","onValueChange","enabled","style","children","ref","items","expanded","setExpanded","useState","useImperativeHandle","focus","blur","selectedItem","find","item","value","selectedLabel","label","labelState","useEffect","set","matchContents","vertical","onExpandedChange","undefined","readOnly","modifiers","onDismissRequest","map","index","onClick","color","fontFamily","fontSize","background","backgroundColor","String","Item"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,gBAAgB,QAAQ,sDAAsD;AACvF,SACEC,sBAAsB,EACtBC,mBAAmB,QACd,+CAA+C;AACtD,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,UAAU,QAAQ,kCAAkC;AAC7D,SACEC,kBAAkB,EAClBC,UAAU,QAIL,UAAU;AAEjB;;;CAGC,GACD,OAAO,SAASC,OAAkCC,KAAqB;IACrE,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,GAAG,EAAE,GAAGN;IACxE,MAAMO,QAAQV,mBAAsBQ;IACpC,MAAM,CAACG,UAAUC,YAAY,GAAGrB,MAAMsB,QAAQ,CAAC;IAE/CtB,MAAMuB,mBAAmB,CAACL,KAAK,IAAO,CAAA;YACpCM,OAAO,IAAMH,YAAY;YACzBI,MAAM,IAAMJ,YAAY;QAC1B,CAAA;IAEA,MAAMK,eAAeP,MAAMQ,IAAI,CAAC,CAACC,OAASA,KAAKC,KAAK,KAAKhB;IACzD,MAAMiB,gBAAgBJ,cAAcK,SAAS;IAC7C,MAAMC,aAAa/B,eAAe6B;IAElC,wFAAwF;IACxF9B,MAAMiC,SAAS,CAAC;QACdD,WAAWE,GAAG,CAACJ;IACjB,GAAG;QAACE;QAAYF;KAAc;IAE9B,qBACE,KAACzB;QAAKW,OAAOA;QAAOmB,eAAe;YAAEC,UAAU;QAAK;kBAClD,cAAA,MAACjC;YACCiB,UAAUA;YACViB,kBAAkBtB,YAAY,QAAQuB,YAAYjB;;8BAClD,KAACd;oBAAUsB,OAAOG;oBAAYO,QAAQ;oBAACxB,SAASA;oBAASyB,WAAW;wBAAChC;qBAAa;;8BAClF,KAACJ;oBAAoBgB,UAAUA;oBAAUqB,kBAAkB,IAAMpB,YAAY;8BAC1EF,MAAMuB,GAAG,CAAC,CAACd,MAAMe,sBAChB,KAACzC;4BAECa,SAASa,KAAKb,OAAO;4BACrB6B,SAAS;gCACP9B,gBAAgBc,KAAKC,KAAK,EAAEc;gCAC5BtB,YAAY;4BACd;sCACA,cAAA,KAACnB,iBAAiBI,IAAI;0CACpB,cAAA,KAACA;oCACCuC,OAAOjB,KAAKiB,KAAK;oCACjB7B,OAAO;wCACL8B,YAAYlB,KAAKkB,UAAU;wCAC3BC,UAAUnB,KAAKmB,QAAQ;wCACvBC,YAAYpB,KAAKqB,eAAe;oCAClC;8CACCrB,KAAKG,KAAK;;;2BAdVmB,OAAOtB,KAAKC,KAAK,IAAIc;;;;;AAuBxC;AAEAhC,OAAOwC,IAAI,GAAGzC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExpoModifier } from '../../types';
|
|
2
|
+
export { LazyItems, type LazyItemsProps } from '../LazyItems';
|
|
2
3
|
/**
|
|
3
4
|
* Content padding values for LazyColumn.
|
|
4
5
|
*/
|
|
@@ -51,7 +52,7 @@ export interface LazyColumnProps {
|
|
|
51
52
|
export declare function LazyColumn(props: LazyColumnProps): import("react").JSX.Element;
|
|
52
53
|
export declare namespace LazyColumn {
|
|
53
54
|
var Items: {
|
|
54
|
-
<
|
|
55
|
+
<T>({ recycling, ...props }: import(".").LazyItemsProps<T>): import("react").JSX.Element;
|
|
55
56
|
displayName: string;
|
|
56
57
|
};
|
|
57
58
|
}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { requireNativeView } from 'expo';
|
|
3
3
|
import { LazyItems } from '../LazyItems';
|
|
4
4
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
export { LazyItems } from '../LazyItems';
|
|
5
6
|
const LazyColumnNativeView = requireNativeView('ExpoUI', 'LazyColumnView');
|
|
6
7
|
function transformProps(props) {
|
|
7
8
|
const { modifiers, ...restProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/LazyColumn/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","LazyItems","createViewModifierEventListener","LazyColumnNativeView","transformProps","props","modifiers","restProps","undefined","LazyColumn","Items"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAGzC,SAASC,SAAS,QAAQ,eAAe;AACzC,SAASC,+BAA+B,QAAQ,qBAAqB;
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/LazyColumn/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","LazyItems","createViewModifierEventListener","LazyColumnNativeView","transformProps","props","modifiers","restProps","undefined","LazyColumn","Items"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAGzC,SAASC,SAAS,QAAQ,eAAe;AACzC,SAASC,+BAA+B,QAAQ,qBAAqB;AAErE,SAASD,SAAS,QAA6B,eAAe;AAwD9D,MAAME,uBAAmEH,kBACvE,UACA;AAGF,SAASI,eAAeC,KAAsB;IAC5C,MAAM,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGF;IACpC,OAAO;QACLC;QACA,GAAIA,YAAYJ,gCAAgCI,aAAaE,SAAS;QACtE,GAAGD,SAAS;IACd;AACF;AAEA;;CAEC,GACD,OAAO,SAASE,WAAWJ,KAAsB;IAC/C,qBAAO,KAACF;QAAsB,GAAGC,eAAeC,MAAM;;AACxD;AAEAI,WAAWC,KAAK,GAAGT"}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface LazyItemsProps<
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
export interface LazyItemsProps<T> {
|
|
3
3
|
/** Items to display. Replace the array when updating data. */
|
|
4
|
-
data: readonly
|
|
4
|
+
data: readonly T[];
|
|
5
5
|
/** Returns a stable, unique string key, also used as the lazy list item key. */
|
|
6
|
-
keyExtractor: (item:
|
|
6
|
+
keyExtractor: (item: T, index: number) => string;
|
|
7
7
|
/**
|
|
8
|
-
* Renders
|
|
9
|
-
* Recycled
|
|
10
|
-
* Reset it when the item changes, or keep the state outside the
|
|
8
|
+
* Renders an item. Wrap it in `useCallback`, or every item re-renders on each parent render.
|
|
9
|
+
* Recycled views are reused for other items, so their local state (`useState`) carries over.
|
|
10
|
+
* Reset it when the item changes, or keep the state outside the view.
|
|
11
11
|
*/
|
|
12
|
-
children:
|
|
12
|
+
children: (info: {
|
|
13
|
+
item: T;
|
|
14
|
+
index: number;
|
|
15
|
+
}) => ReactElement;
|
|
13
16
|
/**
|
|
14
|
-
* Renders only the
|
|
15
|
-
* render every
|
|
17
|
+
* Renders only the items near the visible range and reuses them while scrolling. Set to `false`
|
|
18
|
+
* to render every item at once. Set it once; changing it remounts the items.
|
|
16
19
|
* @default true
|
|
17
20
|
*/
|
|
18
21
|
recycling?: boolean;
|
|
19
22
|
/**
|
|
20
|
-
* Extra
|
|
23
|
+
* Extra items to prepare on each side of the visible items. Must be a non-negative integer.
|
|
21
24
|
* Ignored when `recycling` is `false`.
|
|
22
25
|
* @default 10
|
|
23
26
|
*/
|
|
24
27
|
overscanCount?: number;
|
|
25
28
|
/**
|
|
26
|
-
* Placeholder size in dp along the scroll axis, until
|
|
27
|
-
*
|
|
28
|
-
* width changes. Ignored when `recycling` is `false`.
|
|
29
|
+
* Placeholder size in dp along the scroll axis, until an item is measured. Must be positive.
|
|
30
|
+
* Ignored when `recycling` is `false`.
|
|
29
31
|
* @default 64
|
|
30
32
|
*/
|
|
31
33
|
estimatedItemSize?: number;
|
|
@@ -36,12 +38,11 @@ export interface LazyItemsProps<ItemT> {
|
|
|
36
38
|
* so large data sets stay cheap. Rows that are not ready yet show a placeholder of
|
|
37
39
|
* `estimatedItemSize`, or of the size last measured for that item.
|
|
38
40
|
*
|
|
39
|
-
* Mount it as a direct child of `LazyColumn` or `LazyRow`.
|
|
40
|
-
* single items, so static and recycled content can be mixed in order.
|
|
41
|
+
* Mount it as a direct child of `LazyColumn` or `LazyRow`.
|
|
41
42
|
* @platform android
|
|
42
43
|
*/
|
|
43
44
|
export declare const LazyItems: {
|
|
44
|
-
<
|
|
45
|
+
<T>({ recycling, ...props }: LazyItemsProps<T>): import("react").JSX.Element;
|
|
45
46
|
displayName: string;
|
|
46
47
|
};
|
|
47
48
|
/**
|
|
@@ -49,6 +50,6 @@ export declare const LazyItems: {
|
|
|
49
50
|
* Creates the `Items` component of one lazy list, so its errors name that list.
|
|
50
51
|
*/
|
|
51
52
|
export declare function createLazyItems(componentName: string): {
|
|
52
|
-
<
|
|
53
|
+
<T>({ recycling, ...props }: LazyItemsProps<T>): import("react").JSX.Element;
|
|
53
54
|
displayName: string;
|
|
54
55
|
};
|
|
@@ -11,8 +11,7 @@ const LazyItemsPoolNativeView = requireNativeView('ExpoUI', 'LazyItemsPoolView')
|
|
|
11
11
|
* so large data sets stay cheap. Rows that are not ready yet show a placeholder of
|
|
12
12
|
* `estimatedItemSize`, or of the size last measured for that item.
|
|
13
13
|
*
|
|
14
|
-
* Mount it as a direct child of `LazyColumn` or `LazyRow`.
|
|
15
|
-
* single items, so static and recycled content can be mixed in order.
|
|
14
|
+
* Mount it as a direct child of `LazyColumn` or `LazyRow`.
|
|
16
15
|
* @platform android
|
|
17
16
|
*/ export const LazyItems = createLazyItems('LazyColumn.Items');
|
|
18
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/LazyItems/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","Fragment","useItemKeys","useRecycledRows","LazyItemsNativeView","LazyItemsSlotNativeView","LazyItemsPoolNativeView","LazyItems","createLazyItems","componentName","Items","recycling","props","RecycledItems","StaticItems","data","keyExtractor","children","renderItem","itemKeys","map","item","index","overscanCount","estimatedItemSize","revision","rows","onWindowChange","Slot","nativeEvent","displayName"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAA2B,QAAQ;AAEpD,SACEC,WAAW,EACXC,eAAe,
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/LazyItems/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","Fragment","useItemKeys","useRecycledRows","LazyItemsNativeView","LazyItemsSlotNativeView","LazyItemsPoolNativeView","LazyItems","createLazyItems","componentName","Items","recycling","props","RecycledItems","StaticItems","data","keyExtractor","children","renderItem","itemKeys","map","item","index","overscanCount","estimatedItemSize","revision","rows","onWindowChange","Slot","nativeEvent","displayName"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAA2B,QAAQ;AAEpD,SACEC,WAAW,EACXC,eAAe,QAGV,kCAAkC;AAyCzC,MAAMC,sBACJJ,kBAAwC,UAAU;AACpD,MAAMK,0BACJL,kBAAqC,UAAU;AACjD,MAAMM,0BACJN,kBAAkB,UAAU;AAE9B;;;;;;;;CAQC,GACD,OAAO,MAAMO,YAAYC,gBAAgB,oBAAoB;AAE7D;;;CAGC,GACD,OAAO,SAASA,gBAAgBC,aAAqB;IACnD,SAASC,MAAS,EAAEC,YAAY,IAAI,EAAE,GAAGC,OAA0B;QACjE,OAAOD,0BAAY,KAACE;YAAe,GAAGD,KAAK;2BAAO,KAACE;YAAa,GAAGF,KAAK;;IAC1E;IAEA,2EAA2E;IAC3E,SAASE,YAAe,EACtBC,IAAI,EACJC,YAAY,EACZC,UAAUC,UAAU,EACiB;QACrC,MAAMC,WAAWjB,YAAYO,eAAeM,MAAMC;QAClD,OAAOD,KAAKK,GAAG,CAAC,CAACC,MAAMC,sBACrB,KAACrB;0BAAgCiB,WAAW;oBAAEG;oBAAMC;gBAAM;eAA3CH,QAAQ,CAACG,MAAM;IAElC;IAEA,SAAST,cAAiB,EACxBE,IAAI,EACJC,YAAY,EACZC,UAAUC,UAAU,EACpBK,aAAa,EACbC,oBAAoB,EAAE,EACe;QACrC,MAAM,EAAEL,QAAQ,EAAEM,QAAQ,EAAEC,IAAI,EAAEC,cAAc,EAAE,GAAGxB,gBAAgB;YACnEM;YACAmB,MAAMvB;YACNU;YACAC;YACAE;YACAK;YACAC;QACF;QAEA,qBACE,KAACpB;YACCe,UAAUA;YACVM,UAAUA;YACVD,mBAAmBA;YACnBG,gBAAgB,CAAC,EAAEE,WAAW,EAAE,GAAKF,eAAeE;sBACpD,cAAA,KAACvB;0BAAyBoB;;;IAGhC;IACAhB,MAAMoB,WAAW,GAAGrB;IACpB,OAAOC;AACT"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExpoModifier } from '../../types';
|
|
2
2
|
import { type ContentPadding } from '../LazyColumn';
|
|
3
|
+
export { LazyItems, type LazyItemsProps } from '../LazyItems';
|
|
3
4
|
export interface LazyRowProps {
|
|
4
5
|
/**
|
|
5
6
|
* The content to display inside the lazy row.
|
|
@@ -31,7 +32,7 @@ export interface LazyRowProps {
|
|
|
31
32
|
export declare function LazyRow(props: LazyRowProps): import("react").JSX.Element;
|
|
32
33
|
export declare namespace LazyRow {
|
|
33
34
|
var Items: {
|
|
34
|
-
<
|
|
35
|
+
<T>({ recycling, ...props }: import(".").LazyItemsProps<T>): import("react").JSX.Element;
|
|
35
36
|
displayName: string;
|
|
36
37
|
};
|
|
37
38
|
}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { requireNativeView } from 'expo';
|
|
3
3
|
import { createLazyItems } from '../LazyItems';
|
|
4
4
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
export { LazyItems } from '../LazyItems';
|
|
5
6
|
const LazyRowNativeView = requireNativeView('ExpoUI', 'LazyRowView');
|
|
6
7
|
function transformProps(props) {
|
|
7
8
|
const { modifiers, ...restProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/LazyRow/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createLazyItems","createViewModifierEventListener","LazyRowNativeView","transformProps","props","modifiers","restProps","undefined","LazyRow","Items"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,+BAA+B,QAAQ,qBAAqB;
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/LazyRow/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createLazyItems","createViewModifierEventListener","LazyItems","LazyRowNativeView","transformProps","props","modifiers","restProps","undefined","LazyRow","Items"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,+BAA+B,QAAQ,qBAAqB;AAErE,SAASC,SAAS,QAA6B,eAAe;AAkC9D,MAAMC,oBAA6DJ,kBACjE,UACA;AAGF,SAASK,eAAeC,KAAmB;IACzC,MAAM,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGF;IACpC,OAAO;QACLC;QACA,GAAIA,YAAYL,gCAAgCK,aAAaE,SAAS;QACtE,GAAGD,SAAS;IACd;AACF;AAEA;;CAEC,GACD,OAAO,SAASE,QAAQJ,KAAmB;IACzC,qBAAO,KAACF;QAAmB,GAAGC,eAAeC,MAAM;;AACrD;AAEAI,QAAQC,KAAK,GAAGV,gBAAgB"}
|
|
@@ -6,10 +6,15 @@ export interface RNHostProps extends PrimitiveBaseProps {
|
|
|
6
6
|
/**
|
|
7
7
|
* When `true`, the RNHost will update its size in the Jetpack Compose view tree to match the children's size.
|
|
8
8
|
* When `false`, the RNHost will use the size of the parent Jetpack Compose View.
|
|
9
|
+
* Pass an object to choose per axis. For example, `{ vertical: true }` takes the width from the
|
|
10
|
+
* parent and the height from the children, so text wraps and grows vertically.
|
|
9
11
|
* Can be only set once on mount.
|
|
10
12
|
* @default false
|
|
11
13
|
*/
|
|
12
|
-
matchContents?: boolean
|
|
14
|
+
matchContents?: boolean | {
|
|
15
|
+
vertical?: boolean;
|
|
16
|
+
horizontal?: boolean;
|
|
17
|
+
};
|
|
13
18
|
/**
|
|
14
19
|
* Called on mount and whenever this view's layout in the React Native view tree changes.
|
|
15
20
|
* With `matchContents`, the reported size is the one measured from the hosted view.
|
|
@@ -2,16 +2,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
3
|
import { requireNativeView } from 'expo';
|
|
4
4
|
import { PresentedContentContext, useIsPresentedInOwnWindow } from '../../PresentedContentContext';
|
|
5
|
+
import { resolveMatchContents } from '../../utils/matchContents';
|
|
5
6
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
7
|
const NativeRNHostView = requireNativeView('ExpoUI', 'RNHostView');
|
|
7
8
|
function transformProps(props, layoutRoot) {
|
|
8
|
-
const { modifiers, ...restProps } = props;
|
|
9
|
+
const { modifiers, matchContents, ...restProps } = props;
|
|
10
|
+
const { horizontal: matchContentsHorizontal, vertical: matchContentsVertical } = resolveMatchContents(matchContents);
|
|
9
11
|
return {
|
|
10
12
|
modifiers,
|
|
11
13
|
...modifiers ? createViewModifierEventListener(modifiers) : undefined,
|
|
12
14
|
...restProps,
|
|
13
15
|
layoutRoot,
|
|
14
|
-
|
|
16
|
+
matchContentsHorizontal,
|
|
17
|
+
matchContentsVertical,
|
|
18
|
+
expoInternalSizeFromChildren: matchContentsHorizontal || matchContentsVertical
|
|
15
19
|
};
|
|
16
20
|
}
|
|
17
21
|
export function RNHostView(props) {
|
|
@@ -20,11 +24,12 @@ export function RNHostView(props) {
|
|
|
20
24
|
// root already streams this subtree's touches, and a second stream in a second coordinate space
|
|
21
25
|
// is what makes a `Pressable` drop its press on the first finger movement.
|
|
22
26
|
const layoutRoot = useIsPresentedInOwnWindow();
|
|
27
|
+
const nativeProps = transformProps(props, layoutRoot);
|
|
23
28
|
return /*#__PURE__*/ _createElement(NativeRNHostView, {
|
|
24
|
-
...
|
|
29
|
+
...nativeProps,
|
|
25
30
|
// `matchContents` can only be used once on mount
|
|
26
31
|
// So we force unmount when it changes to prevent unexpected layout
|
|
27
|
-
key:
|
|
32
|
+
key: `${nativeProps.matchContentsHorizontal}-${nativeProps.matchContentsVertical}`
|
|
28
33
|
}, /*#__PURE__*/ _jsx(PresentedContentContext.Provider, {
|
|
29
34
|
value: false,
|
|
30
35
|
children: props.children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/RNHostView/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","PresentedContentContext","useIsPresentedInOwnWindow","createViewModifierEventListener","NativeRNHostView","transformProps","props","layoutRoot","modifiers","restProps","undefined","expoInternalSizeFromChildren","
|
|
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,mBAAqDL,kBACzD,UACA;AAGF,SAASM,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;kBACtCf,MAAMgB,QAAQ;;AAIvB"}
|
|
@@ -16,7 +16,6 @@ export * from './ExposedDropdownMenuBox';
|
|
|
16
16
|
export * from './Divider';
|
|
17
17
|
export * from './Host';
|
|
18
18
|
export * from './LazyColumn';
|
|
19
|
-
export { type LazyItemsProps } from './LazyItems';
|
|
20
19
|
export * from './LazyRow';
|
|
21
20
|
export * from './ListItem';
|
|
22
21
|
export * from './RNHostView';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/index.ts"],"sourcesContent":[null],"names":["BasicAlertDialog","TextField","OutlinedTextField","BasicTextField","HorizontalPager","Text","useNativeState"],"mappings":"AAAA,OAAO,wCAAwC;AAE/C,cAAc,gBAAgB;AAC9B,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,SAASA,gBAAgB,QAAoC,qBAAqB;AAClF,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,2BAA2B;AACzC,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,eAAe;
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/index.ts"],"sourcesContent":[null],"names":["BasicAlertDialog","TextField","OutlinedTextField","BasicTextField","HorizontalPager","Text","useNativeState"],"mappings":"AAAA,OAAO,wCAAwC;AAE/C,cAAc,gBAAgB;AAC9B,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,SAASA,gBAAgB,QAAoC,qBAAqB;AAClF,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,2BAA2B;AACzC,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,aAAa;AAC3B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,oBAAoB;AAClC,cAAc,aAAa;AAC3B,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,eAAe;AAC7B,SACEC,SAAS,EACTC,iBAAiB,EACjBC,cAAc,QAcT,cAAc;AACrB,cAAc,iBAAiB;AAC/B,cAAc,UAAU;AACxB,cAAc,qBAAqB;AACnC,cAAc,kBAAkB;AAChC,cAAc,aAAa;AAC3B,SACEC,eAAe,QAGV,oBAAoB;AAC3B,cAAc,cAAc;AAC5B,cAAc,aAAa;AAC3B,cAAc,oBAAoB;AAClC,cAAc,8BAA8B;AAC5C,cAAc,yBAAyB;AACvC,cAAc,qBAAqB;AACnC,cAAc,gBAAgB;AAC9B,cAAc,YAAY;AAC1B,SAAyBC,IAAI,QAAQ,SAAS;AAC9C,cAAc,YAAY;AAC1B,cAAc,qBAAqB;AAEnC,cAAc,uBAAuB;AACrC,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,SAASC,cAAc,QAAQ,WAAW"}
|
|
@@ -38,10 +38,25 @@ export declare const fillMaxWidth: (fraction?: number) => import("./createModifi
|
|
|
38
38
|
*/
|
|
39
39
|
export declare const fillMaxHeight: (fraction?: number) => import("./createModifier").ModifierConfig;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* Intrinsic width values for the `width` modifier. `Min` is the smallest width at which the content
|
|
42
|
+
* still draws correctly, and `Max` is the width the content needs when nothing limits it.
|
|
43
43
|
*/
|
|
44
|
-
export declare const
|
|
44
|
+
export declare const IntrinsicSize: {
|
|
45
|
+
readonly Min: "min";
|
|
46
|
+
readonly Max: "max";
|
|
47
|
+
};
|
|
48
|
+
export type IntrinsicSize = (typeof IntrinsicSize)[keyof typeof IntrinsicSize];
|
|
49
|
+
/**
|
|
50
|
+
* Sets the width of the view to an exact value, or to the minimum or maximum intrinsic width of its
|
|
51
|
+
* content. The incoming constraints can still make the view narrower or wider than that width.
|
|
52
|
+
* @param value - Width in dp, or an `IntrinsicSize`. `IntrinsicSize.Min` uses the minimum intrinsic
|
|
53
|
+
* width, the smallest width at which the content still draws correctly (for a text, its widest word).
|
|
54
|
+
* `IntrinsicSize.Max` uses the maximum intrinsic width, the width the content needs when nothing
|
|
55
|
+
* limits it (for a text, a single line).
|
|
56
|
+
* @see [Compose `width(IntrinsicSize)` modifier](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/width.modifier#(androidx.compose.ui.Modifier).width(androidx.compose.foundation.layout.IntrinsicSize))
|
|
57
|
+
* @see [Intrinsic measurements in Compose layouts](https://developer.android.com/develop/ui/compose/layouts/intrinsic-measurements)
|
|
58
|
+
*/
|
|
59
|
+
export declare const width: (value: number | IntrinsicSize) => import("./createModifier").ModifierConfig;
|
|
45
60
|
/**
|
|
46
61
|
* Sets the exact height of the view.
|
|
47
62
|
* @param value - Height in dp.
|
|
@@ -48,8 +48,21 @@ export { animated, spring, tween, snap, keyframes } from './animation';
|
|
|
48
48
|
fraction
|
|
49
49
|
});
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
51
|
+
* Intrinsic width values for the `width` modifier. `Min` is the smallest width at which the content
|
|
52
|
+
* still draws correctly, and `Max` is the width the content needs when nothing limits it.
|
|
53
|
+
*/ export const IntrinsicSize = {
|
|
54
|
+
Min: 'min',
|
|
55
|
+
Max: 'max'
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Sets the width of the view to an exact value, or to the minimum or maximum intrinsic width of its
|
|
59
|
+
* content. The incoming constraints can still make the view narrower or wider than that width.
|
|
60
|
+
* @param value - Width in dp, or an `IntrinsicSize`. `IntrinsicSize.Min` uses the minimum intrinsic
|
|
61
|
+
* width, the smallest width at which the content still draws correctly (for a text, its widest word).
|
|
62
|
+
* `IntrinsicSize.Max` uses the maximum intrinsic width, the width the content needs when nothing
|
|
63
|
+
* limits it (for a text, a single line).
|
|
64
|
+
* @see [Compose `width(IntrinsicSize)` modifier](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/width.modifier#(androidx.compose.ui.Modifier).width(androidx.compose.foundation.layout.IntrinsicSize))
|
|
65
|
+
* @see [Intrinsic measurements in Compose layouts](https://developer.android.com/develop/ui/compose/layouts/intrinsic-measurements)
|
|
53
66
|
*/ export const width = (value)=>createModifier('width', {
|
|
54
67
|
width: value
|
|
55
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/modifiers/index.ts"],"sourcesContent":[null],"names":["createModifier","createModifierWithEventListener","animated","spring","tween","snap","keyframes","paddingAll","all","padding","start","top","end","bottom","size","width","height","fillMaxSize","fraction","fillMaxWidth","fillMaxHeight","value","defaultMinSize","options","wrapContentWidth","alignment","wrapContentHeight","imePadding","offset","x","y","background","color","animationSpec","border","borderWidth","borderColor","shadow","elevation","dropShadow","shape","config","innerShadow","alpha","blur","radius","cornerRadius","rotate","degrees","graphicsLayer","params","zIndex","index","animateContentSize","dampingRatio","stiffness","weight","align","matchParentSize","menuAnchor","type","enabled","clickable","handler","indication","combinedClickable","handlers","event","onClick","onLongClick","selectable","selected","role","selectableGroup","toggleable","onVisibilityChanged","isVisible","minDurationMs","minFractionVisible","onSizeChanged","onGloballyPositioned","layout","testID","tag","semantics","material","name","Shapes","Rectangle","Circle","RoundedCorner","CutCorner","Material","Cookie4Sided","Cookie6Sided","Cookie7Sided","Cookie9Sided","Cookie12Sided","Clover4Leaf","Clover8Leaf","SoftBurst","Boom","Oval","Pill","Triangle","Diamond","Pentagon","Sunny","VerySunny","Fan","PixelCircle","PixelTriangle","Ghostish","Bun","Heart","Arch","Slanted","Puffy","PuffyDiamond","clip","maskClip","verticalScroll","horizontalScroll","createViewModifierEventListener"],"mappings":"AAGA,SAASA,cAAc,EAAEC,+BAA+B,QAAQ,mBAAmB;AAEnF,SACEC,QAAQ,EACRC,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,SAAS,QAGJ,cAAc;AAsBrB;;;CAGC,GACD,OAAO,MAAMC,aAAa,CAACC,MAAgBR,eAAe,cAAc;QAAEQ;IAAI,GAAG;AAEjF;;;;;;CAMC,GACD,OAAO,MAAMC,UAAU,CAACC,OAAeC,KAAaC,KAAaC,SAC/Db,eAAe,WAAW;QAAEU;QAAOC;QAAKC;QAAKC;IAAO,GAAG;AAEzD,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF;;;;CAIC,GACD,OAAO,MAAMC,OAAO,CAACC,OAAeC,SAAmBhB,eAAe,QAAQ;QAAEe;QAAOC;IAAO,GAAG;AAEjG;;;CAGC,GACD,OAAO,MAAMC,cAAc,CAACC,WAAsBlB,eAAe,eAAe;QAAEkB;IAAS,GAAG;AAE9F;;;CAGC,GACD,OAAO,MAAMC,eAAe,CAACD,WAAsBlB,eAAe,gBAAgB;QAAEkB;IAAS,GAAG;AAEhG;;;CAGC,GACD,OAAO,MAAME,gBAAgB,CAACF,WAAsBlB,eAAe,iBAAiB;QAAEkB;IAAS,GAAG;AAElG;;;CAGC,GACD,OAAO,
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/modifiers/index.ts"],"sourcesContent":[null],"names":["createModifier","createModifierWithEventListener","animated","spring","tween","snap","keyframes","paddingAll","all","padding","start","top","end","bottom","size","width","height","fillMaxSize","fraction","fillMaxWidth","fillMaxHeight","IntrinsicSize","Min","Max","value","defaultMinSize","options","wrapContentWidth","alignment","wrapContentHeight","imePadding","offset","x","y","background","color","animationSpec","border","borderWidth","borderColor","shadow","elevation","dropShadow","shape","config","innerShadow","alpha","blur","radius","cornerRadius","rotate","degrees","graphicsLayer","params","zIndex","index","animateContentSize","dampingRatio","stiffness","weight","align","matchParentSize","menuAnchor","type","enabled","clickable","handler","indication","combinedClickable","handlers","event","onClick","onLongClick","selectable","selected","role","selectableGroup","toggleable","onVisibilityChanged","isVisible","minDurationMs","minFractionVisible","onSizeChanged","onGloballyPositioned","layout","testID","tag","semantics","material","name","Shapes","Rectangle","Circle","RoundedCorner","CutCorner","Material","Cookie4Sided","Cookie6Sided","Cookie7Sided","Cookie9Sided","Cookie12Sided","Clover4Leaf","Clover8Leaf","SoftBurst","Boom","Oval","Pill","Triangle","Diamond","Pentagon","Sunny","VerySunny","Fan","PixelCircle","PixelTriangle","Ghostish","Bun","Heart","Arch","Slanted","Puffy","PuffyDiamond","clip","maskClip","verticalScroll","horizontalScroll","createViewModifierEventListener"],"mappings":"AAGA,SAASA,cAAc,EAAEC,+BAA+B,QAAQ,mBAAmB;AAEnF,SACEC,QAAQ,EACRC,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,SAAS,QAGJ,cAAc;AAsBrB;;;CAGC,GACD,OAAO,MAAMC,aAAa,CAACC,MAAgBR,eAAe,cAAc;QAAEQ;IAAI,GAAG;AAEjF;;;;;;CAMC,GACD,OAAO,MAAMC,UAAU,CAACC,OAAeC,KAAaC,KAAaC,SAC/Db,eAAe,WAAW;QAAEU;QAAOC;QAAKC;QAAKC;IAAO,GAAG;AAEzD,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF;;;;CAIC,GACD,OAAO,MAAMC,OAAO,CAACC,OAAeC,SAAmBhB,eAAe,QAAQ;QAAEe;QAAOC;IAAO,GAAG;AAEjG;;;CAGC,GACD,OAAO,MAAMC,cAAc,CAACC,W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,SAAS;QACpBgB,MAAMhB,SAAS;QACfiB,MAAMjB,SAAS;QACfkB,MAAMlB,SAAS;QACfmB,UAAUnB,SAAS;QACnBoB,SAASpB,SAAS;QAClBqB,UAAUrB,SAAS;QACnBsB,OAAOtB,SAAS;QAChBuB,WAAWvB,SAAS;QACpBwB,KAAKxB,SAAS;QACdyB,aAAazB,SAAS;QACtB0B,eAAe1B,SAAS;QACxB2B,UAAU3B,SAAS;QACnB4B,KAAK5B,SAAS;QACd6B,OAAO7B,SAAS;QAChB8B,MAAM9B,SAAS;QACf+B,SAAS/B,SAAS;QAClBgC,OAAOhC,SAAS;QAChBiC,cAAcjC,SAAS;IACzB;AACF,EAAE;AAEF;;;CAGC,GACD,OAAO,MAAMkC,OAAO,CAAC/E,QAAwB3C,eAAe,QAAQ;QAAE2C;IAAM,GAAG;AAE/E;;;;;;;;;;;;;;CAcC,GACD,OAAO,MAAMgF,WAAW,CAAChF,QAAwB3C,eAAe,YAAY;QAAE2C;IAAM,GAAG;AAEvF,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;;CAIC,GACD,OAAO,MAAMiF,iBAAiB,IAAM5H,eAAe,kBAAkB;AAErE;;;;CAIC,GACD,OAAO,MAAM6H,mBAAmB,IAAM7H,eAAe,oBAAoB;AAEzE,SAASA,cAAc,EAAEC,+BAA+B,QAAQ,mBAAmB;AACnF,SAAS6H,+BAA+B,QAAQ,UAAU"}
|
|
@@ -1,4 +1,38 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
1
2
|
import { type CommonViewModifierProps } from '../types';
|
|
3
|
+
export interface LazyHStackForEachProps<T> {
|
|
4
|
+
/** Items to display. Replace the array when updating data. */
|
|
5
|
+
data: readonly T[];
|
|
6
|
+
/** Returns a stable, unique string key for each item. */
|
|
7
|
+
keyExtractor: (item: T, index: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Renders an item. Wrap it in `useCallback`, or every item re-renders on each parent render.
|
|
10
|
+
* Recycled views are reused for other items, so their local state (`useState`) carries over.
|
|
11
|
+
* Reset it when the item changes, or keep the state outside the view.
|
|
12
|
+
*/
|
|
13
|
+
children: (info: {
|
|
14
|
+
item: T;
|
|
15
|
+
index: number;
|
|
16
|
+
}) => ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* Renders only the items near the visible range and reuses them while scrolling. Set to `false`
|
|
19
|
+
* to render every item at once. Set it once; changing it remounts the items.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
recycling?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Extra items to prepare on each side of the visible items. Must be a non-negative integer.
|
|
25
|
+
* Ignored when `recycling` is `false`.
|
|
26
|
+
* @default 10
|
|
27
|
+
*/
|
|
28
|
+
overscanCount?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Placeholder size in points along the stack axis, until an item is measured. Must be positive.
|
|
31
|
+
* Ignored when `recycling` is `false`.
|
|
32
|
+
* @default 64
|
|
33
|
+
*/
|
|
34
|
+
estimatedItemSize?: number;
|
|
35
|
+
}
|
|
2
36
|
export interface LazyHStackProps extends CommonViewModifierProps {
|
|
3
37
|
children: React.ReactNode;
|
|
4
38
|
/**
|
|
@@ -11,3 +45,14 @@ export interface LazyHStackProps extends CommonViewModifierProps {
|
|
|
11
45
|
alignment?: 'top' | 'center' | 'bottom' | 'firstTextBaseline' | 'lastTextBaseline';
|
|
12
46
|
}
|
|
13
47
|
export declare function LazyHStack(props: LazyHStackProps): import("react").JSX.Element;
|
|
48
|
+
export declare namespace LazyHStack {
|
|
49
|
+
var ForEach: <T>(props: LazyHStackForEachProps<T>) => ReactElement;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A block of recycled items inside `LazyHStack`. Only a small pool of items around the visible
|
|
53
|
+
* range is mounted. Items that are not ready yet show a placeholder of `estimatedItemSize`, or of
|
|
54
|
+
* the size last measured for that item.
|
|
55
|
+
*
|
|
56
|
+
* Mount it as a direct child of `LazyHStack`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const LazyHStackForEach: <T>(props: LazyHStackForEachProps<T>) => ReactElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { requireNativeView } from 'expo';
|
|
3
|
+
import { createLazyStackForEach } from '../LazyStackForEach';
|
|
3
4
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
4
5
|
const LazyHStackNativeView = requireNativeView('ExpoUI', 'LazyHStackView');
|
|
5
6
|
export function LazyHStack(props) {
|
|
@@ -10,5 +11,13 @@ export function LazyHStack(props) {
|
|
|
10
11
|
...restProps
|
|
11
12
|
});
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* A block of recycled items inside `LazyHStack`. Only a small pool of items around the visible
|
|
16
|
+
* range is mounted. Items that are not ready yet show a placeholder of `estimatedItemSize`, or of
|
|
17
|
+
* the size last measured for that item.
|
|
18
|
+
*
|
|
19
|
+
* Mount it as a direct child of `LazyHStack`.
|
|
20
|
+
*/ export const LazyHStackForEach = createLazyStackForEach('LazyHStack.ForEach', 'horizontal');
|
|
21
|
+
LazyHStack.ForEach = LazyHStackForEach;
|
|
13
22
|
|
|
14
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["swift-ui/LazyHStack/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createViewModifierEventListener","LazyHStackNativeView","LazyHStack","props","modifiers","restProps","undefined"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"sources":["swift-ui/LazyHStack/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createLazyStackForEach","createViewModifierEventListener","LazyHStackNativeView","LazyHStack","props","modifiers","restProps","undefined","LazyHStackForEach","ForEach"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAGzC,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,+BAA+B,QAAQ,qBAAqB;AA8CrE,MAAMC,uBAA6DH,kBACjE,UACA;AAGF,OAAO,SAASI,WAAWC,KAAsB;IAC/C,MAAM,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGF;IACpC,qBACE,KAACF;QACCG,WAAWA;QACV,GAAIA,YAAYJ,gCAAgCI,aAAaE,SAAS;QACtE,GAAGD,SAAS;;AAGnB;AAEA;;;;;;CAMC,GACD,OAAO,MAAME,oBACXR,uBAAuB,sBAAsB,cAAc;AAE7DG,WAAWM,OAAO,GAAGD"}
|