diff --git a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved index 0667008b4..5090a25ab 100644 --- a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -153,15 +153,6 @@ "version" : "2.1.0" } }, - { - "identity" : "pspdfkit-sp", - "kind" : "remoteSourceControl", - "location" : "https://github.com/PSPDFKit/PSPDFKit-SP", - "state" : { - "branch" : "master", - "revision" : "e9757beadad1b30de84073d3c33c1cd0f7a94b80" - } - }, { "identity" : "sovran-swift", "kind" : "remoteSourceControl", diff --git a/apple/OmnivoreKit/Package.swift b/apple/OmnivoreKit/Package.swift index f5ef78249..58f0d3de0 100644 --- a/apple/OmnivoreKit/Package.swift +++ b/apple/OmnivoreKit/Package.swift @@ -56,7 +56,7 @@ let package = Package( var appPackageDependencies: [Target.Dependency] { var deps: [Target.Dependency] = ["Views", "Services", "Models", "Utils"] // #if canImport(UIKit) - deps.append(.product(name: "PSPDFKit", package: "PSPDFKit-SP")) +// deps.append(.product(name: "PSPDFKit", package: "PSPDFKit-SP")) // #endif return deps } @@ -70,7 +70,7 @@ var dependencies: [Package.Dependency] { .package(url: "https://github.com/google/GoogleSignIn-iOS", from: "6.2.2") ] // #if canImport(UIKit) - deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", branch: "master")) +// deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", branch: "master")) // #endif return deps } diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift index bb27f01c8..3e34d3d41 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift @@ -205,7 +205,9 @@ struct ApplyLabelsListView: View { Section( content: { SearchBar(searchTerm: $viewModel.labelSearchFilter, horizontalPadding: 0) + #if os(iOS) .listRowSeparator(.hidden) + #endif }, header: { Text("Apply Labels") @@ -213,7 +215,9 @@ struct ApplyLabelsListView: View { .foregroundColor(.appGrayText) } ) - .listRowSeparator(.hidden) + #if os(iOS) + .listRowSeparator(.hidden) + #endif Section { ForEach(viewModel.labels.applySearchFilter(viewModel.labelSearchFilter), id: \.self) { label in Button( @@ -242,7 +246,9 @@ struct ApplyLabelsListView: View { .contentShape(Rectangle()) } ) - .listRowSeparator(.hidden) + #if os(iOS) + .listRowSeparator(.hidden) + #endif .buttonStyle(PlainButtonStyle()) } } diff --git a/apple/OmnivoreKit/Sources/Utils/ColorUtils.swift b/apple/OmnivoreKit/Sources/Utils/ColorUtils.swift index 8ba7298a4..f9d314e72 100644 --- a/apple/OmnivoreKit/Sources/Utils/ColorUtils.swift +++ b/apple/OmnivoreKit/Sources/Utils/ColorUtils.swift @@ -99,32 +99,60 @@ public extension Color { } static func lighten(color: Color, by percentage: CGFloat) -> Color { - if let lightenedUIColor = UIColor(color).adjust(by: abs(percentage)) { - return Color(lightenedUIColor) + #if os(iOS) + let lightenedColor = UIColor(color).adjust(by: abs(percentage)) + #else + let lightenedColor = NSColor(color).adjust(by: abs(percentage)) + #endif + if let lightenedColor = lightenedColor { + return Color(lightenedColor) } else { return color } } } -extension UIColor { - func lighter(by percentage: CGFloat = 30.0) -> UIColor? { - adjust(by: abs(percentage)) - } +#if os(iOS) + extension UIColor { + func lighter(by percentage: CGFloat = 30.0) -> UIColor? { + adjust(by: abs(percentage)) + } - func darker(by percentage: CGFloat = 30.0) -> UIColor? { - adjust(by: -1 * abs(percentage)) - } + func darker(by percentage: CGFloat = 30.0) -> UIColor? { + adjust(by: -1 * abs(percentage)) + } - func adjust(by percentage: CGFloat = 30.0) -> UIColor? { - var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0 - if getRed(&red, green: &green, blue: &blue, alpha: &alpha) { - return UIColor(red: min(red + percentage / 100, 1.0), + func adjust(by percentage: CGFloat = 30.0) -> UIColor? { + var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0 + if getRed(&red, green: &green, blue: &blue, alpha: &alpha) { + return UIColor(red: min(red + percentage / 100, 1.0), + green: min(green + percentage / 100, 1.0), + blue: min(blue + percentage / 100, 1.0), + alpha: alpha) + } else { + return nil + } + } + } +#endif + +#if os(macOS) + extension NSColor { + func lighter(by percentage: CGFloat = 30.0) -> NSColor? { + adjust(by: abs(percentage)) + } + + func darker(by percentage: CGFloat = 30.0) -> NSColor? { + adjust(by: -1 * abs(percentage)) + } + + func adjust(by percentage: CGFloat = 30.0) -> NSColor? { + var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0 + getRed(&red, green: &green, blue: &blue, alpha: &alpha) + return NSColor(red: min(red + percentage / 100, 1.0), green: min(green + percentage / 100, 1.0), blue: min(blue + percentage / 100, 1.0), alpha: alpha) - } else { - return nil } } -} +#endif diff --git a/apple/Sources/ShareExtension/ShareExtensionViewController.swift b/apple/Sources/ShareExtension/ShareExtensionViewController.swift index e0770c439..06021accd 100644 --- a/apple/Sources/ShareExtension/ShareExtensionViewController.swift +++ b/apple/Sources/ShareExtension/ShareExtensionViewController.swift @@ -22,7 +22,7 @@ import Utils class ShareViewController: NSViewController { override func loadView() { - view = NSView(frame: NSRect(x: 0, y: 0, width: 400, height: 200)) + view = NSView(frame: NSRect(x: 0, y: 0, width: 400, height: 600)) } override func viewDidLoad() {