ce55be4a-fb5f-4981-b507-0f4.../README.md

67 lines
2.1 KiB
Markdown
Raw Normal View History

# AirDrop Plugin for MioIsland
Quick access to macOS AirDrop from your Mio Island panel. Tap the
center of the card to pick files, then the system AirDrop sheet
appears and lets you send to nearby devices or contacts.
[简体中文](README.zh-CN.md)
## Features
- **One-tap file picker** — opens the native `NSOpenPanel`, supports
multi-select and folders.
- **Native AirDrop sheet** — uses `NSSharingService(.sendViaAirDrop)`,
the same API Finder uses. No private APIs, no entitlements.
- **Bi-lingual UI** — follows MioIsland's `appLanguage` preference
(`zh` / `en`).
- **Zero permissions required** — no Accessibility, no Automation, no
network. The plugin just delegates to macOS' built-in AirDrop.
## Why no drag-and-drop?
Mio Island's notch panel auto-collapses when the user clicks outside
it — that means the natural "open Island → Cmd-Tab to Finder → grab
file → drag back" workflow can't work, the panel disappears before
the drop target reaches. Rather than fight the host's event routing
(we tried, it broke in three different ways), this plugin commits
to a rock-solid **tap-to-choose** UX.
If you want drag-based sharing, stay tuned — a future Mio Island
host release may add a global drag-to-open trigger (similar to
Atoll's Dynamic Island drop zone).
## Requirements
- macOS 15.0+
- Mio Island v2.2.0+
## Building from source
```bash
./build.sh
```
Produces `build/airdrop.bundle` and `build/airdrop.zip`. Drop the
bundle into `~/.config/codeisland/plugins/` to test locally.
## Structure
```
Sources/
├── MioPlugin.swift ← protocol copy (runtime-matched via @objc)
├── AirDropPlugin.swift ← principal class, Info.plist NSPrincipalClass
├── AirDropState.swift ← @MainActor ObservableObject phase machine
├── services/
│ └── AirDropService.swift ← thin wrapper around NSSharingService
├── ui/
│ ├── ExpandedView.swift ← card-in-container layout
│ └── DropZoneView.swift ← tap-target, phase-reactive visuals
└── support/
├── Localization.swift
└── HostVersionCheck.swift
```
## License
MIT — see [LICENSE](LICENSE).