Merge branch 'tauri-apps:v2' into v2

pull/1056/head
Tahmin Ahmed 1 year ago committed by GitHub
commit f1f56a5984
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"dialog": "patch"
---
Fixed an issue where dialogs would not spawn but instead freeze the whole app.

@ -0,0 +1,5 @@
---
"http": patch
---
The scope URL now follows the URL pattern standard instead of a simple glob pattern.

@ -0,0 +1,6 @@
---
"fs": patch
"fs-js": patch
---
Fix infinite loop on cargo build operations

@ -2,8 +2,18 @@
"tag": "beta", "tag": "beta",
"changes": [ "changes": [
".changes/beta.md", ".changes/beta.md",
".changes/clipboard-html.md",
".changes/dialog-can-create-directories.md",
".changes/dialog-linux-freeze.md",
".changes/enhance-http-scope.md",
".changes/file-autogen-fix.md",
".changes/fix-shutdown-timing.md",
".changes/fix-zbus-import.md", ".changes/fix-zbus-import.md",
".changes/http-user-agent.md",
".changes/msrv-1.75.md", ".changes/msrv-1.75.md",
".changes/tauri-beta-4.md" ".changes/shell-shellexcute.md",
".changes/tauri-beta-4.md",
".changes/tauri-beta-8.md",
".changes/tauri-beta-9.md"
] ]
} }

@ -0,0 +1,7 @@
---
"fs": patch
"http": patch
"shell": patch
---
Update to tauri beta.9.

105
Cargo.lock generated

@ -626,6 +626,12 @@ version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "base64"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51"
[[package]] [[package]]
name = "base64ct" name = "base64ct"
version = "1.6.0" version = "1.6.0"
@ -1659,7 +1665,7 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412"
dependencies = [ dependencies = [
"libloading 0.7.4", "libloading 0.8.1",
] ]
[[package]] [[package]]
@ -3534,9 +3540,9 @@ dependencies = [
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.20" version = "0.4.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
dependencies = [ dependencies = [
"value-bag", "value-bag",
] ]
@ -6261,9 +6267,9 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae"
[[package]] [[package]]
name = "tauri" name = "tauri"
version = "2.0.0-beta.8" version = "2.0.0-beta.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2bd3d5ccf5316833c0f71c645c25585bddf997a16bea652bf3eab8114273cff" checksum = "353a521566bd41164a05887f40fe93b375c82b82000726f63c66237955dfb4f5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -6294,7 +6300,6 @@ dependencies = [
"serde_repr", "serde_repr",
"serialize-to-javascript", "serialize-to-javascript",
"state", "state",
"static_assertions",
"swift-rs", "swift-rs",
"tauri-build", "tauri-build",
"tauri-macros", "tauri-macros",
@ -6314,9 +6319,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-build" name = "tauri-build"
version = "2.0.0-beta.6" version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ca30dbed856449b41abed13a5a46655ea2196075e09e99e22fe8ed0958b6aee" checksum = "50887f06d343b6ede0260d29abb4edd57f40d8aac538f6e34d801c9a4fa1c6b8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cargo_toml", "cargo_toml",
@ -6338,11 +6343,11 @@ dependencies = [
[[package]] [[package]]
name = "tauri-codegen" name = "tauri-codegen"
version = "2.0.0-beta.6" version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf4ed45a0d2a1723ef4ea71d1aa5809c4a8bcaa92de77f6c9a8f4d4f28c5d86a" checksum = "10c676621ba42f97d349ee1a835cfac8a268d8843c8b81fa7663ebac2854786a"
dependencies = [ dependencies = [
"base64 0.21.7", "base64 0.22.0",
"brotli", "brotli",
"ico", "ico",
"json-patch", "json-patch",
@ -6365,9 +6370,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-macros" name = "tauri-macros"
version = "2.0.0-beta.6" version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0a75661fb86b350141e78ad54ce9c60346149afc5cbf41de2ca60a1ebc252b3" checksum = "dd5e87dc692a359ee99662616639fe35681e3ce9929e1ec2447b2e3853b6bda6"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
@ -6379,9 +6384,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-plugin" name = "tauri-plugin"
version = "2.0.0-beta.6" version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9530f0f0d809e77ff9a93da5ff2483faf8fef2cb8ed125ca7b0172cb92685d4" checksum = "b84ccc2181a81c66f2b203775b6b67590cc357bc477c57f0fac844c31dd5c474"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"glob", "glob",
@ -6546,8 +6551,8 @@ name = "tauri-plugin-http"
version = "2.0.0-beta.1" version = "2.0.0-beta.1"
dependencies = [ dependencies = [
"data-url", "data-url",
"glob",
"http 0.2.11", "http 0.2.11",
"regex",
"reqwest", "reqwest",
"schemars", "schemars",
"serde", "serde",
@ -6557,6 +6562,7 @@ dependencies = [
"tauri-plugin-fs", "tauri-plugin-fs",
"thiserror", "thiserror",
"url", "url",
"urlpattern",
] ]
[[package]] [[package]]
@ -6840,9 +6846,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-runtime" name = "tauri-runtime"
version = "2.0.0-beta.6" version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0381b4b96e1f4f39a24ca6472c9b016151b103a54b1425233007fdbc26cf20a8" checksum = "3fc1ebe2a720c1b62a9980ebf44f27db4f8a475e1465917959ce3940d6903307"
dependencies = [ dependencies = [
"gtk", "gtk",
"http 0.2.11", "http 0.2.11",
@ -6858,14 +6864,15 @@ dependencies = [
[[package]] [[package]]
name = "tauri-runtime-wry" name = "tauri-runtime-wry"
version = "2.0.0-beta.6" version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eef6a8373c9936b33a58c1bdbdd76fe4603d00ebe72304c0777bf0674e455aa" checksum = "d0e853c02137e908589e9f0c684f10bb49d0dedf9e86ad734a18e42ce9bbd2ab"
dependencies = [ dependencies = [
"cocoa 0.25.0", "cocoa 0.25.0",
"gtk", "gtk",
"http 0.2.11", "http 0.2.11",
"jni", "jni",
"log",
"percent-encoding", "percent-encoding",
"raw-window-handle 0.6.0", "raw-window-handle 0.6.0",
"softbuffer", "softbuffer",
@ -6881,9 +6888,9 @@ dependencies = [
[[package]] [[package]]
name = "tauri-utils" name = "tauri-utils"
version = "2.0.0-beta.6" version = "2.0.0-beta.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92e35e2f9a5ee8539d00dde621f176647747736a388a07c3083a0cc1b96ba6d7" checksum = "e1973b15065cb63868f5fba789d54ef04232d7e0229fb2230d1f557480a5ceea"
dependencies = [ dependencies = [
"aes-gcm 0.10.3", "aes-gcm 0.10.3",
"brotli", "brotli",
@ -7450,6 +7457,47 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "unic-char-property"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221"
dependencies = [
"unic-char-range",
]
[[package]]
name = "unic-char-range"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc"
[[package]]
name = "unic-common"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc"
[[package]]
name = "unic-ucd-ident"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987"
dependencies = [
"unic-char-property",
"unic-char-range",
"unic-ucd-version",
]
[[package]]
name = "unic-ucd-version"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4"
dependencies = [
"unic-common",
]
[[package]] [[package]]
name = "unicase" name = "unicase"
version = "2.7.0" version = "2.7.0"
@ -7542,6 +7590,19 @@ version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
[[package]]
name = "urlpattern"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9bd5ff03aea02fa45b13a7980151fe45009af1980ba69f651ec367121a31609"
dependencies = [
"derive_more",
"regex",
"serde",
"unic-ucd-ident",
"url",
]
[[package]] [[package]]
name = "utf-8" name = "utf-8"
version = "0.7.6" version = "0.7.6"

@ -10,9 +10,9 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
log = "0.4" log = "0.4"
tauri = "2.0.0-beta.8" tauri = "2.0.0-beta.9"
tauri-build = "2.0.0-beta.6" tauri-build = "2.0.0-beta.7"
tauri-plugin = "2.0.0-beta.6" tauri-plugin = "2.0.0-beta.7"
serde_json = "1" serde_json = "1"
thiserror = "1" thiserror = "1"
url = "2" url = "2"

@ -1,5 +1,25 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
### Dependencies
- Upgraded to `clipboard-manager-js@2.0.0-beta.2`
- Upgraded to `dialog-js@2.0.0-beta.2`
- Upgraded to `fs-js@2.0.0-beta.2`
- Upgraded to `http-js@2.0.0-beta.2`
- Upgraded to `shell-js@2.0.0-beta.2`
- Upgraded to `barcode-scanner-js@2.0.0-beta.2`
- Upgraded to `biometric-js@2.0.0-beta.2`
- Upgraded to `cli-js@2.0.0-beta.2`
- Upgraded to `global-shortcut-js@2.0.0-beta.2`
- Upgraded to `log-js@2.0.0-beta.2`
- Upgraded to `nfc-js@2.0.0-beta.2`
- Upgraded to `notification-js@2.0.0-beta.2`
- Upgraded to `os-js@2.0.0-beta.2`
- Upgraded to `process-js@2.0.0-beta.2`
- Upgraded to `updater-js@2.0.0-beta.2`
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
{ {
"name": "svelte-app", "name": "svelte-app",
"private": true, "private": true,
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --clearScreen false", "dev": "vite --clearScreen false",
@ -9,28 +9,28 @@
"serve": "vite preview" "serve": "vite preview"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.3", "@tauri-apps/api": "2.0.0-beta.4",
"@tauri-apps/plugin-barcode-scanner": "2.0.0-beta.1", "@tauri-apps/plugin-barcode-scanner": "2.0.0-beta.2",
"@tauri-apps/plugin-biometric": "2.0.0-beta.1", "@tauri-apps/plugin-biometric": "2.0.0-beta.2",
"@tauri-apps/plugin-cli": "2.0.0-beta.1", "@tauri-apps/plugin-cli": "2.0.0-beta.2",
"@tauri-apps/plugin-clipboard-manager": "2.0.0-beta.1", "@tauri-apps/plugin-clipboard-manager": "2.0.0-beta.2",
"@tauri-apps/plugin-dialog": "2.0.0-beta.1", "@tauri-apps/plugin-dialog": "2.0.0-beta.2",
"@tauri-apps/plugin-fs": "2.0.0-beta.1", "@tauri-apps/plugin-fs": "2.0.0-beta.2",
"@tauri-apps/plugin-global-shortcut": "2.0.0-beta.1", "@tauri-apps/plugin-global-shortcut": "2.0.0-beta.2",
"@tauri-apps/plugin-http": "2.0.0-beta.1", "@tauri-apps/plugin-http": "2.0.0-beta.2",
"@tauri-apps/plugin-nfc": "2.0.0-beta.1", "@tauri-apps/plugin-nfc": "2.0.0-beta.2",
"@tauri-apps/plugin-notification": "2.0.0-beta.1", "@tauri-apps/plugin-notification": "2.0.0-beta.2",
"@tauri-apps/plugin-os": "2.0.0-beta.1", "@tauri-apps/plugin-os": "2.0.0-beta.2",
"@tauri-apps/plugin-process": "2.0.0-beta.1", "@tauri-apps/plugin-process": "2.0.0-beta.2",
"@tauri-apps/plugin-shell": "2.0.0-beta.1", "@tauri-apps/plugin-shell": "2.0.0-beta.2",
"@tauri-apps/plugin-updater": "2.0.0-beta.1", "@tauri-apps/plugin-updater": "2.0.0-beta.2",
"@zerodevx/svelte-json-view": "1.0.7" "@zerodevx/svelte-json-view": "1.0.7"
}, },
"devDependencies": { "devDependencies": {
"@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-beta.6", "@tauri-apps/cli": "2.0.0-beta.7",
"@unocss/extractor-svelte": "^0.58.0", "@unocss/extractor-svelte": "^0.58.0",
"internal-ip": "^8.0.0", "internal-ip": "^8.0.0",
"svelte": "^4.2.8", "svelte": "^4.2.8",

@ -1,5 +1,25 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
### Dependencies
- Upgraded to `clipboard-manager@2.0.0-beta.2`
- Upgraded to `dialog@2.0.0-beta.2`
- Upgraded to `http@2.0.0-beta.2`
- Upgraded to `fs@2.0.0-beta.2`
- Upgraded to `shell@2.0.0-beta.2`
- Upgraded to `barcode-scanner@2.0.0-beta.2`
- Upgraded to `biometric@2.0.0-beta.2`
- Upgraded to `cli@2.0.0-beta.2`
- Upgraded to `global-shortcut@2.0.0-beta.2`
- Upgraded to `log-plugin@2.0.0-beta.2`
- Upgraded to `nfc@2.0.0-beta.2`
- Upgraded to `notification@2.0.0-beta.2`
- Upgraded to `os@2.0.0-beta.2`
- Upgraded to `process@2.0.0-beta.2`
- Upgraded to `updater@2.0.0-beta.2`
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
[package] [package]
name = "api" name = "api"
publish = false publish = false
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,21 +19,21 @@ serde_json = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
tiny_http = "0.11" tiny_http = "0.11"
log = { workspace = true } log = { workspace = true }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.1" } tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.2" }
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.1", features = [ "watch" ] } tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.2", features = [ "watch" ] }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-beta.1" } tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-beta.2" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.1" } tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.2" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.1" } tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.2" }
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.1", features = [ "windows7-compat" ] } tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.2", features = [ "windows7-compat" ] }
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.1" } tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.2" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.1" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.2" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.1" } tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.2" }
[dependencies.tauri] [dependencies.tauri]
workspace = true workspace = true
features = [ features = [
"icon-ico", "image-ico",
"icon-png", "image-png",
"isolation", "isolation",
"macos-private-api", "macos-private-api",
"tray-icon", "tray-icon",
@ -41,17 +41,17 @@ tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.1"
] ]
[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-beta.1" } tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-beta.2" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-beta.1" } tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-beta.2" }
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-beta.1" } tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-beta.2" }
[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-beta.1" } tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-beta.2" }
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-beta.1" } tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-beta.2" }
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-beta.1" } tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-beta.2" }
[target."cfg(target_os = \"windows\")".dependencies] [target."cfg(target_os = \"windows\")".dependencies]
window-shadows = "0.2" window-shadows = "0.2"
[features] [features]
custom-protocol = [ "tauri/custom-protocol" ] prod = [ "tauri/custom-protocol" ]

@ -11,6 +11,13 @@
} }
] ]
}, },
{
"description": "A list of capabilities.",
"type": "array",
"items": {
"$ref": "#/definitions/Capability"
}
},
{ {
"description": "A list of capabilities.", "description": "A list of capabilities.",
"type": "object", "type": "object",
@ -2236,33 +2243,49 @@
"items": { "items": {
"title": "ScopeEntry", "title": "ScopeEntry",
"description": "HTTP scope entry object definition.", "description": "HTTP scope entry object definition.",
"anyOf": [
{
"description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string"
},
{
"type": "object", "type": "object",
"required": [ "required": [
"url" "url"
], ],
"properties": { "properties": {
"url": { "url": {
"description": "A URL that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples:\n\n- \"https://*\" or \"https://**\" : allows all HTTPS urls\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", "description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string" "type": "string"
} }
} }
} }
]
}
}, },
"deny": { "deny": {
"items": { "items": {
"title": "ScopeEntry", "title": "ScopeEntry",
"description": "HTTP scope entry object definition.", "description": "HTTP scope entry object definition.",
"anyOf": [
{
"description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string"
},
{
"type": "object", "type": "object",
"required": [ "required": [
"url" "url"
], ],
"properties": { "properties": {
"url": { "url": {
"description": "A URL that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples:\n\n- \"https://*\" or \"https://**\" : allows all HTTPS urls\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", "description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string" "type": "string"
} }
} }
} }
]
}
} }
} }
}, },
@ -4790,6 +4813,125 @@
"http:deny-fetch-send" "http:deny-fetch-send"
] ]
}, },
{
"description": "image:default -> Default permissions for the plugin.",
"type": "string",
"enum": [
"image:default"
]
},
{
"description": "image:allow-from-bytes -> Enables the from_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-bytes"
]
},
{
"description": "image:allow-from-ico-bytes -> Enables the from_ico_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-ico-bytes"
]
},
{
"description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-path"
]
},
{
"description": "image:allow-from-png-bytes -> Enables the from_png_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-png-bytes"
]
},
{
"description": "image:allow-height -> Enables the height command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-height"
]
},
{
"description": "image:allow-new -> Enables the new command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-new"
]
},
{
"description": "image:allow-rgba -> Enables the rgba command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-rgba"
]
},
{
"description": "image:allow-width -> Enables the width command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-width"
]
},
{
"description": "image:deny-from-bytes -> Denies the from_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-bytes"
]
},
{
"description": "image:deny-from-ico-bytes -> Denies the from_ico_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-ico-bytes"
]
},
{
"description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-path"
]
},
{
"description": "image:deny-from-png-bytes -> Denies the from_png_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-png-bytes"
]
},
{
"description": "image:deny-height -> Denies the height command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-height"
]
},
{
"description": "image:deny-new -> Denies the new command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-new"
]
},
{
"description": "image:deny-rgba -> Denies the rgba command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-rgba"
]
},
{
"description": "image:deny-width -> Denies the width command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-width"
]
},
{ {
"description": "log:default -> Allows the log command", "description": "log:default -> Allows the log command",
"type": "string", "type": "string",

@ -47,15 +47,22 @@
"default": "", "default": "",
"type": "string" "type": "string"
}, },
"context": { "remote": {
"description": "Execution context of the capability.\n\nAt runtime, Tauri filters the IPC command together with the context to determine whether it is allowed or not and its scope.", "description": "Configure remote URLs that can use the capability permissions.",
"default": "local", "anyOf": [
"allOf": [
{ {
"$ref": "#/definitions/CapabilityContext" "$ref": "#/definitions/CapabilityRemote"
},
{
"type": "null"
} }
] ]
}, },
"local": {
"description": "Whether this capability is enabled for local app URLs or not. Defaults to `true`.",
"default": true,
"type": "boolean"
},
"windows": { "windows": {
"description": "List of windows that uses this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.", "description": "List of windows that uses this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.",
"type": "array", "type": "array",
@ -78,7 +85,7 @@
} }
}, },
"platforms": { "platforms": {
"description": "Target platforms this capability applies. By default all platforms applies.", "description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
"default": [ "default": [
"linux", "linux",
"macOS", "macOS",
@ -93,24 +100,8 @@
} }
} }
}, },
"CapabilityContext": { "CapabilityRemote": {
"description": "Context of the capability.", "description": "Configuration for remote URLs that are associated with the capability.",
"oneOf": [
{
"description": "Capability refers to local URL usage.",
"type": "string",
"enum": [
"local"
]
},
{
"description": "Capability refers to remote usage.",
"type": "object",
"required": [
"remote"
],
"properties": {
"remote": {
"type": "object", "type": "object",
"required": [ "required": [
"urls" "urls"
@ -124,11 +115,6 @@
} }
} }
} }
}
},
"additionalProperties": false
}
]
}, },
"PermissionEntry": { "PermissionEntry": {
"description": "An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.", "description": "An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.",
@ -2250,33 +2236,49 @@
"items": { "items": {
"title": "ScopeEntry", "title": "ScopeEntry",
"description": "HTTP scope entry object definition.", "description": "HTTP scope entry object definition.",
"anyOf": [
{
"description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string"
},
{
"type": "object", "type": "object",
"required": [ "required": [
"url" "url"
], ],
"properties": { "properties": {
"url": { "url": {
"description": "A URL that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples:\n\n- \"https://*\" or \"https://**\" : allows all HTTPS urls\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", "description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string" "type": "string"
} }
} }
} }
]
}
}, },
"deny": { "deny": {
"items": { "items": {
"title": "ScopeEntry", "title": "ScopeEntry",
"description": "HTTP scope entry object definition.", "description": "HTTP scope entry object definition.",
"anyOf": [
{
"description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string"
},
{
"type": "object", "type": "object",
"required": [ "required": [
"url" "url"
], ],
"properties": { "properties": {
"url": { "url": {
"description": "A URL that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern.\n\nExamples:\n\n- \"https://*\" or \"https://**\" : allows all HTTPS urls\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", "description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string" "type": "string"
} }
} }
} }
]
}
} }
} }
}, },
@ -5756,6 +5758,13 @@
"webview:allow-print" "webview:allow-print"
] ]
}, },
{
"description": "webview:allow-reparent -> Enables the reparent command without any pre-configured scope.",
"type": "string",
"enum": [
"webview:allow-reparent"
]
},
{ {
"description": "webview:allow-set-webview-focus -> Enables the set_webview_focus command without any pre-configured scope.", "description": "webview:allow-set-webview-focus -> Enables the set_webview_focus command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5826,6 +5835,13 @@
"webview:deny-print" "webview:deny-print"
] ]
}, },
{
"description": "webview:deny-reparent -> Denies the reparent command without any pre-configured scope.",
"type": "string",
"enum": [
"webview:deny-reparent"
]
},
{ {
"description": "webview:deny-set-webview-focus -> Denies the set_webview_focus command without any pre-configured scope.", "description": "webview:deny-set-webview-focus -> Denies the set_webview_focus command without any pre-configured scope.",
"type": "string", "type": "string",

@ -7,7 +7,10 @@ mod cmd;
mod tray; mod tray;
use serde::Serialize; use serde::Serialize;
use tauri::{webview::WebviewWindowBuilder, App, AppHandle, Manager, RunEvent, WebviewUrl}; use tauri::{
webview::{PageLoadEvent, WebviewWindowBuilder},
App, AppHandle, Manager, RunEvent, WebviewUrl,
};
#[derive(Clone, Serialize)] #[derive(Clone, Serialize)]
struct Reply { struct Reply {
@ -107,7 +110,8 @@ pub fn run() {
Ok(()) Ok(())
}) })
.on_page_load(|webview, _| { .on_page_load(|webview, payload| {
if payload.event() == PageLoadEvent::Finished {
let webview_ = webview.clone(); let webview_ = webview.clone();
webview.listen("js-event", move |event| { webview.listen("js-event", move |event| {
println!("got js-event with message '{:?}'", event.payload()); println!("got js-event with message '{:?}'", event.payload());
@ -119,6 +123,7 @@ pub fn run() {
.emit("rust-event", Some(reply)) .emit("rust-event", Some(reply))
.expect("failed to emit"); .expect("failed to emit");
}); });
}
}); });
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]

@ -79,11 +79,14 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
} }
i @ "icon-1" | i @ "icon-2" => { i @ "icon-1" | i @ "icon-2" => {
if let Some(tray) = app.tray_by_id("tray-1") { if let Some(tray) = app.tray_by_id("tray-1") {
let _ = tray.set_icon(Some(tauri::Icon::Raw(if i == "icon-1" { let _ = tray.set_icon(Some(if i == "icon-1" {
include_bytes!("../icons/icon.ico").to_vec() tauri::Image::from_ico_bytes(include_bytes!("../icons/icon.ico")).unwrap()
} else { } else {
include_bytes!("../icons/tray_icon_with_transparency.png").to_vec() tauri::Image::from_png_bytes(include_bytes!(
}))); "../icons/tray_icon_with_transparency.png"
))
.unwrap()
}));
} }
} }
"switch-menu" => { "switch-menu" => {

@ -1,15 +1,15 @@
<script> <script>
import { getCurrent } from "@tauri-apps/api/window"; import { getCurrent } from "@tauri-apps/api/webview";
import { invoke } from "@tauri-apps/api/core"; import { invoke } from "@tauri-apps/api/core";
import { onMount, onDestroy } from "svelte"; import { onMount, onDestroy } from "svelte";
const appWindow = getCurrent(); const webview = getCurrent();
export let onMessage; export let onMessage;
let unlisten; let unlisten;
onMount(async () => { onMount(async () => {
unlisten = await appWindow.listen("rust-event", onMessage); unlisten = await webview.listen("rust-event", onMessage);
}); });
onDestroy(() => { onDestroy(() => {
if (unlisten) { if (unlisten) {
@ -37,7 +37,7 @@
} }
function emitEvent() { function emitEvent() {
appWindow.emit("js-event", "this is the payload string"); webview.emit("js-event", "this is the payload string");
} }
</script> </script>

@ -53,7 +53,7 @@
const form = new FormData(); const form = new FormData();
form.append("foo", foo); form.append("foo", foo);
form.append("bar", bar); form.append("bar", bar);
const response = await tauriFetch("http://localhost:3003", { const response = await tauriFetch("http://localhost:3003/tauri", {
method: "POST", method: "POST",
body: form, body: form,
}); });

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -41,4 +45,4 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-authenticator" name = "tauri-plugin-authenticator"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
description = "Use hardware security-keys in your Tauri App." description = "Use hardware security-keys in your Tauri App."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-authenticator", "name": "@tauri-apps/plugin-authenticator",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"description": "Use hardware security-keys in your Tauri App.", "description": "Use hardware security-keys in your Tauri App.",
"license": "MIT or APACHE-2.0", "license": "MIT or APACHE-2.0",
"authors": [ "authors": [
@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -41,4 +45,4 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-autostart" name = "tauri-plugin-autostart"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-autostart", "name": "@tauri-apps/plugin-autostart",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -28,4 +32,4 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`454428c`](https://github.com/tauri-apps/plugins-workspace/commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. - [`454428c`](https://github.com/tauri-apps/plugins-workspace/commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release.
commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release. commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-barcode-scanner" name = "tauri-plugin-barcode-scanner"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-barcode-scanner", "name": "@tauri-apps/plugin-barcode-scanner",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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",
"license": "MIT or APACHE-2.0", "license": "MIT or APACHE-2.0",
"authors": [ "authors": [
@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -12,4 +16,4 @@
- [`8df28a9`](https://github.com/tauri-apps/plugins-workspace/commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. - [`8df28a9`](https://github.com/tauri-apps/plugins-workspace/commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
- [`8df28a9`](https://github.com/tauri-apps/plugins-workspace/commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. - [`8df28a9`](https://github.com/tauri-apps/plugins-workspace/commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release. commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-biometric" name = "tauri-plugin-biometric"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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 }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-biometric", "name": "@tauri-apps/plugin-biometric",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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"
@ -27,6 +27,6 @@
"tslib": "2.6.0" "tslib": "2.6.0"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -41,4 +45,4 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-cli" name = "tauri-plugin-cli"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-cli", "name": "@tauri-apps/plugin-cli",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,10 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`dc6d332`](https://github.com/tauri-apps/plugins-workspace/commit/dc6d3321e5305fa8b7250553bd179cbee995998a)([#977](https://github.com/tauri-apps/plugins-workspace/pull/977)) Add support for writing HTML content to the clipboard.
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -41,4 +46,4 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-clipboard-manager" name = "tauri-plugin-clipboard-manager"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-clipboard-manager", "name": "@tauri-apps/plugin-clipboard-manager",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -36,4 +40,4 @@
- [`eccd6f9`](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. - [`eccd6f9`](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
- [`eccd6f9`](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. - [`eccd6f9`](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release. commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-deep-link" name = "tauri-plugin-deep-link"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,5 +1,11 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
### Dependencies
- Upgraded to `deep-link-js@2.0.0-beta.2`
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
{ {
"name": "deep-link-example", "name": "deep-link-example",
"private": true, "private": true,
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@ -10,11 +10,11 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2", "@tauri-apps/api": "2.0.0-beta.4",
"@tauri-apps/plugin-deep-link": "2.0.0-beta.1" "@tauri-apps/plugin-deep-link": "2.0.0-beta.2"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "2.0.0-beta.3", "@tauri-apps/cli": "2.0.0-beta.7",
"internal-ip": "^8.0.0", "internal-ip": "^8.0.0",
"typescript": "^5.2.2", "typescript": "^5.2.2",
"vite": "^5.0.12" "vite": "^5.0.12"

@ -26,4 +26,4 @@ tauri-plugin-deep-link = { path = "../../../" }
# this feature is used for production builds or when `devUrl` points to the filesystem and the built-in dev server is disabled. # this feature is used for production builds or when `devUrl` points to the filesystem and the built-in dev server is disabled.
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes. # If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
# DO NOT REMOVE!! # DO NOT REMOVE!!
custom-protocol = [ "tauri/custom-protocol" ] prod = ["tauri/custom-protocol"]

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-deep-link", "name": "@tauri-apps/plugin-deep-link",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"description": "Set your Tauri application as the default handler for an URL", "description": "Set your Tauri application as the default handler for an URL",
"license": "MIT or APACHE-2.0", "license": "MIT or APACHE-2.0",
"authors": [ "authors": [
@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,10 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`aa25c91`](https://github.com/tauri-apps/plugins-workspace/commit/aa25c91bb01e957872fb2b606a3acaf2f2c4ef3a)([#978](https://github.com/tauri-apps/plugins-workspace/pull/978)) Allow configuring `canCreateDirectories` for open and save dialogs on macOS, if not configured, it will be set to `true` by default.
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -87,5 +92,9 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release! pull/371)) First v2 alpha release!
kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
71](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release!
kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
pull/371)) First v2 alpha release! pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-dialog" name = "tauri-plugin-dialog"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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 }
@ -22,7 +22,7 @@ serde_json = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.1" } tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.2" }
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
glib = "0.16" glib = "0.16"

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-dialog", "name": "@tauri-apps/plugin-dialog",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -11,6 +11,7 @@
use std::path::PathBuf; use std::path::PathBuf;
use raw_window_handle::{HasWindowHandle, RawWindowHandle}; use raw_window_handle::{HasWindowHandle, RawWindowHandle};
use rfd::{AsyncFileDialog, AsyncMessageDialog};
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
use tauri::{plugin::PluginApi, AppHandle, Runtime}; use tauri::{plugin::PluginApi, AppHandle, Runtime};
@ -18,16 +19,6 @@ use crate::{models::*, FileDialogBuilder, MessageDialogBuilder};
const OK: &str = "Ok"; const OK: &str = "Ok";
#[cfg(target_os = "linux")]
type FileDialog = rfd::FileDialog;
#[cfg(not(target_os = "linux"))]
type FileDialog = rfd::AsyncFileDialog;
#[cfg(target_os = "linux")]
type MessageDialog = rfd::MessageDialog;
#[cfg(not(target_os = "linux"))]
type MessageDialog = rfd::AsyncMessageDialog;
pub fn init<R: Runtime, C: DeserializeOwned>( pub fn init<R: Runtime, C: DeserializeOwned>(
app: &AppHandle<R>, app: &AppHandle<R>,
_api: PluginApi<R, C>, _api: PluginApi<R, C>,
@ -51,40 +42,18 @@ impl<R: Runtime> Dialog<R> {
} }
} }
#[cfg(not(target_os = "linux"))]
macro_rules! run_dialog { macro_rules! run_dialog {
($e:expr, $h: expr) => {{ ($e:expr, $h: expr) => {{
std::thread::spawn(move || $h(tauri::async_runtime::block_on($e))); std::thread::spawn(move || $h(tauri::async_runtime::block_on($e)));
}}; }};
} }
#[cfg(target_os = "linux")]
macro_rules! run_dialog {
($e:expr, $h: ident) => {{
std::thread::spawn(move || {
let context = glib::MainContext::default();
context.invoke_with_priority(glib::PRIORITY_HIGH, move || $h($e));
});
}};
}
#[cfg(not(target_os = "linux"))]
macro_rules! run_file_dialog { macro_rules! run_file_dialog {
($e:expr, $h: ident) => {{ ($e:expr, $h: ident) => {{
std::thread::spawn(move || $h(tauri::async_runtime::block_on($e))); std::thread::spawn(move || $h(tauri::async_runtime::block_on($e)));
}}; }};
} }
#[cfg(target_os = "linux")]
macro_rules! run_file_dialog {
($e:expr, $h: ident) => {{
std::thread::spawn(move || {
let context = glib::MainContext::default();
context.invoke_with_priority(glib::PRIORITY_HIGH, move || $h($e));
});
}};
}
impl From<MessageDialogKind> for rfd::MessageLevel { impl From<MessageDialogKind> for rfd::MessageLevel {
fn from(kind: MessageDialogKind) -> Self { fn from(kind: MessageDialogKind) -> Self {
match kind { match kind {
@ -105,9 +74,9 @@ impl HasWindowHandle for WindowHandle {
} }
} }
impl<R: Runtime> From<FileDialogBuilder<R>> for FileDialog { impl<R: Runtime> From<FileDialogBuilder<R>> for AsyncFileDialog {
fn from(d: FileDialogBuilder<R>) -> Self { fn from(d: FileDialogBuilder<R>) -> Self {
let mut builder = FileDialog::new(); let mut builder = AsyncFileDialog::new();
if let Some(title) = d.title { if let Some(title) = d.title {
builder = builder.set_title(title); builder = builder.set_title(title);
@ -133,9 +102,9 @@ impl<R: Runtime> From<FileDialogBuilder<R>> for FileDialog {
} }
} }
impl<R: Runtime> From<MessageDialogBuilder<R>> for MessageDialog { impl<R: Runtime> From<MessageDialogBuilder<R>> for AsyncMessageDialog {
fn from(d: MessageDialogBuilder<R>) -> Self { fn from(d: MessageDialogBuilder<R>) -> Self {
let mut dialog = MessageDialog::new() let mut dialog = AsyncMessageDialog::new()
.set_title(&d.title) .set_title(&d.title)
.set_description(&d.message) .set_description(&d.message)
.set_level(d.kind.into()); .set_level(d.kind.into());
@ -162,49 +131,44 @@ pub fn pick_file<R: Runtime, F: FnOnce(Option<PathBuf>) + Send + 'static>(
dialog: FileDialogBuilder<R>, dialog: FileDialogBuilder<R>,
f: F, f: F,
) { ) {
#[cfg(not(target_os = "linux"))]
let f = |path: Option<rfd::FileHandle>| f(path.map(|p| p.path().to_path_buf())); let f = |path: Option<rfd::FileHandle>| f(path.map(|p| p.path().to_path_buf()));
run_file_dialog!(FileDialog::from(dialog).pick_file(), f) run_file_dialog!(AsyncFileDialog::from(dialog).pick_file(), f)
} }
pub fn pick_files<R: Runtime, F: FnOnce(Option<Vec<PathBuf>>) + Send + 'static>( pub fn pick_files<R: Runtime, F: FnOnce(Option<Vec<PathBuf>>) + Send + 'static>(
dialog: FileDialogBuilder<R>, dialog: FileDialogBuilder<R>,
f: F, f: F,
) { ) {
#[cfg(not(target_os = "linux"))]
let f = |paths: Option<Vec<rfd::FileHandle>>| { let f = |paths: Option<Vec<rfd::FileHandle>>| {
f(paths.map(|list| list.into_iter().map(|p| p.path().to_path_buf()).collect())) f(paths.map(|list| list.into_iter().map(|p| p.path().to_path_buf()).collect()))
}; };
run_file_dialog!(FileDialog::from(dialog).pick_files(), f) run_file_dialog!(AsyncFileDialog::from(dialog).pick_files(), f)
} }
pub fn pick_folder<R: Runtime, F: FnOnce(Option<PathBuf>) + Send + 'static>( pub fn pick_folder<R: Runtime, F: FnOnce(Option<PathBuf>) + Send + 'static>(
dialog: FileDialogBuilder<R>, dialog: FileDialogBuilder<R>,
f: F, f: F,
) { ) {
#[cfg(not(target_os = "linux"))]
let f = |path: Option<rfd::FileHandle>| f(path.map(|p| p.path().to_path_buf())); let f = |path: Option<rfd::FileHandle>| f(path.map(|p| p.path().to_path_buf()));
run_file_dialog!(FileDialog::from(dialog).pick_folder(), f) run_file_dialog!(AsyncFileDialog::from(dialog).pick_folder(), f)
} }
pub fn pick_folders<R: Runtime, F: FnOnce(Option<Vec<PathBuf>>) + Send + 'static>( pub fn pick_folders<R: Runtime, F: FnOnce(Option<Vec<PathBuf>>) + Send + 'static>(
dialog: FileDialogBuilder<R>, dialog: FileDialogBuilder<R>,
f: F, f: F,
) { ) {
#[cfg(not(target_os = "linux"))]
let f = |paths: Option<Vec<rfd::FileHandle>>| { let f = |paths: Option<Vec<rfd::FileHandle>>| {
f(paths.map(|list| list.into_iter().map(|p| p.path().to_path_buf()).collect())) f(paths.map(|list| list.into_iter().map(|p| p.path().to_path_buf()).collect()))
}; };
run_file_dialog!(FileDialog::from(dialog).pick_folders(), f) run_file_dialog!(AsyncFileDialog::from(dialog).pick_folders(), f)
} }
pub fn save_file<R: Runtime, F: FnOnce(Option<PathBuf>) + Send + 'static>( pub fn save_file<R: Runtime, F: FnOnce(Option<PathBuf>) + Send + 'static>(
dialog: FileDialogBuilder<R>, dialog: FileDialogBuilder<R>,
f: F, f: F,
) { ) {
#[cfg(not(target_os = "linux"))]
let f = |path: Option<rfd::FileHandle>| f(path.map(|p| p.path().to_path_buf())); let f = |path: Option<rfd::FileHandle>| f(path.map(|p| p.path().to_path_buf()));
run_file_dialog!(FileDialog::from(dialog).save_file(), f) run_file_dialog!(AsyncFileDialog::from(dialog).save_file(), f)
} }
/// Shows a message dialog /// Shows a message dialog
@ -223,5 +187,5 @@ pub fn show_message_dialog<R: Runtime, F: FnOnce(bool) + Send + 'static>(
}); });
}; };
run_dialog!(MessageDialog::from(dialog).show(), f); run_dialog!(AsyncMessageDialog::from(dialog).show(), f);
} }

@ -1,5 +1,10 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`7358102`](https://github.com/tauri-apps/plugins-workspace/commit/735810237e21504a027a65a7b3c25fd7e594288a)([#1029](https://github.com/tauri-apps/plugins-workspace/pull/1029)) Fix infinite loop on cargo build operations
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -55,4 +60,6 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-fs" name = "tauri-plugin-fs"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
description = "Access the file system." description = "Access the file system."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -154,8 +154,11 @@ permissions = [
]"### ]"###
); );
std::fs::write(base_dirs.join(format!("{lower}.toml")), toml) let permission_path = base_dirs.join(format!("{lower}.toml"));
.unwrap_or_else(|e| panic!("unable to autogenerate ${upper}: {e}")); if toml != std::fs::read_to_string(&permission_path).unwrap_or_default() {
std::fs::write(permission_path, toml)
.unwrap_or_else(|e| panic!("unable to autogenerate ${lower}: {e}"));
}
} }
tauri_plugin::Builder::new(COMMANDS) tauri_plugin::Builder::new(COMMANDS)

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-fs", "name": "@tauri-apps/plugin-fs",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"description": "Access the file system.", "description": "Access the file system.",
"license": "MIT or APACHE-2.0", "license": "MIT or APACHE-2.0",
"authors": [ "authors": [
@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

File diff suppressed because one or more lines are too long

@ -809,9 +809,7 @@ pub fn resolve_path<R: Runtime>(
) -> CommandResult<PathBuf> { ) -> CommandResult<PathBuf> {
let path = file_url_to_safe_pathbuf(path)?; let path = file_url_to_safe_pathbuf(path)?;
let path = if let Some(base_dir) = base_dir { let path = if let Some(base_dir) = base_dir {
app.path() app.path().resolve(&path, base_dir)?
.resolve(&path, base_dir)
.map_err(Error::CannotResolvePath)?
} else { } else {
path.as_ref().to_path_buf() path.as_ref().to_path_buf()
}; };

@ -16,8 +16,6 @@ pub enum Error {
Io(#[from] std::io::Error), Io(#[from] std::io::Error),
#[error("forbidden path: {0}")] #[error("forbidden path: {0}")]
PathForbidden(PathBuf), PathForbidden(PathBuf),
#[error("failed to resolve path: {0}")]
CannotResolvePath(tauri::path::Error),
/// Invalid glob pattern. /// Invalid glob pattern.
#[error("invalid glob pattern: {0}")] #[error("invalid glob pattern: {0}")]
GlobPattern(#[from] glob::PatternError), GlobPattern(#[from] glob::PatternError),

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -47,4 +51,4 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-global-shortcut" name = "tauri-plugin-global-shortcut"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-global-shortcut", "name": "@tauri-apps/plugin-global-shortcut",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBALSHORTCUT__=function(t){"use strict";function e(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}var r;"function"==typeof SuppressedError&&SuppressedError;class n{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,r.set(this,(()=>{})),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((t=>{e(this,r,"f").call(this,t)}))}set onmessage(t){!function(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(t,r):o?o.value=r:e.set(t,r)}(this,r,t,"f")}get onmessage(){return e(this,r,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function o(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return r=new WeakMap,t.isRegistered=async function(t){return await o("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new n;return r.onmessage=e,await o("plugin:global-shortcut|register",{shortcut:t,handler:r})},t.registerAll=async function(t,e){const r=new n;return r.onmessage=e,await o("plugin:global-shortcut|register_all",{shortcuts:t,handler:r})},t.unregister=async function(t){return await o("plugin:global-shortcut|unregister",{shortcut:t})},t.unregisterAll=async function(){return await o("plugin:global-shortcut|unregister_all")},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBALSHORTCUT__})} if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBALSHORTCUT__=function(t){"use strict";function e(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function r(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r}var n,s,i;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),s.set(this,0),i.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o===e(this,s,"f")){r(this,s,o+1,"f"),e(this,n,"f").call(this,t);const a=Object.keys(e(this,i,"f"));if(a.length>0){let t=o+1;for(const r of a.sort()){if(parseInt(r)!==t)break;{const s=e(this,i,"f")[r];delete e(this,i,"f")[r],e(this,n,"f").call(this,s),t+=1}}}}else e(this,i,"f")[o.toString()]=t}))}set onmessage(t){r(this,n,t,"f")}get onmessage(){return e(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return n=new WeakMap,s=new WeakMap,i=new WeakMap,t.isRegistered=async function(t){return await a("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new o;return r.onmessage=e,await a("plugin:global-shortcut|register",{shortcut:t,handler:r})},t.registerAll=async function(t,e){const r=new o;return r.onmessage=e,await a("plugin:global-shortcut|register_all",{shortcuts:t,handler:r})},t.unregister=async function(t){return await a("plugin:global-shortcut|unregister",{shortcut:t})},t.unregisterAll=async function(){return await a("plugin:global-shortcut|unregister_all")},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBALSHORTCUT__})}

@ -1,5 +1,10 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`ae56b13`](https://github.com/tauri-apps/plugins-workspace/commit/ae56b13a4d49dbf922b8a0fbb0d557bb63c1d72b)([#983](https://github.com/tauri-apps/plugins-workspace/pull/983)) Allow `User-Agent` header to be set.
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -72,7 +77,26 @@
371\)) First v2 alpha release! 371\)) First v2 alpha release!
! !
371\)) First v2 alpha release! 371\)) First v2 alpha release!
ace/pull/371)) First v2 alpha release! ace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
2 alpha release!
!
371\)) First v2 alpha release!
/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
!
371\)) First v2 alpha release!
ace/pull/371)) First v2 alpha release!
371\)) First v2 alpha release! 371\)) First v2 alpha release!
! !
371\)) First v2 alpha release! 371\)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-http" name = "tauri-plugin-http"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,15 +17,17 @@ tauri-plugin = { workspace = true, features = [ "build" ] }
schemars = { workspace = true } schemars = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
url = { workspace = true } url = { workspace = true }
glob = "0.3" urlpattern = "0.2"
regex = "1"
[dependencies] [dependencies]
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tauri = { workspace = true } tauri = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.1" } tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.2" }
glob = "0.3" urlpattern = "0.2"
regex = "1"
http = "0.2" http = "0.2"
reqwest = { version = "0.11", default-features = false } reqwest = { version = "0.11", default-features = false }
url = { workspace = true } url = { workspace = true }

@ -9,26 +9,59 @@ mod scope;
const COMMANDS: &[&str] = &["fetch", "fetch_cancel", "fetch_send", "fetch_read_body"]; const COMMANDS: &[&str] = &["fetch", "fetch_cancel", "fetch_send", "fetch_read_body"];
/// HTTP scope entry object definition. /// HTTP scope entry object definition.
#[allow(unused)]
#[derive(schemars::JsonSchema)] #[derive(schemars::JsonSchema)]
struct ScopeEntry { #[serde(untagged)]
enum ScopeEntry {
/// A URL that can be accessed by the webview when using the HTTP APIs. /// A URL that can be accessed by the webview when using the HTTP APIs.
/// The scoped URL is matched against the request URL using a glob pattern. /// Wildcards can be used following the URL pattern standard.
///
/// See [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.
///
/// Examples:
///
/// - "https://*" : allows all HTTPS origin on port 443
///
/// - "https://*:*" : allows all HTTPS origin on any port
///
/// - "https://*.github.com/tauri-apps/tauri": allows any subdomain of "github.com" with the "tauri-apps/api" path
///
/// - "https://myapi.service.com/users/*": allows access to any URLs that begins with "https://myapi.service.com/users/"
Value(String),
Object {
/// A URL that can be accessed by the webview when using the HTTP APIs.
/// Wildcards can be used following the URL pattern standard.
///
/// See [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.
/// ///
/// Examples: /// Examples:
/// ///
/// - "https://*" or "https://**" : allows all HTTPS urls /// - "https://*" : allows all HTTPS origin on port 443
///
/// - "https://*:*" : allows all HTTPS origin on any port
/// ///
/// - "https://*.github.com/tauri-apps/tauri": allows any subdomain of "github.com" with the "tauri-apps/api" path /// - "https://*.github.com/tauri-apps/tauri": allows any subdomain of "github.com" with the "tauri-apps/api" path
/// ///
/// - "https://myapi.service.com/users/*": allows access to any URLs that begins with "https://myapi.service.com/users/" /// - "https://myapi.service.com/users/*": allows access to any URLs that begins with "https://myapi.service.com/users/"
url: String, url: String,
},
} }
// ensure scope entry is up to date // ensure scope entry is up to date
impl From<ScopeEntry> for scope::Entry { impl From<ScopeEntry> for scope::Entry {
fn from(value: ScopeEntry) -> Self { fn from(value: ScopeEntry) -> Self {
let url = match value {
ScopeEntry::Value(url) => url,
ScopeEntry::Object { url } => url,
};
scope::Entry { scope::Entry {
url: value.url.parse().unwrap(), url: urlpattern::UrlPattern::parse(
urlpattern::UrlPatternInit::parse_constructor_string::<regex::Regex>(&url, None)
.unwrap(),
)
.unwrap(),
} }
} }
} }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-http", "name": "@tauri-apps/plugin-http",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -2,13 +2,21 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use std::sync::Arc;
use serde::{Deserialize, Deserializer}; use serde::{Deserialize, Deserializer};
use url::Url; use url::Url;
use urlpattern::{UrlPattern, UrlPatternInit, UrlPatternMatchInput};
#[allow(rustdoc::bare_urls)] #[allow(rustdoc::bare_urls)]
#[derive(Debug)] #[derive(Debug)]
pub struct Entry { pub struct Entry {
pub url: glob::Pattern, pub url: UrlPattern,
}
fn parse_url_pattern(s: &str) -> Result<UrlPattern, urlpattern::quirks::Error> {
let init = UrlPatternInit::parse_constructor_string::<regex::Regex>(s, None)?;
UrlPattern::parse(init)
} }
impl<'de> Deserialize<'de> for Entry { impl<'de> Deserialize<'de> for Entry {
@ -17,17 +25,20 @@ impl<'de> Deserialize<'de> for Entry {
D: Deserializer<'de>, D: Deserializer<'de>,
{ {
#[derive(Deserialize)] #[derive(Deserialize)]
struct EntryRaw { #[serde(untagged)]
url: String, enum EntryRaw {
Value(String),
Object { url: String },
} }
EntryRaw::deserialize(deserializer).and_then(|raw| { EntryRaw::deserialize(deserializer).and_then(|raw| {
let url = match raw {
EntryRaw::Value(url) => url,
EntryRaw::Object { url } => url,
};
Ok(Entry { Ok(Entry {
url: glob::Pattern::new(&raw.url).map_err(|e| { url: parse_url_pattern(&url).map_err(|e| {
serde::de::Error::custom(format!( serde::de::Error::custom(format!("`{}` is not a valid URL pattern: {e}", url))
"URL `{}` is not a valid glob pattern: {e}",
raw.url
))
})?, })?,
}) })
}) })
@ -37,32 +48,32 @@ impl<'de> Deserialize<'de> for Entry {
/// Scope for filesystem access. /// Scope for filesystem access.
#[derive(Debug)] #[derive(Debug)]
pub struct Scope<'a> { pub struct Scope<'a> {
allowed: Vec<&'a Entry>, allowed: Vec<&'a Arc<Entry>>,
denied: Vec<&'a Entry>, denied: Vec<&'a Arc<Entry>>,
} }
impl<'a> Scope<'a> { impl<'a> Scope<'a> {
/// Creates a new scope from the scope configuration. /// Creates a new scope from the scope configuration.
pub(crate) fn new(allowed: Vec<&'a Entry>, denied: Vec<&'a Entry>) -> Self { pub(crate) fn new(allowed: Vec<&'a Arc<Entry>>, denied: Vec<&'a Arc<Entry>>) -> Self {
Self { allowed, denied } Self { allowed, denied }
} }
/// Determines if the given URL is allowed on this scope. /// Determines if the given URL is allowed on this scope.
pub fn is_allowed(&self, url: &Url) -> bool { pub fn is_allowed(&self, url: &Url) -> bool {
let denied = self.denied.iter().any(|entry| { let denied = self.denied.iter().any(|entry| {
entry.url.matches(url.as_str()) entry
|| entry
.url .url
.matches(url.as_str().strip_suffix('/').unwrap_or_default()) .test(UrlPatternMatchInput::Url(url.clone()))
.unwrap_or_default()
}); });
if denied { if denied {
false false
} else { } else {
self.allowed.iter().any(|entry| { self.allowed.iter().any(|entry| {
entry.url.matches(url.as_str()) entry
|| entry
.url .url
.matches(url.as_str().strip_suffix('/').unwrap_or_default()) .test(UrlPatternMatchInput::Url(url.clone()))
.unwrap_or_default()
}) })
} }
} }
@ -70,23 +81,31 @@ impl<'a> Scope<'a> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::str::FromStr; use std::{str::FromStr, sync::Arc};
use super::Entry; use super::Entry;
impl FromStr for Entry { impl FromStr for Entry {
type Err = glob::PatternError; type Err = urlpattern::quirks::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> { fn from_str(s: &str) -> Result<Self, Self::Err> {
let pattern = s.parse()?; let pattern = super::parse_url_pattern(s)?;
Ok(Self { url: pattern }) Ok(Self { url: pattern })
} }
} }
#[test] #[test]
fn is_allowed() { fn denied_takes_precedence() {
let allow = Arc::new("http://localhost:8080/file.png".parse().unwrap());
let deny = Arc::new("http://localhost:8080/*".parse().unwrap());
let scope = super::Scope::new(vec![&allow], vec![&deny]);
assert!(!scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap()));
}
#[test]
fn fixed_url() {
// plain URL // plain URL
let entry = "http://localhost:8080".parse().unwrap(); let entry = Arc::new("http://localhost:8080".parse().unwrap());
let scope = super::Scope::new(vec![&entry], Vec::new()); let scope = super::Scope::new(vec![&entry], Vec::new());
assert!(scope.is_allowed(&"http://localhost:8080".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080".parse().unwrap()));
assert!(scope.is_allowed(&"http://localhost:8080/".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080/".parse().unwrap()));
@ -96,15 +115,12 @@ mod tests {
assert!(!scope.is_allowed(&"https://localhost:8080".parse().unwrap())); assert!(!scope.is_allowed(&"https://localhost:8080".parse().unwrap()));
assert!(!scope.is_allowed(&"http://localhost:8081".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8081".parse().unwrap()));
assert!(!scope.is_allowed(&"http://local:8080".parse().unwrap())); assert!(!scope.is_allowed(&"http://local:8080".parse().unwrap()));
}
// deny takes precedence #[test]
let allow = "http://localhost:8080/file.png".parse().unwrap(); fn fixed_path() {
let deny = "http://localhost:8080/*".parse().unwrap();
let scope = super::Scope::new(vec![&allow], vec![&deny]);
assert!(!scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap()));
// URL with fixed path // URL with fixed path
let entry = "http://localhost:8080/file.png".parse().unwrap(); let entry = Arc::new("http://localhost:8080/file.png".parse().unwrap());
let scope = super::Scope::new(vec![&entry], Vec::new()); let scope = super::Scope::new(vec![&entry], Vec::new());
assert!(scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap()));
@ -112,27 +128,52 @@ mod tests {
assert!(!scope.is_allowed(&"http://localhost:8080".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080".parse().unwrap()));
assert!(!scope.is_allowed(&"http://localhost:8080/file".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080/file".parse().unwrap()));
assert!(!scope.is_allowed(&"http://localhost:8080/file.png/other.jpg".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080/file.png/other.jpg".parse().unwrap()));
}
// URL with glob pattern #[test]
let entry = "http://localhost:8080/*.png".parse().unwrap(); fn pattern_wildcard() {
let entry = Arc::new("http://localhost:8080/*.png".parse().unwrap());
let scope = super::Scope::new(vec![&entry], Vec::new()); let scope = super::Scope::new(vec![&entry], Vec::new());
assert!(scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap()));
assert!(scope.is_allowed(&"http://localhost:8080/assets/file.png".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080/assets/file.png".parse().unwrap()));
assert!(!scope.is_allowed(&"http://localhost:8080/file.jpeg".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080/file.jpeg".parse().unwrap()));
}
let entry = "http://*".parse().unwrap(); #[test]
fn domain_wildcard() {
let entry = Arc::new("http://*".parse().unwrap());
let scope = super::Scope::new(vec![&entry], Vec::new()); let scope = super::Scope::new(vec![&entry], Vec::new());
assert!(scope.is_allowed(&"http://something.else".parse().unwrap())); assert!(scope.is_allowed(&"http://something.else".parse().unwrap()));
assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); assert!(!scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap()));
assert!(!scope.is_allowed(&"https://something.else".parse().unwrap())); assert!(!scope.is_allowed(&"https://something.else".parse().unwrap()));
let entry = "http://**".parse().unwrap(); let entry = Arc::new("http://*/*".parse().unwrap());
let scope = super::Scope::new(vec![&entry], Vec::new());
assert!(scope.is_allowed(&"http://something.else".parse().unwrap()));
assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap()));
}
#[test]
fn scheme_wildcard() {
let entry = Arc::new("*://*".parse().unwrap());
let scope = super::Scope::new(vec![&entry], Vec::new());
assert!(scope.is_allowed(&"http://something.else".parse().unwrap()));
assert!(!scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap()));
assert!(scope.is_allowed(&"file://path".parse().unwrap()));
assert!(!scope.is_allowed(&"file://path/to/file".parse().unwrap()));
assert!(scope.is_allowed(&"https://something.else".parse().unwrap()));
let entry = Arc::new("*://*/*".parse().unwrap());
let scope = super::Scope::new(vec![&entry], Vec::new()); let scope = super::Scope::new(vec![&entry], Vec::new());
assert!(scope.is_allowed(&"http://something.else".parse().unwrap())); assert!(scope.is_allowed(&"http://something.else".parse().unwrap()));
assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap()));
assert!(scope.is_allowed(&"file://path/to/file".parse().unwrap()));
assert!(scope.is_allowed(&"https://something.else".parse().unwrap()));
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`14f381a`](https://github.com/tauri-apps/plugins-workspace/commit/14f381acf8fe690acecc676922c6f05939b95734) Update MSRV to 1.75. - [`14f381a`](https://github.com/tauri-apps/plugins-workspace/commit/14f381acf8fe690acecc676922c6f05939b95734) Update MSRV to 1.75.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-localhost" name = "tauri-plugin-localhost"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -45,4 +49,4 @@
https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ase! ase!
https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-log" name = "tauri-plugin-log"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-log", "name": "@tauri-apps/plugin-log",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"description": "Configurable logging for your Tauri app.", "description": "Configurable logging for your Tauri app.",
"license": "MIT or APACHE-2.0", "license": "MIT or APACHE-2.0",
"authors": [ "authors": [
@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -12,4 +16,4 @@
## \[2.0.0-alpha.0] ## \[2.0.0-alpha.0]
- [`fe79adb`](https://github.com/tauri-apps/plugins-workspace/commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release. - [`fe79adb`](https://github.com/tauri-apps/plugins-workspace/commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release.
commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release. commit/fe79adb5c7febd0e912efb5581264d671709fbb0)([#830](https://github.com/tauri-apps/plugins-workspace/pull/830)) Initial release.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-nfc" name = "tauri-plugin-nfc"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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 }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-nfc", "name": "@tauri-apps/plugin-nfc",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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"
@ -27,6 +27,6 @@
"tslib": "2.6.0" "tslib": "2.6.0"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -53,4 +57,4 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ithub.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ithub.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-notification" name = "tauri-plugin-notification"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-notification", "name": "@tauri-apps/plugin-notification",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(n){"use strict";function e(n,e,i,t){if("a"===i&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?n!==e||!t:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?t:"a"===i?t.call(n):t?t.value:e.get(n)}var i,t,o,r;"function"==typeof SuppressedError&&SuppressedError;class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),this.id=function(n,e=!1){return window.__TAURI_INTERNALS__.transformCallback(n,e)}((n=>{e(this,i,"f").call(this,n)}))}set onmessage(n){!function(n,e,i,t,o){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?n!==e||!o:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===t?o.call(n,i):o?o.value=i:e.set(n,i)}(this,i,n,"f")}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}i=new WeakMap;class c{constructor(n,e,i){this.plugin=n,this.event=e,this.channelId=i}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function s(n,e,i){const t=new a;return t.onmessage=i,u(`plugin:${n}|register_listener`,{event:e,handler:t}).then((()=>new c(n,e,t.id)))}async function u(n,e={},i){return window.__TAURI_INTERNALS__.invoke(n,e,i)}n.ScheduleEvery=void 0,(t=n.ScheduleEvery||(n.ScheduleEvery={})).Year="year",t.Month="month",t.TwoWeeks="twoWeeks",t.Week="week",t.Day="day",t.Hour="hour",t.Minute="minute",t.Second="second";return n.Importance=void 0,(o=n.Importance||(n.Importance={}))[o.None=0]="None",o[o.Min=1]="Min",o[o.Low=2]="Low",o[o.Default=3]="Default",o[o.High=4]="High",n.Visibility=void 0,(r=n.Visibility||(n.Visibility={}))[r.Secret=-1]="Secret",r[r.Private=0]="Private",r[r.Public=1]="Public",n.Schedule=class{static at(n,e=!1,i=!1){return{at:{date:n,repeating:e,allowWhileIdle:i},interval:void 0,every:void 0}}static interval(n,e=!1){return{at:void 0,interval:{interval:n,allowWhileIdle:e},every:void 0}}static every(n,e,i=!1){return{at:void 0,interval:void 0,every:{interval:n,count:e,allowWhileIdle:i}}}},n.active=async function(){return u("plugin:notification|get_active")},n.cancel=async function(n){return u("plugin:notification|cancel",{notifications:n})},n.cancelAll=async function(){return u("plugin:notification|cancel")},n.channels=async function(){return u("plugin:notification|listChannels")},n.createChannel=async function(n){return u("plugin:notification|create_channel",{...n})},n.isPermissionGranted=async function(){return"default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):u("plugin:notification|is_permission_granted")},n.onAction=async function(n){return s("notification","actionPerformed",n)},n.onNotificationReceived=async function(n){return s("notification","notification",n)},n.pending=async function(){return u("plugin:notification|get_pending")},n.registerActionTypes=async function(n){return u("plugin:notification|register_action_types",{types:n})},n.removeActive=async function(n){return u("plugin:notification|remove_active",{notifications:n})},n.removeAllActive=async function(){return u("plugin:notification|remove_active")},n.removeChannel=async function(n){return u("plugin:notification|delete_channel",{id:n})},n.requestPermission=async function(){return window.Notification.requestPermission()},n.sendNotification=function(n){"string"==typeof n?new window.Notification(n):new window.Notification(n.title,n)},n}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})} if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(e){"use strict";function n(e,n,i,t){if("a"===i&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!t:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?t:"a"===i?t.call(e):t?t.value:n.get(e)}function i(e,n,i,t,o){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?e!==n||!o:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===t?o.call(e,i):o?o.value=i:n.set(e,i),i}var t,o,r,a,c,s;"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,t.set(this,(()=>{})),o.set(this,0),r.set(this,{}),this.id=function(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}((({message:e,id:a})=>{if(a===n(this,o,"f")){i(this,o,a+1,"f"),n(this,t,"f").call(this,e);const c=Object.keys(n(this,r,"f"));if(c.length>0){let e=a+1;for(const i of c.sort()){if(parseInt(i)!==e)break;{const o=n(this,r,"f")[i];delete n(this,r,"f")[i],n(this,t,"f").call(this,o),e+=1}}}}else n(this,r,"f")[a.toString()]=e}))}set onmessage(e){i(this,t,e,"f")}get onmessage(){return n(this,t,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}t=new WeakMap,o=new WeakMap,r=new WeakMap;class u{constructor(e,n,i){this.plugin=e,this.event=n,this.channelId=i}async unregister(){return d(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function f(e,n,i){const t=new l;return t.onmessage=i,d(`plugin:${e}|register_listener`,{event:n,handler:t}).then((()=>new u(e,n,t.id)))}async function d(e,n={},i){return window.__TAURI_INTERNALS__.invoke(e,n,i)}e.ScheduleEvery=void 0,(a=e.ScheduleEvery||(e.ScheduleEvery={})).Year="year",a.Month="month",a.TwoWeeks="twoWeeks",a.Week="week",a.Day="day",a.Hour="hour",a.Minute="minute",a.Second="second";return e.Importance=void 0,(c=e.Importance||(e.Importance={}))[c.None=0]="None",c[c.Min=1]="Min",c[c.Low=2]="Low",c[c.Default=3]="Default",c[c.High=4]="High",e.Visibility=void 0,(s=e.Visibility||(e.Visibility={}))[s.Secret=-1]="Secret",s[s.Private=0]="Private",s[s.Public=1]="Public",e.Schedule=class{static at(e,n=!1,i=!1){return{at:{date:e,repeating:n,allowWhileIdle:i},interval:void 0,every:void 0}}static interval(e,n=!1){return{at:void 0,interval:{interval:e,allowWhileIdle:n},every:void 0}}static every(e,n,i=!1){return{at:void 0,interval:void 0,every:{interval:e,count:n,allowWhileIdle:i}}}},e.active=async function(){return d("plugin:notification|get_active")},e.cancel=async function(e){return d("plugin:notification|cancel",{notifications:e})},e.cancelAll=async function(){return d("plugin:notification|cancel")},e.channels=async function(){return d("plugin:notification|listChannels")},e.createChannel=async function(e){return d("plugin:notification|create_channel",{...e})},e.isPermissionGranted=async function(){return"default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):d("plugin:notification|is_permission_granted")},e.onAction=async function(e){return f("notification","actionPerformed",e)},e.onNotificationReceived=async function(e){return f("notification","notification",e)},e.pending=async function(){return d("plugin:notification|get_pending")},e.registerActionTypes=async function(e){return d("plugin:notification|register_action_types",{types:e})},e.removeActive=async function(e){return d("plugin:notification|remove_active",{notifications:e})},e.removeAllActive=async function(){return d("plugin:notification|remove_active")},e.removeChannel=async function(e){return d("plugin:notification|delete_channel",{id:e})},e.requestPermission=async function(){return window.Notification.requestPermission()},e.sendNotification=function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},e}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})}

@ -247,9 +247,8 @@ mod imp {
#[cfg(all(windows, feature = "windows7-compat"))] #[cfg(all(windows, feature = "windows7-compat"))]
fn notify_win7<R: tauri::Runtime>(self, app: &tauri::AppHandle<R>) -> crate::Result<()> { fn notify_win7<R: tauri::Runtime>(self, app: &tauri::AppHandle<R>) -> crate::Result<()> {
let app = app.clone(); let app_ = app.clone();
let default_window_icon = app.default_window_icon().cloned(); let _ = app.clone().run_on_main_thread(move || {
let _ = app.run_on_main_thread(move || {
let mut notification = win7_notifications::Notification::new(); let mut notification = win7_notifications::Notification::new();
if let Some(body) = self.body { if let Some(body) = self.body {
notification.body(&body); notification.body(&body);
@ -257,13 +256,8 @@ mod imp {
if let Some(title) = self.title { if let Some(title) = self.title {
notification.summary(&title); notification.summary(&title);
} }
if let Some(tauri::Icon::Rgba { if let Some(icon) = app_.default_window_icon() {
rgba, notification.icon(icon.rgba().to_vec(), icon.width(), icon.height());
width,
height,
}) = default_window_icon
{
notification.icon(rgba, width, height);
} }
let _ = notification.show(); let _ = notification.show();
}); });

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -53,4 +57,4 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-os" name = "tauri-plugin-os"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-os", "name": "@tauri-apps/plugin-os",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,13 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
### Dependencies
- Upgraded to `fs@2.0.0-beta.2`
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`14f381a`](https://github.com/tauri-apps/plugins-workspace/commit/14f381acf8fe690acecc676922c6f05939b95734) Update MSRV to 1.75. - [`14f381a`](https://github.com/tauri-apps/plugins-workspace/commit/14f381acf8fe690acecc676922c6f05939b95734) Update MSRV to 1.75.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-persisted-scope" name = "tauri-plugin-persisted-scope"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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 }
@ -19,7 +19,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-beta.1" } tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.2" }
[features] [features]
protocol-asset = [ "tauri/protocol-asset" ] protocol-asset = [ "tauri/protocol-asset" ]

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -101,4 +105,4 @@
\-19 \-19
data on 2021-11-19 data on 2021-11-19
- [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19
m/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 m/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-positioner" name = "tauri-plugin-positioner"
version = "2.0.0-beta.1" version = "2.0.0-beta.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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-positioner", "name": "@tauri-apps/plugin-positioner",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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": [
@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -41,4 +45,4 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-process" name = "tauri-plugin-process"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
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,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-process", "name": "@tauri-apps/plugin-process",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,10 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`9586eab`](https://github.com/tauri-apps/plugins-workspace/commit/9586eabd5a96673e4d976757777f470ae358d68a)([#1021](https://github.com/tauri-apps/plugins-workspace/pull/1021)) On Windows, fix `open` can't open file if the file is being used by a program.
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -49,4 +54,6 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! .com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-shell" name = "tauri-plugin-shell"
version = "2.0.0-beta.1" version = "2.0.0-beta.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 }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-shell", "name": "@tauri-apps/plugin-shell",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"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,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(e){"use strict";function t(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)}var s;"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((e=>{t(this,s,"f").call(this,e)}))}set onmessage(e){!function(e,t,s,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?n.call(e,s):n?n.value=s:t.set(e,s)}(this,s,e,"f")}get onmessage(){return t(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function n(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}s=new WeakMap;class i{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const s=r=>{this.removeListener(e,s),t(r)};return this.addListener(e,s)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const s=this.eventListeners[e];for(const e of s)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const s=r=>{this.removeListener(e,s),t(r)};return this.prependListener(e,s)}}class o{constructor(e){this.pid=e}async write(e){return n("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof e?e:Array.from(e)})}async kill(){return n("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class a extends i{constructor(e,t=[],s){super(),this.stdout=new i,this.stderr=new i,this.program=e,this.args="string"==typeof t?[t]:t,this.options=s??{}}static create(e,t=[],s){return new a(e,t,s)}static sidecar(e,t=[],s){const r=new a(e,t,s);return r.options.sidecar=!0,r}async spawn(){return async function(e,t,s=[],i){"object"==typeof s&&Object.freeze(s);const o=new r;return o.onmessage=e,n("plugin:shell|execute",{program:t,args:s,options:i,onEvent:o})}((e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((e=>new o(e)))}async execute(){return new Promise(((e,t)=>{this.on("error",t);const s=[],r=[];this.stdout.on("data",(e=>{s.push(e)})),this.stderr.on("data",(e=>{r.push(e)})),this.on("close",(t=>{e({code:t.code,signal:t.signal,stdout:this.collectOutput(s),stderr:this.collectOutput(r)})})),this.spawn().catch(t)}))}collectOutput(e){return"raw"===this.options.encoding?e.reduce(((e,t)=>new Uint8Array([...e,...t,10])),new Uint8Array):e.join("\n")}}return e.Child=o,e.Command=a,e.EventEmitter=i,e.open=async function(e,t){return n("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})} if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(e){"use strict";function t(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)}function s(e,t,s,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,s):n?n.value=s:t.set(e,s),s}var r,n,i;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,r.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:o})=>{if(o===t(this,n,"f")){s(this,n,o+1,"f"),t(this,r,"f").call(this,e);const a=Object.keys(t(this,i,"f"));if(a.length>0){let e=o+1;for(const s of a.sort()){if(parseInt(s)!==e)break;{const n=t(this,i,"f")[s];delete t(this,i,"f")[s],t(this,r,"f").call(this,n),e+=1}}}}else t(this,i,"f")[o.toString()]=e}))}set onmessage(e){s(this,r,e,"f")}get onmessage(){return t(this,r,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}r=new WeakMap,n=new WeakMap,i=new WeakMap;class h{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const s=r=>{this.removeListener(e,s),t(r)};return this.addListener(e,s)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const s=this.eventListeners[e];for(const e of s)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const s=r=>{this.removeListener(e,s),t(r)};return this.prependListener(e,s)}}class c{constructor(e){this.pid=e}async write(e){return a("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof e?e:Array.from(e)})}async kill(){return a("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class u extends h{constructor(e,t=[],s){super(),this.stdout=new h,this.stderr=new h,this.program=e,this.args="string"==typeof t?[t]:t,this.options=s??{}}static create(e,t=[],s){return new u(e,t,s)}static sidecar(e,t=[],s){const r=new u(e,t,s);return r.options.sidecar=!0,r}async spawn(){return async function(e,t,s=[],r){"object"==typeof s&&Object.freeze(s);const n=new o;return n.onmessage=e,a("plugin:shell|execute",{program:t,args:s,options:r,onEvent:n})}((e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((e=>new c(e)))}async execute(){return new Promise(((e,t)=>{this.on("error",t);const s=[],r=[];this.stdout.on("data",(e=>{s.push(e)})),this.stderr.on("data",(e=>{r.push(e)})),this.on("close",(t=>{e({code:t.code,signal:t.signal,stdout:this.collectOutput(s),stderr:this.collectOutput(r)})})),this.spawn().catch(t)}))}collectOutput(e){return"raw"===this.options.encoding?e.reduce(((e,t)=>new Uint8Array([...e,...t,10])),new Uint8Array):e.join("\n")}}return e.Child=c,e.Command=u,e.EventEmitter=h,e.open=async function(e,t){return a("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})}

@ -2,6 +2,8 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use std::sync::Arc;
use crate::open::Program; use crate::open::Program;
use crate::process::Command; use crate::process::Command;
@ -141,7 +143,7 @@ pub struct OpenScope {
#[derive(Clone)] #[derive(Clone)]
pub struct ShellScope<'a> { pub struct ShellScope<'a> {
/// All allowed commands, using their unique command name as the keys. /// All allowed commands, using their unique command name as the keys.
pub scopes: Vec<&'a ScopeAllowedCommand>, pub scopes: Vec<&'a Arc<ScopeAllowedCommand>>,
} }
/// All errors that can happen while validating a scoped command. /// All errors that can happen while validating a scoped command.

@ -1,5 +1,10 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
- [`2397ec5`](https://github.com/tauri-apps/plugins-workspace/commit/2397ec5937e594397e533925ccd257cae30b4cd1)([#1019](https://github.com/tauri-apps/plugins-workspace/pull/1019)) Fix doesn't shutdown immediately.
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
- [`6d1e621`](https://github.com/tauri-apps/plugins-workspace/commit/6d1e6218b5877ef91f589f790f7251acda9c9605)([#981](https://github.com/tauri-apps/plugins-workspace/pull/981)) Fix `zbus::blocking::connection::Builder` import. - [`6d1e621`](https://github.com/tauri-apps/plugins-workspace/commit/6d1e6218b5877ef91f589f790f7251acda9c9605)([#981](https://github.com/tauri-apps/plugins-workspace/pull/981)) Fix `zbus::blocking::connection::Builder` import.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-single-instance" name = "tauri-plugin-single-instance"
version = "2.0.0-beta.2" version = "2.0.0-beta.3"
description = "Ensure a single instance of your tauri app is running." description = "Ensure a single instance of your tauri app is running."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -9,6 +9,6 @@
"author": "", "author": "",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "2.0.0-beta.3" "@tauri-apps/cli": "2.0.0-beta.7"
} }
} }

@ -2,7 +2,7 @@
name = "single-instance-example" name = "single-instance-example"
version = "0.1.0" version = "0.1.0"
description = "A Tauri App" description = "A Tauri App"
authors = [ "You" ] authors = ["You"]
repository = "" repository = ""
edition = "2021" edition = "2021"
rust-version = "1.75" rust-version = "1.75"
@ -17,4 +17,4 @@ tauri-plugin-single-instance = { path = "../../../" }
tauri-build = { workspace = true } tauri-build = { workspace = true }
[features] [features]
custom-protocol = [ "tauri/custom-protocol" ] prod = ["tauri/custom-protocol"]

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -51,4 +55,4 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-sql" name = "tauri-plugin-sql"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
description = "Interface with SQL databases." description = "Interface with SQL databases."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-sql", "name": "@tauri-apps/plugin-sql",
"version": "2.0.0-beta.1", "version": "2.0.0-beta.2",
"description": "Interface with SQL databases", "description": "Interface with SQL databases",
"license": "MIT or APACHE-2.0", "license": "MIT or APACHE-2.0",
"authors": [ "authors": [
@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.2" "@tauri-apps/api": "2.0.0-beta.4"
} }
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
## \[2.0.0-beta.1] ## \[2.0.0-beta.1]
- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4. - [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
@ -44,4 +48,4 @@
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-store" name = "tauri-plugin-store"
version = "2.0.0-beta.1" version = "2.0.0-beta.2"
description = "Simple, persistent key-value store." description = "Simple, persistent key-value store."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -69,19 +69,30 @@ await store.set("some-key", { value: 5 });
const val = await store.get("some-key"); const val = await store.get("some-key");
assert(val, { value: 5 }); assert(val, { value: 5 });
await store.save(); // this manually saves the store, otherwise the store is only saved when your app is closed // This manually saves the store.
await store.save();
``` ```
### Persisting values ### Persisting Values
Values added to the store are not persisted between application loads unless: As seen above, values added to the store are not persisted between application loads unless the application is closed gracefully.
1. The application is closed gracefully (plugin automatically saves) You can manually save a store with:
2. The store is manually saved (using `store.save()`)
```javascript
await store.save();
```
Stores are loaded automatically when used from the JavaScript bindings.
However, you can also load them manually later like so:
```javascript
await store.load();
```
## Usage from Rust ## Usage from Rust
You can also access Stores from Rust, you can create new stores: You can also create `Store` instances directly in Rust:
```rust ```rust
use tauri_plugin_store::StoreBuilder; use tauri_plugin_store::StoreBuilder;
@ -91,23 +102,52 @@ fn main() {
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_store::Builder::default().build()) .plugin(tauri_plugin_store::Builder::default().build())
.setup(|app| { .setup(|app| {
let mut store = StoreBuilder::new(app.handle(), "path/to/store.bin".parse()?).build(); let mut store = StoreBuilder::new("app_data.bin").build(app.handle().clone());
// Attempt to load the store, if it's saved already.
store.load().expect("Failed to load store from disk");
// Note that values must be serde_json::Value instances,
// otherwise, they will not be compatible with the JavaScript bindings.
store.insert("a".to_string(), json!("b"));
store.insert("a".to_string(), json!("b")) // note that values must be serd_json::Value to be compatible with JS // You can manually save the store after making changes.
// Otherwise, it will save upon graceful exit as described above.
store.save()
}) })
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("error while running tauri application"); .expect("error while running tauri application");
} }
``` ```
As you may have noticed, the Store crated above isn't accessible to the frontend. To interoperate with stores created by JS use the exported `with_store` method: ### Loading Gracefully
If you call `load` on a `Store` that hasn't yet been written to the desk, it will return an error. You must handle this error if you want to gracefully continue and use the default store until you save it to the disk. The example above shows how to do this.
For example, this would cause a panic if the store has not yet been created:
```rust
store.load().unwrap();
```
Rather than silently continuing like you may expect.
You should always handle the error appropriately rather than unwrapping, or you may experience unexpected app crashes:
```rust
store.load().expect("Failed to load store from disk");
```
### Frontend Interoperability
As you may have noticed, the `Store` crated above isn't accessible to the frontend. To interoperate with stores created by JavaScript use the exported `with_store` method:
```rust ```rust
use tauri::Wry; use tauri::Wry;
use tauri_plugin_store::with_store; use tauri_plugin_store::with_store;
let stores = app.state::<StoreCollection<Wry>>(); let stores = app.state::<StoreCollection<Wry>>();
let path = PathBuf::from("path/to/the/storefile"); let path = PathBuf::from("app_data.bin");
with_store(app_handle, stores, path, |store| store.insert("a".to_string(), json!("b"))) with_store(app_handle, stores, path, |store| store.insert("a".to_string(), json!("b")))
``` ```

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

Loading…
Cancel
Save