Skip to content

Commit 16e550e

Browse files
refactor(core): add webview events (#8844)
* refactor(core): add webview events * license header * clippy * fix doctests * more doctests * fix JS `listen` with `EventTarget::Any` * typo * update module import * clippy * remove console.log * fix api example * fix documentation for emiTo [skip ci] * actually add RunEvent::WebviewEvent * update migration * lint --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
1 parent 5618f6d commit 16e550e

31 files changed

+779
-381
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@tauri-apps/api': 'patch:breaking'
3+
---
4+
5+
Renamed the following enum variants of `TauriEvent` enum:
6+
7+
- `TauriEvent.WEBVIEW_FILE_DROP` -> `TauriEvent.FILE_DROP`
8+
- `TauriEvent.WEBVIEW_FILE_DROP_HOVER` -> `TauriEvent.FILE_DROP_HOVER`
9+
- `TauriEvent.WEBVIEW_FILE_DROP_CANCELLED` -> `TauriEvent.FILE_DROP_CANCELLED`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tauri-apps/api': 'patch:feat'
3+
---
4+
5+
Add a new `webviewWindow` module that exports `WebviewWindow` class and related methods such as `getCurrent` and `getAll`.

.changes/api-webview-window.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tauri-apps/api': 'patch:breaking'
3+
---
4+
5+
Move `WebviewWindow` class from `webview` module to a new `webviewWindow` module.

.changes/api-window-on-filedrop.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tauri-apps/api': 'patch:feat'
3+
---
4+
5+
Add `Window.onFileDropEvent` method.

.changes/core-js-event-anytarget.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri': 'patch:bug'
3+
---
4+
5+
Fix JS event listeners registered using JS `listen` api with `EventTarget::Any` never fired.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'tauri-runtime': 'patch'
3+
'tauri-runtime-wry': 'patch'
4+
---
5+
6+
Add `WebviewEvent`, `RunEvent::WebviewEvent` and `WebviewDispatch::on_webview_event`.

.changes/tauri-webview-events.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'tauri': 'patch:feat'
3+
---
4+
5+
Add webview-specific events for multi-webview windows:
6+
7+
- Add `WebviewEvent` enum
8+
- Add `RunEvent::WebviewEvent` variant.
9+
- Add `Builder::on_webview_event` and `Webview::on_webview_event` methods.

.github/workflows/test-core.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
- name: test (using cross)
9595
if: ${{ matrix.platform.cross }}
9696
run: |
97-
cargo install cross --git https://github.com/cross-rs/cross
97+
cargo install cross --git https://github.com/cross-rs/cross --locked
9898
cross ${{ matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }}
9999
100100
- name: test (using cargo)

0 commit comments

Comments
 (0)