@expo/ui 57.0.13 → 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 (160) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +17 -3
  4. package/android/src/main/java/expo/modules/ui/ProgressView.kt +31 -0
  5. package/android/src/main/java/expo/modules/ui/RNHostView.kt +161 -11
  6. package/build/PresentedContentContext.d.ts +18 -0
  7. package/build/PresentedContentContext.d.ts.map +1 -0
  8. package/build/community/pager-view/PagerView.android.d.ts.map +1 -1
  9. package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
  10. package/build/jetpack-compose/BasicAlertDialog/index.d.ts.map +1 -1
  11. package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -1
  12. package/build/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.d.ts.map +1 -1
  13. package/build/jetpack-compose/Host/index.d.ts +3 -0
  14. package/build/jetpack-compose/Host/index.d.ts.map +1 -1
  15. package/build/jetpack-compose/ModalBottomSheet/index.d.ts.map +1 -1
  16. package/build/jetpack-compose/Progress/index.d.ts +25 -2
  17. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  18. package/build/jetpack-compose/RNHostView/index.d.ts +6 -6
  19. package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -1
  20. package/build/jetpack-compose/TextField/shared.d.ts +2 -1
  21. package/build/jetpack-compose/TextField/shared.d.ts.map +1 -1
  22. package/build/jetpack-compose/Tooltip/index.d.ts.map +1 -1
  23. package/build/keyboard/index.d.ts +43 -0
  24. package/build/keyboard/index.d.ts.map +1 -0
  25. package/build/keyboard/interop.d.ts +16 -0
  26. package/build/keyboard/interop.d.ts.map +1 -0
  27. package/build/keyboard/textInputState.d.ts +2 -0
  28. package/build/keyboard/textInputState.d.ts.map +1 -0
  29. package/build/keyboard/textInputState.web.d.ts +11 -0
  30. package/build/keyboard/textInputState.web.d.ts.map +1 -0
  31. package/build/swift-ui/Background/index.d.ts +18 -0
  32. package/build/swift-ui/Background/index.d.ts.map +1 -0
  33. package/build/swift-ui/BottomSheet/index.d.ts.map +1 -1
  34. package/build/swift-ui/Host/index.d.ts +3 -0
  35. package/build/swift-ui/Host/index.d.ts.map +1 -1
  36. package/build/swift-ui/Popover/index.d.ts.map +1 -1
  37. package/build/swift-ui/RNHostView.d.ts +4 -1
  38. package/build/swift-ui/RNHostView.d.ts.map +1 -1
  39. package/build/swift-ui/SecureField/index.d.ts.map +1 -1
  40. package/build/swift-ui/TextField/index.d.ts.map +1 -1
  41. package/build/swift-ui/index.d.ts +1 -0
  42. package/build/swift-ui/index.d.ts.map +1 -1
  43. package/build/swift-ui/modifiers/index.d.ts +9 -34
  44. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  45. package/build/swift-ui/modifiers/presentationModifiers.d.ts +3 -2
  46. package/build/swift-ui/modifiers/presentationModifiers.d.ts.map +1 -1
  47. package/build/swift-ui/modifiers/shapeStyle.d.ts +54 -0
  48. package/build/swift-ui/modifiers/shapeStyle.d.ts.map +1 -0
  49. package/build/universal/BottomSheet/index.android.d.ts +1 -1
  50. package/build/universal/BottomSheet/index.android.d.ts.map +1 -1
  51. package/build/universal/BottomSheet/index.d.ts +1 -1
  52. package/build/universal/BottomSheet/index.d.ts.map +1 -1
  53. package/build/universal/BottomSheet/index.ios.d.ts +1 -1
  54. package/build/universal/BottomSheet/index.ios.d.ts.map +1 -1
  55. package/build/universal/BottomSheet/types.d.ts +20 -0
  56. package/build/universal/BottomSheet/types.d.ts.map +1 -1
  57. package/build/universal/ListItem/ListItem.android.d.ts.map +1 -1
  58. package/build/universal/ListItem/types.d.ts +19 -0
  59. package/build/universal/ListItem/types.d.ts.map +1 -1
  60. package/build/universal/RNHostView/index.android.d.ts +1 -1
  61. package/build/universal/RNHostView/index.android.d.ts.map +1 -1
  62. package/build/universal/RNHostView/index.d.ts +1 -1
  63. package/build/universal/RNHostView/index.d.ts.map +1 -1
  64. package/build/universal/RNHostView/index.ios.d.ts +1 -1
  65. package/build/universal/RNHostView/index.ios.d.ts.map +1 -1
  66. package/build/universal/RNHostView/types.d.ts +2 -0
  67. package/build/universal/RNHostView/types.d.ts.map +1 -1
  68. package/build/utils/useMergeRefs.d.ts +12 -0
  69. package/build/utils/useMergeRefs.d.ts.map +1 -0
  70. package/expo-module.config.json +1 -1
  71. package/ios/BackgroundView.swift +34 -0
  72. package/ios/ColorPickerView.swift +1 -1
  73. package/ios/Convertibles/ShapeStyleValue.swift +129 -0
  74. package/ios/ExpoUIModule.swift +4 -0
  75. package/ios/HostView.swift +7 -0
  76. package/ios/Modifiers/ForegroundStyleModifier.swift +12 -105
  77. package/ios/Modifiers/ViewModifierRegistry.swift +29 -5
  78. package/ios/RNHostView.swift +64 -4
  79. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.13/expo.modules.ui-57.0.13-sources.jar → 57.0.15/expo.modules.ui-57.0.15-sources.jar} +0 -0
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.md5 +1 -0
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha1 +1 -0
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha256 +1 -0
  83. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha512 +1 -0
  84. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar +0 -0
  85. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.md5 +1 -0
  86. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha1 +1 -0
  87. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha256 +1 -0
  88. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha512 +1 -0
  89. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.13/expo.modules.ui-57.0.13.module → 57.0.15/expo.modules.ui-57.0.15.module} +22 -22
  90. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.md5 +1 -0
  91. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha1 +1 -0
  92. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha256 +1 -0
  93. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha512 +1 -0
  94. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.13/expo.modules.ui-57.0.13.pom → 57.0.15/expo.modules.ui-57.0.15.pom} +1 -1
  95. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.md5 +1 -0
  96. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha1 +1 -0
  97. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha256 +1 -0
  98. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha512 +1 -0
  99. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  100. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  101. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  102. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  103. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  104. package/package.json +4 -4
  105. package/src/PresentedContentContext.tsx +22 -0
  106. package/src/community/pager-view/PagerView.android.tsx +1 -7
  107. package/src/jetpack-compose/AlertDialog/index.tsx +6 -1
  108. package/src/jetpack-compose/BasicAlertDialog/index.tsx +7 -1
  109. package/src/jetpack-compose/DropdownMenu/index.tsx +7 -1
  110. package/src/jetpack-compose/ExposedDropdownMenuBox/ExposedDropdownMenu.tsx +3 -1
  111. package/src/jetpack-compose/Host/index.tsx +28 -17
  112. package/src/jetpack-compose/ModalBottomSheet/index.tsx +8 -1
  113. package/src/jetpack-compose/Progress/index.tsx +32 -2
  114. package/src/jetpack-compose/RNHostView/index.tsx +28 -13
  115. package/src/jetpack-compose/TextField/shared.ts +7 -1
  116. package/src/jetpack-compose/Tooltip/index.tsx +2 -1
  117. package/src/keyboard/index.tsx +243 -0
  118. package/src/keyboard/interop.ts +99 -0
  119. package/src/keyboard/textInputState.ts +2 -0
  120. package/src/keyboard/textInputState.web.ts +16 -0
  121. package/src/swift-ui/Background/index.tsx +38 -0
  122. package/src/swift-ui/BottomSheet/index.tsx +4 -1
  123. package/src/swift-ui/Host/index.tsx +33 -18
  124. package/src/swift-ui/Popover/index.tsx +7 -1
  125. package/src/swift-ui/RNHostView.tsx +20 -3
  126. package/src/swift-ui/SecureField/index.tsx +8 -2
  127. package/src/swift-ui/TextField/index.tsx +8 -1
  128. package/src/swift-ui/index.tsx +1 -0
  129. package/src/swift-ui/modifiers/index.ts +10 -39
  130. package/src/swift-ui/modifiers/presentationModifiers.ts +3 -2
  131. package/src/swift-ui/modifiers/shapeStyle.ts +55 -0
  132. package/src/ts-declarations/react-native-text-input-state.d.ts +26 -0
  133. package/src/universal/BottomSheet/index.android.tsx +4 -0
  134. package/src/universal/BottomSheet/index.ios.tsx +5 -0
  135. package/src/universal/BottomSheet/index.tsx +4 -0
  136. package/src/universal/BottomSheet/types.ts +22 -0
  137. package/src/universal/ListItem/ListItem.android.tsx +2 -1
  138. package/src/universal/ListItem/types.ts +21 -0
  139. package/src/universal/RNHostView/index.android.tsx +2 -1
  140. package/src/universal/RNHostView/index.ios.tsx +6 -2
  141. package/src/universal/RNHostView/index.tsx +2 -0
  142. package/src/universal/RNHostView/types.ts +3 -0
  143. package/src/utils/useMergeRefs.ts +47 -0
  144. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13-sources.jar.md5 +0 -1
  145. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13-sources.jar.sha1 +0 -1
  146. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13-sources.jar.sha256 +0 -1
  147. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13-sources.jar.sha512 +0 -1
  148. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.aar +0 -0
  149. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.aar.md5 +0 -1
  150. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.aar.sha1 +0 -1
  151. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.aar.sha256 +0 -1
  152. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.aar.sha512 +0 -1
  153. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.module.md5 +0 -1
  154. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.module.sha1 +0 -1
  155. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.module.sha256 +0 -1
  156. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.module.sha512 +0 -1
  157. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.pom.md5 +0 -1
  158. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.pom.sha1 +0 -1
  159. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.pom.sha256 +0 -1
  160. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.13/expo.modules.ui-57.0.13.pom.sha512 +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAuB3D;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,cAAc,GACf,EAAE,gBAAgB,2CAgDlB;AAuCD,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAuB3D;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,cAAc,EACd,cAAc,GACf,EAAE,gBAAgB,2CAmDlB;AAuCD,cAAc,SAAS,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { BottomSheetProps } from './types';
2
- export declare function BottomSheet({ children, isPresented, onDismiss, showDragIndicator, snapPoints, testID, modifiers, contentPadding, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function BottomSheet({ children, isPresented, onDismiss, showDragIndicator, snapPoints, testID, modifiers, contentPadding, containerColor, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
3
3
  export * from './types';
4
4
  //# sourceMappingURL=index.ios.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.ios.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAS3D,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,cAAc,GACf,EAAE,gBAAgB,2CAgClB;AAED,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.ios.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAS3D,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,cAAc,EACd,cAAc,GACf,EAAE,gBAAgB,2CAmClB;AAED,cAAc,SAAS,CAAC"}
@@ -98,5 +98,25 @@ export interface BottomSheetProps {
98
98
  * from `@expo/ui/swift-ui/modifiers` or `@expo/ui/jetpack-compose/modifiers`.
99
99
  */
100
100
  modifiers?: ModifierConfig[];
101
+ /**
102
+ * The sheet's own background color, painting its full chrome (including the
103
+ * drag-indicator zone and, on iOS, the home-indicator safe-area inset).
104
+ * When omitted, each platform keeps its own default.
105
+ *
106
+ * This only paints the background. `children` are React Native views on
107
+ * every platform, so they don't pick up a contrasting text color
108
+ * automatically -- set one explicitly if you use a dark `containerColor`.
109
+ * @platform android
110
+ * @platform ios 16.4+
111
+ * @platform web
112
+ */
113
+ containerColor?: ColorValue;
114
+ /**
115
+ * The preferred color for native Compose content that doesn't set its own
116
+ * color. Doesn't reach a `BottomSheet`'s (React Native) `children` -- see
117
+ * `containerColor`'s doc.
118
+ * @platform android
119
+ */
120
+ contentColor?: ColorValue;
101
121
  }
102
122
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GACjC,MAAM,GACN;IACE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IAEzB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GACjC,MAAM,GACN;IACE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IAEzB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAE7B;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAE5B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.android.d.ts","sourceRoot":"","sources":["../../../src/universal/ListItem/ListItem.android.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAW7C;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAqC5C;AAED,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"ListItem.android.d.ts","sourceRoot":"","sources":["../../../src/universal/ListItem/ListItem.android.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAW7C;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAsC5C;AAED,cAAc,SAAS,CAAC"}
@@ -1,5 +1,19 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { ColorValue } from 'react-native';
2
3
  import type { ModifierConfig } from '../../types';
4
+ /**
5
+ * Colors for a `ListItem`'s row elements, matching Jetpack Compose's
6
+ * `ListItemDefaults.colors()` on Android.
7
+ * @platform android
8
+ */
9
+ export interface ListItemColors {
10
+ containerColor?: ColorValue;
11
+ contentColor?: ColorValue;
12
+ leadingContentColor?: ColorValue;
13
+ trailingContentColor?: ColorValue;
14
+ supportingContentColor?: ColorValue;
15
+ overlineContentColor?: ColorValue;
16
+ }
3
17
  /**
4
18
  * Props for the [`ListItem.Leading`](#listitemleading) slot marker.
5
19
  */
@@ -63,5 +77,10 @@ export interface ListItemProps {
63
77
  * its default `buttonStyle(.plain)`.
64
78
  */
65
79
  modifiers?: ModifierConfig[];
80
+ /**
81
+ * Row colors. Applied on Android via Compose's `ListItem.colors`.
82
+ * @platform android
83
+ */
84
+ colors?: ListItemColors;
66
85
  }
67
86
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/ListItem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEpC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/ListItem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,sBAAsB,CAAC,EAAE,UAAU,CAAC;IACpC,oBAAoB,CAAC,EAAE,UAAU,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEpC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAE7B;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB"}
@@ -2,6 +2,6 @@ import type { RNHostViewProps } from './types';
2
2
  /**
3
3
  * Hosts React Native views inside Jetpack Compose views.
4
4
  */
5
- export declare function RNHostView({ children, matchContents, style, onAppear, onDisappear, disabled, hidden, testID, modifiers: extraModifiers, }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function RNHostView({ children, matchContents, style, onAppear, onDisappear, disabled, hidden, testID, onLayout, modifiers: extraModifiers, }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
6
6
  export * from './types';
7
7
  //# sourceMappingURL=index.android.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.android.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.android.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,aAAa,EACb,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,EAAE,cAAc,GAC1B,EAAE,eAAe,2CAYjB;AAED,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.android.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.android.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,aAAa,EACb,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EAAE,cAAc,GAC1B,EAAE,eAAe,2CAYjB;AAED,cAAc,SAAS,CAAC"}
@@ -2,6 +2,6 @@ import type { RNHostViewProps } from './types';
2
2
  /**
3
3
  * Hosts React Native views inside Jetpack Compose or SwiftUI views.
4
4
  */
5
- export declare function RNHostView({ children, style, onAppear, onDisappear, hidden, testID, matchContents, }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function RNHostView({ children, style, onAppear, onDisappear, hidden, testID, matchContents, onLayout, }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
6
6
  export * from './types';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAc,EACd,MAAM,EACN,aAAqB,GACtB,EAAE,eAAe,2CAcjB;AAED,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAc,EACd,MAAM,EACN,aAAqB,EACrB,QAAQ,GACT,EAAE,eAAe,2CAejB;AAED,cAAc,SAAS,CAAC"}
@@ -2,6 +2,6 @@ import type { RNHostViewProps } from './types';
2
2
  /**
3
3
  * Hosts React Native views inside SwiftUI views.
4
4
  */
5
- export declare function RNHostView({ children, matchContents }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function RNHostView({ children, matchContents, onLayout }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
6
6
  export * from './types';
7
7
  //# sourceMappingURL=index.ios.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,eAAe,2CAEtE;AAED,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAMhF;AAED,cAAc,SAAS,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
+ import type { LayoutChangeEvent } from 'react-native';
2
3
  import type { UniversalBaseProps } from '../types';
3
4
  /**
4
5
  * Props for the [`RNHostView`](#rnhostview) component.
@@ -15,6 +16,7 @@ export interface RNHostViewProps extends UniversalBaseProps {
15
16
  * @platform ios
16
17
  */
17
18
  matchContents?: boolean;
19
+ onLayout?: (event: LayoutChangeEvent) => void;
18
20
  /**
19
21
  * The React Native view to host.
20
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAE9C;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB"}
@@ -0,0 +1,12 @@
1
+ import { type Ref } from 'react';
2
+ /**
3
+ * Builds a ref that forwards its value to each of the given refs, in the order
4
+ * they are given. Handles object refs and callback refs, including a callback
5
+ * ref that returns its own cleanup function.
6
+ *
7
+ * A copy of React Native's `useMergeRefs`, which lives behind a deep internal
8
+ * import: those are deprecated, warn in development, and have no counterpart in
9
+ * React Native for web.
10
+ */
11
+ export declare function useMergeRefs<T>(...refs: (Ref<T> | undefined)[]): (instance: T | null) => void;
12
+ //# sourceMappingURL=useMergeRefs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMergeRefs.d.ts","sourceRoot":"","sources":["../../src/utils/useMergeRefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAmC7F"}
@@ -10,7 +10,7 @@
10
10
  "publication": {
11
11
  "groupId": "expo.modules.ui",
12
12
  "artifactId": "expo.modules.ui",
13
- "version": "57.0.13",
13
+ "version": "57.0.15",
14
14
  "repository": "local-maven-repo"
15
15
  }
16
16
  }
@@ -0,0 +1,34 @@
1
+ // Copyright 2025-present 650 Industries. All rights reserved.
2
+
3
+ import ExpoModulesCore
4
+ import SwiftUI
5
+
6
+ internal class BackgroundViewProps: UIBaseViewProps {
7
+ @Field var alignment: AlignmentOptions?
8
+ }
9
+
10
+ internal struct BackgroundView: ExpoSwiftUI.View {
11
+ @ObservedObject var props: BackgroundViewProps
12
+
13
+ var body: some View {
14
+ baseContent
15
+ .background(alignment: props.alignment?.toAlignment() ?? .center) {
16
+ backgroundContent
17
+ }
18
+ }
19
+
20
+ @ViewBuilder
21
+ private var baseContent: some View {
22
+ ForEach(props.children?.withoutSlots() ?? [], id: \.id) { child in
23
+ let view: any View = child.childView
24
+ AnyView(view)
25
+ }
26
+ }
27
+
28
+ @ViewBuilder
29
+ private var backgroundContent: some View {
30
+ if let content = props.children?.slot("content") {
31
+ content
32
+ }
33
+ }
34
+ }
@@ -49,7 +49,7 @@ struct ColorPickerView: ExpoSwiftUI.View {
49
49
  components.count > 1 ? components[1] : components[0],
50
50
  components.count > 2 ? components[2] : components[0],
51
51
  newColor.cgColor.alpha
52
- ].map { Int(max(0, min(255, $0 * 255))) }
52
+ ].map { Int(max(0, min(255, ($0 * 255).rounded()))) }
53
53
 
54
54
  let format = supportsOpacity ? "#%02X%02X%02X%02X" : "#%02X%02X%02X"
55
55
  return String(format: format, rgba[0], rgba[1], rgba[2], supportsOpacity ? rgba[3] : 255)
@@ -0,0 +1,129 @@
1
+ // Copyright 2015-present 650 Industries. All rights reserved.
2
+
3
+ import ExpoModulesCore
4
+ import SwiftUI
5
+
6
+ internal enum ShapeStyleType: String, Enumerable {
7
+ case color
8
+ case hierarchical
9
+ case material
10
+ case linearGradient
11
+ case radialGradient
12
+ case angularGradient
13
+ }
14
+
15
+ internal enum HierarchicalShapeStyleOptions: String, Enumerable {
16
+ case primary
17
+ case secondary
18
+ case tertiary
19
+ case quaternary
20
+ case quinary
21
+
22
+ /**
23
+ Returns `nil` when the style is not available on the running platform.
24
+ */
25
+ func toShapeStyle() -> AnyShapeStyle? {
26
+ switch self {
27
+ case .primary:
28
+ return AnyShapeStyle(HierarchicalShapeStyle.primary)
29
+ case .secondary:
30
+ return AnyShapeStyle(HierarchicalShapeStyle.secondary)
31
+ case .tertiary:
32
+ return AnyShapeStyle(HierarchicalShapeStyle.tertiary)
33
+ case .quaternary:
34
+ return AnyShapeStyle(HierarchicalShapeStyle.quaternary)
35
+ case .quinary:
36
+ if #available(iOS 16.0, tvOS 17.0, *) {
37
+ return AnyShapeStyle(HierarchicalShapeStyle.quinary)
38
+ }
39
+ return nil
40
+ }
41
+ }
42
+ }
43
+
44
+ internal enum MaterialOptions: String, Enumerable {
45
+ case ultraThin
46
+ case thin
47
+ case regular
48
+ case thick
49
+ case ultraThick
50
+ case bar
51
+
52
+ /**
53
+ Returns `nil` when the material is not available on the running platform.
54
+ */
55
+ func toShapeStyle() -> AnyShapeStyle? {
56
+ switch self {
57
+ case .ultraThin:
58
+ return AnyShapeStyle(Material.ultraThin)
59
+ case .thin:
60
+ return AnyShapeStyle(Material.thin)
61
+ case .regular:
62
+ return AnyShapeStyle(Material.regular)
63
+ case .thick:
64
+ return AnyShapeStyle(Material.thick)
65
+ case .ultraThick:
66
+ return AnyShapeStyle(Material.ultraThick)
67
+ case .bar:
68
+ // The bar material has no tvOS counterpart.
69
+ #if os(tvOS)
70
+ return nil
71
+ #else
72
+ return AnyShapeStyle(Material.bar)
73
+ #endif
74
+ }
75
+ }
76
+ }
77
+
78
+ /**
79
+ A style that fills or paints an area, mirroring SwiftUI's `ShapeStyle`. Every style is erased to
80
+ `AnyShapeStyle` because the concrete type is only known at runtime — an opaque `some ShapeStyle`
81
+ would have to be a single type across all the branches below.
82
+ */
83
+ internal struct ShapeStyleValue: Record {
84
+ @Field var type: ShapeStyleType = .color
85
+ @Field var color: Color?
86
+ @Field var hierarchical: HierarchicalShapeStyleOptions?
87
+ @Field var material: MaterialOptions?
88
+ @Field var colors: [Color]?
89
+ @Field var startPoint: UnitPoint?
90
+ @Field var endPoint: UnitPoint?
91
+ @Field var center: UnitPoint?
92
+ @Field var startRadius: CGFloat?
93
+ @Field var endRadius: CGFloat?
94
+
95
+ /**
96
+ Resolves the style, or returns `nil` when the fields it needs are missing or the style is not
97
+ available on the running platform. Callers leave the view untouched in that case.
98
+ */
99
+ func toAnyShapeStyle() -> AnyShapeStyle? {
100
+ switch type {
101
+ case .color:
102
+ guard let color else {
103
+ return nil
104
+ }
105
+ return AnyShapeStyle(color)
106
+ case .hierarchical:
107
+ return (hierarchical ?? .primary).toShapeStyle()
108
+ case .material:
109
+ return material?.toShapeStyle()
110
+ case .linearGradient:
111
+ guard let colors, let startPoint, let endPoint else {
112
+ return nil
113
+ }
114
+ return AnyShapeStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
115
+ case .radialGradient:
116
+ guard let colors, let center, let startRadius, let endRadius else {
117
+ return nil
118
+ }
119
+ return AnyShapeStyle(
120
+ RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius)
121
+ )
122
+ case .angularGradient:
123
+ guard let colors, let center else {
124
+ return nil
125
+ }
126
+ return AnyShapeStyle(AngularGradient(colors: colors, center: center))
127
+ }
128
+ }
129
+ }
@@ -10,6 +10,9 @@ public final class ExpoUIModule: Module {
10
10
  View(RNHostView.self)
11
11
 
12
12
  OnDestroy {
13
+ // Clear all registered content origins when the module is destroyed
14
+ ContentOriginRegistry.clearAll()
15
+
13
16
  Task { @MainActor in
14
17
  NamespaceRegistry.shared.removeAll()
15
18
  }
@@ -190,6 +193,7 @@ public final class ExpoUIModule: Module {
190
193
  ExpoUIView(DividerView.self)
191
194
  ExpoUIView(PopoverView.self)
192
195
  ExpoUIView(OverlayView.self)
196
+ ExpoUIView(BackgroundView.self)
193
197
  ExpoUIView(MaskView.self)
194
198
  ExpoUIView(GridView.self)
195
199
  ExpoUIView(AccessoryWidgetBackgroundView.self)
@@ -3,6 +3,11 @@
3
3
  import SwiftUI
4
4
  import ExpoModulesCore
5
5
 
6
+ /// Coordinate space anchored at the `Host`, so hosted React Native views can report where SwiftUI
7
+ /// actually placed them. Name it last in the chain: Yoga measures a hosted view from the `Host`
8
+ /// component view, so any `Host` inset or alignment has to be inside this space, not outside it.
9
+ internal let expoHostCoordinateSpace = "expo.ui.host"
10
+
6
11
  internal enum ExpoColorScheme: String, Enumerable {
7
12
  case light
8
13
  case dark
@@ -68,6 +73,7 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
68
73
  globalEventDispatcher: props.globalEventDispatcher
69
74
  )
70
75
  .modifier(GeometryChangeModifier(props: props))
76
+ .coordinateSpace(name: expoHostCoordinateSpace)
71
77
  } else {
72
78
  ZStack(alignment: alignment) {
73
79
  Children()
@@ -82,6 +88,7 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
82
88
  globalEventDispatcher: props.globalEventDispatcher
83
89
  )
84
90
  .modifier(GeometryChangeModifier(props: props))
91
+ .coordinateSpace(name: expoHostCoordinateSpace)
85
92
  }
86
93
  }
87
94
 
@@ -3,122 +3,29 @@
3
3
  import ExpoModulesCore
4
4
  import SwiftUI
5
5
 
6
- internal enum ForegroundStyleType: String, Enumerable {
7
- case color
8
- case hierarchical
9
- case linearGradient
10
- case radialGradient
11
- case angularGradient
12
- }
13
-
14
- internal enum ForegroundHierarchicalStyleType: String, Enumerable {
15
- case primary
16
- case secondary
17
- case tertiary
18
- case quaternary
19
- case quinary
20
- }
21
-
22
6
  internal struct ForegroundStyleModifier: ViewModifier, Record {
23
- @Field var styleType: ForegroundStyleType = .color
24
- @Field var hierarchicalStyle: ForegroundHierarchicalStyleType = .primary
25
- @Field var color: Color?
26
- @Field var colors: [Color]?
27
- @Field var startPoint: UnitPoint?
28
- @Field var endPoint: UnitPoint?
29
- @Field var center: UnitPoint?
30
- @Field var startRadius: CGFloat?
31
- @Field var endRadius: CGFloat?
7
+ @Field var style: ShapeStyleValue?
32
8
 
33
9
  func body(content: Content) -> some View {
34
- applyForegroundStyle(self, to: content)
35
- }
36
- }
37
-
38
- @ViewBuilder
39
- internal func applyForegroundStyle<V: View>(_ modifier: ForegroundStyleModifier, to content: V) -> some View {
40
- switch modifier.styleType {
41
- case .color:
42
- if let color = modifier.color {
43
- content.foregroundStyle(color)
44
- } else {
45
- content
46
- }
47
- case .hierarchical:
48
- switch modifier.hierarchicalStyle {
49
- case .primary:
50
- content.foregroundStyle(.primary)
51
- case .secondary:
52
- content.foregroundStyle(.secondary)
53
- case .tertiary:
54
- content.foregroundStyle(.tertiary)
55
- case .quaternary:
56
- content.foregroundStyle(.quaternary)
57
- case .quinary:
58
- if #available(iOS 16.0, tvOS 17.0, *) {
59
- content.foregroundStyle(.quinary)
60
- } else {
61
- content
62
- }
63
- }
64
- case .linearGradient:
65
- if let colors = modifier.colors, let startPoint = modifier.startPoint, let endPoint = modifier.endPoint {
66
- content.foregroundStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
67
- } else {
68
- content
69
- }
70
- case .radialGradient:
71
- if let colors = modifier.colors, let center = modifier.center,
72
- let startRadius = modifier.startRadius, let endRadius = modifier.endRadius {
73
- content.foregroundStyle(RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius))
74
- } else {
75
- content
76
- }
77
- case .angularGradient:
78
- if let colors = modifier.colors, let center = modifier.center {
79
- content.foregroundStyle(AngularGradient(colors: colors, center: center))
10
+ if let shapeStyle = style?.toAnyShapeStyle() {
11
+ content.foregroundStyle(shapeStyle)
80
12
  } else {
81
13
  content
82
14
  }
83
15
  }
84
16
  }
85
17
 
18
+ /**
19
+ `Text` keeps its own type through `foregroundStyle(_:)`, which lets the caller apply further
20
+ text-only modifiers, so the text overload is applied separately from the view one.
21
+
22
+ TODO: `Text.foregroundStyle(_:)` requires iOS 17. Once the package drops iOS 16, inline this
23
+ into the `foregroundStyle` case of `applyTextModifier` and delete the color-only fallback there.
24
+ */
86
25
  @available(iOS 17.0, tvOS 17.0, *)
87
26
  internal func applyForegroundStyle(_ modifier: ForegroundStyleModifier, to text: Text) -> Text {
88
- switch modifier.styleType {
89
- case .color:
90
- if let color = modifier.color {
91
- return text.foregroundStyle(color)
92
- }
93
- return text
94
- case .hierarchical:
95
- switch modifier.hierarchicalStyle {
96
- case .primary:
97
- return text.foregroundStyle(.primary)
98
- case .secondary:
99
- return text.foregroundStyle(.secondary)
100
- case .tertiary:
101
- return text.foregroundStyle(.tertiary)
102
- case .quaternary:
103
- return text.foregroundStyle(.quaternary)
104
- case .quinary:
105
- return text.foregroundStyle(.quinary)
106
- }
107
- case .linearGradient:
108
- if let colors = modifier.colors, let startPoint = modifier.startPoint, let endPoint = modifier.endPoint {
109
- return text.foregroundStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
110
- }
111
- return text
112
- case .radialGradient:
113
- if let colors = modifier.colors, let center = modifier.center,
114
- let startRadius = modifier.startRadius, let endRadius = modifier.endRadius {
115
- return text.foregroundStyle(RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius))
116
- }
117
- return text
118
- case .angularGradient:
119
- if let colors = modifier.colors, let center = modifier.center {
120
- return text.foregroundStyle(AngularGradient(colors: colors, center: center))
121
- }
27
+ guard let shapeStyle = modifier.style?.toAnyShapeStyle() else {
122
28
  return text
123
29
  }
30
+ return text.foregroundStyle(shapeStyle)
124
31
  }
@@ -910,6 +910,26 @@ internal struct AnyViewModifier: ViewModifier {
910
910
  }
911
911
  }
912
912
 
913
+ /**
914
+ * Prunability-stable wrapper for `AnyViewModifier`
915
+ */
916
+ internal struct StableViewModifier: ViewModifier {
917
+ let params: [String: Any]
918
+ weak var appContext: AppContext?
919
+ let dispatcher: EventDispatcher
920
+
921
+ func body(content: Content) -> some View {
922
+ if let type = params["$type"] as? String,
923
+ let appContext,
924
+ let factory = ViewModifierRegistry.shared.modifierFactories[type],
925
+ let modifier = try? factory(params, appContext, dispatcher) {
926
+ content.modifier(AnyViewModifier(modifier))
927
+ } else {
928
+ content
929
+ }
930
+ }
931
+ }
932
+
913
933
  internal struct AnimationModifier: ViewModifier, Record {
914
934
  @Field var animation: AnimationConfig
915
935
  @Field var animatedValue: Either<Double, Bool>?
@@ -1562,10 +1582,14 @@ public class ViewModifierRegistry {
1562
1582
  globalEventDispatcher: EventDispatcher,
1563
1583
  params: [String: Any]
1564
1584
  ) -> AnyView {
1565
- guard let viewModifier = try? modifierFactories[type]?(params, appContext, globalEventDispatcher) else {
1585
+ guard modifierFactories[type] != nil else {
1566
1586
  return view
1567
1587
  }
1568
- return AnyView(view.modifier(AnyViewModifier(viewModifier)))
1588
+ return AnyView(view.modifier(StableViewModifier(
1589
+ params: params,
1590
+ appContext: appContext,
1591
+ dispatcher: globalEventDispatcher
1592
+ )))
1569
1593
  }
1570
1594
 
1571
1595
  /**
@@ -1595,9 +1619,9 @@ public class ViewModifierRegistry {
1595
1619
  guard let modifier = try? ForegroundStyleModifier(from: params, appContext: appContext) else { return text }
1596
1620
  if #available(iOS 17.0, tvOS 17.0, *) {
1597
1621
  return applyForegroundStyle(modifier, to: text)
1598
- } else if modifier.styleType == .color, let color = modifier.color {
1599
- return text.foregroundColor(color)
1600
- }
1622
+ } else if modifier.style?.type == .color, let color = modifier.style?.color {
1623
+ return text.foregroundColor(color)
1624
+ }
1601
1625
  return text
1602
1626
  default:
1603
1627
  #if DEBUG