mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-01 12:08:06 +02:00
Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12adc1dbec | |||
| 553c87bde0 | |||
| d74fc0a097 | |||
| d5a7c77a8d | |||
| 4ab90f048e | |||
| 84133b57b8 | |||
| 5b3210c224 | |||
| be591d2feb | |||
| 7d9df7297a | |||
| 7f2e2dd5b8 | |||
| 6f01bc11ab | |||
| aba07c27b8 | |||
| 0bba6932c0 | |||
| 52ef0addd8 | |||
| 5fd597ddaf | |||
| 56d455d343 | |||
| a79d6d94bd | |||
| 83abea3cae | |||
| 0417b7ad60 | |||
| 1cb831183c | |||
| db7f4f9a41 | |||
| c8c3191565 | |||
| 2fc420ba37 | |||
| c81dff292a | |||
| 32c2a441c3 | |||
| 9359b5b138 | |||
| 84b3612393 | |||
| c73049d3ed | |||
| 1091d6d6ac | |||
| 91ffc01a91 | |||
| 0413ed3ce6 | |||
| b3d7d11ae3 | |||
| d8b4aca69f | |||
| 29bf8a2ab4 | |||
| 393667b547 | |||
| cf5864266e | |||
| 0f480d0985 | |||
| a7cba0dac7 | |||
| 7906397c64 | |||
| 7d71ad4e58 |
+26
-4
@@ -41,7 +41,7 @@
|
||||
"app",
|
||||
"log-plugin",
|
||||
"cli",
|
||||
"clipboard",
|
||||
"clipboard-manager",
|
||||
"dialog",
|
||||
"fs",
|
||||
"global-shortcut",
|
||||
@@ -52,7 +52,8 @@
|
||||
"shell",
|
||||
"updater",
|
||||
"window"
|
||||
]
|
||||
],
|
||||
"postversion": "pnpm install"
|
||||
},
|
||||
"api-example-js": {
|
||||
"path": "./examples/api",
|
||||
@@ -62,7 +63,7 @@
|
||||
"app-js",
|
||||
"log-js",
|
||||
"cli-js",
|
||||
"clipboard-js",
|
||||
"clipboard-manager-js",
|
||||
"dialog-js",
|
||||
"fs-js",
|
||||
"global-shortcut-js",
|
||||
@@ -231,7 +232,28 @@
|
||||
|
||||
"sql": {
|
||||
"path": "./plugins/sql",
|
||||
"manager": "rust"
|
||||
"manager": "rust",
|
||||
"publish": [
|
||||
{
|
||||
"command": "cargo package --no-verify",
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Cargo Publish</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "cargo publish --features sqlite",
|
||||
"dryRunCommand": "cargo publish --features sqlite --dry-run",
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"sql-js": {
|
||||
"path": "./plugins/sql",
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"dialog": "patch"
|
||||
---
|
||||
|
||||
On non-Linux system, use `AsyncMessageDialog` instead of `MessageDialog`. [(tauri#7182)](https://github.com/tauri-apps/tauri/issues/7182)
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-js": "minor:feat"
|
||||
---
|
||||
|
||||
Added the `maximizable`, `minimizable` and `closable` fields on `WindowOptions`.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"window": "minor:feat"
|
||||
"window-js": "minor:feat"
|
||||
---
|
||||
|
||||
Added the `setMaximizable`, `setMinimizable`, `setClosable`, `isMaximizable`, `isMinimizable` and `isClosable` methods.
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
"app": patch
|
||||
"authenticator": patch
|
||||
"autostart": patch
|
||||
"cli": patch
|
||||
"clipboard-manager": patch
|
||||
"dialog": patch
|
||||
"fs": patch
|
||||
"global-shortcut": patch
|
||||
"http": patch
|
||||
"localhost": patch
|
||||
"log-plugin": patch
|
||||
"notification": patch
|
||||
"os": patch
|
||||
"persisted-scope": patch
|
||||
"positioner": patch
|
||||
"process": patch
|
||||
"shell": patch
|
||||
"single-instance": patch
|
||||
"sql": patch
|
||||
"store": patch
|
||||
"stronghold": patch
|
||||
"updater": patch
|
||||
"upload": patch
|
||||
"websocket": patch
|
||||
"window": patch
|
||||
"window-state": patch
|
||||
---
|
||||
|
||||
Fixes docs.rs build by enabling the `tauri/dox` feature flag.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fs-js": patch
|
||||
---
|
||||
|
||||
Fix `writeBinaryFile` crashing with `command 'write_binary_file' not found`
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"http-js": minor
|
||||
---
|
||||
|
||||
Multipart requests are now handled in JavaScript by the `Request` JavaScript class so you just need to use a `FormData` body and not set the content-type header to `multipart/form-data`. `application/x-www-form-urlencoded` requests must be done manually.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"http": minor
|
||||
"http-js": minor
|
||||
---
|
||||
|
||||
The http plugin has been rewritten from scratch and now only exposes a `fetch` function in Javascript and Re-exports `reqwest` crate in Rust. The new `fetch` method tries to be as close and compliant to the `fetch` Web API as possible.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Use `window.__TAURI_INVOKE__` instead of `window.__TAURI__` in init.js, fixes usage in apps without `withGlobalTauri` enabled.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Revert [7d71ad4e5](https://github.com/tauri-apps/plugins-workspace/commit/7d71ad4e587bcf47ea34645f5b226945e487b765) which added a default sound for notifications on Windows. This introduced inconsistency with other platforms that has silent notifications by default. In the upcoming releases, we will add support for modifying the notification sound across all platforms.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Play a default sound when showing a notification on Windows.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
"os": minor
|
||||
"os-js": minor
|
||||
---
|
||||
|
||||
The os plugin is recieving a few changes to improve consistency and add new features:
|
||||
|
||||
- Renamed `Kind` enum to `OsType` and `kind()` function to `os_type()`.
|
||||
- Added `family()`,`exe_extension()`, and `hostname()` functions and their equivalents for JS.
|
||||
- Removed `tempdir()` function and its equivalent on JS, use `std::env::temp_dir` instead of `temp_dir` from `tauri::path::PathResolver::temp_dir` and `path.tempDir` on JS.
|
||||
- Modified `platform()` implementation to return `windows` instead of `win32` and `macos` instead of `darwin` to align with Rust's `std::env::consts::OS`
|
||||
- `EOL` const in JS has been modified into a function `eol()` fix import issues in frameworks like `next.js`
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"persisted-scope": patch
|
||||
---
|
||||
|
||||
Split up fs and asset scopes. **This will reset the asset protocol scope once!**
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"persisted-scope": patch
|
||||
---
|
||||
|
||||
Fix usage of directory patterns by removing glob asterisks at the end before allowing/forbidding them. This was causing them to be escaped, and so undesirable paths were allowed/forbidden while polluting the `.persisted-scope` file.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"positioner": patch
|
||||
---
|
||||
|
||||
Change `system-tray` feature flag to `tray-icon`.
|
||||
+31
-1
@@ -1,4 +1,34 @@
|
||||
{
|
||||
"tag": "alpha",
|
||||
"changes": [".changes/persisted-scope-fix-oom.md", ".changes/v2-alpha.md"]
|
||||
"changes": [
|
||||
".changes/dialog-async-message-dialog.md",
|
||||
".changes/disable-window-controls-api-options.md",
|
||||
".changes/disable-window-controls-api.md",
|
||||
".changes/fix-docs-build.md",
|
||||
".changes/fs-wiret-binary-file.md",
|
||||
".changes/http-multipart-refactor.md",
|
||||
".changes/http-plugin-refactor.md",
|
||||
".changes/notification-init-script.md",
|
||||
".changes/notification-revert-sound.md",
|
||||
".changes/notification-sound.md",
|
||||
".changes/os-plugin-refactor.md",
|
||||
".changes/persisted-scope-asset.md",
|
||||
".changes/persisted-scope-glob.md",
|
||||
".changes/positioner-tray-flag.md",
|
||||
".changes/shell-command-apis.md",
|
||||
".changes/shell-detached.md",
|
||||
".changes/stronghold-arg-name.md",
|
||||
".changes/stronghold-constructor.md",
|
||||
".changes/tauri-alpha.11.md",
|
||||
".changes/updater-nsis-admin.md",
|
||||
".changes/updater-nsis.md",
|
||||
".changes/updater-plugin-refactor.md",
|
||||
".changes/v2-alpha.md",
|
||||
".changes/window-incognito.md",
|
||||
".changes/window-is-focused.md",
|
||||
".changes/window-plugin-refactor.md",
|
||||
".changes/window-set-effects.md",
|
||||
".changes/window-state-decorated.md",
|
||||
".changes/window-state-promise.md"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"shell": "patch"
|
||||
---
|
||||
|
||||
Added `Command::arg`, `Command::env` and changed `Command::new` input type.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"shell": patch
|
||||
---
|
||||
|
||||
Ensure the launched process is detached so it can out-live your tauri app and does not shutdown with it.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"stronghold-js": patch
|
||||
---
|
||||
|
||||
Change the argument name of the `Stronghold.remove` from `location` to `recordPath` to match the Stronghold command argument
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"stronghold-js": minor
|
||||
---
|
||||
|
||||
Added `Stronghold.load` and removed its constructor.
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
"app": patch
|
||||
"app-js": patch
|
||||
"authenticator": patch
|
||||
"authenticator-js": patch
|
||||
"autostart": patch
|
||||
"autostart-js": patch
|
||||
"cli": patch
|
||||
"cli-js": patch
|
||||
"clipboard-manager": patch
|
||||
"clipboard-manager-js": patch
|
||||
"dialog": patch
|
||||
"dialog-js": patch
|
||||
"fs": patch
|
||||
"fs-js": patch
|
||||
"global-shortcut": patch
|
||||
"global-shortcut-js": patch
|
||||
"http": patch
|
||||
"http-js": patch
|
||||
"localhost": patch
|
||||
"log-plugin": patch
|
||||
"log-js": patch
|
||||
"notification": patch
|
||||
"notification-js": patch
|
||||
"os": patch
|
||||
"os-js": patch
|
||||
"persisted-scope": patch
|
||||
"positioner": patch
|
||||
"positioner-js": patch
|
||||
"process": patch
|
||||
"process-js": patch
|
||||
"shell": patch
|
||||
"shell-js": patch
|
||||
"single-instance": patch
|
||||
"sql": patch
|
||||
"sql-js": patch
|
||||
"store": patch
|
||||
"store-js": patch
|
||||
"stronghold": patch
|
||||
"stronghold-js": patch
|
||||
"updater": patch
|
||||
"updater-js": patch
|
||||
"upload": patch
|
||||
"upload-js": patch
|
||||
"websocket": patch
|
||||
"websocket-js": patch
|
||||
"window": patch
|
||||
"window-js": patch
|
||||
"window-state": patch
|
||||
"window-state-js": patch
|
||||
---
|
||||
|
||||
Update to alpha.11.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": "patch"
|
||||
---
|
||||
|
||||
On Windows, fix NSIS installers requiring administrator rights failing to be launched by updater.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
Implement passive mode on NSIS and automatically restart after NSIS update.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"updater": minor
|
||||
"updater-js": minor
|
||||
---
|
||||
|
||||
The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-js": "minor"
|
||||
---
|
||||
|
||||
Add `incognito` window configuration option
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"window": "minor:feat"
|
||||
"window-js": "minor:feat"
|
||||
---
|
||||
|
||||
Add `WebviewWindow.is_focused` and `WebviewWindow.getFocusedWindow` getters.
|
||||
@@ -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.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"window": "patch"
|
||||
"window-js": "patch"
|
||||
---
|
||||
|
||||
Added the `setEffects` and `clearEffects` API.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": "patch"
|
||||
---
|
||||
|
||||
Correctly set decoration state if no saved state xists
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state-js": "patch"
|
||||
---
|
||||
|
||||
Correctly propagate the promise inside `saveWindowState`, `restoreState` and `restoreStateCurrent` so callers can choose to `await` them.
|
||||
+2
-1
@@ -2,4 +2,5 @@ target
|
||||
node_modules
|
||||
dist
|
||||
dist-js
|
||||
api-iife.js
|
||||
api-iife.js
|
||||
init.js
|
||||
@@ -0,0 +1,54 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: integration tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/integration-tests.yml"
|
||||
- "plugins/updater/src/**"
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/integration-tests.yml"
|
||||
- "plugins/updater/src/**"
|
||||
|
||||
jobs:
|
||||
run-integration-tests:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev libfuse2
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: install Tauri CLI
|
||||
run: cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch dev
|
||||
|
||||
- name: run integration tests
|
||||
run: cargo test --test '*' -- --ignored
|
||||
@@ -193,6 +193,11 @@ jobs:
|
||||
working-directory: examples/api
|
||||
run: mkdir dist
|
||||
|
||||
- name: Downgrade crates with MSRV conflict
|
||||
# The --precise flag can only be used once per invocation.
|
||||
run: |
|
||||
cargo update -p time@0.3.24 --precise 0.3.23
|
||||
|
||||
- name: test ${{ matrix.package }}
|
||||
if: matrix.package != 'tauri-plugin-sql'
|
||||
uses: actions-rs/cargo@v1
|
||||
|
||||
@@ -116,6 +116,6 @@ if (files.length > 0) {
|
||||
console.log(missing.join("\n"));
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ https.get(url, options, (response) => {
|
||||
}
|
||||
} else if (kind === "npm") {
|
||||
const versions = Object.keys(data.versions || {}).filter((v) =>
|
||||
v.startsWith(target)
|
||||
v.startsWith(target),
|
||||
);
|
||||
console.log(versions[versions.length - 1] || "0.0.0");
|
||||
}
|
||||
|
||||
Generated
+1650
-1013
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -5,8 +5,8 @@ resolver = "2"
|
||||
[workspace.dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = "2.0.0-alpha.9"
|
||||
tauri-build = "2.0.0-alpha.5"
|
||||
tauri = "2.0.0-alpha.11"
|
||||
tauri-build = "2.0.0-alpha.8"
|
||||
serde_json = "1"
|
||||
thiserror = "1"
|
||||
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `window-js@2.0.0-alpha.1`
|
||||
- Upgraded to `fs-js@2.0.0-alpha.1`
|
||||
- Upgraded to `http-js@2.0.0-alpha.1`
|
||||
- Upgraded to `os-js@2.0.0-alpha.1`
|
||||
- Upgraded to `app-js@2.0.0-alpha.1`
|
||||
- Upgraded to `cli-js@2.0.0-alpha.1`
|
||||
- Upgraded to `dialog-js@2.0.0-alpha.1`
|
||||
- Upgraded to `global-shortcut-js@2.0.0-alpha.1`
|
||||
- Upgraded to `log-js@2.0.0-alpha.1`
|
||||
- Upgraded to `notification-js@2.0.0-alpha.1`
|
||||
- Upgraded to `process-js@2.0.0-alpha.1`
|
||||
- Upgraded to `shell-js@2.0.0-alpha.1`
|
||||
- Upgraded to `updater-js@2.0.0-alpha.1`
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en" theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
||||
/>
|
||||
<title>Svelte + Vite App</title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
+25
-24
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "svelte-app",
|
||||
"private": true,
|
||||
"version": "2.0.0-alpha.0",
|
||||
"version": "2.0.0-alpha.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --clearScreen false",
|
||||
@@ -9,30 +9,31 @@
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.4",
|
||||
"@zerodevx/svelte-json-view": "0.2.1",
|
||||
"@tauri-apps/plugin-app": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-cli": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-fs": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-global-shortcut": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-http": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-notification": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-os": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-process": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-shell": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-updater": "2.0.0-alpha.0",
|
||||
"@tauri-apps/plugin-window": "2.0.0-alpha.0"
|
||||
"@tauri-apps/api": "2.0.0-alpha.6",
|
||||
"@tauri-apps/plugin-app": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-cli": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-fs": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-global-shortcut": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-http": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-notification": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-os": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-process": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-shell": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-updater": "2.0.0-alpha.1",
|
||||
"@tauri-apps/plugin-window": "2.0.0-alpha.1",
|
||||
"@zerodevx/svelte-json-view": "1.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/codicon": "^1.1.10",
|
||||
"@iconify-json/ph": "^1.1.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^1.0.1",
|
||||
"@tauri-apps/cli": "2.0.0-alpha.9",
|
||||
"internal-ip": "^7.0.0",
|
||||
"svelte": "^3.49.0",
|
||||
"unocss": "^0.39.3",
|
||||
"vite": "^3.0.9"
|
||||
"@iconify-json/codicon": "^1.1.26",
|
||||
"@iconify-json/ph": "^1.1.5",
|
||||
"@sveltejs/vite-plugin-svelte": "^2.4.1",
|
||||
"@tauri-apps/cli": "2.0.0-alpha.11",
|
||||
"@unocss/extractor-svelte": "^0.53.1",
|
||||
"internal-ip": "^8.0.0",
|
||||
"svelte": "^3.59.1",
|
||||
"unocss": "^0.53.1",
|
||||
"vite": "^4.3.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `dialog@2.0.0-alpha.1`
|
||||
- Upgraded to `window@2.0.0-alpha.1`
|
||||
- Upgraded to `app@2.0.0-alpha.1`
|
||||
- Upgraded to `cli@2.0.0-alpha.1`
|
||||
- Upgraded to `fs@2.0.0-alpha.1`
|
||||
- Upgraded to `global-shortcut@2.0.0-alpha.1`
|
||||
- Upgraded to `http@2.0.0-alpha.1`
|
||||
- Upgraded to `log-plugin@2.0.0-alpha.1`
|
||||
- Upgraded to `notification@2.0.0-alpha.2`
|
||||
- Upgraded to `os@2.0.0-alpha.1`
|
||||
- Upgraded to `process@2.0.0-alpha.1`
|
||||
- Upgraded to `shell@2.0.0-alpha.1`
|
||||
- Upgraded to `updater@2.0.0-alpha.1`
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Updated to latest `notification`
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "api"
|
||||
publish = false
|
||||
version = "2.0.0-alpha.0"
|
||||
version = "2.0.0-alpha.2"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
rust-version = { workspace = true }
|
||||
license = "Apache-2.0 OR MIT"
|
||||
|
||||
[lib]
|
||||
@@ -18,17 +18,17 @@ serde_json = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
tiny_http = "0.11"
|
||||
log = { workspace = true }
|
||||
tauri-plugin-app = { path = "../../../plugins/app", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-app = { path = "../../../plugins/app", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-alpha.0", features = [ "windows7-compat" ] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-window = { path = "../../../plugins/window", version = "2.0.0-alpha.0", features = [ "devtools", "icon-ico", "icon-png" ] }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-alpha.2", features = [ "windows7-compat" ] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-window = { path = "../../../plugins/window", version = "2.0.0-alpha.1", features = [ "devtools", "icon-ico", "icon-png" ] }
|
||||
|
||||
[dependencies.tauri]
|
||||
workspace = true
|
||||
@@ -37,14 +37,14 @@ tauri-plugin-window = { path = "../../../plugins/window", version = "2.0.0-alpha
|
||||
"icon-png",
|
||||
"isolation",
|
||||
"macos-private-api",
|
||||
"system-tray",
|
||||
"tray-icon",
|
||||
"protocol-asset"
|
||||
]
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-alpha.1" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-alpha.1" }
|
||||
|
||||
[target."cfg(target_os = \"windows\")".dependencies]
|
||||
window-shadows = "0.2"
|
||||
|
||||
@@ -44,7 +44,7 @@ pub fn run() {
|
||||
.setup(move |app| {
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
tray::create_tray(app)?;
|
||||
tray::create_tray(app.handle())?;
|
||||
app.handle().plugin(tauri_plugin_cli::init())?;
|
||||
app.handle()
|
||||
.plugin(tauri_plugin_global_shortcut::Builder::new().build())?;
|
||||
@@ -56,7 +56,7 @@ pub fn run() {
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
window_builder = window_builder
|
||||
.user_agent("Tauri API")
|
||||
.user_agent(&format!("Tauri API - {}", std::env::consts::OS))
|
||||
.title("Tauri API Validation")
|
||||
.inner_size(1000., 800.)
|
||||
.min_inner_size(600., 400.)
|
||||
@@ -71,6 +71,11 @@ pub fn run() {
|
||||
.decorations(false);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
window_builder = window_builder.transparent(true);
|
||||
}
|
||||
|
||||
let window = window_builder.build().unwrap();
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
|
||||
@@ -4,140 +4,113 @@
|
||||
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use tauri::{
|
||||
CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, WindowBuilder, WindowUrl,
|
||||
menu::{Menu, MenuItem},
|
||||
tray::{ClickType, TrayIconBuilder},
|
||||
Manager, Runtime, WindowBuilder, WindowUrl,
|
||||
};
|
||||
use tauri_plugin_dialog::DialogExt;
|
||||
use tauri_plugin_shell::ShellExt;
|
||||
|
||||
pub fn create_tray(app: &tauri::App) -> tauri::Result<()> {
|
||||
let mut tray_menu1 = SystemTrayMenu::new()
|
||||
.add_item(CustomMenuItem::new("toggle", "Toggle"))
|
||||
.add_item(CustomMenuItem::new("new", "New window"))
|
||||
.add_item(CustomMenuItem::new("icon_1", "Tray Icon 1"))
|
||||
.add_item(CustomMenuItem::new("icon_2", "Tray Icon 2"));
|
||||
|
||||
pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
|
||||
let toggle_i = MenuItem::with_id(app, "toggle", "Toggle", true, None);
|
||||
let new_window_i = MenuItem::with_id(app, "new-window", "New window", true, None);
|
||||
let icon_i_1 = MenuItem::with_id(app, "icon-1", "Icon 1", true, None);
|
||||
let icon_i_2 = MenuItem::with_id(app, "icon-2", "Icon 2", true, None);
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
tray_menu1 = tray_menu1.add_item(CustomMenuItem::new("set_title", "Set Title"));
|
||||
}
|
||||
let set_title_i = MenuItem::with_id(app, "set-title", "Set Title", true, None);
|
||||
let switch_i = MenuItem::with_id(app, "switch-menu", "Switch Menu", true, None);
|
||||
let quit_i = MenuItem::with_id(app, "quit", "Quit", true, None);
|
||||
let remove_tray_i = MenuItem::with_id(app, "remove-tray", "Remove Tray icon", true, None);
|
||||
let menu1 = Menu::with_items(
|
||||
app,
|
||||
&[
|
||||
&toggle_i,
|
||||
&new_window_i,
|
||||
&icon_i_1,
|
||||
&icon_i_2,
|
||||
#[cfg(target_os = "macos")]
|
||||
&set_title_i,
|
||||
&switch_i,
|
||||
&quit_i,
|
||||
&remove_tray_i,
|
||||
],
|
||||
)?;
|
||||
let menu2 = Menu::with_items(
|
||||
app,
|
||||
&[&toggle_i, &new_window_i, &switch_i, &quit_i, &remove_tray_i],
|
||||
)?;
|
||||
|
||||
tray_menu1 = tray_menu1
|
||||
.add_item(CustomMenuItem::new("switch_menu", "Switch Menu"))
|
||||
.add_item(CustomMenuItem::new("about", "About"))
|
||||
.add_item(CustomMenuItem::new("exit_app", "Quit"))
|
||||
.add_item(CustomMenuItem::new("destroy", "Destroy"));
|
||||
|
||||
let tray_menu2 = SystemTrayMenu::new()
|
||||
.add_item(CustomMenuItem::new("toggle", "Toggle"))
|
||||
.add_item(CustomMenuItem::new("new", "New window"))
|
||||
.add_item(CustomMenuItem::new("switch_menu", "Switch Menu"))
|
||||
.add_item(CustomMenuItem::new("about", "About"))
|
||||
.add_item(CustomMenuItem::new("exit_app", "Quit"))
|
||||
.add_item(CustomMenuItem::new("destroy", "Destroy"));
|
||||
let is_menu1 = AtomicBool::new(true);
|
||||
|
||||
let handle = app.handle();
|
||||
let tray_id = "my-tray".to_string();
|
||||
SystemTray::new()
|
||||
.with_id(&tray_id)
|
||||
.with_menu(tray_menu1.clone())
|
||||
.with_tooltip("Tauri")
|
||||
.on_event(move |event| {
|
||||
let tray_handle = handle.tray_handle_by_id(&tray_id).unwrap();
|
||||
match event {
|
||||
SystemTrayEvent::LeftClick {
|
||||
position: _,
|
||||
size: _,
|
||||
..
|
||||
} => {
|
||||
let window = handle.get_window("main").unwrap();
|
||||
window.show().unwrap();
|
||||
window.set_focus().unwrap();
|
||||
let _ = TrayIconBuilder::with_id("tray-1")
|
||||
.tooltip("Tauri")
|
||||
.icon(app.default_window_icon().unwrap().clone())
|
||||
.menu(&menu1)
|
||||
.menu_on_left_click(false)
|
||||
.on_menu_event(move |app, event| match event.id.as_ref() {
|
||||
"quit" => {
|
||||
app.exit(0);
|
||||
}
|
||||
"remove-tray" => {
|
||||
app.remove_tray_by_id("tray-1");
|
||||
}
|
||||
"toggle" => {
|
||||
if let Some(window) = app.get_window("main") {
|
||||
let new_title = if window.is_visible().unwrap_or_default() {
|
||||
let _ = window.hide();
|
||||
"Show"
|
||||
} else {
|
||||
let _ = window.show();
|
||||
let _ = window.set_focus();
|
||||
"Hide"
|
||||
};
|
||||
toggle_i.set_text(new_title).unwrap();
|
||||
}
|
||||
SystemTrayEvent::MenuItemClick { id, .. } => {
|
||||
let item_handle = tray_handle.get_item(&id);
|
||||
match id.as_str() {
|
||||
"exit_app" => {
|
||||
// exit the app
|
||||
handle.exit(0);
|
||||
}
|
||||
"destroy" => {
|
||||
tray_handle.destroy().unwrap();
|
||||
}
|
||||
"toggle" => {
|
||||
let window = handle.get_window("main").unwrap();
|
||||
let new_title = if window.is_visible().unwrap() {
|
||||
window.hide().unwrap();
|
||||
"Show"
|
||||
} else {
|
||||
window.show().unwrap();
|
||||
"Hide"
|
||||
};
|
||||
item_handle.set_title(new_title).unwrap();
|
||||
}
|
||||
"new" => {
|
||||
WindowBuilder::new(&handle, "new", WindowUrl::App("index.html".into()))
|
||||
.title("Tauri")
|
||||
.build()
|
||||
.unwrap();
|
||||
}
|
||||
"set_title" => {
|
||||
#[cfg(target_os = "macos")]
|
||||
tray_handle.set_title("Tauri").unwrap();
|
||||
}
|
||||
"icon_1" => {
|
||||
#[cfg(target_os = "macos")]
|
||||
tray_handle.set_icon_as_template(true).unwrap();
|
||||
|
||||
tray_handle
|
||||
.set_icon(tauri::Icon::Raw(
|
||||
include_bytes!("../icons/tray_icon_with_transparency.png")
|
||||
.to_vec(),
|
||||
))
|
||||
.unwrap();
|
||||
}
|
||||
"icon_2" => {
|
||||
#[cfg(target_os = "macos")]
|
||||
tray_handle.set_icon_as_template(true).unwrap();
|
||||
|
||||
tray_handle
|
||||
.set_icon(tauri::Icon::Raw(
|
||||
include_bytes!("../icons/icon.ico").to_vec(),
|
||||
))
|
||||
.unwrap();
|
||||
}
|
||||
"switch_menu" => {
|
||||
let flag = is_menu1.load(Ordering::Relaxed);
|
||||
let (menu, tooltip) = if flag {
|
||||
(tray_menu2.clone(), "Menu 2")
|
||||
} else {
|
||||
(tray_menu1.clone(), "Tauri")
|
||||
};
|
||||
tray_handle.set_menu(menu).unwrap();
|
||||
tray_handle.set_tooltip(tooltip).unwrap();
|
||||
is_menu1.store(!flag, Ordering::Relaxed);
|
||||
}
|
||||
"about" => {
|
||||
let window = handle.get_window("main").unwrap();
|
||||
window
|
||||
.dialog()
|
||||
.message("Tauri demo app")
|
||||
.title("About app")
|
||||
.parent(&window)
|
||||
.ok_button_label("Homepage")
|
||||
.cancel_button_label("Cancel")
|
||||
.show(move |ok| {
|
||||
if ok {
|
||||
window.shell().open("https://tauri.app/", None).unwrap();
|
||||
}
|
||||
});
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
"new-window" => {
|
||||
let _ = WindowBuilder::new(app, "new", WindowUrl::App("index.html".into()))
|
||||
.title("Tauri")
|
||||
.build();
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
"set-title" => {
|
||||
if let Some(tray) = app.tray_by_id("tray-1") {
|
||||
let _ = tray.set_title(Some("Tauri"));
|
||||
}
|
||||
}
|
||||
i @ "icon-1" | i @ "icon-2" => {
|
||||
if let Some(tray) = app.tray_by_id("tray-1") {
|
||||
let _ = tray.set_icon(Some(tauri::Icon::Raw(if i == "icon-1" {
|
||||
include_bytes!("../icons/icon.ico").to_vec()
|
||||
} else {
|
||||
include_bytes!("../icons/tray_icon_with_transparency.png").to_vec()
|
||||
})));
|
||||
}
|
||||
}
|
||||
"switch-menu" => {
|
||||
let flag = is_menu1.load(Ordering::Relaxed);
|
||||
let (menu, tooltip) = if flag {
|
||||
(menu2.clone(), "Menu 2")
|
||||
} else {
|
||||
(menu1.clone(), "Tauri")
|
||||
};
|
||||
if let Some(tray) = app.tray_by_id("tray-1") {
|
||||
let _ = tray.set_menu(Some(menu));
|
||||
let _ = tray.set_tooltip(Some(tooltip));
|
||||
}
|
||||
is_menu1.store(!flag, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
_ => {}
|
||||
})
|
||||
.on_tray_event(|tray, event| {
|
||||
if event.click_type == ClickType::Left {
|
||||
let app = tray.app_handle();
|
||||
if let Some(window) = app.get_window("main") {
|
||||
let _ = window.show();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
})
|
||||
.build(app)
|
||||
.map(|_| ())
|
||||
.build(app);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
"security": {
|
||||
"csp": {
|
||||
"default-src": "'self' customprotocol: asset:",
|
||||
"connect-src": "ipc: https://ipc.localhost",
|
||||
"font-src": ["https://fonts.gstatic.com"],
|
||||
"img-src": "'self' asset: https://asset.localhost blob: data:",
|
||||
"style-src": "'unsafe-inline' 'self' https://fonts.googleapis.com"
|
||||
@@ -136,11 +137,6 @@
|
||||
"deny": ["$APPDATA/db/*.stronghold"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"systemTray": {
|
||||
"iconPath": "icons/tray_icon_with_transparency.png",
|
||||
"iconAsTemplate": true,
|
||||
"menuOnLeftClick": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-10
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import { writable } from "svelte/store";
|
||||
import { open } from "@tauri-apps/plugin-shell";
|
||||
import { appWindow, getCurrent } from "@tauri-apps/plugin-window";
|
||||
import { getCurrent } from "@tauri-apps/plugin-window";
|
||||
import * as os from "@tauri-apps/plugin-os";
|
||||
|
||||
import Welcome from "./views/Welcome.svelte";
|
||||
@@ -22,6 +22,8 @@
|
||||
import { onMount } from "svelte";
|
||||
import { ask } from "@tauri-apps/plugin-dialog";
|
||||
|
||||
const appWindow = getCurrent();
|
||||
|
||||
if (appWindow.label !== "main") {
|
||||
appWindow.onCloseRequested(async (event) => {
|
||||
const confirmed = await confirm("Are you sure?");
|
||||
@@ -121,20 +123,20 @@
|
||||
// Window controls
|
||||
let isWindowMaximized;
|
||||
onMount(async () => {
|
||||
const window = getCurrent();
|
||||
isWindowMaximized = await window.isMaximized();
|
||||
window.onResized(async () => {
|
||||
isWindowMaximized = await window.isMaximized();
|
||||
isWindowMaximized = await appWindow.isMaximized();
|
||||
appWindow.onResized(async () => {
|
||||
isWindowMaximized = await appWindow.isMaximized();
|
||||
});
|
||||
});
|
||||
|
||||
function minimize() {
|
||||
getCurrent().minimize();
|
||||
appWindow.minimize();
|
||||
}
|
||||
|
||||
async function toggleMaximize() {
|
||||
const window = getCurrent();
|
||||
(await window.isMaximized()) ? window.unmaximize() : window.maximize();
|
||||
(await appWindow.isMaximized())
|
||||
? appWindow.unmaximize()
|
||||
: appWindow.maximize();
|
||||
}
|
||||
|
||||
let confirmed_close = false;
|
||||
@@ -147,7 +149,7 @@
|
||||
}
|
||||
);
|
||||
if (confirmed_close) {
|
||||
getCurrent().close();
|
||||
appWindow.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,7 +356,7 @@
|
||||
<!-- Sidebar toggle, only visible on small screens -->
|
||||
<div
|
||||
id="sidebarToggle"
|
||||
class="z-2000 display-none lt-sm:flex justify-center items-center absolute top-2 left-2 w-8 h-8 rd-8
|
||||
class="z-2000 sidebar-toggle display-none lt-sm:flex justify-center absolute items-center w-8 h-8 rd-8
|
||||
bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"
|
||||
>
|
||||
{#if isSideBarOpen}
|
||||
|
||||
@@ -39,3 +39,19 @@ code.code-block {
|
||||
transform: translateX(var(--translate-x));
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-toggle {
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
padding: env(safe-area-inset-top) env(safe-area-inset-right)
|
||||
env(safe-area-inset-bottom) env(safe-area-inset-left);
|
||||
}
|
||||
|
||||
#sidebar,
|
||||
#console {
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<script>
|
||||
import { appWindow } from "@tauri-apps/plugin-window";
|
||||
import { getCurrent } from "@tauri-apps/plugin-window";
|
||||
import { invoke } from "@tauri-apps/api/tauri";
|
||||
import { onMount, onDestroy } from "svelte";
|
||||
|
||||
const appWindow = getCurrent();
|
||||
|
||||
export let onMessage;
|
||||
let unlisten;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { getClient, Body, ResponseType } from "@tauri-apps/plugin-http";
|
||||
import { fetch as tauriFetch } from "@tauri-apps/plugin-http";
|
||||
import { JsonView } from "@zerodevx/svelte-json-view";
|
||||
|
||||
let httpMethod = "GET";
|
||||
@@ -8,53 +8,62 @@
|
||||
export let onMessage;
|
||||
|
||||
async function makeHttpRequest() {
|
||||
const client = await getClient().catch((e) => {
|
||||
onMessage(e);
|
||||
throw e;
|
||||
});
|
||||
let method = httpMethod || "GET";
|
||||
|
||||
const options = {
|
||||
url: "http://localhost:3003",
|
||||
method: method || "GET",
|
||||
headers: {},
|
||||
};
|
||||
|
||||
if (
|
||||
(httpBody.startsWith("{") && httpBody.endsWith("}")) ||
|
||||
(httpBody.startsWith("[") && httpBody.endsWith("]"))
|
||||
) {
|
||||
options.body = Body.json(JSON.parse(httpBody));
|
||||
} else if (httpBody !== "") {
|
||||
options.body = Body.text(httpBody);
|
||||
let bodyType;
|
||||
|
||||
if (method !== "GET") {
|
||||
options.body = httpBody;
|
||||
|
||||
if (
|
||||
(httpBody.startsWith("{") && httpBody.endsWith("}")) ||
|
||||
(httpBody.startsWith("[") && httpBody.endsWith("]"))
|
||||
) {
|
||||
options.headers["Content-Type"] = "application/json";
|
||||
bodyType = "json";
|
||||
} else if (httpBody !== "") {
|
||||
bodyType = "text";
|
||||
}
|
||||
}
|
||||
|
||||
client.request(options).then(onMessage).catch(onMessage);
|
||||
const response = await tauriFetch("http://localhost:3003", options);
|
||||
const body =
|
||||
bodyType === "json" ? await response.json() : await response.text();
|
||||
|
||||
onMessage({
|
||||
url: response.url,
|
||||
status: response.status,
|
||||
ok: response.ok,
|
||||
headers: Object.fromEntries(response.headers.entries()),
|
||||
body,
|
||||
});
|
||||
}
|
||||
|
||||
/// http form
|
||||
let foo = "baz";
|
||||
let bar = "qux";
|
||||
let result = null;
|
||||
let multipart = true;
|
||||
|
||||
async function doPost() {
|
||||
const client = await getClient().catch((e) => {
|
||||
onMessage(e);
|
||||
throw e;
|
||||
});
|
||||
|
||||
result = await client.request({
|
||||
url: "http://localhost:3003",
|
||||
const form = new FormData();
|
||||
form.append("foo", foo);
|
||||
form.append("bar", bar);
|
||||
const response = await tauriFetch("http://localhost:3003", {
|
||||
method: "POST",
|
||||
body: Body.form({
|
||||
foo,
|
||||
bar,
|
||||
}),
|
||||
headers: multipart
|
||||
? { "Content-Type": "multipart/form-data" }
|
||||
: undefined,
|
||||
responseType: ResponseType.Text,
|
||||
body: form,
|
||||
});
|
||||
result = {
|
||||
url: response.url,
|
||||
status: response.status,
|
||||
ok: response.ok,
|
||||
headers: Object.fromEntries(response.headers.entries()),
|
||||
body: await response.text(),
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -87,11 +96,6 @@
|
||||
<input class="input" bind:value={bar} />
|
||||
</div>
|
||||
<br />
|
||||
<label>
|
||||
<input type="checkbox" bind:checked={multipart} />
|
||||
Multipart
|
||||
</label>
|
||||
<br />
|
||||
<br />
|
||||
<button class="btn" type="button" on:click={doPost}> Post it</button>
|
||||
<br />
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
<script>
|
||||
import {
|
||||
appWindow,
|
||||
WebviewWindow,
|
||||
getCurrent,
|
||||
LogicalSize,
|
||||
UserAttentionType,
|
||||
PhysicalSize,
|
||||
PhysicalPosition,
|
||||
Effect,
|
||||
EffectState,
|
||||
Window
|
||||
} from "@tauri-apps/plugin-window";
|
||||
import { open as openDialog } from "@tauri-apps/plugin-dialog";
|
||||
import { open } from "@tauri-apps/plugin-shell";
|
||||
|
||||
const appWindow = getCurrent();
|
||||
|
||||
let selectedWindow = appWindow.label;
|
||||
const windowMap = {
|
||||
[appWindow.label]: appWindow,
|
||||
@@ -57,12 +61,28 @@
|
||||
"rowResize",
|
||||
];
|
||||
|
||||
const windowsEffects = ["mica", "blur", "acrylic"];
|
||||
const isWindows = navigator.appVersion.includes("windows");
|
||||
const isMacOS = navigator.appVersion.includes("macos");
|
||||
let effectOptions = isWindows
|
||||
? windowsEffects
|
||||
: Object.keys(Effect)
|
||||
.map((effect) => Effect[effect])
|
||||
.filter((e) => !windowsEffects.includes(e));
|
||||
const effectStateOptions = Object.keys(EffectState).map(
|
||||
(state) => EffectState[state]
|
||||
);
|
||||
|
||||
export let onMessage;
|
||||
const mainEl = document.querySelector("main");
|
||||
|
||||
let newWindowLabel;
|
||||
|
||||
let urlValue = "https://tauri.app";
|
||||
let resizable = true;
|
||||
let maximizable = true;
|
||||
let minimizable = true;
|
||||
let closable = true;
|
||||
let maximized = false;
|
||||
let decorations = true;
|
||||
let alwaysOnTop = false;
|
||||
@@ -91,6 +111,12 @@
|
||||
let cursorIgnoreEvents = false;
|
||||
let windowTitle = "Awesome Tauri Example!";
|
||||
|
||||
let effects = [];
|
||||
let selectedEffect;
|
||||
let effectState;
|
||||
let effectRadius;
|
||||
let effectR, effectG, effectB, effectA;
|
||||
|
||||
function openUrl() {
|
||||
open(urlValue);
|
||||
}
|
||||
@@ -122,7 +148,7 @@
|
||||
function createWindow() {
|
||||
if (!newWindowLabel) return;
|
||||
|
||||
const webview = new WebviewWindow(newWindowLabel);
|
||||
const webview = new Window(newWindowLabel);
|
||||
windowMap[newWindowLabel] = webview;
|
||||
webview.once("tauri://error", function () {
|
||||
onMessage("Error creating new webview");
|
||||
@@ -172,12 +198,47 @@
|
||||
await windowMap[selectedWindow].requestUserAttention(null);
|
||||
}
|
||||
|
||||
async function addEffect() {
|
||||
if (!effects.includes(selectedEffect)) {
|
||||
effects = [...effects, selectedEffect];
|
||||
}
|
||||
|
||||
const payload = {
|
||||
effects,
|
||||
state: effectState,
|
||||
radius: effectRadius,
|
||||
};
|
||||
if (
|
||||
Number.isInteger(effectR) &&
|
||||
Number.isInteger(effectG) &&
|
||||
Number.isInteger(effectB) &&
|
||||
Number.isInteger(effectA)
|
||||
) {
|
||||
payload.color = [effectR, effectG, effectB, effectA];
|
||||
}
|
||||
|
||||
mainEl.classList.remove("bg-primary");
|
||||
mainEl.classList.remove("dark:bg-darkPrimary");
|
||||
await windowMap[selectedWindow].clearEffects();
|
||||
await windowMap[selectedWindow].setEffects(payload);
|
||||
}
|
||||
|
||||
async function clearEffects() {
|
||||
effects = [];
|
||||
await windowMap[selectedWindow].clearEffects();
|
||||
mainEl.classList.add("bg-primary");
|
||||
mainEl.classList.add("dark:bg-darkPrimary");
|
||||
}
|
||||
|
||||
$: {
|
||||
windowMap[selectedWindow];
|
||||
loadWindowPosition();
|
||||
loadWindowSize();
|
||||
}
|
||||
$: windowMap[selectedWindow]?.setResizable(resizable);
|
||||
$: windowMap[selectedWindow]?.setMaximizable(maximizable);
|
||||
$: windowMap[selectedWindow]?.setMinimizable(minimizable);
|
||||
$: windowMap[selectedWindow]?.setClosable(closable);
|
||||
$: maximized
|
||||
? windowMap[selectedWindow]?.maximize()
|
||||
: windowMap[selectedWindow]?.unmaximize();
|
||||
@@ -280,6 +341,18 @@
|
||||
Resizable
|
||||
<input type="checkbox" bind:checked={resizable} />
|
||||
</label>
|
||||
<label>
|
||||
Maximizable
|
||||
<input type="checkbox" bind:checked={maximizable} />
|
||||
</label>
|
||||
<label>
|
||||
Minimizable
|
||||
<input type="checkbox" bind:checked={minimizable} />
|
||||
</label>
|
||||
<label>
|
||||
Closable
|
||||
<input type="checkbox" bind:checked={closable} />
|
||||
</label>
|
||||
<label>
|
||||
Has decorations
|
||||
<input type="checkbox" bind:checked={decorations} />
|
||||
@@ -455,5 +528,88 @@
|
||||
<button class="btn" id="open-url"> Open URL </button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
{#if isWindows || isMacOS}
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="flex">
|
||||
<label>
|
||||
Effect
|
||||
<select class="input" bind:value={selectedEffect}>
|
||||
{#each effectOptions as effect}
|
||||
<option value={effect}>{effect}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
State
|
||||
<select class="input" bind:value={effectState}>
|
||||
{#each effectStateOptions as state}
|
||||
<option value={state}>{state}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Radius
|
||||
<input class="input" type="number" bind:value={effectRadius} />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<label>
|
||||
Color
|
||||
<div class="flex">
|
||||
<input
|
||||
style="max-width: 120px;"
|
||||
class="input"
|
||||
type="number"
|
||||
placeholder="R"
|
||||
bind:value={effectR}
|
||||
/>
|
||||
<input
|
||||
style="max-width: 120px;"
|
||||
class="input"
|
||||
type="number"
|
||||
placeholder="G"
|
||||
bind:value={effectG}
|
||||
/>
|
||||
<input
|
||||
style="max-width: 120px;"
|
||||
class="input"
|
||||
type="number"
|
||||
placeholder="B"
|
||||
bind:value={effectB}
|
||||
/>
|
||||
<input
|
||||
style="max-width: 120px;"
|
||||
class="input"
|
||||
type="number"
|
||||
placeholder="A"
|
||||
bind:value={effectA}
|
||||
/>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<button class="btn" style="width: 80px;" on:click={addEffect}
|
||||
>Add</button
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<div>
|
||||
Applied effects: {effects.length ? effects.join(",") : "None"}
|
||||
</div>
|
||||
|
||||
<button class="btn" style="width: 80px;" on:click={clearEffects}
|
||||
>Clear</button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -2,13 +2,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import {
|
||||
defineConfig,
|
||||
presetIcons,
|
||||
presetUno,
|
||||
extractorSvelte,
|
||||
presetWebFonts,
|
||||
} from "unocss";
|
||||
import { defineConfig, presetIcons, presetUno, presetWebFonts } from "unocss";
|
||||
import extractorSvelte from "@unocss/extractor-svelte";
|
||||
|
||||
export default defineConfig({
|
||||
theme: {
|
||||
|
||||
+20
-16
@@ -10,24 +10,28 @@
|
||||
"format-check": "prettier --check ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-node-resolve": "^15.0.2",
|
||||
"@rollup/plugin-terser": "^0.4.1",
|
||||
"@rollup/plugin-typescript": "^11.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
||||
"@typescript-eslint/parser": "^5.58.0",
|
||||
"@rollup/plugin-node-resolve": "15.1.0",
|
||||
"@rollup/plugin-terser": "0.4.3",
|
||||
"@rollup/plugin-typescript": "11.1.2",
|
||||
"@typescript-eslint/eslint-plugin": "6.1.0",
|
||||
"@typescript-eslint/parser": "6.1.0",
|
||||
"covector": "^0.9.0",
|
||||
"eslint": "^8.38.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-config-standard-with-typescript": "^34.0.1",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-n": "^16.0.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-security": "^1.7.1",
|
||||
"prettier": "^2.8.7",
|
||||
"rollup": "^3.20.4",
|
||||
"typescript": "^5.0.4"
|
||||
"eslint": "8.45.0",
|
||||
"eslint-config-prettier": "8.8.0",
|
||||
"eslint-config-standard-with-typescript": "36.1.0",
|
||||
"eslint-plugin-import": "2.27.5",
|
||||
"eslint-plugin-n": "16.0.1",
|
||||
"eslint-plugin-promise": "6.1.1",
|
||||
"eslint-plugin-security": "1.7.1",
|
||||
"prettier": "3.0.0",
|
||||
"rollup": "3.26.3",
|
||||
"typescript": "5.1.6"
|
||||
},
|
||||
"resolutions": {
|
||||
"semver": ">=7.5.2",
|
||||
"optionator": ">=0.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"pnpm": ">=7.24.2"
|
||||
"pnpm": ">=7.33.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
[package]
|
||||
name = "tauri-plugin-app"
|
||||
version = "2.0.0-alpha.0"
|
||||
version = "2.0.0-alpha.1"
|
||||
description = "APIs to read application metadata and change app visibility on macOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = [ "tauri/dox" ]
|
||||
|
||||
[dependencies]
|
||||
tauri = { workspace = true }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# App
|
||||

|
||||
|
||||
This plugin provides APIs to read application metadata and macOS app visibility functions.
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-app",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"version": "2.0.0-alpha.1",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -27,6 +27,6 @@
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.4"
|
||||
"@tauri-apps/api": "2.0.0-alpha.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! [](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/app)
|
||||
//!
|
||||
//! This plugin provides APIs to read application metadata and macOS app visibility functions.
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
Runtime,
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
[package]
|
||||
name = "tauri-plugin-authenticator"
|
||||
version = "2.0.0-alpha.0"
|
||||
version = "2.0.0-alpha.1"
|
||||
description = "Use hardware security-keys in your Tauri App."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = [ "tauri/dox" ]
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Use hardware security-keys in your Tauri App.
|
||||
|
||||
@@ -93,7 +93,7 @@ const r2 = await auth.verifyRegistration(
|
||||
challenge,
|
||||
app,
|
||||
registerResult.registerData,
|
||||
registerResult.clientData
|
||||
registerResult.clientData,
|
||||
);
|
||||
const j2 = JSON.parse(r2);
|
||||
|
||||
@@ -108,7 +108,7 @@ const counter = await auth.verifySignature(
|
||||
signData.signData,
|
||||
clientData,
|
||||
keyHandle,
|
||||
pubkey
|
||||
pubkey,
|
||||
);
|
||||
|
||||
if (counter && counter > 0) {
|
||||
|
||||
@@ -25,7 +25,7 @@ export class Authenticator {
|
||||
challenge: string,
|
||||
application: string,
|
||||
registerData: string,
|
||||
clientData: string
|
||||
clientData: string,
|
||||
): Promise<string> {
|
||||
return await window.__TAURI_INVOKE__(
|
||||
"plugin:authenticator|verify_registration",
|
||||
@@ -34,14 +34,14 @@ export class Authenticator {
|
||||
application,
|
||||
registerData,
|
||||
clientData,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
async sign(
|
||||
challenge: string,
|
||||
application: string,
|
||||
keyHandle: string
|
||||
keyHandle: string,
|
||||
): Promise<string> {
|
||||
return await window.__TAURI_INVOKE__("plugin:authenticator|sign", {
|
||||
timeout: 10000,
|
||||
@@ -57,7 +57,7 @@ export class Authenticator {
|
||||
signData: string,
|
||||
clientData: string,
|
||||
keyHandle: string,
|
||||
pubkey: string
|
||||
pubkey: string,
|
||||
): Promise<number> {
|
||||
return await window.__TAURI_INVOKE__(
|
||||
"plugin:authenticator|verify_signature",
|
||||
@@ -68,7 +68,7 @@ export class Authenticator {
|
||||
clientData,
|
||||
keyHandle,
|
||||
pubkey,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-authenticator",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"version": "2.0.0-alpha.1",
|
||||
"description": "Use hardware security-keys in your Tauri App.",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
@@ -25,9 +25,9 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"devDependencies": {
|
||||
"tslib": "^2.5.0"
|
||||
"tslib": "2.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.4"
|
||||
"@tauri-apps/api": "2.0.0-alpha.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -2,6 +2,16 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! [](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/authenticator)
|
||||
//!
|
||||
//! Use hardware security-keys in your Tauri App.
|
||||
//!
|
||||
//! - Supported platforms: Windows, Linux, FreeBSD, NetBSD, OpenBSD, and macOS.
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
#![cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
|
||||
mod auth;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../shared/tsconfig.json
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": ["guest-js/*.ts"]
|
||||
}
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
[package]
|
||||
name = "tauri-plugin-autostart"
|
||||
version = "2.0.0-alpha.0"
|
||||
version = "2.0.0-alpha.1"
|
||||
description = "Automatically launch your application at startup."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = [ "tauri/dox" ]
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-autostart",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"version": "2.0.0-alpha.1",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -24,9 +24,9 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"devDependencies": {
|
||||
"tslib": "^2.5.0"
|
||||
"tslib": "2.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.4"
|
||||
"@tauri-apps/api": "2.0.0-alpha.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! [](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/autostart)
|
||||
//!
|
||||
//! Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux.
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
#![cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
|
||||
use auto_launch::{AutoLaunch, AutoLaunchBuilder};
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../shared/tsconfig.json
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": ["guest-js/*.ts"]
|
||||
}
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
[package]
|
||||
name = "tauri-plugin-cli"
|
||||
version = "2.0.0-alpha.0"
|
||||
version = "2.0.0-alpha.1"
|
||||
description = "Parse arguments from your Tauri application's command line interface."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = [ "tauri/dox" ]
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# CLI
|
||||

|
||||
|
||||
Parse arguments from your Command Line Interface.
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-cli",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"version": "2.0.0-alpha.1",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -27,6 +27,6 @@
|
||||
"tslib": "^2.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.4"
|
||||
"@tauri-apps/api": "2.0.0-alpha.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -2,6 +2,17 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! [](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/cli)
|
||||
//!
|
||||
//! Parse arguments from your Command Line Interface.
|
||||
//!
|
||||
//! - Supported platforms: Windows, Linux and macOS.
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
|
||||
use tauri::{
|
||||
plugin::{Builder, PluginApi, TauriPlugin},
|
||||
AppHandle, Manager, Runtime, State,
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
[package]
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.0.0-alpha.0"
|
||||
version = "2.0.0-alpha.1"
|
||||
description = "Read and write to the system clipboard."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
links = "tauri-plugin-clipboard-manager"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = [ "tauri/dox" ]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { workspace = true }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Clipboard Manager
|
||||

|
||||
|
||||
Read and write to the system clipboard.
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@@ -36,7 +36,7 @@ type ClipResponse = Clip<"PlainText", string>;
|
||||
*/
|
||||
async function writeText(
|
||||
text: string,
|
||||
opts?: { label?: string }
|
||||
opts?: { label?: string },
|
||||
): Promise<void> {
|
||||
return window.__TAURI_INVOKE__("plugin:clipboard|write", {
|
||||
data: {
|
||||
@@ -60,7 +60,7 @@ async function writeText(
|
||||
*/
|
||||
async function readText(): Promise<string> {
|
||||
const kind: ClipResponse = await window.__TAURI_INVOKE__(
|
||||
"plugin:clipboard|read"
|
||||
"plugin:clipboard|read",
|
||||
);
|
||||
return kind.options;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-clipboard-manager",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"version": "2.0.0-alpha.1",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -27,6 +27,6 @@
|
||||
"tslib": "^2.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.4"
|
||||
"@tauri-apps/api": "2.0.0-alpha.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! [](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/clipboard-manager)
|
||||
//!
|
||||
//! Read and write to the system clipboard.
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
Manager, Runtime,
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
d6e80b)([#545](https://github.com/tauri-apps/plugins-workspace/pull/545)) Fixes docs.rs build by enabling the `tauri/dox` feature flag.
|
||||
- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-alpha.1`
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
[package]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.0.0-alpha.0"
|
||||
version = "2.0.0-alpha.1"
|
||||
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
links = "tauri-plugin-dialog"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = [ "tauri/dox" ]
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-alpha.0" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-alpha.1" }
|
||||
|
||||
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
glib = "0.16"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Dialog
|
||||

|
||||
|
||||
Native system dialogs for opening and saving files along with message dialogs.
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@@ -103,16 +103,16 @@ interface ConfirmDialogOptions {
|
||||
}
|
||||
|
||||
async function open(
|
||||
options?: OpenDialogOptions & { multiple?: false; directory?: false }
|
||||
options?: OpenDialogOptions & { multiple?: false; directory?: false },
|
||||
): Promise<null | FileResponse>;
|
||||
async function open(
|
||||
options?: OpenDialogOptions & { multiple?: true; directory?: false }
|
||||
options?: OpenDialogOptions & { multiple?: true; directory?: false },
|
||||
): Promise<null | FileResponse[]>;
|
||||
async function open(
|
||||
options?: OpenDialogOptions & { multiple?: false; directory?: true }
|
||||
options?: OpenDialogOptions & { multiple?: false; directory?: true },
|
||||
): Promise<null | string>;
|
||||
async function open(
|
||||
options?: OpenDialogOptions & { multiple?: true; directory?: true }
|
||||
options?: OpenDialogOptions & { multiple?: true; directory?: true },
|
||||
): Promise<null | string[]>;
|
||||
/**
|
||||
* Open a file/directory selection dialog.
|
||||
@@ -125,7 +125,7 @@ async function open(
|
||||
* You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope).
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { open } from '@tauri-apps/api/dialog';
|
||||
* import { open } from '@tauri-apps/plugin-dialog';
|
||||
* // Open a selection dialog for image files
|
||||
* const selected = await open({
|
||||
* multiple: true,
|
||||
@@ -145,7 +145,7 @@ async function open(
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { open } from '@tauri-apps/api/dialog';
|
||||
* import { open } from '@tauri-apps/plugin-dialog';
|
||||
* import { appDir } from '@tauri-apps/api/path';
|
||||
* // Open a selection dialog for directories
|
||||
* const selected = await open({
|
||||
@@ -167,7 +167,7 @@ async function open(
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function open(
|
||||
options: OpenDialogOptions = {}
|
||||
options: OpenDialogOptions = {},
|
||||
): Promise<null | string | string[] | FileResponse | FileResponse[]> {
|
||||
if (typeof options === "object") {
|
||||
Object.freeze(options);
|
||||
@@ -187,7 +187,7 @@ async function open(
|
||||
* You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope).
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { save } from '@tauri-apps/api/dialog';
|
||||
* import { save } from '@tauri-apps/plugin-dialog';
|
||||
* const filePath = await save({
|
||||
* filters: [{
|
||||
* name: 'Image',
|
||||
@@ -212,7 +212,7 @@ async function save(options: SaveDialogOptions = {}): Promise<string | null> {
|
||||
* Shows a message dialog with an `Ok` button.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { message } from '@tauri-apps/api/dialog';
|
||||
* import { message } from '@tauri-apps/plugin-dialog';
|
||||
* await message('Tauri is awesome', 'Tauri');
|
||||
* await message('File not found', { title: 'Tauri', type: 'error' });
|
||||
* ```
|
||||
@@ -227,7 +227,7 @@ async function save(options: SaveDialogOptions = {}): Promise<string | null> {
|
||||
*/
|
||||
async function message(
|
||||
message: string,
|
||||
options?: string | MessageDialogOptions
|
||||
options?: string | MessageDialogOptions,
|
||||
): Promise<void> {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return window.__TAURI_INVOKE__("plugin:dialog|message", {
|
||||
@@ -242,7 +242,7 @@ async function message(
|
||||
* Shows a question dialog with `Yes` and `No` buttons.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { ask } from '@tauri-apps/api/dialog';
|
||||
* import { ask } from '@tauri-apps/plugin-dialog';
|
||||
* const yes = await ask('Are you sure?', 'Tauri');
|
||||
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });
|
||||
* ```
|
||||
@@ -256,7 +256,7 @@ async function message(
|
||||
*/
|
||||
async function ask(
|
||||
message: string,
|
||||
options?: string | ConfirmDialogOptions
|
||||
options?: string | ConfirmDialogOptions,
|
||||
): Promise<boolean> {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return window.__TAURI_INVOKE__("plugin:dialog|ask", {
|
||||
@@ -272,7 +272,7 @@ async function ask(
|
||||
* Shows a question dialog with `Ok` and `Cancel` buttons.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { confirm } from '@tauri-apps/api/dialog';
|
||||
* import { confirm } from '@tauri-apps/plugin-dialog';
|
||||
* const confirmed = await confirm('Are you sure?', 'Tauri');
|
||||
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });
|
||||
* ```
|
||||
@@ -286,7 +286,7 @@ async function ask(
|
||||
*/
|
||||
async function confirm(
|
||||
message: string,
|
||||
options?: string | ConfirmDialogOptions
|
||||
options?: string | ConfirmDialogOptions,
|
||||
): Promise<boolean> {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return window.__TAURI_INVOKE__("plugin:dialog|confirm", {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-dialog",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"version": "2.0.0-alpha.1",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -27,6 +27,6 @@
|
||||
"tslib": "^2.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.4"
|
||||
"@tauri-apps/api": "2.0.0-alpha.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user