Compare commits

...

40 Commits

Author SHA1 Message Date
amrbashir bc53cf11db use ShellExecuteExW 2024-10-30 01:55:03 +03:00
amrbashir 539d41ace7 use dunce 2024-10-30 01:38:01 +03:00
amrbashir 1ec8844b0e lock file 2024-10-30 00:37:30 +03:00
amrbashir b5c55d4ba2 Merge branch 'v2' into feat/shell-show-item-in-dir 2024-10-30 00:37:20 +03:00
阿良仔 4341d7f500 fix(sql): replace Mutex with RwLock to enable concurrent SQL execution (#1972) 2024-10-26 13:19:59 +02:00
Amr Bashir 77149dc432 fix(fs): fix writeFile converting UTF-8 characters in path into replacement character (#1965) 2024-10-22 08:17:37 +03:00
github-actions[bot] 525abc4be5 Publish New Versions (v2) (#1961)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2024-10-21 15:13:27 +03:00
bWanShiTong 14cee64c82 fix(fs): fix compilation on targets with pointer width 16 and 32 (#1958) 2024-10-21 15:07:55 +03:00
github-actions[bot] 3fd283121f publish new versions (#1909)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-10-20 08:54:26 -03:00
Amr Bashir ae8024565f perf(fs): improve FileHandle.read performance (#1950)
* perf(fs): improve `FileHandle.read` performance

* handle different target pointer width

* improve `writeTextFile` performance

* revert packageManager field

* change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-20 08:49:01 -03:00
Tony 2302c2db1c fix(dialog): ask and confirm not using system button texts (#1910)
* Fix `ask`'s button texts being ok and cancel

* Update change file
2024-10-20 08:48:45 -03:00
renovate[bot] 44c50c1275 chore(deps): update rust crate tauri to 2.0.4 (#1952)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-20 17:28:39 +08:00
renovate[bot] 415bf2abc3 chore(deps): update eslint monorepo to v9.13.0 (#1951)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-20 16:54:34 +08:00
renovate[bot] 36207a93f3 chore(deps): update dependency @tauri-apps/cli to v2.0.3 (#1925)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 11:14:14 +08:00
renovate[bot] 854754e10b chore(deps): update dependency typescript-eslint to v8.10.0 (#1949)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 11:13:06 +08:00
renovate[bot] 1c2f137a8a chore(deps): lock file maintenance (#1929)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-19 11:12:38 +08:00
Tony 8c67d44aef refactor(store)!: more reworks (#1860)
* refactor(store): more reworks

* Enable auto save by default

* Store to resource table by default

* Remove share store

* Clean up

* Add close store

* Add store function

* Add lazy store

* Add init to lazy store

* refresh cache in example

* Add get-or-create-store

* Revert "Add get-or-create-store"

This reverts commit 7ffd769240.

* try get first

* Docs

* Use absolute path for store

* more docs

* Allow js to use pre-stored (de)serialize functions

* Fix js get and close store

* Show case how to use pretty json

* Update readme

* Use store instead of `store_builder` in example

* Build

* Fix example

* More docs for StoreBuilder::build

* Add default (de)serialize fn

* Use pretty json by default

* Use `undefined` for empty value in get

* Change files

* Differentiate json null from no value for events

* Add create or existing

* Build

* Rename inner store's inset method to set

* Update readme

* Apply suggestions from code review

* Use close instead

* Update breaking changes

* Return result in resolve_store_path

* Change to close_resource and take &self

* Clean up

* Apply suggestions from code review

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* Remove unused pub(crate)

* Update change file

* Expose resolve_store_path

* Remove with_store

* Remove StoreInner from pub and expose is_empty

* Fix wrong jsdoc param

* Update readme

* rename createOrExistingStore to createOrLoad

* make api consistent with the JS implementation, add examples

* fmt

* reintroduce "get existing store" behavior for create_or_load

* rename createOrLoad to newOrExisting

* keep store lock throughout whole new_or_existing_inner

* Remove load

* Missed if load

* Don't make StoreState public

* Remove R: Runtime from Builder

* rename newOrExisting to load, load to reload

* update docs

* rename missing reload fn

* rename builder fn to build()

* fix default permission

* Fix description and create_new logic

* Clippy

* Update docs

* Update docs

* remove create_store command

* remove close_store command since we extend from Resource

* Revert "remove close_store command since we extend from Resource"

This reverts commit 4a29fc8990.

* Reapply "remove close_store command since we extend from Resource"

This reverts commit 70a1830e7d.

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-17 19:14:41 +08:00
Niko Korvenlaita cfd48b3b2e feat: allow http calls without origin header (#1941) 2024-10-16 15:56:36 +03:00
renovate[bot] 558e14bb4c chore(deps): update dependency typescript-eslint to v8.9.0 (#1937)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 09:52:18 +08:00
凊弦凝绝 aef5dd6157 fix(sql): don't panic on missing migration when preload is enabled (#1932)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2024-10-14 20:32:49 +02:00
Fabian-Lars 74ee7edc43 ci: Run workflows on ubuntu 22.04 (#1936) 2024-10-14 18:40:56 +02:00
Fabian-Lars 7e1c17a635 ci(renovate): Remove tauri pre-release workaround 2024-10-09 14:44:38 +02:00
Lucas Fernandes Nogueira 3c1f3874f4 fix(positioner): handleIconState missing permission and wrong impl (#1911) 2024-10-09 09:37:16 -03:00
Amr Bashir 51ddf6a715 fix(shell): use async command for open JS API (#1881)
closes tauri-apps/tauri#11212
2024-10-09 08:47:25 -03:00
renovate[bot] 62082b7086 chore(deps): lock file maintenance (#1895)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-09 08:46:38 -03:00
nashaofu aee14ed426 fix(dialog): Fix the issue of Android saving files with a .txt extension (#1892)
* fix: Fix the issue of Android saving files with a .txt extension

* fix(dialog): pull intent type from extensions filters

* fix covector

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-09 08:45:05 -03:00
Amr Bashir 9b2840db94 fix(http): retain headers order (#1884)
* fix(http): retain headers order

closes #1882

* simplify if

* actually set headers

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-09 08:07:46 -03:00
renovate[bot] 60064fce52 chore(deps): update dependency typescript to v5.6.3 (#1905)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-09 09:28:06 +08:00
renovate[bot] 0058583583 fix(deps): update tauri monorepo to v2.0.2 (#1874)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-08 15:29:28 +08:00
renovate[bot] fb676626f1 chore(deps): update dependency typescript-eslint to v8.8.1 (#1899)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-08 10:01:07 +08:00
renovate[bot] f445c704a1 chore(deps): update eslint monorepo to v9.12.0 (#1887)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-05 07:29:30 +08:00
github-actions[bot] fd785ab5de publish new versions (#1878)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-10-03 10:58:13 -03:00
Lucas Fernandes Nogueira a1a82208ed chore: change MSRV to 1.77.2 to support Windows 7 (#1873)
* chore: change MSRV to 1.77.2 to support Windows 7

* fmt
2024-10-03 10:31:13 -03:00
renovate[bot] dc49de5341 chore(deps): update dependency typescript-eslint to v8.8.0 (#1854)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-03 20:52:00 +08:00
Tillmann 4c2454d410 sync readme with metadata (#1872) 2024-10-03 07:23:40 -03:00
renovate[bot] fe6dd0ff9e fix(deps): update dependency @tauri-apps/api to v2.0.1 (#1862)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-03 10:54:25 +08:00
Horu ab8d089b2b chore(barcode-scanner): fix banner link in readme (#1870)
* chore: fix banner link in readme

* chore: raw
2024-10-03 05:04:38 +03:00
github-actions[bot] ee02ea7746 publish new versions (#1869)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2024-10-02 16:40:18 -03:00
Lucas Fernandes Nogueira 9501cfa5f5 fix(updater): validate endpoint scheme before printing warning (#1868)
regression from #1814
2024-10-02 16:28:16 -03:00
amrbashir 5092683f97 feat(shell): add show_item_in_dir api 2024-02-28 03:25:18 +02:00
157 changed files with 2399 additions and 1240 deletions
+5
View File
@@ -0,0 +1,5 @@
---
sql: patch
---
Replace `Mutex` with `RwLock` to enable concurrent SQL execution.
+5
View File
@@ -0,0 +1,5 @@
---
"fs-js": "patch"
---
Fix `writeTextFile` converting UTF-8 characters (for example `äöü`) in the given path into replacement character (``)
+1 -1
View File
@@ -126,7 +126,7 @@ jobs:
clippy: clippy:
needs: changes needs: changes
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }} if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
runs-on: ubuntu-latest runs-on: ubuntu-22.04
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
+2 -2
View File
@@ -168,7 +168,7 @@ jobs:
} }
- { - {
target: x86_64-unknown-linux-gnu, target: x86_64-unknown-linux-gnu,
os: ubuntu-latest, os: ubuntu-22.04,
runner: 'cargo', runner: 'cargo',
command: 'test' command: 'test'
} }
@@ -202,7 +202,7 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev 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: with:
targets: ${{ matrix.platform.target }} targets: ${{ matrix.platform.target }}
Generated
+345 -214
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -11,10 +11,10 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
log = "0.4" log = "0.4"
tauri = { version = "2.0.0", default-features = false } tauri = { version = "2.0.4", default-features = false }
tauri-build = "2.0.0" tauri-build = "2.0.1"
tauri-plugin = "2.0.0" tauri-plugin = "2.0.1"
tauri-utils = "2.0.0" tauri-utils = "2.0.1"
serde_json = "1" serde_json = "1"
thiserror = "1" thiserror = "1"
url = "2" url = "2"
@@ -27,7 +27,7 @@ specta = "=2.0.0-rc.20"
edition = "2021" edition = "2021"
authors = ["Tauri Programme within The Commons Conservancy"] authors = ["Tauri Programme within The Commons Conservancy"]
license = "Apache-2.0 OR MIT" license = "Apache-2.0 OR MIT"
rust-version = "1.78" rust-version = "1.77.2"
repository = "https://github.com/tauri-apps/plugins-workspace" repository = "https://github.com/tauri-apps/plugins-workspace"
# default to small, optimized release binaries # default to small, optimized release binaries
+1 -1
View File
@@ -30,7 +30,7 @@
| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? | | [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**_ _This repo and all plugins require a Rust version of at least **1.77.2**_
## Contributing ## Contributing
+10
View File
@@ -1,5 +1,15 @@
# Changelog # Changelog
## \[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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+8 -8
View File
@@ -1,7 +1,7 @@
{ {
"name": "svelte-app", "name": "svelte-app",
"private": true, "private": true,
"version": "2.0.0", "version": "2.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --clearScreen false", "dev": "vite --clearScreen false",
@@ -9,23 +9,23 @@
"serve": "vite preview" "serve": "vite preview"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0", "@tauri-apps/api": "2.0.2",
"@tauri-apps/plugin-barcode-scanner": "2.0.0", "@tauri-apps/plugin-barcode-scanner": "2.0.0",
"@tauri-apps/plugin-biometric": "2.0.0", "@tauri-apps/plugin-biometric": "2.0.0",
"@tauri-apps/plugin-cli": "2.0.0", "@tauri-apps/plugin-cli": "2.0.0",
"@tauri-apps/plugin-clipboard-manager": "2.0.0", "@tauri-apps/plugin-clipboard-manager": "2.0.0",
"@tauri-apps/plugin-dialog": "2.0.0", "@tauri-apps/plugin-dialog": "2.0.1",
"@tauri-apps/plugin-fs": "2.0.0", "@tauri-apps/plugin-fs": "2.0.1",
"@tauri-apps/plugin-geolocation": "2.0.0", "@tauri-apps/plugin-geolocation": "2.0.0",
"@tauri-apps/plugin-global-shortcut": "2.0.0", "@tauri-apps/plugin-global-shortcut": "2.0.0",
"@tauri-apps/plugin-haptics": "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-nfc": "2.0.0",
"@tauri-apps/plugin-notification": "2.0.0", "@tauri-apps/plugin-notification": "2.0.0",
"@tauri-apps/plugin-os": "2.0.0", "@tauri-apps/plugin-os": "2.0.0",
"@tauri-apps/plugin-process": "2.0.0", "@tauri-apps/plugin-process": "2.0.0",
"@tauri-apps/plugin-shell": "2.0.0", "@tauri-apps/plugin-shell": "2.0.1",
"@tauri-apps/plugin-store": "2.0.0", "@tauri-apps/plugin-store": "2.1.0",
"@tauri-apps/plugin-updater": "2.0.0", "@tauri-apps/plugin-updater": "2.0.0",
"@zerodevx/svelte-json-view": "1.0.11" "@zerodevx/svelte-json-view": "1.0.11"
}, },
@@ -33,7 +33,7 @@
"@iconify-json/codicon": "^1.1.37", "@iconify-json/codicon": "^1.1.37",
"@iconify-json/ph": "^1.1.8", "@iconify-json/ph": "^1.1.8",
"@sveltejs/vite-plugin-svelte": "^3.0.1", "@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tauri-apps/cli": "2.0.0", "@tauri-apps/cli": "2.0.3",
"@unocss/extractor-svelte": "^0.63.0", "@unocss/extractor-svelte": "^0.63.0",
"svelte": "^4.2.19", "svelte": "^4.2.19",
"unocss": "^0.63.0", "unocss": "^0.63.0",
+49
View File
@@ -1,5 +1,54 @@
# Changelog # Changelog
## \[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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+19 -19
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "api" name = "api"
publish = false publish = false
version = "2.0.0" version = "2.0.4"
description = "An example Tauri Application showcasing the api" description = "An example Tauri Application showcasing the api"
edition = "2021" edition = "2021"
rust-version = { workspace = true } rust-version = { workspace = true }
@@ -19,22 +19,22 @@ serde_json = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
tiny_http = "0.12" tiny_http = "0.12"
log = { workspace = true } log = { workspace = true }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0" } tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.1" }
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0", features = [ tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.3", features = [
"watch", "watch",
] } ] }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0" } tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.1" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0" } tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.3" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ tauri-plugin-http = { path = "../../../plugins/http", features = [
"multipart", "multipart",
], version = "2.0.0" } ], version = "2.0.3" }
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0", features = [ tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.1", features = [
"windows7-compat", "windows7-compat",
] } ] }
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0" } tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.1" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.1" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0" } tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.2" }
tauri-plugin-store = { path = "../../../plugins/store", version = "2.0.0" } tauri-plugin-store = { path = "../../../plugins/store", version = "2.1.0" }
[dependencies.tauri] [dependencies.tauri]
workspace = true 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] [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-cli = { path = "../../../plugins/cli", version = "2.0.1" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0" } tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.1" }
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0" } tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.2" }
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0" } tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0" }
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", 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.0" } tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.1" }
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0" } tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.1" }
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.0" } tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.1" }
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.0" } tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.1" }
[features] [features]
prod = ["tauri/custom-protocol"] prod = ["tauri/custom-protocol"]
@@ -79,10 +79,6 @@
], ],
"deny": ["$APPDATA/db/*.stronghold"] "deny": ["$APPDATA/db/*.stronghold"]
}, },
"store:allow-entries", "store:default"
"store:allow-get",
"store:allow-set",
"store:allow-save",
"store:allow-load"
] ]
} }
+4 -1
View File
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
@@ -18,7 +19,7 @@
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules"> <option name="modules">
<set> <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$" />
<option value="$PROJECT_DIR$/app" /> <option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/buildSrc" /> <option value="$PROJECT_DIR$/buildSrc" />
@@ -27,6 +28,8 @@
<option value="$PROJECT_DIR$/../../../../../plugins/clipboard-manager/android" /> <option value="$PROJECT_DIR$/../../../../../plugins/clipboard-manager/android" />
<option value="$PROJECT_DIR$/../../../../../plugins/dialog/android" /> <option value="$PROJECT_DIR$/../../../../../plugins/dialog/android" />
<option value="$PROJECT_DIR$/../../../../../plugins/fs/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/nfc/android" />
<option value="$PROJECT_DIR$/../../../../../plugins/notification/android" /> <option value="$PROJECT_DIR$/../../../../../plugins/notification/android" />
<option value="$PROJECT_DIR$/../../../../../plugins/shell/android" /> <option value="$PROJECT_DIR$/../../../../../plugins/shell/android" />
+2 -1
View File
@@ -67,7 +67,8 @@ pub fn run() {
.user_agent(&format!("Tauri API - {}", std::env::consts::OS)) .user_agent(&format!("Tauri API - {}", std::env::consts::OS))
.title("Tauri API Validation") .title("Tauri API Validation")
.inner_size(1000., 800.) .inner_size(1000., 800.)
.min_inner_size(600., 400.); .min_inner_size(600., 400.)
.visible(false);
} }
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
+60 -18
View File
@@ -1,5 +1,5 @@
<script> <script>
import { Store } from "@tauri-apps/plugin-store"; import { LazyStore } from "@tauri-apps/plugin-store";
import { onMount } from "svelte"; import { onMount } from "svelte";
export let onMessage; export let onMessage;
@@ -7,28 +7,65 @@
let key; let key;
let value; let value;
const store = new Store("cache.json"); let store = new LazyStore("cache.json");
let cache = {}; let cache = {};
onMount(async () => { async function refreshEntries() {
await store.load(); try {
const values = await store.entries(); const values = await store.entries();
for (const [key, value] of values) { cache = {};
cache[key] = value; for (const [key, value] of values) {
cache[key] = value;
}
} catch (error) {
onMessage(error);
} }
cache = cache; }
onMount(async () => {
await refreshEntries();
}); });
function write(key, value) { async function write(key, value) {
store try {
.set(key, value) if (value) {
.then(() => store.get(key)) await store.set(key, value);
.then((v) => { } else {
cache[key] = v; await store.delete(key);
}
const v = await store.get(key);
if (v === undefined) {
delete cache[key];
cache = cache; cache = cache;
}) } else {
.then(() => store.save()) cache[key] = v;
.catch(onMessage); }
} 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> </script>
@@ -44,7 +81,12 @@
<input class="grow input" bind:value /> <input class="grow input" bind:value />
</div> </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>
<div> <div>
+4 -4
View File
@@ -10,20 +10,20 @@
"format:check": "prettier --check ." "format:check": "prettier --check ."
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "9.11.1", "@eslint/js": "9.13.0",
"@rollup/plugin-node-resolve": "15.3.0", "@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-terser": "0.4.4", "@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "11.1.6", "@rollup/plugin-typescript": "11.1.6",
"@types/eslint__js": "8.42.3", "@types/eslint__js": "8.42.3",
"covector": "^0.12.3", "covector": "^0.12.3",
"eslint": "9.11.1", "eslint": "9.13.0",
"eslint-config-prettier": "9.1.0", "eslint-config-prettier": "9.1.0",
"eslint-plugin-security": "3.0.1", "eslint-plugin-security": "3.0.1",
"prettier": "3.3.3", "prettier": "3.3.3",
"rollup": "4.22.4", "rollup": "4.22.4",
"tslib": "2.7.0", "tslib": "2.7.0",
"typescript": "5.6.2", "typescript": "5.6.3",
"typescript-eslint": "8.7.0" "typescript-eslint": "8.10.0"
}, },
"resolutions": { "resolutions": {
"semver": ">=7.5.2", "semver": ">=7.5.2",
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-autostart" name = "tauri-plugin-autostart"
version = "2.0.0" version = "2.0.1"
description = "Automatically launch your application at startup." description = "Automatically launch your application at startup."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Automatically launch your application at startup.
## Install ## 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. There are three general methods of installation that we can recommend.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-barcode-scanner" 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" description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+1 -1
View File
@@ -1,4 +1,4 @@
![Barcode Scanner](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/scanner/banner.png) ![Barcode Scanner](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/barcode-scanner/banner.png)
Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes. Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-biometric" name = "tauri-plugin-biometric"
version = "2.0.0" version = "2.0.1"
description = "Prompt the user for biometric authentication on Android and iOS." description = "Prompt the user for biometric authentication on Android and iOS."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-cli" name = "tauri-plugin-cli"
version = "2.0.0" version = "2.0.1"
description = "Parse arguments from your Tauri application's command line interface." description = "Parse arguments from your Tauri application's command line interface."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Parse arguments from your Command Line Interface.
## Install ## 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. There are three general methods of installation that we can recommend.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-clipboard-manager" name = "tauri-plugin-clipboard-manager"
version = "2.0.0" version = "2.0.1"
description = "Read and write to the system clipboard." description = "Read and write to the system clipboard."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Read and write to the system clipboard.
## Install ## 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. There are three general methods of installation that we can recommend.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-deep-link" 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" description = "Set your Tauri application as the default handler for an URL"
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Set your Tauri application as the default handler for an URL.
## Install ## 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. There are three general methods of installation that we can recommend.
+2 -2
View File
@@ -10,11 +10,11 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0", "@tauri-apps/api": "2.0.2",
"@tauri-apps/plugin-deep-link": "2.0.0" "@tauri-apps/plugin-deep-link": "2.0.0"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "2.0.0", "@tauri-apps/cli": "2.0.3",
"typescript": "^5.2.2", "typescript": "^5.2.2",
"vite": "^5.4.7" "vite": "^5.4.7"
} }
@@ -6,7 +6,7 @@ authors = ["you"]
license = "" license = ""
repository = "" repository = ""
edition = "2021" 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 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+21
View File
@@ -1,5 +1,24 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`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! pull/371)) First v2 alpha release!
lpha release! lpha release!
pull/371)) First v2 alpha release! pull/371)) First v2 alpha release!
lease!
pull/371)) First v2 alpha release!
+2 -2
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-dialog" 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." description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -34,7 +34,7 @@ tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
url = { 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] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true, features = ["wry"] }
+1 -1
View File
@@ -12,7 +12,7 @@ Native system dialogs for opening and saving files along with message dialogs.
## Install ## 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. 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.net.Uri
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.webkit.MimeTypeMap
import androidx.activity.result.ActivityResult import androidx.activity.result.ActivityResult
import app.tauri.Logger import app.tauri.Logger
import app.tauri.annotation.ActivityCallback import app.tauri.annotation.ActivityCallback
@@ -43,6 +44,7 @@ class MessageOptions {
@InvokeArg @InvokeArg
class SaveFileDialogOptions { class SaveFileDialogOptions {
var fileName: String? = null var fileName: String? = null
lateinit var filters: Array<Filter>
} }
@TauriPlugin @TauriPlugin
@@ -57,20 +59,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
val intent = if (parsedTypes.isNotEmpty()) { val intent = if (parsedTypes.isNotEmpty()) {
val intent = Intent(Intent.ACTION_PICK) val intent = Intent(Intent.ACTION_PICK)
intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes) setIntentMimeTypes(intent, 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 "*/*"
intent intent
} else { } else {
val intent = Intent(Intent.ACTION_GET_CONTENT) val intent = Intent(Intent.ACTION_GET_CONTENT)
@@ -130,13 +119,47 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
private fun parseFiltersOption(filters: Array<Filter>): Array<String> { private fun parseFiltersOption(filters: Array<Filter>): Array<String> {
val mimeTypes = mutableListOf<String>() val mimeTypes = mutableListOf<String>()
for (filter in filters) { for (filter in filters) {
for (mime in filter.extensions) { for (ext in filter.extensions) {
mimeTypes.add(if (mime == "text/csv") "text/comma-separated-values" else mime) 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() 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 @Command
fun showMessageDialog(invoke: Invoke) { fun showMessageDialog(invoke: Invoke) {
val args = invoke.parseArgs(MessageOptions::class.java) val args = invoke.parseArgs(MessageOptions::class.java)
@@ -187,10 +210,12 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
fun saveFileDialog(invoke: Invoke) { fun saveFileDialog(invoke: Invoke) {
try { try {
val args = invoke.parseArgs(SaveFileDialogOptions::class.java) val args = invoke.parseArgs(SaveFileDialogOptions::class.java)
val parsedTypes = parseFiltersOption(args.filters)
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT) val intent = Intent(Intent.ACTION_CREATE_DOCUMENT)
setIntentMimeTypes(intent, parsedTypes)
intent.addCategory(Intent.CATEGORY_OPENABLE) intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.setType("text/plain")
intent.putExtra(Intent.EXTRA_TITLE, args.fileName ?: "") intent.putExtra(Intent.EXTRA_TITLE, args.fileName ?: "")
startActivityForResult(invoke, intent, "saveFileDialogResult") startActivityForResult(invoke, intent, "saveFileDialogResult")
} catch (ex: Exception) { } catch (ex: Exception) {
+1 -1
View File
@@ -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__})}
+4 -4
View File
@@ -257,8 +257,8 @@ async function ask(
message: message.toString(), message: message.toString(),
title: opts?.title?.toString(), title: opts?.title?.toString(),
kind: opts?.kind, kind: opts?.kind,
okButtonLabel: opts?.okLabel?.toString() ?? 'Yes', yesButtonLabel: opts?.okLabel?.toString(),
cancelButtonLabel: opts?.cancelLabel?.toString() ?? 'No' noButtonLabel: opts?.cancelLabel?.toString()
}) })
} }
@@ -287,8 +287,8 @@ async function confirm(
message: message.toString(), message: message.toString(),
title: opts?.title?.toString(), title: opts?.title?.toString(),
kind: opts?.kind, kind: opts?.kind,
okButtonLabel: opts?.okLabel?.toString() ?? 'Ok', okButtonLabel: opts?.okLabel?.toString(),
cancelButtonLabel: opts?.cancelLabel?.toString() ?? 'Cancel' cancelButtonLabel: opts?.cancelLabel?.toString()
}) })
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-dialog", "name": "@tauri-apps/plugin-dialog",
"version": "2.0.0", "version": "2.0.1",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"
+23 -21
View File
@@ -10,7 +10,7 @@ use tauri_plugin_fs::FsExt;
use crate::{ use crate::{
Dialog, FileDialogBuilder, FilePath, MessageDialogButtons, MessageDialogKind, Result, CANCEL, Dialog, FileDialogBuilder, FilePath, MessageDialogButtons, MessageDialogKind, Result, CANCEL,
OK, NO, OK, YES,
}; };
#[derive(Serialize)] #[derive(Serialize)]
@@ -299,8 +299,8 @@ pub(crate) async fn ask<R: Runtime>(
title: Option<String>, title: Option<String>,
message: String, message: String,
kind: Option<MessageDialogKind>, kind: Option<MessageDialogKind>,
ok_button_label: Option<String>, yes_button_label: Option<String>,
cancel_button_label: Option<String>, no_button_label: Option<String>,
) -> Result<bool> { ) -> Result<bool> {
Ok(message_dialog( Ok(message_dialog(
window, window,
@@ -308,7 +308,16 @@ pub(crate) async fn ask<R: Runtime>(
title, title,
message, message,
kind, 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, title,
message, message,
kind, 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
}
}
+1
View File
@@ -112,6 +112,7 @@ impl From<MessageDialogButtons> for rfd::MessageButtons {
match value { match value {
MessageDialogButtons::Ok => Self::Ok, MessageDialogButtons::Ok => Self::Ok,
MessageDialogButtons::OkCancel => Self::OkCancel, MessageDialogButtons::OkCancel => Self::OkCancel,
MessageDialogButtons::YesNo => Self::YesNo,
MessageDialogButtons::OkCustom(ok) => Self::OkCustom(ok), MessageDialogButtons::OkCustom(ok) => Self::OkCustom(ok),
MessageDialogButtons::OkCancelCustom(ok, cancel) => Self::OkCancelCustom(ok, cancel), MessageDialogButtons::OkCancelCustom(ok, cancel) => Self::OkCancelCustom(ok, cancel),
} }
+3
View File
@@ -43,6 +43,8 @@ use mobile::*;
pub(crate) const OK: &str = "Ok"; pub(crate) const OK: &str = "Ok";
pub(crate) const CANCEL: &str = "Cancel"; pub(crate) const CANCEL: &str = "Cancel";
pub(crate) const YES: &str = "Yes";
pub(crate) const NO: &str = "No";
macro_rules! blocking_fn { macro_rules! blocking_fn {
($self:ident, $fn:ident) => {{ ($self:ident, $fn:ident) => {{
@@ -236,6 +238,7 @@ impl<R: Runtime> MessageDialogBuilder<R> {
let (ok_button_label, cancel_button_label) = match &self.buttons { let (ok_button_label, cancel_button_label) = match &self.buttons {
MessageDialogButtons::Ok => (Some(OK), None), MessageDialogButtons::Ok => (Some(OK), None),
MessageDialogButtons::OkCancel => (Some(OK), Some(CANCEL)), MessageDialogButtons::OkCancel => (Some(OK), Some(CANCEL)),
MessageDialogButtons::YesNo => (Some(YES), Some(NO)),
MessageDialogButtons::OkCustom(ok) => (Some(ok.as_str()), Some(CANCEL)), MessageDialogButtons::OkCustom(ok) => (Some(ok.as_str()), Some(CANCEL)),
MessageDialogButtons::OkCancelCustom(ok, cancel) => { MessageDialogButtons::OkCancelCustom(ok, cancel) => {
(Some(ok.as_str()), Some(cancel.as_str())) (Some(ok.as_str()), Some(cancel.as_str()))
+2
View File
@@ -59,6 +59,8 @@ pub enum MessageDialogButtons {
Ok, Ok,
/// 2 buttons `Ok` and `Cancel` with OS default dialog texts /// 2 buttons `Ok` and `Cancel` with OS default dialog texts
OkCancel, OkCancel,
/// 2 buttons `Yes` and `No` with OS default dialog texts
YesNo,
/// A single `Ok` button with custom text /// A single `Ok` button with custom text
OkCustom(String), OkCustom(String),
/// 2 buttons `Ok` and `Cancel` with custom texts /// 2 buttons `Ok` and `Cancel` with custom texts
+12
View File
@@ -1,5 +1,17 @@
# Changelog # Changelog
## \[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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-fs" name = "tauri-plugin-fs"
version = "2.0.0" version = "2.0.3"
description = "Access the file system." description = "Access the file system."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Access the file system.
## Install ## 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. There are three general methods of installation that we can recommend.
File diff suppressed because one or more lines are too long
+36 -6
View File
@@ -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. * The Tauri abstraction for reading and writing files.
* *
@@ -285,12 +304,20 @@ class FileHandle extends Resource {
return 0 return 0
} }
const [data, nread] = await invoke<[number[], number]>('plugin:fs|read', { const data = await invoke<ArrayBuffer | number[]>('plugin:fs|read', {
rid: this.rid, rid: this.rid,
len: buffer.byteLength 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 return nread === 0 ? null : nread
} }
@@ -1041,10 +1068,13 @@ async function writeTextFile(
throw new TypeError('Must be a file URL.') throw new TypeError('Must be a file URL.')
} }
await invoke('plugin:fs|write_text_file', { const encoder = new TextEncoder()
path: path instanceof URL ? path.toString() : path,
data, await invoke('plugin:fs|write_text_file', encoder.encode(data), {
options headers: {
path: encodeURIComponent(path instanceof URL ? path.toString() : path),
options: JSON.stringify(options)
}
}) })
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-fs", "name": "@tauri-apps/plugin-fs",
"version": "2.0.0", "version": "2.0.1",
"description": "Access the file system.", "description": "Access the file system.",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
+63 -50
View File
@@ -9,7 +9,7 @@ use tauri::{
ipc::{CommandScope, GlobalScope}, ipc::{CommandScope, GlobalScope},
path::BaseDirectory, path::BaseDirectory,
utils::config::FsScope, utils::config::FsScope,
AppHandle, Manager, Resource, ResourceId, Runtime, Webview, Manager, Resource, ResourceId, Runtime, Webview,
}; };
use std::{ use std::{
@@ -301,13 +301,36 @@ pub async fn read_dir<R: Runtime>(
pub async fn read<R: Runtime>( pub async fn read<R: Runtime>(
webview: Webview<R>, webview: Webview<R>,
rid: ResourceId, rid: ResourceId,
len: u32, len: usize,
) -> CommandResult<(Vec<u8>, usize)> { ) -> CommandResult<tauri::ipc::Response> {
let mut data = vec![0; len as usize]; let mut data = vec![0; len];
let file = webview.resources_table().get::<StdFileResource>(rid)?; let file = webview.resources_table().get::<StdFileResource>(rid)?;
let nread = StdFileResource::with_lock(&file, |mut file| file.read(&mut data)) 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}"))?; .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] #[tauri::command]
@@ -783,10 +806,34 @@ fn write_file_inner<R: Runtime>(
webview: Webview<R>, webview: Webview<R>,
global_scope: &GlobalScope<Entry>, global_scope: &GlobalScope<Entry>,
command_scope: &CommandScope<Entry>, command_scope: &CommandScope<Entry>,
path: SafeFilePath, request: tauri::ipc::Request<'_>,
data: &[u8],
options: Option<WriteFileOptions>,
) -> CommandResult<()> { ) -> 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( let (mut file, path) = resolve_file(
&webview, &webview,
global_scope, global_scope,
@@ -823,7 +870,7 @@ fn write_file_inner<R: Runtime>(
}, },
)?; )?;
file.write_all(data) file.write_all(&data)
.map_err(|e| { .map_err(|e| {
format!( format!(
"failed to write bytes to file at path: {} with error: {e}", "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>, command_scope: CommandScope<Entry>,
request: tauri::ipc::Request<'_>, request: tauri::ipc::Request<'_>,
) -> CommandResult<()> { ) -> CommandResult<()> {
let data = match request.body() { write_file_inner(webview, &global_scope, &command_scope, request)
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)
} }
// TODO, in v3, remove this command and rely on `write_file` command only
#[tauri::command] #[tauri::command]
pub async fn write_text_file<R: Runtime>( pub async fn write_text_file<R: Runtime>(
#[allow(unused)] app: AppHandle<R>, webview: Webview<R>,
#[allow(unused)] webview: Webview<R>, global_scope: GlobalScope<Entry>,
#[allow(unused)] global_scope: GlobalScope<Entry>, command_scope: CommandScope<Entry>,
#[allow(unused)] command_scope: CommandScope<Entry>, request: tauri::ipc::Request<'_>,
path: SafeFilePath,
data: String,
#[allow(unused)] options: Option<WriteFileOptions>,
) -> CommandResult<()> { ) -> CommandResult<()> {
write_file_inner( write_file_inner(webview, &global_scope, &command_scope, request)
webview,
&global_scope,
&command_scope,
path,
data.as_bytes(),
options,
)
} }
#[tauri::command] #[tauri::command]
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "tauri-plugin-geolocation" name = "tauri-plugin-geolocation"
description = "Get and track the device's current position" description = "Get and track the device's current position"
version = "2.0.0" version = "2.0.1"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ This plugin provides APIs for getting and tracking the device's current position
## Install ## 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. There are three general methods of installation that we can recommend.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-global-shortcut" name = "tauri-plugin-global-shortcut"
version = "2.0.0" version = "2.0.1"
description = "Register global hotkeys listeners on your Tauri application." description = "Register global hotkeys listeners on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Register global shortcuts.
## Install ## 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. There are three general methods of installation that we can recommend.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "tauri-plugin-haptics" name = "tauri-plugin-haptics"
description = "Haptic feedback and vibrations on Android and iOS" description = "Haptic feedback and vibrations on Android and iOS"
version = "2.0.0" version = "2.0.1"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
+1 -1
View File
@@ -14,7 +14,7 @@ There are no standards/requirements for vibration support on Android, so the `fe
## Install ## 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. There are three general methods of installation that we can recommend.
+22
View File
@@ -1,5 +1,24 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
@@ -278,3 +297,6 @@
ha release! ha release!
! !
371\)) First v2 alpha release! 371\)) First v2 alpha release!
lease!
!
371\)) First v2 alpha release!
+4 -4
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-http" name = "tauri-plugin-http"
version = "2.0.0" version = "2.0.3"
description = "Access an HTTP client written in Rust." description = "Access an HTTP client written in Rust."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -17,8 +17,8 @@ rustdoc-args = ["--cfg", "docsrs"]
windows = { level = "full", notes = "" } windows = { level = "full", notes = "" }
linux = { level = "full", notes = "" } linux = { level = "full", notes = "" }
macos = { level = "full", notes = "" } macos = { level = "full", notes = "" }
android = { level = "none", notes = "" } android = { level = "full", notes = "" }
ios = { level = "none", notes = "" } ios = { level = "full", notes = "" }
[build-dependencies] [build-dependencies]
tauri-plugin = { workspace = true, features = ["build"] } tauri-plugin = { workspace = true, features = ["build"] }
@@ -34,7 +34,7 @@ serde_json = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tokio = { version = "1", features = ["sync", "macros"] } 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" urlpattern = "0.3"
regex = "1" regex = "1"
http = "1" http = "1"
+1 -1
View File
@@ -12,7 +12,7 @@ Access the HTTP client written in Rust.
## Install ## 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. There are three general methods of installation that we can recommend.
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-http", "name": "@tauri-apps/plugin-http",
"version": "2.0.0", "version": "2.0.1",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"
+35 -24
View File
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // 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 reqwest::{redirect::Policy, NoProxy};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use tauri::{ use tauri::{
@@ -176,7 +176,7 @@ pub async fn fetch<R: Runtime>(
let ClientConfig { let ClientConfig {
method, method,
url, url,
headers, headers: headers_raw,
data, data,
connect_timeout, connect_timeout,
max_redirections, max_redirections,
@@ -185,7 +185,17 @@ pub async fn fetch<R: Runtime>(
let scheme = url.scheme(); let scheme = url.scheme();
let method = Method::from_bytes(method.as_bytes())?; 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) {
continue;
}
headers.append(name, HeaderValue::from_str(&v)?);
}
match scheme { match scheme {
"http" | "https" => { "http" | "https" => {
@@ -228,45 +238,46 @@ pub async fn fetch<R: Runtime>(
let mut request = builder.build()?.request(method.clone(), url); 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, // 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 there is no body. https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
if data.is_none() && matches!(method, Method::POST | Method::PUT) { 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 // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 18
// If httpRequests header list contains `Range`, then append (`Accept-Encoding`, `identity`) // If httpRequests 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()) { if !headers.contains_key(header::USER_AGENT) {
request = request.header(header::USER_AGENT, HTTP_USER_AGENT); headers.append(header::USER_AGENT, HeaderValue::from_str(HTTP_USER_AGENT)?);
} }
if cfg!(feature = "unsafe-headers") // ensure we have an Origin header set
&& !headers.contains_key(header::ORIGIN.as_str()) if cfg!(not(feature = "unsafe-headers")) || !headers.contains_key(header::ORIGIN) {
{
if let Ok(url) = webview.url() { if let Ok(url) = webview.url() {
request = headers.append(
request.header(header::ORIGIN, url.origin().ascii_serialization()); 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 { if let Some(data) = data {
request = request.body(data); request = request.body(data);
} }
request = request.headers(headers);
let fut = async move { request.send().await.map_err(Into::into) }; let fut = async move { request.send().await.map_err(Into::into) };
let mut resources_table = webview.resources_table(); let mut resources_table = webview.resources_table();
let rid = resources_table.add_request(Box::pin(fut)); let rid = resources_table.add_request(Box::pin(fut));
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-localhost" 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." description = "Expose your apps assets through a localhost server instead of the default custom protocol."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
+1 -1
View File
@@ -14,7 +14,7 @@ Expose your apps assets through a localhost server instead of the default custom
## Install ## 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. There are three general methods of installation that we can recommend.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-log" name = "tauri-plugin-log"
version = "2.0.0" version = "2.0.1"
description = "Configurable logging for your Tauri app." description = "Configurable logging for your Tauri app."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Configurable logging for your Tauri app.
## Install ## 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. There are three general methods of installation that we can recommend.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-nfc" name = "tauri-plugin-nfc"
version = "2.0.0" version = "2.0.1"
description = "Read and write NFC tags on Android and iOS." description = "Read and write NFC tags on Android and iOS."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-notification" name = "tauri-plugin-notification"
version = "2.0.0" version = "2.0.1"
description = "Send desktop and mobile notifications on your Tauri application." description = "Send desktop and mobile notifications on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Send message notifications (brief auto-expiring OS window element) to your user.
## Install ## 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. There are three general methods of installation that we can recommend.
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-os" name = "tauri-plugin-os"
version = "2.0.0" version = "2.0.1"
description = "Read information about the operating system." description = "Read information about the operating system."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ Read information about the operating system.
## Install ## 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. There are three general methods of installation that we can recommend.
+20
View File
@@ -1,5 +1,25 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+2 -2
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-persisted-scope" 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." description = "Save filesystem and asset scopes and restore them when the app is reopened."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@@ -27,7 +27,7 @@ log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
aho-corasick = "1" aho-corasick = "1"
bincode = "1" bincode = "1"
tauri-plugin-fs = { path = "../fs", version = "2.0.0" } tauri-plugin-fs = { path = "../fs", version = "2.0.3" }
[features] [features]
protocol-asset = ["tauri/protocol-asset"] protocol-asset = ["tauri/protocol-asset"]
+1 -1
View File
@@ -12,7 +12,7 @@ Save filesystem and asset scopes and restore them when the app is reopened.
## Install ## 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. There are three general methods of installation that we can recommend.
+8
View File
@@ -1,5 +1,13 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-positioner" name = "tauri-plugin-positioner"
version = "2.0.0" version = "2.0.2"
description = "Position your windows at well-known locations." description = "Position your windows at well-known locations."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
+1 -1
View File
@@ -14,7 +14,7 @@ This plugin is a port of [electron-positioner](https://github.com/jenslind/elect
## Install ## 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. There are three general methods of installation that we can recommend.
+1 -1
View File
@@ -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__})}
+1 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &["move_window"]; const COMMANDS: &[&str] = &["move_window", "set_tray_icon_state"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) tauri_plugin::Builder::new(COMMANDS)
+2 -14
View File
@@ -40,20 +40,8 @@ export async function moveWindow(to: Position): Promise<void> {
} }
export async function handleIconState(event: TrayIconEvent): Promise<void> { export async function handleIconState(event: TrayIconEvent): Promise<void> {
const size = {} as Record<string, unknown>
size[`${event.rect.size.type}`] = {
width: event.rect.size.width,
height: event.rect.size.height
}
const position = {} as Record<string, unknown>
position[`${event.rect.position.type}`] = {
x: event.rect.position.x,
y: event.rect.position.y
}
await invoke('plugin:positioner|set_tray_icon_state', { await invoke('plugin:positioner|set_tray_icon_state', {
position, position: event.rect.position,
size size: event.rect.size
}) })
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-positioner", "name": "@tauri-apps/plugin-positioner",
"version": "2.0.0", "version": "2.0.1",
"description": "Position your windows at well-known locations.", "description": "Position your windows at well-known locations.",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
@@ -4,5 +4,10 @@
[[permission]] [[permission]]
identifier = "allow-set-tray-icon-state" identifier = "allow-set-tray-icon-state"
description = "Enables the set_tray_icon_state to handle events and set the TrayIcon state." description = "Enables the set_tray_icon_state command without any pre-configured scope."
commands.allow = ["set_tray_icon_state"] commands.allow = ["set_tray_icon_state"]
[[permission]]
identifier = "deny-set-tray-icon-state"
description = "Denies the set_tray_icon_state command without any pre-configured scope."
commands.deny = ["set_tray_icon_state"]
@@ -1,6 +1,6 @@
## Default Permission ## Default Permission
Allows the move_window command Allows the moveWindow and handleIconState APIs
- `allow-move-window` - `allow-move-window`
- `set-tray-icon-state` - `set-tray-icon-state`
@@ -48,7 +48,20 @@ Denies the move_window command without any pre-configured scope.
</td> </td>
<td> <td>
Enables the set_tray_icon_state to handle events and set the TrayIcon state. Enables the set_tray_icon_state command without any pre-configured scope.
</td>
</tr>
<tr>
<td>
`positioner:deny-set-tray-icon-state`
</td>
<td>
Denies the set_tray_icon_state command without any pre-configured scope.
</td> </td>
</tr> </tr>
+1 -1
View File
@@ -1,4 +1,4 @@
"$schema" = "schemas/schema.json" "$schema" = "schemas/schema.json"
[default] [default]
description = "Allows the move_window command" description = "Allows the moveWindow and handleIconState APIs"
permissions = ["allow-move-window", "set-tray-icon-state"] permissions = ["allow-move-window", "set-tray-icon-state"]
@@ -305,12 +305,17 @@
"const": "deny-move-window" "const": "deny-move-window"
}, },
{ {
"description": "Enables the set_tray_icon_state to handle events and set the TrayIcon state.", "description": "Enables the set_tray_icon_state command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-set-tray-icon-state" "const": "allow-set-tray-icon-state"
}, },
{ {
"description": "Allows the move_window command", "description": "Denies the set_tray_icon_state command without any pre-configured scope.",
"type": "string",
"const": "deny-set-tray-icon-state"
},
{
"description": "Allows the moveWindow and handleIconState APIs",
"type": "string", "type": "string",
"const": "default" "const": "default"
} }
+4
View File
@@ -1,5 +1,9 @@
# Changelog # 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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-process" name = "tauri-plugin-process"
version = "2.0.0" version = "2.0.1"
description = "Access the current process of your Tauri application." description = "Access the current process of your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
+1 -1
View File
@@ -12,7 +12,7 @@ This plugin provides APIs to access the current process. To spawn child processe
## Install ## 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. There are three general methods of installation that we can recommend.
+8
View File
@@ -1,5 +1,13 @@
# Changelog # Changelog
## \[2.0.1]
- [`51ddf6a7`](https://github.com/tauri-apps/plugins-workspace/commit/51ddf6a71544acfb261ffc9393dab1342da0a219) ([#1881](https://github.com/tauri-apps/plugins-workspace/pull/1881) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) On Windows, Fix `open` JS API hanging and freezing the app.
## \[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] ## \[2.0.0]
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+12 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-shell" name = "tauri-plugin-shell"
version = "2.0.0" version = "2.0.2"
description = "Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application." description = "Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -37,6 +37,17 @@ regex = "1"
open = { version = "5", features = ["shellexecute-on-windows"] } open = { version = "5", features = ["shellexecute-on-windows"] }
encoding_rs = "0.8" encoding_rs = "0.8"
os_pipe = "1" os_pipe = "1"
dunce = { workspace = true }
[target."cfg(windows)".dependencies.windows]
version = "0.54"
features = [
"Win32_Foundation",
"Win32_UI_Shell_Common",
"Win32_UI_WindowsAndMessaging",
"Win32_System_Com",
"Win32_System_Registry",
]
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true, features = ["wry"] }

Some files were not shown because too many files have changed in this diff Show More