Sources/OrgstarWidgets/OrgstarWidgets.swift
37 lines · 1017 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 FlashcardWidget()
23 #if os(iOS)
24 CaptureWidget()
25 ClockActivityWidget()
26 CaptureControl()
27 ClockControl()
28 #endif
29 }
30}
31
32#if os(iOS)
33/// The App Intents OrgApp declares: the Live Activity's Clock Out button.
34struct OrgstarWidgetIntents: AppIntentsPackage {
35 static var includedPackages: [any AppIntentsPackage.Type] { [OrgAppIntents.self] }
36}
37#endif