diff --git a/apple/Makefile b/apple/Makefile index 4a35936ca..0da5b7797 100644 --- a/apple/Makefile +++ b/apple/Makefile @@ -7,4 +7,5 @@ graphql_gen: extension_gen: pushd ../pkg/extension/ && yarn build-prod && popd cp -r ../pkg/extension/dist/* Sources/SafariExtension/Resources/. + mv Sources/SafariExtension/Resources/images/extension-transparent/* Sources/SafariExtension/Resources/images/extension/. cat ../pkg/extension/dist/manifest.json | jq '.background.persistent = false' | jq '.permissions = ["activeTab", "storage", "nativeMessaging", "https://*/**", "http://*/**"]' > Sources/SafariExtension/Resources/manifest.json \ No newline at end of file diff --git a/apple/Omnivore.xcodeproj/project.pbxproj b/apple/Omnivore.xcodeproj/project.pbxproj index 1d4522b28..0bb3b1f69 100644 --- a/apple/Omnivore.xcodeproj/project.pbxproj +++ b/apple/Omnivore.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ 042F48DC26DFD10E00BF98FC /* iOSLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042F48DB26DFD10E00BF98FC /* iOSLaunchTests.swift */; }; 045B1681279147E7005047F7 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 045B1680279147E7005047F7 /* FirebaseMessaging */; }; 0465B9BE26CDD35F005558CD /* MainApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81BE98F0CB588F5FC577A13 /* MainApp.swift */; }; - 046C5CD526A3F89A00AC5349 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 046C5CD426A3F89A00AC5349 /* icon.icns */; }; 046C5CDF26A3F89A00AC5349 /* ShareExtension-Mac.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 046C5CD226A3F89A00AC5349 /* ShareExtension-Mac.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 046C5CE626A3FE8C00AC5349 /* App in Frameworks */ = {isa = PBXBuildFile; productRef = 046C5CE526A3FE8C00AC5349 /* App */; }; 047AD6F22724C934004FD5CF /* App in Frameworks */ = {isa = PBXBuildFile; productRef = 047AD6F12724C934004FD5CF /* App */; }; @@ -34,12 +33,8 @@ 260BBE4168E3C57D6D2E225D /* App in Frameworks */ = {isa = PBXBuildFile; productRef = 7DD0EF4D497D71D248C7B0DF /* App */; }; 4214F6EF2714D2260096B644 /* SafariExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 42FF1B16271154A700B38C38 /* SafariExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 4214F6F22714D28E0096B644 /* SafariExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 42FF1B20271154A700B38C38 /* SafariExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 4225D59227164F82002A680F /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 4225D59127164F82002A680F /* fonts */; }; - 4225D59327164F82002A680F /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 4225D59127164F82002A680F /* fonts */; }; 42321E852714E6B00056429F /* scripts in Resources */ = {isa = PBXBuildFile; fileRef = 42321E822714E6B00056429F /* scripts */; }; 42321E862714E6B00056429F /* scripts in Resources */ = {isa = PBXBuildFile; fileRef = 42321E822714E6B00056429F /* scripts */; }; - 42321E872714E6B00056429F /* styles in Resources */ = {isa = PBXBuildFile; fileRef = 42321E832714E6B00056429F /* styles */; }; - 42321E882714E6B00056429F /* styles in Resources */ = {isa = PBXBuildFile; fileRef = 42321E832714E6B00056429F /* styles */; }; 42321E892714E6B00056429F /* views in Resources */ = {isa = PBXBuildFile; fileRef = 42321E842714E6B00056429F /* views */; }; 42321E8A2714E6B00056429F /* views in Resources */ = {isa = PBXBuildFile; fileRef = 42321E842714E6B00056429F /* views */; }; 42704E7328E6BDB000C8C73E /* SnapshotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42704E7228E6BDAF00C8C73E /* SnapshotHelper.swift */; }; @@ -192,7 +187,6 @@ 042F48DB26DFD10E00BF98FC /* iOSLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSLaunchTests.swift; sourceTree = ""; }; 042F48DD26DFD10E00BF98FC /* iOSUITests.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = iOSUITests.plist; sourceTree = ""; }; 046C5CD226A3F89A00AC5349 /* ShareExtension-Mac.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "ShareExtension-Mac.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; - 046C5CD426A3F89A00AC5349 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = ""; }; 046C5CDB26A3F89A00AC5349 /* ShareExtensionMac.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = ShareExtensionMac.plist; sourceTree = ""; }; 046C5CDC26A3F89A00AC5349 /* ShareExtensionMac.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShareExtensionMac.entitlements; sourceTree = ""; }; 047AA41F297A17FB00F0BEBF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = ""; }; @@ -215,9 +209,7 @@ 082449FB9F5F3730EE0D8D3F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 0BE7F7C593222747A96AA4E7 /* Omnivore.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Omnivore.plist; sourceTree = ""; }; 1A39D8FDA25447FDBF07E24B /* Omnivore.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Omnivore.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 4225D59127164F82002A680F /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = ""; }; 42321E822714E6B00056429F /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scripts; sourceTree = ""; }; - 42321E832714E6B00056429F /* styles */ = {isa = PBXFileReference; lastKnownFileType = folder; path = styles; sourceTree = ""; }; 42321E842714E6B00056429F /* views */ = {isa = PBXFileReference; lastKnownFileType = folder; path = views; sourceTree = ""; }; 42704E7228E6BDAF00C8C73E /* SnapshotHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SnapshotHelper.swift; sourceTree = ""; }; 42E2BFB128E458E0007F29B2 /* AppStoreScreenshots.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppStoreScreenshots.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -473,9 +465,7 @@ 42FF1AEC271154A600B38C38 /* Resources */ = { isa = PBXGroup; children = ( - 4225D59127164F82002A680F /* fonts */, 42321E822714E6B00056429F /* scripts */, - 42321E832714E6B00056429F /* styles */, 42321E842714E6B00056429F /* views */, 42FF1AED271154A600B38C38 /* _locales */, 42FF1AEE271154A600B38C38 /* images */, @@ -511,7 +501,6 @@ B330B55BAF36E624637EE3BE /* ShareExtension */ = { isa = PBXGroup; children = ( - 046C5CD426A3F89A00AC5349 /* icon.icns */, FF9F2334402E6B10A665F1A7 /* ShareExtensionViewController.swift */, 04E9706E26BDE47D002A523D /* ShareExtension.js */, ); @@ -878,7 +867,6 @@ buildActionMask = 2147483647; files = ( 04E9707226BDE5F1002A523D /* ShareExtension.js in Resources */, - 046C5CD526A3F89A00AC5349 /* icon.icns in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -909,9 +897,7 @@ buildActionMask = 2147483647; files = ( 42321E892714E6B00056429F /* views in Resources */, - 42321E872714E6B00056429F /* styles in Resources */, 42321E852714E6B00056429F /* scripts in Resources */, - 4225D59227164F82002A680F /* fonts in Resources */, 42FF1B37271154A700B38C38 /* images in Resources */, 42FF1B39271154A700B38C38 /* manifest.json in Resources */, 42FF1B35271154A700B38C38 /* _locales in Resources */, @@ -923,9 +909,7 @@ buildActionMask = 2147483647; files = ( 42321E8A2714E6B00056429F /* views in Resources */, - 42321E882714E6B00056429F /* styles in Resources */, 42321E862714E6B00056429F /* scripts in Resources */, - 4225D59327164F82002A680F /* fonts in Resources */, 42FF1B38271154A700B38C38 /* images in Resources */, 42FF1B3A271154A700B38C38 /* manifest.json in Resources */, 42FF1B36271154A700B38C38 /* _locales in Resources */, diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/AddNoteSheet.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/AddNoteSheet.swift index f9a0bd759..54d487dcf 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/AddNoteSheet.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/AddNoteSheet.swift @@ -24,7 +24,9 @@ public struct AddNoteSheet: View { public init(viewModel: ShareExtensionViewModel) { _viewModel = StateObject(wrappedValue: viewModel) - UITextView.appearance().textContainerInset = UIEdgeInsets(top: 8, left: 4, bottom: 10, right: 4) + #if os(iOS) + UITextView.appearance().textContainerInset = UIEdgeInsets(top: 8, left: 4, bottom: 10, right: 4) + #endif } func saveNote() { @@ -41,6 +43,7 @@ public struct AddNoteSheet: View { } .background(Color.extensionBackground) .navigationTitle("Add Note") + #if os(iOS) .navigationBarTitleDisplayMode(.inline) .navigationBarItems(leading: Button(action: { dismiss() @@ -53,6 +56,10 @@ public struct AddNoteSheet: View { }, label: { Text("Save").bold() })) - }.navigationViewStyle(StackNavigationViewStyle()) + #endif + } + #if os(iOS) + .navigationViewStyle(StackNavigationViewStyle()) + #endif } } diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/EditInfoSheet.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/EditInfoSheet.swift index 45dea726b..c7d315a85 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/EditInfoSheet.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/EditInfoSheet.swift @@ -26,17 +26,11 @@ public struct EditInfoSheet: View { public init(viewModel: ShareExtensionViewModel) { _viewModel = StateObject(wrappedValue: viewModel) - UITextView.appearance().textContainerInset = UIEdgeInsets(top: 8, left: 4, bottom: 10, right: 4) + #if os(iOS) + UITextView.appearance().textContainerInset = UIEdgeInsets(top: 8, left: 4, bottom: 10, right: 4) + #endif } -// func saveInfo() { -// if let linkedItem = viewModel.linkedItem { -// _ = viewModel.services.dataService.updateLinkedItemTitleAndDescription(itemID: linkedItem.unwrappedID, title: title, description: description, author: author) -// } else { -// // Maybe we shouldn't even allow this UI without linkeditem existing -// } -// } - public var body: some View { if let item = viewModel.linkedItem { LinkedItemMetadataEditView(item: item) { title, _ in diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/EditLabelsSheet.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/EditLabelsSheet.swift index a39547606..efd5b5386 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/EditLabelsSheet.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/EditLabelsSheet.swift @@ -14,6 +14,7 @@ import Views @MainActor public struct EditLabelsSheet: View { @State var text = "" + @State var isLabelsEntryFocused = false @Environment(\.dismiss) private var dismiss @EnvironmentObject var dataService: DataService @@ -29,8 +30,9 @@ public struct EditLabelsSheet: View { public init(viewModel: ShareExtensionViewModel, labelsViewModel: LabelsViewModel) { _viewModel = StateObject(wrappedValue: viewModel) _labelsViewModel = StateObject(wrappedValue: labelsViewModel) - - UITextView.appearance().textContainerInset = UIEdgeInsets(top: 5, left: 2, bottom: 5, right: 2) + #if os(iOS) + UITextView.appearance().textContainerInset = UIEdgeInsets(top: 5, left: 2, bottom: 5, right: 2) + #endif } @MainActor @@ -55,6 +57,7 @@ public struct EditLabelsSheet: View { VStack { LabelsEntryView( searchTerm: $labelsViewModel.labelSearchFilter, + isFocused: $isLabelsEntryFocused, viewModel: labelsViewModel ) .padding(.horizontal, 10) @@ -95,7 +98,9 @@ public struct EditLabelsSheet: View { } .listStyle(.plain) .background(Color.extensionBackground) - } + + Spacer() + }.frame(maxHeight: .infinity) } public var body: some View { @@ -104,6 +109,7 @@ public struct EditLabelsSheet: View { .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.extensionBackground) .navigationTitle("Set Labels") + #if os(iOS) .navigationBarTitleDisplayMode(.inline) .navigationBarItems(trailing: Button(action: { if let linkedItem = viewModel.linkedItem, let linkedItemId = linkedItem.id { @@ -116,11 +122,14 @@ public struct EditLabelsSheet: View { }, label: { Text("Done").bold() })) + #endif } - .navigationViewStyle(StackNavigationViewStyle()) + #if os(iOS) + .navigationViewStyle(StackNavigationViewStyle()) + #endif .environmentObject(viewModel.services.dataService) - .task { - await labelsViewModel.loadLabelsFromStore(dataService: viewModel.services.dataService) - } + .task { + await labelsViewModel.loadLabelsFromStore(dataService: viewModel.services.dataService) + } } } diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/MiniShareExtensionView.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/MiniShareExtensionView.swift index 4095e3645..44b6e00ba 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/MiniShareExtensionView.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/MiniShareExtensionView.swift @@ -9,6 +9,8 @@ import Foundation import SwiftUI struct MiniShareExtensionView: View { + @StateObject var viewModel: ShareExtensionViewModel + @StateObject var labelsViewModel: LabelsViewModel let extensionContext: NSExtensionContext? @State var showToast = true diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift index 2c5f7f2a9..84232e33d 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift @@ -20,7 +20,8 @@ public struct ShareExtensionView: View { @State var showAddNoteModal = false enum FocusField: Hashable { - case titleEditor + case noteEditor + case labelEditor } enum ViewState { @@ -39,6 +40,10 @@ public struct ShareExtensionView: View { _viewModel = StateObject(wrappedValue: viewModel) _labelsViewModel = StateObject(wrappedValue: labelsViewModel) self.extensionContext = extensionContext + + #if os(iOS) + UITextView.appearance().textContainerInset = UIEdgeInsets(top: 8, left: 4, bottom: 10, right: 4) + #endif } private func localImage(from url: URL) -> Image? { @@ -100,7 +105,7 @@ public struct ShareExtensionView: View { Image(systemName: "checkmark.circle") .frame(width: 15, height: 15) .foregroundColor(.appGreenSuccess) - // .opacity(isSynced ? 1.0 : 0.0) + .opacity(isSynced ? 1.0 : 0.0) } } @@ -160,14 +165,16 @@ public struct ShareExtensionView: View { var moreMenuButton: some View { Menu { - Button(action: { - NotificationCenter.default.post(name: Notification.Name("ShowEditInfoSheet"), object: nil) - }, label: { - Label( - "Edit Info", - systemImage: "info.circle" - ) - }) + #if os(iOS) + Button(action: { + NotificationCenter.default.post(name: Notification.Name("ShowEditInfoSheet"), object: nil) + }, label: { + Label( + "Edit Info", + systemImage: "info.circle" + ) + }) + #endif Button(action: { if let linkedItem = self.viewModel.linkedItem { self.viewModel.setLinkArchived(dataService: self.viewModel.services.dataService, @@ -237,14 +244,34 @@ public struct ShareExtensionView: View { Text("Saved to Omnivore") .font(Font.system(size: 22, weight: .bold)) .frame(maxWidth: .infinity, alignment: .leading) - - Spacer() - moreMenuButton - closeButton + #if os(iOS) + Spacer() + moreMenuButton + closeButton + #endif } } + var displayDismiss: Bool { + #if os(iOS) + if UIDevice.isIPhone { + return false + } + #endif + return true + } + public var body: some View { + #if os(iOS) + iOSBody + .environmentObject(viewModel.services.dataService) + #else + macOSBody + .environmentObject(viewModel.services.dataService) + #endif + } + + var iOSBody: some View { VStack(alignment: .leading, spacing: 15) { titleBar .padding(.top, 15) @@ -254,32 +281,44 @@ public struct ShareExtensionView: View { Spacer(minLength: 1) HStack { + #if os(macOS) + moreMenuButton + .padding(.bottom, 15) + #endif Spacer() - if UIDevice.isIPad { + if displayDismiss { Button(action: { extensionContext?.completeRequest(returningItems: [], completionHandler: nil) }, label: { Text("Dismiss") + #if os(iOS) .font(Font.system(size: 17, weight: .semibold)) .tint(Color.appGrayText) .padding(20) + #endif }) + #if os(iOS) .frame(height: 50) .cornerRadius(24) - .padding(.bottom, 15) + #endif + .padding(.bottom, 15) } Button(action: { viewModel.handleReadNowAction(extensionContext: extensionContext) }, label: { Text("Read Now") + #if os(iOS) .font(Font.system(size: 17, weight: .semibold)) .tint(Color.white) .padding(20) + #endif }) + #if os(iOS) .frame(height: 50) .background(Color.blue) .cornerRadius(24) - .padding(.bottom, 15) + #endif + .padding(.bottom, 15) }.frame(maxWidth: .infinity) }.padding(.horizontal, 15) .background(Color.extensionBackground) @@ -287,4 +326,108 @@ public struct ShareExtensionView: View { viewModel.savePage(extensionContext: extensionContext) } } + + @State var labelsSearch = ZWSP + @State var isLabelsEntryFocused = false + + func save() { + if !viewModel.noteText.isEmpty { + viewModel.saveNote() + } + if let itemID = viewModel.linkedItem?.id { + labelsViewModel.saveItemLabelChanges(itemID: itemID, dataService: viewModel.services.dataService) + } + } + + var macOSBody: some View { + VStack(alignment: .leading, spacing: 0) { + HStack(spacing: 10) { + Text("Saved to Omnivore") + .font(Font.system(size: 17)) + Image(systemName: "checkmark.circle") + .foregroundColor(.appGreenSuccess) + .opacity(isSynced ? 1.0 : 0.0) + Spacer() + }.padding(15) + + Divider() + + ZStack(alignment: .topLeading) { + TextEditor(text: $viewModel.noteText) + .frame(maxWidth: .infinity) + .font(Font.system(size: 14)) + .accentColor(.blue) + #if os(macos) + .introspectTextView { textView in + textView.textContainerInset = NSSize(width: 10, height: 10) + } + #endif + .focused($focusedField, equals: .noteEditor) + if viewModel.noteText.isEmpty { + Text("Notes") + .fontWeight(.light) + .font(Font.system(size: 14)) + .foregroundColor(.black.opacity(0.25)) + .padding(.leading, 15) + .padding(.top, 10) + .allowsHitTesting(false) + } + } + + Divider() + + ZStack(alignment: .topLeading) { + LabelsEntryView(searchTerm: $labelsSearch, isFocused: $isLabelsEntryFocused, viewModel: labelsViewModel) + .frame(maxWidth: .infinity) + .padding(.horizontal, 8) + .focused($focusedField, equals: .labelEditor) + + if labelsViewModel.selectedLabels.isEmpty, labelsSearch == ZWSP { + Text("Type to add labels") + .fontWeight(.light) + .font(Font.system(size: 14)) + .foregroundColor(.black.opacity(0.25)) + .padding(.leading, 15) + .padding(.top, 10) + .allowsHitTesting(false) + } + } + + Divider() + + HStack { + moreMenuButton + .padding(.bottom, 15) + Spacer() + Button(action: { + save() + extensionContext?.completeRequest(returningItems: [], completionHandler: nil) + }, label: { + Text("Dismiss") + }) + .padding(.bottom, 15) + Button(action: { + save() + viewModel.handleReadNowAction(extensionContext: extensionContext) + }, label: { + Text("Read Now") + }) + .padding(.bottom, 15) + + }.padding(15) + + }.frame(maxWidth: .infinity) + .background(Color.isDarkMode ? Color.systemBackground : Color.white) + .onAppear { + if let extensionContext = extensionContext { + viewModel.savePage(extensionContext: extensionContext) + } + DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { + focusedField = .labelEditor + } + Task { + await labelsViewModel.loadLabels(dataService: viewModel.services.dataService, initiallySelectedLabels: []) + } + } + } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift index 482d2f191..e96127e08 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewMac.swift @@ -106,7 +106,6 @@ import Views .contextMenu { menuItems(item) } - Divider().padding(5) } if viewModel.isLoading { diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift index b259cdbf0..409955170 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift @@ -36,6 +36,7 @@ struct ApplyLabelsView: View { @EnvironmentObject var dataService: DataService @Environment(\.presentationMode) private var presentationMode @StateObject var viewModel = LabelsViewModel() + @State var isLabelsEntryFocused = false enum ViewState { case mainView @@ -52,6 +53,7 @@ struct ApplyLabelsView: View { VStack { LabelsEntryView( searchTerm: $viewModel.labelSearchFilter, + isFocused: $isLabelsEntryFocused, viewModel: viewModel ) .padding(.horizontal, 10) @@ -62,67 +64,60 @@ struct ApplyLabelsView: View { } List { - Section { - ForEach(viewModel.labels.applySearchFilter(viewModel.labelSearchFilter), id: \.self) { label in - Button( - action: { - if isSelected(label) { - if let idx = viewModel.selectedLabels.firstIndex(of: label) { - viewModel.selectedLabels.remove(at: idx) - } - } else { - viewModel.labelSearchFilter = ZWSP - viewModel.selectedLabels.append(label) + ForEach(viewModel.labels.applySearchFilter(viewModel.labelSearchFilter), id: \.self) { label in + Button( + action: { + if isSelected(label) { + if let idx = viewModel.selectedLabels.firstIndex(of: label) { + viewModel.selectedLabels.remove(at: idx) } - }, - label: { - HStack { - TextChip(feedItemLabel: label).allowsHitTesting(false) - Spacer() - if isSelected(label) { - Image(systemName: "checkmark") - } - } - .contentShape(Rectangle()) + } else { + viewModel.labelSearchFilter = ZWSP + viewModel.selectedLabels.append(label) } - ) - .padding(.vertical, 5) - .frame(maxWidth: .infinity, alignment: .leading) - #if os(macOS) - .buttonStyle(PlainButtonStyle()) - #endif - } + }, + label: { + HStack { + TextChip(feedItemLabel: label).allowsHitTesting(false) + Spacer() + if isSelected(label) { + Image(systemName: "checkmark") + } + } + .contentShape(Rectangle()) + } + ) + .padding(.vertical, 5) + .frame(maxWidth: .infinity, alignment: .leading) + #if os(macOS) + .buttonStyle(PlainButtonStyle()) + #endif + } + if !viewModel.labelSearchFilter.isEmpty, viewModel.labelSearchFilter != ZWSP { createLabelButton } } .listStyle(.plain) .background(Color.extensionBackground) - - Spacer() + .frame(maxHeight: .infinity) } .navigationTitle(mode.navTitle) .background(Color.extensionBackground) - #if os(iOS) - .navigationBarTitleDisplayMode(.inline) - .toolbar { - ToolbarItem(placement: .navigationBarLeading) { - cancelButton - } - ToolbarItem(placement: .navigationBarTrailing) { - saveItemChangesButton - } - } - #else - .toolbar { - ToolbarItemGroup { - cancelButton - saveItemChangesButton - } - } - #endif .sheet(isPresented: $viewModel.showCreateLabelModal) { CreateLabelView(viewModel: viewModel, newLabelName: viewModel.labelSearchFilter) } + .onAppear { + Task { + switch mode { + case let .item(feedItem): + await viewModel.loadLabels(dataService: dataService, item: feedItem) + case let .highlight(highlight): + await viewModel.loadLabels(dataService: dataService, highlight: highlight) + case let .list(labels): + await viewModel.loadLabels(dataService: dataService, initiallySelectedLabels: labels) + } + } + } } var createLabelButton: some View { @@ -176,32 +171,29 @@ struct ApplyLabelsView: View { } var body: some View { - Group { - #if os(iOS) - NavigationView { - if viewModel.labels.isEmpty, viewModel.isLoading { - EmptyView() - } else { - innerBody + #if os(iOS) + NavigationView { + innerBody + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .navigationBarLeading) { + cancelButton + } + ToolbarItem(placement: .navigationBarTrailing) { + saveItemChangesButton + } + } + } + #elseif os(macOS) + innerBody + .toolbar { + ToolbarItemGroup { + cancelButton + saveItemChangesButton } } - #elseif os(macOS) - innerBody - .frame(minWidth: 400, minHeight: 600) - #endif - } - .onAppear { - Task { - switch mode { - case let .item(feedItem): - await viewModel.loadLabels(dataService: dataService, item: feedItem) - case let .highlight(highlight): - await viewModel.loadLabels(dataService: dataService, highlight: highlight) - case let .list(labels): - await viewModel.loadLabels(dataService: dataService, initiallySelectedLabels: labels) - } - } - } + .frame(minWidth: 400, minHeight: 600) + #endif } } @@ -210,8 +202,11 @@ extension Sequence where Element == LinkedItemLabel { if searchFilter.isEmpty || searchFilter == ZWSP { return map { $0 } // return the identity of the sequence } - let index = searchFilter.index(searchFilter.startIndex, offsetBy: 1) - let trimmed = searchFilter.suffix(from: index).lowercased() - return filter { ($0.name ?? "").lowercased().contains(trimmed) } + if searchFilter.starts(with: ZWSP) { + let index = searchFilter.index(searchFilter.startIndex, offsetBy: 1) + let trimmed = searchFilter.suffix(from: index).lowercased() + return filter { ($0.name ?? "").lowercased().contains(trimmed) } + } + return filter { ($0.name ?? "").lowercased().contains(searchFilter.lowercased()) } } } diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsViewModel.swift index 98b5dd8e2..569014ab3 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsViewModel.swift @@ -29,7 +29,6 @@ import SwiftUI highlight: Highlight? = nil, initiallySelectedLabels: [LinkedItemLabel]? = nil ) async { - isLoading = true let selLabels = initiallySelectedLabels ?? item?.sortedLabels ?? highlight?.sortedLabels ?? [] await loadLabelsFromStore(dataService: dataService) @@ -42,7 +41,6 @@ import SwiftUI unselectedLabels.insert(label) } } - isLoading = false Task.detached(priority: .userInitiated) { if let labelIDs = try? await dataService.labels() { @@ -59,7 +57,6 @@ import SwiftUI self.unselectedLabels.insert(label) } } - self.isLoading = false } } } diff --git a/apple/OmnivoreKit/Sources/App/Views/LabelsEntryView.swift b/apple/OmnivoreKit/Sources/App/Views/LabelsEntryView.swift index 7a5141799..836165558 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LabelsEntryView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LabelsEntryView.swift @@ -25,38 +25,54 @@ private struct LabelEntry: Entry { @MainActor public struct LabelsEntryView: View { @Binding var searchTerm: String + @Binding var isFocused: Bool @State var viewModel: LabelsViewModel @EnvironmentObject var dataService: DataService let entries: [Entry] + #if os(macOS) + @State var popoverIndex = -1 + @State var presentPopover = false + #endif + @State private var totalHeight = CGFloat.zero @FocusState private var textFieldFocused: Bool public init( searchTerm: Binding, + isFocused: Binding, viewModel: LabelsViewModel ) { self._searchTerm = searchTerm - self.viewModel = viewModel + self._isFocused = isFocused + self.viewModel = viewModel self.entries = Array(viewModel.selectedLabels.map { LabelEntry(label: $0) }) } - func onTextSubmit() { - let index = searchTerm.index(searchTerm.startIndex, offsetBy: 1) - let trimmed = searchTerm.suffix(from: index).lowercased() + func getSearchTermText() -> String { + if searchTerm.starts(with: ZWSP) { + let index = searchTerm.index(searchTerm.startIndex, offsetBy: 1) + let trimmed = searchTerm.suffix(from: index) + return String(trimmed) + } + return searchTerm + } + func onTextSubmit() { + let trimmed = getSearchTermText() if trimmed.count < 1 { return } - if let label = viewModel.labels.first(where: { $0.name?.lowercased() == trimmed }) { + let lowercased = trimmed.lowercased() + if let label = viewModel.labels.first(where: { $0.name?.lowercased() == lowercased }) { if !viewModel.selectedLabels.contains(label) { viewModel.selectedLabels.append(label) } - searchTerm = ZWSP + reset() DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { textFieldFocused = true } @@ -67,27 +83,58 @@ public struct LabelsEntryView: View { color: Gradient.randomColor(str: trimmed, offset: 1), description: nil ) - searchTerm = ZWSP + reset() DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { textFieldFocused = true } } } + var textFieldString: NSAttributedString { + #if os(iOS) + NSAttributedString( + string: searchTerm, + attributes: [ + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14) + ] + ) + #else + NSAttributedString( + string: searchTerm, + attributes: [ + NSAttributedString.Key.font: NSFont.systemFont(ofSize: 14) + ] + ) + #endif + } + + func reset() { + searchTerm = ZWSP + #if os(macOS) + popoverIndex = -1 + presentPopover = false + #endif + } + var deletableTextField: some View { - let str = NSAttributedString( - string: searchTerm, - attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14)] - ) // Round it up to avoid jitter when typing - let textWidth = max(25.0, Double(Int(str.size().width + 1))) - let result = TextField("", text: $searchTerm) + let textWidth = max(25.0, Double(Int(textFieldString.size().width + 28))) + var result = AnyView(TextField("", text: $searchTerm) + .id("deletableTextField") .frame(alignment: .topLeading) .frame(height: 25) .frame(width: textWidth) - .padding(5) + .padding(.trailing, 5) + .padding(.vertical, 5) + .padding(EdgeInsets(top: 0, leading: 6, bottom: 0, trailing: 6)) + .cornerRadius(5) + .accentColor(.blue) .font(Font.system(size: 14)) .multilineTextAlignment(.leading) + #if os(macOS) + .textFieldStyle(.plain) + .background(Color.clear) + #endif .onChange(of: searchTerm, perform: { _ in if searchTerm.count >= 64 { searchTerm = String(searchTerm.prefix(64)) @@ -95,56 +142,108 @@ public struct LabelsEntryView: View { if searchTerm.isEmpty { if viewModel.selectedLabels.count > 0 { viewModel.selectedLabels.removeLast() - searchTerm = ZWSP + reset() DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { textFieldFocused = true } } else { - searchTerm = ZWSP + reset() } } }) - .onSubmit { - onTextSubmit() + .onSubmit { + #if os(iOS) + onTextSubmit() + #else + if popoverIndex == -1 || popoverIndex >= partialMatches.count { + onTextSubmit() + } else if popoverIndex >= 0, popoverIndex < partialMatches.count { + let matched = partialMatches[popoverIndex] + viewModel.selectedLabels.append(matched) + reset() + } + #endif + } + .submitScope()) + + #if os(macOS) + if #available(macOS 14.0, *) { + result = AnyView(result + .onKeyPress(.downArrow) { + popoverIndex = ((popoverIndex + 1) % (partialMatches.count + 1)) + return .handled + } + .onKeyPress(.upArrow) { + popoverIndex -= 1 + return .handled + } + .onKeyPress(.tab) { + popoverIndex = ((popoverIndex + 1) % (partialMatches.count + 1)) + return .handled + }) } - return result + #endif + + return AnyView(result) } -// func onTextDelete() -> Bool { if searchTerm.isEmpty { -// if lastSelected { -// if viewModel.selectedLabels.count > 0 { -// viewModel.selectedLabels.removeLast() -// DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(500)) { -// textFieldFocused = true -// } -// } -// } else { -// lastSelected = true -// } -// return true -// } -// return false -// } - public var body: some View { - // HStack(spacing: 0) { VStack { GeometryReader { geometry in self.generateLabelsContent(in: geometry) } }.padding(0) .frame(height: totalHeight) + .frame(maxWidth: .infinity) .background(Color.extensionPanelBackground) - .cornerRadius(8) + #if os(macOS) + .onHover { isHovered in + DispatchQueue.main.async { + if isHovered { + NSCursor.iBeam.push() + } else { + NSCursor.pop() + } + } + } + #endif + .cornerRadius(8) .onAppear { textFieldFocused = true } .onTapGesture { textFieldFocused = true } - .transaction { $0.animation = nil } + .onChange(of: textFieldFocused) { self.isFocused = $0 } } + var partialMatches: [LinkedItemLabel] { + viewModel.labels.applySearchFilter(searchTerm) + } + + #if os(macOS) + private var createLabelButton: some View { + let count = partialMatches.count + return Button { + viewModel.createLabel( + dataService: dataService, + name: searchTerm, + color: Gradient.randomColor(str: searchTerm, offset: 1), + description: nil + ) + reset() + } label: { + Text("Create new label") + .padding(6) + } + .background(popoverIndex == count ? Color.blue : Color.clear) + .frame(maxWidth: .infinity, alignment: .leading) + .cornerRadius(4) + .buttonStyle(.borderless) + .cornerRadius(4) + } + #endif + private func generateLabelsContent(in geom: GeometryProxy) -> some View { var width = CGFloat.zero var height = CGFloat.zero @@ -183,6 +282,37 @@ public struct LabelsEntryView: View { height = 0 return result }).focused($textFieldFocused) + #if os(macOS) + .onChange(of: searchTerm) { _ in + presentPopover = !searchTerm.isEmpty && searchTerm != ZWSP && partialMatches.count < 14 + if popoverIndex >= partialMatches.count + 1 { + popoverIndex = partialMatches.count + 1 + } + } + .popover(isPresented: $presentPopover, arrowEdge: .top) { + VStack(alignment: .leading, spacing: 4) { + ForEach(Array(partialMatches.enumerated()), id: \.offset) { idx, label in + if let name = label.name { + Button { + reset() + viewModel.selectedLabels.append(label) + } label: { + Text(name) + .padding(6) + .frame(maxWidth: .infinity, alignment: .leading) + } + .background(idx == popoverIndex ? Color.blue : Color.clear) + .frame(maxWidth: .infinity, alignment: .leading) + .cornerRadius(4) + .buttonStyle(.borderless) + .cornerRadius(4) + } + } + createLabelButton + }.padding(4) + } + + #endif }.background(viewHeightReader($totalHeight)) } diff --git a/apple/OmnivoreKit/Sources/App/Views/LinkedItemMetadataEditView.swift b/apple/OmnivoreKit/Sources/App/Views/LinkedItemMetadataEditView.swift index b3477a748..39065ef6d 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LinkedItemMetadataEditView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LinkedItemMetadataEditView.swift @@ -138,7 +138,7 @@ struct LinkedItemMetadataEditView: View { ) } } - .frame(minWidth: 400, minHeight: 600) + .frame(minWidth: 400, minHeight: 400) } #endif } diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index aba8bf1ca..8042fa436 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -499,7 +499,9 @@ struct WebReaderContainerView: View { showErrorAlertMessage: $showErrorAlertMessage ) } - .navigationViewStyle(StackNavigationViewStyle()) + #if os(iOS) + .navigationViewStyle(StackNavigationViewStyle()) + #endif } .sheet(isPresented: $showHighlightLabelsModal) { if let highlight = Highlight.lookup(byID: self.annotation, inContext: self.dataService.viewContext) { diff --git a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift index 433cbabed..63e410b36 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift @@ -89,6 +89,7 @@ struct WelcomeView: View { .sheet(isPresented: $showPrivacyModal) { NavigationView { BasicWebAppView.privacyPolicyWebView(baseURL: dataService.appEnvironment.webAppBaseURL) + #if os(iOS) .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button( @@ -101,11 +102,24 @@ struct WelcomeView: View { ) } } + #else + .toolbar { + Button( + action: { + showPrivacyModal = false + }, + label: { + Text(LocalText.genericClose) + } + ) + } + #endif } } .sheet(isPresented: $showTermsModal) { NavigationView { BasicWebAppView.termsConditionsWebView(baseURL: dataService.appEnvironment.webAppBaseURL) + #if os(iOS) .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button( @@ -118,6 +132,18 @@ struct WelcomeView: View { ) } } + #else + .toolbar { + Button( + action: { + showTermsModal = false + }, + label: { + Text(LocalText.genericClose) + } + ) + } + #endif } } .sheet(isPresented: $showAboutPage) { diff --git a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift index 2034eea85..ae6feb607 100644 --- a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift +++ b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift @@ -66,7 +66,7 @@ public struct LibraryItemCard: View { labels } - if let note = item.noteText { + if let note = item.noteText, !note.isEmpty { HStack(alignment: .top, spacing: 10) { avatarImage .frame(width: 20, height: 20) diff --git a/apple/Resources/Assets.xcassets/AccentColor.colorset/Contents.json b/apple/Resources/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index d2c39fe61..000000000 --- a/apple/Resources/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0xA8", - "green" : "0xEB", - "red" : "0xFB" - } - }, - "idiom" : "universal" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0x4C", - "green" : "0x4D", - "red" : "0x4F" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-400.woff2 b/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-400.woff2 deleted file mode 100644 index b5db4467b..000000000 Binary files a/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-400.woff2 and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-600.woff2 b/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-600.woff2 deleted file mode 100644 index 924ae728d..000000000 Binary files a/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-600.woff2 and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-700.woff2 b/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-700.woff2 deleted file mode 100644 index f6215ed24..000000000 Binary files a/apple/Sources/SafariExtension/Resources/fonts/inter-v3-latin-700.woff2 and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/devices.png b/apple/Sources/SafariExtension/Resources/images/devices.png deleted file mode 100644 index 6cda4d401..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/devices.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/extension/icon-128.png b/apple/Sources/SafariExtension/Resources/images/extension/icon-128.png deleted file mode 100644 index d6df58ae7..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/extension/icon-128.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/extension/icon-16.png b/apple/Sources/SafariExtension/Resources/images/extension/icon-16.png index 5c0b8ad30..e7ddfcf23 100644 Binary files a/apple/Sources/SafariExtension/Resources/images/extension/icon-16.png and b/apple/Sources/SafariExtension/Resources/images/extension/icon-16.png differ diff --git a/apple/Sources/SafariExtension/Resources/images/extension/icon-24.png b/apple/Sources/SafariExtension/Resources/images/extension/icon-24.png index a0654130b..c07a5a558 100644 Binary files a/apple/Sources/SafariExtension/Resources/images/extension/icon-24.png and b/apple/Sources/SafariExtension/Resources/images/extension/icon-24.png differ diff --git a/apple/Sources/SafariExtension/Resources/images/extension/icon-256.png b/apple/Sources/SafariExtension/Resources/images/extension/icon-256.png deleted file mode 100644 index a4413ba25..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/extension/icon-256.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/extension/icon-32.png b/apple/Sources/SafariExtension/Resources/images/extension/icon-32.png index 2270c0762..3d9603994 100644 Binary files a/apple/Sources/SafariExtension/Resources/images/extension/icon-32.png and b/apple/Sources/SafariExtension/Resources/images/extension/icon-32.png differ diff --git a/apple/Sources/SafariExtension/Resources/images/extension/icon-48.png b/apple/Sources/SafariExtension/Resources/images/extension/icon-48.png index dda13bd4e..011541e8f 100644 Binary files a/apple/Sources/SafariExtension/Resources/images/extension/icon-48.png and b/apple/Sources/SafariExtension/Resources/images/extension/icon-48.png differ diff --git a/apple/Sources/SafariExtension/Resources/images/extension/icon-96.png b/apple/Sources/SafariExtension/Resources/images/extension/icon-96.png deleted file mode 100644 index 3af64b0be..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/extension/icon-96.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/icon-128.png b/apple/Sources/SafariExtension/Resources/images/icon-128.png deleted file mode 100644 index c919eb009..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/icon-128.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/icon-256.png b/apple/Sources/SafariExtension/Resources/images/icon-256.png deleted file mode 100644 index 6bd3d206a..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/icon-256.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/icon-48.png b/apple/Sources/SafariExtension/Resources/images/icon-48.png deleted file mode 100644 index 353e8fbd5..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/icon-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/icon-512.png b/apple/Sources/SafariExtension/Resources/images/icon-512.png deleted file mode 100644 index 2200828bc..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/icon-512.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/icon-64.png b/apple/Sources/SafariExtension/Resources/images/icon-64.png deleted file mode 100644 index 995689f72..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/icon-64.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/icon-96.png b/apple/Sources/SafariExtension/Resources/images/icon-96.png deleted file mode 100644 index cb079d208..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/icon-96.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar-icon-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar-icon-16.png deleted file mode 100644 index ad014f6e2..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar-icon-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar-icon-19.png b/apple/Sources/SafariExtension/Resources/images/toolbar-icon-19.png deleted file mode 100644 index 33eb01e74..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar-icon-19.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar-icon-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar-icon-32.png deleted file mode 100644 index a71914b0a..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar-icon-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar-icon-38.png b/apple/Sources/SafariExtension/Resources/images/toolbar-icon-38.png deleted file mode 100644 index 990e7f410..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar-icon-38.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon-16.png deleted file mode 100644 index 8af894339..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-19.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon-19.png deleted file mode 100644 index a162b7259..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-19.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-24.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon-24.png deleted file mode 100644 index 0cc823c29..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-24.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon-32.png deleted file mode 100644 index ae41ae57b..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-38.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon-38.png deleted file mode 100644 index 3a3ecf52d..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-38.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-48.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon-48.png deleted file mode 100644 index 8452adade..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-16.png deleted file mode 100644 index 187cd66f5..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-19.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-19.png deleted file mode 100644 index 6f7b1847f..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-19.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-24.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-24.png deleted file mode 100644 index 8df374a15..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-24.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-32.png deleted file mode 100644 index b973cfd75..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-38.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-38.png deleted file mode 100644 index 21c68f3a8..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-38.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-48.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-48.png deleted file mode 100644 index 4b78bd06a..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_dark-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-16.png deleted file mode 100644 index a214de8c1..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-24.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-24.png deleted file mode 100644 index 6530b0436..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-24.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-32.png deleted file mode 100644 index 2f05b48ec..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-48.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-48.png deleted file mode 100644 index 0b251b106..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-16.png deleted file mode 100644 index 7c412d031..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-24.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-24.png deleted file mode 100644 index b24a06597..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-24.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-32.png deleted file mode 100644 index 2bd788355..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-48.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-48.png deleted file mode 100644 index dba76c689..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_dark-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-16.png deleted file mode 100644 index cab80e160..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-24.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-24.png deleted file mode 100644 index 43ee51057..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-24.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-32.png deleted file mode 100644 index d04ebe178..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-48.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-48.png deleted file mode 100644 index 4f99f32d3..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-16.png deleted file mode 100644 index f2896afb7..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-24.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-24.png deleted file mode 100644 index c25eb9ec7..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-24.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-32.png deleted file mode 100644 index 63325a4f2..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-48.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-48.png deleted file mode 100644 index c92d48723..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_edge_inactive_dark-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox.svg b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox.svg deleted file mode 100644 index 1917916ce..000000000 --- a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_dark.svg b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_dark.svg deleted file mode 100644 index 49dcf5e8b..000000000 --- a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_dark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_inactive.svg b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_inactive.svg deleted file mode 100644 index 49dcf5e8b..000000000 --- a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_inactive.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_inactive_dark.svg b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_inactive_dark.svg deleted file mode 100644 index 49dcf5e8b..000000000 --- a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_firefox_inactive_dark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-16.png deleted file mode 100644 index 6dc495ab5..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-19.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-19.png deleted file mode 100644 index 9291dfd5f..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-19.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-24.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-24.png deleted file mode 100644 index 10962350d..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-24.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-32.png deleted file mode 100644 index 118629ee5..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-38.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-38.png deleted file mode 100644 index 8cc56b267..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-38.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-48.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-48.png deleted file mode 100644 index 67c406e52..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-16.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-16.png deleted file mode 100644 index 4912800b8..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-16.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-19.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-19.png deleted file mode 100644 index 8c41a8b7f..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-19.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-24.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-24.png deleted file mode 100644 index ff2eb0de0..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-24.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-32.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-32.png deleted file mode 100644 index 26f0d3f06..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-32.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-38.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-38.png deleted file mode 100644 index 9720efa04..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-38.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-48.png b/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-48.png deleted file mode 100644 index 8670b05eb..000000000 Binary files a/apple/Sources/SafariExtension/Resources/images/toolbar/icon_inactive_dark-48.png and /dev/null differ diff --git a/apple/Sources/SafariExtension/Resources/manifest.json b/apple/Sources/SafariExtension/Resources/manifest.json index 9781facf2..aa672f639 100644 --- a/apple/Sources/SafariExtension/Resources/manifest.json +++ b/apple/Sources/SafariExtension/Resources/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Omnivore", "short_name": "Omnivore", - "version": "2.6.2", + "version": "2.8.2", "description": "Save PDFs and Articles to your Omnivore library", "author": "Omnivore Media, Inc", "default_locale": "en", diff --git a/apple/Sources/SafariExtension/Resources/scripts/content/toast.js b/apple/Sources/SafariExtension/Resources/scripts/content/toast.js index 2e5b74219..7ee799643 100644 --- a/apple/Sources/SafariExtension/Resources/scripts/content/toast.js +++ b/apple/Sources/SafariExtension/Resources/scripts/content/toast.js @@ -1 +1 @@ -!function(){let e,t,o,n=[],a=!1;const i={spinner:'\n \n \n \n \n \n \n \n \n \n ',success:'\n \n \n \n ',failure:'\n \n \n \n ',close:'',animatedLoader:'\n \n
\n '};function r(){a=!0,o&&clearTimeout(o)}function s(o){if(e)switch(o.ctx&&(t={...t,...o.ctx}),o.target){case"logged_out":r(),l("failure"),c("#omnivore-logged-out-row"),d("#omnivore-logged-out-status","empty","You are not logged in."),["#omnivore-toast-edit-title-btn","#omnivore-toast-edit-labels-btn","#omnivore-toast-read-now-btn","#omnivore-toast-add-note-btn","#omnivore-open-menu-btn"].forEach((t=>{e.shadowRoot.querySelector(t).disabled=!0}));break;case"page":l(o.status);break;case"note":d("#omnivore-add-note-status",o.status,o.message,"success"==o.status?2500:void 0),"success"==o.status&&setTimeout((()=>{c("#omnivore-add-note-status")}),3e3);break;case"title":d("#omnivore-edit-title-status",o.status,o.message,"success"==o.status?2500:void 0),"success"==o.status&&setTimeout((()=>{c("#omnivore-edit-title-status")}),3e3);break;case"labels":d("#omnivore-edit-labels-status",o.status,o.message,"success"==o.status?2500:void 0);break;case"extra":d("#omnivore-extra-status",o.status,o.message,"success"==o.status?2500:void 0),"success"==o.status&&setTimeout((()=>{e.remove()}),3e3)}else console.log("no statusBox to update")}function l(t){const n=e.shadowRoot.querySelector(".omnivore-toast-statusBox");switch(t){case"loading":n.innerHTML=i.animatedLoader;break;case"success":o=setTimeout((function(){console.log("hiding: ",e,a),a||(e.remove(),e=void 0)}),2500),n.innerHTML=i.success;break;case"failure":n.innerHTML=i.failure}}function d(t,o,n,a){const r=e.shadowRoot.querySelector(t),s=(()=>{switch(o){case"loading":return i.animatedLoader;case"success":return i.success;case"failure":return i.failure;case"none":return"";default:return}})();r.innerHTML=s?`${s}${n}`:n,a&&setTimeout((()=>{r.innerHTML=""}),a)}function c(t){if(!e)return;const o=e.shadowRoot.querySelector(t),n=o?.getAttribute("data-state");if(e.shadowRoot.querySelectorAll(".omnivore-toast-func-row").forEach((e=>{e.setAttribute("data-state","closed")})),o&&n){const e="open"===n?"closed":"open";o.setAttribute("data-state",e)}}function u(e){const t=document.createElement("button"),o=document.createElement("span");o.style="width:10px;height:10px;border-radius:1000px;",o.style.setProperty("background-color",e.color);const n=document.createElement("span");n.style="margin-left: 10px;pointer-events: none;",n.innerText=e.name;const a=document.createElement("span");return a.style="margin-left: auto;pointer-events: none;",a.className="checkbox",a.innerHTML='\n \n \n \n ',t.appendChild(o),t.appendChild(n),t.appendChild(a),t.onclick=m,t.onkeydown=f,t.setAttribute("data-label-id",e.id),t.setAttribute("data-label-selected",e.selected?"on":"off"),t.setAttribute("tabIndex","-1"),t}function m(e){e.preventDefault();const t=e.target.getAttribute("data-label-id");b(e,t)}function b(e,t){const o=e.target.getAttribute("data-label-selected");if(!t||!o)return;const a="on"!=o;e.target.setAttribute("data-label-selected",a?"on":"off");const i=n.find((e=>e.id===t));i&&(i.selected=a);const r=e.target.form.querySelector("#label-list"),s=e.target.form.querySelector("#omnivore-edit-label-input");a?h(r,s,i.name):w(r,i.id)}function p(e){const t=e.target.querySelector("#omnivore-edit-label-input");t&&e.target!=t&&t.focus()}function f(e){switch(e.cancelBubble=!0,e.stopPropogation&&e.stopPropogation(),e.target.form&&"backspace"!==e.key.toLowerCase()&&e.target.form.querySelectorAll('.label[data-label-backspaced="on"]').forEach((e=>{e.removeAttribute("data-label-backspaced")})),e.key.toLowerCase()){case"arrowup":{if("omnivore-edit-label-input"==e.target.id)return;if(!e.target.getAttribute("data-label-id"))return;let t=e.target.previousElementSibling;t&&t.getAttribute("data-label-id")?t.focus():e.target.form.querySelector("#omnivore-edit-label-input")?.focus(),e.preventDefault();break}case"arrowdown":{let t;"omnivore-edit-label-input"==e.target.id?(idx=e.target.getAttribute("data-label-id"),t=e.target.closest("#omnivore-edit-labels-form").querySelector("#omnivore-edit-labels-list").querySelector("[data-label-id]")):t=e.target.nextElementSibling,t&&t.getAttribute("data-label-id")&&t.focus(),e.preventDefault();break}case"backspace":"omnivore-edit-label-input"==e.target.id&&0==e.target.value.length&&(e.target.form.querySelector("#label-list"),function(e,t){const o=t.closest("#label-entry-item").previousElementSibling;o&&(o.getAttribute("data-label-backspaced")?w(t.closest("#label-list"),o.getAttribute("data-label-id")):o.setAttribute("data-label-backspaced","on"))}(0,e.target));break;case"enter":{if("omnivore-edit-label-input"==e.target.id)return e.target.value&&h(e.target.form.querySelector("#label-list"),e.target,e.target.value),void e.preventDefault();const t=e.target.getAttribute("data-label-id");b(e,t),e.preventDefault();break}}}async function g(){const o=document.location?`cached-note-${document.location.href}`:void 0;r(),c("#omnivore-add-note-row");const n=e.shadowRoot.querySelector("#omnivore-add-note-textarea");if(n){if(o){const e=await getStorageItem(o);n.value=e}n.value?n.select():n.focus(),n.addEventListener("input",(e=>{(async()=>{const t={};t[o]=e.target.value,await setStorage(t)})()})),n.onkeydown=e=>{e.cancelBubble=!0,e.stopPropogation&&e.stopPropogation(),13==e.keyCode&&(e.metaKey||e.ctrlKey)&&(d("#omnivore-add-note-status","loading","Adding note..."),browserApi.runtime.sendMessage({action:ACTIONS.AddNote,payload:{ctx:t,note:n.value}}))}}e.shadowRoot.querySelector("#omnivore-add-note-form").onsubmit=e=>{d("#omnivore-add-note-status","loading","Adding note..."),browserApi.runtime.sendMessage({action:ACTIONS.AddNote,payload:{ctx:t,note:e.target.elements.title.value}}),e.preventDefault(),e.stopPropogation&&e.stopPropogation()}}function v(){r(),c("#omnivore-edit-title-row");const o=e.shadowRoot.querySelector("#omnivore-edit-title-textarea");o&&(o.focus(),o.onkeydown=e=>{e.cancelBubble=!0,e.stopPropogation&&e.stopPropogation()}),e.shadowRoot.querySelector("#omnivore-edit-title-form").onsubmit=e=>{d("#omnivore-edit-title-status","loading","Updating title..."),browserApi.runtime.sendMessage({action:ACTIONS.EditTitle,payload:{ctx:t,title:e.target.elements.title.value}}),e.preventDefault()}}function h(e,t,o){const a=n.find((e=>e.name===o)),i=a?a.id:([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))),r=e.querySelector("#label-entry-item"),s=r.querySelector("#omnivore-edit-label-input");if(a&&e.querySelector(`[data-label-id='${a.id}']`)){const t=e.querySelector(`[data-label-id='${a.id}']`);return t.setAttribute("data-item-highlighted","on"),setTimeout((()=>{t.style.borderColor="rgb(222, 222, 222)"}),500),void(s&&(s.value="",s.focus(),L(void 0)))}const l=a?a.color:function(){const e=["#FF5D99","#7CFF7B","#FFD234","#7BE4FF","#CE88EF","#EF8C43"];return e[Math.floor(Math.random()*e.length)]}(),d=document.createElement("li");d.classList.add("label"),d.innerHTML=`\n \n ${o}\n \n `,e.insertBefore(d,r),t.value="";const c=d.querySelector(".label-remove-button");c&&(c.onclick=t=>{w(e,i),t.preventDefault()});const m=e.closest("#omnivore-edit-labels-form");if(a){const e=m.querySelector(`[data-label-id='${a.id}']`);a.selected=!0,e.setAttribute("data-label-selected","on"),d.setAttribute("data-label-id",a.id)}else{const e=m.querySelector("#omnivore-edit-labels-list"),t={id:i,color:l,name:o,temporary:!0,selected:!0};n.push(t),d.setAttribute("data-label-id",t.id);const a=u(t),r=e.querySelector("button[data-label-id]");a.setAttribute("data-label-selected","on"),e.insertBefore(a,r)}s&&(s.focus(),L(void 0)),y()}function w(e,t){const o=e.closest("#omnivore-edit-labels-form"),a=e.querySelector(`[data-label-id='${t}']`);a&&a.remove();const i=o.querySelector(`[data-label-id='${t}']`);i&&i.setAttribute("data-label-selected","off");const r=n.find((e=>e.id===t));r&&(r.selected=!1),y()}function y(){d("#omnivore-edit-labels-status","loading","Updating Labels...",void 0);const e=n.filter((e=>e.selected)).map((e=>({name:e.name,color:e.color})));browserApi.runtime.sendMessage({action:ACTIONS.SetLabels,payload:{ctx:t,labels:e}})}async function C(){r(),await getStorageItem("labels").then((e=>{n=e})),c("#omnivore-edit-labels-row"),e.shadowRoot.querySelector("#omnivore-edit-label-input")?.focus();const t=e.shadowRoot.querySelector("#omnivore-edit-labels-list");e.shadowRoot.querySelector("#omnivore-edit-label-input").onkeydown=f,e.shadowRoot.querySelector("#omnivore-edit-label-editor").onclick=p,e.shadowRoot.querySelector("#omnivore-edit-label-input").addEventListener("input",(e=>{L(e.target.value)})),t&&(t.innerHTML="",n.sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"base"}))).forEach((function(e,o){const n=u(e);t.appendChild(n)})))}async function L(t){const o=e.shadowRoot.querySelector("#omnivore-edit-labels-list");o&&(o.innerHTML="",t?n.filter((e=>e.name.toLowerCase().indexOf(t.toLowerCase())>-1)).sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"base"}))).forEach((function(e){const t=u(e);o.appendChild(t)})):n.sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"base"}))).forEach((function(e){const t=u(e);o.appendChild(t)})))}function S(){r(),e.shadowRoot.querySelector("#omnivore-toast-container").setAttribute("data-state","open"),t&&t.readerURL?window.open(t.readerURL,"_blank"):t?window.open(new URL(`/article?url=${encodeURI(t.originalURL)}`,t.omnivoreURL),"_blank"):alert("Error no URL found."),setTimeout((()=>{q()}),1e3)}function x(e){browserApi.runtime.sendMessage({action:ACTIONS.Archive,payload:{ctx:t}}),e.preventDefault()}function k(e){browserApi.runtime.sendMessage({action:ACTIONS.Delete,payload:{ctx:t}}),e.preventDefault()}function A(){r(),c("#omnivore-extra-buttons-row")}function q(){e.remove(),e=void 0}function R(){window.open(new URL("/login",t.omnivoreURL),"_blank"),setTimeout(q,2e3)}window.showToolbar=function(o){t=o.ctx,async function(t){document.body&&(e||(e=await async function(){const e=await fetch(browserApi.runtime.getURL("views/toast.html")),t=await e.text(),o=document.createElement("div");o.tabIndex=0,o.attachShadow({mode:"open"}),o.shadowRoot&&(o.shadowRoot.innerHTML="");const n=document.createElement("div");return n.id="#omnivore-toast",n.innerHTML=t,n.tabIndex=0,o.shadowRoot.appendChild(n),document.body.appendChild(o),function(e){const t=[{id:"#omnivore-toast-add-note-btn",func:g},{id:"#omnivore-toast-edit-title-btn",func:v},{id:"#omnivore-toast-edit-labels-btn",func:C},{id:"#omnivore-toast-read-now-btn",func:S},{id:"#omnivore-open-menu-btn",func:A},{id:"#omnivore-toast-close-btn",func:q},{id:"#omnivore-toast-login-btn",func:R},{id:"#omnivore-toast-archive-btn",func:x},{id:"#omnivore-toast-delete-btn",func:k}];for(const o of t){const t=e.shadowRoot.querySelector(o.id);t&&t.addEventListener("click",o.func)}if(window.matchMedia("(max-width: 500px)").matches){e.shadowRoot.querySelectorAll(".omnivore-top-button-label").forEach((e=>{e.style.display="none"}));const t=e.shadowRoot.querySelector("#omnivore-toast-container");t.style.width="280px",t.style.top="unset",t.style.bottom="20px"}}(o),function(e){e.addEventListener("keydown",(e=>{switch(e.key){case"r":S();break;case"l":C();break;case"m":A();break;case"t":v();break;case"n":e.preventDefault(),g()}e.cancelBubble=!0,e.stopPropogation&&e.stopPropogation()}))}(o),o}()),"loading"===t.type&&s({status:"loading",target:"page"}),document.querySelectorAll("#omnivore-toast").forEach((t=>{t!==e&&(console.log("removing current toast el: ",e),t.remove())})),e.focus({preventScroll:!0}))}(o).catch((e=>console.log("error showing toast",e)))},window.updateStatus=s,window.updateLabelsFromCache=function(e){(async()=>{await getStorageItem("labels").then((e=>{n&&n.filter((e=>e.selected)).forEach((t=>{const o=e.find((e=>e.name==t.name));o?o.selected=!0:e.push(t)})),n=e}))})()}}(); \ No newline at end of file +!function(){let e,t,o,n=[],a=!1;const i={spinner:'\n \n \n \n \n \n \n \n \n \n ',success:'\n \n \n \n ',failure:'\n \n \n \n ',close:'',animatedLoader:'\n \n
\n '};function r(){a=!0,o&&clearTimeout(o)}function s(o){if(e)switch(o.ctx&&(t={...t,...o.ctx}),o.target){case"logged_out":r(),l("failure"),c("#omnivore-logged-out-row"),d("#omnivore-logged-out-status","empty","You are not logged in."),["#omnivore-toast-edit-title-btn","#omnivore-toast-edit-labels-btn","#omnivore-toast-read-now-btn","#omnivore-toast-add-note-btn","#omnivore-open-menu-btn"].forEach((t=>{e.shadowRoot.querySelector(t).disabled=!0}));break;case"page":l(o.status);break;case"note":d("#omnivore-add-note-status",o.status,o.message,"success"==o.status?2500:void 0),"success"==o.status&&setTimeout((()=>{c("#omnivore-add-note-status")}),3e3);break;case"title":d("#omnivore-edit-title-status",o.status,o.message,"success"==o.status?2500:void 0),"success"==o.status&&setTimeout((()=>{c("#omnivore-edit-title-status")}),3e3);break;case"labels":d("#omnivore-edit-labels-status",o.status,o.message,"success"==o.status?2500:void 0);break;case"extra":d("#omnivore-extra-status",o.status,o.message,"success"==o.status?2500:void 0),"success"==o.status&&setTimeout((()=>{e.remove()}),3e3)}else console.log("no statusBox to update")}function l(t){const n=e.shadowRoot.querySelector(".omnivore-toast-statusBox");switch(t){case"loading":n.innerHTML=i.animatedLoader;break;case"success":const t=t=>{const n=t&&!Number.isNaN(Number(t))?Number(t):2500;console.log("setting dismiss time: ",n),o=setTimeout((function(){console.log("hiding toast timeout"),a||(e.remove(),e=void 0)}),n)};getStorageItem("autoDismissTime").then((e=>{t(e)})).catch((()=>{t("2500")})),getStorageItem("disableAutoDismiss").then((e=>{console.log("got disableAutoDismiss",e),e&&r()})),n.innerHTML=i.success;break;case"failure":n.innerHTML=i.failure}}function d(t,o,n,a){const r=e.shadowRoot.querySelector(t),s=(()=>{switch(o){case"loading":return i.animatedLoader;case"success":return i.success;case"failure":return i.failure;case"none":return"";default:return}})();r.innerHTML=s?`${s}${n}`:n,a&&setTimeout((()=>{r.innerHTML=""}),a)}function c(t){if(!e)return;const o=e.shadowRoot.querySelector(t),n=o?.getAttribute("data-state");if(e.shadowRoot.querySelectorAll(".omnivore-toast-func-row").forEach((e=>{e.setAttribute("data-state","closed")})),o&&n){const e="open"===n?"closed":"open";o.setAttribute("data-state",e)}}function u(e){const t=document.createElement("button"),o=document.createElement("span");o.style="width:10px;height:10px;border-radius:1000px;",o.style.setProperty("background-color",e.color);const n=document.createElement("span");n.style="margin-left: 10px;pointer-events: none;",n.innerText=e.name;const a=document.createElement("span");return a.style="margin-left: auto;pointer-events: none;",a.className="checkbox",a.innerHTML='\n \n \n \n ',t.appendChild(o),t.appendChild(n),t.appendChild(a),t.onclick=m,t.onkeydown=g,t.setAttribute("data-label-id",e.id),t.setAttribute("data-label-selected",e.selected?"on":"off"),t.setAttribute("tabIndex","-1"),t}function m(e){e.preventDefault();const t=e.target.getAttribute("data-label-id");b(e,t)}function b(e,t){const o=e.target.getAttribute("data-label-selected");if(!t||!o)return;const a="on"!=o;e.target.setAttribute("data-label-selected",a?"on":"off");const i=n.find((e=>e.id===t));i&&(i.selected=a);const r=e.target.form.querySelector("#label-list"),s=e.target.form.querySelector("#omnivore-edit-label-input");a?h(r,s,i.name):w(r,i.id)}function p(e){const t=e.target.querySelector("#omnivore-edit-label-input");t&&e.target!=t&&t.focus()}function g(e){switch(e.cancelBubble=!0,e.stopPropogation&&e.stopPropogation(),e.target.form&&"backspace"!==e.key.toLowerCase()&&e.target.form.querySelectorAll('.label[data-label-backspaced="on"]').forEach((e=>{e.removeAttribute("data-label-backspaced")})),e.key.toLowerCase()){case"arrowup":{if("omnivore-edit-label-input"==e.target.id)return;if(!e.target.getAttribute("data-label-id"))return;let t=e.target.previousElementSibling;t&&t.getAttribute("data-label-id")?t.focus():e.target.form.querySelector("#omnivore-edit-label-input")?.focus(),e.preventDefault();break}case"arrowdown":{let t;"omnivore-edit-label-input"==e.target.id?(idx=e.target.getAttribute("data-label-id"),t=e.target.closest("#omnivore-edit-labels-form").querySelector("#omnivore-edit-labels-list").querySelector("[data-label-id]")):t=e.target.nextElementSibling,t&&t.getAttribute("data-label-id")&&t.focus(),e.preventDefault();break}case"backspace":"omnivore-edit-label-input"==e.target.id&&0==e.target.value.length&&(e.target.form.querySelector("#label-list"),function(e,t){const o=t.closest("#label-entry-item").previousElementSibling;o&&(o.getAttribute("data-label-backspaced")?w(t.closest("#label-list"),o.getAttribute("data-label-id")):o.setAttribute("data-label-backspaced","on"))}(0,e.target));break;case"enter":{if("omnivore-edit-label-input"==e.target.id)return e.target.value&&h(e.target.form.querySelector("#label-list"),e.target,e.target.value),void e.preventDefault();const t=e.target.getAttribute("data-label-id");b(e,t),e.preventDefault();break}}}async function f(){const o=document.location?`cached-note-${document.location.href}`:void 0;r(),c("#omnivore-add-note-row");const n=e.shadowRoot.querySelector("#omnivore-add-note-textarea");if(n){if(o){const e=await getStorageItem(o);n.value=e}n.value?n.select():n.focus(),n.addEventListener("input",(e=>{(async()=>{const t={};t[o]=e.target.value,await setStorage(t)})()})),n.onkeydown=e=>{e.cancelBubble=!0,e.stopPropogation&&e.stopPropogation(),13==e.keyCode&&(e.metaKey||e.ctrlKey)&&(d("#omnivore-add-note-status","loading","Adding note..."),browserApi.runtime.sendMessage({action:ACTIONS.AddNote,payload:{ctx:t,note:n.value}}))}}e.shadowRoot.querySelector("#omnivore-add-note-form").onsubmit=e=>{d("#omnivore-add-note-status","loading","Adding note..."),browserApi.runtime.sendMessage({action:ACTIONS.AddNote,payload:{ctx:t,note:e.target.elements.title.value}}),e.preventDefault(),e.stopPropogation&&e.stopPropogation()}}function v(){r(),c("#omnivore-edit-title-row");const o=e.shadowRoot.querySelector("#omnivore-edit-title-textarea");o&&(o.focus(),o.onkeydown=e=>{e.cancelBubble=!0,e.stopPropogation&&e.stopPropogation()}),e.shadowRoot.querySelector("#omnivore-edit-title-form").onsubmit=e=>{d("#omnivore-edit-title-status","loading","Updating title..."),browserApi.runtime.sendMessage({action:ACTIONS.EditTitle,payload:{ctx:t,title:e.target.elements.title.value}}),e.preventDefault()}}function h(e,t,o){const a=n.find((e=>e.name===o)),i=a?a.id:([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))),r=e.querySelector("#label-entry-item"),s=r.querySelector("#omnivore-edit-label-input");if(a&&e.querySelector(`[data-label-id='${a.id}']`)){const t=e.querySelector(`[data-label-id='${a.id}']`);return t.setAttribute("data-item-highlighted","on"),setTimeout((()=>{t.style.borderColor="rgb(222, 222, 222)"}),500),void(s&&(s.value="",s.focus(),L(void 0)))}const l=a?a.color:function(){const e=["#FF5D99","#7CFF7B","#FFD234","#7BE4FF","#CE88EF","#EF8C43"];return e[Math.floor(Math.random()*e.length)]}(),d=document.createElement("li");d.classList.add("label"),d.innerHTML=`\n \n ${o}\n \n `,e.insertBefore(d,r),t.value="";const c=d.querySelector(".label-remove-button");c&&(c.onclick=t=>{w(e,i),t.preventDefault()});const m=e.closest("#omnivore-edit-labels-form");if(a){const e=m.querySelector(`[data-label-id='${a.id}']`);a.selected=!0,e.setAttribute("data-label-selected","on"),d.setAttribute("data-label-id",a.id)}else{const e=m.querySelector("#omnivore-edit-labels-list"),t={id:i,color:l,name:o,temporary:!0,selected:!0};n.push(t),d.setAttribute("data-label-id",t.id);const a=u(t),r=e.querySelector("button[data-label-id]");a.setAttribute("data-label-selected","on"),e.insertBefore(a,r)}s&&(s.focus(),L(void 0)),y()}function w(e,t){const o=e.closest("#omnivore-edit-labels-form"),a=e.querySelector(`[data-label-id='${t}']`);a&&a.remove();const i=o.querySelector(`[data-label-id='${t}']`);i&&i.setAttribute("data-label-selected","off");const r=n.find((e=>e.id===t));r&&(r.selected=!1),y()}function y(){d("#omnivore-edit-labels-status","loading","Updating Labels...",void 0);const e=n.filter((e=>e.selected)).map((e=>({name:e.name,color:e.color})));browserApi.runtime.sendMessage({action:ACTIONS.SetLabels,payload:{ctx:t,labels:e}})}async function C(){r(),await getStorageItem("labels").then((e=>{n=e})),c("#omnivore-edit-labels-row"),e.shadowRoot.querySelector("#omnivore-edit-label-input")?.focus();const t=e.shadowRoot.querySelector("#omnivore-edit-labels-list");e.shadowRoot.querySelector("#omnivore-edit-label-input").onkeydown=g,e.shadowRoot.querySelector("#omnivore-edit-label-editor").onclick=p,e.shadowRoot.querySelector("#omnivore-edit-label-input").addEventListener("input",(e=>{L(e.target.value)})),t&&(t.innerHTML="",n.sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"base"}))).forEach((function(e,o){const n=u(e);t.appendChild(n)})))}async function L(t){const o=e.shadowRoot.querySelector("#omnivore-edit-labels-list");o&&(o.innerHTML="",t?n.filter((e=>e.name.toLowerCase().indexOf(t.toLowerCase())>-1)).sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"base"}))).forEach((function(e){const t=u(e);o.appendChild(t)})):n.sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"base"}))).forEach((function(e){const t=u(e);o.appendChild(t)})))}function S(){r(),e.shadowRoot.querySelector("#omnivore-toast-container").setAttribute("data-state","open"),t&&t.readerURL?window.open(t.readerURL,"_blank"):t?window.open(new URL(`/article?url=${encodeURI(t.originalURL)}`,t.omnivoreURL),"_blank"):alert("Error no URL found."),setTimeout((()=>{q()}),1e3)}function x(e){browserApi.runtime.sendMessage({action:ACTIONS.Archive,payload:{ctx:t}}),e.preventDefault()}function k(e){browserApi.runtime.sendMessage({action:ACTIONS.Delete,payload:{ctx:t}}),e.preventDefault()}function A(){r(),c("#omnivore-extra-buttons-row")}function q(){e.remove(),e=void 0}function R(){window.open(new URL("/login",t.omnivoreURL),"_blank"),setTimeout(q,2e3)}window.showToolbar=function(o){t=o.ctx,async function(t){document.body&&(e||(e=await async function(){const e=await fetch(browserApi.runtime.getURL("views/toast.html")),t=await e.text(),o=document.createElement("div");o.tabIndex=0,o.attachShadow({mode:"open"}),o.shadowRoot&&(o.shadowRoot.innerHTML="");const n=document.createElement("div");return n.id="#omnivore-toast",n.innerHTML=t,n.tabIndex=0,o.shadowRoot.appendChild(n),document.body.appendChild(o),function(e){const t=[{id:"#omnivore-toast-add-note-btn",func:f},{id:"#omnivore-toast-edit-title-btn",func:v},{id:"#omnivore-toast-edit-labels-btn",func:C},{id:"#omnivore-toast-read-now-btn",func:S},{id:"#omnivore-open-menu-btn",func:A},{id:"#omnivore-toast-close-btn",func:q},{id:"#omnivore-toast-login-btn",func:R},{id:"#omnivore-toast-archive-btn",func:x},{id:"#omnivore-toast-delete-btn",func:k}];for(const o of t){const t=e.shadowRoot.querySelector(o.id);t&&t.addEventListener("click",o.func)}if(window.matchMedia("(max-width: 500px)").matches){e.shadowRoot.querySelectorAll(".omnivore-top-button-label").forEach((e=>{e.style.display="none"}));const t=e.shadowRoot.querySelector("#omnivore-toast-container");t.style.width="280px",t.style.top="unset",t.style.bottom="20px"}}(o),function(e){e.addEventListener("keydown",(e=>{switch(e.key){case"r":S();break;case"l":C();break;case"m":A();break;case"t":v();break;case"n":e.preventDefault(),f()}e.cancelBubble=!0,e.stopPropogation&&e.stopPropogation()}))}(o),o}()),"loading"===t.type&&s({status:"loading",target:"page"}),document.querySelectorAll("#omnivore-toast").forEach((t=>{t!==e&&(console.log("removing current toast el: ",e),t.remove())})),e.focus({preventScroll:!0}))}(o).catch((e=>console.log("error showing toast",e)))},window.updateStatus=s,window.updateLabelsFromCache=function(e){(async()=>{await getStorageItem("labels").then((e=>{n&&n.filter((e=>e.selected)).forEach((t=>{const o=e.find((e=>e.name==t.name));o?o.selected=!0:e.push(t)})),n=e}))})()}}(); \ No newline at end of file diff --git a/apple/Sources/SafariExtension/Resources/styles/cta-popup.css b/apple/Sources/SafariExtension/Resources/styles/cta-popup.css deleted file mode 100644 index ef2ac515b..000000000 --- a/apple/Sources/SafariExtension/Resources/styles/cta-popup.css +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Fonts - */ - -@font-face { - font-style: normal; - font-weight: 400; - font-family: Inter; - src: - local(""), - url("/fonts/inter-v3-latin-400.woff2") format("woff2"); -} - -@font-face { - font-style: normal; - font-weight: 600; - font-family: Inter; - src: - local(""), - url("/fonts/inter-v3-latin-600.woff2") format("woff2"); -} - -@font-face { - font-style: normal; - font-weight: 700; - font-family: Inter; - src: - local(""), - url("/fonts/inter-v3-latin-700.woff2") format("woff2"); -} - -/** - * Other - */ - -html, -body { - width: 100%; - height: 100%; -} - -body { - margin: 0; -} - -.cta-container { - position: relative; - overflow: hidden; - box-sizing: border-box; - width: 100%; - height: 100%; - padding: 24px 12px; - background: linear-gradient(150deg, #fff 55%, #ffde8c 55%); - background-color: #fff; - color: #3d3d3d; - font-family: Inter, sans-serif; - text-align: center; -} - -.cta-container__wrapper { - position: relative; - z-index: 1; -} - -.cta-container__title { - padding: 0 24px 24px; - font-weight: 600; - font-size: 16px; -} - -.cta-container__icon { - vertical-align: unset; - margin-bottom: -4px; - fill: none; -} - -.cta-container__link { - display: flex; - align-items: center; - justify-content: center; - width: 184px; - height: 34px; - margin: 36px auto 14px; - border-radius: 40px; - background-color: #fff; - color: inherit; - font-weight: 700; - font-size: 12px; - text-decoration: none; - cursor: pointer; -} - -.cta-container__text { - margin: 0; - font-size: 12px; -} - -.cta-container__textlink { - color: inherit; - font-weight: 700; -} diff --git a/apple/Sources/SafariExtension/Resources/views/cta-popup.html b/apple/Sources/SafariExtension/Resources/views/cta-popup.html index 260725c08..94fe55621 100644 --- a/apple/Sources/SafariExtension/Resources/views/cta-popup.html +++ b/apple/Sources/SafariExtension/Resources/views/cta-popup.html @@ -7,33 +7,6 @@ -