This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block Editor: use SwiftUI for transcludes and related (#994)
Fixes #983 Replaces UIKit transcludes with SwiftUI transcludes using UIHostingView from #981. The transclude callbacks are not yet hooked up to anything. Saving this for a future PR where we integrate the block editor with real data and services. Progress toward #214.
- Loading branch information
1 parent
4202840
commit e02b211
Showing
19 changed files
with
387 additions
and
858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
xcode/Subconscious/Shared/Components/Common/Transclude/TranscludeListView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// TranscludeListView.swift | ||
// Subconscious | ||
// | ||
// Created by Gordon Brander on 11/11/23. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct TranscludeListView: View { | ||
var entries: [EntryStub] | ||
var onViewTransclude: (EntryStub) -> Void | ||
var onTranscludeLink: (ResolvedAddress, SubSlashlinkLink) -> Void | ||
|
||
var body: some View { | ||
VStack { | ||
ForEach(entries, id: \.self) { entry in | ||
TranscludeView( | ||
entry: entry, | ||
onRequestDetail: { | ||
onViewTransclude(entry) | ||
}, | ||
onLink: { link in | ||
onTranscludeLink(entry.toResolvedAddress(), link) | ||
} | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct TranscludeListView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
TranscludeListView( | ||
entries: [ | ||
EntryStub( | ||
did: Did.dummyData(), | ||
address: Slashlink("did:subconscious:local/loomings")!, | ||
excerpt: Subtext( | ||
markup: """ | ||
Call me Ishmael. | ||
Some years ago- never mind how long precisely | ||
""" | ||
), | ||
isTruncated: false, | ||
modified: Date.now | ||
), | ||
], | ||
onViewTransclude: { _ in }, | ||
onTranscludeLink: { _, _ in } | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 0 additions & 76 deletions
76
...ubconscious/Shared/UIKit/BlockEditor/Blocks/Appendix/BlockEditorAppendixHeadingView.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.