diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/AudioToolbarButton.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/AudioToolbarButton.swift index d7d961e87..cdd9dbc28 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/AudioToolbarButton.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/AudioToolbarButton.swift @@ -1,4 +1,3 @@ - import Foundation import SwiftUI diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedAudioPlayer.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedAudioPlayer.swift index 89035da24..bf23ae8af 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedAudioPlayer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedAudioPlayer.swift @@ -385,7 +385,10 @@ func playerContent(_: LinkedItemAudioProperties) -> some View { ZStack { WindowLink(level: .alert, transition: .move(edge: .bottom), isPresented: $showSnackbar) { - OperationToast(operationMessage: $snackbarMessage, showOperationToast: $showSnackbar, operationStatus: $operationStatus) + OperationToast( + operationMessage: $snackbarMessage, + showOperationToast: $showSnackbar, + operationStatus: $operationStatus) .offset(y: -90) } label: { EmptyView() diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/Components/LibraryItemFetcher.swift b/apple/OmnivoreKit/Sources/App/Views/Home/Components/LibraryItemFetcher.swift index 6062be93e..aefc9e3c7 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/Components/LibraryItemFetcher.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/Components/LibraryItemFetcher.swift @@ -1,4 +1,3 @@ - import Foundation import CoreData diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/FilterSelectorView.swift b/apple/OmnivoreKit/Sources/App/Views/Home/FilterSelectorView.swift deleted file mode 100644 index 7c5f4b75a..000000000 --- a/apple/OmnivoreKit/Sources/App/Views/Home/FilterSelectorView.swift +++ /dev/null @@ -1,121 +0,0 @@ - -// import Introspect -// import Models -// import Services -// import SwiftUI -// import Views -// -// @MainActor final class FilterSelectorViewModel: NSObject, ObservableObject { -// @Published var isLoading = false -// @Published var errorMessage: String = "" -// @Published var showErrorMessage: Bool = false -// -// func error(_ msg: String) { -// errorMessage = msg -// showErrorMessage = true -// isLoading = false -// } -// } -// -// struct FilterSelectorView: View { -// @ObservedObject var viewModel: HomeFeedViewModel -// @ObservedObject var filterViewModel = FilterByLabelsViewModel() -// @EnvironmentObject var dataService: DataService -// @Environment(\.dismiss) private var dismiss -// -// @State var showLabelsSheet = false -// -// init(viewModel: HomeFeedViewModel) { -// self.viewModel = viewModel -// } -// -// var body: some View { -// Group { -// #if os(iOS) -// List { -// innerBody -// } -// .listStyle(.grouped) -// #elseif os(macOS) -// List { -// innerBody -// } -// .listStyle(.plain) -// #endif -// } -// #if os(iOS) -// .navigationBarTitle("Library") -// .navigationBarTitleDisplayMode(.inline) -// .navigationBarItems(trailing: doneButton) -// #endif -// } -// -// private var innerBody: some View { -// Group { -// Section { -// ForEach(LinkedItemFilter.allCases, id: \.self) { filter in -// HStack { -// Text(filter.displayName) -// .foregroundColor(filterState.appliedFilter == filter.rawValue ? Color.blue : Color.appTextDefault) -// Spacer() -// if filterState.appliedFilter == filter.rawValue { -// Image(systemName: "checkmark") -// .foregroundColor(Color.blue) -// } -// } -// .contentShape(Rectangle()) -// .onTapGesture { -// filterState.appliedFilter = filter.rawValue -// } -// } -// } -// -// Section("Labels") { -// Button( -// action: { -// showLabelsSheet = true -// }, -// label: { -// HStack { -// Text("Select Labels (\(filterState.selectedLabels.count))") -// Spacer() -// Image(systemName: "chevron.right") -// } -// } -// ) -// } -// } -// .sheet(isPresented: $showLabelsSheet) { -// FilterByLabelsView( -// initiallySelected: filterState.selectedLabels, -// initiallyNegated: filterState.negatedLabels -// ) { -// self.filterState.selectedLabels = $0 -// self.filterState.negatedLabels = $1 -// } -// } -// .task { -// await filterViewModel.loadLabels( -// dataService: dataService, -// initiallySelectedLabels: filterState.selectedLabels, -// initiallyNegatedLabels: filterState.negatedLabels -// ) -// } -// } -// -// func isNegated(_ label: LinkedItemLabel) -> Bool { -// filterViewModel.negatedLabels.contains(where: { $0.id == label.id }) -// } -// -// func isSelected(_ label: LinkedItemLabel) -> Bool { -// filterViewModel.selectedLabels.contains(where: { $0.id == label.id }) -// } -// -// var doneButton: some View { -// Button( -// action: { dismiss() }, -// label: { Text("Done") } -// ) -// .disabled(viewModel.isLoading) -// } -// } diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/LibraryAddFeedView.swift b/apple/OmnivoreKit/Sources/App/Views/Home/LibraryAddFeedView.swift index 2e3d9287e..6c4deb2d6 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/LibraryAddFeedView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/LibraryAddFeedView.swift @@ -1,4 +1,3 @@ - import Introspect import Models import Services diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/LibraryAddLinkView.swift b/apple/OmnivoreKit/Sources/App/Views/Home/LibraryAddLinkView.swift index 5a9518dfa..1ee6b9137 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/LibraryAddLinkView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/LibraryAddLinkView.swift @@ -1,4 +1,3 @@ - import Introspect import Models import Services diff --git a/apple/OmnivoreKit/Sources/App/Views/InformationalSnackBar.swift b/apple/OmnivoreKit/Sources/App/Views/InformationalSnackBar.swift index 045e40c20..ad7f70e62 100644 --- a/apple/OmnivoreKit/Sources/App/Views/InformationalSnackBar.swift +++ b/apple/OmnivoreKit/Sources/App/Views/InformationalSnackBar.swift @@ -12,7 +12,7 @@ struct InformationalSnackbar: View { Text(message) } Spacer() - + if let undoAction = self.undoAction { Button(action: { undoAction() diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift index b0015fd07..ee12fd19f 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift @@ -1,4 +1,3 @@ - import Models import Services import SwiftUI diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift index c5a996ea2..326dd246e 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift @@ -60,6 +60,10 @@ struct WebReaderContent { body { -webkit-text-size-adjust: 100%; } + .is-sticky { + right: 15px !important; + bottom: 40px !important; + } diff --git a/apple/OmnivoreKit/Sources/Models/DataModels/PDFItem.swift b/apple/OmnivoreKit/Sources/Models/DataModels/PDFItem.swift index 3b6fcb7bc..9f7cba9b2 100644 --- a/apple/OmnivoreKit/Sources/Models/DataModels/PDFItem.swift +++ b/apple/OmnivoreKit/Sources/Models/DataModels/PDFItem.swift @@ -1,6 +1,5 @@ import CoreData import Foundation -import Models import Utils public struct PDFItem { diff --git a/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift b/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift index 465518fb1..af128dd9b 100644 --- a/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift +++ b/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift @@ -298,10 +298,16 @@ public final class OmnivoreWebView: WKWebView { case #selector(removeSelection): return true case #selector(copy(_:)): return true case #selector(setLabels(_:)): return true + case Selector(("_lookup:")): return (currentMenu == .defaultMenu) case Selector(("_define:")): return (currentMenu == .defaultMenu) case Selector(("_translate:")): return (currentMenu == .defaultMenu) - // case Selector(("_findSelected:")): return (currentMenu == .defaultMenu) + case Selector(("_findSelected:")): return (currentMenu == .defaultMenu) + + case Selector(("lookup:")): return (currentMenu == .defaultMenu) + case Selector(("define:")): return (currentMenu == .defaultMenu) + case Selector(("translate:")): return (currentMenu == .defaultMenu) + case Selector(("findSelected:")): return (currentMenu == .defaultMenu) default: return false } } @@ -371,6 +377,14 @@ public final class OmnivoreWebView: WKWebView { let items: [UIMenuElement] if currentMenu == .defaultMenu { + let autoHighlightEnabled = UserDefaults.standard.value(forKey: UserDefaultKey.enableHighlightOnRelease.rawValue) + if let autoHighlightEnabled = autoHighlightEnabled as? Bool, autoHighlightEnabled { + builder.remove(menu: .standardEdit) + builder.remove(menu: .lookup) + builder.remove(menu: .find) + super.buildMenu(with: builder) + return + } let highlight = UICommand(title: LocalText.genericHighlight, action: #selector(highlightSelection)) items = [highlight, annotate] } else { @@ -380,7 +394,7 @@ public final class OmnivoreWebView: WKWebView { } let omnivore = UIMenu(title: "", options: .displayInline, children: items) - builder.insertSibling(omnivore, beforeMenu: .lookup) + builder.insertSibling(omnivore, afterMenu: .standardEdit) } super.buildMenu(with: builder) diff --git a/apple/OmnivoreKit/Sources/Views/FeedItem/CardUtils.swift b/apple/OmnivoreKit/Sources/Views/FeedItem/CardUtils.swift index defdcd95e..eec6d1ae9 100644 --- a/apple/OmnivoreKit/Sources/Views/FeedItem/CardUtils.swift +++ b/apple/OmnivoreKit/Sources/Views/FeedItem/CardUtils.swift @@ -1,4 +1,3 @@ - import Foundation func cardShouldHideUrl(_ url: String?) -> Bool {