Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ let swiftSettings: [SwiftSetting] = [
let package = Package(
name: "RadiantKit",
platforms: [
.iOS(.v17),
.macCatalyst(.v17),
.macOS(.v14),
.tvOS(.v17),
.iOS(.v15),
.macCatalyst(.v15),
.macOS(.v12),
.tvOS(.v15),
.visionOS(.v1),
.watchOS(.v10)
.watchOS(.v8)
],
products: [
.library(
Expand Down
6 changes: 6 additions & 0 deletions Sources/RadiantDocs/Actions/OpenFileURLAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,24 @@

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

static let defaultValue: OpenFileURLAction = .default
}

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

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

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

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

/// View extension that provides file URL opening functionality.
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
extension View {
/// Configures the view to handle file URL opening.
/// - Parameter closure: A closure that handles the URL opening action,
Expand Down
2 changes: 2 additions & 0 deletions Sources/RadiantDocs/Actions/OpenWindowWithAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
public import SwiftUI

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

/// Extension providing functionality for opening windows without associated
/// values.
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
@MainActor
extension OpenWindowWithAction {
/// Creates a new window opening action with the specified closure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
public import SwiftUI

/// A struct that represents an action to open a window with a given value.
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
public struct OpenWindowWithValueAction<ValueType: Sendable>: Sendable {
/// The default instance of `OpenWindowWithValueAction`.
public static var `default`: Self {
Expand Down
2 changes: 2 additions & 0 deletions Sources/RadiantDocs/AppKit/NewFilePanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import UniformTypeIdentifiers

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

@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
extension OpenWindowAction {
/// Presents a new file panel for a specified file type and
/// opens a window with the created file.
Expand Down
2 changes: 2 additions & 0 deletions Sources/RadiantDocs/AppKit/OpenAnyFilePanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

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

@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
extension OpenFileURLAction {
/// Displays a file panel with the specified file types and
/// calls the provided `OpenFileURLAction` with the selected file URL and the
Expand Down
2 changes: 2 additions & 0 deletions Sources/RadiantDocs/AppKit/OpenFilePanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import UniformTypeIdentifiers

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

@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
extension OpenWindowAction {
/// Calls the `OpenFilePanel` with the provided file type
/// and passes the selected file to the `OpenWindowAction`.
Expand Down
1 change: 1 addition & 0 deletions Sources/RadiantKit/TransformedValueObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
/// An observable class that transforms an input value of type `InputValue` to
/// an output value of type `OutputValue`, and provides a formatted
/// representation of the output value as `FormattableValue`.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
@Observable
public class TransformedValueObject<InputValue, OutputValue, FormattableValue> {
/// The default transformation function from `InputValue` to `OutputValue`.
Expand Down
1 change: 1 addition & 0 deletions Sources/RadiantKit/ViewExtensions/SingleWindowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
}

#if os(macOS) || os(iOS) || os(visionOS)
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
extension WindowGroup {
/// Initializes a new instance of the `WindowGroup` with a single window
/// view.
Expand Down
2 changes: 2 additions & 0 deletions Sources/RadiantKit/Views/GuidedLabeledContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
/// - description: A closure that returns the description view.
///
/// - Returns: A view that presents the labeled content and description.
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
public struct GuidedLabeledContent<
Label: View,
Content: View,
Expand Down Expand Up @@ -70,6 +71,7 @@
}
}

@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
extension GuidedLabeledContent
where Description == GuidedLabeledContentDescriptionView {
/// Initializes a `GuidedLabeledContent` instance with a content view, a
Expand Down
1 change: 1 addition & 0 deletions Sources/RadiantKit/Views/SliderStepperView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
/// - step: The step size for the slider and stepper.
/// - content: A closure that returns a view representing the content of the
/// view.
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
@MainActor
public struct SliderStepperView<Content: View, Label: View, TitleType>: View {
private let title: TitleType
Expand Down
1 change: 1 addition & 0 deletions Sources/RadiantKit/Views/ValueTextBubble.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
public import SwiftUI

/// A SwiftUI view that displays a value with a formatted text bubble.
@available(iOS 15.0, *)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Incomplete availability annotation—specify all relevant platforms.

The availability annotation only specifies iOS 15.0, but this SwiftUI view should be available across multiple Apple platforms. Other files in this PR use comprehensive platform lists (e.g., macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0).

Apply this diff to specify complete availability:

-  @available(iOS 15.0, *)
+  @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)

Note: Adjust the specific version numbers based on which platform APIs this view actually requires (e.g., if it requires FormatStyle features, verify their minimum versions).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@available(iOS 15.0, *)
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
🤖 Prompt for AI Agents
In Sources/RadiantKit/Views/ValueTextBubble.swift around line 37, the @available
annotation currently lists only iOS 15.0; update it to a full multi-platform
availability annotation matching this PR’s conventions (e.g., macOS 13.0, iOS
16.0, watchOS 9.0, tvOS 16.0) or to the correct minimums for any APIs used;
replace the single-platform annotation with the comprehensive list so the view
is correctly gated across all Apple platforms.

public struct ValueTextBubble<
ShapeStyleType: ShapeStyle,
ValueType: Equatable,
Expand Down
1 change: 1 addition & 0 deletions Sources/RadiantKit/Views/VerticalLabelStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
}
}

@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
extension LabeledContentStyle {
/// Creates a vertical label style with the given parameters.
///
Expand Down
2 changes: 2 additions & 0 deletions Sources/RadiantProgress/CopyOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
#if canImport(OSLog)
public import OSLog
#else
public import Logging

Check notice on line 37 in Sources/RadiantProgress/CopyOperation.swift

View check run for this annotation

codefactor.io / CodeFactor

Sources/RadiantProgress/CopyOperation.swift#L37

Imports should be sorted (sorted_imports)
#endif

/// An operation that copies a file from a source URL to a destination URL, and
/// periodically updates the progress of the operation.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
@MainActor
@Observable
public final class CopyOperation<ValueType: BinaryInteger & Sendable>: Identifiable {
Expand Down Expand Up @@ -176,5 +177,6 @@
}
}

@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
extension CopyOperation: ProgressOperation {}
#endif
1 change: 1 addition & 0 deletions Sources/RadiantProgress/DownloadOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

/// A download operation that downloads data from a source URL to a destination
/// URL.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
@MainActor
@Observable
public final class DownloadOperation<ValueType: BinaryInteger & Sendable>: Identifiable,
Expand Down
1 change: 1 addition & 0 deletions Sources/RadiantProgress/FileOperationProgress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public import Foundation
public import Observation

@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
@MainActor
@Observable
public final class FileOperationProgress<ValueType: BinaryInteger>: Identifiable {
Expand Down
1 change: 1 addition & 0 deletions Sources/RadiantProgress/ObservableDownloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

/// An observable downloader class that observes download progress and provides
/// a way to resume downloads.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
@Observable
@MainActor
public final class ObservableDownloader: DownloadObserver, Downloader {
Expand Down
2 changes: 2 additions & 0 deletions Sources/RadiantProgress/ProgressOperationProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public import Foundation

/// A structure that represents the properties of a progress operation.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
public struct ProgressOperationProperties: Identifiable, Sendable {
/// The name of the image associated with the progress operation.
internal let imageName: String
Expand Down Expand Up @@ -65,6 +66,7 @@
}

#if canImport(SwiftUI)
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
extension ProgressOperationView {
/// The properties of a progress operation.
public typealias Properties = ProgressOperationProperties
Expand Down
1 change: 1 addition & 0 deletions Sources/RadiantProgress/ProgressOperationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/// - title: The title of the file operation.
/// - text: A closure that returns a view displaying the progress text.
/// - icon: A closure that returns a view displaying the icon.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
public struct ProgressOperationView<Icon: View, ProgressText: View>: View {
private let progress: FileOperationProgress<Int>
private let title: any StringProtocol
Expand Down
3 changes: 3 additions & 0 deletions Sources/RadiantProgress/SetupPublishers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
/// download publishers for.
/// - Returns: An array of `AnyCancellable` instances representing the
/// subscriptions.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
@MainActor
private func setupDownloadPublsihers(
_ downloader: ObservableDownloader
Expand Down Expand Up @@ -80,6 +81,7 @@
/// byte update publishers for.
/// - Returns: An array of `AnyCancellable` instances representing the
/// subscriptions.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
@MainActor
private func setupByteUpdatPublishers(
_ downloader: ObservableDownloader
Expand Down Expand Up @@ -107,6 +109,7 @@
/// publishers for.
/// - Returns: An array of `AnyCancellable` instances representing the
/// subscriptions.
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
@MainActor
internal func callAsFunction(
downloader: ObservableDownloader
Expand Down
Loading