@expo/ui 58.0.19 → 58.0.20

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 (35) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/android/build.gradle +2 -2
  3. package/build/swift-ui/Host/index.d.ts +11 -1
  4. package/build/swift-ui/Host/index.js.map +1 -1
  5. package/ios/HostView.swift +20 -1
  6. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.module → 58.0.20/expo.modules.ui-58.0.20.module} +7 -7
  7. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.module.md5 +1 -0
  8. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.module.sha1 +1 -0
  9. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.module.sha256 +1 -0
  10. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.module.sha512 +1 -0
  11. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.pom → 58.0.20/expo.modules.ui-58.0.20.pom} +1 -1
  12. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.pom.md5 +1 -0
  13. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.pom.sha1 +1 -0
  14. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.pom.sha256 +1 -0
  15. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.pom.sha512 +1 -0
  16. package/package.json +1 -1
  17. package/src/swift-ui/Host/index.tsx +12 -1
  18. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.module.md5 +0 -1
  19. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.module.sha1 +0 -1
  20. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.module.sha256 +0 -1
  21. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.module.sha512 +0 -1
  22. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.pom.md5 +0 -1
  23. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.pom.sha1 +0 -1
  24. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.pom.sha256 +0 -1
  25. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.pom.sha512 +0 -1
  26. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar → 58.0.20/expo.modules.ui-58.0.20-sources.jar} +0 -0
  27. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar.md5 → 58.0.20/expo.modules.ui-58.0.20-sources.jar.md5} +0 -0
  28. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar.sha1 → 58.0.20/expo.modules.ui-58.0.20-sources.jar.sha1} +0 -0
  29. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar.sha256 → 58.0.20/expo.modules.ui-58.0.20-sources.jar.sha256} +0 -0
  30. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar.sha512 → 58.0.20/expo.modules.ui-58.0.20-sources.jar.sha512} +0 -0
  31. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.aar → 58.0.20/expo.modules.ui-58.0.20.aar} +0 -0
  32. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.aar.md5 → 58.0.20/expo.modules.ui-58.0.20.aar.md5} +0 -0
  33. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.aar.sha1 → 58.0.20/expo.modules.ui-58.0.20.aar.sha1} +0 -0
  34. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.aar.sha256 → 58.0.20/expo.modules.ui-58.0.20.aar.sha256} +0 -0
  35. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.aar.sha512 → 58.0.20/expo.modules.ui-58.0.20.aar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 58.0.20
4
+
5
+ ### Patch Changes
6
+
7
+ - [iOS] Add an `alignment` prop to the SwiftUI `Host`. It sets where the content sits in the host when their sizes differ. A `matchContents` host anchored to the trailing edge of its row can now keep that edge still while its content animates to a new width. ([#51617](https://github.com/expo/expo/pull/51617) by [@maxlapides](https://github.com/maxlapides))
8
+
3
9
  ## 58.0.19
4
10
 
5
11
  ### Patch Changes
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
12
12
  apply plugin: 'org.jetbrains.kotlin.plugin.compose'
13
13
 
14
14
  group = 'expo.modules.ui'
15
- version = '58.0.19'
15
+ version = '58.0.20'
16
16
 
17
17
  android {
18
18
  namespace "expo.modules.ui"
19
19
  defaultConfig {
20
20
  versionCode 1
21
- versionName "58.0.19"
21
+ versionName "58.0.20"
22
22
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
23
23
  }
24
24
  buildFeatures {
@@ -1,6 +1,6 @@
1
1
  import type { Ref } from 'react';
2
2
  import { type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
3
- import { type CommonViewModifierProps } from '../types';
3
+ import { type Alignment, type CommonViewModifierProps } from '../types';
4
4
  export interface HostProps extends CommonViewModifierProps {
5
5
  /**
6
6
  * When true, the host view will update its size in the React Native view tree to match the content's layout from SwiftUI.
@@ -11,6 +11,16 @@ export interface HostProps extends CommonViewModifierProps {
11
11
  vertical?: boolean;
12
12
  horizontal?: boolean;
13
13
  };
14
+ /**
15
+ * The position of the SwiftUI content inside the host when their sizes differ. The sizes differ
16
+ * when the host is larger than its content, and while the content of a `matchContents` host
17
+ * animates to a new size. Setting it to the edge that the host is anchored to in its React
18
+ * Native layout keeps that edge still. For example, a host at the end of a row uses `'trailing'`.
19
+ * It also aligns the host's children with each other. Leading and trailing follow
20
+ * `layoutDirection`.
21
+ * @default 'topLeading'
22
+ */
23
+ alignment?: Alignment;
14
24
  /**
15
25
  * When true and no explicit size is provided, the host will use the viewport size as the proposed size for SwiftUI layout.
16
26
  * This is particularly useful for SwiftUI views that need to fill their available space, such as `Form`.
@@ -1 +1 @@
1
- {"version":3,"sources":["swift-ui/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","I18nManager","NativeTreeContext","useWarnIfNestedHost","TextInputHostProvider","useTextInputHostRef","useMergeRefs","createViewModifierEventListener","HostNativeView","Host","props","matchContents","onLayoutContent","ignoreSafeArea","modifiers","layoutDirection","seedColor","ref","children","restProps","hostRef","mergedRef","undefined","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL","Provider","value"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAASC,WAAW,QAAyD,eAAe;AAE5F,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACjF,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,+BAA+B,QAAQ,qBAAqB;AAyDrE,MAAMC,iBAMFR,kBAAkB,UAAU;AAEhC;;CAEC,GACD,OAAO,SAASS,KAAKC,KAAgB;IACnC,MAAM,EACJC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,eAAe,EACfC,SAAS,EACTC,GAAG,EACHC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IACJ,MAAMU,UAAUf;IAChB,MAAMgB,YAAYf,aAAaW,KAAKG;IACpCjB,oBAAoB;IAEpB,qBACE,KAACC;QAAsBgB,SAASA;kBAC9B,cAAA,KAACZ;YACCM,WAAWA;YACV,GAAIA,YAAYP,gCAAgCO,aAAaQ,SAAS;YACvEC,uBACE,OAAOZ,kBAAkB,WAAWA,cAAca,QAAQ,GAAGb;YAE/Dc,yBACE,OAAOd,kBAAkB,WAAWA,cAAce,UAAU,GAAGf;YAEjEC,iBAAiBA;YACjBG,iBACEA,mBAAoBd,CAAAA,YAAY0B,YAAY,GAAGC,KAAK,GAAG,gBAAgB,aAAY;YAErFf,gBAAgBA;YAChBG,WAAWA;YACV,GAAGG,SAAS;YACbF,KAAKI;sBACL,cAAA,KAACnB,kBAAkB2B,QAAQ;gBAACC,KAAK;0BAAEZ;;;;AAI3C"}
1
+ {"version":3,"sources":["swift-ui/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","I18nManager","NativeTreeContext","useWarnIfNestedHost","TextInputHostProvider","useTextInputHostRef","useMergeRefs","createViewModifierEventListener","HostNativeView","Host","props","matchContents","onLayoutContent","ignoreSafeArea","modifiers","layoutDirection","seedColor","ref","children","restProps","hostRef","mergedRef","undefined","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL","Provider","value"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAASC,WAAW,QAAyD,eAAe;AAE5F,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACjF,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,+BAA+B,QAAQ,qBAAqB;AAoErE,MAAMC,iBAMFR,kBAAkB,UAAU;AAEhC;;CAEC,GACD,OAAO,SAASS,KAAKC,KAAgB;IACnC,MAAM,EACJC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,eAAe,EACfC,SAAS,EACTC,GAAG,EACHC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IACJ,MAAMU,UAAUf;IAChB,MAAMgB,YAAYf,aAAaW,KAAKG;IACpCjB,oBAAoB;IAEpB,qBACE,KAACC;QAAsBgB,SAASA;kBAC9B,cAAA,KAACZ;YACCM,WAAWA;YACV,GAAIA,YAAYP,gCAAgCO,aAAaQ,SAAS;YACvEC,uBACE,OAAOZ,kBAAkB,WAAWA,cAAca,QAAQ,GAAGb;YAE/Dc,yBACE,OAAOd,kBAAkB,WAAWA,cAAce,UAAU,GAAGf;YAEjEC,iBAAiBA;YACjBG,iBACEA,mBAAoBd,CAAAA,YAAY0B,YAAY,GAAGC,KAAK,GAAG,gBAAgB,aAAY;YAErFf,gBAAgBA;YAChBG,WAAWA;YACV,GAAGG,SAAS;YACbF,KAAKI;sBACL,cAAA,KAACnB,kBAAkB2B,QAAQ;gBAACC,KAAK;0BAAEZ;;;;AAI3C"}
@@ -60,6 +60,7 @@ internal final class HostViewProps: ExpoSwiftUI.ViewProps, ExpoSwiftUI.SafeAreaC
60
60
  @Field var layoutDirection: ExpoLayoutDirection = .leftToRight
61
61
  @Field var matchContentsHorizontal = false
62
62
  @Field var matchContentsVertical = false
63
+ @Field var alignment: AlignmentOptions?
63
64
  @Field var ignoreSafeArea: ExpoSwiftUI.IgnoreSafeArea?
64
65
  @Field var modifiers: ModifierArray?
65
66
  var onLayoutContent = EventDispatcher()
@@ -75,7 +76,7 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
75
76
 
76
77
  var body: some View {
77
78
  let layoutDirection = props.layoutDirection.toLayoutDirection()
78
- let alignment: Alignment = layoutDirection == .rightToLeft ? .topTrailing : .topLeading
79
+ let alignment = physicalAlignment(props.alignment?.toAlignment() ?? .topLeading, layoutDirection: layoutDirection)
79
80
  let fillHorizontal = !props.useViewportSizeMeasurement && !props.matchContentsHorizontal
80
81
  let fillVertical = !props.useViewportSizeMeasurement && !props.matchContentsVertical
81
82
  let pinHorizontal = !props.useViewportSizeMeasurement && props.matchContentsHorizontal
@@ -137,6 +138,24 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
137
138
 
138
139
  }
139
140
 
141
+ /**
142
+ Mirrors the horizontal edge of `alignment` for a right-to-left `Host`. `FillAlignmentModifier` sits
143
+ outside `LayoutDirectionModifier`, so it reads leading and trailing in the hosting controller's
144
+ own direction.
145
+ */
146
+ private func physicalAlignment(_ alignment: Alignment, layoutDirection: LayoutDirection) -> Alignment {
147
+ guard layoutDirection == .rightToLeft else {
148
+ return alignment
149
+ }
150
+ if alignment.horizontal == .leading {
151
+ return Alignment(horizontal: .trailing, vertical: alignment.vertical)
152
+ }
153
+ if alignment.horizontal == .trailing {
154
+ return Alignment(horizontal: .leading, vertical: alignment.vertical)
155
+ }
156
+ return alignment
157
+ }
158
+
140
159
  /**
141
160
  A Layout designed for the `useViewportSizeMeasurement` behavior.
142
161
  If parent's proposedViewSize is zero or nil, it will try to use the viewport size to expand its children size.
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "expo.modules.ui",
5
5
  "module": "expo.modules.ui",
6
- "version": "58.0.19",
6
+ "version": "58.0.20",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.ui-58.0.19.aar",
28
- "url": "expo.modules.ui-58.0.19.aar",
27
+ "name": "expo.modules.ui-58.0.20.aar",
28
+ "url": "expo.modules.ui-58.0.20.aar",
29
29
  "size": 1859361,
30
30
  "sha512": "ba561fa50c9fde30184d2c36051e644fd87db59555b7b38f8e2e5b7096b03bf0d2aec3e53fff1831d2705d85b174ec1a7fc2e9cadc69c41237aac262bbea9365",
31
31
  "sha256": "6cbb10f1e4cd5618c6997d87c2021e97c7bab1b8fc4ecc7be48f563e9c0e284a",
@@ -141,8 +141,8 @@
141
141
  ],
142
142
  "files": [
143
143
  {
144
- "name": "expo.modules.ui-58.0.19.aar",
145
- "url": "expo.modules.ui-58.0.19.aar",
144
+ "name": "expo.modules.ui-58.0.20.aar",
145
+ "url": "expo.modules.ui-58.0.20.aar",
146
146
  "size": 1859361,
147
147
  "sha512": "ba561fa50c9fde30184d2c36051e644fd87db59555b7b38f8e2e5b7096b03bf0d2aec3e53fff1831d2705d85b174ec1a7fc2e9cadc69c41237aac262bbea9365",
148
148
  "sha256": "6cbb10f1e4cd5618c6997d87c2021e97c7bab1b8fc4ecc7be48f563e9c0e284a",
@@ -161,8 +161,8 @@
161
161
  },
162
162
  "files": [
163
163
  {
164
- "name": "expo.modules.ui-58.0.19-sources.jar",
165
- "url": "expo.modules.ui-58.0.19-sources.jar",
164
+ "name": "expo.modules.ui-58.0.20-sources.jar",
165
+ "url": "expo.modules.ui-58.0.20-sources.jar",
166
166
  "size": 113113,
167
167
  "sha512": "10ed672c04082cf5f06e6ca6dca0f28229f11f3d503d46e5b61dbc7d3ad50bfdc1399838dd38dc5b8c1643ec375c4bf1672c95606ce28f7ed36384f66b829b68",
168
168
  "sha256": "f9a24faad34f9f66bebcdde7d05a6cf72a8b4b9030819b80049de5084a694ef0",
@@ -0,0 +1 @@
1
+ b378b5a3097dfa2a27e87822671b5b1867b14d52
@@ -0,0 +1 @@
1
+ 46af13485988415a3ff14c812754b46df0b5cf7d0b7ebb28a80d7b16c3306fe4
@@ -0,0 +1 @@
1
+ c9fcfdbaa4dbae59c5112fffa82e03ce4c36bb3840f98c1f149c9b0d8d0634dff5c5f63e47f32e921933b5a29bdab362830aecf5f37e3fa82cd552c28e774f71
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>expo.modules.ui</groupId>
11
11
  <artifactId>expo.modules.ui</artifactId>
12
- <version>58.0.19</version>
12
+ <version>58.0.20</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.ui</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ ff65582de003d4ba6fbfb2194fb4bb97bd523798
@@ -0,0 +1 @@
1
+ fde46f8c2665d31cc8c43574f2897aed7e82a9db1e29fdf0a557e4c8d528f005
@@ -0,0 +1 @@
1
+ 1f1f387588df2979f0a9f2eb9db168b05343069b1ffe2f46f30da422e31d554d9133a96afc594e69824183460ab5bfb9f2982a43613d294c31eac7a3d814b23b
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/ui",
3
- "version": "58.0.19",
3
+ "version": "58.0.20",
4
4
  "description": "A collection of UI components",
5
5
  "keywords": [
6
6
  "Jetpack Compose",
@@ -6,7 +6,7 @@ import { NativeTreeContext, useWarnIfNestedHost } from '../../NativeTreeContext'
6
6
  import { TextInputHostProvider, useTextInputHostRef } from '../../keyboard';
7
7
  import { useMergeRefs } from '../../utils/useMergeRefs';
8
8
  import { createViewModifierEventListener } from '../modifiers/utils';
9
- import { type CommonViewModifierProps } from '../types';
9
+ import { type Alignment, type CommonViewModifierProps } from '../types';
10
10
 
11
11
  export interface HostProps extends CommonViewModifierProps {
12
12
  /**
@@ -16,6 +16,17 @@ export interface HostProps extends CommonViewModifierProps {
16
16
  */
17
17
  matchContents?: boolean | { vertical?: boolean; horizontal?: boolean };
18
18
 
19
+ /**
20
+ * The position of the SwiftUI content inside the host when their sizes differ. The sizes differ
21
+ * when the host is larger than its content, and while the content of a `matchContents` host
22
+ * animates to a new size. Setting it to the edge that the host is anchored to in its React
23
+ * Native layout keeps that edge still. For example, a host at the end of a row uses `'trailing'`.
24
+ * It also aligns the host's children with each other. Leading and trailing follow
25
+ * `layoutDirection`.
26
+ * @default 'topLeading'
27
+ */
28
+ alignment?: Alignment;
29
+
19
30
  /**
20
31
  * When true and no explicit size is provided, the host will use the viewport size as the proposed size for SwiftUI layout.
21
32
  * This is particularly useful for SwiftUI views that need to fill their available space, such as `Form`.
@@ -1 +0,0 @@
1
- 8c2bd451043981662411c611d1573f61b55cf5dd
@@ -1 +0,0 @@
1
- 82b20f15e0fbc0c319fa61f9d869f302953272c36c4f15afbf4ce22b9cf64a5a
@@ -1 +0,0 @@
1
- e4c834445928c130c75b01adbb0f1a7d875ebb80983b79e2c15f24fe34f832b90a23f53a82b6d5a925c8814f959b74f418f9e2d53f68bef68fb53a3c9486e6e6
@@ -1 +0,0 @@
1
- 7cce460c1fa19a0c3e04acff06cf0cf34596c0c4
@@ -1 +0,0 @@
1
- 58cda1507dfd9c49cea452e3bf9497b7516f2d926ca99101576c5bacf3126fdb
@@ -1 +0,0 @@
1
- 5074aa536b5e8a9cc938a82b32c4d7a2d495e86d55f27d120629d312e707e37a9707f1d2853daaf853e257fbb02f3f8622ec54d17a3d1959e5768e10c5efce81