@expo/ui 58.0.19 → 58.0.21

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 (44) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/android/build.gradle +2 -2
  3. package/build/community/segmented-control/vendor/SegmentedControl.js +2 -2
  4. package/build/community/segmented-control/vendor/SegmentedControl.js.map +1 -1
  5. package/build/swift-ui/Host/index.d.ts +11 -1
  6. package/build/swift-ui/Host/index.js.map +1 -1
  7. package/ios/DataListForEachView.swift +24 -6
  8. package/ios/HostView.swift +20 -1
  9. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar +0 -0
  10. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.md5 +1 -0
  11. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha1 +1 -0
  12. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha256 +1 -0
  13. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha512 +1 -0
  14. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.module → 58.0.21/expo.modules.ui-58.0.21.module} +17 -17
  15. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.md5 +1 -0
  16. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha1 +1 -0
  17. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha256 +1 -0
  18. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha512 +1 -0
  19. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19.pom → 58.0.21/expo.modules.ui-58.0.21.pom} +1 -1
  20. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.md5 +1 -0
  21. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha1 +1 -0
  22. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha256 +1 -0
  23. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha512 +1 -0
  24. package/package.json +1 -1
  25. package/src/community/segmented-control/vendor/SegmentedControl.tsx +10 -2
  26. package/src/swift-ui/Host/index.tsx +12 -1
  27. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.aar +0 -0
  28. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.aar.md5 +0 -1
  29. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.aar.sha1 +0 -1
  30. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.aar.sha256 +0 -1
  31. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.aar.sha512 +0 -1
  32. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.module.md5 +0 -1
  33. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.module.sha1 +0 -1
  34. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.module.sha256 +0 -1
  35. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.module.sha512 +0 -1
  36. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.pom.md5 +0 -1
  37. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.pom.sha1 +0 -1
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.pom.sha256 +0 -1
  39. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.19/expo.modules.ui-58.0.19.pom.sha512 +0 -1
  40. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar → 58.0.21/expo.modules.ui-58.0.21-sources.jar} +0 -0
  41. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar.md5 → 58.0.21/expo.modules.ui-58.0.21-sources.jar.md5} +0 -0
  42. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar.sha1 → 58.0.21/expo.modules.ui-58.0.21-sources.jar.sha1} +0 -0
  43. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar.sha256 → 58.0.21/expo.modules.ui-58.0.21-sources.jar.sha256} +0 -0
  44. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.19/expo.modules.ui-58.0.19-sources.jar.sha512 → 58.0.21/expo.modules.ui-58.0.21-sources.jar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 58.0.21
4
+
5
+ ### Patch Changes
6
+
7
+ - [iOS] Fix `List.ForEach` with `data` and a `children` render function. With recycling, `List` ignored the `moveDisabled` and `deleteDisabled` modifiers on a row. With `recycling={false}`, dragging a row did not reorder it or call `onMove`, and `onDelete` received the wrong index. ([#51704](https://github.com/expo/expo/pull/51704) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
8
+ - [Web] Stop the community `SegmentedControl` from logging the `useNativeDriver` warning when it mounts. ([#51775](https://github.com/expo/expo/pull/51775) by [@miniware9](https://github.com/miniware9))
9
+
10
+ ## 58.0.20
11
+
12
+ ### Patch Changes
13
+
14
+ - [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))
15
+
3
16
  ## 58.0.19
4
17
 
5
18
  ### 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.21'
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.21"
22
22
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
23
23
  }
24
24
  buildFeatures {
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  * Vendored from @react-native-segmented-control/segmented-control (MIT license).
5
5
  * https://github.com/react-native-segmented-control/segmented-control
6
6
  */ import * as React from 'react';
7
- import { Animated, Easing, I18nManager, StyleSheet, View, useColorScheme } from 'react-native';
7
+ import { Animated, Easing, I18nManager, Platform, StyleSheet, View, useColorScheme } from 'react-native';
8
8
  import { SegmentedControlTab } from './SegmentedControlTab';
9
9
  import { SegmentsSeparators } from './SegmentsSeparators';
10
10
  import { buildChangeEvent } from '../types';
@@ -40,7 +40,7 @@ export function SegmentedControl({ style, onChange, onValueChange, enabled = tru
40
40
  toValue: isRTL * (selectedIndex ?? 0),
41
41
  duration: 300,
42
42
  easing: Easing.out(Easing.quad),
43
- useNativeDriver: true
43
+ useNativeDriver: Platform.OS !== 'web'
44
44
  }).start();
45
45
  }
46
46
  }, [
@@ -1 +1 @@
1
- {"version":3,"sources":["community/segmented-control/vendor/SegmentedControl.tsx"],"sourcesContent":[null],"names":["React","Animated","Easing","I18nManager","StyleSheet","View","useColorScheme","SegmentedControlTab","SegmentsSeparators","buildChangeEvent","SegmentedControl","style","onChange","onValueChange","enabled","selectedIndex","values","tintColor","appearance","colorSchemeHook","colorScheme","segmentWidth","setSegmentWidth","useState","animation","useRef","Value","current","handleChange","index","val","updateSegmentWidth","useCallback","width","count","length","newSegmentWidth","setValue","useEffect","isRTL","timing","toValue","duration","easing","out","quad","useNativeDriver","start","styles","default","darkControl","disabled","onLayout","nativeEvent","layout","slider","transform","translateX","zIndex","backgroundColor","segmentsContainer","map","value","selected","accessibilityHint","onSelect","create","overflow","position","height","borderRadius","opacity","top","bottom","right","left","borderWidth","borderColor","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","flex","flexDirection","justifyContent","alignItems"],"mappings":";AAAA;;;;CAIC,GAED,YAAYA,WAAW,QAAQ;AAC/B,SAASC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,EAAEC,UAAU,EAAEC,IAAI,EAAEC,cAAc,QAAQ,eAAe;AAE/F,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,gBAAgB,QAAoC,WAAW;AAExE,OAAO,SAASC,iBAAiB,EAC/BC,KAAK,EACLC,QAAQ,EACRC,aAAa,EACbC,UAAU,IAAI,EACdC,aAAa,EACbC,MAAM,EACNC,SAAS,EACTC,UAAU,EACY;IACtB,MAAMC,kBAAkBb;IACxB,MAAMc,cAAcF,cAAcC;IAClC,MAAM,CAACE,cAAcC,gBAAgB,GAAGtB,MAAMuB,QAAQ,CAAC;IACvD,MAAMC,YAAYxB,MAAMyB,MAAM,CAAC,IAAIxB,SAASyB,KAAK,CAAC,IAAIC,OAAO;IAE7D,MAAMC,eAAe,CAACC;QACpB,MAAMC,MAAMd,QAAQ,CAACa,MAAM,IAAI;QAC/BhB,gBAAgBiB;QAChB,IAAIlB,UAAU;YACZA,SAASH,iBAAiBoB,OAAOC;QACnC;IACF;IAEA,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qC,OAAOY,iBAAiB;0BAClC5C,QAAQ6C,IAAI,CAACC,OAAOjC,sBACnB,KAACtB;wBACCO,SAASA;wBACTiD,UAAUhD,kBAAkBc;wBAC5BmC,mBAAmB,GAAGnC,QAAQ,EAAE,QAAQ,EAAEb,OAAOmB,MAAM,EAAE;wBAEzD2B,OAAOA;wBACP7C,WAAWA;wBACXC,YAAYE,gBAAgB,SAAS,SAAS;wBAC9C6C,UAAU,IAAMrC,aAAaC;uBAJxBA;;;;AAUjB;AAEA,MAAMmB,SAAS5C,WAAW8D,MAAM,CAAC;IAC/BjB,SAAS;QACPkB,UAAU;QACVC,UAAU;QACVC,QAAQ;QACRV,iBAAiB;QACjBW,cAAc;IAChB;IACApB,aAAa;QACXS,iBAAiB;IACnB;IACAR,UAAU;QACRoB,SAAS;IACX;IACAhB,QAAQ;QACNa,UAAU;QACVE,cAAc;QACdE,KAAK;QACLC,QAAQ;QACRC,OAAO;QACPC,MAAM;QACNC,aAAa;QACbC,aAAa;QACbC,aAAa;QACbC,cAAc;YACZ9C,OAAO;YACPoC,QAAQ;QACV;QACAW,eAAe;QACfC,cAAc;QACdC,WAAW;IACb;IACAtB,mBAAmB;QACjBuB,MAAM;QACNC,eAAe;QACfC,gBAAgB;QAChBC,YAAY;QACZJ,WAAW;QACXvB,iBAAiB;QACjBD,QAAQ;IACV;AACF"}
1
+ {"version":3,"sources":["community/segmented-control/vendor/SegmentedControl.tsx"],"sourcesContent":[null],"names":["React","Animated","Easing","I18nManager","Platform","StyleSheet","View","useColorScheme","SegmentedControlTab","SegmentsSeparators","buildChangeEvent","SegmentedControl","style","onChange","onValueChange","enabled","selectedIndex","values","tintColor","appearance","colorSchemeHook","colorScheme","segmentWidth","setSegmentWidth","useState","animation","useRef","Value","current","handleChange","index","val","updateSegmentWidth","useCallback","width","count","length","newSegmentWidth","setValue","useEffect","isRTL","timing","toValue","duration","easing","out","quad","useNativeDriver","OS","start","styles","default","darkControl","disabled","onLayout","nativeEvent","layout","slider","transform","translateX","zIndex","backgroundColor","segmentsContainer","map","value","selected","accessibilityHint","onSelect","create","overflow","position","height","borderRadius","opacity","top","bottom","right","left","borderWidth","borderColor","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","flex","flexDirection","justifyContent","alignItems"],"mappings":";AAAA;;;;CAIC,GAED,YAAYA,WAAW,QAAQ;AAC/B,SACEC,QAAQ,EACRC,MAAM,EACNC,WAAW,EACXC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,cAAc,QACT,eAAe;AAEtB,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,gBAAgB,QAAoC,WAAW;AAExE,OAAO,SAASC,iBAAiB,EAC/BC,KAAK,EACLC,QAAQ,EACRC,aAAa,EACbC,UAAU,IAAI,EACdC,aAAa,EACbC,MAAM,EACNC,SAAS,EACTC,UAAU,EACY;IACtB,MAAMC,kBAAkBb;IACxB,MAAMc,cAAcF,cAAcC;IAClC,MAAM,CAACE,cAAcC,gBAAgB,GAAGvB,MAAMwB,QAAQ,CAAC;IACvD,MAAMC,YAAYzB,MAAM0B,MAAM,CAAC,IAAIzB,SAAS0B,KAAK,CAAC,IAAIC,OAAO;IAE7D,MAAMC,eAAe,CAACC;QACpB,MAAMC,MAAMd,QAAQ,CAACa,MAAM,IAAI;QAC/BhB,gBAAgBiB;QAChB,IAAIlB,UAAU;YACZA,SAASH,iBAAiBoB,OAAOC;QACnC;IACF;IAEA,MAAMC,qBAAqBhC,MAAMiC,WAAW,CAC1C,CAACC;QACC,MAAMC,QAAQlB,QAAQmB,UAAU;QAChC,MAAMC,kBAAkBF,QAAQD,QAAQC,QAAQ;QAChD,IAAIE,oBAAoBf,cAAc;YACpCG,UAAUa,QAAQ,CAACD,kBAAmBrB,CAAAA,iBAAiB,CAAA;YACvDO,gBAAgBc;QAClB;IACF,GACA;QAACpB,QAAQmB;QAAQd;QAAcG;QAAWT;KAAc;IAG1DhB,MAAMuC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C,aAAaC;uBAJxBA;;;;AAUjB;AAEA,MAAMoB,SAAS7C,WAAW+D,MAAM,CAAC;IAC/BjB,SAAS;QACPkB,UAAU;QACVC,UAAU;QACVC,QAAQ;QACRV,iBAAiB;QACjBW,cAAc;IAChB;IACApB,aAAa;QACXS,iBAAiB;IACnB;IACAR,UAAU;QACRoB,SAAS;IACX;IACAhB,QAAQ;QACNa,UAAU;QACVE,cAAc;QACdE,KAAK;QACLC,QAAQ;QACRC,OAAO;QACPC,MAAM;QACNC,aAAa;QACbC,aAAa;QACbC,aAAa;QACbC,cAAc;YACZ/C,OAAO;YACPqC,QAAQ;QACV;QACAW,eAAe;QACfC,cAAc;QACdC,WAAW;IACb;IACAtB,mBAAmB;QACjBuB,MAAM;QACNC,eAAe;QACfC,gBAAgB;QAChBC,YAAY;QACZJ,WAAW;QACXvB,iBAAiB;QACjBD,QAAQ;IACV;AACF"}
@@ -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"}
@@ -47,9 +47,23 @@ struct DataListForEachItemView: ExpoSwiftUI.View {
47
47
  }
48
48
 
49
49
  var body: some View {
50
- Children()
50
+ content
51
51
  .publishZeroContentOrigin(props.shadowNodeProxy)
52
52
  }
53
+
54
+ // `List` reads row traits such as `moveDisabled` from the row's root view, and a nested
55
+ // `ForEach` breaks `onMove`. So a single child is the root itself.
56
+ @ViewBuilder
57
+ private var content: some View {
58
+ if let children = props.children, children.count == 1 {
59
+ let view: any View = children[0].childView
60
+ AnyView(view)
61
+ } else {
62
+ VStack(alignment: .leading, spacing: 0) {
63
+ Children()
64
+ }
65
+ }
66
+ }
53
67
  }
54
68
 
55
69
  final class DataListForEachPoolProps: ExpoSwiftUI.ViewProps {}
@@ -112,8 +126,9 @@ private struct DataListForEachRow: View {
112
126
  return slots[index % slots.count].childView as? DataListForEachItemView
113
127
  }
114
128
 
129
+ // A `Group`, not a stack, so the row's traits reach `List`.
115
130
  var body: some View {
116
- VStack(alignment: .leading, spacing: 0) {
131
+ Group {
117
132
  if let slot {
118
133
  DataListForEachSlotContent(
119
134
  props: slot.props,
@@ -178,12 +193,15 @@ private struct DataListForEachSlotContent: View {
178
193
  var body: some View {
179
194
  Group {
180
195
  if showsContent {
196
+ // Measured in the background: `onGeometryChange` on the item hides its row traits from `List`.
181
197
  DataListForEachItemView(props: props)
182
198
  .id(itemKey)
183
- .onGeometryChange(
184
- for: CGFloat.self,
185
- of: { axis == .horizontal ? $0.size.width : $0.size.height },
186
- action: { size in window.measure(size, for: itemKey, revision: revision) }
199
+ .background(
200
+ Color.clear.onGeometryChange(
201
+ for: CGFloat.self,
202
+ of: { axis == .horizontal ? $0.size.width : $0.size.height },
203
+ action: { size in window.measure(size, for: itemKey, revision: revision) }
204
+ )
187
205
  )
188
206
  } else {
189
207
  // Hide the previous item while JS updates this slot.
@@ -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.
@@ -0,0 +1 @@
1
+ 0a7945dfaec70218a5a6ed678049dd831dde7c23
@@ -0,0 +1 @@
1
+ 83f788f94510400d5695ee901721e3cef284309da751b00c9df7eeb8e4fdd5ca
@@ -0,0 +1 @@
1
+ 61d884b5f7528ac4d2791cebbdc45eefa1bfaf4eca17faf37b322a58a5670b042b1096a860bba051adb4a9d95334f227a9ea8f69473289d7a7725ea2600d7c48
@@ -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.21",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
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",
29
- "size": 1859361,
30
- "sha512": "ba561fa50c9fde30184d2c36051e644fd87db59555b7b38f8e2e5b7096b03bf0d2aec3e53fff1831d2705d85b174ec1a7fc2e9cadc69c41237aac262bbea9365",
31
- "sha256": "6cbb10f1e4cd5618c6997d87c2021e97c7bab1b8fc4ecc7be48f563e9c0e284a",
32
- "sha1": "93a6d734857d79049d179014133d651be167840a",
33
- "md5": "b51953e6905c7a42506ea0d23c859703"
27
+ "name": "expo.modules.ui-58.0.21.aar",
28
+ "url": "expo.modules.ui-58.0.21.aar",
29
+ "size": 1861060,
30
+ "sha512": "61d884b5f7528ac4d2791cebbdc45eefa1bfaf4eca17faf37b322a58a5670b042b1096a860bba051adb4a9d95334f227a9ea8f69473289d7a7725ea2600d7c48",
31
+ "sha256": "83f788f94510400d5695ee901721e3cef284309da751b00c9df7eeb8e4fdd5ca",
32
+ "sha1": "0a7945dfaec70218a5a6ed678049dd831dde7c23",
33
+ "md5": "485ed53072102e73937c25dae52b054c"
34
34
  }
35
35
  ]
36
36
  },
@@ -141,13 +141,13 @@
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",
146
- "size": 1859361,
147
- "sha512": "ba561fa50c9fde30184d2c36051e644fd87db59555b7b38f8e2e5b7096b03bf0d2aec3e53fff1831d2705d85b174ec1a7fc2e9cadc69c41237aac262bbea9365",
148
- "sha256": "6cbb10f1e4cd5618c6997d87c2021e97c7bab1b8fc4ecc7be48f563e9c0e284a",
149
- "sha1": "93a6d734857d79049d179014133d651be167840a",
150
- "md5": "b51953e6905c7a42506ea0d23c859703"
144
+ "name": "expo.modules.ui-58.0.21.aar",
145
+ "url": "expo.modules.ui-58.0.21.aar",
146
+ "size": 1861060,
147
+ "sha512": "61d884b5f7528ac4d2791cebbdc45eefa1bfaf4eca17faf37b322a58a5670b042b1096a860bba051adb4a9d95334f227a9ea8f69473289d7a7725ea2600d7c48",
148
+ "sha256": "83f788f94510400d5695ee901721e3cef284309da751b00c9df7eeb8e4fdd5ca",
149
+ "sha1": "0a7945dfaec70218a5a6ed678049dd831dde7c23",
150
+ "md5": "485ed53072102e73937c25dae52b054c"
151
151
  }
152
152
  ]
153
153
  },
@@ -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.21-sources.jar",
165
+ "url": "expo.modules.ui-58.0.21-sources.jar",
166
166
  "size": 113113,
167
167
  "sha512": "10ed672c04082cf5f06e6ca6dca0f28229f11f3d503d46e5b61dbc7d3ad50bfdc1399838dd38dc5b8c1643ec375c4bf1672c95606ce28f7ed36384f66b829b68",
168
168
  "sha256": "f9a24faad34f9f66bebcdde7d05a6cf72a8b4b9030819b80049de5084a694ef0",
@@ -0,0 +1 @@
1
+ aa7bf9c6ba26b5b17ed01fee30da4bebcccc3a30
@@ -0,0 +1 @@
1
+ 40b983bbed71d40341901a69d3ccb11f05df376770fdf645d690adcdc2ecb2ad
@@ -0,0 +1 @@
1
+ d99293cea982f3bb6bd43ced68122e957b7de2fe6462e340d3a712220a05102f2c399896100844629fbaf9e4676005d0f5975d27b35066d4b1714a40ba160e22
@@ -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.21</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
+ 326c7b1245711c1546f6cff3d3b43a8d0055a7d5
@@ -0,0 +1 @@
1
+ 6f11e59da1bd0114fa50e832c7adb7f64651956a13e2989218f3f24b5e210b63
@@ -0,0 +1 @@
1
+ d469c3b770e3c8135b80e503922da3361b5eb101d722a3cb92fa2602585c37938a0bc8096a6e1735e4d7d8612dcc46b7eb486816780a49a62531c58f48c7d3be
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/ui",
3
- "version": "58.0.19",
3
+ "version": "58.0.21",
4
4
  "description": "A collection of UI components",
5
5
  "keywords": [
6
6
  "Jetpack Compose",
@@ -5,7 +5,15 @@
5
5
  */
6
6
 
7
7
  import * as React from 'react';
8
- import { Animated, Easing, I18nManager, StyleSheet, View, useColorScheme } from 'react-native';
8
+ import {
9
+ Animated,
10
+ Easing,
11
+ I18nManager,
12
+ Platform,
13
+ StyleSheet,
14
+ View,
15
+ useColorScheme,
16
+ } from 'react-native';
9
17
 
10
18
  import { SegmentedControlTab } from './SegmentedControlTab';
11
19
  import { SegmentsSeparators } from './SegmentsSeparators';
@@ -53,7 +61,7 @@ export function SegmentedControl({
53
61
  toValue: isRTL * (selectedIndex ?? 0),
54
62
  duration: 300,
55
63
  easing: Easing.out(Easing.quad),
56
- useNativeDriver: true,
64
+ useNativeDriver: Platform.OS !== 'web',
57
65
  }).start();
58
66
  }
59
67
  }, [animation, segmentWidth, selectedIndex]);
@@ -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
- 93a6d734857d79049d179014133d651be167840a
@@ -1 +0,0 @@
1
- 6cbb10f1e4cd5618c6997d87c2021e97c7bab1b8fc4ecc7be48f563e9c0e284a
@@ -1 +0,0 @@
1
- ba561fa50c9fde30184d2c36051e644fd87db59555b7b38f8e2e5b7096b03bf0d2aec3e53fff1831d2705d85b174ec1a7fc2e9cadc69c41237aac262bbea9365
@@ -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