v0.5.0 — Phase β-4 Media + Advanced Card-Types
Alle 7 Card-Types werden gerendert und können erstellt werden. image-occlusion mit Touch-Drag-Mask-Editor (kein PencilKit — Server- Schema erlaubt nur Rechtecke), audio-front mit AVAudioPlayer und File-Picker. - MediaUploadResponse-DTO, MaskRegion-Codable mit 0..1-Coordinates - MaskRegions.parse/encode (1:1-Port aus cards-domain, Sortierung nach ID lexikographisch) - CardFieldsBuilder.imageOcclusion mit stringified-JSON-mask_regions + audioFront - CardsAPI.uploadMedia (Multipart, 25 MiB) + fetchMedia (streamed) - MediaCache actor mit LRU 200 MB (contentModificationDate-Eviction) - mediaCache Environment-Key - RemoteImage + AudioPlayerButton SwiftUI-Views - CardRenderer: imageOcclusion (Mask-Overlay über RemoteImage) + audioFront (AudioPlayerButton + back-Text auf Flip) - MaskEditorView: Touch-Drag-Rechteck, Label-Edit, Delete - CardEditorView erweitert: PhotosPicker für Image, fileImporter für Audio, Magic-Byte-MIME-Detection - 6 neue Tests für MaskRegions (30 Total grün) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cf1160b270
commit
80eb3708b4
12 changed files with 923 additions and 44 deletions
15
Sources/Core/Sync/MediaEnvironment.swift
Normal file
15
Sources/Core/Sync/MediaEnvironment.swift
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import SwiftUI
|
||||
|
||||
/// Environment-Key, der den shared `MediaCache` durch die View-Hierarchie
|
||||
/// reicht. App-Entrypoint setzt den Wert; Views lesen via
|
||||
/// `@Environment(\.mediaCache)`.
|
||||
private struct MediaCacheKey: EnvironmentKey {
|
||||
static let defaultValue: MediaCache? = nil
|
||||
}
|
||||
|
||||
extension EnvironmentValues {
|
||||
var mediaCache: MediaCache? {
|
||||
get { self[MediaCacheKey.self] }
|
||||
set { self[MediaCacheKey.self] = newValue }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue