Sources/Orgstar/Panels.swift

design-themes-widgets
orgstar/Sources/Orgstar/Panels.swift history · blame · raw

26 lines · 703 bytes

 1import Foundation
 2import OrgApp
 3import OrgCore
 4
 5enum Panel: Identifiable {
 6    case columns(UUID, ColumnView.View)
 7    case export(UUID, URL)
 8    case conflict(UUID)
 9    case syncCopies(UUID)
10    case recovery(UUID)
11    /// A `#+PLOT` table drawn here, or gnuplot's image of it.
12    case plot(UUID, TablePlot.Plot)
13    case plotImage(UUID, URL)
14    case crypt(UUID, CryptRequest)
15
16    var id: UUID {
17        switch self {
18        case .columns(let id, _), .export(let id, _), .conflict(let id), .syncCopies(let id), .recovery(let id), .plot(let id, _), .plotImage(let id, _), .crypt(let id, _): id
19        }
20    }
21}
22
23struct BlockEditRequest: Identifiable {
24    let id = UUID()
25    let edit: BlockEdit
26}