feat(keyboard): ship AI hint carousel, home library cards, and clipboard polish

Rotate AI idle suggestions with optional remote packs, move history/dictionary onto self-sizing Home preview cards, harden clipboard capture/prompting, and simplify keyboard chrome by dropping most liquid-glass shadows.
This commit is contained in:
Rocky
2026-08-13 01:00:51 +08:00
parent fd6e0d3e7e
commit 9f308fadd2
202 changed files with 10897 additions and 5962 deletions
@@ -25,24 +25,17 @@ public enum EditLastInputPromptComposer {
"""
<edit_request protocol="edit-last-input-v1">
<source_text>
\(escapeXML(input.sourceText))
\(PromptXMLEscaping.escapeTextContent(input.sourceText))
</source_text>
<spoken_instruction>
\(escapeXML(input.spokenInstruction.trimmingCharacters(in: .whitespacesAndNewlines)))
\(PromptXMLEscaping.escapeTextContent(
input.spokenInstruction.trimmingCharacters(in: .whitespacesAndNewlines)
))
</spoken_instruction>
</edit_request>
"""
}
private static func escapeXML(_ text: String) -> String {
text
.replacingOccurrences(of: "&", with: "&amp;")
.replacingOccurrences(of: "<", with: "&lt;")
.replacingOccurrences(of: ">", with: "&gt;")
.replacingOccurrences(of: "\"", with: "&quot;")
.replacingOccurrences(of: "'", with: "&apos;")
}
private static let chinesePrompt = """
你是输入法中的文本编辑器。用户会提供“原文”和一条由语音识别得到的“编辑指令”。