feat(keyboard): harden clipboard command and add What's New sheet
Stabilize clipboard long-press prepare/resume across paste alerts and cold start, add an in-app release-notes sheet with remote bilingual HTML, localize typing input settings, and bump build to 55.
This commit is contained in:
@@ -1,12 +1,27 @@
|
||||
// ClipboardPasteboardReader.swift
|
||||
// OSGKeyboard · Keyboard Extension
|
||||
//
|
||||
// Opportunity-read of UIPasteboard for clipboard-command eligibility.
|
||||
// Pasteboard peeks for clipboard-command UI and long-press snapshot capture.
|
||||
//
|
||||
// Idle affordance must use metadata only (`hasStrings` / `changeCount`) so the
|
||||
// system「允许粘贴」alert never appears while the keyboard is merely open.
|
||||
// Content reads (`string`) happen only on an explicit long-press.
|
||||
|
||||
import UIKit
|
||||
import OSGKeyboardShared
|
||||
|
||||
enum ClipboardPasteboardReader {
|
||||
/// Metadata-only — does not trigger the paste permission prompt.
|
||||
static func changeCount() -> Int {
|
||||
UIPasteboard.general.changeCount
|
||||
}
|
||||
|
||||
/// Metadata-only — whether the pasteboard currently holds string items.
|
||||
static func hasStrings() -> Bool {
|
||||
UIPasteboard.general.hasStrings
|
||||
}
|
||||
|
||||
/// Content sample for long-press snapshot. May present the system paste alert.
|
||||
static func sample() -> (changeCount: Int, text: String?) {
|
||||
let board = UIPasteboard.general
|
||||
let changeCount = board.changeCount
|
||||
|
||||
Reference in New Issue
Block a user