@momo-kits/native-kits 0.167.1-duo.10-debug → 0.167.1-duo.11-debug

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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.167.1-duo.10-debug"
43
+ version = "0.167.1-duo.11-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -291,8 +291,9 @@ struct BottomSheetView<Content: View>: View {
291
291
  }
292
292
  }
293
293
 
294
- /// Compose's `heightIn(max:)`: caps the sheet but keeps it hugging its content, which
295
- /// `.frame(maxHeight:)` would not — a flexible frame grows to the cap.
294
+ /// Compose's `heightIn(max:)`. `.frame(maxHeight:)` grows to the cap whenever the proposal is
295
+ /// larger, leaving a gap above the header; this sizes the sheet to its content and only caps it
296
+ /// when taller.
296
297
  @available(iOS 16.0, *)
297
298
  private struct CapHeight: ViewModifier {
298
299
  let maxHeight: CGFloat
@@ -307,8 +308,11 @@ private struct CapHeightLayout: Layout {
307
308
  let maxHeight: CGFloat
308
309
 
309
310
  func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize {
310
- let height = min(proposal.height ?? .infinity, maxHeight)
311
- return subviews.first?.sizeThatFits(ProposedViewSize(width: proposal.width, height: height)) ?? .zero
311
+ guard let subview = subviews.first else { return .zero }
312
+ let cap = min(maxHeight, proposal.height ?? .infinity)
313
+ // ideal first: a scroll view would otherwise fill whatever height it is offered
314
+ let ideal = subview.sizeThatFits(ProposedViewSize(width: proposal.width, height: nil))
315
+ return subview.sizeThatFits(ProposedViewSize(width: proposal.width, height: min(ideal.height, cap)))
312
316
  }
313
317
 
314
318
  func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.167.1-duo.10-debug",
3
+ "version": "0.167.1-duo.11-debug",
4
4
  "private": false,
5
5
  "dependeNavigationncies": {},
6
6
  "devDependencies": {},