Skip to content

Commit 519bb0f

Browse files
committed
adding support for macOS 12
1 parent febe500 commit 519bb0f

20 files changed

+38
-5
lines changed

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ let swiftSettings: [SwiftSetting] = [
3030
let package = Package(
3131
name: "RadiantKit",
3232
platforms: [
33-
.iOS(.v17),
34-
.macCatalyst(.v17),
35-
.macOS(.v14),
36-
.tvOS(.v17),
33+
.iOS(.v15),
34+
.macCatalyst(.v15),
35+
.macOS(.v12),
36+
.tvOS(.v15),
3737
.visionOS(.v1),
38-
.watchOS(.v10)
38+
.watchOS(.v8)
3939
],
4040
products: [
4141
.library(

Sources/RadiantDocs/Actions/OpenFileURLAction.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,24 @@
3535

3636
/// A private environment key for storing the `OpenFileURLAction` in the
3737
/// environment.
38+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
3839
private struct OpenFileURLKey: EnvironmentKey, Sendable {
3940
typealias Value = OpenFileURLAction
4041

4142
static let defaultValue: OpenFileURLAction = .default
4243
}
4344

4445
/// A type alias for opening windows with URL values.
46+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4547
public typealias OpenWindowURLAction = OpenWindowWithValueAction<URL>
4648

4749
/// A type alias for opening files with URLs.
50+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4851
public typealias OpenFileURLAction = OpenWindowURLAction
4952

5053
/// Environment values extension that provides access to the file URL opening
5154
/// action.
55+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
5256
extension EnvironmentValues {
5357
/// The action used to open file URLs in the current environment.
5458
public var openFileURL: OpenFileURLAction {
@@ -58,6 +62,7 @@
5862
}
5963

6064
/// Scene extension that provides file URL opening functionality.
65+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
6166
extension Scene {
6267
/// Configures the scene to handle file URL opening.
6368
/// - Parameter closure: A closure that handles the URL opening action,
@@ -69,6 +74,7 @@
6974
}
7075

7176
/// View extension that provides file URL opening functionality.
77+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
7278
extension View {
7379
/// Configures the view to handle file URL opening.
7480
/// - Parameter closure: A closure that handles the URL opening action,

Sources/RadiantDocs/Actions/OpenWindowWithAction.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@
3535
public import SwiftUI
3636

3737
/// A type alias for opening windows without an associated value.
38+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
3839
public typealias OpenWindowWithAction = OpenWindowWithValueAction<Void>
3940

4041
/// Extension providing functionality for opening windows without associated
4142
/// values.
43+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4244
@MainActor
4345
extension OpenWindowWithAction {
4446
/// Creates a new window opening action with the specified closure.

Sources/RadiantDocs/Actions/OpenWindowWithValueAction.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
public import SwiftUI
3636

3737
/// A struct that represents an action to open a window with a given value.
38+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
3839
public struct OpenWindowWithValueAction<ValueType: Sendable>: Sendable {
3940
/// The default instance of `OpenWindowWithValueAction`.
4041
public static var `default`: Self {

Sources/RadiantDocs/AppKit/NewFilePanel.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import UniformTypeIdentifiers
3838

3939
/// A struct that represents a new file panel for a specific file type.
40+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4041
public struct NewFilePanel<FileType: InitializableFileTypeSpecification>: Sendable {
4142
/// Initializes a new instance of `NewFilePanel`.
4243
public init() {}
@@ -73,6 +74,7 @@
7374
}
7475
}
7576

77+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
7678
extension OpenWindowAction {
7779
/// Presents a new file panel for a specified file type and
7880
/// opens a window with the created file.

Sources/RadiantDocs/AppKit/OpenAnyFilePanel.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
/// A struct that provides a convenient way
4040
/// to open a file panel and handle the selected file.
41+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4142
public struct OpenAnyFilePanel {
4243
/// The file types that the file panel should allow.
4344
private let fileTypes: [FileType]
@@ -78,6 +79,7 @@
7879
}
7980
}
8081

82+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
8183
extension OpenFileURLAction {
8284
/// Displays a file panel with the specified file types and
8385
/// calls the provided `OpenFileURLAction` with the selected file URL and the

Sources/RadiantDocs/AppKit/OpenFilePanel.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import UniformTypeIdentifiers
3838

3939
/// A struct that represents an open file panel for a specific file type.
40+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4041
public struct OpenFilePanel<FileType: FileTypeSpecification>: Sendable {
4142
/// Initializes a new instance of the `OpenFilePanel` struct.
4243
public init() {}
@@ -69,6 +70,7 @@
6970
}
7071
}
7172

73+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
7274
extension OpenWindowAction {
7375
/// Calls the `OpenFilePanel` with the provided file type
7476
/// and passes the selected file to the `OpenWindowAction`.

Sources/RadiantKit/TransformedValueObject.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
/// An observable class that transforms an input value of type `InputValue` to
3636
/// an output value of type `OutputValue`, and provides a formatted
3737
/// representation of the output value as `FormattableValue`.
38+
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
3839
@Observable
3940
public class TransformedValueObject<InputValue, OutputValue, FormattableValue> {
4041
/// The default transformation function from `InputValue` to `OutputValue`.

Sources/RadiantKit/ViewExtensions/SingleWindowView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
}
6363

6464
#if os(macOS) || os(iOS) || os(visionOS)
65+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
6566
extension WindowGroup {
6667
/// Initializes a new instance of the `WindowGroup` with a single window
6768
/// view.

Sources/RadiantKit/Views/GuidedLabeledContent.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
/// - description: A closure that returns the description view.
4444
///
4545
/// - Returns: A view that presents the labeled content and description.
46+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4647
public struct GuidedLabeledContent<
4748
Label: View,
4849
Content: View,
@@ -70,6 +71,7 @@
7071
}
7172
}
7273

74+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
7375
extension GuidedLabeledContent
7476
where Description == GuidedLabeledContentDescriptionView {
7577
/// Initializes a `GuidedLabeledContent` instance with a content view, a

0 commit comments

Comments
 (0)