feat: Moves core functionality into it's own library.

This commit is contained in:
2024-12-05 09:59:30 -05:00
parent 33356d8648
commit e7bbbec7c2
24 changed files with 464 additions and 387 deletions

View File

@@ -0,0 +1,23 @@
public struct HStack: TextNode {
@usableFromInline
let content: [any TextNode]
@usableFromInline
let separator: any TextNode
@inlinable
public init(
spacing: Int = 1,
@TextBuilder content: () -> any TextNode
) {
self.content = array(from: content())
self.separator = seperator(" ", count: spacing > 0 ? spacing - 1 : 0)
}
@inlinable
public var body: some TextNode {
content.removingEmptys()
.joined(separator: separator.render())
}
}