diff --git a/Sources/Elementary/Core/HtmlBuilder+Tuples.swift b/Sources/Elementary/Core/HtmlBuilder+Tuples.swift index 775bc6e..9e3cbca 100644 --- a/Sources/Elementary/Core/HtmlBuilder+Tuples.swift +++ b/Sources/Elementary/Core/HtmlBuilder+Tuples.swift @@ -44,6 +44,7 @@ public extension HTMLBuilder { // variadic generics currently not supported in embedded #if !hasFeature(Embedded) @inlinable + @available(iOS 17, *) static func buildBlock(_ content: repeat each Content) -> _HTMLTuple where repeat each Content: HTML { _HTMLTuple(repeat each content) @@ -273,8 +274,10 @@ public struct _HTMLTuple6: HTML { public let value: (repeat each Child) diff --git a/Sources/Elementary/Rendering/HtmlTextRenderer.swift b/Sources/Elementary/Rendering/HtmlTextRenderer.swift index 076dc80..bc3e107 100644 --- a/Sources/Elementary/Rendering/HtmlTextRenderer.swift +++ b/Sources/Elementary/Rendering/HtmlTextRenderer.swift @@ -1,3 +1,7 @@ +#if os(iOS) +import Foundation +#endif + #if !hasFeature(Embedded) struct HTMLTextRenderer: _HTMLRendering { private var result: [UInt8] = [] @@ -68,7 +72,11 @@ struct PrettyHTMLTextRenderer { } if currentInlineText.contains("\n") { + #if os(iOS) + currentInlineText = currentInlineText.replacingOccurrences(of: "\n", with: "\n\(currentIndentation)") + #else currentInlineText.replace("\n", with: "\n\(currentIndentation)") + #endif addLineBreak() result += currentInlineText return true diff --git a/Sources/Elementary/ServerSupport/SendOnceBox.swift b/Sources/Elementary/ServerSupport/SendOnceBox.swift index eb61348..45f677e 100644 --- a/Sources/Elementary/ServerSupport/SendOnceBox.swift +++ b/Sources/Elementary/ServerSupport/SendOnceBox.swift @@ -1,7 +1,7 @@ -#if compiler(>=6.0) && !hasFeature(Embedded) && !os(iOS) +#if compiler(>=6.0) && !hasFeature(Embedded) import Synchronization -@available(macOS 15.0, *) +@available(iOS 18, macOS 15, *) final class SendOnceBox: Sendable, SendOnceBoxing { // final class SendOnceBox: Sendable, SendOnceBoxing { typealias Value = any HTML diff --git a/Sources/Elementary/ServerSupport/SendableAnyHTMLBox.swift b/Sources/Elementary/ServerSupport/SendableAnyHTMLBox.swift index de9ef7e..44619a7 100644 --- a/Sources/Elementary/ServerSupport/SendableAnyHTMLBox.swift +++ b/Sources/Elementary/ServerSupport/SendableAnyHTMLBox.swift @@ -1,8 +1,10 @@ -#if !hasFeature(Embedded) && !os(iOS) +#if !hasFeature(Embedded) /// A wrapper around an `any HTML` value that can be safely sent once. /// /// Note: For non-sendable values, this will only allow the value to be taken only once. /// Sendable values can safely be taken multiple times. + +@available(iOS 18, *) public struct _SendableAnyHTMLBox: Sendable { var storage: Storage