@expo/ui 58.0.5 → 58.0.6
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 +10 -0
- package/android/build.gradle +2 -2
- package/build/swift-ui/List/DataListForEach.d.ts +59 -0
- package/build/swift-ui/List/DataListForEach.js +137 -0
- package/build/swift-ui/List/DataListForEach.js.map +1 -0
- package/build/swift-ui/List/ListForEach.d.ts +15 -4
- package/build/swift-ui/List/ListForEach.js +40 -3
- package/build/swift-ui/List/ListForEach.js.map +1 -1
- package/build/swift-ui/List/index.d.ts +1 -1
- package/build/swift-ui/List/index.js.map +1 -1
- package/build/swift-ui/List/window.d.ts +5 -0
- package/build/swift-ui/List/window.js +28 -0
- package/build/swift-ui/List/window.js.map +1 -0
- package/build/swift-ui/modifiers/index.d.ts +16 -7
- package/build/swift-ui/modifiers/index.js +10 -5
- package/build/swift-ui/modifiers/index.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/DataListForEachView.swift +255 -0
- package/ios/ExpoUIModule.swift +3 -0
- package/ios/ListForEachView.swift +12 -3
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5.module → 58.0.6/expo.modules.ui-58.0.6.module} +7 -7
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.6/expo.modules.ui-58.0.6.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.6/expo.modules.ui-58.0.6.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.6/expo.modules.ui-58.0.6.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.6/expo.modules.ui-58.0.6.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5.pom → 58.0.6/expo.modules.ui-58.0.6.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.6/expo.modules.ui-58.0.6.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.6/expo.modules.ui-58.0.6.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.6/expo.modules.ui-58.0.6.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.6/expo.modules.ui-58.0.6.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +2 -2
- package/prebuilds/output/debug/xcframeworks/ExpoUI.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoUI.tar.gz +0 -0
- package/src/swift-ui/List/DataListForEach.tsx +249 -0
- package/src/swift-ui/List/ListForEach.tsx +56 -6
- package/src/swift-ui/List/index.tsx +1 -1
- package/src/swift-ui/List/window.ts +28 -0
- package/src/swift-ui/modifiers/index.ts +50 -14
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5-sources.jar → 58.0.6/expo.modules.ui-58.0.6-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5-sources.jar.md5 → 58.0.6/expo.modules.ui-58.0.6-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5-sources.jar.sha1 → 58.0.6/expo.modules.ui-58.0.6-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5-sources.jar.sha256 → 58.0.6/expo.modules.ui-58.0.6-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5-sources.jar.sha512 → 58.0.6/expo.modules.ui-58.0.6-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5.aar → 58.0.6/expo.modules.ui-58.0.6.aar} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5.aar.md5 → 58.0.6/expo.modules.ui-58.0.6.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5.aar.sha1 → 58.0.6/expo.modules.ui-58.0.6.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5.aar.sha256 → 58.0.6/expo.modules.ui-58.0.6.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.5/expo.modules.ui-58.0.5.aar.sha512 → 58.0.6/expo.modules.ui-58.0.6.aar.sha512} +0 -0
|
@@ -2,6 +2,9 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
|
|
3
3
|
import { type ViewEvent } from '../../types';
|
|
4
4
|
import { type CommonViewModifierProps } from '../types';
|
|
5
|
+
import { DataListForEach, NativeSlot, useItemKeys, type ListForEachProps } from './DataListForEach';
|
|
6
|
+
|
|
7
|
+
export { type ListForEachProps };
|
|
5
8
|
|
|
6
9
|
const ListForEachNativeView: React.ComponentType<NativeListForEachProps> =
|
|
7
10
|
requireNativeView<NativeListForEachProps>('ExpoUI', 'ListForEachView');
|
|
@@ -14,21 +17,29 @@ type NativeListForEachProps = CommonViewModifierProps &
|
|
|
14
17
|
DeleteEvent &
|
|
15
18
|
MoveEvent & {
|
|
16
19
|
children: React.ReactNode;
|
|
20
|
+
deleteEnabled: boolean;
|
|
21
|
+
moveEnabled: boolean;
|
|
17
22
|
};
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Pass `data` and `keyExtractor`, and render each row from a `children` function.
|
|
26
|
+
*/
|
|
27
|
+
export interface ListForEachElementsProps extends CommonViewModifierProps {
|
|
28
|
+
data?: never;
|
|
29
|
+
keyExtractor?: never;
|
|
30
|
+
recycling?: never;
|
|
31
|
+
overscanCount?: never;
|
|
32
|
+
estimatedItemSize?: never;
|
|
20
33
|
/**
|
|
21
34
|
* The children elements to be rendered inside the `List.ForEach`.
|
|
22
35
|
*/
|
|
23
36
|
children: React.ReactNode;
|
|
24
|
-
|
|
25
37
|
/**
|
|
26
38
|
* Callback triggered when items are deleted.
|
|
27
39
|
* Receives an array of indices that were deleted.
|
|
28
40
|
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/dynamicviewcontent/ondelete(perform:)).
|
|
29
41
|
*/
|
|
30
42
|
onDelete?: (indices: number[]) => void;
|
|
31
|
-
|
|
32
43
|
/**
|
|
33
44
|
* Callback triggered when items are moved.
|
|
34
45
|
* Receives the source indices and destination index.
|
|
@@ -37,14 +48,33 @@ export interface ListForEachProps extends CommonViewModifierProps {
|
|
|
37
48
|
onMove?: (sourceIndices: number[], destination: number) => void;
|
|
38
49
|
}
|
|
39
50
|
|
|
51
|
+
let warnedElements = false;
|
|
52
|
+
|
|
40
53
|
/**
|
|
41
|
-
* A
|
|
42
|
-
*
|
|
54
|
+
* A group of rows inside `List`, with optional deletion and reordering.
|
|
55
|
+
* Pass `data` with `keyExtractor`, and render each row from a `children` function.
|
|
56
|
+
* Recycles rows unless `recycling` is `false`.
|
|
43
57
|
*/
|
|
44
|
-
export function ListForEach(
|
|
58
|
+
export function ListForEach<ItemT>(props: ListForEachProps<ItemT> | ListForEachElementsProps) {
|
|
59
|
+
if (props.data === undefined) {
|
|
60
|
+
if (__DEV__ && !warnedElements) {
|
|
61
|
+
warnedElements = true;
|
|
62
|
+
console.warn(
|
|
63
|
+
'[@expo/ui] Passing elements as List.ForEach children is deprecated. Pass `data` and `keyExtractor`, and render each row from a `children` function: `{({ item }) => <Row item={item} />}`.'
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return <ChildrenListForEach {...props} />;
|
|
67
|
+
}
|
|
68
|
+
const { recycling = true, ...rest } = props;
|
|
69
|
+
return recycling ? <DataListForEach {...rest} /> : <StaticListForEach {...rest} />;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function ChildrenListForEach({ children, onDelete, onMove, ...props }: ListForEachElementsProps) {
|
|
45
73
|
return (
|
|
46
74
|
<ListForEachNativeView
|
|
47
75
|
{...props}
|
|
76
|
+
deleteEnabled={!!onDelete}
|
|
77
|
+
moveEnabled={!!onMove}
|
|
48
78
|
onDelete={onDelete ? ({ nativeEvent }) => onDelete(nativeEvent.indices) : undefined}
|
|
49
79
|
onMove={
|
|
50
80
|
onMove
|
|
@@ -55,3 +85,23 @@ export function ListForEach({ children, onDelete, onMove, ...props }: ListForEac
|
|
|
55
85
|
</ListForEachNativeView>
|
|
56
86
|
);
|
|
57
87
|
}
|
|
88
|
+
|
|
89
|
+
function StaticListForEach<ItemT>({
|
|
90
|
+
data,
|
|
91
|
+
keyExtractor,
|
|
92
|
+
children: renderItem,
|
|
93
|
+
overscanCount: _overscanCount,
|
|
94
|
+
estimatedItemSize: _estimatedItemSize,
|
|
95
|
+
...props
|
|
96
|
+
}: Omit<ListForEachProps<ItemT>, 'recycling'>) {
|
|
97
|
+
const itemKeys = useItemKeys(data, keyExtractor);
|
|
98
|
+
return (
|
|
99
|
+
<ChildrenListForEach {...props}>
|
|
100
|
+
{data.map((item, index) => (
|
|
101
|
+
<NativeSlot key={itemKeys[index]} itemKey={itemKeys[index]!} index={index} revision={0}>
|
|
102
|
+
{renderItem({ item, index })}
|
|
103
|
+
</NativeSlot>
|
|
104
|
+
))}
|
|
105
|
+
</ChildrenListForEach>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
@@ -5,7 +5,7 @@ import { createViewModifierEventListener } from '../modifiers/utils';
|
|
|
5
5
|
import { type CommonViewModifierProps } from '../types';
|
|
6
6
|
import { ListForEach } from './ListForEach';
|
|
7
7
|
|
|
8
|
-
export { ListForEach, type ListForEachProps } from './ListForEach';
|
|
8
|
+
export { ListForEach, type ListForEachProps, type ListForEachElementsProps } from './ListForEach';
|
|
9
9
|
|
|
10
10
|
const ListNativeView: React.ComponentType<NativeListProps> = requireNativeView<NativeListProps>(
|
|
11
11
|
'ExpoUI',
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function getWindow(
|
|
2
|
+
count: number,
|
|
3
|
+
first: number,
|
|
4
|
+
last: number,
|
|
5
|
+
overscanCount: number,
|
|
6
|
+
minCapacity = 0
|
|
7
|
+
) {
|
|
8
|
+
if (count === 0) return { start: 0, capacity: 0 };
|
|
9
|
+
first = Math.max(0, Math.min(first, count - 1));
|
|
10
|
+
last = Math.max(first, Math.min(last, count - 1));
|
|
11
|
+
const start = Math.max(0, first - overscanCount);
|
|
12
|
+
const end = Math.min(count, last + 1 + overscanCount);
|
|
13
|
+
// Never shrink the pool: a stable capacity keeps `index % capacity` slot assignments stable.
|
|
14
|
+
// Grow it with headroom, because every growth re-renders the whole pool.
|
|
15
|
+
const needed = end - start;
|
|
16
|
+
let capacity = minCapacity;
|
|
17
|
+
if (needed > capacity) capacity = capacity === 0 ? needed : needed + overscanCount;
|
|
18
|
+
capacity = Math.min(count, capacity);
|
|
19
|
+
return { start: Math.min(start, count - capacity), capacity };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getSlotIndices(start: number, capacity: number): number[] {
|
|
23
|
+
if (capacity === 0) return [];
|
|
24
|
+
return Array.from(
|
|
25
|
+
{ length: capacity },
|
|
26
|
+
(_, slot) => start + ((slot - (start % capacity) + capacity) % capacity)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -106,31 +106,67 @@ export const matchedGeometryEffect = (
|
|
|
106
106
|
*/
|
|
107
107
|
export const geometryGroup = () => createModifier('geometryGroup', {});
|
|
108
108
|
|
|
109
|
+
type FrameAlignment =
|
|
110
|
+
| 'center'
|
|
111
|
+
| 'leading'
|
|
112
|
+
| 'trailing'
|
|
113
|
+
| 'top'
|
|
114
|
+
| 'bottom'
|
|
115
|
+
| 'topLeading'
|
|
116
|
+
| 'topTrailing'
|
|
117
|
+
| 'bottomLeading'
|
|
118
|
+
| 'bottomTrailing';
|
|
119
|
+
|
|
109
120
|
/**
|
|
110
|
-
*
|
|
111
|
-
* @param params - The frame parameters
|
|
121
|
+
* Positions this view within an invisible frame with the specified size.
|
|
122
|
+
* @param params - The fixed frame parameters: `width`, `height` and `alignment`.
|
|
112
123
|
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/SwiftUI/View/frame(width:height:alignment:)).
|
|
113
124
|
*/
|
|
114
|
-
export
|
|
125
|
+
export function frame(params: {
|
|
115
126
|
width?: number;
|
|
116
127
|
height?: number;
|
|
128
|
+
alignment?: FrameAlignment;
|
|
129
|
+
}): ModifierConfig;
|
|
130
|
+
/**
|
|
131
|
+
* Positions this view within an invisible frame having the specified size constraints.
|
|
132
|
+
* @param params - The flexible frame parameters: `minWidth`, `idealWidth`, `maxWidth`, `minHeight`, `idealHeight`, `maxHeight` and `alignment`.
|
|
133
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/frame(minwidth:idealwidth:maxwidth:minheight:idealheight:maxheight:alignment:)).
|
|
134
|
+
*/
|
|
135
|
+
export function frame(params: {
|
|
117
136
|
minWidth?: number;
|
|
137
|
+
idealWidth?: number;
|
|
118
138
|
maxWidth?: number;
|
|
119
139
|
minHeight?: number;
|
|
140
|
+
idealHeight?: number;
|
|
120
141
|
maxHeight?: number;
|
|
142
|
+
alignment?: FrameAlignment;
|
|
143
|
+
}): ModifierConfig;
|
|
144
|
+
export function frame(params: {
|
|
145
|
+
width?: number;
|
|
146
|
+
height?: number;
|
|
147
|
+
minWidth?: number;
|
|
121
148
|
idealWidth?: number;
|
|
149
|
+
maxWidth?: number;
|
|
150
|
+
minHeight?: number;
|
|
122
151
|
idealHeight?: number;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
152
|
+
maxHeight?: number;
|
|
153
|
+
alignment?: FrameAlignment;
|
|
154
|
+
}): ModifierConfig {
|
|
155
|
+
if (__DEV__) {
|
|
156
|
+
const { width, height, alignment: _alignment, ...flexible } = params;
|
|
157
|
+
const ignored = Object.keys(flexible).filter(
|
|
158
|
+
(key) => flexible[key as keyof typeof flexible] !== undefined
|
|
159
|
+
);
|
|
160
|
+
if ((width !== undefined || height !== undefined) && ignored.length > 0) {
|
|
161
|
+
console.warn(
|
|
162
|
+
`frame() ignores ${ignored.join(', ')} because width or height is also set. ` +
|
|
163
|
+
'SwiftUI applies fixed and flexible frames as separate modifiers. ' +
|
|
164
|
+
'Split the values into two calls, for example [frame({ height: 50 }), frame({ maxWidth: Infinity })].'
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return createModifier('frame', params);
|
|
169
|
+
}
|
|
134
170
|
|
|
135
171
|
/**
|
|
136
172
|
* Positions this view within an invisible frame with a size relative to the nearest container.
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8824700262a9ab7d8f339532d030c14d
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
842b6342d3ac040ed8069f06731423ce098d4c06
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.module.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
713717be0ec2dabfe766d7916d5c69df3434313c9cff38b1067c9efa8c46f9ab
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.module.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a0cbbe1a7eae1d80cd5d3284ab5fe64f36e357ed1b94685f469f7d71f7794e787fa6919d0d15df9eee791fe7142554344c0424ac4c9eb205dd2ce86b706b756e
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
990bdee8071627b4b6943b40dc1aec45
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
be3b0d33e5b9fb949a42f962c343e0119fdaedc0
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b3ded768986b2232ffeff134fec3af26cf68977a970bd9db2c5f6f7994d99391
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.5/expo.modules.ui-58.0.5.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fd0be2177afd1ca4fb68653adcd767e5f25e5c7fa99d787b79a7b63fc5ec234381d9374fb7c5233cc0fcc3bffce07bd9abbf30b43da1bc63777e3ea3f7b4c644
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|