mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-01 12:08:06 +02:00
Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 57f69c6615 | |||
| cfb3ec0e21 | |||
| b8bf4ad360 | |||
| 87cc58527d | |||
| e0d2e2c53f | |||
| 9a7092ca44 | |||
| 606fa08dae | |||
| 62f1e40682 | |||
| c8e5614063 | |||
| 03c255ae20 | |||
| a706748dd3 | |||
| 7c1046d239 | |||
| a90f36b07e | |||
| e5249cff0b | |||
| d57df4debe | |||
| 1f649c7f1f | |||
| 0ca4cc914c | |||
| 9dcad78f44 | |||
| 4341d7f500 | |||
| 77149dc432 | |||
| 525abc4be5 | |||
| 14cee64c82 | |||
| 3fd283121f | |||
| ae8024565f | |||
| 2302c2db1c | |||
| 44c50c1275 | |||
| 415bf2abc3 | |||
| 36207a93f3 | |||
| 854754e10b | |||
| 1c2f137a8a | |||
| 8c67d44aef | |||
| cfd48b3b2e | |||
| 558e14bb4c | |||
| aef5dd6157 | |||
| 74ee7edc43 | |||
| 7e1c17a635 | |||
| 3c1f3874f4 | |||
| 51ddf6a715 | |||
| 62082b7086 | |||
| aee14ed426 | |||
| 9b2840db94 | |||
| 60064fce52 | |||
| 0058583583 | |||
| fb676626f1 | |||
| f445c704a1 | |||
| fd785ab5de | |||
| a1a82208ed | |||
| dc49de5341 | |||
| 4c2454d410 | |||
| fe6dd0ff9e | |||
| ab8d089b2b | |||
| ee02ea7746 | |||
| 9501cfa5f5 |
@@ -126,7 +126,7 @@ jobs:
|
||||
clippy:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -168,7 +168,7 @@ jobs:
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
os: ubuntu-22.04,
|
||||
runner: 'cargo',
|
||||
command: 'test'
|
||||
}
|
||||
@@ -202,7 +202,7 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev
|
||||
|
||||
- uses: dtolnay/rust-toolchain@1.78.0
|
||||
- uses: dtolnay/rust-toolchain@1.77.2
|
||||
with:
|
||||
targets: ${{ matrix.platform.target }}
|
||||
|
||||
|
||||
Generated
+335
-669
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -11,10 +11,10 @@ resolver = "2"
|
||||
[workspace.dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = { version = "2.0.0", default-features = false }
|
||||
tauri-build = "2.0.0"
|
||||
tauri-plugin = "2.0.0"
|
||||
tauri-utils = "2.0.0"
|
||||
tauri = { version = "2.0.4", default-features = false }
|
||||
tauri-build = "2.0.1"
|
||||
tauri-plugin = "2.0.1"
|
||||
tauri-utils = "2.0.1"
|
||||
serde_json = "1"
|
||||
thiserror = "1"
|
||||
url = "2"
|
||||
@@ -27,7 +27,7 @@ specta = "=2.0.0-rc.20"
|
||||
edition = "2021"
|
||||
authors = ["Tauri Programme within The Commons Conservancy"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
rust-version = "1.78"
|
||||
rust-version = "1.77.2"
|
||||
repository = "https://github.com/tauri-apps/plugins-workspace"
|
||||
|
||||
# default to small, optimized release binaries
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
# Official Tauri Plugins
|
||||
|
||||
This repo and all plugins require a Rust version of at least **1.77.2**
|
||||
|
||||
## Plugins Found Here
|
||||
|
||||
| | | Win | Mac | Lin | iOS | And |
|
||||
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | --- | --- | --- |
|
||||
| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [barcode-scanner](plugins/barcode-scanner) | Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes. | ? | ? | ? | ✅ | ✅ |
|
||||
| [biometric](plugins/biometric) | Prompt the user for biometric authentication on Android and iOS. | ? | ? | ? | ✅ | ✅ |
|
||||
| [cli](plugins/cli) | Parse arguments from your Command Line Interface | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [cli](plugins/cli) | Parse arguments from your Command Line Interface | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [clipboard-manager](plugins/clipboard-manager) | Read and write to the system clipboard. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [deep-link](plugins/deep-link) | Set your Tauri application as the default handler for an URL. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [dialog](plugins/dialog) | Native system dialogs for opening and saving files along with message dialogs. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [fs](plugins/fs) | Access the file system. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [geolocation](plugins/geolocation) | Get and track current device position. | ? | ? | ? | ✅ | ✅ |
|
||||
| [global-shortcut](plugins/global-shortcut) | Register global shortcuts. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [haptics](plugins/haptics) | Haptic feedback and vibrations. | ? | ? | ? | ✅ | ✅ |
|
||||
| [http](plugins/http) | Access the HTTP client written in Rust. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [localhost](plugins/localhost) | Use a localhost server in production apps. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
@@ -18,19 +24,21 @@
|
||||
| [notification](plugins/notification) | Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [process](plugins/process) | This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [shell](plugins/shell) | Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? |
|
||||
| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ✅ |
|
||||
| [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
|
||||
_This repo and all plugins require a Rust version of at least **1.78**_
|
||||
- ✅: (Partially) Supported
|
||||
- ❌: Not supported
|
||||
- `?` : Unknown/Untested or Planned
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs-js@2.0.2`
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `dialog-js@2.0.1`
|
||||
- Upgraded to `fs-js@2.0.1`
|
||||
- Upgraded to `http-js@2.0.1`
|
||||
- Upgraded to `shell-js@2.0.1`
|
||||
- Upgraded to `store-js@2.1.0`
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
+12
-12
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "svelte-app",
|
||||
"private": true,
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --clearScreen false",
|
||||
@@ -9,34 +9,34 @@
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0",
|
||||
"@tauri-apps/api": "2.0.3",
|
||||
"@tauri-apps/plugin-barcode-scanner": "2.0.0",
|
||||
"@tauri-apps/plugin-biometric": "2.0.0",
|
||||
"@tauri-apps/plugin-cli": "2.0.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.0.0",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0",
|
||||
"@tauri-apps/plugin-fs": "2.0.0",
|
||||
"@tauri-apps/plugin-dialog": "2.0.1",
|
||||
"@tauri-apps/plugin-fs": "2.0.2",
|
||||
"@tauri-apps/plugin-geolocation": "2.0.0",
|
||||
"@tauri-apps/plugin-global-shortcut": "2.0.0",
|
||||
"@tauri-apps/plugin-haptics": "2.0.0",
|
||||
"@tauri-apps/plugin-http": "2.0.0",
|
||||
"@tauri-apps/plugin-http": "2.0.1",
|
||||
"@tauri-apps/plugin-nfc": "2.0.0",
|
||||
"@tauri-apps/plugin-notification": "2.0.0",
|
||||
"@tauri-apps/plugin-os": "2.0.0",
|
||||
"@tauri-apps/plugin-process": "2.0.0",
|
||||
"@tauri-apps/plugin-shell": "2.0.0",
|
||||
"@tauri-apps/plugin-store": "2.0.0",
|
||||
"@tauri-apps/plugin-shell": "2.0.1",
|
||||
"@tauri-apps/plugin-store": "2.1.0",
|
||||
"@tauri-apps/plugin-updater": "2.0.0",
|
||||
"@zerodevx/svelte-json-view": "1.0.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/codicon": "^1.1.37",
|
||||
"@iconify-json/ph": "^1.1.8",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
||||
"@tauri-apps/cli": "2.0.0",
|
||||
"@unocss/extractor-svelte": "^0.63.0",
|
||||
"svelte": "^4.2.19",
|
||||
"unocss": "^0.63.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
||||
"@tauri-apps/cli": "2.0.4",
|
||||
"@unocss/extractor-svelte": "^0.64.0",
|
||||
"svelte": "^5.0.0",
|
||||
"unocss": "^0.64.0",
|
||||
"vite": "^5.4.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,61 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager@2.0.2`
|
||||
- Upgraded to `log-plugin@2.0.2`
|
||||
|
||||
## \[2.0.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.3`
|
||||
- Upgraded to `dialog@2.0.3`
|
||||
- Upgraded to `http@2.0.3`
|
||||
|
||||
## \[2.0.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `dialog@2.0.2`
|
||||
- Upgraded to `fs@2.0.2`
|
||||
- Upgraded to `http@2.0.2`
|
||||
- Upgraded to `shell@2.0.2`
|
||||
- Upgraded to `store@2.1.0`
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner@2.0.1`
|
||||
- Upgraded to `biometric@2.0.1`
|
||||
- Upgraded to `cli@2.0.1`
|
||||
- Upgraded to `clipboard-manager@2.0.1`
|
||||
- Upgraded to `fs@2.0.1`
|
||||
- Upgraded to `dialog@2.0.1`
|
||||
- Upgraded to `geolocation@2.0.1`
|
||||
- Upgraded to `global-shortcut@2.0.1`
|
||||
- Upgraded to `haptics@2.0.1`
|
||||
- Upgraded to `http@2.0.1`
|
||||
- Upgraded to `log-plugin@2.0.1`
|
||||
- Upgraded to `nfc@2.0.1`
|
||||
- Upgraded to `notification@2.0.1`
|
||||
- Upgraded to `os@2.0.1`
|
||||
- Upgraded to `process@2.0.1`
|
||||
- Upgraded to `shell@2.0.1`
|
||||
- Upgraded to `store@2.0.1`
|
||||
- Upgraded to `updater@2.0.2`
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater@2.0.1`
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "api"
|
||||
publish = false
|
||||
version = "2.0.0"
|
||||
version = "2.0.5"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
rust-version = { workspace = true }
|
||||
@@ -19,22 +19,22 @@ serde_json = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
tiny_http = "0.12"
|
||||
log = { workspace = true }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0", features = [
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.2" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.3", features = [
|
||||
"watch",
|
||||
] }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0" }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.2" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.3" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [
|
||||
"multipart",
|
||||
], version = "2.0.0" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0", features = [
|
||||
], version = "2.0.3" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.1", features = [
|
||||
"windows7-compat",
|
||||
] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0" }
|
||||
tauri-plugin-store = { path = "../../../plugins/store", version = "2.0.0" }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.1" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.1" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.2" }
|
||||
tauri-plugin-store = { path = "../../../plugins/store", version = "2.1.0" }
|
||||
|
||||
[dependencies.tauri]
|
||||
workspace = true
|
||||
@@ -50,17 +50,17 @@ features = [
|
||||
]
|
||||
|
||||
[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" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0" }
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.1" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.1" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.2" }
|
||||
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0" }
|
||||
|
||||
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0" }
|
||||
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.0" }
|
||||
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.0" }
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.1" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.1" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.1" }
|
||||
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.1" }
|
||||
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.1" }
|
||||
|
||||
[features]
|
||||
prod = ["tauri/custom-protocol"]
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"shell:allow-open",
|
||||
"shell:allow-kill",
|
||||
"shell:allow-stdin-write",
|
||||
"process:allow-exit",
|
||||
@@ -79,10 +80,6 @@
|
||||
],
|
||||
"deny": ["$APPDATA/db/*.stronghold"]
|
||||
},
|
||||
"store:allow-entries",
|
||||
"store:allow-get",
|
||||
"store:allow-set",
|
||||
"store:allow-save",
|
||||
"store:allow-load"
|
||||
"store:default"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
"updater:default",
|
||||
"global-shortcut:allow-unregister",
|
||||
"global-shortcut:allow-register",
|
||||
"global-shortcut:allow-unregister-all"
|
||||
"global-shortcut:allow-unregister-all",
|
||||
{ "identifier": "fs:allow-watch", "allow": ["*", "**/*"] },
|
||||
"fs:allow-unwatch"
|
||||
]
|
||||
}
|
||||
|
||||
+4
-1
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
@@ -18,7 +19,7 @@
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$USER_HOME$/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-2.0.0-rc.7/mobile/android" />
|
||||
<option value="$USER_HOME$/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-2.0.2/mobile/android" />
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/buildSrc" />
|
||||
@@ -27,6 +28,8 @@
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/clipboard-manager/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/dialog/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/fs/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/geolocation/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/haptics/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/nfc/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/notification/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/shell/android" />
|
||||
|
||||
@@ -67,7 +67,8 @@ pub fn run() {
|
||||
.user_agent(&format!("Tauri API - {}", std::env::consts::OS))
|
||||
.title("Tauri API Validation")
|
||||
.inner_size(1000., 800.)
|
||||
.min_inner_size(600., 400.);
|
||||
.min_inner_size(600., 400.)
|
||||
.visible(false);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
|
||||
+44
-41
@@ -205,7 +205,7 @@
|
||||
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight
|
||||
}
|
||||
|
||||
// this function is renders HTML without sanitizing it so it's insecure
|
||||
// this function renders HTML without sanitizing it so it's insecure
|
||||
// we only use it with our own input data
|
||||
async function insecureRenderHtml(html) {
|
||||
messages.update((r) => [
|
||||
@@ -334,42 +334,46 @@
|
||||
children:h-100% children:w-12 children:inline-flex
|
||||
children:items-center children:justify-center"
|
||||
>
|
||||
<span
|
||||
<button
|
||||
aria-label="Toggle dark mode"
|
||||
title={isDark ? 'Switch to Light mode' : 'Switch to Dark mode'}
|
||||
class="hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
on:click={toggleDark}
|
||||
>
|
||||
{#if isDark}
|
||||
<div class="i-ph-sun" />
|
||||
<div class="i-ph-sun"></div>
|
||||
{:else}
|
||||
<div class="i-ph-moon" />
|
||||
<div class="i-ph-moon"></div>
|
||||
{/if}
|
||||
</span>
|
||||
<span
|
||||
</button>
|
||||
<button
|
||||
aria-label="Minimize window"
|
||||
title="Minimize"
|
||||
class="hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
on:click={minimize}
|
||||
>
|
||||
<div class="i-codicon-chrome-minimize" />
|
||||
</span>
|
||||
<span
|
||||
<div class="i-codicon-chrome-minimize"></div>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Maximize window"
|
||||
title={isWindowMaximized ? 'Restore' : 'Maximize'}
|
||||
class="hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
on:click={toggleMaximize}
|
||||
>
|
||||
{#if isWindowMaximized}
|
||||
<div class="i-codicon-chrome-restore" />
|
||||
<div class="i-codicon-chrome-restore"></div>
|
||||
{:else}
|
||||
<div class="i-codicon-chrome-maximize" />
|
||||
<div class="i-codicon-chrome-maximize"></div>
|
||||
{/if}
|
||||
</span>
|
||||
<span
|
||||
</button>
|
||||
<button
|
||||
aria-label="Close window"
|
||||
title="Close"
|
||||
class="hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText"
|
||||
class="bg-inherit border-none hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText"
|
||||
on:click={close}
|
||||
>
|
||||
<div class="i-codicon-chrome-close" />
|
||||
</span>
|
||||
<div class="i-codicon-chrome-close"></div>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -377,13 +381,13 @@
|
||||
<!-- Sidebar toggle, only visible on small screens -->
|
||||
<div
|
||||
id="sidebarToggle"
|
||||
class="z-2000 sidebar-toggle display-none lt-sm:flex justify-center absolute items-center w-8 h-8 rd-8
|
||||
class="z-2000 sidebar-toggle hidden 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}
|
||||
<span class="i-codicon-close animate-duration-300ms animate-fade-in" />
|
||||
<span class="i-codicon-close animate-duration-300ms animate-fade-in"></span>
|
||||
{:else}
|
||||
<span class="i-codicon-menu animate-duration-300ms animate-fade-in" />
|
||||
<span class="i-codicon-menu animate-duration-300ms animate-fade-in"></span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -395,24 +399,21 @@
|
||||
class="lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999
|
||||
bg-darkPrimaryLighter transition-colors-250 overflow-hidden grid select-none px-2"
|
||||
>
|
||||
<img
|
||||
on:click={() => open('https://tauri.app/')}
|
||||
class="self-center p-7 cursor-pointer"
|
||||
src="tauri_logo.png"
|
||||
alt="Tauri logo"
|
||||
/>
|
||||
<a href="https://tauri.app" target="_blank">
|
||||
<img class="p-7" src="tauri_logo.png" alt="Tauri logo" />
|
||||
</a>
|
||||
{#if !isWindows}
|
||||
<a href="##" class="nv justify-between h-8" on:click={toggleDark}>
|
||||
{#if isDark}
|
||||
Switch to Light mode
|
||||
<div class="i-ph-sun" />
|
||||
<div class="i-ph-sun"></div>
|
||||
{:else}
|
||||
Switch to Dark mode
|
||||
<div class="i-ph-moon" />
|
||||
<div class="i-ph-moon"></div>
|
||||
{/if}
|
||||
</a>
|
||||
<br />
|
||||
<div class="bg-white/5 h-2px" />
|
||||
<div class="bg-white/5 h-2px"></div>
|
||||
<br />
|
||||
{/if}
|
||||
|
||||
@@ -422,7 +423,7 @@
|
||||
href="https://tauri.app/v1/guides/"
|
||||
>
|
||||
Documentation
|
||||
<span class="i-codicon-link-external" />
|
||||
<span class="i-codicon-link-external"></span>
|
||||
</a>
|
||||
<a
|
||||
class="nv justify-between h-8"
|
||||
@@ -430,7 +431,7 @@
|
||||
href="https://github.com/tauri-apps/tauri"
|
||||
>
|
||||
GitHub
|
||||
<span class="i-codicon-link-external" />
|
||||
<span class="i-codicon-link-external"></span>
|
||||
</a>
|
||||
<a
|
||||
class="nv justify-between h-8"
|
||||
@@ -438,10 +439,10 @@
|
||||
href="https://github.com/tauri-apps/tauri/tree/dev/examples/api"
|
||||
>
|
||||
Source
|
||||
<span class="i-codicon-link-external" />
|
||||
<span class="i-codicon-link-external"></span>
|
||||
</a>
|
||||
<br />
|
||||
<div class="bg-white/5 h-2px" />
|
||||
<div class="bg-white/5 h-2px"></div>
|
||||
<br />
|
||||
<div
|
||||
class="flex flex-col overflow-y-auto children-h-10 children-flex-none gap-1"
|
||||
@@ -456,7 +457,7 @@
|
||||
isSideBarOpen = false
|
||||
}}
|
||||
>
|
||||
<div class="{view.icon} mr-2" />
|
||||
<div class="{view.icon} mr-2"></div>
|
||||
<p>{view.label}</p></a
|
||||
>
|
||||
{/if}
|
||||
@@ -485,21 +486,23 @@
|
||||
id="console"
|
||||
class="select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden"
|
||||
>
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
on:mousedown={startResizingConsole}
|
||||
class="bg-black/20 h-2px cursor-ns-resize"
|
||||
/>
|
||||
></div>
|
||||
<div class="flex justify-between items-center px-2">
|
||||
<p class="font-semibold">Console</p>
|
||||
<div
|
||||
class="cursor-pointer h-85% rd-1 p-1 flex justify-center items-center
|
||||
<button
|
||||
aria-label="Clear Console"
|
||||
class="cursor-pointer h-85% rd-1 p-1 flex justify-center items-center border-none bg-inherit
|
||||
hover:bg-hoverOverlay dark:hover:bg-darkHoverOverlay
|
||||
active:bg-hoverOverlay/25 dark:active:bg-darkHoverOverlay/25
|
||||
"
|
||||
on:click={clear}
|
||||
>
|
||||
<div class="i-codicon-clear-all" />
|
||||
</div>
|
||||
<div class="i-codicon-clear-all"></div>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
bind:this={consoleTextEl}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
import 'uno.css'
|
||||
import './app.css'
|
||||
import App from './App.svelte'
|
||||
import { mount } from 'svelte'
|
||||
|
||||
const app = new App({
|
||||
const app = mount(App, {
|
||||
target: document.querySelector('#app')
|
||||
})
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<script>
|
||||
import { getMatches } from "@tauri-apps/plugin-cli";
|
||||
import { getMatches } from '@tauri-apps/plugin-cli'
|
||||
|
||||
export let onMessage;
|
||||
export let onMessage
|
||||
|
||||
function cliMatches() {
|
||||
getMatches().then(onMessage).catch(onMessage);
|
||||
getMatches().then(onMessage).catch(onMessage)
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>
|
||||
<div>
|
||||
This binary can be run from the terminal and takes the following arguments:
|
||||
<code class="code-block flex flex-wrap my-2">
|
||||
<pre>
|
||||
@@ -17,7 +17,7 @@
|
||||
--verbose</pre>
|
||||
</code>
|
||||
Additionally, it has a <code>update --background</code> subcommand.
|
||||
</p>
|
||||
</div>
|
||||
<br />
|
||||
<div class="note">
|
||||
Note that the arguments are only parsed, not implemented.
|
||||
|
||||
@@ -1,69 +1,69 @@
|
||||
<script>
|
||||
import { fetch as tauriFetch } from "@tauri-apps/plugin-http";
|
||||
import { JsonView } from "@zerodevx/svelte-json-view";
|
||||
import { fetch as tauriFetch } from '@tauri-apps/plugin-http'
|
||||
import { JsonView } from '@zerodevx/svelte-json-view'
|
||||
|
||||
let httpMethod = "GET";
|
||||
let httpBody = "";
|
||||
let httpMethod = 'GET'
|
||||
let httpBody = ''
|
||||
|
||||
export let onMessage;
|
||||
export let onMessage
|
||||
|
||||
async function makeHttpRequest() {
|
||||
let method = httpMethod || "GET";
|
||||
let method = httpMethod || 'GET'
|
||||
|
||||
const options = {
|
||||
method: method || "GET",
|
||||
headers: {},
|
||||
};
|
||||
method: method || 'GET',
|
||||
headers: {}
|
||||
}
|
||||
|
||||
let bodyType;
|
||||
let bodyType
|
||||
|
||||
if (method !== "GET") {
|
||||
options.body = httpBody;
|
||||
if (method !== 'GET') {
|
||||
options.body = httpBody
|
||||
|
||||
if (
|
||||
(httpBody.startsWith("{") && httpBody.endsWith("}")) ||
|
||||
(httpBody.startsWith("[") && httpBody.endsWith("]"))
|
||||
(httpBody.startsWith('{') && httpBody.endsWith('}')) ||
|
||||
(httpBody.startsWith('[') && httpBody.endsWith(']'))
|
||||
) {
|
||||
options.headers["Content-Type"] = "application/json";
|
||||
bodyType = "json";
|
||||
} else if (httpBody !== "") {
|
||||
bodyType = "text";
|
||||
options.headers['Content-Type'] = 'application/json'
|
||||
bodyType = 'json'
|
||||
} else if (httpBody !== '') {
|
||||
bodyType = 'text'
|
||||
}
|
||||
}
|
||||
|
||||
const response = await tauriFetch("http://localhost:3003", options);
|
||||
const response = await tauriFetch('http://localhost:3003', options)
|
||||
const body =
|
||||
bodyType === "json" ? await response.json() : await response.text();
|
||||
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,
|
||||
});
|
||||
body
|
||||
})
|
||||
}
|
||||
|
||||
/// http form
|
||||
let foo = "baz";
|
||||
let bar = "qux";
|
||||
let result = null;
|
||||
let foo = 'baz'
|
||||
let bar = 'qux'
|
||||
let result = null
|
||||
|
||||
async function doPost() {
|
||||
const form = new FormData();
|
||||
form.append("foo", foo);
|
||||
form.append("bar", bar);
|
||||
const response = await tauriFetch("http://localhost:3003/tauri", {
|
||||
method: "POST",
|
||||
body: form,
|
||||
});
|
||||
const form = new FormData()
|
||||
form.append('foo', foo)
|
||||
form.append('bar', bar)
|
||||
const response = await tauriFetch('http://localhost:3003/tauri', {
|
||||
method: 'POST',
|
||||
body: form
|
||||
})
|
||||
result = {
|
||||
url: response.url,
|
||||
status: response.status,
|
||||
ok: response.ok,
|
||||
headers: Object.fromEntries(response.headers.entries()),
|
||||
body: await response.text(),
|
||||
};
|
||||
body: await response.text()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
placeholder="Request body"
|
||||
rows="5"
|
||||
bind:value={httpBody}
|
||||
/>
|
||||
></textarea>
|
||||
<br />
|
||||
<button class="btn" id="make-request"> Make request </button>
|
||||
</form>
|
||||
|
||||
@@ -1,38 +1,44 @@
|
||||
<script>
|
||||
import { scan, checkPermissions, requestPermissions, Format, cancel } from "@tauri-apps/plugin-barcode-scanner";
|
||||
import {
|
||||
scan,
|
||||
checkPermissions,
|
||||
requestPermissions,
|
||||
Format,
|
||||
cancel
|
||||
} from '@tauri-apps/plugin-barcode-scanner'
|
||||
|
||||
export let onMessage;
|
||||
export let onMessage
|
||||
|
||||
let scanning = false;
|
||||
let windowed = true;
|
||||
let formats = [Format.QRCode];
|
||||
const supportedFormats = [Format.QRCode, Format.EAN13];
|
||||
let scanning = false
|
||||
let windowed = true
|
||||
let formats = [Format.QRCode]
|
||||
const supportedFormats = [Format.QRCode, Format.EAN13]
|
||||
|
||||
async function startScan() {
|
||||
let permission = await checkPermissions();
|
||||
let permission = await checkPermissions()
|
||||
if (permission === 'prompt') {
|
||||
permission = await requestPermissions();
|
||||
permission = await requestPermissions()
|
||||
}
|
||||
if (permission === 'granted') {
|
||||
scanning = true;
|
||||
scanning = true
|
||||
scan({ windowed, formats })
|
||||
.then((res) => {
|
||||
scanning = false;
|
||||
onMessage(res);
|
||||
scanning = false
|
||||
onMessage(res)
|
||||
})
|
||||
.catch((error) => {
|
||||
scanning = false;
|
||||
onMessage(error);
|
||||
});
|
||||
scanning = false
|
||||
onMessage(error)
|
||||
})
|
||||
} else {
|
||||
onMessage('Permission denied')
|
||||
}
|
||||
}
|
||||
|
||||
async function cancelScan() {
|
||||
await cancel();
|
||||
scanning = false;
|
||||
onMessage("cancelled");
|
||||
await cancel()
|
||||
scanning = false
|
||||
onMessage('cancelled')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -59,11 +65,12 @@
|
||||
<div class="barcode-scanner--area--container">
|
||||
<div class="relative">
|
||||
<p>Aim your camera at a QR code</p>
|
||||
<button class="btn" type="button" on:click={cancelScan}>Cancel</button>
|
||||
<button class="btn" type="button" on:click={cancelScan}>Cancel</button
|
||||
>
|
||||
</div>
|
||||
<div class="square surround-cover">
|
||||
<div class="barcode-scanner--area--outer surround-cover">
|
||||
<div class="barcode-scanner--area--inner" />
|
||||
<div class="barcode-scanner--area--inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -111,7 +118,7 @@
|
||||
transition: 0.3s;
|
||||
}
|
||||
.square:after {
|
||||
content: "";
|
||||
content: '';
|
||||
top: 0;
|
||||
display: block;
|
||||
padding-bottom: 100%;
|
||||
@@ -141,7 +148,8 @@
|
||||
width: 100%;
|
||||
margin: 1rem;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0px 0px 2px 1px rgb(0 0 0 / 0.5),
|
||||
box-shadow:
|
||||
0px 0px 2px 1px rgb(0 0 0 / 0.5),
|
||||
inset 0px 0px 2px 1px rgb(0 0 0 / 0.5);
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { Store } from "@tauri-apps/plugin-store";
|
||||
import { LazyStore } from "@tauri-apps/plugin-store";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
export let onMessage;
|
||||
@@ -7,28 +7,65 @@
|
||||
let key;
|
||||
let value;
|
||||
|
||||
const store = new Store("cache.json");
|
||||
let store = new LazyStore("cache.json");
|
||||
let cache = {};
|
||||
|
||||
onMount(async () => {
|
||||
await store.load();
|
||||
const values = await store.entries();
|
||||
for (const [key, value] of values) {
|
||||
cache[key] = value;
|
||||
async function refreshEntries() {
|
||||
try {
|
||||
const values = await store.entries();
|
||||
cache = {};
|
||||
for (const [key, value] of values) {
|
||||
cache[key] = value;
|
||||
}
|
||||
} catch (error) {
|
||||
onMessage(error);
|
||||
}
|
||||
cache = cache;
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
await refreshEntries();
|
||||
});
|
||||
|
||||
function write(key, value) {
|
||||
store
|
||||
.set(key, value)
|
||||
.then(() => store.get(key))
|
||||
.then((v) => {
|
||||
cache[key] = v;
|
||||
async function write(key, value) {
|
||||
try {
|
||||
if (value) {
|
||||
await store.set(key, value);
|
||||
} else {
|
||||
await store.delete(key);
|
||||
}
|
||||
const v = await store.get(key);
|
||||
if (v === undefined) {
|
||||
delete cache[key];
|
||||
cache = cache;
|
||||
})
|
||||
.then(() => store.save())
|
||||
.catch(onMessage);
|
||||
} else {
|
||||
cache[key] = v;
|
||||
}
|
||||
} catch (error) {
|
||||
onMessage(error);
|
||||
}
|
||||
}
|
||||
|
||||
async function reset() {
|
||||
try {
|
||||
await store.reset();
|
||||
} catch (error) {
|
||||
onMessage(error);
|
||||
}
|
||||
await refreshEntries();
|
||||
}
|
||||
|
||||
async function close() {
|
||||
try {
|
||||
await store.close();
|
||||
onMessage("Store is now closed, any new operations will error out");
|
||||
} catch (error) {
|
||||
onMessage(error);
|
||||
}
|
||||
}
|
||||
|
||||
function reopen() {
|
||||
store = new LazyStore("cache.json");
|
||||
onMessage("We made a new `LazyStore` instance, operations will now work");
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -44,7 +81,12 @@
|
||||
<input class="grow input" bind:value />
|
||||
</div>
|
||||
|
||||
<button class="btn" on:click={() => write(key, value)}> Write </button>
|
||||
<div>
|
||||
<button class="btn" on:click={() => write(key, value)}>Write</button>
|
||||
<button class="btn" on:click={() => reset()}>Reset</button>
|
||||
<button class="btn" on:click={() => close()}>Close</button>
|
||||
<button class="btn" on:click={() => reopen()}>Re-open</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
<script>
|
||||
import { check } from "@tauri-apps/plugin-updater";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
import { check } from '@tauri-apps/plugin-updater'
|
||||
import { relaunch } from '@tauri-apps/plugin-process'
|
||||
|
||||
export let onMessage;
|
||||
export let onMessage
|
||||
|
||||
let isChecking, isInstalling, newUpdate;
|
||||
let isChecking, isInstalling, newUpdate
|
||||
let totalSize = 0,
|
||||
downloadedSize = 0;
|
||||
downloadedSize = 0
|
||||
|
||||
async function checkUpdate() {
|
||||
isChecking = true;
|
||||
isChecking = true
|
||||
try {
|
||||
const update = await check();
|
||||
onMessage(`Should update: ${update.available}`);
|
||||
onMessage(update);
|
||||
const update = await check()
|
||||
onMessage(`Should update: ${update.available}`)
|
||||
onMessage(update)
|
||||
|
||||
newUpdate = update;
|
||||
newUpdate = update
|
||||
} catch (e) {
|
||||
onMessage(e);
|
||||
onMessage(e)
|
||||
} finally {
|
||||
isChecking = false;
|
||||
isChecking = false
|
||||
}
|
||||
}
|
||||
|
||||
async function install() {
|
||||
isInstalling = true;
|
||||
downloadedSize = 0;
|
||||
isInstalling = true
|
||||
downloadedSize = 0
|
||||
try {
|
||||
await newUpdate.downloadAndInstall((downloadProgress) => {
|
||||
switch (downloadProgress.event) {
|
||||
case "Started":
|
||||
totalSize = downloadProgress.data.contentLength;
|
||||
break;
|
||||
case "Progress":
|
||||
downloadedSize += downloadProgress.data.chunkLength;
|
||||
break;
|
||||
case "Finished":
|
||||
break;
|
||||
case 'Started':
|
||||
totalSize = downloadProgress.data.contentLength
|
||||
break
|
||||
case 'Progress':
|
||||
downloadedSize += downloadProgress.data.chunkLength
|
||||
break
|
||||
case 'Finished':
|
||||
break
|
||||
}
|
||||
});
|
||||
onMessage("Installation complete, restarting...");
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
await relaunch();
|
||||
})
|
||||
onMessage('Installation complete, restarting...')
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000))
|
||||
await relaunch()
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
onMessage(e);
|
||||
console.error(e)
|
||||
onMessage(e)
|
||||
} finally {
|
||||
isInstalling = false;
|
||||
isInstalling = false
|
||||
}
|
||||
}
|
||||
|
||||
$: progress = totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0;
|
||||
$: progress = totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0
|
||||
</script>
|
||||
|
||||
<div class="flex children:grow children:h10">
|
||||
@@ -61,7 +61,7 @@
|
||||
{:else}
|
||||
<div class="progress">
|
||||
<span>{progress}%</span>
|
||||
<div class="progress-bar" style="width: {progress}%" />
|
||||
<div class="progress-bar" style="width: {progress}%"></div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
+6
-6
@@ -10,20 +10,20 @@
|
||||
"format:check": "prettier --check ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.11.1",
|
||||
"@eslint/js": "9.14.0",
|
||||
"@rollup/plugin-node-resolve": "15.3.0",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
"@rollup/plugin-typescript": "11.1.6",
|
||||
"@types/eslint__js": "8.42.3",
|
||||
"covector": "^0.12.3",
|
||||
"eslint": "9.11.1",
|
||||
"eslint": "9.14.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-security": "3.0.1",
|
||||
"prettier": "3.3.3",
|
||||
"rollup": "4.22.4",
|
||||
"tslib": "2.7.0",
|
||||
"typescript": "5.6.2",
|
||||
"typescript-eslint": "8.7.0"
|
||||
"rollup": "4.24.4",
|
||||
"tslib": "2.8.1",
|
||||
"typescript": "5.6.3",
|
||||
"typescript-eslint": "8.13.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"semver": ">=7.5.2",
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-autostart"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Automatically launch your application at startup."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -12,7 +12,7 @@ Automatically launch your application at startup.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-barcode-scanner"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes.
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-biometric"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Prompt the user for biometric authentication on Android and iOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-cli"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Parse arguments from your Tauri application's command line interface."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -12,7 +12,7 @@ Parse arguments from your Command Line Interface.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
- [`d57df4de`](https://github.com/tauri-apps/plugins-workspace/commit/d57df4debe7c75cfbd6d6558fff1beb07dbee54c) ([#1986](https://github.com/tauri-apps/plugins-workspace/pull/1986) by [@RikaKagurasaka](https://github.com/tauri-apps/plugins-workspace/../../RikaKagurasaka)) Fix that `read_image` wrongly set the image rgba data with binary PNG data.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.0.0"
|
||||
version = "2.0.2"
|
||||
description = "Read and write to the system clipboard."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -37,4 +37,3 @@ tauri = { workspace = true, features = ["wry"] }
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
arboard = "3"
|
||||
image = "0.25"
|
||||
|
||||
@@ -12,7 +12,7 @@ Read and write to the system clipboard.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use arboard::ImageData;
|
||||
use image::ImageEncoder;
|
||||
use serde::de::DeserializeOwned;
|
||||
use tauri::{image::Image, plugin::PluginApi, AppHandle, Runtime};
|
||||
|
||||
@@ -85,16 +84,11 @@ impl<R: Runtime> Clipboard<R> {
|
||||
match &self.clipboard {
|
||||
Ok(clipboard) => {
|
||||
let image = clipboard.lock().unwrap().get_image()?;
|
||||
|
||||
let mut buffer: Vec<u8> = Vec::new();
|
||||
image::codecs::png::PngEncoder::new(&mut buffer).write_image(
|
||||
&image.bytes,
|
||||
let image = Image::new_owned(
|
||||
image.bytes.to_vec(),
|
||||
image.width as u32,
|
||||
image.height as u32,
|
||||
image::ExtendedColorType::Rgba8,
|
||||
)?;
|
||||
|
||||
let image = Image::new_owned(buffer, image.width as u32, image.height as u32);
|
||||
);
|
||||
Ok(image)
|
||||
}
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
|
||||
@@ -15,9 +15,6 @@ pub enum Error {
|
||||
Clipboard(String),
|
||||
#[error(transparent)]
|
||||
Tauri(#[from] tauri::Error),
|
||||
#[cfg(desktop)]
|
||||
#[error("invalid image: {0}")]
|
||||
Image(#[from] image::ImageError),
|
||||
}
|
||||
|
||||
impl Serialize for Error {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-deep-link"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Set your Tauri application as the default handler for an URL"
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -12,7 +12,7 @@ Set your Tauri application as the default handler for an URL.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0",
|
||||
"@tauri-apps/api": "2.0.3",
|
||||
"@tauri-apps/plugin-deep-link": "2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.0.0",
|
||||
"@tauri-apps/cli": "2.0.4",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.4.7"
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ authors = ["you"]
|
||||
license = ""
|
||||
repository = ""
|
||||
edition = "2021"
|
||||
rust-version = "1.78"
|
||||
rust-version = "1.77.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.3`
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`2302c2db`](https://github.com/tauri-apps/plugins-workspace/commit/2302c2db1c49673e61dcbda8cdb01b2c57e9ba6f) ([#1910](https://github.com/tauri-apps/plugins-workspace/pull/1910) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix `ask` and `confirm` not using system button texts
|
||||
- [`aee14ed4`](https://github.com/tauri-apps/plugins-workspace/commit/aee14ed4261cdedc4ed7cc2686f01f437859a5c7) ([#1892](https://github.com/tauri-apps/plugins-workspace/pull/1892) by [@nashaofu](https://github.com/tauri-apps/plugins-workspace/../../nashaofu)) Set `save` dialog mime type from the `filters` extensions on Android.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.1`
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
@@ -280,3 +299,5 @@
|
||||
pull/371)) First v2 alpha release!
|
||||
lpha release!
|
||||
pull/371)) First v2 alpha release!
|
||||
lease!
|
||||
pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.0.0"
|
||||
version = "2.0.3"
|
||||
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -34,7 +34,7 @@ tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
url = { workspace = true }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.3" }
|
||||
|
||||
[target.'cfg(target_os = "ios")'.dependencies]
|
||||
tauri = { workspace = true, features = ["wry"] }
|
||||
|
||||
@@ -12,7 +12,7 @@ Native system dialogs for opening and saving files along with message dialogs.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.webkit.MimeTypeMap
|
||||
import androidx.activity.result.ActivityResult
|
||||
import app.tauri.Logger
|
||||
import app.tauri.annotation.ActivityCallback
|
||||
@@ -43,6 +44,7 @@ class MessageOptions {
|
||||
@InvokeArg
|
||||
class SaveFileDialogOptions {
|
||||
var fileName: String? = null
|
||||
lateinit var filters: Array<Filter>
|
||||
}
|
||||
|
||||
@TauriPlugin
|
||||
@@ -57,20 +59,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
|
||||
|
||||
val intent = if (parsedTypes.isNotEmpty()) {
|
||||
val intent = Intent(Intent.ACTION_PICK)
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes)
|
||||
|
||||
var uniqueMimeType = true
|
||||
var mimeKind: String? = null
|
||||
for (mime in parsedTypes) {
|
||||
val kind = mime.split("/")[0]
|
||||
if (mimeKind == null) {
|
||||
mimeKind = kind
|
||||
} else if (mimeKind != kind) {
|
||||
uniqueMimeType = false
|
||||
}
|
||||
}
|
||||
|
||||
intent.type = if (uniqueMimeType) Intent.normalizeMimeType("$mimeKind/*") else "*/*"
|
||||
setIntentMimeTypes(intent, parsedTypes)
|
||||
intent
|
||||
} else {
|
||||
val intent = Intent(Intent.ACTION_GET_CONTENT)
|
||||
@@ -130,12 +119,46 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
|
||||
private fun parseFiltersOption(filters: Array<Filter>): Array<String> {
|
||||
val mimeTypes = mutableListOf<String>()
|
||||
for (filter in filters) {
|
||||
for (mime in filter.extensions) {
|
||||
mimeTypes.add(if (mime == "text/csv") "text/comma-separated-values" else mime)
|
||||
for (ext in filter.extensions) {
|
||||
if (ext.contains('/')) {
|
||||
mimeTypes.add(if (ext == "text/csv") "text/comma-separated-values" else ext)
|
||||
} else {
|
||||
MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext)?.let {
|
||||
mimeTypes.add(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return mimeTypes.toTypedArray()
|
||||
}
|
||||
|
||||
private fun setIntentMimeTypes(intent: Intent, mimeTypes: Array<String>) {
|
||||
if (mimeTypes.isNotEmpty()) {
|
||||
var uniqueMimeKind = true
|
||||
var mimeKind: String? = null
|
||||
for (mime in mimeTypes) {
|
||||
val kind = mime.split("/")[0]
|
||||
if (mimeKind == null) {
|
||||
mimeKind = kind
|
||||
} else if (mimeKind != kind) {
|
||||
uniqueMimeKind = false
|
||||
}
|
||||
}
|
||||
|
||||
if (uniqueMimeKind) {
|
||||
if (mimeTypes.size > 1) {
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes)
|
||||
intent.type = Intent.normalizeMimeType("$mimeKind/*")
|
||||
} else {
|
||||
intent.type = mimeTypes[0]
|
||||
}
|
||||
} else {
|
||||
intent.type = "*/*"
|
||||
}
|
||||
} else {
|
||||
intent.type = "*/*"
|
||||
}
|
||||
}
|
||||
|
||||
@Command
|
||||
fun showMessageDialog(invoke: Invoke) {
|
||||
@@ -187,10 +210,12 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
|
||||
fun saveFileDialog(invoke: Invoke) {
|
||||
try {
|
||||
val args = invoke.parseArgs(SaveFileDialogOptions::class.java)
|
||||
val parsedTypes = parseFiltersOption(args.filters)
|
||||
|
||||
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT)
|
||||
setIntentMimeTypes(intent, parsedTypes)
|
||||
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE)
|
||||
intent.setType("text/plain")
|
||||
intent.putExtra(Intent.EXTRA_TITLE, args.fileName ?: "")
|
||||
startActivityForResult(invoke, intent, "saveFileDialogResult")
|
||||
} catch (ex: Exception) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()??"Yes",cancelButtonLabel:i?.cancelLabel?.toString()??"No"})},t.confirm=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()??"Ok",cancelButtonLabel:i?.cancelLabel?.toString()??"Cancel"})},t.message=async function(t,e){const i="string"==typeof e?{title:e}:e;await n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,yesButtonLabel:i?.okLabel?.toString(),noButtonLabel:i?.cancelLabel?.toString()})},t.confirm=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString(),cancelButtonLabel:i?.cancelLabel?.toString()})},t.message=async function(t,e){const i="string"==typeof e?{title:e}:e;await n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})}
|
||||
|
||||
@@ -257,8 +257,8 @@ async function ask(
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
kind: opts?.kind,
|
||||
okButtonLabel: opts?.okLabel?.toString() ?? 'Yes',
|
||||
cancelButtonLabel: opts?.cancelLabel?.toString() ?? 'No'
|
||||
yesButtonLabel: opts?.okLabel?.toString(),
|
||||
noButtonLabel: opts?.cancelLabel?.toString()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -287,8 +287,8 @@ async function confirm(
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
kind: opts?.kind,
|
||||
okButtonLabel: opts?.okLabel?.toString() ?? 'Ok',
|
||||
cancelButtonLabel: opts?.cancelLabel?.toString() ?? 'Cancel'
|
||||
okButtonLabel: opts?.okLabel?.toString(),
|
||||
cancelButtonLabel: opts?.cancelLabel?.toString()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-dialog",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -10,7 +10,7 @@ use tauri_plugin_fs::FsExt;
|
||||
|
||||
use crate::{
|
||||
Dialog, FileDialogBuilder, FilePath, MessageDialogButtons, MessageDialogKind, Result, CANCEL,
|
||||
OK,
|
||||
NO, OK, YES,
|
||||
};
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -299,8 +299,8 @@ pub(crate) async fn ask<R: Runtime>(
|
||||
title: Option<String>,
|
||||
message: String,
|
||||
kind: Option<MessageDialogKind>,
|
||||
ok_button_label: Option<String>,
|
||||
cancel_button_label: Option<String>,
|
||||
yes_button_label: Option<String>,
|
||||
no_button_label: Option<String>,
|
||||
) -> Result<bool> {
|
||||
Ok(message_dialog(
|
||||
window,
|
||||
@@ -308,7 +308,16 @@ pub(crate) async fn ask<R: Runtime>(
|
||||
title,
|
||||
message,
|
||||
kind,
|
||||
get_ok_cancel_type(ok_button_label, cancel_button_label),
|
||||
if let Some(yes_button_label) = yes_button_label {
|
||||
MessageDialogButtons::OkCancelCustom(
|
||||
yes_button_label,
|
||||
no_button_label.unwrap_or(NO.to_string()),
|
||||
)
|
||||
} else if let Some(no_button_label) = no_button_label {
|
||||
MessageDialogButtons::OkCancelCustom(YES.to_string(), no_button_label)
|
||||
} else {
|
||||
MessageDialogButtons::YesNo
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
@@ -328,22 +337,15 @@ pub(crate) async fn confirm<R: Runtime>(
|
||||
title,
|
||||
message,
|
||||
kind,
|
||||
get_ok_cancel_type(ok_button_label, cancel_button_label),
|
||||
if let Some(ok_button_label) = ok_button_label {
|
||||
MessageDialogButtons::OkCancelCustom(
|
||||
ok_button_label,
|
||||
cancel_button_label.unwrap_or(CANCEL.to_string()),
|
||||
)
|
||||
} else if let Some(cancel_button_label) = cancel_button_label {
|
||||
MessageDialogButtons::OkCancelCustom(OK.to_string(), cancel_button_label)
|
||||
} else {
|
||||
MessageDialogButtons::OkCancel
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
fn get_ok_cancel_type(
|
||||
ok_button_label: Option<String>,
|
||||
cancel_button_label: Option<String>,
|
||||
) -> MessageDialogButtons {
|
||||
if let Some(ok_button_label) = ok_button_label {
|
||||
MessageDialogButtons::OkCancelCustom(
|
||||
ok_button_label,
|
||||
cancel_button_label.unwrap_or(CANCEL.to_string()),
|
||||
)
|
||||
} else if let Some(cancel_button_label) = cancel_button_label {
|
||||
MessageDialogButtons::OkCancelCustom(OK.to_string(), cancel_button_label)
|
||||
} else {
|
||||
MessageDialogButtons::OkCancel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,7 @@ impl From<MessageDialogButtons> for rfd::MessageButtons {
|
||||
match value {
|
||||
MessageDialogButtons::Ok => Self::Ok,
|
||||
MessageDialogButtons::OkCancel => Self::OkCancel,
|
||||
MessageDialogButtons::YesNo => Self::YesNo,
|
||||
MessageDialogButtons::OkCustom(ok) => Self::OkCustom(ok),
|
||||
MessageDialogButtons::OkCancelCustom(ok, cancel) => Self::OkCancelCustom(ok, cancel),
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ use mobile::*;
|
||||
|
||||
pub(crate) const OK: &str = "Ok";
|
||||
pub(crate) const CANCEL: &str = "Cancel";
|
||||
pub(crate) const YES: &str = "Yes";
|
||||
pub(crate) const NO: &str = "No";
|
||||
|
||||
macro_rules! blocking_fn {
|
||||
($self:ident, $fn:ident) => {{
|
||||
@@ -236,6 +238,7 @@ impl<R: Runtime> MessageDialogBuilder<R> {
|
||||
let (ok_button_label, cancel_button_label) = match &self.buttons {
|
||||
MessageDialogButtons::Ok => (Some(OK), None),
|
||||
MessageDialogButtons::OkCancel => (Some(OK), Some(CANCEL)),
|
||||
MessageDialogButtons::YesNo => (Some(YES), Some(NO)),
|
||||
MessageDialogButtons::OkCustom(ok) => (Some(ok.as_str()), Some(CANCEL)),
|
||||
MessageDialogButtons::OkCancelCustom(ok, cancel) => {
|
||||
(Some(ok.as_str()), Some(cancel.as_str()))
|
||||
|
||||
@@ -59,6 +59,8 @@ pub enum MessageDialogButtons {
|
||||
Ok,
|
||||
/// 2 buttons `Ok` and `Cancel` with OS default dialog texts
|
||||
OkCancel,
|
||||
/// 2 buttons `Yes` and `No` with OS default dialog texts
|
||||
YesNo,
|
||||
/// A single `Ok` button with custom text
|
||||
OkCustom(String),
|
||||
/// 2 buttons `Ok` and `Cancel` with custom texts
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
- [`77149dc4`](https://github.com/tauri-apps/plugins-workspace/commit/77149dc4320d26b413e4a6bbe82c654367c51b32) ([#1965](https://github.com/tauri-apps/plugins-workspace/pull/1965) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Fix `writeTextFile` converting UTF-8 characters (for example `äöü`) in the given path into replacement character (`�`)
|
||||
|
||||
## \[2.0.3]
|
||||
|
||||
- [`14cee64c`](https://github.com/tauri-apps/plugins-workspace/commit/14cee64c82a72655ae6a4ac0892736a2959dbda5) ([#1958](https://github.com/tauri-apps/plugins-workspace/pull/1958) by [@bWanShiTong](https://github.com/tauri-apps/plugins-workspace/../../bWanShiTong)) Fix compilation on targets with pointer width of `16` or `32`
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`ae802456`](https://github.com/tauri-apps/plugins-workspace/commit/ae8024565f074f313084777c8b10d1b5e3bbe220) ([#1950](https://github.com/tauri-apps/plugins-workspace/pull/1950) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Improve performance of the `FileHandle.read` and `writeTextFile` APIs.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-fs"
|
||||
version = "2.0.0"
|
||||
version = "2.0.3"
|
||||
description = "Access the file system."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -35,8 +35,12 @@ url = { workspace = true }
|
||||
anyhow = "1"
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
glob = "0.3"
|
||||
notify = { version = "6", optional = true, features = ["serde"] }
|
||||
notify-debouncer-full = { version = "0.3", optional = true }
|
||||
# TODO: Remove `serialization-compat-6` in v3
|
||||
notify = { version = "7", optional = true, features = [
|
||||
"serde",
|
||||
"serialization-compat-6",
|
||||
] }
|
||||
notify-debouncer-full = { version = "0.4", optional = true }
|
||||
dunce = { workspace = true }
|
||||
percent-encoding = "2"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Access the file system.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -243,6 +243,25 @@ function parseFileInfo(r: UnparsedFileInfo): FileInfo {
|
||||
}
|
||||
}
|
||||
|
||||
// https://mstn.github.io/2018/06/08/fixed-size-arrays-in-typescript/
|
||||
type FixedSizeArray<T, N extends number> = ReadonlyArray<T> & {
|
||||
length: N
|
||||
}
|
||||
|
||||
// https://gist.github.com/zapthedingbat/38ebfbedd98396624e5b5f2ff462611d
|
||||
/** Converts a big-endian eight byte array to number */
|
||||
function fromBytes(buffer: FixedSizeArray<number, 8>): number {
|
||||
const bytes = new Uint8ClampedArray(buffer)
|
||||
const size = bytes.byteLength
|
||||
let x = 0
|
||||
for (let i = 0; i < size; i++) {
|
||||
const byte = bytes[i]
|
||||
x *= 0x100
|
||||
x += byte
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
/**
|
||||
* The Tauri abstraction for reading and writing files.
|
||||
*
|
||||
@@ -285,12 +304,20 @@ class FileHandle extends Resource {
|
||||
return 0
|
||||
}
|
||||
|
||||
const [data, nread] = await invoke<[number[], number]>('plugin:fs|read', {
|
||||
const data = await invoke<ArrayBuffer | number[]>('plugin:fs|read', {
|
||||
rid: this.rid,
|
||||
len: buffer.byteLength
|
||||
})
|
||||
|
||||
buffer.set(data)
|
||||
// Rust side will never return an empty array for this command and
|
||||
// ensure there is at least 8 elements there.
|
||||
//
|
||||
// This is an optimization to include the number of read bytes (as bigendian bytes)
|
||||
// at the end of returned array to avoid serialization overhead of separate values.
|
||||
const nread = fromBytes(data.slice(-8) as FixedSizeArray<number, 8>)
|
||||
|
||||
const bytes = data instanceof ArrayBuffer ? new Uint8Array(data) : data
|
||||
buffer.set(bytes.slice(0, bytes.length - 8))
|
||||
|
||||
return nread === 0 ? null : nread
|
||||
}
|
||||
@@ -1041,10 +1068,13 @@ async function writeTextFile(
|
||||
throw new TypeError('Must be a file URL.')
|
||||
}
|
||||
|
||||
await invoke('plugin:fs|write_text_file', {
|
||||
path: path instanceof URL ? path.toString() : path,
|
||||
data,
|
||||
options
|
||||
const encoder = new TextEncoder()
|
||||
|
||||
await invoke('plugin:fs|write_text_file', encoder.encode(data), {
|
||||
headers: {
|
||||
path: encodeURIComponent(path instanceof URL ? path.toString() : path),
|
||||
options: JSON.stringify(options)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-fs",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.2",
|
||||
"description": "Access the file system.",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
|
||||
@@ -24,6 +24,7 @@ This default permission set prevents access to critical components
|
||||
of the Tauri application by default.
|
||||
On Windows the webview data folder access is denied.
|
||||
|
||||
#### Included permissions within this default permission set:
|
||||
|
||||
|
||||
- `create-app-specific-dirs`
|
||||
|
||||
@@ -26,6 +26,7 @@ This default permission set prevents access to critical components
|
||||
of the Tauri application by default.
|
||||
On Windows the webview data folder access is denied.
|
||||
|
||||
#### Included permissions within this default permission set:
|
||||
"""
|
||||
permissions = [
|
||||
"create-app-specific-dirs",
|
||||
|
||||
@@ -1665,7 +1665,7 @@
|
||||
"const": "create-app-specific-dirs"
|
||||
},
|
||||
{
|
||||
"description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n",
|
||||
"description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n#### Included permissions within this default permission set:\n",
|
||||
"type": "string",
|
||||
"const": "default"
|
||||
},
|
||||
|
||||
+63
-50
@@ -9,7 +9,7 @@ use tauri::{
|
||||
ipc::{CommandScope, GlobalScope},
|
||||
path::BaseDirectory,
|
||||
utils::config::FsScope,
|
||||
AppHandle, Manager, Resource, ResourceId, Runtime, Webview,
|
||||
Manager, Resource, ResourceId, Runtime, Webview,
|
||||
};
|
||||
|
||||
use std::{
|
||||
@@ -301,13 +301,36 @@ pub async fn read_dir<R: Runtime>(
|
||||
pub async fn read<R: Runtime>(
|
||||
webview: Webview<R>,
|
||||
rid: ResourceId,
|
||||
len: u32,
|
||||
) -> CommandResult<(Vec<u8>, usize)> {
|
||||
let mut data = vec![0; len as usize];
|
||||
len: usize,
|
||||
) -> CommandResult<tauri::ipc::Response> {
|
||||
let mut data = vec![0; len];
|
||||
let file = webview.resources_table().get::<StdFileResource>(rid)?;
|
||||
let nread = StdFileResource::with_lock(&file, |mut file| file.read(&mut data))
|
||||
.map_err(|e| format!("faied to read bytes from file with error: {e}"))?;
|
||||
Ok((data, nread))
|
||||
|
||||
// This is an optimization to include the number of read bytes (as bigendian bytes)
|
||||
// at the end of returned vector so we can use `tauri::ipc::Response`
|
||||
// and avoid serialization overhead of separate values.
|
||||
#[cfg(target_pointer_width = "16")]
|
||||
let nread = {
|
||||
let nread = nread.to_be_bytes();
|
||||
let mut out = [0; 8];
|
||||
out[6..].copy_from_slice(&nread);
|
||||
out
|
||||
};
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
let nread = {
|
||||
let nread = nread.to_be_bytes();
|
||||
let mut out = [0; 8];
|
||||
out[4..].copy_from_slice(&nread);
|
||||
out
|
||||
};
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
let nread = nread.to_be_bytes();
|
||||
|
||||
data.extend(nread);
|
||||
|
||||
Ok(tauri::ipc::Response::new(data))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -783,10 +806,34 @@ fn write_file_inner<R: Runtime>(
|
||||
webview: Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
command_scope: &CommandScope<Entry>,
|
||||
path: SafeFilePath,
|
||||
data: &[u8],
|
||||
options: Option<WriteFileOptions>,
|
||||
request: tauri::ipc::Request<'_>,
|
||||
) -> CommandResult<()> {
|
||||
let data = match request.body() {
|
||||
tauri::ipc::InvokeBody::Raw(data) => Cow::Borrowed(data),
|
||||
tauri::ipc::InvokeBody::Json(serde_json::Value::Array(data)) => Cow::Owned(
|
||||
data.iter()
|
||||
.flat_map(|v| v.as_number().and_then(|v| v.as_u64().map(|v| v as u8)))
|
||||
.collect(),
|
||||
),
|
||||
_ => return Err(anyhow::anyhow!("unexpected invoke body").into()),
|
||||
};
|
||||
|
||||
let path = request
|
||||
.headers()
|
||||
.get("path")
|
||||
.ok_or_else(|| anyhow::anyhow!("missing file path").into())
|
||||
.and_then(|p| {
|
||||
percent_encoding::percent_decode(p.as_ref())
|
||||
.decode_utf8()
|
||||
.map_err(|_| anyhow::anyhow!("path is not a valid UTF-8").into())
|
||||
})
|
||||
.and_then(|p| SafeFilePath::from_str(&p).map_err(CommandError::from))?;
|
||||
let options: Option<WriteFileOptions> = request
|
||||
.headers()
|
||||
.get("options")
|
||||
.and_then(|p| p.to_str().ok())
|
||||
.and_then(|opts| serde_json::from_str(opts).ok());
|
||||
|
||||
let (mut file, path) = resolve_file(
|
||||
&webview,
|
||||
global_scope,
|
||||
@@ -823,7 +870,7 @@ fn write_file_inner<R: Runtime>(
|
||||
},
|
||||
)?;
|
||||
|
||||
file.write_all(data)
|
||||
file.write_all(&data)
|
||||
.map_err(|e| {
|
||||
format!(
|
||||
"failed to write bytes to file at path: {} with error: {e}",
|
||||
@@ -840,52 +887,18 @@ pub async fn write_file<R: Runtime>(
|
||||
command_scope: CommandScope<Entry>,
|
||||
request: tauri::ipc::Request<'_>,
|
||||
) -> CommandResult<()> {
|
||||
let data = match request.body() {
|
||||
tauri::ipc::InvokeBody::Raw(data) => Cow::Borrowed(data),
|
||||
tauri::ipc::InvokeBody::Json(serde_json::Value::Array(data)) => Cow::Owned(
|
||||
data.iter()
|
||||
.flat_map(|v| v.as_number().and_then(|v| v.as_u64().map(|v| v as u8)))
|
||||
.collect(),
|
||||
),
|
||||
_ => return Err(anyhow::anyhow!("unexpected invoke body").into()),
|
||||
};
|
||||
|
||||
let path = request
|
||||
.headers()
|
||||
.get("path")
|
||||
.ok_or_else(|| anyhow::anyhow!("missing file path").into())
|
||||
.and_then(|p| {
|
||||
percent_encoding::percent_decode(p.as_ref())
|
||||
.decode_utf8()
|
||||
.map_err(|_| anyhow::anyhow!("path is not a valid UTF-8").into())
|
||||
})
|
||||
.and_then(|p| SafeFilePath::from_str(&p).map_err(CommandError::from))?;
|
||||
let options = request
|
||||
.headers()
|
||||
.get("options")
|
||||
.and_then(|p| p.to_str().ok())
|
||||
.and_then(|opts| serde_json::from_str(opts).ok());
|
||||
write_file_inner(webview, &global_scope, &command_scope, path, &data, options)
|
||||
write_file_inner(webview, &global_scope, &command_scope, request)
|
||||
}
|
||||
|
||||
// TODO, in v3, remove this command and rely on `write_file` command only
|
||||
#[tauri::command]
|
||||
pub async fn write_text_file<R: Runtime>(
|
||||
#[allow(unused)] app: AppHandle<R>,
|
||||
#[allow(unused)] webview: Webview<R>,
|
||||
#[allow(unused)] global_scope: GlobalScope<Entry>,
|
||||
#[allow(unused)] command_scope: CommandScope<Entry>,
|
||||
path: SafeFilePath,
|
||||
data: String,
|
||||
#[allow(unused)] options: Option<WriteFileOptions>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
request: tauri::ipc::Request<'_>,
|
||||
) -> CommandResult<()> {
|
||||
write_file_inner(
|
||||
webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
data.as_bytes(),
|
||||
options,
|
||||
)
|
||||
write_file_inner(webview, &global_scope, &command_scope, request)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use notify::{Config, Event, RecommendedWatcher, RecursiveMode, Watcher};
|
||||
use notify_debouncer_full::{new_debouncer, DebounceEventResult, Debouncer, FileIdMap};
|
||||
use notify_debouncer_full::{new_debouncer, DebounceEventResult, Debouncer, RecommendedCache};
|
||||
use serde::Deserialize;
|
||||
use tauri::{
|
||||
ipc::{Channel, CommandScope, GlobalScope},
|
||||
@@ -47,7 +47,7 @@ impl WatcherResource {
|
||||
impl Resource for WatcherResource {}
|
||||
|
||||
enum WatcherKind {
|
||||
Debouncer(Debouncer<RecommendedWatcher, FileIdMap>),
|
||||
Debouncer(Debouncer<RecommendedWatcher, RecommendedCache>),
|
||||
Watcher(RecommendedWatcher),
|
||||
}
|
||||
|
||||
@@ -111,8 +111,7 @@ pub async fn watch<R: Runtime>(
|
||||
let (tx, rx) = channel();
|
||||
let mut debouncer = new_debouncer(Duration::from_millis(delay), None, tx)?;
|
||||
for path in &resolved_paths {
|
||||
debouncer.watcher().watch(path.as_ref(), recursive_mode)?;
|
||||
debouncer.cache().add_root(path, recursive_mode);
|
||||
debouncer.watch(path, recursive_mode)?;
|
||||
}
|
||||
watch_debounced(on_event, rx);
|
||||
WatcherKind::Debouncer(debouncer)
|
||||
@@ -120,7 +119,7 @@ pub async fn watch<R: Runtime>(
|
||||
let (tx, rx) = channel();
|
||||
let mut watcher = RecommendedWatcher::new(tx, Config::default())?;
|
||||
for path in &resolved_paths {
|
||||
watcher.watch(path.as_ref(), recursive_mode)?;
|
||||
watcher.watch(path, recursive_mode)?;
|
||||
}
|
||||
watch_raw(on_event, rx);
|
||||
WatcherKind::Watcher(watcher)
|
||||
@@ -140,14 +139,14 @@ pub async fn unwatch<R: Runtime>(webview: Webview<R>, rid: ResourceId) -> Comman
|
||||
match &mut watcher.kind {
|
||||
WatcherKind::Debouncer(ref mut debouncer) => {
|
||||
for path in &watcher.paths {
|
||||
debouncer.watcher().unwatch(path.as_ref()).map_err(|e| {
|
||||
debouncer.unwatch(path).map_err(|e| {
|
||||
format!("failed to unwatch path: {} with error: {e}", path.display())
|
||||
})?;
|
||||
}
|
||||
}
|
||||
WatcherKind::Watcher(ref mut w) => {
|
||||
for path in &watcher.paths {
|
||||
w.unwatch(path.as_ref()).map_err(|e| {
|
||||
w.unwatch(path).map_err(|e| {
|
||||
format!("failed to unwatch path: {} with error: {e}", path.display())
|
||||
})?;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "tauri-plugin-geolocation"
|
||||
description = "Get and track the device's current position"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -12,7 +12,7 @@ This plugin provides APIs for getting and tracking the device's current position
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-global-shortcut"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Register global hotkeys listeners on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -12,7 +12,7 @@ Register global shortcuts.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "tauri-plugin-haptics"
|
||||
description = "Haptic feedback and vibrations on Android and iOS"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -14,7 +14,7 @@ There are no standards/requirements for vibration support on Android, so the `fe
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.3`
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`cfd48b3b`](https://github.com/tauri-apps/plugins-workspace/commit/cfd48b3b2ec0fccfc162197518694ed59ceda22c) ([#1941](https://github.com/tauri-apps/plugins-workspace/pull/1941) by [@Nipsuli](https://github.com/tauri-apps/plugins-workspace/../../Nipsuli)) Allow skipping sending `Origin` header in HTTP requests by setting `Origin` header to an empty string when calling `fetch`.
|
||||
- [`9b2840db`](https://github.com/tauri-apps/plugins-workspace/commit/9b2840db9464cf08db75806270e4441f0af81e5d) ([#1884](https://github.com/tauri-apps/plugins-workspace/pull/1884) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Retain headers order.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.1`
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
@@ -278,3 +297,6 @@
|
||||
ha release!
|
||||
!
|
||||
371\)) First v2 alpha release!
|
||||
lease!
|
||||
!
|
||||
371\)) First v2 alpha release!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-http"
|
||||
version = "2.0.0"
|
||||
version = "2.0.3"
|
||||
description = "Access an HTTP client written in Rust."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -17,8 +17,8 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
macos = { level = "full", notes = "" }
|
||||
android = { level = "none", notes = "" }
|
||||
ios = { level = "none", notes = "" }
|
||||
android = { level = "full", notes = "" }
|
||||
ios = { level = "full", notes = "" }
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
@@ -34,7 +34,7 @@ serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tokio = { version = "1", features = ["sync", "macros"] }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.3" }
|
||||
urlpattern = "0.3"
|
||||
regex = "1"
|
||||
http = "1"
|
||||
|
||||
@@ -12,7 +12,7 @@ Access the HTTP client written in Rust.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-http",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::{collections::HashMap, future::Future, pin::Pin, sync::Arc, time::Duration};
|
||||
use std::{future::Future, pin::Pin, str::FromStr, sync::Arc, time::Duration};
|
||||
|
||||
use http::{header, HeaderName, Method, StatusCode};
|
||||
use http::{header, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use reqwest::{redirect::Policy, NoProxy};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tauri::{
|
||||
@@ -176,7 +176,7 @@ pub async fn fetch<R: Runtime>(
|
||||
let ClientConfig {
|
||||
method,
|
||||
url,
|
||||
headers,
|
||||
headers: headers_raw,
|
||||
data,
|
||||
connect_timeout,
|
||||
max_redirections,
|
||||
@@ -185,7 +185,22 @@ pub async fn fetch<R: Runtime>(
|
||||
|
||||
let scheme = url.scheme();
|
||||
let method = Method::from_bytes(method.as_bytes())?;
|
||||
let headers: HashMap<String, String> = HashMap::from_iter(headers);
|
||||
|
||||
let mut headers = HeaderMap::new();
|
||||
for (h, v) in headers_raw {
|
||||
let name = HeaderName::from_str(&h)?;
|
||||
#[cfg(not(feature = "unsafe-headers"))]
|
||||
if is_unsafe_header(&name) {
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
eprintln!("[\x1b[33mWARNING\x1b[0m] Skipping {name} header as it is a forbidden header per fetch spec https://fetch.spec.whatwg.org/#terminology-headers");
|
||||
eprintln!("[\x1b[33mWARNING\x1b[0m] if keeping the header is a desired behavior, you can enable `unsafe-headers` feature flag in your Cargo.toml");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
headers.append(name, HeaderValue::from_str(&v)?);
|
||||
}
|
||||
|
||||
match scheme {
|
||||
"http" | "https" => {
|
||||
@@ -228,45 +243,46 @@ pub async fn fetch<R: Runtime>(
|
||||
|
||||
let mut request = builder.build()?.request(method.clone(), url);
|
||||
|
||||
for (name, value) in &headers {
|
||||
let name = HeaderName::from_bytes(name.as_bytes())?;
|
||||
#[cfg(not(feature = "unsafe-headers"))]
|
||||
if is_unsafe_header(&name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
request = request.header(name, value);
|
||||
}
|
||||
|
||||
// POST and PUT requests should always have a 0 length content-length,
|
||||
// if there is no body. https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
|
||||
if data.is_none() && matches!(method, Method::POST | Method::PUT) {
|
||||
request = request.header(header::CONTENT_LENGTH, 0);
|
||||
headers.append(header::CONTENT_LENGTH, HeaderValue::from_str("0")?);
|
||||
}
|
||||
|
||||
if headers.contains_key(header::RANGE.as_str()) {
|
||||
if headers.contains_key(header::RANGE) {
|
||||
// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 18
|
||||
// If httpRequest’s header list contains `Range`, then append (`Accept-Encoding`, `identity`)
|
||||
request = request.header(header::ACCEPT_ENCODING, "identity");
|
||||
headers.append(header::ACCEPT_ENCODING, HeaderValue::from_str("identity")?);
|
||||
}
|
||||
|
||||
if !headers.contains_key(header::USER_AGENT.as_str()) {
|
||||
request = request.header(header::USER_AGENT, HTTP_USER_AGENT);
|
||||
if !headers.contains_key(header::USER_AGENT) {
|
||||
headers.append(header::USER_AGENT, HeaderValue::from_str(HTTP_USER_AGENT)?);
|
||||
}
|
||||
|
||||
if cfg!(feature = "unsafe-headers")
|
||||
&& !headers.contains_key(header::ORIGIN.as_str())
|
||||
{
|
||||
// ensure we have an Origin header set
|
||||
if cfg!(not(feature = "unsafe-headers")) || !headers.contains_key(header::ORIGIN) {
|
||||
if let Ok(url) = webview.url() {
|
||||
request =
|
||||
request.header(header::ORIGIN, url.origin().ascii_serialization());
|
||||
headers.append(
|
||||
header::ORIGIN,
|
||||
HeaderValue::from_str(&url.origin().ascii_serialization())?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// In case empty origin is passed, remove it. Some services do not like Origin header
|
||||
// so this way we can remove it in explicit way. The default behaviour is still to set it
|
||||
if cfg!(feature = "unsafe-headers")
|
||||
&& headers.get(header::ORIGIN) == Some(&HeaderValue::from_static(""))
|
||||
{
|
||||
headers.remove(header::ORIGIN);
|
||||
};
|
||||
|
||||
if let Some(data) = data {
|
||||
request = request.body(data);
|
||||
}
|
||||
|
||||
request = request.headers(headers);
|
||||
|
||||
let fut = async move { request.send().await.map_err(Into::into) };
|
||||
let mut resources_table = webview.resources_table();
|
||||
let rid = resources_table.add_request(Box::pin(fut));
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-localhost"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Expose your apps assets through a localhost server instead of the default custom protocol."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -14,7 +14,7 @@ Expose your apps assets through a localhost server instead of the default custom
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
- [`606fa08d`](https://github.com/tauri-apps/plugins-workspace/commit/606fa08dae1acd074b961fb360623f4c86f13ee8) ([#1997](https://github.com/tauri-apps/plugins-workspace/pull/1997) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) **Potentially breaking:** Updated `fern` from 0.6 to 0.7. This is technically a breaking change because `fern` is re-exported in `tauri-plugin-log`.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-log"
|
||||
version = "2.0.0"
|
||||
version = "2.0.2"
|
||||
description = "Configurable logging for your Tauri app."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -31,7 +31,7 @@ serde_repr = "0.1"
|
||||
byte-unit = "5"
|
||||
log = { workspace = true, features = ["kv_unstable"] }
|
||||
time = { version = "0.3", features = ["formatting", "local-offset"] }
|
||||
fern = "0.6"
|
||||
fern = "0.7"
|
||||
thiserror = "1"
|
||||
|
||||
[target."cfg(target_os = \"android\")".dependencies]
|
||||
|
||||
@@ -12,7 +12,7 @@ Configurable logging for your Tauri app.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-nfc"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Read and write NFC tags on Android and iOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-notification"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Send desktop and mobile notifications on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -12,7 +12,7 @@ Send message notifications (brief auto-expiring OS window element) to your user.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function t(i,t,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!e:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(i):e?e.value:t.get(i)}function n(i,t,n,e,o){if("function"==typeof t?i!==t||!o:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(i,n),n}var e,o,a,r,c,s;"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,e.set(this,(()=>{})),o.set(this,0),a.set(this,{}),this.id=function(i,t=!1){return window.__TAURI_INTERNALS__.transformCallback(i,t)}((({message:i,id:r})=>{if(r===t(this,o,"f")){n(this,o,r+1),t(this,e,"f").call(this,i);const c=Object.keys(t(this,a,"f"));if(c.length>0){let i=r+1;for(const n of c.sort()){if(parseInt(n)!==i)break;{const o=t(this,a,"f")[n];delete t(this,a,"f")[n],t(this,e,"f").call(this,o),i+=1}}n(this,o,i)}}else t(this,a,"f")[r.toString()]=i}))}set onmessage(i){n(this,e,i)}get onmessage(){return t(this,e,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}e=new WeakMap,o=new WeakMap,a=new WeakMap;class u{constructor(i,t,n){this.plugin=i,this.event=t,this.channelId=n}async unregister(){return d(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function f(i,t,n){const e=new l;return e.onmessage=n,d(`plugin:${i}|register_listener`,{event:t,handler:e}).then((()=>new u(i,t,e.id)))}async function d(i,t={},n){return window.__TAURI_INTERNALS__.invoke(i,t,n)}i.ScheduleEvery=void 0,(r=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",r.Month="month",r.TwoWeeks="twoWeeks",r.Week="week",r.Day="day",r.Hour="hour",r.Minute="minute",r.Second="second";return i.Importance=void 0,(c=i.Importance||(i.Importance={}))[c.None=0]="None",c[c.Min=1]="Min",c[c.Low=2]="Low",c[c.Default=3]="Default",c[c.High=4]="High",i.Visibility=void 0,(s=i.Visibility||(i.Visibility={}))[s.Secret=-1]="Secret",s[s.Private=0]="Private",s[s.Public=1]="Public",i.Schedule=class{static at(i,t=!1,n=!1){return{at:{date:i,repeating:t,allowWhileIdle:n},interval:void 0,every:void 0}}static interval(i,t=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:t},every:void 0}}static every(i,t,n=!1){return{at:void 0,interval:void 0,every:{interval:i,count:t,allowWhileIdle:n}}}},i.active=async function(){return await d("plugin:notification|get_active")},i.cancel=async function(i){await d("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await d("plugin:notification|cancel")},i.channels=async function(){return await d("plugin:notification|listChannels")},i.createChannel=async function(i){await d("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await d("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await f("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await f("notification","notification",i)},i.pending=async function(){return await d("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await d("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await d("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await d("plugin:notification|remove_active")},i.removeChannel=async function(i){await d("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function t(i,t,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!e:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(i):e?e.value:t.get(i)}function n(i,t,n,e,o){if("function"==typeof t?i!==t||!o:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(i,n),n}var e,o,a,r,c,s;"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,e.set(this,(()=>{})),o.set(this,0),a.set(this,{}),this.id=function(i,t=!1){return window.__TAURI_INTERNALS__.transformCallback(i,t)}((({message:i,id:r})=>{if(r===t(this,o,"f")){n(this,o,r+1),t(this,e,"f").call(this,i);const c=Object.keys(t(this,a,"f"));if(c.length>0){let i=r+1;for(const n of c.sort()){if(parseInt(n)!==i)break;{const o=t(this,a,"f")[n];delete t(this,a,"f")[n],t(this,e,"f").call(this,o),i+=1}}n(this,o,i)}}else t(this,a,"f")[r.toString()]=i}))}set onmessage(i){n(this,e,i)}get onmessage(){return t(this,e,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}e=new WeakMap,o=new WeakMap,a=new WeakMap;class u{constructor(i,t,n){this.plugin=i,this.event=t,this.channelId=n}async unregister(){return d(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function f(i,t,n){const e=new l;return e.onmessage=n,d(`plugin:${i}|registerListener`,{event:t,handler:e}).then((()=>new u(i,t,e.id)))}async function d(i,t={},n){return window.__TAURI_INTERNALS__.invoke(i,t,n)}i.ScheduleEvery=void 0,(r=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",r.Month="month",r.TwoWeeks="twoWeeks",r.Week="week",r.Day="day",r.Hour="hour",r.Minute="minute",r.Second="second";return i.Importance=void 0,(c=i.Importance||(i.Importance={}))[c.None=0]="None",c[c.Min=1]="Min",c[c.Low=2]="Low",c[c.Default=3]="Default",c[c.High=4]="High",i.Visibility=void 0,(s=i.Visibility||(i.Visibility={}))[s.Secret=-1]="Secret",s[s.Private=0]="Private",s[s.Public=1]="Public",i.Schedule=class{static at(i,t=!1,n=!1){return{at:{date:i,repeating:t,allowWhileIdle:n},interval:void 0,every:void 0}}static interval(i,t=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:t},every:void 0}}static every(i,t,n=!1){return{at:void 0,interval:void 0,every:{interval:i,count:t,allowWhileIdle:n}}}},i.active=async function(){return await d("plugin:notification|get_active")},i.cancel=async function(i){await d("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await d("plugin:notification|cancel")},i.channels=async function(){return await d("plugin:notification|listChannels")},i.createChannel=async function(i){await d("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await d("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await f("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await f("notification","notification",i)},i.pending=async function(){return await d("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await d("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await d("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await d("plugin:notification|remove_active")},i.removeChannel=async function(i){await d("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-os"
|
||||
version = "2.0.0"
|
||||
version = "2.0.1"
|
||||
description = "Read information about the operating system."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -12,7 +12,7 @@ Read information about the operating system.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.3`
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.2`
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.1`
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-persisted-scope"
|
||||
version = "2.0.0"
|
||||
version = "2.0.3"
|
||||
description = "Save filesystem and asset scopes and restore them when the app is reopened."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -27,7 +27,7 @@ log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
aho-corasick = "1"
|
||||
bincode = "1"
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.3" }
|
||||
|
||||
[features]
|
||||
protocol-asset = ["tauri/protocol-asset"]
|
||||
|
||||
@@ -12,7 +12,7 @@ Save filesystem and asset scopes and restore them when the app is reopened.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`3c1f3874`](https://github.com/tauri-apps/plugins-workspace/commit/3c1f3874f4c828637b3aa983cba13c77427faf58) ([#1911](https://github.com/tauri-apps/plugins-workspace/pull/1911) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Added missing permission for `handleIconState` and fixed its event processing logic.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-positioner"
|
||||
version = "2.0.0"
|
||||
version = "2.0.2"
|
||||
description = "Position your windows at well-known locations."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -14,7 +14,7 @@ This plugin is a port of [electron-positioner](https://github.com/jenslind/elect
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_POSITIONER__=function(t){"use strict";async function e(t,e={},o){return window.__TAURI_INTERNALS__.invoke(t,e,o)}var o;return"function"==typeof SuppressedError&&SuppressedError,t.Position=void 0,(o=t.Position||(t.Position={}))[o.TopLeft=0]="TopLeft",o[o.TopRight=1]="TopRight",o[o.BottomLeft=2]="BottomLeft",o[o.BottomRight=3]="BottomRight",o[o.TopCenter=4]="TopCenter",o[o.BottomCenter=5]="BottomCenter",o[o.LeftCenter=6]="LeftCenter",o[o.RightCenter=7]="RightCenter",o[o.Center=8]="Center",o[o.TrayLeft=9]="TrayLeft",o[o.TrayBottomLeft=10]="TrayBottomLeft",o[o.TrayRight=11]="TrayRight",o[o.TrayBottomRight=12]="TrayBottomRight",o[o.TrayCenter=13]="TrayCenter",o[o.TrayBottomCenter=14]="TrayBottomCenter",t.handleIconState=async function(t){const o={};o[`${t.rect.size.type}`]={width:t.rect.size.width,height:t.rect.size.height};const i={};i[`${t.rect.position.type}`]={x:t.rect.position.x,y:t.rect.position.y},await e("plugin:positioner|set_tray_icon_state",{position:i,size:o})},t.moveWindow=async function(t){await e("plugin:positioner|move_window",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_PLUGIN_POSITIONER__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_POSITIONER__=function(t){"use strict";async function o(t,o={},e){return window.__TAURI_INTERNALS__.invoke(t,o,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,t.Position=void 0,(e=t.Position||(t.Position={}))[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e[e.TopCenter=4]="TopCenter",e[e.BottomCenter=5]="BottomCenter",e[e.LeftCenter=6]="LeftCenter",e[e.RightCenter=7]="RightCenter",e[e.Center=8]="Center",e[e.TrayLeft=9]="TrayLeft",e[e.TrayBottomLeft=10]="TrayBottomLeft",e[e.TrayRight=11]="TrayRight",e[e.TrayBottomRight=12]="TrayBottomRight",e[e.TrayCenter=13]="TrayCenter",e[e.TrayBottomCenter=14]="TrayBottomCenter",t.handleIconState=async function(t){await o("plugin:positioner|set_tray_icon_state",{position:t.rect.position,size:t.rect.size})},t.moveWindow=async function(t){await o("plugin:positioner|move_window",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_PLUGIN_POSITIONER__})}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user