Run swift format

This commit is contained in:
gonzalezreal
2024-06-16 08:29:38 +00:00
committed by github-actions[bot]
parent ba61e69dc7
commit 9f6c50ff63
3 changed files with 49 additions and 70 deletions

View File

@@ -147,14 +147,14 @@ struct CodeSyntaxHighlightView: View {
}
private func copyToClipboard(_ string: String) {
#if os(macOS)
if let pasteboard = NSPasteboard.general {
pasteboard.clearContents()
pasteboard.setString(string, forType: .string)
}
#elseif os(iOS)
UIPasteboard.general.string = string
#endif
#if os(macOS)
if let pasteboard = NSPasteboard.general {
pasteboard.clearContents()
pasteboard.setString(string, forType: .string)
}
#elseif os(iOS)
UIPasteboard.general.string = string
#endif
}
}

View File

@@ -46,8 +46,7 @@ extension View {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a generic 'Configuration'
value.
"""
@@ -62,8 +61,7 @@ extension View {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a generic 'Configuration'
value.
"""
@@ -85,8 +83,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -102,8 +99,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -119,8 +115,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -136,8 +131,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -153,8 +147,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -170,8 +163,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -187,8 +179,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -204,8 +195,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -221,8 +211,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'CodeBlockConfiguration'
value.
"""
@@ -240,8 +229,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -257,8 +245,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -274,8 +261,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -291,8 +277,7 @@ extension Theme {
@available(
*,
deprecated,
message:
"""
message: """
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
value.
"""
@@ -330,11 +315,10 @@ public typealias InlineCode = Code
@available(
*,
unavailable,
message:
message: """
"MarkdownImageHandler" has been superseded by the "ImageProvider" protocol and its conforming
types "DefaultImageProvider" and "AssetImageProvider".
"""
"MarkdownImageHandler" has been superseded by the "ImageProvider" protocol and its conforming
types "DefaultImageProvider" and "AssetImageProvider".
"""
)
public struct MarkdownImageHandler {
public static var networkImage: Self {
@@ -353,11 +337,10 @@ extension Markdown {
@available(
*,
unavailable,
message:
message: """
"MarkdownImageHandler" has been superseded by the "ImageProvider" protocol and its conforming
types "DefaultImageProvider" and "AssetImageProvider".
"""
"MarkdownImageHandler" has been superseded by the "ImageProvider" protocol and its conforming
types "DefaultImageProvider" and "AssetImageProvider".
"""
)
public func setImageHandler(
_ imageHandler: MarkdownImageHandler,
@@ -381,11 +364,10 @@ extension View {
@available(
*,
unavailable,
message:
message: """
"MarkdownStyle" and its subtypes have been superseded by the "Theme", "TextStyle", and
"BlockStyle" types.
"""
"MarkdownStyle" and its subtypes have been superseded by the "Theme", "TextStyle", and
"BlockStyle" types.
"""
)
public struct MarkdownStyle: Hashable {
public struct Font: Hashable {
@@ -501,11 +483,10 @@ extension View {
@available(
*,
unavailable,
message:
message: """
"MarkdownStyle" and its subtypes have been superseded by the "Theme", "TextStyle", and
"BlockStyle" types.
"""
"MarkdownStyle" and its subtypes have been superseded by the "Theme", "TextStyle", and
"BlockStyle" types.
"""
)
public func markdownStyle(_ markdownStyle: MarkdownStyle) -> some View {
self

View File

@@ -41,29 +41,27 @@ struct ListItemView: View {
.frame(width: self.markerWidth, alignment: .trailing)
}
#if os(visionOS)
.labelStyle(BulletItemStyle())
.labelStyle(BulletItemStyle())
#endif
}
}
extension VerticalAlignment {
private enum CenterOfFirstLine: AlignmentID {
static func defaultValue(in context: ViewDimensions) -> CGFloat {
let heightAfterFirstLine = context[.lastTextBaseline] - context[.firstTextBaseline]
let heightOfFirstLine = context.height - heightAfterFirstLine
return heightOfFirstLine / 2
}
}
static let centerOfFirstLine = Self(CenterOfFirstLine.self)
private enum CenterOfFirstLine: AlignmentID {
static func defaultValue(in context: ViewDimensions) -> CGFloat {
let heightAfterFirstLine = context[.lastTextBaseline] - context[.firstTextBaseline]
let heightOfFirstLine = context.height - heightAfterFirstLine
return heightOfFirstLine / 2
}
}
static let centerOfFirstLine = Self(CenterOfFirstLine.self)
}
struct BulletItemStyle: LabelStyle {
func makeBody(configuration: Configuration) -> some View {
HStack(alignment: .centerOfFirstLine, spacing: 4) {
configuration.icon
configuration.title
}
func makeBody(configuration: Configuration) -> some View {
HStack(alignment: .centerOfFirstLine, spacing: 4) {
configuration.icon
configuration.title
}
}
}