Add single file audio player, introduce blocks

This commit is contained in:
Christoph Hagen
2025-01-06 01:17:06 +01:00
parent c78c359819
commit 245534e989
27 changed files with 521 additions and 88 deletions

View File

@ -0,0 +1,43 @@
import SwiftUI
struct AudioSettingsDetailView: View {
@Environment(\.language)
private var language
@ObservedObject
var audioPlayer: AudioPlayerSettings
var body: some View {
ScrollView {
VStack(alignment: .leading) {
DetailTitle(
title: "Audio Player Settings",
text: "Configure the files and settings for the audio player components")
IntegerPropertyView(
title: "Playlist Cover Image Size",
value: $audioPlayer.playlistCoverImageSize,
footer: "The maximum size of the album cover image in a playlist audio player (in pixels)")
IntegerPropertyView(
title: "Small Album Cover Image Size",
value: $audioPlayer.smallCoverImageSize,
footer: "The maximum size of the album cover image in a single file audio player (in pixels)")
FilePropertyView(
title: "Audio Player CSS File",
footer: "The CSS file to provide the style for the audio player",
selectedFile: $audioPlayer.audioPlayerCssFile,
allowedType: .asset)
FilePropertyView(
title: "Audio Player JavaScript File",
footer: "The CSS file to provide the functionality for the audio player",
selectedFile: $audioPlayer.audioPlayerJsFile,
allowedType: .asset)
}
.padding()
}
}
}

View File

@ -17,10 +17,10 @@ struct GenerationContentView: View {
var body: some View {
switch selectedSection {
case .folders, .navigationBar, .postFeed, .tagOverview:
generationView
case .pages:
PageSettingsContentView()
default:
generationView
}
}
@ -96,6 +96,11 @@ struct GenerationContentView: View {
Text(markdown)
}
}
Section("Invalid blocks") {
ForEach(content.results.invalidBlocks.sorted(), id: \.self) { markdown in
Text(markdown)
}
}
Section("Warnings") {
ForEach(content.results.warnings.sorted(), id: \.self) { warning in
Text(warning)

View File

@ -4,6 +4,9 @@ struct GenerationDetailView: View {
let section: SettingsSection
@EnvironmentObject
private var content: Content
var body: some View {
switch section {
case .folders:
@ -16,6 +19,8 @@ struct GenerationDetailView: View {
PageSettingsDetailView()
case .tagOverview:
TagOverviewDetailView()
case .audioPlayer:
AudioSettingsDetailView(audioPlayer: content.settings.audioPlayer)
}
}
}

View File

@ -42,18 +42,6 @@ struct PageSettingsDetailView: View {
selectedFile: $content.settings.pages.codeHighlightingJsFile,
allowedType: .asset)
FilePropertyView(
title: "Audio Player CSS File",
footer: "The CSS file to provide the style for the audio player",
selectedFile: $content.settings.pages.audioPlayerCssFile,
allowedType: .asset)
FilePropertyView(
title: "Audio Player JavaScript File",
footer: "The CSS file to provide the functionality for the audio player",
selectedFile: $content.settings.pages.audioPlayerJsFile,
allowedType: .asset)
FilePropertyView(
title: "3D Model Viewer File",
footer: "The JavaScript file to provide the functionality for the 3D model viewer",

View File

@ -12,6 +12,8 @@ enum SettingsSection: String {
case tagOverview = "Tag Overview"
case audioPlayer = "Audio Player"
}
extension SettingsSection {
@ -23,6 +25,7 @@ extension SettingsSection {
case .postFeed: return .rectangleGrid1x2
case .pages: return .docRichtext
case .tagOverview: return .tag
case .audioPlayer: return .waveform
}
}
}