mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-03 12:15:11 +02:00
Compare commits
63 Commits
os-v2.3.1
...
sql-v2.3.1
| Author | SHA1 | Date | |
|---|---|---|---|
| e7a68fa637 | |||
| b5550a3b0d | |||
| 93426f8512 | |||
| 4ee61e055e | |||
| 06124af8d6 | |||
| 060219e597 | |||
| c7e9766ff5 | |||
| d4a8ce962b | |||
| cdc7eec415 | |||
| 6314b004ab | |||
| fb4c8ae54c | |||
| fccc1cfb7e | |||
| 3702308e6f | |||
| c9c8b39b56 | |||
| 3c396feedf | |||
| b514d482fa | |||
| 60e5714ceb | |||
| 654bf4891a | |||
| 6c9b61fb65 | |||
| 6b5b1053ba | |||
| 67a7bf80f8 | |||
| e25a9339f4 | |||
| 92f98a93b4 | |||
| c0f82e5a5e | |||
| 5204145c6a | |||
| b4ee33dd01 | |||
| e933acb004 | |||
| e4a9154f4a | |||
| d44ac9afed | |||
| 1b197c2d4d | |||
| 650ff5ff23 | |||
| 2930aa39a4 | |||
| 3e92ce260b | |||
| 12da195fce | |||
| 30dd109d9f | |||
| 5e5bc30ad0 | |||
| f6dca71343 | |||
| 021e573248 | |||
| 51b430be98 | |||
| fd439b143e | |||
| 2522b71f6b | |||
| 9021a73247 | |||
| 625bb1c096 | |||
| 6215afe023 | |||
| 8cf8eeab02 | |||
| 509eba8d44 | |||
| 9ac5fe84e7 | |||
| c247410319 | |||
| de45034082 | |||
| 50c6b7c644 | |||
| b79d02d896 | |||
| b75f9f5cd3 | |||
| d865ed4768 | |||
| 1107c46425 | |||
| 23a3705857 | |||
| 6f65e68340 | |||
| 1a0b791650 | |||
| 2d03e2eac2 | |||
| 21d721a0c2 | |||
| 8abb31ee59 | |||
| 0354046817 | |||
| 04a0954857 | |||
| 9e4e859bea |
+1
-1
@@ -58,4 +58,4 @@ pids
|
||||
.idea
|
||||
debug.log
|
||||
TODO.md
|
||||
.aider*
|
||||
.aider.*
|
||||
|
||||
Generated
+40
-40
@@ -207,7 +207,7 @@ checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
||||
|
||||
[[package]]
|
||||
name = "api"
|
||||
version = "2.0.33"
|
||||
version = "2.0.38"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@@ -6359,9 +6359,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
||||
|
||||
[[package]]
|
||||
name = "tauri"
|
||||
version = "2.8.2"
|
||||
version = "2.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a54629607ea3084a8b455c1ebe888cbdfc4de02fa5edb2e40db0dc97091007e3"
|
||||
checksum = "5d545ccf7b60dcd44e07c6fb5aeb09140966f0aabd5d2aa14a6821df7bc99348"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
@@ -6496,7 +6496,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-autostart"
|
||||
version = "2.5.0"
|
||||
version = "2.5.1"
|
||||
dependencies = [
|
||||
"auto-launch",
|
||||
"serde",
|
||||
@@ -6508,7 +6508,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-barcode-scanner"
|
||||
version = "2.4.0"
|
||||
version = "2.4.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@@ -6520,7 +6520,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-biometric"
|
||||
version = "2.3.0"
|
||||
version = "2.3.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@@ -6533,7 +6533,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-cli"
|
||||
version = "2.4.0"
|
||||
version = "2.4.1"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"log",
|
||||
@@ -6546,7 +6546,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.3.0"
|
||||
version = "2.3.2"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"log",
|
||||
@@ -6559,7 +6559,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-deep-link"
|
||||
version = "2.4.1"
|
||||
version = "2.4.5"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"plist",
|
||||
@@ -6578,7 +6578,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.3.3"
|
||||
version = "2.4.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"raw-window-handle",
|
||||
@@ -6594,7 +6594,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-fs"
|
||||
version = "2.4.2"
|
||||
version = "2.4.4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"dunce",
|
||||
@@ -6616,7 +6616,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-geolocation"
|
||||
version = "2.3.0"
|
||||
version = "2.3.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@@ -6629,7 +6629,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-global-shortcut"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
dependencies = [
|
||||
"global-hotkey",
|
||||
"log",
|
||||
@@ -6642,7 +6642,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-haptics"
|
||||
version = "2.3.0"
|
||||
version = "2.3.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@@ -6655,7 +6655,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-http"
|
||||
version = "2.5.2"
|
||||
version = "2.5.4"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"cookie_store",
|
||||
@@ -6678,7 +6678,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-localhost"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
dependencies = [
|
||||
"http",
|
||||
"log",
|
||||
@@ -6691,7 +6691,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-log"
|
||||
version = "2.6.0"
|
||||
version = "2.7.1"
|
||||
dependencies = [
|
||||
"android_logger",
|
||||
"byte-unit",
|
||||
@@ -6712,7 +6712,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-nfc"
|
||||
version = "2.3.1"
|
||||
version = "2.3.3"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@@ -6725,7 +6725,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-notification"
|
||||
version = "2.3.0"
|
||||
version = "2.3.3"
|
||||
dependencies = [
|
||||
"color-backtrace",
|
||||
"ctor",
|
||||
@@ -6747,7 +6747,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-opener"
|
||||
version = "2.5.0"
|
||||
version = "2.5.2"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"glob",
|
||||
@@ -6767,7 +6767,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-os"
|
||||
version = "2.3.1"
|
||||
version = "2.3.2"
|
||||
dependencies = [
|
||||
"gethostname 1.0.1",
|
||||
"log",
|
||||
@@ -6783,7 +6783,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-persisted-scope"
|
||||
version = "2.3.2"
|
||||
version = "2.3.4"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"bincode",
|
||||
@@ -6797,7 +6797,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-positioner"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@@ -6810,7 +6810,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-process"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
dependencies = [
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
@@ -6818,7 +6818,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-shell"
|
||||
version = "2.3.0"
|
||||
version = "2.3.3"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"log",
|
||||
@@ -6837,7 +6837,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-single-instance"
|
||||
version = "2.3.2"
|
||||
version = "2.3.6"
|
||||
dependencies = [
|
||||
"semver",
|
||||
"serde",
|
||||
@@ -6852,7 +6852,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-sql"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"indexmap 2.9.0",
|
||||
@@ -6869,7 +6869,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-store"
|
||||
version = "2.4.0"
|
||||
version = "2.4.1"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"serde",
|
||||
@@ -6883,7 +6883,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-stronghold"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"iota-crypto",
|
||||
@@ -6934,7 +6934,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-upload"
|
||||
version = "2.3.1"
|
||||
version = "2.3.2"
|
||||
dependencies = [
|
||||
"futures-util",
|
||||
"log",
|
||||
@@ -6952,7 +6952,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-websocket"
|
||||
version = "2.4.0"
|
||||
version = "2.4.1"
|
||||
dependencies = [
|
||||
"futures-util",
|
||||
"http",
|
||||
@@ -6969,7 +6969,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-window-state"
|
||||
version = "2.4.0"
|
||||
version = "2.4.1"
|
||||
dependencies = [
|
||||
"bitflags 2.9.0",
|
||||
"log",
|
||||
@@ -7007,9 +7007,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "2.8.0"
|
||||
version = "2.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5bb0f10f831f75832ac74d14d98f701868f9a8adccef2c249b466cf70b607db9"
|
||||
checksum = "c1fe9d48bd122ff002064e88cfcd7027090d789c4302714e68fcccba0f4b7807"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
@@ -7332,9 +7332,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio-tungstenite"
|
||||
version = "0.27.0"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "489a59b6730eda1b0171fcfda8b121f4bee2b35cba8645ca35c5f7ba3eb736c1"
|
||||
checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857"
|
||||
dependencies = [
|
||||
"futures-util",
|
||||
"log",
|
||||
@@ -7565,9 +7565,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||
|
||||
[[package]]
|
||||
name = "tungstenite"
|
||||
version = "0.27.0"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eadc29d668c91fcc564941132e17b28a7ceb2f3ebf0b9dae3e03fd7a6748eb0d"
|
||||
checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"data-encoding",
|
||||
@@ -8789,9 +8789,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
|
||||
|
||||
[[package]]
|
||||
name = "wry"
|
||||
version = "0.53.1"
|
||||
version = "0.53.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5698e50a589268aec06d2219f48b143222f7b5ad9aa690118b8dce0a8dcac574"
|
||||
checksum = "e3b6763512fe4b51c80b3ce9b50939d682acb4de335dfabbdb20d7a2642199b7"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"block2 0.6.0",
|
||||
|
||||
+2
-1
@@ -3,11 +3,12 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import eslint from '@eslint/js'
|
||||
import { defineConfig } from 'eslint/config'
|
||||
import eslintConfigPrettier from 'eslint-config-prettier'
|
||||
import eslintPluginSecurity from 'eslint-plugin-security'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export default tseslint.config(
|
||||
export default defineConfig(
|
||||
{
|
||||
ignores: [
|
||||
'**/target',
|
||||
|
||||
@@ -1,5 +1,60 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.34]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner-js@2.4.2`
|
||||
- Upgraded to `biometric-js@2.3.2`
|
||||
- Upgraded to `cli-js@2.4.1`
|
||||
- Upgraded to `clipboard-manager-js@2.3.2`
|
||||
- Upgraded to `dialog-js@2.4.2`
|
||||
- Upgraded to `fs-js@2.4.4`
|
||||
- Upgraded to `global-shortcut-js@2.3.1`
|
||||
- Upgraded to `http-js@2.5.4`
|
||||
- Upgraded to `log-js@2.7.1`
|
||||
- Upgraded to `nfc-js@2.3.3`
|
||||
- Upgraded to `notification-js@2.3.3`
|
||||
- Upgraded to `opener-js@2.5.2`
|
||||
- Upgraded to `os-js@2.3.2`
|
||||
- Upgraded to `process-js@2.3.1`
|
||||
- Upgraded to `shell-js@2.3.3`
|
||||
- Upgraded to `store-js@2.4.1`
|
||||
|
||||
## \[2.0.33]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner-js@2.4.1`
|
||||
- Upgraded to `biometric-js@2.3.1`
|
||||
- Upgraded to `clipboard-manager-js@2.3.1`
|
||||
- Upgraded to `dialog-js@2.4.1`
|
||||
- Upgraded to `fs-js@2.4.3`
|
||||
- Upgraded to `nfc-js@2.3.2`
|
||||
- Upgraded to `notification-js@2.3.2`
|
||||
- Upgraded to `opener-js@2.5.1`
|
||||
- Upgraded to `shell-js@2.3.2`
|
||||
- Upgraded to `http-js@2.5.3`
|
||||
|
||||
## \[2.0.32]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `dialog-js@2.4.0`
|
||||
- Upgraded to `log-js@2.7.0`
|
||||
|
||||
## \[2.0.31]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `shell-js@2.3.1`
|
||||
|
||||
## \[2.0.30]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `notification-js@2.3.1`
|
||||
|
||||
## \[2.0.29]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
||||
content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=0"
|
||||
/>
|
||||
<title>Svelte + Vite App</title>
|
||||
</head>
|
||||
|
||||
+19
-19
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "api",
|
||||
"private": true,
|
||||
"version": "2.0.29",
|
||||
"version": "2.0.34",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --clearScreen false",
|
||||
@@ -10,24 +10,24 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.8.0",
|
||||
"@tauri-apps/plugin-barcode-scanner": "^2.4.0",
|
||||
"@tauri-apps/plugin-biometric": "^2.3.0",
|
||||
"@tauri-apps/plugin-cli": "^2.4.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.3.0",
|
||||
"@tauri-apps/plugin-dialog": "^2.3.3",
|
||||
"@tauri-apps/plugin-fs": "^2.4.2",
|
||||
"@tauri-apps/api": "2.9.0",
|
||||
"@tauri-apps/plugin-barcode-scanner": "^2.4.2",
|
||||
"@tauri-apps/plugin-biometric": "^2.3.2",
|
||||
"@tauri-apps/plugin-cli": "^2.4.1",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.3.2",
|
||||
"@tauri-apps/plugin-dialog": "^2.4.2",
|
||||
"@tauri-apps/plugin-fs": "^2.4.4",
|
||||
"@tauri-apps/plugin-geolocation": "^2.2.0",
|
||||
"@tauri-apps/plugin-global-shortcut": "^2.3.0",
|
||||
"@tauri-apps/plugin-global-shortcut": "^2.3.1",
|
||||
"@tauri-apps/plugin-haptics": "^2.2.0",
|
||||
"@tauri-apps/plugin-http": "^2.5.2",
|
||||
"@tauri-apps/plugin-nfc": "^2.3.1",
|
||||
"@tauri-apps/plugin-notification": "^2.3.0",
|
||||
"@tauri-apps/plugin-opener": "^2.5.0",
|
||||
"@tauri-apps/plugin-os": "^2.3.1",
|
||||
"@tauri-apps/plugin-process": "^2.3.0",
|
||||
"@tauri-apps/plugin-shell": "^2.3.0",
|
||||
"@tauri-apps/plugin-store": "^2.4.0",
|
||||
"@tauri-apps/plugin-http": "^2.5.4",
|
||||
"@tauri-apps/plugin-nfc": "^2.3.3",
|
||||
"@tauri-apps/plugin-notification": "^2.3.3",
|
||||
"@tauri-apps/plugin-opener": "^2.5.2",
|
||||
"@tauri-apps/plugin-os": "^2.3.2",
|
||||
"@tauri-apps/plugin-process": "^2.3.1",
|
||||
"@tauri-apps/plugin-shell": "^2.3.3",
|
||||
"@tauri-apps/plugin-store": "^2.4.1",
|
||||
"@tauri-apps/plugin-updater": "^2.9.0",
|
||||
"@tauri-apps/plugin-upload": "^2.3.0",
|
||||
"@zerodevx/svelte-json-view": "1.0.11"
|
||||
@@ -36,10 +36,10 @@
|
||||
"@iconify-json/codicon": "^1.2.12",
|
||||
"@iconify-json/ph": "^1.2.2",
|
||||
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
||||
"@tauri-apps/cli": "2.8.1",
|
||||
"@tauri-apps/cli": "2.9.1",
|
||||
"@unocss/extractor-svelte": "^66.3.3",
|
||||
"svelte": "^5.20.4",
|
||||
"unocss": "^66.3.3",
|
||||
"vite": "^7.0.4"
|
||||
"vite": "^7.0.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,64 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.38]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner@2.4.2`
|
||||
- Upgraded to `biometric@2.3.2`
|
||||
- Upgraded to `cli@2.4.1`
|
||||
- Upgraded to `clipboard-manager@2.3.2`
|
||||
- Upgraded to `dialog@2.4.2`
|
||||
- Upgraded to `fs@2.4.4`
|
||||
- Upgraded to `geolocation@2.3.2`
|
||||
- Upgraded to `global-shortcut@2.3.1`
|
||||
- Upgraded to `haptics@2.3.2`
|
||||
- Upgraded to `http@2.5.4`
|
||||
- Upgraded to `log@2.7.1`
|
||||
- Upgraded to `nfc@2.3.3`
|
||||
- Upgraded to `notification@2.3.3`
|
||||
- Upgraded to `opener@2.5.2`
|
||||
- Upgraded to `os@2.3.2`
|
||||
- Upgraded to `process@2.3.1`
|
||||
- Upgraded to `shell@2.3.3`
|
||||
- Upgraded to `store@2.4.1`
|
||||
|
||||
## \[2.0.37]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner@2.4.1`
|
||||
- Upgraded to `biometric@2.3.1`
|
||||
- Upgraded to `clipboard-manager@2.3.1`
|
||||
- Upgraded to `dialog@2.4.1`
|
||||
- Upgraded to `fs@2.4.3`
|
||||
- Upgraded to `geolocation@2.3.1`
|
||||
- Upgraded to `haptics@2.3.1`
|
||||
- Upgraded to `nfc@2.3.2`
|
||||
- Upgraded to `notification@2.3.2`
|
||||
- Upgraded to `opener@2.5.1`
|
||||
- Upgraded to `shell@2.3.2`
|
||||
- Upgraded to `http@2.5.3`
|
||||
|
||||
## \[2.0.36]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `dialog@2.4.0`
|
||||
- Upgraded to `log@2.7.0`
|
||||
|
||||
## \[2.0.35]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `shell@2.3.1`
|
||||
|
||||
## \[2.0.34]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `notification@2.3.1`
|
||||
|
||||
## \[2.0.33]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "api"
|
||||
publish = false
|
||||
version = "2.0.33"
|
||||
version = "2.0.38"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
rust-version = { workspace = true }
|
||||
@@ -20,24 +20,24 @@ serde = { workspace = true }
|
||||
tiny_http = "0.12"
|
||||
time = "0.3"
|
||||
log = { workspace = true }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.6.0" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.4.2", features = [
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.7.1" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.4.4", features = [
|
||||
"watch",
|
||||
] }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.0" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.3.3" }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.2" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.4.2" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [
|
||||
"multipart",
|
||||
"cookies",
|
||||
], version = "2.5.2" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.3.0", features = [
|
||||
], version = "2.5.4" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.3.3", features = [
|
||||
"windows7-compat",
|
||||
] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.3.1" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.3.0" }
|
||||
tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.0" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.0" }
|
||||
tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.0" }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.3.2" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.3.1" }
|
||||
tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.2" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.3" }
|
||||
tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.1" }
|
||||
tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
|
||||
|
||||
[dependencies.tauri]
|
||||
@@ -55,17 +55,17 @@ features = [
|
||||
]
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.0" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.0" }
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.1" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.1" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.9.0" }
|
||||
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" }
|
||||
|
||||
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.4.0" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.1" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.3.0" }
|
||||
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.3.0" }
|
||||
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.0" }
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.4.2" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.3" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.3.2" }
|
||||
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.3.2" }
|
||||
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.2" }
|
||||
|
||||
[features]
|
||||
prod = ["tauri/custom-protocol"]
|
||||
|
||||
@@ -68,6 +68,9 @@
|
||||
"fs:allow-rename",
|
||||
"fs:allow-mkdir",
|
||||
"fs:allow-remove",
|
||||
"fs:allow-stat",
|
||||
"fs:allow-fstat",
|
||||
"fs:allow-lstat",
|
||||
"fs:allow-write-text-file",
|
||||
"fs:read-meta",
|
||||
"fs:scope-download-recursive",
|
||||
@@ -75,6 +78,9 @@
|
||||
{
|
||||
"identifier": "fs:scope-appdata-recursive",
|
||||
"allow": [
|
||||
{
|
||||
"path": "$APPDATA/db/"
|
||||
},
|
||||
{
|
||||
"path": "$APPDATA/db/**"
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ val tauriProperties = Properties().apply {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
namespace = "com.tauri.api"
|
||||
defaultConfig {
|
||||
manifestPlaceholders["usesCleartextTraffic"] = "false"
|
||||
applicationId = "com.tauri.api"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
targetSdk = 36
|
||||
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
|
||||
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:8.5.1")
|
||||
classpath("com.android.tools.build:gradle:8.11.0")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
compileOnly(gradleApi())
|
||||
implementation("com.android.tools.build:gradle:8.5.1")
|
||||
implementation("com.android.tools.build:gradle:8.11.0")
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,13 @@
|
||||
await message("Tauri is awesome!");
|
||||
}
|
||||
|
||||
async function msgCustom(result) {
|
||||
const buttons = { yes: "awesome", no: "amazing", cancel: "stunning" };
|
||||
await message(`Tauri is: `, { buttons })
|
||||
.then((res) => onMessage(`Tauri is ${res}`))
|
||||
.catch(onMessage);
|
||||
}
|
||||
|
||||
function openDialog() {
|
||||
open({
|
||||
title: "My wonderful open dialog",
|
||||
@@ -136,12 +143,17 @@
|
||||
<label for="dialog-directory">Directory</label>
|
||||
</div>
|
||||
<br />
|
||||
<button class="btn" id="open-dialog" on:click={openDialog}>Open dialog</button>
|
||||
<button class="btn" id="save-dialog" on:click={saveDialog}
|
||||
>Open save dialog</button
|
||||
>
|
||||
<button class="btn" id="prompt-dialog" on:click={prompt}>Prompt</button>
|
||||
<button class="btn" id="custom-prompt-dialog" on:click={promptCustom}
|
||||
>Prompt (custom)</button
|
||||
>
|
||||
<button class="btn" id="message-dialog" on:click={msg}>Message</button>
|
||||
|
||||
<div class="flex flex-wrap flex-col md:flex-row gap-2 children:flex-shrink-0">
|
||||
<button class="btn" id="open-dialog" on:click={openDialog}>Open dialog</button>
|
||||
<button class="btn" id="save-dialog" on:click={saveDialog}
|
||||
>Open save dialog</button
|
||||
>
|
||||
<button class="btn" id="prompt-dialog" on:click={prompt}>Prompt</button>
|
||||
<button class="btn" id="custom-prompt-dialog" on:click={promptCustom}
|
||||
>Prompt (custom)</button
|
||||
>
|
||||
<button class="btn" id="message-dialog" on:click={msg}>Message</button>
|
||||
<button class="btn" id="message-dialog" on:click={msgCustom}>Message (custom)</button>
|
||||
|
||||
</div>
|
||||
@@ -1,8 +1,9 @@
|
||||
<script>
|
||||
import * as fs from '@tauri-apps/plugin-fs'
|
||||
import * as os from '@tauri-apps/plugin-os'
|
||||
import { convertFileSrc } from '@tauri-apps/api/core'
|
||||
import { arrayBufferToBase64 } from '../lib/utils'
|
||||
import { onDestroy } from 'svelte'
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
|
||||
const { onMessage, insecureRenderHtml } = $props()
|
||||
|
||||
@@ -18,6 +19,12 @@
|
||||
let baseDir = $state()
|
||||
let unwatchFn
|
||||
let unwatchPath = ''
|
||||
let isMobile = $state(false)
|
||||
|
||||
onMount(() => {
|
||||
let platform = os.platform()
|
||||
isMobile = platform === 'android' || platform === 'ios'
|
||||
})
|
||||
|
||||
const dirOptions = Object.keys(fs.BaseDirectory).filter((key) =>
|
||||
isNaN(parseInt(key))
|
||||
@@ -38,7 +45,7 @@
|
||||
}
|
||||
|
||||
function mkdir() {
|
||||
fs.mkdir(path, { baseDir })
|
||||
fs.mkdir(path, { baseDir, recursive: true })
|
||||
.then(() => {
|
||||
onMessage(`Created dir ${path}`)
|
||||
})
|
||||
@@ -73,6 +80,16 @@
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
function write() {
|
||||
const encoder = new TextEncoder()
|
||||
file
|
||||
.write(encoder.encode('Hello from Tauri :)'))
|
||||
.then(() => {
|
||||
onMessage(`wrote to file`)
|
||||
})
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
function stat() {
|
||||
file
|
||||
.stat()
|
||||
@@ -180,6 +197,13 @@
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col">
|
||||
{#if isMobile}
|
||||
<div>
|
||||
On mobile, paths outside of App* paths require the use of dialogs
|
||||
regardless of Tauri's scope mechanism.
|
||||
</div>
|
||||
<br />
|
||||
{/if}
|
||||
<div class="flex gap-1">
|
||||
<select class="input" bind:value={baseDir}>
|
||||
<option value={undefined} selected>None</option>
|
||||
@@ -207,6 +231,7 @@
|
||||
</div>
|
||||
{#if file}
|
||||
<div>
|
||||
<button class="btn" onclick={write}>Write</button>
|
||||
<button class="btn" onclick={truncate}>Truncate</button>
|
||||
<button class="btn" onclick={stat}>Stat</button>
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
<script>
|
||||
import { sendNotification } from '@tauri-apps/plugin-notification'
|
||||
export let onMessage
|
||||
|
||||
let sound = ''
|
||||
|
||||
// send the notification directly
|
||||
// the backend is responsible for checking the permission
|
||||
function _sendNotification() {
|
||||
new Notification('Notification title', {
|
||||
body: 'This is the notification body'
|
||||
sendNotification({
|
||||
title: 'Notification title',
|
||||
body: 'This is the notification body',
|
||||
sound: sound || null
|
||||
})
|
||||
}
|
||||
|
||||
// alternatively, check the permission ourselves
|
||||
function sendNotification() {
|
||||
function triggerNotification() {
|
||||
if (Notification.permission === 'default') {
|
||||
Notification.requestPermission()
|
||||
.then(function (response) {
|
||||
@@ -29,6 +34,11 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<button class="btn" id="notification" on:click={sendNotification}>
|
||||
<input
|
||||
class="input grow"
|
||||
placeholder="Notification sound..."
|
||||
bind:value={sound}
|
||||
/>
|
||||
<button class="btn" id="notification" on:click={triggerNotification}>
|
||||
Send test notification
|
||||
</button>
|
||||
|
||||
+9
-8
@@ -11,20 +11,21 @@
|
||||
"example:api:dev": "pnpm run --filter \"api\" tauri dev"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.33.0",
|
||||
"@rollup/plugin-node-resolve": "16.0.1",
|
||||
"@eslint/js": "9.38.0",
|
||||
"@rollup/plugin-node-resolve": "16.0.3",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
"@rollup/plugin-typescript": "12.1.4",
|
||||
"@rollup/plugin-typescript": "12.3.0",
|
||||
"covector": "^0.12.4",
|
||||
"eslint": "9.33.0",
|
||||
"eslint": "9.38.0",
|
||||
"eslint-config-prettier": "10.1.8",
|
||||
"eslint-plugin-security": "3.0.1",
|
||||
"prettier": "3.6.2",
|
||||
"rollup": "4.46.4",
|
||||
"rollup": "4.52.5",
|
||||
"tslib": "2.8.1",
|
||||
"typescript": "5.9.2",
|
||||
"typescript-eslint": "8.40.0"
|
||||
"typescript": "5.9.3",
|
||||
"typescript-eslint": "8.46.2"
|
||||
},
|
||||
"minimumReleaseAge": 4320,
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"esbuild@<0.25.0": ">=0.25.0"
|
||||
@@ -34,6 +35,6 @@
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"pnpm": "^10.0.0"
|
||||
"pnpm": "^10.16.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.5.1]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.5.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-autostart"
|
||||
version = "2.5.0"
|
||||
version = "2.5.1"
|
||||
description = "Automatically launch your application at startup."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -9,10 +9,6 @@ rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-autostart"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-autostart",
|
||||
"version": "2.5.0",
|
||||
"version": "2.5.1",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.4.2]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.4.1]
|
||||
|
||||
- [`654bf489`](https://github.com/tauri-apps/plugins-workspace/commit/654bf4891a35769f7e82971641d3ad99974b2dfe) ([#3038](https://github.com/tauri-apps/plugins-workspace/pull/3038) by [@daniel-mader](https://github.com/tauri-apps/plugins-workspace/../../daniel-mader)) Update `androidx.camera` from `1.1.0` to `1.5.1` to support 16 KB memory page sizes.
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
|
||||
## \[2.4.0]
|
||||
|
||||
- [`aa9140e1`](https://github.com/tauri-apps/plugins-workspace/commit/aa9140e1ac239ab9f015f92b2ed52bbf0eda7c12) ([#2437](https://github.com/tauri-apps/plugins-workspace/pull/2437) by [@enkhjile](https://github.com/tauri-apps/plugins-workspace/../../enkhjile)) Added support for GS1 DataBar on iOS 15.4+
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-barcode-scanner"
|
||||
version = "2.4.0"
|
||||
version = "2.4.2"
|
||||
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -10,8 +10,6 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-barcode-scanner"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.barcodescanner"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
@@ -33,16 +33,14 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
val camerax_version = "1.5.1"
|
||||
implementation("androidx.core:core-ktx:1.9.0")
|
||||
implementation("androidx.appcompat:appcompat:1.6.0")
|
||||
implementation("com.google.android.material:material:1.7.0")
|
||||
implementation("androidx.camera:camera-core:1.1.0")
|
||||
implementation("androidx.camera:camera-view:1.1.0")
|
||||
implementation("androidx.camera:camera-lifecycle:1.1.0")
|
||||
implementation("androidx.camera:camera-camera2:1.1.0")
|
||||
implementation("androidx.camera:camera-lifecycle:1.1.0")
|
||||
implementation("androidx.camera:camera-view:1.1.0")
|
||||
implementation("androidx.camera:camera-core:${camerax_version}")
|
||||
implementation("androidx.camera:camera-camera2:${camerax_version}")
|
||||
implementation("androidx.camera:camera-lifecycle:${camerax_version}")
|
||||
implementation("androidx.camera:camera-view:${camerax_version}")
|
||||
implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.1.0")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-barcode-scanner",
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.2",
|
||||
"description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.3.2]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.3.1]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-biometric"
|
||||
version = "2.3.0"
|
||||
version = "2.3.2"
|
||||
description = "Prompt the user for biometric authentication on Android and iOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -9,8 +9,6 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-biometric"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.biometric"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-biometric",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.2",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.4.1]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.4.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-cli"
|
||||
version = "2.4.0"
|
||||
version = "2.4.1"
|
||||
description = "Parse arguments from your Tauri application's command line interface."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -9,10 +9,6 @@ rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-cli"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-cli",
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.1",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.3.2]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.3.1]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.3.0"
|
||||
version = "2.3.2"
|
||||
description = "Read and write to the system clipboard."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -10,8 +10,7 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-clipboard-manager"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.clipboard"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-clipboard-manager",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.2",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.4.5]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.4.4]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
- [`e25a9339`](https://github.com/tauri-apps/plugins-workspace/commit/e25a9339f46268f70dc9afd0c5ab3decbf79b330) ([#3019](https://github.com/tauri-apps/plugins-workspace/pull/3019) by [@kevinschoonover](https://github.com/tauri-apps/plugins-workspace/../../kevinschoonover)) Fix Exec= field in desktop handler if executable path changes
|
||||
|
||||
## \[2.4.3]
|
||||
|
||||
- [`2522b71f`](https://github.com/tauri-apps/plugins-workspace/commit/2522b71f6bcae65c03b24415eb9295c9e7c84ffc) ([#2970](https://github.com/tauri-apps/plugins-workspace/pull/2970) by [@WSH032](https://github.com/tauri-apps/plugins-workspace/../../WSH032)) Revert the breaking change introduced by [#2928](https://github.com/tauri-apps/plugins-workspace/pull/2928).
|
||||
|
||||
## \[2.4.2]
|
||||
|
||||
- [`21d721a0`](https://github.com/tauri-apps/plugins-workspace/commit/21d721a0c2731fc201872f5b99ea8bbdc61b0b60) ([#2928](https://github.com/tauri-apps/plugins-workspace/pull/2928) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Linux, improved error messages when OS commands fail.
|
||||
|
||||
## \[2.4.1]
|
||||
|
||||
- [`d4f8299b`](https://github.com/tauri-apps/plugins-workspace/commit/d4f8299b12f107718c70692840a63768d65baaf9) ([#2844](https://github.com/tauri-apps/plugins-workspace/pull/2844) by [@yobson1](https://github.com/tauri-apps/plugins-workspace/../../yobson1)) Fix deep link protocol handler not set as default on linux
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-deep-link"
|
||||
version = "2.4.1"
|
||||
version = "2.4.5"
|
||||
description = "Set your Tauri application as the default handler for an URL"
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -10,8 +10,6 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-deep-link"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.deep_link"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.2.8]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `deep-link-js@2.4.5`
|
||||
|
||||
## \[2.2.7]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `deep-link-js@2.4.4`
|
||||
|
||||
## \[2.2.6]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `deep-link-js@2.4.3`
|
||||
|
||||
## \[2.2.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `deep-link-js@2.4.2`
|
||||
|
||||
## \[2.2.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "deep-link-example",
|
||||
"private": true,
|
||||
"version": "2.2.4",
|
||||
"version": "2.2.8",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -10,12 +10,12 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.8.0",
|
||||
"@tauri-apps/plugin-deep-link": "link:../.."
|
||||
"@tauri-apps/api": "2.9.0",
|
||||
"@tauri-apps/plugin-deep-link": "2.4.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.8.1",
|
||||
"@tauri-apps/cli": "2.9.1",
|
||||
"typescript": "^5.7.3",
|
||||
"vite": "^7.0.4"
|
||||
"vite": "^7.0.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-deep-link",
|
||||
"version": "2.4.1",
|
||||
"version": "2.4.5",
|
||||
"description": "Set your Tauri application as the default handler for an URL",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
@@ -28,6 +28,6 @@
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.8.1"
|
||||
"@tauri-apps/cli": "2.9.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,16 @@ pub enum Error {
|
||||
PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError),
|
||||
}
|
||||
|
||||
// TODO(v3): change this into an error in v3,
|
||||
// see <https://github.com/tauri-apps/plugins-workspace/pull/2970#issuecomment-3244660138>.
|
||||
#[inline]
|
||||
#[cfg(target_os = "linux")]
|
||||
pub(crate) fn inspect_command_error<'a>(command: &'a str) -> impl Fn(&std::io::Error) + 'a {
|
||||
move |e| {
|
||||
tracing::error!("Failed to run OS command `{command}`: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for Error {
|
||||
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
|
||||
where
|
||||
|
||||
@@ -254,6 +254,7 @@ mod imp {
|
||||
///
|
||||
/// ## Platform-specific:
|
||||
///
|
||||
/// - **Linux**: Needs the `xdg-mime` and `update-desktop-database` commands available on the system.
|
||||
/// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
|
||||
pub fn register<S: AsRef<str>>(&self, _protocol: S) -> crate::Result<()> {
|
||||
#[cfg(windows)]
|
||||
@@ -292,6 +293,7 @@ mod imp {
|
||||
.unwrap_or_else(|| bin.into_os_string())
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
let qualified_exec = format!("{} %u", exec);
|
||||
|
||||
let target = self.app.path().data_dir()?.join("applications");
|
||||
|
||||
@@ -303,12 +305,28 @@ mod imp {
|
||||
|
||||
if let Ok(mut desktop_file) = ini::Ini::load_from_file(&target_file) {
|
||||
if let Some(section) = desktop_file.section_mut(Some("Desktop Entry")) {
|
||||
// it's ok to remove it - we only write to the file if it's missing
|
||||
// and in that case we include old_mimes
|
||||
let old_mimes = section.remove("MimeType").unwrap_or_default();
|
||||
let mut change = false;
|
||||
|
||||
// if the mime type is not present, append it to the list
|
||||
if !old_mimes.split(';').any(|mime| mime == mime_type) {
|
||||
section.append("MimeType", format!("{mime_type};{old_mimes}"));
|
||||
change = true;
|
||||
} else {
|
||||
section.insert("MimeType".to_string(), old_mimes);
|
||||
}
|
||||
|
||||
// if the exec command doesnt match, update to the new one
|
||||
let old_exec = section.remove("Exec").unwrap_or_default();
|
||||
if old_exec != qualified_exec {
|
||||
section.append("Exec", qualified_exec);
|
||||
change = true;
|
||||
} else {
|
||||
section.insert("Exec".to_string(), old_exec.to_string());
|
||||
}
|
||||
|
||||
// if any property has changed, rewrite the .desktop file
|
||||
if change {
|
||||
desktop_file.write_to_file(&target_file)?;
|
||||
}
|
||||
}
|
||||
@@ -323,7 +341,7 @@ mod imp {
|
||||
.product_name
|
||||
.clone()
|
||||
.unwrap_or_else(|| file_name.clone()),
|
||||
exec = exec,
|
||||
qualified_exec = qualified_exec,
|
||||
mime_type = mime_type
|
||||
)
|
||||
.as_bytes(),
|
||||
@@ -332,11 +350,15 @@ mod imp {
|
||||
|
||||
Command::new("update-desktop-database")
|
||||
.arg(target)
|
||||
.status()?;
|
||||
.status()
|
||||
.inspect_err(crate::error::inspect_command_error(
|
||||
"update-desktop-database",
|
||||
))?;
|
||||
|
||||
Command::new("xdg-mime")
|
||||
.args(["default", &file_name, mime_type.as_str()])
|
||||
.status()?;
|
||||
.status()
|
||||
.inspect_err(crate::error::inspect_command_error("xdg-mime"))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -405,6 +427,7 @@ mod imp {
|
||||
///
|
||||
/// ## Platform-specific:
|
||||
///
|
||||
/// - **Linux**: Needs the `xdg-mime` command available on the system.
|
||||
/// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
|
||||
pub fn is_registered<S: AsRef<str>>(&self, _protocol: S) -> crate::Result<bool> {
|
||||
#[cfg(windows)]
|
||||
@@ -439,7 +462,8 @@ mod imp {
|
||||
"default",
|
||||
&format!("x-scheme-handler/{}", _protocol.as_ref()),
|
||||
])
|
||||
.output()?;
|
||||
.output()
|
||||
.inspect_err(crate::error::inspect_command_error("xdg-mime"))?;
|
||||
|
||||
Ok(String::from_utf8_lossy(&output.stdout).contains(&file_name))
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name={name}
|
||||
Exec={exec} %u
|
||||
Exec={qualified_exec}
|
||||
Terminal=false
|
||||
MimeType={mime_type}
|
||||
NoDisplay=true
|
||||
NoDisplay=true
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.4.2]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs-js@2.4.4`
|
||||
|
||||
## \[2.4.1]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs-js@2.4.3`
|
||||
|
||||
## \[2.4.0]
|
||||
|
||||
- [`509eba8d`](https://github.com/tauri-apps/plugins-workspace/commit/509eba8d441c4f6ecf0af77b572cb2afd69a752d) ([#2641](https://github.com/tauri-apps/plugins-workspace/pull/2641) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add support for showing a message dialog with 3 buttons.
|
||||
|
||||
## \[2.3.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.3.3"
|
||||
version = "2.4.2"
|
||||
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -10,8 +10,6 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-dialog"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
@@ -34,7 +32,7 @@ tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
url = { workspace = true }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.4.2" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.4.4" }
|
||||
|
||||
[target.'cfg(target_os = "ios")'.dependencies]
|
||||
tauri = { workspace = true, features = ["wry"] }
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.dialog"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -38,6 +38,7 @@ class MessageOptions {
|
||||
var title: String? = null
|
||||
lateinit var message: String
|
||||
var okButtonLabel: String? = null
|
||||
var noButtonLabel: String? = null
|
||||
var cancelButtonLabel: String? = null
|
||||
}
|
||||
|
||||
@@ -139,9 +140,8 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
|
||||
return
|
||||
}
|
||||
|
||||
val handler = { cancelled: Boolean, value: Boolean ->
|
||||
val handler = { value: String ->
|
||||
val ret = JSObject()
|
||||
ret.put("cancelled", cancelled)
|
||||
ret.put("value", value)
|
||||
invoke.resolve(ret)
|
||||
}
|
||||
@@ -153,24 +153,34 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
|
||||
if (args.title != null) {
|
||||
builder.setTitle(args.title)
|
||||
}
|
||||
|
||||
val okButtonLabel = args.okButtonLabel ?: "Ok"
|
||||
|
||||
builder
|
||||
.setMessage(args.message)
|
||||
.setPositiveButton(
|
||||
args.okButtonLabel ?: "OK"
|
||||
) { dialog, _ ->
|
||||
.setPositiveButton(okButtonLabel) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
handler(false, true)
|
||||
handler(okButtonLabel)
|
||||
}
|
||||
.setOnCancelListener { dialog ->
|
||||
dialog.dismiss()
|
||||
handler(true, false)
|
||||
handler(args.cancelButtonLabel ?: "Cancel")
|
||||
}
|
||||
|
||||
if (args.noButtonLabel != null) {
|
||||
builder.setNeutralButton(args.noButtonLabel) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
handler(args.noButtonLabel!!)
|
||||
}
|
||||
}
|
||||
|
||||
if (args.cancelButtonLabel != null) {
|
||||
builder.setNegativeButton( args.cancelButtonLabel) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
handler(false, false)
|
||||
handler(args.cancelButtonLabel!!)
|
||||
}
|
||||
}
|
||||
|
||||
val dialog = builder.create()
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,yesButtonLabel:i?.okLabel?.toString(),noButtonLabel:i?.cancelLabel?.toString()})},t.confirm=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString(),cancelButtonLabel:i?.cancelLabel?.toString()})},t.message=async function(t,e){const i="string"==typeof e?{title:e}:e;await n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}function e(t){if(void 0!==t)return"string"==typeof t?t:"ok"in t&&"cancel"in t?{OkCancelCustom:[t.ok,t.cancel]}:"yes"in t&&"no"in t&&"cancel"in t?{YesNoCancelCustom:[t.yes,t.no,t.cancel]}:"ok"in t?{OkCustom:t.ok}:void 0}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const o="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:o?.title?.toString(),kind:o?.kind,yesButtonLabel:o?.okLabel?.toString(),noButtonLabel:o?.cancelLabel?.toString()})},t.confirm=async function(t,e){const o="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:o?.title?.toString(),kind:o?.kind,okButtonLabel:o?.okLabel?.toString(),cancelButtonLabel:o?.cancelLabel?.toString()})},t.message=async function(t,o){const i="string"==typeof o?{title:o}:o;return n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString(),buttons:e(i?.buttons)})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})}
|
||||
|
||||
@@ -77,6 +77,80 @@ interface SaveDialogOptions {
|
||||
canCreateDirectories?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Default buttons for a message dialog.
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
export type MessageDialogDefaultButtons =
|
||||
| 'Ok'
|
||||
| 'OkCancel'
|
||||
| 'YesNo'
|
||||
| 'YesNoCancel'
|
||||
|
||||
/** All possible button keys. */
|
||||
type ButtonKey = 'ok' | 'cancel' | 'yes' | 'no'
|
||||
|
||||
/** Ban everything except a set of keys. */
|
||||
type BanExcept<Allowed extends ButtonKey> = Partial<
|
||||
Record<Exclude<ButtonKey, Allowed>, never>
|
||||
>
|
||||
|
||||
/**
|
||||
* The Yes, No and Cancel buttons of a message dialog.
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
export type MessageDialogButtonsYesNoCancel = {
|
||||
/** The Yes button. */
|
||||
yes: string
|
||||
/** The No button. */
|
||||
no: string
|
||||
/** The Cancel button. */
|
||||
cancel: string
|
||||
} & BanExcept<'yes' | 'no' | 'cancel'>
|
||||
|
||||
/**
|
||||
* The Ok and Cancel buttons of a message dialog.
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
export type MessageDialogButtonsOkCancel = {
|
||||
/** The Ok button. */
|
||||
ok: string
|
||||
/** The Cancel button. */
|
||||
cancel: string
|
||||
} & BanExcept<'ok' | 'cancel'>
|
||||
|
||||
/**
|
||||
* The Ok button of a message dialog.
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
export type MessageDialogButtonsOk = {
|
||||
/** The Ok button. */
|
||||
ok: string
|
||||
} & BanExcept<'ok'>
|
||||
|
||||
/**
|
||||
* Custom buttons for a message dialog.
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
export type MessageDialogCustomButtons =
|
||||
| MessageDialogButtonsYesNoCancel
|
||||
| MessageDialogButtonsOkCancel
|
||||
| MessageDialogButtonsOk
|
||||
|
||||
/**
|
||||
* The buttons of a message dialog.
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
export type MessageDialogButtons =
|
||||
| MessageDialogDefaultButtons
|
||||
| MessageDialogCustomButtons
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@@ -85,8 +159,58 @@ interface MessageDialogOptions {
|
||||
title?: string
|
||||
/** The kind of the dialog. Defaults to `info`. */
|
||||
kind?: 'info' | 'warning' | 'error'
|
||||
/** The label of the confirm button. */
|
||||
/**
|
||||
* The label of the Ok button.
|
||||
*
|
||||
* @deprecated Use {@linkcode MessageDialogOptions.buttons} instead.
|
||||
*/
|
||||
okLabel?: string
|
||||
/**
|
||||
* The buttons of the dialog.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* // Use system default buttons texts
|
||||
* await message('Hello World!', { buttons: 'Ok' })
|
||||
* await message('Hello World!', { buttons: 'OkCancel' })
|
||||
*
|
||||
* // Or with custom button texts
|
||||
* await message('Hello World!', { buttons: { ok: 'Yes!' } })
|
||||
* await message('Take on the task?', {
|
||||
* buttons: { ok: 'Accept', cancel: 'Cancel' }
|
||||
* })
|
||||
* await message('Show the file content?', {
|
||||
* buttons: { yes: 'Show content', no: 'Show in folder', cancel: 'Cancel' }
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
buttons?: MessageDialogButtons
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal function to convert the buttons to the Rust type.
|
||||
*/
|
||||
function buttonsToRust(buttons: MessageDialogButtons | undefined) {
|
||||
if (buttons === undefined) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
if (typeof buttons === 'string') {
|
||||
return buttons
|
||||
} else if ('ok' in buttons && 'cancel' in buttons) {
|
||||
return { OkCancelCustom: [buttons.ok, buttons.cancel] }
|
||||
} else if ('yes' in buttons && 'no' in buttons && 'cancel' in buttons) {
|
||||
return {
|
||||
YesNoCancelCustom: [buttons.yes, buttons.no, buttons.cancel]
|
||||
}
|
||||
} else if ('ok' in buttons) {
|
||||
return { OkCustom: buttons.ok }
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
interface ConfirmDialogOptions {
|
||||
@@ -202,6 +326,16 @@ async function save(options: SaveDialogOptions = {}): Promise<string | null> {
|
||||
return await invoke('plugin:dialog|save', { options })
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of a message dialog.
|
||||
*
|
||||
* The result is a string if the dialog has custom buttons,
|
||||
* otherwise it is one of the default buttons.
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
export type MessageDialogResult = 'Yes' | 'No' | 'Ok' | 'Cancel' | (string & {})
|
||||
|
||||
/**
|
||||
* Shows a message dialog with an `Ok` button.
|
||||
* @example
|
||||
@@ -222,13 +356,15 @@ async function save(options: SaveDialogOptions = {}): Promise<string | null> {
|
||||
async function message(
|
||||
message: string,
|
||||
options?: string | MessageDialogOptions
|
||||
): Promise<void> {
|
||||
): Promise<MessageDialogResult> {
|
||||
const opts = typeof options === 'string' ? { title: options } : options
|
||||
await invoke('plugin:dialog|message', {
|
||||
|
||||
return invoke<MessageDialogResult>('plugin:dialog|message', {
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
kind: opts?.kind,
|
||||
okButtonLabel: opts?.okLabel?.toString()
|
||||
okButtonLabel: opts?.okLabel?.toString(),
|
||||
buttons: buttonsToRust(opts?.buttons)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ struct MessageDialogOptions: Decodable {
|
||||
var title: String?
|
||||
let message: String
|
||||
var okButtonLabel: String?
|
||||
var noButtonLabel: String?
|
||||
var cancelButtonLabel: String?
|
||||
}
|
||||
|
||||
@@ -200,36 +201,38 @@ class DialogPlugin: Plugin {
|
||||
let alert = UIAlertController(
|
||||
title: args.title, message: args.message, preferredStyle: UIAlertController.Style.alert)
|
||||
|
||||
let cancelButtonLabel = args.cancelButtonLabel ?? ""
|
||||
if !cancelButtonLabel.isEmpty {
|
||||
if let cancelButtonLabel = args.cancelButtonLabel {
|
||||
alert.addAction(
|
||||
UIAlertAction(
|
||||
title: cancelButtonLabel, style: UIAlertAction.Style.default,
|
||||
handler: { (_) -> Void in
|
||||
Logger.error("cancel")
|
||||
|
||||
invoke.resolve([
|
||||
"value": false,
|
||||
"cancelled": false,
|
||||
])
|
||||
}))
|
||||
invoke.resolve(["value": cancelButtonLabel])
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
let okButtonLabel = args.okButtonLabel ?? (cancelButtonLabel.isEmpty ? "OK" : "")
|
||||
if !okButtonLabel.isEmpty {
|
||||
if let noButtonLabel = args.noButtonLabel {
|
||||
alert.addAction(
|
||||
UIAlertAction(
|
||||
title: okButtonLabel, style: UIAlertAction.Style.default,
|
||||
title: noButtonLabel, style: UIAlertAction.Style.default,
|
||||
handler: { (_) -> Void in
|
||||
Logger.error("ok")
|
||||
|
||||
invoke.resolve([
|
||||
"value": true,
|
||||
"cancelled": false,
|
||||
])
|
||||
}))
|
||||
invoke.resolve(["value": noButtonLabel])
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
let okButtonLabel = args.okButtonLabel ?? "Ok"
|
||||
alert.addAction(
|
||||
UIAlertAction(
|
||||
title: okButtonLabel, style: UIAlertAction.Style.default,
|
||||
handler: { (_) -> Void in
|
||||
invoke.resolve(["value": okButtonLabel])
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
manager.viewController?.present(alert, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-dialog",
|
||||
"version": "2.3.3",
|
||||
"version": "2.4.2",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -9,8 +9,8 @@ use tauri::{command, Manager, Runtime, State, Window};
|
||||
use tauri_plugin_fs::FsExt;
|
||||
|
||||
use crate::{
|
||||
Dialog, FileDialogBuilder, FilePath, MessageDialogButtons, MessageDialogKind, Result, CANCEL,
|
||||
NO, OK, YES,
|
||||
Dialog, FileDialogBuilder, FilePath, MessageDialogBuilder, MessageDialogButtons,
|
||||
MessageDialogKind, MessageDialogResult, Result, CANCEL, NO, OK, YES,
|
||||
};
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -248,7 +248,7 @@ fn message_dialog<R: Runtime>(
|
||||
message: String,
|
||||
kind: Option<MessageDialogKind>,
|
||||
buttons: MessageDialogButtons,
|
||||
) -> bool {
|
||||
) -> MessageDialogBuilder<R> {
|
||||
let mut builder = dialog.message(message);
|
||||
|
||||
builder = builder.buttons(buttons);
|
||||
@@ -266,7 +266,7 @@ fn message_dialog<R: Runtime>(
|
||||
builder = builder.kind(kind);
|
||||
}
|
||||
|
||||
builder.blocking_show()
|
||||
builder
|
||||
}
|
||||
|
||||
#[command]
|
||||
@@ -277,19 +277,15 @@ pub(crate) async fn message<R: Runtime>(
|
||||
message: String,
|
||||
kind: Option<MessageDialogKind>,
|
||||
ok_button_label: Option<String>,
|
||||
) -> Result<bool> {
|
||||
Ok(message_dialog(
|
||||
window,
|
||||
dialog,
|
||||
title,
|
||||
message,
|
||||
kind,
|
||||
if let Some(ok_button_label) = ok_button_label {
|
||||
MessageDialogButtons::OkCustom(ok_button_label)
|
||||
} else {
|
||||
MessageDialogButtons::Ok
|
||||
},
|
||||
))
|
||||
buttons: Option<MessageDialogButtons>,
|
||||
) -> Result<MessageDialogResult> {
|
||||
let buttons = buttons.unwrap_or(if let Some(ok_button_label) = ok_button_label {
|
||||
MessageDialogButtons::OkCustom(ok_button_label)
|
||||
} else {
|
||||
MessageDialogButtons::Ok
|
||||
});
|
||||
|
||||
Ok(message_dialog(window, dialog, title, message, kind, buttons).blocking_show_with_result())
|
||||
}
|
||||
|
||||
#[command]
|
||||
@@ -302,7 +298,7 @@ pub(crate) async fn ask<R: Runtime>(
|
||||
yes_button_label: Option<String>,
|
||||
no_button_label: Option<String>,
|
||||
) -> Result<bool> {
|
||||
Ok(message_dialog(
|
||||
let dialog = message_dialog(
|
||||
window,
|
||||
dialog,
|
||||
title,
|
||||
@@ -318,7 +314,9 @@ pub(crate) async fn ask<R: Runtime>(
|
||||
} else {
|
||||
MessageDialogButtons::YesNo
|
||||
},
|
||||
))
|
||||
);
|
||||
|
||||
Ok(dialog.blocking_show())
|
||||
}
|
||||
|
||||
#[command]
|
||||
@@ -331,7 +329,7 @@ pub(crate) async fn confirm<R: Runtime>(
|
||||
ok_button_label: Option<String>,
|
||||
cancel_button_label: Option<String>,
|
||||
) -> Result<bool> {
|
||||
Ok(message_dialog(
|
||||
let dialog = message_dialog(
|
||||
window,
|
||||
dialog,
|
||||
title,
|
||||
@@ -347,5 +345,7 @@ pub(crate) async fn confirm<R: Runtime>(
|
||||
} else {
|
||||
MessageDialogButtons::OkCancel
|
||||
},
|
||||
))
|
||||
);
|
||||
|
||||
Ok(dialog.blocking_show())
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ use rfd::{AsyncFileDialog, AsyncMessageDialog};
|
||||
use serde::de::DeserializeOwned;
|
||||
use tauri::{plugin::PluginApi, AppHandle, Runtime};
|
||||
|
||||
use crate::{models::*, FileDialogBuilder, FilePath, MessageDialogBuilder, OK};
|
||||
use crate::{models::*, FileDialogBuilder, FilePath, MessageDialogBuilder};
|
||||
|
||||
pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
app: &AppHandle<R>,
|
||||
@@ -115,6 +115,10 @@ impl From<MessageDialogButtons> for rfd::MessageButtons {
|
||||
MessageDialogButtons::YesNo => Self::YesNo,
|
||||
MessageDialogButtons::OkCustom(ok) => Self::OkCustom(ok),
|
||||
MessageDialogButtons::OkCancelCustom(ok, cancel) => Self::OkCancelCustom(ok, cancel),
|
||||
MessageDialogButtons::YesNoCancel => Self::YesNoCancel,
|
||||
MessageDialogButtons::YesNoCancelCustom(yes, no, cancel) => {
|
||||
Self::YesNoCancelCustom(yes, no, cancel)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,28 +212,46 @@ pub fn save_file<R: Runtime, F: FnOnce(Option<FilePath>) + Send + 'static>(
|
||||
}
|
||||
|
||||
/// Shows a message dialog
|
||||
pub fn show_message_dialog<R: Runtime, F: FnOnce(bool) + Send + 'static>(
|
||||
pub fn show_message_dialog<R: Runtime, F: FnOnce(MessageDialogResult) + Send + 'static>(
|
||||
dialog: MessageDialogBuilder<R>,
|
||||
f: F,
|
||||
callback: F,
|
||||
) {
|
||||
use rfd::MessageDialogResult;
|
||||
|
||||
let ok_label = match &dialog.buttons {
|
||||
MessageDialogButtons::OkCustom(ok) => Some(ok.clone()),
|
||||
MessageDialogButtons::OkCancelCustom(ok, _) => Some(ok.clone()),
|
||||
_ => None,
|
||||
};
|
||||
let f = move |res| {
|
||||
f(match res {
|
||||
MessageDialogResult::Ok | MessageDialogResult::Yes => true,
|
||||
MessageDialogResult::Custom(s) => ok_label.map_or(s == OK, |ok_label| ok_label == s),
|
||||
_ => false,
|
||||
});
|
||||
};
|
||||
let f = move |res: rfd::MessageDialogResult| callback(res.into());
|
||||
|
||||
let handle = dialog.dialog.app_handle().to_owned();
|
||||
let _ = handle.run_on_main_thread(move || {
|
||||
let buttons = dialog.buttons.clone();
|
||||
let dialog = AsyncMessageDialog::from(dialog).show();
|
||||
std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog)));
|
||||
std::thread::spawn(move || {
|
||||
let result = tauri::async_runtime::block_on(dialog);
|
||||
// on Linux rfd does not return rfd::MessageDialogResult::Custom, so we must map manually
|
||||
let result = match (result, buttons) {
|
||||
(rfd::MessageDialogResult::Ok, MessageDialogButtons::OkCustom(s)) => {
|
||||
rfd::MessageDialogResult::Custom(s)
|
||||
}
|
||||
(
|
||||
rfd::MessageDialogResult::Ok,
|
||||
MessageDialogButtons::OkCancelCustom(ok, _cancel),
|
||||
) => rfd::MessageDialogResult::Custom(ok),
|
||||
(
|
||||
rfd::MessageDialogResult::Cancel,
|
||||
MessageDialogButtons::OkCancelCustom(_ok, cancel),
|
||||
) => rfd::MessageDialogResult::Custom(cancel),
|
||||
(
|
||||
rfd::MessageDialogResult::Yes,
|
||||
MessageDialogButtons::YesNoCancelCustom(yes, _no, _cancel),
|
||||
) => rfd::MessageDialogResult::Custom(yes),
|
||||
(
|
||||
rfd::MessageDialogResult::No,
|
||||
MessageDialogButtons::YesNoCancelCustom(_yes, no, _cancel),
|
||||
) => rfd::MessageDialogResult::Custom(no),
|
||||
(
|
||||
rfd::MessageDialogResult::Cancel,
|
||||
MessageDialogButtons::YesNoCancelCustom(_yes, _no, cancel),
|
||||
) => rfd::MessageDialogResult::Custom(cancel),
|
||||
(result, _) => result,
|
||||
};
|
||||
f(result);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -216,6 +216,7 @@ pub(crate) struct MessageDialogPayload<'a> {
|
||||
message: &'a String,
|
||||
kind: &'a MessageDialogKind,
|
||||
ok_button_label: Option<&'a str>,
|
||||
no_button_label: Option<&'a str>,
|
||||
cancel_button_label: Option<&'a str>,
|
||||
}
|
||||
|
||||
@@ -238,13 +239,17 @@ impl<R: Runtime> MessageDialogBuilder<R> {
|
||||
|
||||
#[cfg(mobile)]
|
||||
pub(crate) fn payload(&self) -> MessageDialogPayload<'_> {
|
||||
let (ok_button_label, cancel_button_label) = match &self.buttons {
|
||||
MessageDialogButtons::Ok => (Some(OK), None),
|
||||
MessageDialogButtons::OkCancel => (Some(OK), Some(CANCEL)),
|
||||
MessageDialogButtons::YesNo => (Some(YES), Some(NO)),
|
||||
MessageDialogButtons::OkCustom(ok) => (Some(ok.as_str()), Some(CANCEL)),
|
||||
let (ok_button_label, no_button_label, cancel_button_label) = match &self.buttons {
|
||||
MessageDialogButtons::Ok => (Some(OK), None, None),
|
||||
MessageDialogButtons::OkCancel => (Some(OK), None, Some(CANCEL)),
|
||||
MessageDialogButtons::YesNo => (Some(YES), Some(NO), None),
|
||||
MessageDialogButtons::YesNoCancel => (Some(YES), Some(NO), Some(CANCEL)),
|
||||
MessageDialogButtons::OkCustom(ok) => (Some(ok.as_str()), None, None),
|
||||
MessageDialogButtons::OkCancelCustom(ok, cancel) => {
|
||||
(Some(ok.as_str()), Some(cancel.as_str()))
|
||||
(Some(ok.as_str()), None, Some(cancel.as_str()))
|
||||
}
|
||||
MessageDialogButtons::YesNoCancelCustom(yes, no, cancel) => {
|
||||
(Some(yes.as_str()), Some(no.as_str()), Some(cancel.as_str()))
|
||||
}
|
||||
};
|
||||
MessageDialogPayload {
|
||||
@@ -252,6 +257,7 @@ impl<R: Runtime> MessageDialogBuilder<R> {
|
||||
message: &self.message,
|
||||
kind: &self.kind,
|
||||
ok_button_label,
|
||||
no_button_label,
|
||||
cancel_button_label,
|
||||
}
|
||||
}
|
||||
@@ -295,16 +301,55 @@ impl<R: Runtime> MessageDialogBuilder<R> {
|
||||
}
|
||||
|
||||
/// Shows a message dialog
|
||||
///
|
||||
/// Returns `true` if the user pressed the OK/Yes button,
|
||||
pub fn show<F: FnOnce(bool) + Send + 'static>(self, f: F) {
|
||||
let ok_label = match &self.buttons {
|
||||
MessageDialogButtons::OkCustom(ok) => Some(ok.clone()),
|
||||
MessageDialogButtons::OkCancelCustom(ok, _) => Some(ok.clone()),
|
||||
MessageDialogButtons::YesNoCancelCustom(yes, _, _) => Some(yes.clone()),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
show_message_dialog(self, move |res| {
|
||||
let sucess = match res {
|
||||
MessageDialogResult::Ok | MessageDialogResult::Yes => true,
|
||||
MessageDialogResult::Custom(s) => {
|
||||
ok_label.map_or(s == OK, |ok_label| ok_label == s)
|
||||
}
|
||||
_ => false,
|
||||
};
|
||||
|
||||
f(sucess)
|
||||
})
|
||||
}
|
||||
|
||||
/// Shows a message dialog and returns the button that was pressed.
|
||||
///
|
||||
/// Returns a [`MessageDialogResult`] enum that indicates which button was pressed.
|
||||
pub fn show_with_result<F: FnOnce(MessageDialogResult) + Send + 'static>(self, f: F) {
|
||||
show_message_dialog(self, f)
|
||||
}
|
||||
|
||||
/// Shows a message dialog.
|
||||
///
|
||||
/// Returns `true` if the user pressed the OK/Yes button,
|
||||
///
|
||||
/// This is a blocking operation,
|
||||
/// and should *NOT* be used when running on the main thread context.
|
||||
pub fn blocking_show(self) -> bool {
|
||||
blocking_fn!(self, show)
|
||||
}
|
||||
|
||||
/// Shows a message dialog and returns the button that was pressed.
|
||||
///
|
||||
/// Returns a [`MessageDialogResult`] enum that indicates which button was pressed.
|
||||
///
|
||||
/// This is a blocking operation,
|
||||
/// and should *NOT* be used when running on the main thread context.
|
||||
pub fn blocking_show_with_result(self) -> MessageDialogResult {
|
||||
blocking_fn!(self, show_with_result)
|
||||
}
|
||||
}
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct Filter {
|
||||
|
||||
@@ -8,7 +8,7 @@ use tauri::{
|
||||
AppHandle, Runtime,
|
||||
};
|
||||
|
||||
use crate::{FileDialogBuilder, FilePath, MessageDialogBuilder};
|
||||
use crate::{FileDialogBuilder, FilePath, MessageDialogBuilder, MessageDialogResult};
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
const PLUGIN_IDENTIFIER: &str = "app.tauri.dialog";
|
||||
@@ -107,13 +107,11 @@ pub fn save_file<R: Runtime, F: FnOnce(Option<FilePath>) + Send + 'static>(
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct ShowMessageDialogResponse {
|
||||
#[allow(dead_code)]
|
||||
cancelled: bool,
|
||||
value: bool,
|
||||
value: String,
|
||||
}
|
||||
|
||||
/// Shows a message dialog
|
||||
pub fn show_message_dialog<R: Runtime, F: FnOnce(bool) + Send + 'static>(
|
||||
pub fn show_message_dialog<R: Runtime, F: FnOnce(MessageDialogResult) + Send + 'static>(
|
||||
dialog: MessageDialogBuilder<R>,
|
||||
f: F,
|
||||
) {
|
||||
@@ -122,6 +120,8 @@ pub fn show_message_dialog<R: Runtime, F: FnOnce(bool) + Send + 'static>(
|
||||
.dialog
|
||||
.0
|
||||
.run_mobile_plugin::<ShowMessageDialogResponse>("showMessageDialog", dialog.payload());
|
||||
f(res.map(|r| r.value).unwrap_or_default())
|
||||
|
||||
let res = res.map(|res| res.value.into());
|
||||
f(res.unwrap_or_default())
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ impl Serialize for MessageDialogKind {
|
||||
|
||||
/// Set of button that will be displayed on the dialog
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Default, Clone)]
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
pub enum MessageDialogButtons {
|
||||
#[default]
|
||||
/// A single `Ok` button with OS default dialog text
|
||||
@@ -61,8 +61,49 @@ pub enum MessageDialogButtons {
|
||||
OkCancel,
|
||||
/// 2 buttons `Yes` and `No` with OS default dialog texts
|
||||
YesNo,
|
||||
/// 3 buttons `Yes`, `No` and `Cancel` with OS default dialog texts
|
||||
YesNoCancel,
|
||||
/// A single `Ok` button with custom text
|
||||
OkCustom(String),
|
||||
/// 2 buttons `Ok` and `Cancel` with custom texts
|
||||
OkCancelCustom(String, String),
|
||||
/// 3 buttons `Yes`, `No` and `Cancel` with custom texts
|
||||
YesNoCancelCustom(String, String, String),
|
||||
}
|
||||
|
||||
/// Result of a message dialog
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub enum MessageDialogResult {
|
||||
Yes,
|
||||
No,
|
||||
Ok,
|
||||
#[default]
|
||||
Cancel,
|
||||
#[serde(untagged)]
|
||||
Custom(String),
|
||||
}
|
||||
|
||||
#[cfg(desktop)]
|
||||
impl From<rfd::MessageDialogResult> for MessageDialogResult {
|
||||
fn from(result: rfd::MessageDialogResult) -> Self {
|
||||
match result {
|
||||
rfd::MessageDialogResult::Yes => Self::Yes,
|
||||
rfd::MessageDialogResult::No => Self::No,
|
||||
rfd::MessageDialogResult::Ok => Self::Ok,
|
||||
rfd::MessageDialogResult::Cancel => Self::Cancel,
|
||||
rfd::MessageDialogResult::Custom(s) => Self::Custom(s),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for MessageDialogResult {
|
||||
fn from(value: String) -> Self {
|
||||
match value.as_str() {
|
||||
"Yes" => Self::Yes,
|
||||
"No" => Self::No,
|
||||
"Ok" => Self::Ok,
|
||||
"Cancel" => Self::Cancel,
|
||||
_ => Self::Custom(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.4.4]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.4.3]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
- [`6b5b1053`](https://github.com/tauri-apps/plugins-workspace/commit/6b5b1053ba8aeb789dd5cb5fb05b7e98f3b8de0b) ([#1939](https://github.com/tauri-apps/plugins-workspace/pull/1939) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Enhance error messages.
|
||||
|
||||
## \[2.4.2]
|
||||
|
||||
- [`4eb36b0f`](https://github.com/tauri-apps/plugins-workspace/commit/4eb36b0ff57acb0bb1b911c583efa3bf2f56aa32) ([#2907](https://github.com/tauri-apps/plugins-workspace/pull/2907) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fixed calling `writeFile` with `data: ReadableStream` throws `Invalid argument`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-fs"
|
||||
version = "2.4.2"
|
||||
version = "2.4.4"
|
||||
description = "Access the file system."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -9,10 +9,6 @@ rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-fs"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "Apps installed via MSI or NSIS in `perMachine` and `both` mode require admin permissions for write access in `$RESOURCES` folder" }
|
||||
linux = { level = "full", notes = "No write access to `$RESOURCES` folder" }
|
||||
|
||||
@@ -5,11 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "com.plugin.fs"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 21
|
||||
targetSdk = 34
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-fs",
|
||||
"version": "2.4.2",
|
||||
"version": "2.4.4",
|
||||
"description": "Access the file system.",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
|
||||
@@ -3748,6 +3748,28 @@ This enables all index or metadata related commands without any pre-configured a
|
||||
|
||||
An empty permission you can use to modify the global scope.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
{
|
||||
"identifier": "read-documents",
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"fs:allow-read",
|
||||
{
|
||||
"identifier": "fs:scope",
|
||||
"allow": [
|
||||
"$APPDATA/documents/**/*"
|
||||
],
|
||||
"deny": [
|
||||
"$APPDATA/documents/secret.txt"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -2005,10 +2005,10 @@
|
||||
"markdownDescription": "This enables all index or metadata related commands without any pre-configured accessible paths."
|
||||
},
|
||||
{
|
||||
"description": "An empty permission you can use to modify the global scope.",
|
||||
"description": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n",
|
||||
"type": "string",
|
||||
"const": "scope",
|
||||
"markdownDescription": "An empty permission you can use to modify the global scope."
|
||||
"markdownDescription": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n"
|
||||
},
|
||||
{
|
||||
"description": "This enables all write related commands without any pre-configured accessible paths.",
|
||||
|
||||
@@ -2,4 +2,27 @@
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope"
|
||||
description = "An empty permission you can use to modify the global scope."
|
||||
description = """
|
||||
An empty permission you can use to modify the global scope.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
{
|
||||
"identifier": "read-documents",
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"fs:allow-read",
|
||||
{
|
||||
"identifier": "fs:scope",
|
||||
"allow": [
|
||||
"$APPDATA/documents/**/*"
|
||||
],
|
||||
"deny": [
|
||||
"$APPDATA/documents/secret.txt"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
"""
|
||||
|
||||
+110
-18
@@ -85,6 +85,7 @@ pub fn create<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<ResourceId> {
|
||||
let resolved_path = resolve_path(
|
||||
"create",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -119,6 +120,7 @@ pub fn open<R: Runtime>(
|
||||
options: Option<OpenOptions>,
|
||||
) -> CommandResult<ResourceId> {
|
||||
let (file, _path) = resolve_file(
|
||||
"open",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -167,6 +169,7 @@ pub async fn copy_file<R: Runtime>(
|
||||
options: Option<CopyFileOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_from_path = resolve_path(
|
||||
"copy-file",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -174,6 +177,7 @@ pub async fn copy_file<R: Runtime>(
|
||||
options.as_ref().and_then(|o| o.from_path_base_dir),
|
||||
)?;
|
||||
let resolved_to_path = resolve_path(
|
||||
"copy-file",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -208,6 +212,7 @@ pub fn mkdir<R: Runtime>(
|
||||
options: Option<MkdirOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_path = resolve_path(
|
||||
"mkdir",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -255,6 +260,7 @@ pub async fn read_dir<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<Vec<DirEntry>> {
|
||||
let resolved_path = resolve_path(
|
||||
"read-dir",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -331,8 +337,8 @@ pub async fn read<R: Runtime>(
|
||||
Ok(tauri::ipc::Response::new(data))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn read_file<R: Runtime>(
|
||||
async fn read_file_inner<R: Runtime>(
|
||||
permission: &str,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
@@ -340,6 +346,7 @@ pub async fn read_file<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<tauri::ipc::Response> {
|
||||
let (mut file, path) = resolve_file(
|
||||
permission,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -367,6 +374,25 @@ pub async fn read_file<R: Runtime>(
|
||||
Ok(tauri::ipc::Response::new(contents))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn read_file<R: Runtime>(
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafeFilePath,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<tauri::ipc::Response> {
|
||||
read_file_inner(
|
||||
"read-file",
|
||||
webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
path,
|
||||
options,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
// TODO, remove in v3, rely on `read_file` command instead
|
||||
#[tauri::command]
|
||||
pub async fn read_text_file<R: Runtime>(
|
||||
@@ -376,7 +402,15 @@ pub async fn read_text_file<R: Runtime>(
|
||||
path: SafeFilePath,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<tauri::ipc::Response> {
|
||||
read_file(webview, global_scope, command_scope, path, options).await
|
||||
read_file_inner(
|
||||
"read-text-file",
|
||||
webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
path,
|
||||
options,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -388,6 +422,7 @@ pub fn read_text_file_lines<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<ResourceId> {
|
||||
let resolved_path = resolve_path(
|
||||
"read-text-file-lines",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -452,6 +487,7 @@ pub fn remove<R: Runtime>(
|
||||
options: Option<RemoveOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_path = resolve_path(
|
||||
"remove",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -521,6 +557,7 @@ pub fn rename<R: Runtime>(
|
||||
options: Option<RenameOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_old_path = resolve_path(
|
||||
"rename",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -528,6 +565,7 @@ pub fn rename<R: Runtime>(
|
||||
options.as_ref().and_then(|o| o.old_path_base_dir),
|
||||
)?;
|
||||
let resolved_new_path = resolve_path(
|
||||
"rename",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -575,6 +613,7 @@ pub async fn seek<R: Runtime>(
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
fn get_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::Metadata>>(
|
||||
permission: &str,
|
||||
metadata_fn: F,
|
||||
webview: &Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
@@ -585,6 +624,7 @@ fn get_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::Meta
|
||||
match path {
|
||||
SafeFilePath::Url(url) => {
|
||||
let (file, path) = resolve_file(
|
||||
permission,
|
||||
webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
@@ -606,6 +646,7 @@ fn get_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::Meta
|
||||
})
|
||||
}
|
||||
SafeFilePath::Path(p) => get_fs_metadata(
|
||||
permission,
|
||||
metadata_fn,
|
||||
webview,
|
||||
global_scope,
|
||||
@@ -618,6 +659,7 @@ fn get_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::Meta
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
fn get_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::Metadata>>(
|
||||
permission: &str,
|
||||
metadata_fn: F,
|
||||
webview: &Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
@@ -626,6 +668,7 @@ fn get_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::Meta
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<std::fs::Metadata> {
|
||||
get_fs_metadata(
|
||||
permission,
|
||||
metadata_fn,
|
||||
webview,
|
||||
global_scope,
|
||||
@@ -636,6 +679,7 @@ fn get_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::Meta
|
||||
}
|
||||
|
||||
fn get_fs_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::Metadata>>(
|
||||
permission: &str,
|
||||
metadata_fn: F,
|
||||
webview: &Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
@@ -644,6 +688,7 @@ fn get_fs_metadata<R: Runtime, F: FnOnce(&PathBuf) -> std::io::Result<std::fs::M
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<std::fs::Metadata> {
|
||||
let resolved_path = resolve_path(
|
||||
permission,
|
||||
webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
@@ -668,6 +713,7 @@ pub fn stat<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<FileInfo> {
|
||||
let metadata = get_metadata(
|
||||
"stat",
|
||||
|p| std::fs::metadata(p),
|
||||
&webview,
|
||||
&global_scope,
|
||||
@@ -688,6 +734,7 @@ pub fn lstat<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<FileInfo> {
|
||||
let metadata = get_metadata(
|
||||
"lstat",
|
||||
|p| std::fs::symlink_metadata(p),
|
||||
&webview,
|
||||
&global_scope,
|
||||
@@ -716,6 +763,7 @@ pub async fn truncate<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_path = resolve_path(
|
||||
"truncate",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -784,23 +832,13 @@ fn default_create_value() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn write_file<R: Runtime>(
|
||||
async fn write_file_inner<R: Runtime>(
|
||||
permission: &str,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
request: tauri::ipc::Request<'_>,
|
||||
) -> CommandResult<()> {
|
||||
let data = match request.body() {
|
||||
tauri::ipc::InvokeBody::Raw(data) => Cow::Borrowed(data),
|
||||
tauri::ipc::InvokeBody::Json(serde_json::Value::Array(data)) => Cow::Owned(
|
||||
data.iter()
|
||||
.flat_map(|v| v.as_number().and_then(|v| v.as_u64().map(|v| v as u8)))
|
||||
.collect(),
|
||||
),
|
||||
_ => return Err(anyhow::anyhow!("unexpected invoke body").into()),
|
||||
};
|
||||
|
||||
let path = request
|
||||
.headers()
|
||||
.get("path")
|
||||
@@ -811,6 +849,7 @@ pub async fn write_file<R: Runtime>(
|
||||
.map_err(|_| anyhow::anyhow!("path is not a valid UTF-8").into())
|
||||
})
|
||||
.and_then(|p| SafeFilePath::from_str(&p).map_err(CommandError::from))?;
|
||||
|
||||
let options: Option<WriteFileOptions> = request
|
||||
.headers()
|
||||
.get("options")
|
||||
@@ -818,6 +857,7 @@ pub async fn write_file<R: Runtime>(
|
||||
.and_then(|opts| serde_json::from_str(opts).ok());
|
||||
|
||||
let (mut file, path) = resolve_file(
|
||||
permission,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -853,6 +893,16 @@ pub async fn write_file<R: Runtime>(
|
||||
},
|
||||
)?;
|
||||
|
||||
let data = match request.body() {
|
||||
tauri::ipc::InvokeBody::Raw(data) => Cow::Borrowed(data),
|
||||
tauri::ipc::InvokeBody::Json(serde_json::Value::Array(data)) => Cow::Owned(
|
||||
data.iter()
|
||||
.flat_map(|v| v.as_number().and_then(|v| v.as_u64().map(|v| v as u8)))
|
||||
.collect(),
|
||||
),
|
||||
_ => return Err(anyhow::anyhow!("unexpected invoke body").into()),
|
||||
};
|
||||
|
||||
file.write_all(&data)
|
||||
.map_err(|e| {
|
||||
format!(
|
||||
@@ -863,6 +913,16 @@ pub async fn write_file<R: Runtime>(
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn write_file<R: Runtime>(
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
request: tauri::ipc::Request<'_>,
|
||||
) -> CommandResult<()> {
|
||||
write_file_inner("write-file", webview, global_scope, command_scope, request).await
|
||||
}
|
||||
|
||||
// TODO, remove in v3, rely on `write_file` command instead
|
||||
#[tauri::command]
|
||||
pub async fn write_text_file<R: Runtime>(
|
||||
@@ -871,7 +931,14 @@ pub async fn write_text_file<R: Runtime>(
|
||||
command_scope: CommandScope<Entry>,
|
||||
request: tauri::ipc::Request<'_>,
|
||||
) -> CommandResult<()> {
|
||||
write_file(webview, global_scope, command_scope, request).await
|
||||
write_file_inner(
|
||||
"write-text-file",
|
||||
webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
request,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -883,6 +950,7 @@ pub fn exists<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<bool> {
|
||||
let resolved_path = resolve_path(
|
||||
"exists",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -901,6 +969,7 @@ pub async fn size<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<u64> {
|
||||
let resolved_path = resolve_path(
|
||||
"size",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
@@ -943,16 +1012,25 @@ fn get_dir_size(path: &PathBuf) -> CommandResult<u64> {
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
pub fn resolve_file<R: Runtime>(
|
||||
permission: &str,
|
||||
webview: &Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
command_scope: &CommandScope<Entry>,
|
||||
path: SafeFilePath,
|
||||
open_options: OpenOptions,
|
||||
) -> CommandResult<(File, PathBuf)> {
|
||||
resolve_file_in_fs(webview, global_scope, command_scope, path, open_options)
|
||||
resolve_file_in_fs(
|
||||
permission,
|
||||
webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
path,
|
||||
open_options,
|
||||
)
|
||||
}
|
||||
|
||||
fn resolve_file_in_fs<R: Runtime>(
|
||||
permission: &str,
|
||||
webview: &Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
command_scope: &CommandScope<Entry>,
|
||||
@@ -960,6 +1038,7 @@ fn resolve_file_in_fs<R: Runtime>(
|
||||
open_options: OpenOptions,
|
||||
) -> CommandResult<(File, PathBuf)> {
|
||||
let path = resolve_path(
|
||||
permission,
|
||||
webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
@@ -980,6 +1059,7 @@ fn resolve_file_in_fs<R: Runtime>(
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
pub fn resolve_file<R: Runtime>(
|
||||
permission: &str,
|
||||
webview: &Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
command_scope: &CommandScope<Entry>,
|
||||
@@ -997,6 +1077,7 @@ pub fn resolve_file<R: Runtime>(
|
||||
Ok((file, path))
|
||||
}
|
||||
SafeFilePath::Path(path) => resolve_file_in_fs(
|
||||
permission,
|
||||
webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
@@ -1007,6 +1088,7 @@ pub fn resolve_file<R: Runtime>(
|
||||
}
|
||||
|
||||
pub fn resolve_path<R: Runtime>(
|
||||
permission: &str,
|
||||
webview: &Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
command_scope: &CommandScope<Entry>,
|
||||
@@ -1052,7 +1134,17 @@ pub fn resolve_path<R: Runtime>(
|
||||
if fs_scope.scope.is_allowed(&path) || scope.is_allowed(&path) {
|
||||
Ok(path)
|
||||
} else {
|
||||
Err(CommandError::Plugin(Error::PathForbidden(path)))
|
||||
#[cfg(not(debug_assertions))]
|
||||
return Err(CommandError::Plugin(Error::PathForbidden(path)));
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
Err(
|
||||
anyhow::anyhow!(
|
||||
"forbidden path: {}, maybe it is not allowed on the scope for `allow-{permission}` permission in your capability file",
|
||||
path.display()
|
||||
)
|
||||
)
|
||||
.map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ impl<R: Runtime> Fs<R> {
|
||||
std::fs::File::from_raw_fd(fd)
|
||||
})
|
||||
} else {
|
||||
todo!()
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ pub fn watch<R: Runtime>(
|
||||
.into_iter()
|
||||
.map(|path| {
|
||||
resolve_path(
|
||||
"watch",
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.3.2]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.3.1]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
- [`e933acb0`](https://github.com/tauri-apps/plugins-workspace/commit/e933acb0044b4d49053eae6492b542351160e66a) ([#3010](https://github.com/tauri-apps/plugins-workspace/pull/3010) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, use the `timeout` value for `setMinUpdateIntervalMillis`, `setMaxUpdateDelayMillis` and `setIntervalMillis` instead of just `minUpdateInterval`.
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "tauri-plugin-geolocation"
|
||||
description = "Get and track the device's current position"
|
||||
version = "2.3.0"
|
||||
version = "2.3.2"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -9,8 +9,6 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-geolocation"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.geolocation"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -91,11 +91,9 @@ public class Geolocation(private val context: Context) {
|
||||
val lowPrio = if (networkEnabled) Priority.PRIORITY_BALANCED_POWER_ACCURACY else Priority.PRIORITY_LOW_POWER
|
||||
val prio = if (enableHighAccuracy) Priority.PRIORITY_HIGH_ACCURACY else lowPrio
|
||||
|
||||
Logger.error(prio.toString())
|
||||
|
||||
val locationRequest = LocationRequest.Builder(10000)
|
||||
val locationRequest = LocationRequest.Builder(timeout)
|
||||
.setMaxUpdateDelayMillis(timeout)
|
||||
.setMinUpdateIntervalMillis(5000)
|
||||
.setMinUpdateIntervalMillis(timeout)
|
||||
.setPriority(prio)
|
||||
.build()
|
||||
|
||||
@@ -145,4 +143,4 @@ public class Geolocation(private val context: Context) {
|
||||
|
||||
return lastLoc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-geolocation",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.2",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.3.1]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-global-shortcut"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
description = "Register global hotkeys listeners on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -9,10 +9,6 @@ rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-global-shortcut"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-global-shortcut",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.3.2]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.3.1]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "tauri-plugin-haptics"
|
||||
description = "Haptic feedback and vibrations on Android and iOS"
|
||||
version = "2.3.0"
|
||||
version = "2.3.2"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -9,8 +9,6 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-haptics"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.haptics"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-haptics",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.2",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.5.4]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs-js@2.4.4`
|
||||
|
||||
## \[2.5.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs-js@2.4.3`
|
||||
|
||||
## \[2.5.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-http"
|
||||
version = "2.5.2"
|
||||
version = "2.5.4"
|
||||
description = "Access an HTTP client written in Rust."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -9,10 +9,6 @@ rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-http"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
@@ -34,7 +30,7 @@ serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tokio = { version = "1", features = ["sync", "macros"] }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.4.2" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.4.4" }
|
||||
urlpattern = "0.3"
|
||||
regex = "1"
|
||||
http = "1"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-http",
|
||||
"version": "2.5.2",
|
||||
"version": "2.5.4",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.3.1]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-localhost"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
description = "Expose your apps assets through a localhost server instead of the default custom protocol."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -8,10 +8,6 @@ edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.7.1]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.7.0]
|
||||
|
||||
- [`625bb1c0`](https://github.com/tauri-apps/plugins-workspace/commit/625bb1c0965394b88522643731f78ccbcca84add) ([#2965](https://github.com/tauri-apps/plugins-workspace/pull/2965) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Re-export the log crate.
|
||||
|
||||
## \[2.6.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-log"
|
||||
version = "2.6.0"
|
||||
version = "2.7.1"
|
||||
description = "Configurable logging for your Tauri app."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -9,10 +9,6 @@ rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-log"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-log",
|
||||
"version": "2.6.0",
|
||||
"version": "2.7.1",
|
||||
"description": "Configurable logging for your Tauri app.",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use log::RecordBuilder;
|
||||
|
||||
use crate::{LogLevel, WEBVIEW_TARGET};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn log(
|
||||
level: LogLevel,
|
||||
message: String,
|
||||
location: Option<&str>,
|
||||
file: Option<&str>,
|
||||
line: Option<u32>,
|
||||
key_values: Option<HashMap<String, String>>,
|
||||
) {
|
||||
let level = log::Level::from(level);
|
||||
|
||||
let target = if let Some(location) = location {
|
||||
format!("{WEBVIEW_TARGET}:{location}")
|
||||
} else {
|
||||
WEBVIEW_TARGET.to_string()
|
||||
};
|
||||
|
||||
let mut builder = RecordBuilder::new();
|
||||
builder.level(level).target(&target).file(file).line(line);
|
||||
|
||||
let key_values = key_values.unwrap_or_default();
|
||||
let mut kv = HashMap::new();
|
||||
for (k, v) in key_values.iter() {
|
||||
kv.insert(k.as_str(), v.as_str());
|
||||
}
|
||||
builder.key_values(&kv);
|
||||
#[cfg(feature = "tracing")]
|
||||
emit_trace(level, &message, location, file, line, &kv);
|
||||
|
||||
log::logger().log(&builder.args(format_args!("{message}")).build());
|
||||
}
|
||||
|
||||
// Target becomes default and location is added as a parameter
|
||||
#[cfg(feature = "tracing")]
|
||||
fn emit_trace(
|
||||
level: log::Level,
|
||||
message: &String,
|
||||
location: Option<&str>,
|
||||
file: Option<&str>,
|
||||
line: Option<u32>,
|
||||
kv: &HashMap<&str, &str>,
|
||||
) {
|
||||
macro_rules! emit_event {
|
||||
($level:expr) => {
|
||||
tracing::event!(
|
||||
target: WEBVIEW_TARGET,
|
||||
$level,
|
||||
message = %message,
|
||||
location = location,
|
||||
file,
|
||||
line,
|
||||
?kv
|
||||
)
|
||||
};
|
||||
}
|
||||
match level {
|
||||
log::Level::Error => emit_event!(tracing::Level::ERROR),
|
||||
log::Level::Warn => emit_event!(tracing::Level::WARN),
|
||||
log::Level::Info => emit_event!(tracing::Level::INFO),
|
||||
log::Level::Debug => emit_event!(tracing::Level::DEBUG),
|
||||
log::Level::Trace => emit_event!(tracing::Level::TRACE),
|
||||
}
|
||||
}
|
||||
+4
-67
@@ -10,12 +10,10 @@
|
||||
)]
|
||||
|
||||
use fern::{Filter, FormatCallback};
|
||||
use log::{logger, RecordBuilder};
|
||||
use log::{LevelFilter, Record};
|
||||
use serde::Serialize;
|
||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
use std::borrow::Cow;
|
||||
use std::collections::HashMap;
|
||||
use std::{
|
||||
fmt::Arguments,
|
||||
fs::{self, File},
|
||||
@@ -30,6 +28,9 @@ use tauri::{AppHandle, Emitter};
|
||||
use time::{macros::format_description, OffsetDateTime};
|
||||
|
||||
pub use fern;
|
||||
pub use log;
|
||||
|
||||
mod commands;
|
||||
|
||||
pub const WEBVIEW_TARGET: &str = "webview";
|
||||
|
||||
@@ -206,70 +207,6 @@ impl Target {
|
||||
}
|
||||
}
|
||||
|
||||
// Target becomes default and location is added as a parameter
|
||||
#[cfg(feature = "tracing")]
|
||||
fn emit_trace(
|
||||
level: log::Level,
|
||||
message: &String,
|
||||
location: Option<&str>,
|
||||
file: Option<&str>,
|
||||
line: Option<u32>,
|
||||
kv: &HashMap<&str, &str>,
|
||||
) {
|
||||
macro_rules! emit_event {
|
||||
($level:expr) => {
|
||||
tracing::event!(
|
||||
target: WEBVIEW_TARGET,
|
||||
$level,
|
||||
message = %message,
|
||||
location = location,
|
||||
file,
|
||||
line,
|
||||
?kv
|
||||
)
|
||||
};
|
||||
}
|
||||
match level {
|
||||
log::Level::Error => emit_event!(tracing::Level::ERROR),
|
||||
log::Level::Warn => emit_event!(tracing::Level::WARN),
|
||||
log::Level::Info => emit_event!(tracing::Level::INFO),
|
||||
log::Level::Debug => emit_event!(tracing::Level::DEBUG),
|
||||
log::Level::Trace => emit_event!(tracing::Level::TRACE),
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn log(
|
||||
level: LogLevel,
|
||||
message: String,
|
||||
location: Option<&str>,
|
||||
file: Option<&str>,
|
||||
line: Option<u32>,
|
||||
key_values: Option<HashMap<String, String>>,
|
||||
) {
|
||||
let level = log::Level::from(level);
|
||||
|
||||
let target = if let Some(location) = location {
|
||||
format!("{WEBVIEW_TARGET}:{location}")
|
||||
} else {
|
||||
WEBVIEW_TARGET.to_string()
|
||||
};
|
||||
|
||||
let mut builder = RecordBuilder::new();
|
||||
builder.level(level).target(&target).file(file).line(line);
|
||||
|
||||
let key_values = key_values.unwrap_or_default();
|
||||
let mut kv = HashMap::new();
|
||||
for (k, v) in key_values.iter() {
|
||||
kv.insert(k.as_str(), v.as_str());
|
||||
}
|
||||
builder.key_values(&kv);
|
||||
#[cfg(feature = "tracing")]
|
||||
emit_trace(level, &message, location, file, line, &kv);
|
||||
|
||||
logger().log(&builder.args(format_args!("{message}")).build());
|
||||
}
|
||||
|
||||
pub struct Builder {
|
||||
dispatch: fern::Dispatch,
|
||||
rotation_strategy: RotationStrategy,
|
||||
@@ -528,7 +465,7 @@ impl Builder {
|
||||
}
|
||||
|
||||
fn plugin_builder<R: Runtime>() -> plugin::Builder<R> {
|
||||
plugin::Builder::new("log").invoke_handler(tauri::generate_handler![log])
|
||||
plugin::Builder::new("log").invoke_handler(tauri::generate_handler![commands::log])
|
||||
}
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.3.3]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.3.2]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
|
||||
## \[2.3.1]
|
||||
|
||||
- [`fe23a5e0`](https://github.com/tauri-apps/plugins-workspace/commit/fe23a5e01399a6ad61426bf8a94a6bb97227cf88) ([#2885](https://github.com/tauri-apps/plugins-workspace/pull/2885) by [@zaphim12](https://github.com/tauri-apps/plugins-workspace/../../zaphim12)) On iOS, the reader session will now get closed properly on errors, preventing dangling invalid sessions that could prevent subsequent write attempts.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-nfc"
|
||||
version = "2.3.1"
|
||||
version = "2.3.3"
|
||||
description = "Read and write NFC tags on Android and iOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -9,8 +9,6 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-nfc"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.nfc"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-nfc",
|
||||
"version": "2.3.1",
|
||||
"version": "2.3.3",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.3.3]
|
||||
|
||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||
|
||||
## \[2.3.2]
|
||||
|
||||
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
|
||||
|
||||
## \[2.3.1]
|
||||
|
||||
- [`8abb31ee`](https://github.com/tauri-apps/plugins-workspace/commit/8abb31ee59c68197102c0aa699d690b34646ec3c) ([#2905](https://github.com/tauri-apps/plugins-workspace/pull/2905) by [@ChristianPavilonis](https://github.com/tauri-apps/plugins-workspace/../../ChristianPavilonis)) Fix notification scheduling on iOS.
|
||||
- [`2d03e2ea`](https://github.com/tauri-apps/plugins-workspace/commit/2d03e2eac2c19ad997d81d23836ab6a219252ffb) ([#2678](https://github.com/tauri-apps/plugins-workspace/pull/2678) by [@Keerthi421](https://github.com/tauri-apps/plugins-workspace/../../Keerthi421)) Added sound support for desktop notifications which was previously only available on mobile platforms.
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-notification"
|
||||
version = "2.3.0"
|
||||
version = "2.3.3"
|
||||
description = "Send desktop and mobile notifications on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -10,8 +10,6 @@ repository = { workspace = true }
|
||||
links = "tauri-plugin-notification"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
|
||||
@@ -95,6 +95,45 @@ export async function enqueueNotification(title, body) {
|
||||
}
|
||||
```
|
||||
|
||||
### Notification with Sound
|
||||
|
||||
You can add sound to your notifications on all platforms (desktop and mobile):
|
||||
|
||||
```javascript
|
||||
import { sendNotification } from '@tauri-apps/plugin-notification'
|
||||
import { platform } from '@tauri-apps/api/os'
|
||||
|
||||
// Basic notification with sound
|
||||
sendNotification({
|
||||
title: 'New Message',
|
||||
body: 'You have a new message',
|
||||
sound: 'notification.wav' // Path to sound file
|
||||
})
|
||||
|
||||
// Platform-specific sounds
|
||||
async function sendPlatformSpecificNotification() {
|
||||
const platformName = platform()
|
||||
|
||||
let soundPath
|
||||
if (platformName === 'darwin') {
|
||||
// On macOS: use system sounds or sound files in the app bundle
|
||||
soundPath = 'Ping' // macOS system sound
|
||||
} else if (platformName === 'linux') {
|
||||
// On Linux: use XDG theme sounds or file paths
|
||||
soundPath = 'message-new-instant' // XDG theme sound
|
||||
} else {
|
||||
// On Windows: use file paths
|
||||
soundPath = 'notification.wav'
|
||||
}
|
||||
|
||||
sendNotification({
|
||||
title: 'Platform-specific Notification',
|
||||
body: 'This notification uses platform-specific sound',
|
||||
sound: soundPath
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
|
||||
|
||||
@@ -5,10 +5,10 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "app.tauri.notification"
|
||||
compileSdk = 34
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 24
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function n(i,n,t,e){if("function"==typeof n?i!==n||!e:!n.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?e:"a"===t?e.call(i):e?e.value:n.get(i)}function t(i,n,t,e,a){if("function"==typeof n||!n.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(i,t),t}var e,a,o,r;"function"==typeof SuppressedError&&SuppressedError;const s="__TAURI_TO_IPC_KEY__";class c{constructor(i){e.set(this,void 0),a.set(this,0),o.set(this,[]),r.set(this,void 0),t(this,e,i||(()=>{})),this.id=function(i,n=!1){return window.__TAURI_INTERNALS__.transformCallback(i,n)}((i=>{const s=i.index;if("end"in i)return void(s==n(this,a,"f")?this.cleanupCallback():t(this,r,s));const c=i.message;if(s==n(this,a,"f")){for(n(this,e,"f").call(this,c),t(this,a,n(this,a,"f")+1);n(this,a,"f")in n(this,o,"f");){const i=n(this,o,"f")[n(this,a,"f")];n(this,e,"f").call(this,i),delete n(this,o,"f")[n(this,a,"f")],t(this,a,n(this,a,"f")+1)}n(this,a,"f")===n(this,r,"f")&&this.cleanupCallback()}else n(this,o,"f")[s]=c}))}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(i){t(this,e,i)}get onmessage(){return n(this,e,"f")}[(e=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[s]()}}class l{constructor(i,n,t){this.plugin=i,this.event=n,this.channelId=t}async unregister(){return f(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function u(i,n,t){const e=new c(t);return f(`plugin:${i}|registerListener`,{event:n,handler:e}).then((()=>new l(i,n,e.id)))}async function f(i,n={},t){return window.__TAURI_INTERNALS__.invoke(i,n,t)}var h,d,w;i.ScheduleEvery=void 0,(h=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",h.Month="month",h.TwoWeeks="twoWeeks",h.Week="week",h.Day="day",h.Hour="hour",h.Minute="minute",h.Second="second";return i.Importance=void 0,(d=i.Importance||(i.Importance={}))[d.None=0]="None",d[d.Min=1]="Min",d[d.Low=2]="Low",d[d.Default=3]="Default",d[d.High=4]="High",i.Visibility=void 0,(w=i.Visibility||(i.Visibility={}))[w.Secret=-1]="Secret",w[w.Private=0]="Private",w[w.Public=1]="Public",i.Schedule=class{static at(i,n=!1,t=!1){return{at:{date:i,repeating:n,allowWhileIdle:t},interval:void 0,every:void 0}}static interval(i,n=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:n},every:void 0}}static every(i,n,t=!1){return{at:void 0,interval:void 0,every:{interval:i,count:n,allowWhileIdle:t}}}},i.active=async function(){return await f("plugin:notification|get_active")},i.cancel=async function(i){await f("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await f("plugin:notification|cancel")},i.channels=async function(){return await f("plugin:notification|listChannels")},i.createChannel=async function(i){await f("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await f("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await u("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await u("notification","notification",i)},i.pending=async function(){return await f("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await f("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await f("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await f("plugin:notification|remove_active")},i.removeChannel=async function(i){await f("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function n(i,n,t,e){if("function"==typeof n?i!==n||!e:!n.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?e:"a"===t?e.call(i):e?e.value:n.get(i)}function t(i,n,t,e,a){if("function"==typeof n||!n.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(i,t),t}var e,a,o,r;"function"==typeof SuppressedError&&SuppressedError;const s="__TAURI_TO_IPC_KEY__";class c{constructor(i){e.set(this,void 0),a.set(this,0),o.set(this,[]),r.set(this,void 0),t(this,e,i||(()=>{})),this.id=function(i,n=!1){return window.__TAURI_INTERNALS__.transformCallback(i,n)}((i=>{const s=i.index;if("end"in i)return void(s==n(this,a,"f")?this.cleanupCallback():t(this,r,s));const c=i.message;if(s==n(this,a,"f")){for(n(this,e,"f").call(this,c),t(this,a,n(this,a,"f")+1);n(this,a,"f")in n(this,o,"f");){const i=n(this,o,"f")[n(this,a,"f")];n(this,e,"f").call(this,i),delete n(this,o,"f")[n(this,a,"f")],t(this,a,n(this,a,"f")+1)}n(this,a,"f")===n(this,r,"f")&&this.cleanupCallback()}else n(this,o,"f")[s]=c}))}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(i){t(this,e,i)}get onmessage(){return n(this,e,"f")}[(e=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[s]()}}class l{constructor(i,n,t){this.plugin=i,this.event=n,this.channelId=t}async unregister(){return f(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function u(i,n,t){const e=new c(t);try{return f(`plugin:${i}|register_listener`,{event:n,handler:e}).then((()=>new l(i,n,e.id)))}catch{return f(`plugin:${i}|registerListener`,{event:n,handler:e}).then((()=>new l(i,n,e.id)))}}async function f(i,n={},t){return window.__TAURI_INTERNALS__.invoke(i,n,t)}var h,d,w;i.ScheduleEvery=void 0,(h=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",h.Month="month",h.TwoWeeks="twoWeeks",h.Week="week",h.Day="day",h.Hour="hour",h.Minute="minute",h.Second="second";return i.Importance=void 0,(d=i.Importance||(i.Importance={}))[d.None=0]="None",d[d.Min=1]="Min",d[d.Low=2]="Low",d[d.Default=3]="Default",d[d.High=4]="High",i.Visibility=void 0,(w=i.Visibility||(i.Visibility={}))[w.Secret=-1]="Secret",w[w.Private=0]="Private",w[w.Public=1]="Public",i.Schedule=class{static at(i,n=!1,t=!1){return{at:{date:i,repeating:n,allowWhileIdle:t},interval:void 0,every:void 0}}static interval(i,n=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:n},every:void 0}}static every(i,n,t=!1){return{at:void 0,interval:void 0,every:{interval:i,count:n,allowWhileIdle:t}}}},i.active=async function(){return await f("plugin:notification|get_active")},i.cancel=async function(i){await f("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await f("plugin:notification|cancel")},i.channels=async function(){return await f("plugin:notification|listChannels")},i.createChannel=async function(i){await f("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await f("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await u("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await u("notification","notification",i)},i.pending=async function(){return await f("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await f("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await f("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await f("plugin:notification|remove_active")},i.removeChannel=async function(i){await f("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})}
|
||||
|
||||
@@ -71,7 +71,13 @@ interface Options {
|
||||
*/
|
||||
groupSummary?: boolean
|
||||
/**
|
||||
* The sound resource name. Only available on mobile.
|
||||
* The sound resource name or file path for the notification.
|
||||
*
|
||||
* Platform specific behavior:
|
||||
* - On macOS: use system sounds (e.g., "Ping", "Blow") or sound files in the app bundle
|
||||
* - On Linux: use XDG theme sounds (e.g., "message-new-instant") or file paths
|
||||
* - On Windows: use file paths to sound files (.wav format)
|
||||
* - On Mobile: use resource names
|
||||
*/
|
||||
sound?: string
|
||||
/**
|
||||
|
||||
@@ -38,10 +38,17 @@ func makeNotificationContent(_ notification: Notification) throws -> UNNotificat
|
||||
arguments: nil)
|
||||
}
|
||||
|
||||
content.userInfo = [
|
||||
"__EXTRA__": notification.extra as Any,
|
||||
"__SCHEDULE__": notification.schedule as Any,
|
||||
]
|
||||
var userInfo: [String: Any] = [:]
|
||||
|
||||
if let extra = notification.extra {
|
||||
userInfo["__EXTRA__"] = extra
|
||||
}
|
||||
|
||||
if let schedule = notification.schedule {
|
||||
userInfo["__SCHEDULE__"] = scheduleToDictionary(schedule)
|
||||
}
|
||||
|
||||
content.userInfo = userInfo
|
||||
|
||||
if let actionTypeId = notification.actionTypeId {
|
||||
content.categoryIdentifier = actionTypeId
|
||||
@@ -66,6 +73,56 @@ func makeNotificationContent(_ notification: Notification) throws -> UNNotificat
|
||||
return content
|
||||
}
|
||||
|
||||
func scheduleToDictionary(_ schedule: NotificationSchedule) -> [String: Any] {
|
||||
switch schedule {
|
||||
case .at(let date, let repeating):
|
||||
return [
|
||||
"type": "at",
|
||||
"date": date,
|
||||
"repeating": repeating
|
||||
]
|
||||
case .interval(let interval):
|
||||
return [
|
||||
"type": "interval",
|
||||
"interval": scheduleIntervalToDictionary(interval)
|
||||
]
|
||||
case .every(let interval, let count):
|
||||
return [
|
||||
"type": "every",
|
||||
"interval": interval.rawValue,
|
||||
"count": count
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
func scheduleIntervalToDictionary(_ interval: ScheduleInterval) -> [String: Any] {
|
||||
var dict: [String: Any] = [:]
|
||||
|
||||
if let year = interval.year {
|
||||
dict["year"] = year
|
||||
}
|
||||
if let month = interval.month {
|
||||
dict["month"] = month
|
||||
}
|
||||
if let day = interval.day {
|
||||
dict["day"] = day
|
||||
}
|
||||
if let weekday = interval.weekday {
|
||||
dict["weekday"] = weekday
|
||||
}
|
||||
if let hour = interval.hour {
|
||||
dict["hour"] = hour
|
||||
}
|
||||
if let minute = interval.minute {
|
||||
dict["minute"] = minute
|
||||
}
|
||||
if let second = interval.second {
|
||||
dict["second"] = second
|
||||
}
|
||||
|
||||
return dict
|
||||
}
|
||||
|
||||
func makeAttachments(_ attachments: [NotificationAttachment]) throws -> [UNNotificationAttachment] {
|
||||
var createdAttachments = [UNNotificationAttachment]()
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-notification",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.3",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user