@expo/ui 57.0.14 → 57.0.15

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/RNHostView.kt +20 -0
  4. package/build/jetpack-compose/RNHostView/index.d.ts +6 -0
  5. package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -1
  6. package/build/swift-ui/RNHostView.d.ts +2 -0
  7. package/build/swift-ui/RNHostView.d.ts.map +1 -1
  8. package/build/swift-ui/modifiers/index.d.ts +9 -34
  9. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  10. package/build/swift-ui/modifiers/presentationModifiers.d.ts +3 -2
  11. package/build/swift-ui/modifiers/presentationModifiers.d.ts.map +1 -1
  12. package/build/swift-ui/modifiers/shapeStyle.d.ts +54 -0
  13. package/build/swift-ui/modifiers/shapeStyle.d.ts.map +1 -0
  14. package/build/universal/BottomSheet/index.android.d.ts +1 -1
  15. package/build/universal/BottomSheet/index.android.d.ts.map +1 -1
  16. package/build/universal/BottomSheet/index.d.ts +1 -1
  17. package/build/universal/BottomSheet/index.d.ts.map +1 -1
  18. package/build/universal/BottomSheet/index.ios.d.ts +1 -1
  19. package/build/universal/BottomSheet/index.ios.d.ts.map +1 -1
  20. package/build/universal/BottomSheet/types.d.ts +20 -0
  21. package/build/universal/BottomSheet/types.d.ts.map +1 -1
  22. package/build/universal/ListItem/ListItem.android.d.ts.map +1 -1
  23. package/build/universal/ListItem/types.d.ts +19 -0
  24. package/build/universal/ListItem/types.d.ts.map +1 -1
  25. package/build/universal/RNHostView/index.android.d.ts +1 -1
  26. package/build/universal/RNHostView/index.android.d.ts.map +1 -1
  27. package/build/universal/RNHostView/index.d.ts +1 -1
  28. package/build/universal/RNHostView/index.d.ts.map +1 -1
  29. package/build/universal/RNHostView/index.ios.d.ts +1 -1
  30. package/build/universal/RNHostView/index.ios.d.ts.map +1 -1
  31. package/build/universal/RNHostView/types.d.ts +2 -0
  32. package/build/universal/RNHostView/types.d.ts.map +1 -1
  33. package/expo-module.config.json +1 -1
  34. package/ios/Convertibles/ShapeStyleValue.swift +129 -0
  35. package/ios/Modifiers/ForegroundStyleModifier.swift +12 -105
  36. package/ios/Modifiers/ViewModifierRegistry.swift +29 -5
  37. package/ios/RNHostView.swift +4 -0
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14-sources.jar → 57.0.15/expo.modules.ui-57.0.15-sources.jar} +0 -0
  39. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.md5 +1 -0
  40. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha1 +1 -0
  41. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha256 +1 -0
  42. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha512 +1 -0
  43. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14.aar → 57.0.15/expo.modules.ui-57.0.15.aar} +0 -0
  44. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.md5 +1 -0
  45. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha1 +1 -0
  46. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha256 +1 -0
  47. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha512 +1 -0
  48. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14.module → 57.0.15/expo.modules.ui-57.0.15.module} +22 -22
  49. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.md5 +1 -0
  50. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha1 +1 -0
  51. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha256 +1 -0
  52. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha512 +1 -0
  53. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14.pom → 57.0.15/expo.modules.ui-57.0.15.pom} +1 -1
  54. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.md5 +1 -0
  55. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha1 +1 -0
  56. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha256 +1 -0
  57. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha512 +1 -0
  58. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  59. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  60. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  61. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  62. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  63. package/package.json +3 -3
  64. package/src/jetpack-compose/RNHostView/index.tsx +12 -0
  65. package/src/swift-ui/RNHostView.tsx +3 -0
  66. package/src/swift-ui/modifiers/index.ts +10 -39
  67. package/src/swift-ui/modifiers/presentationModifiers.ts +3 -2
  68. package/src/swift-ui/modifiers/shapeStyle.ts +55 -0
  69. package/src/universal/BottomSheet/index.android.tsx +4 -0
  70. package/src/universal/BottomSheet/index.ios.tsx +5 -0
  71. package/src/universal/BottomSheet/index.tsx +4 -0
  72. package/src/universal/BottomSheet/types.ts +22 -0
  73. package/src/universal/ListItem/ListItem.android.tsx +2 -1
  74. package/src/universal/ListItem/types.ts +21 -0
  75. package/src/universal/RNHostView/index.android.tsx +2 -1
  76. package/src/universal/RNHostView/index.ios.tsx +6 -2
  77. package/src/universal/RNHostView/index.tsx +2 -0
  78. package/src/universal/RNHostView/types.ts +3 -0
  79. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.md5 +0 -1
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha1 +0 -1
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha256 +0 -1
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha512 +0 -1
  83. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.md5 +0 -1
  84. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha1 +0 -1
  85. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha256 +0 -1
  86. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha512 +0 -1
  87. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.md5 +0 -1
  88. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha1 +0 -1
  89. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha256 +0 -1
  90. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha512 +0 -1
  91. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.md5 +0 -1
  92. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha1 +0 -1
  93. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha256 +0 -1
  94. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha512 +0 -1
@@ -21,6 +21,7 @@ import { gaugeStyle } from './gaugeStyle';
21
21
  import { progressViewStyle } from './progressViewStyle';
22
22
  import { onScrollPhaseChange, useScrollGeometryChange } from './scrollObservation';
23
23
  import { id, scrollPosition } from './scrollPosition';
24
+ import { resolveShapeStyle, type ShapeStyle } from './shapeStyle';
24
25
  import { symbolEffect } from './symbolEffect';
25
26
  import type { Color } from './types';
26
27
  import { activityBackgroundTint, widgetAccentedRenderingMode, widgetURL } from './widgets';
@@ -457,51 +458,20 @@ export const foregroundColor = (color: Color) => createModifier('foregroundColor
457
458
  * })]}>
458
459
  * Gradient Text
459
460
  * </Text>
461
+ *
462
+ * // Material
463
+ * <Text modifiers={[foregroundStyle({ type: 'material', material: 'regular' })]}>
464
+ * Text painted with a material
465
+ * </Text>
460
466
  * ```
461
467
  *
468
+ * @param style - Any [`ShapeStyle`](#shapestyle): a color, a hierarchical style, a material or a gradient.
462
469
  * @returns A view modifier that applies the specified foreground style
463
470
  * @since iOS 15.0+ (hierarchical quinary requires iOS 16.0+)
464
471
  * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/foregroundstyle(_:)).
465
472
  */
466
- export const foregroundStyle = (
467
- style:
468
- | Color // Simple color (hex string, color name, or React Native ColorValue)
469
- | { type: 'color'; color: Color }
470
- | {
471
- type: 'hierarchical';
472
- style: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
473
- }
474
- | {
475
- type: 'linearGradient';
476
- colors: Color[];
477
- startPoint: { x: number; y: number };
478
- endPoint: { x: number; y: number };
479
- }
480
- | {
481
- type: 'radialGradient';
482
- colors: Color[];
483
- center: { x: number; y: number };
484
- startRadius: number;
485
- endRadius: number;
486
- }
487
- | {
488
- type: 'angularGradient';
489
- colors: Color[];
490
- center: { x: number; y: number };
491
- }
492
- ) => {
493
- if (style == null || typeof style !== 'object' || !('type' in style)) {
494
- return createModifier('foregroundStyle', { styleType: 'color', color: style });
495
- }
496
- if (style.type === 'hierarchical') {
497
- return createModifier('foregroundStyle', {
498
- styleType: 'hierarchical',
499
- hierarchicalStyle: style.style,
500
- });
501
- }
502
- const { type, ...rest } = style;
503
- return createModifier('foregroundStyle', { styleType: type, ...rest });
504
- };
473
+ export const foregroundStyle = (style: ShapeStyle) =>
474
+ createModifier('foregroundStyle', { style: resolveShapeStyle(style) });
505
475
 
506
476
  /**
507
477
  * Makes text bold.
@@ -1854,6 +1824,7 @@ export * from './progressViewStyle';
1854
1824
  export * from './gaugeStyle';
1855
1825
  export * from './presentationModifiers';
1856
1826
  export * from './environment';
1827
+ export type { ShapeStyle } from './shapeStyle';
1857
1828
  export * from './scrollPosition';
1858
1829
  export * from './symbolEffect';
1859
1830
  export * from './scrollObservation';
@@ -3,6 +3,7 @@ import {
3
3
  createModifierWithEventListener,
4
4
  type ModifierConfig,
5
5
  } from './createModifier';
6
+ import type { Color } from './types';
6
7
 
7
8
  /**
8
9
  * Presentation detent type for controlling sheet heights.
@@ -88,12 +89,12 @@ export const presentationBackgroundInteraction = (
88
89
  * Sets the background of a sheet presentation. Paints the entire sheet chrome
89
90
  * including the drag-indicator zone and home-indicator safe-area inset, which
90
91
  * a regular `background()` modifier cannot reach.
91
- * @param color - The background color (hex string). For example, `#FF0000`.
92
+ * @param color - The background color.
92
93
  * @platform ios 16.4+
93
94
  * @see Official [SwiftUI
94
95
  documentation](https://developer.apple.com/documentation/swiftui/view/presentationbackground(_:)).
95
96
  */
96
- export const presentationBackground = (color: string) =>
97
+ export const presentationBackground = (color: Color) =>
97
98
  createModifier('presentationBackground', { color });
98
99
 
99
100
  /**
@@ -0,0 +1,55 @@
1
+ import type { Color } from './types';
2
+
3
+ /**
4
+ * A style that paints an area, mirroring SwiftUI's `ShapeStyle`.
5
+ * A bare color is a shorthand for `{ type: 'color', color }`.
6
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/shapestyle).
7
+ */
8
+ export type ShapeStyle =
9
+ | Color // Simple color (hex string, color name, or React Native ColorValue)
10
+ | { type: 'color'; color: Color }
11
+ | {
12
+ type: 'hierarchical';
13
+ style: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
14
+ }
15
+ | {
16
+ /**
17
+ * A blurred backdrop that samples the content behind the view and adapts to the current
18
+ * color scheme. `'bar'` has no tvOS counterpart and is ignored there.
19
+ */
20
+ type: 'material';
21
+ material: 'ultraThin' | 'thin' | 'regular' | 'thick' | 'ultraThick' | 'bar';
22
+ }
23
+ | {
24
+ type: 'linearGradient';
25
+ colors: Color[];
26
+ startPoint: { x: number; y: number };
27
+ endPoint: { x: number; y: number };
28
+ }
29
+ | {
30
+ type: 'radialGradient';
31
+ colors: Color[];
32
+ center: { x: number; y: number };
33
+ startRadius: number;
34
+ endRadius: number;
35
+ }
36
+ | {
37
+ type: 'angularGradient';
38
+ colors: Color[];
39
+ center: { x: number; y: number };
40
+ };
41
+
42
+ /**
43
+ * Normalizes a style into the shape the native side reads. A `Color` may itself be an object
44
+ * (for example the one returned by `PlatformColor`), so a style is only treated as a tagged
45
+ * variant when it carries a `type` field.
46
+ */
47
+ export function resolveShapeStyle(style: ShapeStyle): Record<string, any> {
48
+ if (style == null || typeof style !== 'object' || !('type' in style)) {
49
+ return { type: 'color', color: style };
50
+ }
51
+ if (style.type === 'hierarchical') {
52
+ return { type: 'hierarchical', hierarchical: style.style };
53
+ }
54
+ return { ...style };
55
+ }
@@ -43,6 +43,8 @@ export function BottomSheet({
43
43
  shouldDismissOnClickOutside = true,
44
44
  scrimColor,
45
45
  contentPadding,
46
+ containerColor,
47
+ contentColor,
46
48
  }: BottomSheetProps) {
47
49
  const sheetRef = useRef<ModalBottomSheetRef>(null);
48
50
  const [mount, setMount] = useState(isPresented);
@@ -86,6 +88,8 @@ export function BottomSheet({
86
88
  skipPartiallyExpanded={shouldSkipPartiallyExpanded(snapPoints)}
87
89
  properties={{ shouldDismissOnBackPress, shouldDismissOnClickOutside }}
88
90
  scrimColor={scrimColor}
91
+ containerColor={containerColor}
92
+ contentColor={contentColor}
89
93
  modifiers={modifiers}>
90
94
  <Column modifiers={contentModifiers}>{children}</Column>
91
95
  </ModalBottomSheet>
@@ -2,6 +2,7 @@ import { BottomSheet as SwiftUIBottomSheet, Group, Host } from '@expo/ui/swift-u
2
2
  import {
3
3
  frame,
4
4
  padding,
5
+ presentationBackground,
5
6
  presentationDetents,
6
7
  presentationDragIndicator,
7
8
  type ModifierConfig,
@@ -26,6 +27,7 @@ export function BottomSheet({
26
27
  testID,
27
28
  modifiers,
28
29
  contentPadding,
30
+ containerColor,
29
31
  }: BottomSheetProps) {
30
32
  const { top, bottom, left, right } = resolveContentPadding(contentPadding, {
31
33
  top: 16,
@@ -41,6 +43,9 @@ export function BottomSheet({
41
43
  if (snapPoints && snapPoints.length > 0) {
42
44
  presentationModifiers.push(presentationDetents(snapPoints.map(snapPointToDetent)));
43
45
  }
46
+ if (containerColor) {
47
+ presentationModifiers.push(presentationBackground(containerColor));
48
+ }
44
49
  if (modifiers?.length) {
45
50
  presentationModifiers.push(...modifiers);
46
51
  }
@@ -35,6 +35,7 @@ export function BottomSheet({
35
35
  snapPoints,
36
36
  testID,
37
37
  contentPadding,
38
+ containerColor,
38
39
  }: BottomSheetProps) {
39
40
  const isDark = useColorScheme() === 'dark';
40
41
  const { top, bottom, left, right } = resolveContentPadding(contentPadding, {
@@ -63,6 +64,9 @@ export function BottomSheet({
63
64
  // The drawer has to fill the viewport or it gets pushed off-screen.
64
65
  ...(hasSnapPoints ? snapPointContentStyle : noSnapPointContentStyle),
65
66
  ...(showDragIndicator && dragIndicatorSpacing),
67
+ // An explicit containerColor overrides both the 'white' default
68
+ // above and the bare isDark fallback.
69
+ ...(typeof containerColor === 'string' && { backgroundColor: containerColor }),
66
70
  }}
67
71
  aria-describedby={undefined}>
68
72
  {/* Radix Dialog requires a title for a11y; render visually-hidden. */}
@@ -110,4 +110,26 @@ export interface BottomSheetProps {
110
110
  * from `@expo/ui/swift-ui/modifiers` or `@expo/ui/jetpack-compose/modifiers`.
111
111
  */
112
112
  modifiers?: ModifierConfig[];
113
+
114
+ /**
115
+ * The sheet's own background color, painting its full chrome (including the
116
+ * drag-indicator zone and, on iOS, the home-indicator safe-area inset).
117
+ * When omitted, each platform keeps its own default.
118
+ *
119
+ * This only paints the background. `children` are React Native views on
120
+ * every platform, so they don't pick up a contrasting text color
121
+ * automatically -- set one explicitly if you use a dark `containerColor`.
122
+ * @platform android
123
+ * @platform ios 16.4+
124
+ * @platform web
125
+ */
126
+ containerColor?: ColorValue;
127
+
128
+ /**
129
+ * The preferred color for native Compose content that doesn't set its own
130
+ * color. Doesn't reach a `BottomSheet`'s (React Native) `children` -- see
131
+ * `containerColor`'s doc.
132
+ * @platform android
133
+ */
134
+ contentColor?: ColorValue;
113
135
  }
@@ -26,6 +26,7 @@ export function ListItem(props: ListItemProps) {
26
26
  trailing: trailingProp,
27
27
  supportingText,
28
28
  modifiers,
29
+ colors,
29
30
  } = props;
30
31
  const slots = extractListItemSlots(children);
31
32
  const leading = slots.leading ?? leadingProp;
@@ -34,7 +35,7 @@ export function ListItem(props: ListItemProps) {
34
35
  const itemModifiers = [...(onPress ? [clickable(onPress)] : []), ...(modifiers ?? [])];
35
36
 
36
37
  return (
37
- <ComposeListItem modifiers={itemModifiers.length ? itemModifiers : undefined}>
38
+ <ComposeListItem colors={colors} modifiers={itemModifiers.length ? itemModifiers : undefined}>
38
39
  <ComposeListItem.HeadlineContent>
39
40
  <>{wrapStrings(slots.headline)}</>
40
41
  </ComposeListItem.HeadlineContent>
@@ -1,7 +1,22 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { ColorValue } from 'react-native';
2
3
 
3
4
  import type { ModifierConfig } from '../../types';
4
5
 
6
+ /**
7
+ * Colors for a `ListItem`'s row elements, matching Jetpack Compose's
8
+ * `ListItemDefaults.colors()` on Android.
9
+ * @platform android
10
+ */
11
+ export interface ListItemColors {
12
+ containerColor?: ColorValue;
13
+ contentColor?: ColorValue;
14
+ leadingContentColor?: ColorValue;
15
+ trailingContentColor?: ColorValue;
16
+ supportingContentColor?: ColorValue;
17
+ overlineContentColor?: ColorValue;
18
+ }
19
+
5
20
  /**
6
21
  * Props for the [`ListItem.Leading`](#listitemleading) slot marker.
7
22
  */
@@ -74,4 +89,10 @@ export interface ListItemProps {
74
89
  * its default `buttonStyle(.plain)`.
75
90
  */
76
91
  modifiers?: ModifierConfig[];
92
+
93
+ /**
94
+ * Row colors. Applied on Android via Compose's `ListItem.colors`.
95
+ * @platform android
96
+ */
97
+ colors?: ListItemColors;
77
98
  }
@@ -15,6 +15,7 @@ export function RNHostView({
15
15
  disabled,
16
16
  hidden,
17
17
  testID,
18
+ onLayout,
18
19
  modifiers: extraModifiers,
19
20
  }: RNHostViewProps) {
20
21
  const modifiers = transformToModifiers(
@@ -24,7 +25,7 @@ export function RNHostView({
24
25
  );
25
26
 
26
27
  return (
27
- <ComposeRNHostView matchContents={matchContents} modifiers={modifiers}>
28
+ <ComposeRNHostView matchContents={matchContents} modifiers={modifiers} onLayout={onLayout}>
28
29
  {children}
29
30
  </ComposeRNHostView>
30
31
  );
@@ -5,8 +5,12 @@ import type { RNHostViewProps } from './types';
5
5
  /**
6
6
  * Hosts React Native views inside SwiftUI views.
7
7
  */
8
- export function RNHostView({ children, matchContents }: RNHostViewProps) {
9
- return <SwiftUIRNHostView matchContents={matchContents}>{children}</SwiftUIRNHostView>;
8
+ export function RNHostView({ children, matchContents, onLayout }: RNHostViewProps) {
9
+ return (
10
+ <SwiftUIRNHostView matchContents={matchContents} onLayout={onLayout}>
11
+ {children}
12
+ </SwiftUIRNHostView>
13
+ );
10
14
  }
11
15
 
12
16
  export * from './types';
@@ -20,12 +20,14 @@ export function RNHostView({
20
20
  hidden = false,
21
21
  testID,
22
22
  matchContents = false,
23
+ onLayout,
23
24
  }: RNHostViewProps) {
24
25
  useUniversalLifecycle(onAppear, onDisappear);
25
26
 
26
27
  return (
27
28
  <View
28
29
  testID={testID}
30
+ onLayout={onLayout}
29
31
  style={[
30
32
  matchContents ? styles.matchContents : styles.fillParent,
31
33
  style,
@@ -1,4 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
+ import type { LayoutChangeEvent } from 'react-native';
2
3
 
3
4
  import type { UniversalBaseProps } from '../types';
4
5
 
@@ -18,6 +19,8 @@ export interface RNHostViewProps extends UniversalBaseProps {
18
19
  */
19
20
  matchContents?: boolean;
20
21
 
22
+ onLayout?: (event: LayoutChangeEvent) => void;
23
+
21
24
  /**
22
25
  * The React Native view to host.
23
26
  */
@@ -1 +0,0 @@
1
- 52d4523918d2d1e36704df643a721bc42831a30d
@@ -1 +0,0 @@
1
- b873eba373a618838203ac4021d4694eaf842a0114c10a5925cd0b68c69df887
@@ -1 +0,0 @@
1
- 7f85f310231cb704750cc75032268dda0fffff171528345c140fed39eb134be565c867ef329d092c1a128a88d6657576fb6e53b4009d40b8c465724ede556d08
@@ -1 +0,0 @@
1
- 6aaf95d2f756b71ada1992a1a74bdfb36146fb94
@@ -1 +0,0 @@
1
- 319460f26a7e44bc448ec15b0a2a60c28518cc6f3b38eaabc793d5edd69d4895
@@ -1 +0,0 @@
1
- 3e051539308c1cadbcf965de44aabe9360dbdce57508d9ee0da9b2c465e08dbd5eb65f936deabea9dbd47964e7e445347fbdb601962e13379338b1222937aeb8
@@ -1 +0,0 @@
1
- 4b12fa7cf2eafec047ae0bb4290fa9ea36c6a1a9
@@ -1 +0,0 @@
1
- 4c860ed7fc9f4b1492ee6bd299f9c0881ae8286f3eb0bcb95790c7285c19cd58
@@ -1 +0,0 @@
1
- ce1a1bea00c876f9666307b662e48a36d58f7dc4f26f5364c8039e542786d305d965855ef2b1832342fceca0c6e12bb87e906fb25a4ea41fe1da8d4b1585c459
@@ -1 +0,0 @@
1
- 834f927d24513892b48b4a45afe0d0e0322d274c
@@ -1 +0,0 @@
1
- 3f5e966c190b0b4a771b1e7498fd8d2d6227639ffdaa1ea746a8aad505469a8c
@@ -1 +0,0 @@
1
- 3e6f229eb05b6c860730c16d6e3d5ca9c47eac8569f2d84bf8f925c547857fce65361e69ed56153b55527a5df3785243987d27b934cc46c50200974e62a7c28c