Sources/OrgstarWidgets/OrgstarWidgets.swift

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

36 lines · 991 bytes

 1import AppIntents
 2import OrgApp
 3import SwiftUI
 4import WidgetKit
 5
 6/// The agenda and habits on the Home Screen and the Lock Screen, capture and the clock in
 7/// Control Center, and the running clock's Live Activity; on the Mac, the agenda and habits on
 8/// the desktop and in Notification Center.
 9@main
10struct OrgstarWidgets: WidgetBundle {
11    #if APPSTORE
12    /// The App Store app writes the widgets' data to the app group's container.
13    init() {
14        AgendaSnapshot.useGroupContainer = true
15    }
16    #endif
17
18    var body: some Widget {
19        TodayWidget()
20        HabitsWidget()
21        UpNextWidget()
22        #if os(iOS)
23        CaptureWidget()
24        ClockActivityWidget()
25        CaptureControl()
26        ClockControl()
27        #endif
28    }
29}
30
31#if os(iOS)
32/// The App Intents OrgApp declares: the Live Activity's Clock Out button.
33struct OrgstarWidgetIntents: AppIntentsPackage {
34    static var includedPackages: [any AppIntentsPackage.Type] { [OrgAppIntents.self] }
35}
36#endif