tauri-plugin-dragout

Crates.iotauri-plugin-dragout
lib.rstauri-plugin-dragout
version0.1.1
created_at2025-08-04 23:03:54.319185+00
updated_at2025-08-05 13:58:28.120231+00
descriptionTauri plugin providing native macOS drag-out (file promise) support
homepage
repositoryhttps://github.com/alexqqqqqq777/tauri-plugin-dragout
max_upload_size
id1781302
size161,871
(alexqqqqqq777)

documentation

README

tauri-plugin-dragout

Crates.io

Native drag-out (file promise) support for Tauri applications on macOS.

Finder and most Mac apps support dragging a file out of an application before it physically exists on disk. macOS achieves this with NSFilePromiseProvider – the app promises to create the file later, while the user keeps dragging.

This plugin exposes that capability to Rust-side Tauri code and the JavaScript frontend.


Features

  • Start a drag session for any file that is inside an archive or otherwise not yet present on disk.
  • The file is created lazily in the chosen destination when the user drops it.
  • Transparent integration with the system clipboard & drag-and-drop stack.

Platform: macOS 11+. Other platforms are currently not supported – the crate purposely fails to compile there.

Optional BlitzArch backend

When your project is built with the blitzarch_backend feature, the plugin uses blitzarch to extract files from archives on-the-fly. Disable the feature to remove that dependency and provide your own extraction logic.

[dependencies]
tauri-plugin-dragout = { version = "0.1", default-features = false }

Usage

Rust (main Tauri process):

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_dragout::init())
        .invoke_handler(tauri::generate_handler![native_drag_out])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Frontend (React / plain JS):

await window.__TAURI__.invoke("native_drag_out", {
  archivePath: "/Users/you/Downloads/big.zip",
  filePath: "docs/report.pdf"
});

Contributing

PRs and bug reports are welcome! The native part is Objective-C and can be tricky – tests and sample projects live under examples/ to help you iterate.


Author

Created by Oleksandr. If this plugin helped you, please star the repo or say thanks!


License

Dual-licensed under either of

at your option.

Commit count: 0

cargo fmt