@expo/ui 58.0.22 → 58.0.24

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 (234) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/ComposeViews.kt +53 -29
  4. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +6 -4
  5. package/android/src/main/java/expo/modules/ui/HostView.kt +85 -15
  6. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +40 -12
  7. package/android/src/main/java/expo/modules/ui/RNHostView.kt +138 -2
  8. package/android/src/main/java/expo/modules/ui/SliderView.kt +5 -4
  9. package/android/src/main/java/expo/modules/ui/UniversalLayout.kt +610 -0
  10. package/android/src/main/java/expo/modules/ui/VerticalSliderView.kt +5 -4
  11. package/android/src/main/java/expo/modules/ui/state/ObservableState.kt +2 -0
  12. package/android/src/main/java/expo/modules/ui/state/WorkletCallback.kt +2 -0
  13. package/build/community/bottom-sheet/BottomSheet.android.js +2 -0
  14. package/build/community/bottom-sheet/BottomSheet.android.js.map +1 -1
  15. package/build/community/menu/MenuView.ios.js +2 -1
  16. package/build/community/menu/MenuView.ios.js.map +1 -1
  17. package/build/jetpack-compose/Column/index.d.ts +5 -0
  18. package/build/jetpack-compose/Column/index.js.map +1 -1
  19. package/build/jetpack-compose/Row/index.d.ts +5 -0
  20. package/build/jetpack-compose/Row/index.js.map +1 -1
  21. package/build/jetpack-compose/Text/index.js +5 -4
  22. package/build/jetpack-compose/Text/index.js.map +1 -1
  23. package/build/recycling/useRecycledRows.d.ts +2 -0
  24. package/build/recycling/useRecycledRows.js +1 -0
  25. package/build/recycling/useRecycledRows.js.map +1 -1
  26. package/build/swift-ui/ContentUnavailableView/index.d.ts +5 -0
  27. package/build/swift-ui/ContentUnavailableView/index.js +7 -2
  28. package/build/swift-ui/ContentUnavailableView/index.js.map +1 -1
  29. package/build/swift-ui/HStack/index.d.ts +6 -0
  30. package/build/swift-ui/HStack/index.js.map +1 -1
  31. package/build/swift-ui/RNHostView.d.ts +7 -1
  32. package/build/swift-ui/RNHostView.js +2 -1
  33. package/build/swift-ui/RNHostView.js.map +1 -1
  34. package/build/swift-ui/Text/index.js +2 -1
  35. package/build/swift-ui/Text/index.js.map +1 -1
  36. package/build/swift-ui/VStack/index.d.ts +6 -0
  37. package/build/swift-ui/VStack/index.js.map +1 -1
  38. package/build/swift-ui/modifiers/index.d.ts +18 -0
  39. package/build/swift-ui/modifiers/index.js +9 -0
  40. package/build/swift-ui/modifiers/index.js.map +1 -1
  41. package/build/universal/BottomSheet/index.android.js +5 -5
  42. package/build/universal/BottomSheet/index.android.js.map +1 -1
  43. package/build/universal/Button/index.android.js +3 -1
  44. package/build/universal/Button/index.android.js.map +1 -1
  45. package/build/universal/Button/index.ios.js +3 -1
  46. package/build/universal/Button/index.ios.js.map +1 -1
  47. package/build/universal/Collapsible/index.ios.js +1 -0
  48. package/build/universal/Collapsible/index.ios.js.map +1 -1
  49. package/build/universal/Column/index.android.js +4 -1
  50. package/build/universal/Column/index.android.js.map +1 -1
  51. package/build/universal/Column/index.ios.js +2 -0
  52. package/build/universal/Column/index.ios.js.map +1 -1
  53. package/build/universal/Column/index.js +13 -4
  54. package/build/universal/Column/index.js.map +1 -1
  55. package/build/universal/FieldGroup/FieldGroup.android.js +3 -1
  56. package/build/universal/FieldGroup/FieldGroup.android.js.map +1 -1
  57. package/build/universal/FieldGroup/FieldGroup.ios.js +3 -1
  58. package/build/universal/FieldGroup/FieldGroup.ios.js.map +1 -1
  59. package/build/universal/FieldGroup/FieldSection.android.js +13 -4
  60. package/build/universal/FieldGroup/FieldSection.android.js.map +1 -1
  61. package/build/universal/FieldGroup/FieldSection.ios.js +3 -1
  62. package/build/universal/FieldGroup/FieldSection.ios.js.map +1 -1
  63. package/build/universal/Icon/index.android.js +3 -1
  64. package/build/universal/Icon/index.android.js.map +1 -1
  65. package/build/universal/Icon/index.ios.js +3 -1
  66. package/build/universal/Icon/index.ios.js.map +1 -1
  67. package/build/universal/List/ListForEach.android.d.ts +7 -0
  68. package/build/universal/List/ListForEach.android.js +6 -0
  69. package/build/universal/List/ListForEach.android.js.map +1 -0
  70. package/build/universal/List/ListForEach.d.ts +5 -0
  71. package/build/universal/List/ListForEach.ios.d.ts +5 -0
  72. package/build/universal/List/ListForEach.ios.js +11 -0
  73. package/build/universal/List/ListForEach.ios.js.map +1 -0
  74. package/build/universal/List/ListForEach.js +263 -0
  75. package/build/universal/List/ListForEach.js.map +1 -0
  76. package/build/universal/List/ListScrollContext.d.ts +5 -0
  77. package/build/universal/List/ListScrollContext.js +6 -0
  78. package/build/universal/List/ListScrollContext.js.map +1 -0
  79. package/build/universal/List/index.android.d.ts +5 -0
  80. package/build/universal/List/index.android.js +3 -0
  81. package/build/universal/List/index.android.js.map +1 -1
  82. package/build/universal/List/index.d.ts +5 -0
  83. package/build/universal/List/index.ios.d.ts +5 -0
  84. package/build/universal/List/index.ios.js +3 -0
  85. package/build/universal/List/index.ios.js.map +1 -1
  86. package/build/universal/List/index.js +12 -1
  87. package/build/universal/List/index.js.map +1 -1
  88. package/build/universal/List/types.d.ts +42 -1
  89. package/build/universal/List/types.js +1 -3
  90. package/build/universal/List/types.js.map +1 -1
  91. package/build/universal/RNHostView/index.android.js +3 -1
  92. package/build/universal/RNHostView/index.android.js.map +1 -1
  93. package/build/universal/Row/index.android.js +4 -1
  94. package/build/universal/Row/index.android.js.map +1 -1
  95. package/build/universal/Row/index.ios.js +2 -0
  96. package/build/universal/Row/index.ios.js.map +1 -1
  97. package/build/universal/Row/index.js +13 -7
  98. package/build/universal/Row/index.js.map +1 -1
  99. package/build/universal/ScrollView/index.android.js +8 -1
  100. package/build/universal/ScrollView/index.android.js.map +1 -1
  101. package/build/universal/ScrollView/index.ios.js +3 -1
  102. package/build/universal/ScrollView/index.ios.js.map +1 -1
  103. package/build/universal/Spacer/index.android.js +3 -1
  104. package/build/universal/Spacer/index.android.js.map +1 -1
  105. package/build/universal/Spacer/index.ios.js +3 -1
  106. package/build/universal/Spacer/index.ios.js.map +1 -1
  107. package/build/universal/Text/index.android.js +3 -1
  108. package/build/universal/Text/index.android.js.map +1 -1
  109. package/build/universal/Text/index.ios.js +3 -1
  110. package/build/universal/Text/index.ios.js.map +1 -1
  111. package/build/universal/TextInput/index.android.js +22 -7
  112. package/build/universal/TextInput/index.android.js.map +1 -1
  113. package/build/universal/TextInput/index.ios.js +1 -0
  114. package/build/universal/TextInput/index.ios.js.map +1 -1
  115. package/build/universal/index.d.ts +1 -1
  116. package/build/universal/modifierUtils.d.ts +34 -1
  117. package/build/universal/modifierUtils.js +98 -2
  118. package/build/universal/modifierUtils.js.map +1 -1
  119. package/build/universal/stackAxis.d.ts +9 -0
  120. package/build/universal/stackAxis.js +11 -0
  121. package/build/universal/stackAxis.js.map +1 -0
  122. package/build/universal/transformStyle.android.d.ts +6 -2
  123. package/build/universal/transformStyle.android.js +18 -11
  124. package/build/universal/transformStyle.android.js.map +1 -1
  125. package/build/universal/transformStyle.ios.d.ts +5 -1
  126. package/build/universal/transformStyle.ios.js +29 -11
  127. package/build/universal/transformStyle.ios.js.map +1 -1
  128. package/build/universal/types.d.ts +26 -1
  129. package/build/universal/types.js.map +1 -1
  130. package/build/utils/flattenFragments.d.ts +7 -0
  131. package/build/utils/flattenFragments.js +17 -0
  132. package/build/utils/flattenFragments.js.map +1 -0
  133. package/ios/ContentUnavailableView.swift +9 -1
  134. package/ios/GroupView.swift +3 -0
  135. package/ios/HStackView.swift +26 -2
  136. package/ios/HostView.swift +21 -12
  137. package/ios/Modifiers/FontModifier.swift +27 -0
  138. package/ios/Modifiers/SectionIndexLabelModifier.swift +21 -0
  139. package/ios/Modifiers/ViewModifierRegistry.swift +26 -0
  140. package/ios/RNHostView.swift +4 -0
  141. package/ios/ScrollViewComponent.swift +20 -0
  142. package/ios/UIBaseView.swift +4 -1
  143. package/ios/UniversalLayout.swift +691 -0
  144. package/ios/VStackView.swift +26 -2
  145. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.22/expo.modules.ui-58.0.22-sources.jar → 58.0.24/expo.modules.ui-58.0.24-sources.jar} +0 -0
  146. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24-sources.jar.md5 +1 -0
  147. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24-sources.jar.sha1 +1 -0
  148. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24-sources.jar.sha256 +1 -0
  149. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24-sources.jar.sha512 +1 -0
  150. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.aar +0 -0
  151. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.aar.md5 +1 -0
  152. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.aar.sha1 +1 -0
  153. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.aar.sha256 +1 -0
  154. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.aar.sha512 +1 -0
  155. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.22/expo.modules.ui-58.0.22.module → 58.0.24/expo.modules.ui-58.0.24.module} +22 -22
  156. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.module.md5 +1 -0
  157. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.module.sha1 +1 -0
  158. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.module.sha256 +1 -0
  159. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.module.sha512 +1 -0
  160. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.22/expo.modules.ui-58.0.22.pom → 58.0.24/expo.modules.ui-58.0.24.pom} +1 -1
  161. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.pom.md5 +1 -0
  162. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.pom.sha1 +1 -0
  163. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.pom.sha256 +1 -0
  164. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.24/expo.modules.ui-58.0.24.pom.sha512 +1 -0
  165. package/package.json +1 -1
  166. package/src/community/bottom-sheet/BottomSheet.android.tsx +2 -1
  167. package/src/community/menu/MenuView.ios.tsx +3 -2
  168. package/src/jetpack-compose/Column/index.tsx +5 -0
  169. package/src/jetpack-compose/Row/index.tsx +5 -0
  170. package/src/jetpack-compose/Text/index.tsx +5 -4
  171. package/src/recycling/useRecycledRows.tsx +3 -0
  172. package/src/swift-ui/ContentUnavailableView/index.tsx +19 -4
  173. package/src/swift-ui/HStack/index.tsx +6 -0
  174. package/src/swift-ui/RNHostView.tsx +8 -1
  175. package/src/swift-ui/Text/index.tsx +2 -1
  176. package/src/swift-ui/VStack/index.tsx +6 -0
  177. package/src/swift-ui/modifiers/index.ts +19 -0
  178. package/src/universal/BottomSheet/index.android.tsx +3 -1
  179. package/src/universal/Button/index.android.tsx +3 -1
  180. package/src/universal/Button/index.ios.tsx +2 -1
  181. package/src/universal/Collapsible/index.ios.tsx +4 -1
  182. package/src/universal/Column/index.android.tsx +3 -1
  183. package/src/universal/Column/index.ios.tsx +2 -1
  184. package/src/universal/Column/index.tsx +9 -4
  185. package/src/universal/FieldGroup/FieldGroup.android.tsx +8 -1
  186. package/src/universal/FieldGroup/FieldGroup.ios.tsx +2 -1
  187. package/src/universal/FieldGroup/FieldSection.android.tsx +17 -4
  188. package/src/universal/FieldGroup/FieldSection.ios.tsx +2 -1
  189. package/src/universal/Icon/index.android.tsx +2 -1
  190. package/src/universal/Icon/index.ios.tsx +2 -1
  191. package/src/universal/List/ListForEach.android.tsx +6 -0
  192. package/src/universal/List/ListForEach.ios.tsx +9 -0
  193. package/src/universal/List/ListForEach.tsx +246 -0
  194. package/src/universal/List/ListScrollContext.ts +6 -0
  195. package/src/universal/List/index.android.tsx +5 -0
  196. package/src/universal/List/index.ios.tsx +5 -0
  197. package/src/universal/List/index.tsx +11 -2
  198. package/src/universal/List/types.ts +45 -1
  199. package/src/universal/RNHostView/index.android.tsx +2 -1
  200. package/src/universal/Row/index.android.tsx +3 -1
  201. package/src/universal/Row/index.ios.tsx +2 -1
  202. package/src/universal/Row/index.tsx +9 -10
  203. package/src/universal/ScrollView/index.android.tsx +15 -3
  204. package/src/universal/ScrollView/index.ios.tsx +2 -1
  205. package/src/universal/Spacer/index.android.tsx +6 -4
  206. package/src/universal/Spacer/index.ios.tsx +2 -1
  207. package/src/universal/Text/index.android.tsx +2 -1
  208. package/src/universal/Text/index.ios.tsx +2 -1
  209. package/src/universal/TextInput/index.android.tsx +26 -5
  210. package/src/universal/TextInput/index.ios.tsx +1 -1
  211. package/src/universal/index.ts +6 -1
  212. package/src/universal/modifierUtils.ts +159 -2
  213. package/src/universal/stackAxis.ts +17 -0
  214. package/src/universal/transformStyle.android.ts +30 -12
  215. package/src/universal/transformStyle.ios.ts +41 -13
  216. package/src/universal/types.ts +27 -3
  217. package/src/utils/flattenFragments.ts +22 -0
  218. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22-sources.jar.md5 +0 -1
  219. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22-sources.jar.sha1 +0 -1
  220. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22-sources.jar.sha256 +0 -1
  221. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22-sources.jar.sha512 +0 -1
  222. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar +0 -0
  223. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar.md5 +0 -1
  224. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar.sha1 +0 -1
  225. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar.sha256 +0 -1
  226. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar.sha512 +0 -1
  227. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.module.md5 +0 -1
  228. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.module.sha1 +0 -1
  229. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.module.sha256 +0 -1
  230. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.module.sha512 +0 -1
  231. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.pom.md5 +0 -1
  232. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.pom.sha1 +0 -1
  233. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.pom.sha256 +0 -1
  234. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.pom.sha512 +0 -1
@@ -91,6 +91,7 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
91
91
  Children()
92
92
  }
93
93
  .environment(\.expoHostingView, props.hostingViewReference)
94
+ .environment(\.universalPercentageParent, true)
94
95
  .modifier(HostViewContentMarginsMitigation(layoutDirection: layoutDirection, hostingView: props.hostingView))
95
96
  .fixedSize(horizontal: props.matchContentsHorizontal, vertical: props.matchContentsVertical)
96
97
  .modifier(LayoutDirectionModifier(layoutDirection: layoutDirection))
@@ -115,6 +116,7 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
115
116
  Children()
116
117
  }
117
118
  .environment(\.expoHostingView, props.hostingViewReference)
119
+ .environment(\.universalPercentageParent, true)
118
120
  .fixedSize(horizontal: props.matchContentsHorizontal, vertical: props.matchContentsVertical)
119
121
  .modifier(LayoutDirectionModifier(layoutDirection: layoutDirection))
120
122
  .modifier(ColorSchemeModifier(colorScheme: props.colorScheme?.toColorScheme()))
@@ -166,16 +168,11 @@ private struct ViewportSizeMeasurementLayout: Layout {
166
168
  weak var hostingView: UIView?
167
169
 
168
170
  func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize {
169
- let maxSize = safeAreaSize()
170
- let proposalWidth = proposal.width ?? 0
171
- let proposalHeight = proposal.height ?? 0
172
- let availableWidth = proposalWidth > 0 ? proposalWidth : maxSize.width
173
- let availableHeight = proposalHeight > 0 ? proposalHeight : maxSize.height
174
-
171
+ let offered = measurementProposal(for: proposal)
175
172
  var resultWidth: CGFloat = 0
176
173
  var resultHeight: CGFloat = 0
177
174
  for view in subviews {
178
- let size = view.dimensions(in: ProposedViewSize(width: availableWidth, height: availableHeight))
175
+ let size = view.dimensions(in: offered)
179
176
  resultWidth = max(resultWidth, size.width)
180
177
  resultHeight = max(resultHeight, size.height)
181
178
  }
@@ -183,22 +180,34 @@ private struct ViewportSizeMeasurementLayout: Layout {
183
180
  }
184
181
 
185
182
  func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) {
183
+ // A child percentage applies to this proposal.
184
+ // Offering `bounds` would use the measured result and apply the fraction again.
185
+ let offered = measurementProposal(for: proposal)
186
186
  let isRTL = layoutDirection == .rightToLeft
187
187
  for subview in subviews {
188
188
  let origin: CGPoint
189
189
  if isRTL {
190
- let size = subview.dimensions(in: ProposedViewSize(bounds.size))
190
+ let size = subview.dimensions(in: offered)
191
191
  origin = CGPoint(x: bounds.maxX - size.width, y: bounds.minY)
192
192
  } else {
193
193
  origin = bounds.origin
194
194
  }
195
- subview.place(
196
- at: origin,
197
- proposal: ProposedViewSize(bounds.size)
198
- )
195
+ subview.place(at: origin, proposal: offered)
199
196
  }
200
197
  }
201
198
 
199
+ /// A zero or nil axis uses the safe area.
200
+ /// Placement offers this same size, so a percentage is applied once.
201
+ private func measurementProposal(for proposal: ProposedViewSize) -> ProposedViewSize {
202
+ let maxSize = safeAreaSize()
203
+ let proposalWidth = proposal.width ?? 0
204
+ let proposalHeight = proposal.height ?? 0
205
+ return ProposedViewSize(
206
+ width: proposalWidth > 0 ? proposalWidth : maxSize.width,
207
+ height: proposalHeight > 0 ? proposalHeight : maxSize.height
208
+ )
209
+ }
210
+
202
211
  private func safeAreaSize() -> CGSize {
203
212
  #if os(macOS)
204
213
  // `SceneGeometry` is built on `UIWindowScene`, which has no macOS counterpart. The closest
@@ -29,6 +29,20 @@ internal enum FontWeight: String, Enumerable {
29
29
  }
30
30
  }
31
31
 
32
+ internal enum FontLeading: String, Enumerable {
33
+ case standard
34
+ case tight
35
+ case loose
36
+
37
+ func toSwiftUI() -> Font.Leading {
38
+ switch self {
39
+ case .standard: .standard
40
+ case .tight: .tight
41
+ case .loose: .loose
42
+ }
43
+ }
44
+ }
45
+
32
46
  internal enum FontDesign: String, Enumerable {
33
47
  case `default`
34
48
  case rounded
@@ -81,6 +95,8 @@ internal struct FontModifier: ViewModifier, Record {
81
95
  @Field var weight: FontWeight?
82
96
  @Field var design: FontDesign?
83
97
  @Field var textStyle: FontTextStyle?
98
+ @Field var smallCaps: Bool = false
99
+ @Field var leading: FontLeading?
84
100
 
85
101
  func body(content: Content) -> some View {
86
102
  content.font(resolveFont())
@@ -90,6 +106,17 @@ internal struct FontModifier: ViewModifier, Record {
90
106
  // same `Font` as the view path, instead of a fixed-size `Font.custom` that
91
107
  // drops `relativeTo` (Dynamic Type) and `weight`.
92
108
  func resolveFont() -> Font {
109
+ var font = resolveBaseFont()
110
+ if smallCaps {
111
+ font = font.smallCaps()
112
+ }
113
+ if let leading {
114
+ font = font.leading(leading.toSwiftUI())
115
+ }
116
+ return font
117
+ }
118
+
119
+ private func resolveBaseFont() -> Font {
93
120
  if let family = family {
94
121
  let baseSize = size ?? 17
95
122
  var font: Font = if let textStyle = textStyle {
@@ -0,0 +1,21 @@
1
+ // Copyright 2026-present 650 Industries. All rights reserved.
2
+
3
+ import ExpoModulesCore
4
+ import SwiftUI
5
+
6
+ internal struct SectionIndexLabelModifier: ViewModifier, Record {
7
+ @Field var label: String?
8
+
9
+ @ViewBuilder
10
+ func body(content: Content) -> some View {
11
+ if #available(iOS 26.0, macOS 26.0, tvOS 26.0, *) {
12
+ #if compiler(>=6.2) // Xcode 26
13
+ content.sectionIndexLabel(label)
14
+ #else
15
+ content
16
+ #endif
17
+ } else {
18
+ content
19
+ }
20
+ }
21
+ }
@@ -1187,6 +1187,18 @@ internal enum TextLinePattern: String, Enumerable {
1187
1187
  case dashDotDot
1188
1188
  }
1189
1189
 
1190
+ internal extension TextLinePattern {
1191
+ func toSwiftUI() -> Text.LineStyle.Pattern {
1192
+ switch self {
1193
+ case .solid: return .solid
1194
+ case .dash: return .dash
1195
+ case .dot: return .dot
1196
+ case .dashDot: return .dashDot
1197
+ case .dashDotDot: return .dashDotDot
1198
+ }
1199
+ }
1200
+ }
1201
+
1190
1202
  internal struct TextUnderLine: ViewModifier, Record {
1191
1203
  @Field var isActive: Bool = false
1192
1204
  @Field var pattern: TextLinePattern = .solid
@@ -1635,6 +1647,12 @@ public class ViewModifierRegistry {
1635
1647
  return text.foregroundColor(color)
1636
1648
  }
1637
1649
  return text
1650
+ case "underline":
1651
+ guard let modifier = try? TextUnderLine(from: params, appContext: appContext) else { return text }
1652
+ return text.underline(modifier.isActive, pattern: modifier.pattern.toSwiftUI(), color: modifier.color)
1653
+ case "strikethrough":
1654
+ guard let modifier = try? TextStrikeThrough(from: params, appContext: appContext) else { return text }
1655
+ return text.strikethrough(modifier.isActive, pattern: modifier.pattern.toSwiftUI(), color: modifier.color)
1638
1656
  default:
1639
1657
  #if DEBUG
1640
1658
  return Text(" ['\(type)' not supported for nested Text]").foregroundColor(.red)
@@ -1921,6 +1939,10 @@ extension ViewModifierRegistry {
1921
1939
  return try FrameModifier(from: params, appContext: appContext)
1922
1940
  }
1923
1941
 
1942
+ register("universalLayout") { params, appContext, _ in
1943
+ return try UniversalLayoutModifier(from: params, appContext: appContext)
1944
+ }
1945
+
1924
1946
  register("padding") { params, appContext, _ in
1925
1947
  return try PaddingModifier(from: params, appContext: appContext)
1926
1948
  }
@@ -2500,6 +2522,10 @@ extension ViewModifierRegistry {
2500
2522
  return try ListStyleModifier(from: params, appContext: appContext)
2501
2523
  }
2502
2524
 
2525
+ register("sectionIndexLabel") { params, appContext, _ in
2526
+ return try SectionIndexLabelModifier(from: params, appContext: appContext)
2527
+ }
2528
+
2503
2529
  register("moveDisabled") { params, appContext, _ in
2504
2530
  return try MoveDisabledModifier(from: params, appContext: appContext)
2505
2531
  }
@@ -10,6 +10,10 @@ internal final class RNHostViewProps: ExpoSwiftUI.ViewProps {
10
10
  Adds LeafNode and MeasurableYogaNode trait in Shadow node
11
11
  */
12
12
  @Field var expoInternalSizeFromChildren: Bool = false
13
+ /**
14
+ Read by `ExpoViewShadowNode` in C++ to measure the children within the space Yoga gives the `Host`.
15
+ */
16
+ @Field var expoInternalBoundedByHost: Bool = false
13
17
  /**
14
18
  Whether this view owns its subtree's touches and is the origin its content is measured from. Set
15
19
  by the JavaScript side for content presented in its own view controller — see `RNHostView.tsx`,
@@ -10,6 +10,8 @@ public final class ScrollViewComponentProps: UIBaseViewProps {
10
10
 
11
11
  public struct ScrollViewComponent: ExpoSwiftUI.View {
12
12
  @ObservedObject public var props: ScrollViewComponentProps
13
+ // A fraction on this view is a real size only when the parent opted in.
14
+ @Environment(\.resolvesOwnPercentage) private var resolvesOwnPercentage
13
15
 
14
16
  public init(props: ScrollViewComponentProps) {
15
17
  self.props = props
@@ -19,5 +21,23 @@ public struct ScrollViewComponent: ExpoSwiftUI.View {
19
21
  ScrollView(props.axes.toAxis(), showsIndicators: props.showsIndicators) {
20
22
  Children()
21
23
  }
24
+ // The cross axis resolves a child percentage against the viewport.
25
+ // The scroll axis stays unbounded, so a percentage on that axis does not.
26
+ .environment(\.universalPercentageParent, resolvesChildPercentages)
27
+ }
28
+
29
+ /// A vertical scroll view fills the width it is offered.
30
+ /// A horizontal scroll view takes its height from its content unless a size sets it.
31
+ /// That content height is not a percentage base.
32
+ private var resolvesChildPercentages: Bool {
33
+ switch props.axes {
34
+ case .vertical:
35
+ return true
36
+ case .horizontal:
37
+ let dimensions = universalLayoutDimensions(from: props.modifiers)
38
+ return dimensions.heightPoints != nil || (dimensions.heightFraction != nil && resolvesOwnPercentage)
39
+ case .both:
40
+ return false
41
+ }
22
42
  }
23
43
  }
@@ -16,9 +16,12 @@ public struct UIBaseView<Props: UIBaseViewProps, Content: ExpoSwiftUI.View<Props
16
16
  }
17
17
 
18
18
  public var body: some View {
19
- innerView
19
+ UniversalPercentageParentBoundary(content: innerView)
20
20
  .applyAccessibilityIdentifier(props.testID)
21
21
  .applyModifiers(props.modifiers, appContext: props.appContext, globalEventDispatcher: props.globalEventDispatcher)
22
+ // A user modifier such as `onGeometryChange` hides the layout value a universal stack reads.
23
+ // Set it again outside every modifier.
24
+ .layoutValue(key: UniversalLayoutDimensionsKey.self, value: universalLayoutDimensions(from: props.modifiers))
22
25
  .publishZeroContentOrigin(props.shadowNodeProxy)
23
26
  }
24
27
  }