Explicit asset property

This commit is contained in:
Christoph Hagen
2025-02-17 13:38:48 +01:00
parent 0cc0f76254
commit 964c644922
6 changed files with 42 additions and 31 deletions

View File

@ -39,7 +39,7 @@ struct FileContentView: View {
.font(.title)
}
.foregroundStyle(.secondary)
case .text, .code, .asset:
case .text, .code:
TextFileContentView(file: file)
.id(file.id)
case .video:

View File

@ -99,6 +99,11 @@ struct FileDetailView: View {
text: $file.customOutputPath,
footer: "A custom path where the file is stored in the output folder")
BoolPropertyView(
title: "Asset",
value: $file.isAsset,
footer: "Indicate that this file should be treated as an asset")
if let imageDimensions = file.imageDimensions {
GenericPropertyView(title: "Image dimensions") {
Text("\(Int(imageDimensions.width)) x \(Int(imageDimensions.height)) (\(file.aspectRatio))")

View File

@ -25,13 +25,13 @@ struct AudioSettingsDetailView: View {
title: "Audio Player CSS File",
footer: "The CSS file to provide the style for the audio player",
selectedFile: $audioPlayer.audioPlayerCssFile,
allowedType: .asset)
allowedType: .code)
FilePropertyView(
title: "Audio Player JavaScript File",
footer: "The CSS file to provide the functionality for the audio player",
selectedFile: $audioPlayer.audioPlayerJsFile,
allowedType: .asset)
allowedType: .code)
LocalizedAudioSettingsDetailView(settings: audioPlayer.localized(in: language))
.id(language)

View File

@ -30,32 +30,32 @@ struct PageSettingsDetailView: View {
title: "Default CSS File",
footer: "The CSS file containing the styling of all pages",
selectedFile: $pageSettings.defaultCssFile,
allowedType: .asset)
allowedType: .code)
FilePropertyView(
title: "Code Highlighting File",
footer: "The JavaScript file to provide syntax highlighting of code blocks",
selectedFile: $pageSettings.codeHighlightingJsFile,
allowedType: .asset)
allowedType: .code)
FilePropertyView(
title: "3D Model Viewer File",
footer: "The JavaScript file to provide the functionality for the 3D model viewer",
selectedFile: $pageSettings.modelViewerJsFile,
allowedType: .asset)
allowedType: .code)
FilePropertyView(
title: "Image Comparison CSS File",
footer: "The CSS file to provide image comparisons",
selectedFile: $pageSettings.imageCompareCssFile,
allowedType: .asset)
allowedType: .code)
FilePropertyView(
title: "Image Comparison JaveScript File",
footer: "The JavaScript file to provide image comparisons",
selectedFile: $pageSettings.imageCompareJsFile,
allowedType: .asset)
allowedType: .code)
LocalizedPageSettingsView(settings: pageSettings.localized(in: language))
.id(language)