05da6bdf43
Hand selected words off to the platform's native dictionary surface when the user opts into the new "System Dictionary" entry under Settings → Languages → Dictionaries. The setting is exclusive: enabling it disables all other providers (and vice versa) so the in-app lookup button either always opens the popup or always invokes the OS — no mixed states. Per platform: - macOS: AppKit's -[NSView showDefinitionForAttributedString:atPoint:] via a top-level Tauri command in src-tauri/src/macos/system_dictionary.rs. Anchored at the selection's bottom-center (CSS pixels mapped into NSView coords), so the inline Lookup HUD appears just below the highlighted text without raising Dictionary.app to the foreground. - iOS: UIReferenceLibraryViewController presented as a half-detent pageSheet on iPhone (medium → large drag-to-expand) and as a formSheet on iPad. Implemented in the native-bridge plugin. - Android: ACTION_PROCESS_TEXT intent with EXTRA_PROCESS_TEXT_READONLY, dispatched without createChooser so users get the standard system disambiguation dialog with "Just once / Always" buttons. Reports unavailable=true when no app handles the intent so the TS layer can silently skip rather than open an empty chooser. Web/Linux/Windows hide the row entirely. The provider is a sentinel — the registry filters it out of the popup tab list (it has no in-popup UI) and the annotator's handleDictionary checks isSystemDictionaryEnabled to dispatch directly to the native bridge before opening the in-app DictionaryPopup.
41 lines
1010 B
Rust
41 lines
1010 B
Rust
const COMMANDS: &[&str] = &[
|
|
"auth_with_safari",
|
|
"auth_with_custom_tab",
|
|
"copy_uri_to_path",
|
|
"use_background_audio",
|
|
"install_package",
|
|
"set_system_ui_visibility",
|
|
"get_status_bar_height",
|
|
"get_sys_fonts_list",
|
|
"intercept_keys",
|
|
"lock_screen_orientation",
|
|
"iap_is_available",
|
|
"iap_initialize",
|
|
"iap_fetch_products",
|
|
"iap_purchase_product",
|
|
"iap_restore_purchases",
|
|
"get_system_color_scheme",
|
|
"get_safe_area_insets",
|
|
"get_screen_brightness",
|
|
"set_screen_brightness",
|
|
"get_external_sdcard_path",
|
|
"open_external_url",
|
|
"show_lookup_popover",
|
|
"select_directory",
|
|
"get_storefront_region_code",
|
|
"register_listener",
|
|
"remove_listener",
|
|
"request_manage_storage_permission",
|
|
"check_permissions",
|
|
"request_permissions",
|
|
"checkPermissions",
|
|
"requestPermissions",
|
|
];
|
|
|
|
fn main() {
|
|
tauri_plugin::Builder::new(COMMANDS)
|
|
.android_path("android")
|
|
.ios_path("ios")
|
|
.build();
|
|
}
|