From 84133b57b8c443007c728dd8dbe32b08804009f9 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Mon, 7 Aug 2023 19:20:17 +0300 Subject: [PATCH] feat(window): refactor and improvements (#426) Co-authored-by: Lucas Nogueira --- .changes/shell-command-apis.md | 2 +- .changes/window-plugin-refactor.md | 10 + examples/api/src/App.svelte | 20 +- examples/api/src/views/Communication.svelte | 4 +- examples/api/src/views/Window.svelte | 8 +- plugins/window/README.md | 8 +- plugins/window/guest-js/index.ts | 599 ++++++++++---------- plugins/window/src/api-iife.js | 2 +- 8 files changed, 323 insertions(+), 330 deletions(-) create mode 100644 .changes/window-plugin-refactor.md diff --git a/.changes/shell-command-apis.md b/.changes/shell-command-apis.md index 2307e07c..86ee5a40 100644 --- a/.changes/shell-command-apis.md +++ b/.changes/shell-command-apis.md @@ -2,4 +2,4 @@ "shell": "patch" --- -Added `Command::arg`, `Command::env` and changed `Command::new` input type. \ No newline at end of file +Added `Command::arg`, `Command::env` and changed `Command::new` input type. diff --git a/.changes/window-plugin-refactor.md b/.changes/window-plugin-refactor.md new file mode 100644 index 00000000..000d4c23 --- /dev/null +++ b/.changes/window-plugin-refactor.md @@ -0,0 +1,10 @@ +--- +"window": "patch" +"window-js": "patch" +--- + +The window plugin is recieving a few changes to improve consistency and add new features: + +- Removed `appWindow` variable from JS module, use `getCurrent` or `Window.getCurrent`. +- Removed `WindowManager`, `WebviewWindow` and `WebviewHandle` types and merged them into one `Window` type that matches the name of the rust window type. +- Added `Window.getCurrent` and `Window.getAll` which is a convenient method for `getCurrent` and `getAll` functions. diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index dd0df993..740ebeca 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -1,7 +1,7 @@