diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index d1b5dc0131..5d44e59db7 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -12997,7 +12997,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 146.2.0; + version = 148.0.0; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6dd57e77a0..b6b11e25d1 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "e1e436422bc167933baa0f90838958f2ac7119f3", - "version" : "146.2.0" + "revision" : "7c235d29fc446436734612e81dd486b7c52aa577", + "version" : "148.0.0" } }, { diff --git a/DuckDuckGo/NavigationBar/View/AddressBarTextEditor.swift b/DuckDuckGo/NavigationBar/View/AddressBarTextEditor.swift index bf5c1c6c7f..c235f193d1 100644 --- a/DuckDuckGo/NavigationBar/View/AddressBarTextEditor.swift +++ b/DuckDuckGo/NavigationBar/View/AddressBarTextEditor.swift @@ -292,12 +292,14 @@ final class AddressBarTextEditor: NSTextView { guard let index = nextWordSelectionIndex(backwards: false) else { return } self.selectedRange = NSRange(location: index, length: 0) + scrollToCaret() } override func moveWordLeft(_ sender: Any?) { guard let index = nextWordSelectionIndex(backwards: true) else { return } self.selectedRange = NSRange(location: index, length: 0) + scrollToCaret() } override func moveWordRightAndModifySelection(_ sender: Any?) { @@ -311,6 +313,7 @@ final class AddressBarTextEditor: NSTextView { let range = NSRange(location: selectedRange.location, length: index - selectedRange.location) self.setSelectedRange(range, affinity: .downstream, stillSelecting: false) + self.scrollToSelectionEnd() } override func moveWordLeftAndModifySelection(_ sender: Any?) { @@ -324,6 +327,7 @@ final class AddressBarTextEditor: NSTextView { let range = NSRange(location: index, length: selectedRange.upperBound - index) self.setSelectedRange(range, affinity: .upstream, stillSelecting: false) + self.scrollToSelectionStart() } override func deleteForward(_ sender: Any?) { @@ -422,6 +426,22 @@ final class AddressBarTextEditor: NSTextView { breakUndoCoalescing() } + private func scrollToCaret() { + guard let layoutManager = layoutManager, let textContainer = textContainer else { return } + let caretRect = layoutManager.boundingRect(forGlyphRange: selectedRange(), in: textContainer) + scrollToVisible(caretRect) + } + + private func scrollToSelectionStart() { + let startRange = NSRange(location: selectedRange().location, length: 0) + self.scrollRangeToVisible(startRange) + } + + private func scrollToSelectionEnd() { + let endRange = NSRange(location: selectedRange.location + selectedRange.length, length: 0) + self.scrollRangeToVisible(endRange) + } + } final class AddressBarTextFieldCell: NSTextFieldCell { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 1fa39e2681..583ef141ef 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "146.2.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "148.0.0"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper"), ], diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 041e3d6cd1..626fd972c0 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -31,7 +31,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "146.2.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "148.0.0"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.1"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 57655ffe08..269c7f0143 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "146.2.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "148.0.0"), .package(path: "../SwiftUIExtensions") ], targets: [ diff --git a/LocalPackages/SubscriptionUI/Sources/SubscriptionUI/UserText.swift b/LocalPackages/SubscriptionUI/Sources/SubscriptionUI/UserText.swift index 5e470bf2f8..6321b3cc4f 100644 --- a/LocalPackages/SubscriptionUI/Sources/SubscriptionUI/UserText.swift +++ b/LocalPackages/SubscriptionUI/Sources/SubscriptionUI/UserText.swift @@ -76,7 +76,7 @@ enum UserText { // MARK: Preferences when subscription activation is pending static let preferencesSubscriptionPendingHeader = NSLocalizedString("subscription.preferences.subscription.pending.header", value: "Your subscription is being activated", comment: "Header for the subscription preferences pane when the subscription activation is pending") - static let preferencesSubscriptionPendingCaption = NSLocalizedString("subscription.preferences.subscription.pending.caption", value: "This is taking longer than usual, please check back later.", comment: "Caption for the subscription preferences pane when the subscription activation is pending") + static let preferencesSubscriptionPendingCaption = NSLocalizedString("subscription.preferences.subscription.pending.caption", value: "This is taking longer than usual. Please check back later.", comment: "Caption for the subscription preferences pane when the subscription activation is pending") // MARK: Preferences when subscription is expired static let preferencesSubscriptionExpiredCaption = NSLocalizedString("subscription.preferences.subscription.expired.caption", value: "Subscribe again to continue using Privacy Pro.", comment: "Caption for the subscription preferences pane when the subscription activation is pending") @@ -87,7 +87,7 @@ enum UserText { // MARK: - Change plan or billing dialogs static let changeSubscriptionDialogTitle = NSLocalizedString("subscription.dialog.change.title", value: "Change Plan or Billing", comment: "Change plan or billing dialog title") static let changeSubscriptionGoogleDialogDescription = NSLocalizedString("subscription.dialog.change.google.description", value: "Your subscription was purchased through the Google Play Store. To change your plan or billing settings, please open Google Play Store subscription settings on a device signed in to the same Google Account used to purchase your subscription.", comment: "Change plan or billing dialog subtitle description for subscription purchased via Google") - static let changeSubscriptionAppleDialogDescription = NSLocalizedString("subscription.dialog.change.apple.description", value: "Your subscription was purchased through the Apple App Store. To change your plan or billing settings, please go to Settings > Apple ID > Subscriptions on a device signed in to the same Apple ID used to purchase your subscription.", comment: "Change plan or billing dialog subtitle description for subscription purchased via Apple") + static let changeSubscriptionAppleDialogDescription = NSLocalizedString("subscription.dialog.change.apple.description", value: "Your subscription was purchased through the Apple App Store. To change your plan or billing settings, please go to System Settings > Apple ID > Media and Purchases > Subscriptions > Manage on a device signed in to the same Apple ID used to purchase your subscription.", comment: "Change plan or billing dialog subtitle description for subscription purchased via Apple") static let changeSubscriptionDialogDone = NSLocalizedString("subscription.dialog.change.done.button", value: "Done", comment: "Button to close the change subscription dialog") // MARK: - Remove from this device dialog @@ -124,7 +124,7 @@ enum UserText { } } - static let shareModalHasEmailDescription = NSLocalizedString("subscription.share.modal.has.email.description", value: "Use this email to activate your subscription on other devices. Open the DuckDuckGo app on another device and find Privacy Pro in browser settings.", comment: "Share subscription modal description for email address channel") + static let shareModalHasEmailDescription = NSLocalizedString("subscription.share.modal.has.email.description", value: "Use this email to activate your subscription from browser settings in the DuckDuckGo app on other devices", comment: "Share subscription modal description for email address channel") static let shareModalNoEmailDescription = NSLocalizedString("subscription.share.modal.no.email.description", value: "Add an email address to access your subscription in DuckDuckGo on other devices. We’ll only use this address to verify your subscription.", comment: "Share subscription modal description for email address channel") static let restorePurchasesDescription = NSLocalizedString("subscription.share.modal.restore.purchases.description", value: "Your subscription is automatically available in DuckDuckGo on any device signed in to your Apple ID.", comment: "Share subscription modal description for restoring Apple ID purchases")