-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!(core & api): rename drag events for better consistency and …
…clarity (#10170) * refacotr!(core & api): rename drag events for better consistency and clarity * more renames * remove imports * fix drag over listen * update example --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
- Loading branch information
1 parent
69dcfdf
commit 261c9f9
Showing
13 changed files
with
159 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
"@tauri-apps/api": "patch:breaking" | ||
--- | ||
|
||
Renamed drag and drop events in `TauriEvent` enum to better convey when they are triggered: | ||
|
||
- `TauriEvent.DRAG` -> `TauriEvent.DRAG_ENTER` | ||
- `TauriEvent.DROP_OVER` -> `TauriEvent.DRAG_OVER` | ||
- `TauriEvent.DROP` -> `TauriEvent.DRAG_DROP` | ||
- `TauriEvent.DROP_CANCELLED` -> `TauriEvent::DRAG_LEAVE` | ||
|
||
Also the `type` field values in `Window/Webview/WebviewWindow.onDropEvent` and `DragDropEvent` have changed: | ||
|
||
- `dragged` -> `enter` | ||
- `dragOver` -> `over` | ||
- `dropped` -> `drop` | ||
- `cancelled` -> `leave` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
"tauri": "patch:breaking" | ||
--- | ||
|
||
Renamed `DragDropEvent` enum variants to better convey when they are triggered: | ||
|
||
- `DragDropEvent::Dragged` -> `DragDropEvent::Enter` | ||
- `DragDropEvent::DragOver` -> `DragDropEvent::Over` | ||
- `DragDropEvent::Dropped` -> `DragDropEvent::Drop` | ||
- `DragDropEvent::Cancelled` -> `DragDropEvent::Leave` | ||
|
||
This also comes with a change in the events being emitted to JS and Rust event listeners: | ||
|
||
- `tauri://drag` -> `tauri://drag-enter` | ||
- `tauri://drop-over` -> `tauri://drag-over` | ||
- `tauri://drop` -> `tauri://drag-drop` | ||
- `tauri://drag-cancelled` -> `tauri://drag-leave` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.