Ferrite-backup/Ferrite/Protocols/Plugin.swift
kingbri 87d94e4c35 Plugins: Fix animation and appearance
Switching to a list that changes state on updates caused sheets
to break when animating. Place the list in a container ZStack
that doesn't break sheet presentation.

Also modernize the plugin installation buttons and make the catalog
buttons include the plugin list name which should help prevent
duplication.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-24 14:37:52 -04:00

36 lines
832 B
Swift

//
// Plugin.swift
// Ferrite
//
// Created by Brian Dashore on 1/25/23.
//
import CoreData
import Foundation
public protocol Plugin: ObservableObject, NSManagedObject {
var id: UUID { get set }
var listId: UUID? { get set }
var name: String { get set }
var version: Int16 { get set }
var author: String { get set }
var enabled: Bool { get set }
var tags: NSOrderedSet? { get set }
func getTags() -> [PluginTagJson]
}
extension Plugin {
var tagArray: [PluginTag] {
tags?.array as? [PluginTag] ?? []
}
}
public protocol PluginJson: Hashable {
var name: String { get }
var version: Int16 { get }
var author: String? { get }
var listId: UUID? { get }
var listName: String? { get }
var tags: [PluginTagJson]? { get }
func getTags() -> [PluginTagJson]
}