tauri-plugin-dragout 0.1.1

Tauri plugin providing native macOS drag-out (file promise) support
docs.rs failed to build tauri-plugin-dragout-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: tauri-plugin-dragout-0.2.0

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.