Skip to content

Commit 8c4acd6

Browse files
committed
Fix build after rebase
1 parent a31e66c commit 8c4acd6

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

Sources/LiveViewNative/Coordinators/LiveViewCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ public class LiveViewCoordinator<R: RootRegistry>: ObservableObject {
388388
private func handleJoinPayload(renderedPayload: Payload) {
389389
// todo: what should happen if decoding or parsing fails?
390390
self.document = try! LiveViewNativeCore.Document.parseFragmentJson(payload: renderedPayload)
391-
self.document?.on(.changed) { [unowned self] doc, nodeRef, nodeData, parent in
391+
self.document?.on(.changed) { nodeRef, nodeData, parent in
392392
switch nodeData {
393393
case .root:
394394
// when the root changes, update the `NavStackEntry` itself.

Sources/LiveViewNative/Live/LiveElement.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,22 @@ public protocol _LiveElementTrackedContent {
5353

5454
public extension _LiveElementTracked {
5555
func children(_ predicate: (Node) -> Bool = { node in
56-
!node.attributes.contains(where: { $0.name.namespace == nil && $0.name.name == "template" })
56+
!node.attributes().contains(where: { $0.name.namespace == nil && $0.name.name == "template" })
5757
}) -> some View {
5858
context.coordinator.builder.fromNodes(_element.children.filter(predicate), context: context.storage)
5959
}
60-
60+
6161
func children(in template: Template, default includeDefault: Bool = false) -> some View {
6262
children {
63-
$0.attributes.contains(where: {
63+
$0.attributes().contains(where: {
6464
$0 == template
65-
}) || (includeDefault && !$0.attributes.contains(where: { $0.name.namespace == nil && $0.name.name == "template" }))
65+
}) || (includeDefault && !$0.attributes().contains(where: { $0.name.namespace == nil && $0.name.name == "template" }))
6666
}
6767
}
68-
68+
6969
func hasTemplate(_ template: Template, default includeDefault: Bool = false) -> Bool {
7070
_element.children.contains(where: {
71-
for attribute in $0.attributes {
71+
for attribute in $0.attributes() {
7272
if attribute == template {
7373
return true
7474
} else if includeDefault && attribute.name.namespace == nil && attribute.name.name == "template" {

Sources/LiveViewNative/Views/Controls and Indicators/Links/ShareLink.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,24 +98,24 @@ struct ShareLink<Root: RootRegistry>: View {
9898
self.value = try itemsDecoder.decode([String].self, from: data)
9999
}
100100
}
101-
101+
102102
/// A string to share.
103103
@_documentation(visibility: public)
104104
private var item: String?
105-
105+
106106
public var body: some View {
107107
#if !os(tvOS)
108108
let useDefaultLabel = $liveElement.childNodes.filter({
109-
guard case let .element(data) = $0.data else { return true }
110-
return data.tag != "SharePreview"
109+
guard case let .nodeElement(data) = $0.data() else { return true }
110+
return data.name.name != "SharePreview"
111111
}).isEmpty
112-
112+
113113
let subject = self.subject.flatMap(SwiftUI.Text.init)
114114
let message = self.message.flatMap(SwiftUI.Text.init)
115-
115+
116116
if let items = items?.value {
117117
let previews = previews(for: items)
118-
118+
119119
if useDefaultLabel {
120120
switch previews {
121121
case nil:

Sources/LiveViewNative/Views/Images/ImageView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ struct ImageView<Root: RootRegistry>: View {
128128
}
129129

130130
var label: SwiftUI.Text? {
131-
if let labelNode = $liveElement.children().first {
131+
if let labelNode = $liveElement.childNodes.first {
132132
switch labelNode.data() {
133-
case let .element(element):
133+
case let .nodeElement(element):
134134
return Text<Root>(element: ElementNode(node: labelNode, data: element), overrideStylesheet: nil).body
135135
case let .leaf(label):
136136
return .init(label)

Sources/LiveViewNative/Views/Layout Containers/Collection Containers/List.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ struct List<Root: RootRegistry>: View {
167167
}
168168
#endif
169169
}
170-
170+
171171
private var content: some View {
172172
forEach(
173173
nodes: $liveElement.childNodes.filter({
174-
!$0.attributes.contains(where: { $0.name.namespace == nil && $0.name.name == "template" })
174+
!$0.attributes().contains(where: { $0.name.namespace == nil && $0.name.name == "template" })
175175
}),
176176
context: $liveElement.context.storage
177177
)
178178
.onDelete(perform: onDeleteHandler)
179179
.onMove(perform: onMoveHandler)
180180
}
181-
181+
182182
private var onDeleteHandler: ((IndexSet) -> Void)? {
183183
guard delete.event != nil else { return nil }
184184
return { indices in

Sources/LiveViewNative/Views/Text Input and Output/Text.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,14 @@ struct Text<Root: RootRegistry>: View {
213213
}
214214
} else {
215215
return $liveElement.childNodes.reduce(into: SwiftUI.Text("")) { prev, next in
216-
switch next.data {
217-
case let .element(data):
216+
switch next.data() {
217+
case let .nodeElement(data):
218218
guard !data.attributes.contains(where: { $0.name.namespace == nil && $0.name.name == "template" })
219219
else { return }
220-
220+
221221
let element = ElementNode(node: next, data: data)
222-
223-
switch data.tag {
222+
223+
switch data.name.name {
224224
case "Text":
225225
prev = prev + Self(
226226
element: element,

0 commit comments

Comments
 (0)