@expo/ui 58.0.7 → 58.0.9
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 +12 -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 +40 -7
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +3 -1
- package/android/src/main/java/expo/modules/ui/SemanticsModifier.kt +2 -1
- 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/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/index.d.ts +0 -1
- package/build/jetpack-compose/index.js.map +1 -1
- package/build/jetpack-compose/modifiers/index.d.ts +33 -6
- 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/index.d.ts +1 -0
- package/build/swift-ui/index.js.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +5 -1
- package/build/swift-ui/modifiers/index.js.map +1 -1
- package/build/universal/State.android.d.ts +1 -3
- package/build/universal/State.d.ts +2 -3
- package/build/universal/State.ios.d.ts +1 -3
- package/build/universal/State.js +10 -4
- package/build/universal/State.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/universal/types.d.ts +24 -0
- package/build/universal/types.js +8 -2
- package/build/universal/types.js.map +1 -1
- package/expo-module.config.json +0 -1
- package/ios/DataListForEachView.swift +65 -28
- package/ios/LazyHStackView.swift +3 -0
- package/ios/LazyVStackView.swift +3 -0
- package/ios/ListView.swift +8 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.7/expo.modules.ui-58.0.7-sources.jar → 58.0.9/expo.modules.ui-58.0.9-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.7/expo.modules.ui-58.0.7.module → 58.0.9/expo.modules.ui-58.0.9.module} +23 -23
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.7/expo.modules.ui-58.0.7.pom → 58.0.9/expo.modules.ui-58.0.9.pom} +2 -2
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.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/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/index.ts +0 -1
- package/src/jetpack-compose/modifiers/index.ts +32 -4
- 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/index.tsx +1 -0
- package/src/swift-ui/modifiers/index.ts +5 -1
- package/src/universal/State.android.ts +1 -1
- package/src/universal/State.ios.ts +1 -1
- package/src/universal/State.ts +12 -4
- package/src/universal/Switch/index.android.tsx +11 -2
- package/src/universal/types.ts +27 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.7/expo.modules.ui-58.0.7.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
|
@@ -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,
|
|
@@ -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"}
|
|
@@ -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.
|
|
@@ -313,11 +328,23 @@ export declare const onGloballyPositioned: (handler: (layout: {
|
|
|
313
328
|
*/
|
|
314
329
|
export declare const testID: (tag: string) => import("./createModifier").ModifierConfig;
|
|
315
330
|
/**
|
|
316
|
-
*
|
|
331
|
+
* Options for the `semantics` modifier.
|
|
317
332
|
*/
|
|
318
|
-
export
|
|
333
|
+
export type SemanticsConfig = {
|
|
334
|
+
/**
|
|
335
|
+
* An autofill hint, such as `'email'` or `'password'`.
|
|
336
|
+
*/
|
|
319
337
|
contentType?: string;
|
|
320
|
-
|
|
338
|
+
/**
|
|
339
|
+
* What accessibility services such as TalkBack announce for the element. Useful when the visible
|
|
340
|
+
* content does not read well aloud, as with an abbreviation or a glyph.
|
|
341
|
+
*/
|
|
342
|
+
contentDescription?: string;
|
|
343
|
+
};
|
|
344
|
+
/**
|
|
345
|
+
* Applies semantic properties. Wraps `Modifier.semantics { ... }`.
|
|
346
|
+
*/
|
|
347
|
+
export declare const semantics: (params: SemanticsConfig) => import("./createModifier").ModifierConfig;
|
|
321
348
|
type MaterialShapeName = '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';
|
|
322
349
|
type CornerRadii = {
|
|
323
350
|
topStart?: number;
|
|
@@ -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,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,MAAMG,gBAA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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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
export interface LazyStackForEachProps<T> {
|
|
3
|
+
/** Items to display. Replace the array when updating data. */
|
|
4
|
+
data: readonly T[];
|
|
5
|
+
/** Returns a stable, unique string key for each item. */
|
|
6
|
+
keyExtractor: (item: T, index: number) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Renders a row. Wrap it in `useCallback`, or every row re-renders on each parent render.
|
|
9
|
+
* Recycled rows 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 row.
|
|
11
|
+
*/
|
|
12
|
+
children: (info: {
|
|
13
|
+
item: T;
|
|
14
|
+
index: number;
|
|
15
|
+
}) => ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* Renders only the rows near the visible range and reuses them while scrolling. Set to `false` to
|
|
18
|
+
* render every row at once. Set it once; changing it remounts the rows.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
recycling?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Extra rows to prepare on each side of the visible rows. Must be a non-negative integer.
|
|
24
|
+
* Ignored when `recycling` is `false`.
|
|
25
|
+
* @default 10
|
|
26
|
+
*/
|
|
27
|
+
overscanCount?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Placeholder size in points along the stack axis, until a row is measured. Must be positive.
|
|
30
|
+
* Ignored when `recycling` is `false`.
|
|
31
|
+
* @default 64
|
|
32
|
+
*/
|
|
33
|
+
estimatedItemSize?: number;
|
|
34
|
+
}
|
|
35
|
+
type Axis = 'vertical' | 'horizontal';
|
|
36
|
+
/**
|
|
37
|
+
* @hidden
|
|
38
|
+
* Creates the `ForEach` component of one lazy stack, so its errors name that stack.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createLazyStackForEach(componentName: string, axis: Axis): {
|
|
41
|
+
<T>({ recycling, ...props }: LazyStackForEachProps<T>): import("react").JSX.Element;
|
|
42
|
+
displayName: string;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { requireNativeView } from 'expo';
|
|
3
|
+
import { Fragment } from 'react';
|
|
4
|
+
import { useItemKeys, useRecycledRows } from '../../recycling/useRecycledRows';
|
|
5
|
+
import { NativeSlot } from '../List/DataListForEach';
|
|
6
|
+
const NativeForEach = requireNativeView('ExpoUI', 'DataListForEachView');
|
|
7
|
+
const NativePool = requireNativeView('ExpoUI', 'DataListForEachPoolView');
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
* Creates the `ForEach` component of one lazy stack, so its errors name that stack.
|
|
11
|
+
*/ export function createLazyStackForEach(componentName, axis) {
|
|
12
|
+
function ForEach({ recycling = true, ...props }) {
|
|
13
|
+
return recycling ? /*#__PURE__*/ _jsx(RecycledForEach, {
|
|
14
|
+
...props
|
|
15
|
+
}) : /*#__PURE__*/ _jsx(StaticForEach, {
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
// Each row is a plain child of the lazy stack.
|
|
20
|
+
function StaticForEach({ data, keyExtractor, children: renderItem }) {
|
|
21
|
+
const itemKeys = useItemKeys(componentName, data, keyExtractor);
|
|
22
|
+
return data.map((item, index)=>/*#__PURE__*/ _jsx(Fragment, {
|
|
23
|
+
children: renderItem({
|
|
24
|
+
item,
|
|
25
|
+
index
|
|
26
|
+
})
|
|
27
|
+
}, itemKeys[index]));
|
|
28
|
+
}
|
|
29
|
+
function RecycledForEach({ data, keyExtractor, children: renderItem, overscanCount, estimatedItemSize = 64 }) {
|
|
30
|
+
const { itemKeys, revision, rows, onWindowChange } = useRecycledRows({
|
|
31
|
+
componentName,
|
|
32
|
+
Slot: NativeSlot,
|
|
33
|
+
data,
|
|
34
|
+
keyExtractor,
|
|
35
|
+
renderItem,
|
|
36
|
+
overscanCount,
|
|
37
|
+
estimatedItemSize
|
|
38
|
+
});
|
|
39
|
+
return /*#__PURE__*/ _jsx(NativeForEach, {
|
|
40
|
+
axis: axis,
|
|
41
|
+
itemKeys: itemKeys,
|
|
42
|
+
revision: revision,
|
|
43
|
+
estimatedItemSize: estimatedItemSize,
|
|
44
|
+
onWindowChange: ({ nativeEvent })=>onWindowChange(nativeEvent),
|
|
45
|
+
children: /*#__PURE__*/ _jsx(NativePool, {
|
|
46
|
+
children: rows
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
ForEach.displayName = componentName;
|
|
51
|
+
return ForEach;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["swift-ui/LazyStackForEach/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","Fragment","useItemKeys","useRecycledRows","NativeSlot","NativeForEach","NativePool","createLazyStackForEach","componentName","axis","ForEach","recycling","props","RecycledForEach","StaticForEach","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,QAEV,kCAAkC;AAEzC,SAASC,UAAU,QAAQ,0BAA0B;AA2CrD,MAAMC,gBAAgBL,kBAA+B,UAAU;AAC/D,MAAMM,aAAaN,kBACjB,UACA;AAGF;;;CAGC,GACD,OAAO,SAASO,uBAAuBC,aAAqB,EAAEC,IAAU;IACtE,SAASC,QAAW,EAAEC,YAAY,IAAI,EAAE,GAAGC,OAAiC;QAC1E,OAAOD,0BAAY,KAACE;YAAiB,GAAGD,KAAK;2BAAO,KAACE;YAAe,GAAGF,KAAK;;IAC9E;IAEA,+CAA+C;IAC/C,SAASE,cAAiB,EACxBC,IAAI,EACJC,YAAY,EACZC,UAAUC,UAAU,EACwB;QAC5C,MAAMC,WAAWjB,YAAYM,eAAeO,MAAMC;QAClD,OAAOD,KAAKK,GAAG,CAAC,CAACC,MAAMC,sBACrB,KAACrB;0BAAgCiB,WAAW;oBAAEG;oBAAMC;gBAAM;eAA3CH,QAAQ,CAACG,MAAM;IAElC;IAEA,SAAST,gBAAmB,EAC1BE,IAAI,EACJC,YAAY,EACZC,UAAUC,UAAU,EACpBK,aAAa,EACbC,oBAAoB,EAAE,EACsB;QAC5C,MAAM,EAAEL,QAAQ,EAAEM,QAAQ,EAAEC,IAAI,EAAEC,cAAc,EAAE,GAAGxB,gBAAgB;YACnEK;YACAoB,MAAMxB;YACNW;YACAC;YACAE;YACAK;YACAC;QACF;QAEA,qBACE,KAACnB;YACCI,MAAMA;YACNU,UAAUA;YACVM,UAAUA;YACVD,mBAAmBA;YACnBG,gBAAgB,CAAC,EAAEE,WAAW,EAAE,GAAKF,eAAeE;sBACpD,cAAA,KAACvB;0BAAYoB;;;IAGnB;IACAhB,QAAQoB,WAAW,GAAGtB;IACtB,OAAOE;AACT"}
|
|
@@ -1,4 +1,38 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
1
2
|
import { type CommonViewModifierProps } from '../types';
|
|
3
|
+
export interface LazyVStackForEachProps<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 a row. Wrap it in `useCallback`, or every row re-renders on each parent render.
|
|
10
|
+
* Recycled rows 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 row.
|
|
12
|
+
*/
|
|
13
|
+
children: (info: {
|
|
14
|
+
item: T;
|
|
15
|
+
index: number;
|
|
16
|
+
}) => ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* Renders only the rows near the visible range and reuses them while scrolling. Set to `false` to
|
|
19
|
+
* render every row at once. Set it once; changing it remounts the rows.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
recycling?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Extra rows to prepare on each side of the visible rows. 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 a row is measured. Must be positive.
|
|
31
|
+
* Ignored when `recycling` is `false`.
|
|
32
|
+
* @default 64
|
|
33
|
+
*/
|
|
34
|
+
estimatedItemSize?: number;
|
|
35
|
+
}
|
|
2
36
|
export interface LazyVStackProps extends CommonViewModifierProps {
|
|
3
37
|
children: React.ReactNode;
|
|
4
38
|
/**
|
|
@@ -11,3 +45,14 @@ export interface LazyVStackProps extends CommonViewModifierProps {
|
|
|
11
45
|
spacing?: number;
|
|
12
46
|
}
|
|
13
47
|
export declare function LazyVStack(props: LazyVStackProps): import("react").JSX.Element;
|
|
48
|
+
export declare namespace LazyVStack {
|
|
49
|
+
var ForEach: <T>(props: LazyVStackForEachProps<T>) => ReactElement;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A block of recycled rows inside `LazyVStack`. Only a small pool of rows around the visible
|
|
53
|
+
* range is mounted. Rows that are not ready yet show a placeholder of `estimatedItemSize`, or of
|
|
54
|
+
* the size last measured for that row.
|
|
55
|
+
*
|
|
56
|
+
* Mount it as a direct child of `LazyVStack`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const LazyVStackForEach: <T>(props: LazyVStackForEachProps<T>) => ReactElement;
|