@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
|
@@ -10,7 +10,7 @@ import { type ViewEvent } from '../../types';
|
|
|
10
10
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
11
11
|
import { type CommonViewModifierProps } from '../types';
|
|
12
12
|
|
|
13
|
-
export interface ListForEachProps<
|
|
13
|
+
export interface ListForEachProps<T> extends CommonViewModifierProps {
|
|
14
14
|
/** Called with deleted indices from this group's `data` array. */
|
|
15
15
|
onDelete?: (indices: number[]) => void;
|
|
16
16
|
/**
|
|
@@ -19,16 +19,16 @@ export interface ListForEachProps<ItemT> extends CommonViewModifierProps {
|
|
|
19
19
|
*/
|
|
20
20
|
onMove?: (sourceIndices: number[], destination: number) => void;
|
|
21
21
|
/** Items to display. Replace the array when updating data. */
|
|
22
|
-
data: readonly
|
|
22
|
+
data: readonly T[];
|
|
23
23
|
/** Returns a stable, unique string key, also used for `List` selection. */
|
|
24
|
-
keyExtractor: (item:
|
|
24
|
+
keyExtractor: (item: T, index: number) => string;
|
|
25
25
|
/**
|
|
26
26
|
* Renders a row. When `recycling` is `true`, wrap it in `useCallback`, or every row
|
|
27
27
|
* re-renders on each parent render.
|
|
28
28
|
* Recycled rows are reused for other items, so their local state (`useState`) carries over.
|
|
29
29
|
* Reset it when the item changes, or keep the state outside the row.
|
|
30
30
|
*/
|
|
31
|
-
children: (info: { item:
|
|
31
|
+
children: (info: { item: T; index: number }) => ReactElement;
|
|
32
32
|
/**
|
|
33
33
|
* Renders only the rows near the visible range and reuses them while scrolling. Set to `false` to
|
|
34
34
|
* render every row at once. Set it once; changing it remounts the rows.
|
|
@@ -43,8 +43,7 @@ export interface ListForEachProps<ItemT> extends CommonViewModifierProps {
|
|
|
43
43
|
overscanCount?: number;
|
|
44
44
|
/**
|
|
45
45
|
* Placeholder height in points, excluding `List` insets, until a row is measured.
|
|
46
|
-
* Must be positive.
|
|
47
|
-
* Ignored when `recycling` is `false`.
|
|
46
|
+
* Must be positive. Ignored when `recycling` is `false`.
|
|
48
47
|
* @default 64
|
|
49
48
|
*/
|
|
50
49
|
estimatedItemSize?: number;
|
|
@@ -74,7 +73,7 @@ const NativePool = requireNativeView<{ children: ReactElement[] }>(
|
|
|
74
73
|
* Rows show placeholders while JS prepares content. Native keys still cover the full data set.
|
|
75
74
|
* @platform ios
|
|
76
75
|
*/
|
|
77
|
-
export function DataListForEach<
|
|
76
|
+
export function DataListForEach<T>({
|
|
78
77
|
data,
|
|
79
78
|
keyExtractor,
|
|
80
79
|
children: renderItem,
|
|
@@ -84,7 +83,7 @@ export function DataListForEach<ItemT>({
|
|
|
84
83
|
onDelete,
|
|
85
84
|
onMove,
|
|
86
85
|
...props
|
|
87
|
-
}: ListForEachProps<
|
|
86
|
+
}: ListForEachProps<T>) {
|
|
88
87
|
const { itemKeys, revision, rows, onWindowChange, isCurrentRevision } = useRecycledRows({
|
|
89
88
|
componentName: 'List.ForEach',
|
|
90
89
|
Slot: NativeSlot,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
2
3
|
|
|
3
4
|
import { useItemKeys } from '../../recycling/useRecycledRows';
|
|
4
5
|
import { type ViewEvent } from '../../types';
|
|
@@ -56,7 +57,13 @@ let warnedElements = false;
|
|
|
56
57
|
* Pass `data` with `keyExtractor`, and render each row from a `children` function.
|
|
57
58
|
* Recycles rows unless `recycling` is `false`.
|
|
58
59
|
*/
|
|
59
|
-
export function ListForEach<
|
|
60
|
+
export function ListForEach<T>(props: ListForEachProps<T>): ReactElement;
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
* @deprecated Pass `data` and `keyExtractor`, and render each row from a `children` function.
|
|
64
|
+
*/
|
|
65
|
+
export function ListForEach(props: ListForEachElementsProps): ReactElement;
|
|
66
|
+
export function ListForEach<T>(props: ListForEachProps<T> | ListForEachElementsProps) {
|
|
60
67
|
if (props.data === undefined) {
|
|
61
68
|
if (__DEV__ && !warnedElements) {
|
|
62
69
|
warnedElements = true;
|
|
@@ -87,14 +94,14 @@ function ChildrenListForEach({ children, onDelete, onMove, ...props }: ListForEa
|
|
|
87
94
|
);
|
|
88
95
|
}
|
|
89
96
|
|
|
90
|
-
function StaticListForEach<
|
|
97
|
+
function StaticListForEach<T>({
|
|
91
98
|
data,
|
|
92
99
|
keyExtractor,
|
|
93
100
|
children: renderItem,
|
|
94
101
|
overscanCount: _overscanCount,
|
|
95
102
|
estimatedItemSize: _estimatedItemSize,
|
|
96
103
|
...props
|
|
97
|
-
}: Omit<ListForEachProps<
|
|
104
|
+
}: Omit<ListForEachProps<T>, 'recycling'>) {
|
|
98
105
|
const itemKeys = useItemKeys('List.ForEach', data, keyExtractor);
|
|
99
106
|
return (
|
|
100
107
|
<ChildrenListForEach {...props}>
|
|
@@ -2,6 +2,7 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
import type { LayoutChangeEvent } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { PresentedContentContext, useIsPresentedInOwnWindow } from '../PresentedContentContext';
|
|
5
|
+
import { resolveMatchContents } from '../utils/matchContents';
|
|
5
6
|
|
|
6
7
|
const RNHostNativeView: React.ComponentType<any> = requireNativeView('ExpoUI', 'RNHostView');
|
|
7
8
|
|
|
@@ -10,10 +11,12 @@ export interface RNHostViewProps {
|
|
|
10
11
|
* When `true`, the RNHost will update its size in the React Native view tree to match the
|
|
11
12
|
* children's size.
|
|
12
13
|
* When `false`, the RNHost will use the size of the parent SwiftUI View.
|
|
14
|
+
* Pass an object to choose per axis. For example, `{ vertical: true }` takes the width from the
|
|
15
|
+
* parent and the height from the children, so text wraps and grows vertically.
|
|
13
16
|
* Can be only set once on mount.
|
|
14
17
|
* @default false
|
|
15
18
|
*/
|
|
16
|
-
matchContents?: boolean;
|
|
19
|
+
matchContents?: boolean | { vertical?: boolean; horizontal?: boolean };
|
|
17
20
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
18
21
|
/**
|
|
19
22
|
* The RN View to be hosted.
|
|
@@ -21,21 +24,25 @@ export interface RNHostViewProps {
|
|
|
21
24
|
children: React.ReactElement;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
export function RNHostView(props: RNHostViewProps) {
|
|
27
|
+
export function RNHostView({ matchContents, ...props }: RNHostViewProps) {
|
|
25
28
|
// A sheet or popover presents its content in its own view controller, where the React Native
|
|
26
29
|
// surface root is not an ancestor and so touch dispatches don't work.
|
|
27
30
|
// Hosted content there owns its touches and is the origin it is measured from; native reads
|
|
28
31
|
// this one prop for both.
|
|
29
32
|
const layoutRoot = useIsPresentedInOwnWindow();
|
|
33
|
+
const { horizontal: matchContentsHorizontal, vertical: matchContentsVertical } =
|
|
34
|
+
resolveMatchContents(matchContents);
|
|
30
35
|
|
|
31
36
|
return (
|
|
32
37
|
<RNHostNativeView
|
|
33
38
|
{...props}
|
|
34
39
|
layoutRoot={layoutRoot}
|
|
35
|
-
|
|
40
|
+
matchContentsHorizontal={matchContentsHorizontal}
|
|
41
|
+
matchContentsVertical={matchContentsVertical}
|
|
42
|
+
expoInternalSizeFromChildren={matchContentsHorizontal || matchContentsVertical}
|
|
36
43
|
// `matchContents` can only be used once on mount
|
|
37
44
|
// So we force unmount when it changes to prevent unexpected layout
|
|
38
|
-
key={
|
|
45
|
+
key={`${matchContentsHorizontal}-${matchContentsVertical}`}>
|
|
39
46
|
{/* Reset context here so only nearest RNHostView becomes the layout root for its children, and not any other RNHostView above it in the tree. */}
|
|
40
47
|
<PresentedContentContext.Provider value={false}>
|
|
41
48
|
{props.children}
|
package/src/swift-ui/index.tsx
CHANGED
|
@@ -20,6 +20,7 @@ export * from './LabeledContent';
|
|
|
20
20
|
export * from './HStack';
|
|
21
21
|
export * from './LazyHStack';
|
|
22
22
|
export * from './LazyVStack';
|
|
23
|
+
export { type LazyStackForEachProps } from './LazyStackForEach';
|
|
23
24
|
export * from './VStack';
|
|
24
25
|
export * from './ZStack';
|
|
25
26
|
export * from './Group';
|
|
@@ -6,8 +6,8 @@ export type ContainerBackgroundPlacement = 'widget' | 'navigation' | 'navigation
|
|
|
6
6
|
/**
|
|
7
7
|
* Sets the container background of the enclosing container.
|
|
8
8
|
*
|
|
9
|
-
* > **Note:** `navigation` and `navigationSplitView` require iOS 18.
|
|
10
|
-
* >
|
|
9
|
+
* > **Note:** `navigation` and `navigationSplitView` require iOS 18. The `widget` placement works
|
|
10
|
+
* > only in `expo-widgets` widgets, where the other placements fall back to it on iOS 17.
|
|
11
11
|
*
|
|
12
12
|
* @param style - Any [`ShapeStyle`](#shapestyle): a color, a hierarchical style, a material, or a gradient.
|
|
13
13
|
* @param container - The type of container to apply the background to.
|
|
@@ -826,6 +826,16 @@ export const scrollDismissesKeyboard = (
|
|
|
826
826
|
export const scrollDisabled = (disabled: boolean = true) =>
|
|
827
827
|
createModifier('scrollDisabled', { disabled });
|
|
828
828
|
|
|
829
|
+
/**
|
|
830
|
+
* Sets the preferred color scheme for the nearest enclosing presentation, such as a `BottomSheet`,
|
|
831
|
+
* including its background. The value overrides the device's light or dark appearance for that
|
|
832
|
+
* presentation.
|
|
833
|
+
* @param colorScheme - The preferred color scheme, or `null` to indicate no preference.
|
|
834
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/preferredcolorscheme(_:)).
|
|
835
|
+
*/
|
|
836
|
+
export const preferredColorScheme = (colorScheme: 'light' | 'dark' | null) =>
|
|
837
|
+
createModifier('preferredColorScheme', { colorScheme });
|
|
838
|
+
|
|
829
839
|
/**
|
|
830
840
|
* Disables or enables clipping of a scrollable view's content to its bounds.
|
|
831
841
|
* Content drawn outside those bounds, such as a shadow or a view scaled up past the edge, is
|
|
@@ -1839,6 +1849,7 @@ export type BuiltInModifier =
|
|
|
1839
1849
|
| ReturnType<typeof containerRelativeFrame>
|
|
1840
1850
|
| ReturnType<typeof scrollContentBackground>
|
|
1841
1851
|
| ReturnType<typeof scrollDisabled>
|
|
1852
|
+
| ReturnType<typeof preferredColorScheme>
|
|
1842
1853
|
| ReturnType<typeof scrollClipDisabled>
|
|
1843
1854
|
| ReturnType<typeof scrollIndicators>
|
|
1844
1855
|
| ReturnType<typeof scrollEdgeEffectStyle>
|
|
@@ -33,7 +33,10 @@ export function ListItem(props: ListItemProps) {
|
|
|
33
33
|
const supporting = slots.supporting ?? supportingText;
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<Pressable
|
|
36
|
+
<Pressable
|
|
37
|
+
onPress={onPress}
|
|
38
|
+
style={[styles.row, onPress != null ? styles.rowIsPressable : styles.rowIsStatic]}
|
|
39
|
+
testID={testID}>
|
|
37
40
|
{leading != null ? <View style={styles.slot}>{leading}</View> : null}
|
|
38
41
|
<View style={styles.main}>
|
|
39
42
|
<Text style={isDark && styles.darkText}>{slots.headline}</Text>
|
|
@@ -52,8 +55,14 @@ const styles = StyleSheet.create({
|
|
|
52
55
|
width: '100%',
|
|
53
56
|
paddingVertical: 12,
|
|
54
57
|
paddingHorizontal: 16,
|
|
58
|
+
},
|
|
59
|
+
// Pressable defaults to cursor: pointer; override it when not pressable.
|
|
60
|
+
rowIsPressable: {
|
|
55
61
|
cursor: 'pointer',
|
|
56
62
|
},
|
|
63
|
+
rowIsStatic: {
|
|
64
|
+
cursor: 'auto',
|
|
65
|
+
},
|
|
57
66
|
main: {
|
|
58
67
|
flexDirection: 'column',
|
|
59
68
|
gap: 2,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { StyleSheet, View } from 'react-native';
|
|
2
2
|
|
|
3
|
+
import { resolveMatchContents } from '../../utils/matchContents';
|
|
3
4
|
import { useUniversalLifecycle } from '../hooks';
|
|
4
5
|
import type { RNHostViewProps } from './types';
|
|
5
6
|
|
|
6
7
|
const styles = StyleSheet.create({
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
fillWidth: { width: '100%' },
|
|
9
|
+
fillHeight: { height: '100%' },
|
|
10
|
+
fitWidth: { width: 'fit-content' },
|
|
11
|
+
fitHeight: { height: 'fit-content' },
|
|
9
12
|
hidden: { display: 'none' },
|
|
10
13
|
});
|
|
11
14
|
|
|
@@ -23,13 +26,15 @@ export function RNHostView({
|
|
|
23
26
|
onLayout,
|
|
24
27
|
}: RNHostViewProps) {
|
|
25
28
|
useUniversalLifecycle(onAppear, onDisappear);
|
|
29
|
+
const { horizontal, vertical } = resolveMatchContents(matchContents);
|
|
26
30
|
|
|
27
31
|
return (
|
|
28
32
|
<View
|
|
29
33
|
testID={testID}
|
|
30
34
|
onLayout={onLayout}
|
|
31
35
|
style={[
|
|
32
|
-
|
|
36
|
+
horizontal ? styles.fitWidth : styles.fillWidth,
|
|
37
|
+
vertical ? styles.fitHeight : styles.fillHeight,
|
|
33
38
|
style,
|
|
34
39
|
hidden && styles.hidden,
|
|
35
40
|
]}>
|
|
@@ -8,16 +8,18 @@ import type { UniversalBaseProps } from '../types';
|
|
|
8
8
|
*/
|
|
9
9
|
export interface RNHostViewProps extends UniversalBaseProps {
|
|
10
10
|
/**
|
|
11
|
-
* When `true`, the host updates its size in the
|
|
12
|
-
* the children's size. When `false`, the host uses the size of the parent
|
|
13
|
-
*
|
|
11
|
+
* When `true`, the host updates its size in the SwiftUI or Compose view tree to
|
|
12
|
+
* match the children's size. When `false`, the host uses the size of the parent
|
|
13
|
+
* SwiftUI or Compose view. Pass an object to choose per axis. For example,
|
|
14
|
+
* `{ vertical: true }` takes the width from the parent and the height from the
|
|
15
|
+
* children, so text wraps and grows vertically.
|
|
14
16
|
*
|
|
15
17
|
* Can only be set once on mount; changing it remounts the component.
|
|
16
18
|
* @default false
|
|
17
19
|
* @platform android
|
|
18
20
|
* @platform ios
|
|
19
21
|
*/
|
|
20
|
-
matchContents?: boolean;
|
|
22
|
+
matchContents?: boolean | { vertical?: boolean; horizontal?: boolean };
|
|
21
23
|
|
|
22
24
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
23
25
|
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Row, Switch as ComposeSwitch, Text } from '@expo/ui/jetpack-compose';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
fillMaxWidth,
|
|
4
|
+
IntrinsicSize,
|
|
5
|
+
testID as testIDModifier,
|
|
6
|
+
weight,
|
|
7
|
+
width,
|
|
8
|
+
} from '@expo/ui/jetpack-compose/modifiers';
|
|
3
9
|
|
|
4
10
|
import type { SwitchProps } from './types';
|
|
5
11
|
|
|
@@ -16,7 +22,10 @@ export function Switch({ value, onValueChange, label, disabled, testID, modifier
|
|
|
16
22
|
if (label == null) return toggle;
|
|
17
23
|
|
|
18
24
|
return (
|
|
19
|
-
<Row
|
|
25
|
+
<Row
|
|
26
|
+
verticalAlignment="center"
|
|
27
|
+
horizontalArrangement={{ spacedBy: 8 }}
|
|
28
|
+
modifiers={[fillMaxWidth(), width(IntrinsicSize.Max)]}>
|
|
20
29
|
<Text modifiers={[weight(1)]}>{label}</Text>
|
|
21
30
|
{toggle}
|
|
22
31
|
</Row>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves `RNHostView`'s `matchContents` prop to one flag per axis.
|
|
3
|
+
*/
|
|
4
|
+
export function resolveMatchContents(
|
|
5
|
+
matchContents: boolean | { vertical?: boolean; horizontal?: boolean } | null | undefined
|
|
6
|
+
): { horizontal: boolean; vertical: boolean } {
|
|
7
|
+
if (matchContents != null && typeof matchContents === 'object') {
|
|
8
|
+
return {
|
|
9
|
+
horizontal: matchContents.horizontal ?? false,
|
|
10
|
+
vertical: matchContents.vertical ?? false,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return { horizontal: matchContents ?? false, vertical: matchContents ?? false };
|
|
14
|
+
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
import ExpoModulesCore
|
|
3
|
-
#if !os(tvOS)
|
|
4
|
-
import WidgetKit
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
|
-
public final class AccessoryWidgetBackgroundProps: UIBaseViewProps {}
|
|
8
|
-
|
|
9
|
-
public struct AccessoryWidgetBackgroundView: ExpoSwiftUI.View {
|
|
10
|
-
@ObservedObject public var props: AccessoryWidgetBackgroundProps
|
|
11
|
-
|
|
12
|
-
public init(props: AccessoryWidgetBackgroundProps) {
|
|
13
|
-
self.props = props
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public var body: some View {
|
|
17
|
-
#if !os(tvOS)
|
|
18
|
-
if #available(iOS 16.0, *) {
|
|
19
|
-
AccessoryWidgetBackground()
|
|
20
|
-
} else {
|
|
21
|
-
Color.clear
|
|
22
|
-
}
|
|
23
|
-
#else
|
|
24
|
-
EmptyView()
|
|
25
|
-
#endif
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
-
|
|
3
|
-
import ExpoModulesCore
|
|
4
|
-
import SwiftUI
|
|
5
|
-
#if !os(tvOS)
|
|
6
|
-
import WidgetKit
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
internal enum WidgetAccentedRenderingModeOptions: String, Enumerable {
|
|
10
|
-
case accented
|
|
11
|
-
case desaturated
|
|
12
|
-
case accentedDesaturated
|
|
13
|
-
case fullColor
|
|
14
|
-
|
|
15
|
-
#if !os(tvOS)
|
|
16
|
-
@available(iOS 18.0, macOS 15.0, *)
|
|
17
|
-
var toWidgetAccentedRenderingMode: WidgetAccentedRenderingMode {
|
|
18
|
-
switch self {
|
|
19
|
-
case .accented: return .accented
|
|
20
|
-
case .accentedDesaturated: return .accentedDesaturated
|
|
21
|
-
case .desaturated: return .desaturated
|
|
22
|
-
case .fullColor: return .fullColor
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
#endif
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* This is a unique modifier that exists only on Image, but returns some View, and for this reason it cannot be a ViewModifier.
|
|
30
|
-
*/
|
|
31
|
-
internal struct WidgetAccentedRenderingModeModifier: Record {
|
|
32
|
-
@Field var renderingMode: WidgetAccentedRenderingModeOptions?
|
|
33
|
-
|
|
34
|
-
@ViewBuilder
|
|
35
|
-
func apply(to image: Image) -> some View {
|
|
36
|
-
#if !os(tvOS)
|
|
37
|
-
if #available(iOS 18.0, macOS 15.0, *), renderingMode != nil {
|
|
38
|
-
image.widgetAccentedRenderingMode(renderingMode?.toWidgetAccentedRenderingMode)
|
|
39
|
-
} else {
|
|
40
|
-
image
|
|
41
|
-
}
|
|
42
|
-
#else
|
|
43
|
-
image
|
|
44
|
-
#endif
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
internal struct WidgetURLModifier: ViewModifier, Record {
|
|
49
|
-
@Field var url: URL?
|
|
50
|
-
|
|
51
|
-
func body(content: Content) -> some View {
|
|
52
|
-
#if !os(tvOS)
|
|
53
|
-
content.widgetURL(url)
|
|
54
|
-
#else
|
|
55
|
-
content
|
|
56
|
-
#endif
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
internal struct ActivityBackgroundTintModifier: ViewModifier, Record {
|
|
61
|
-
@Field var color: Color?
|
|
62
|
-
|
|
63
|
-
func body(content: Content) -> some View {
|
|
64
|
-
#if !os(tvOS) && !os(macOS) && !targetEnvironment(macCatalyst)
|
|
65
|
-
content.activityBackgroundTint(color)
|
|
66
|
-
#else
|
|
67
|
-
content
|
|
68
|
-
#endif
|
|
69
|
-
}
|
|
70
|
-
}
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8-sources.jar
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9fb8758d9f0ad26c9154ad6536600e2c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c96c6c3f5dc0911a893274646c0cf2096a610423
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
02ee570f6a4a03679186bf43c56875eebf84f15abb7e79bb7040eddad7da908d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fe7df10c6d11c1f95ca7de35f60911401b64bd4b258c6c7956611f973bd062a367c0aea2693298e3d703e58a89b70cfd2c47851400299d035ea28499e595fb8e
|
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
31be76a409dceed307ca47e9e66c8348
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
94aec72d27a48e827dbb31b9d734150334b08662
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
315787d05711205c64b7245b046f29efe369b50f4e86866afef62b2b2474e537
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e5ced1751f3e2e90a7320abf88d98bea0a578fbcabcf73c0aca0e9997efe4d0313375d810c789fe2d96f6f6d5cdb9f36c21c2b82f67db8626149105938f29523
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d90e8090b804462073dc5b54b9753b7d
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
04e6aa44f454389ad4bdd5cf30bd1d86bae120ad
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.module.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dc6fa612aeec16b9c3aeda4837e935cdeeb84368a021a3f44def2a1f95101945
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.module.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
576894a57cc60ce514c66e1cabe503a43173905290c5982e5268be4c8cf344b915e5320d628c809ce8b1fa8d199bca5293717a98be66f0ade834a7a3f2dbb57c
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bc00f54a242aca990d0c2de2c183ebc5
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1796327cd18b03ab779e31706ba31eae75368745
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f2ca3168b9cef1803d4210547ea66a36803383de87fcbb41f0dccb5b7505d34d
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.8/expo.modules.ui-58.0.8.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ce4c6350bbf8c0e67d3e2d2bc08434e67d236e63cb336a35b82962d1842dec854ddfe8e78c45e4b09d43e48e2dee4b8a8f18cce0520e95df65ddcb16721742cd
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<metadata>
|
|
3
|
-
<groupId>expo.modules.ui</groupId>
|
|
4
|
-
<artifactId>expo.modules.ui</artifactId>
|
|
5
|
-
<versioning>
|
|
6
|
-
<latest>58.0.8</latest>
|
|
7
|
-
<release>58.0.8</release>
|
|
8
|
-
<versions>
|
|
9
|
-
<version>58.0.8</version>
|
|
10
|
-
</versions>
|
|
11
|
-
<lastUpdated>20260928121125</lastUpdated>
|
|
12
|
-
</versioning>
|
|
13
|
-
</metadata>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e688c2de104d33044dd1efbb0fb077a5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c07aaec5e802705f3098f5318af20765f1b90eaf
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7d1dc7ca750e3904d57d825eed29663ed37a41fa992e790bd198f2fe23579db2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d47c70eb9cd8b56d5ff5494bd9fca491c4a71662d618fa6a0dc0b82394a129c8bf18ab740bf4eea86f8fe115c41fc2251d0fb53f8b0f51ff9cd094e2f50472fa
|