feat: Adds stacks, working on styles

This commit is contained in:
2024-12-04 10:40:39 -05:00
parent 46c2c7ad31
commit 10119c3e51
12 changed files with 232 additions and 107 deletions

View File

@@ -0,0 +1,21 @@
@usableFromInline
func array(from node: any TextNode) -> [any TextNode] {
if let container = node as? NodeContainer {
return container.nodes
} else if let array = node as? [any TextNode] {
return array
} else {
return [node]
}
}
@usableFromInline
func seperator(_ separator: String, count: Int) -> any TextNode {
assert(count >= 0, "Invalid count while creating a separator")
var output = ""
for _ in 0 ... count {
output += separator
}
return output
}