@momo-kits/native-kits 0.169.11 → 0.169.12-beta.1
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.
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
import SwiftUI
|
|
5
5
|
|
|
6
|
+
/// Stretch frame on hold until design confirms it: `.stretch` lays out like `.grid`.
|
|
7
|
+
private let isStretchFrameEnabled = false
|
|
8
|
+
|
|
6
9
|
/// Header spec values, in points. Public so custom header rights and extensions can match them.
|
|
7
10
|
public enum HeaderLayoutMetrics {
|
|
8
11
|
public static let buttonSize: CGFloat = 32
|
|
@@ -23,6 +26,7 @@ public enum ContentLayout: Equatable {
|
|
|
23
26
|
/// 12 column grid: the header keeps the 12pt side padding.
|
|
24
27
|
case grid
|
|
25
28
|
/// One column of at most `HeaderLayoutMetrics.frameMaxWidth`, centered: the header row sits in the same frame.
|
|
29
|
+
/// On hold: same as `.grid` for now.
|
|
26
30
|
case stretch
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -43,7 +47,8 @@ public extension ScreenLayout {
|
|
|
43
47
|
let isLargeWindow = min(width, height) >= ModalMetrics.foldableMinWidth
|
|
44
48
|
let isWide = !isIPhoneDuo && !isDuoDevice && isLargeWindow
|
|
45
49
|
let safeWidth = width - insets.leading - insets.trailing
|
|
46
|
-
let
|
|
50
|
+
let isStretch = isStretchFrameEnabled && contentLayout == .stretch
|
|
51
|
+
let frameInset = isWide && isStretch
|
|
47
52
|
? max(HeaderLayoutMetrics.sidePadding, (safeWidth - HeaderLayoutMetrics.frameMaxWidth) / 2)
|
|
48
53
|
: HeaderLayoutMetrics.sidePadding
|
|
49
54
|
return HeaderLayout(
|
package/ios/native-kits.podspec
CHANGED