mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-12 14:17:48 +02:00
Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb62d03f73 | |||
| 7e5e34420b | |||
| f12d35609a | |||
| 44273b9889 | |||
| 2f7e32b5e0 | |||
| 30bcf5dcc2 | |||
| 68579934c9 | |||
| 04459afbb6 | |||
| 3b2bd3065d | |||
| f930505de4 | |||
| 34319bd977 | |||
| 34737186fe | |||
| 4bd1f15bb9 | |||
| aabc4d3a24 | |||
| fc9b189e83 | |||
| b7ff3a6bdb | |||
| 04a0aea0ab | |||
| e564e2aa91 | |||
| 118f6b4334 | |||
| fd0a52aa86 | |||
| 52e3bdab26 | |||
| dd09e3c3f4 | |||
| 2797954799 | |||
| 025210be28 | |||
| 221f50f53b | |||
| 6bf1bd8d44 | |||
| 41fe9053a0 | |||
| 27bb5d9a27 | |||
| 3168e17603 | |||
| dd514e7a88 | |||
| 6e142b4230 | |||
| fd1c7c8dbb | |||
| 59c63f31cc | |||
| 3cbb55aa7b | |||
| 60765694f5 | |||
| fd75401aee | |||
| ca34972266 | |||
| 179184326b | |||
| d8efd3cd20 | |||
| 5d39ddcf22 | |||
| 2050a3bea2 | |||
| c078f57a09 | |||
| dc5721ac13 | |||
| 1d9741b52b | |||
| 7a37355e17 | |||
| 5cbd593e76 | |||
| f7600b5fff | |||
| fb85e5dd76 | |||
| 6f3f66794a | |||
| 79d6e19c4b | |||
| aebd4f6185 | |||
| 341a5320c3 | |||
| cc03ccf5e0 | |||
| 009299ebec | |||
| 204e5aacad | |||
| 8a45c35160 | |||
| ebf821afd1 | |||
| 984110a978 | |||
| 2b898f0786 | |||
| b2269333e3 | |||
| 41afcae399 | |||
| 9291e4d2ca | |||
| 3715f3c9a6 |
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"cli": patch
|
||||
---
|
||||
|
||||
Expose `Matches`, `SubcommandMatches` and `ArgData` structs.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"deep-link": patch
|
||||
---
|
||||
|
||||
Emit the `deep-link://new-url` event on Linux and Windows when the app is executed with a deep link CLI argument,
|
||||
matching the iOS and macOS behavior.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"deep-link": patch
|
||||
---
|
||||
|
||||
Added `DeepLink::on_open_url` function to match the JavaScript API implementation,
|
||||
which wraps the `deep-link://new-url` event and also send the current deep link if there's any.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"deep-link": patch
|
||||
---
|
||||
|
||||
Fix fails to start when having spaces in the main binary path on Windows
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"dialog": patch
|
||||
---
|
||||
|
||||
Update Tauri scopes (asset protocol) when using the `open()` command to select directories.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"dialog": patch
|
||||
---
|
||||
|
||||
Update rfd to 0.15
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
sql: patch
|
||||
---
|
||||
|
||||
It is now possible to enable multiple SQL backends at the same time. There will be no compile error anymore if no backends are enabled!
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"barcode-scanner-js": patch
|
||||
---
|
||||
|
||||
Fixed an issue which caused checkPermission and requestPermission to be mixed up.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"clipboard-manager": patch
|
||||
"clipboard-manager-js": patch
|
||||
---
|
||||
|
||||
Fix warnings and clear implementation on Android below SDK 28.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fs": patch
|
||||
---
|
||||
|
||||
Fix `scope-app`, `scope-app-recursive` and `scope-index` not properly enabling the application paths.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
fs: patch
|
||||
---
|
||||
|
||||
Fix failing to deserialize capability file when using an OS specific path in the scope that is not available on the current OS.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": patch
|
||||
---
|
||||
|
||||
Fix can't restore a minimized window's size and position properly
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": patch
|
||||
---
|
||||
|
||||
Fix deadlock when trying to restore window states on initial load
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"upload": 'patch:bug'
|
||||
---
|
||||
|
||||
fix download content to file when unsuccessful response
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fs": patch
|
||||
---
|
||||
|
||||
Support any UTF-8 character in the writeFile API.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"geolocation": patch
|
||||
---
|
||||
|
||||
No longer request permission automatically and leave to the user how to handle the `checkPermissions` and `requestPermissions` APIs.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"dialog": patch:breaking
|
||||
---
|
||||
|
||||
Changed `MessageDialogBuilder::ok_button_label` and `MessageDialogBuilder::cancel_button_label` to `MessageDialogBuilder::buttons` which takes an enum now
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"positioner": patch
|
||||
"positioner-js": patch
|
||||
---
|
||||
|
||||
`handleIconState` function for use in JavaScript event handlers. This allows one to update the TrayIcon state through JavaScript and fully create and handle the TrayIcon without requiring Rust (and the side-effect of creating a TrayIcon).
|
||||
+29
-1
@@ -4,44 +4,72 @@
|
||||
".changes/android-dialog-save.md",
|
||||
".changes/barcode-dependencies.md",
|
||||
".changes/barcode-scanner-validate-plist.md",
|
||||
".changes/cli-hidden-structs.md",
|
||||
".changes/consolidate-permission-state.md",
|
||||
".changes/deep-link-event.md",
|
||||
".changes/deep-link-get-current-desktop.md",
|
||||
".changes/deep-link-on-new-url.md",
|
||||
".changes/deep-link-register-all.md",
|
||||
".changes/deep-link-space-in-path.md",
|
||||
".changes/dialog-asset-scope.md",
|
||||
".changes/dialog-file-response-non-exhaustive.md",
|
||||
".changes/dialog-return-path.md",
|
||||
".changes/dialog-rfd-015.md",
|
||||
".changes/feat-multiple-sql-backends.md",
|
||||
".changes/fix-barcodae-scanner-imports.md",
|
||||
".changes/fix-clipboard-warnings-sdk.md",
|
||||
".changes/fix-deep-link-config.md",
|
||||
".changes/fix-fs-app-scopes.md",
|
||||
".changes/fix-fs-scope-unknown-path.md",
|
||||
".changes/fix-fs-write-file-android.md",
|
||||
".changes/fix-http-plugin-abort.md",
|
||||
".changes/fix-ios-file-dialog-default-mode.md",
|
||||
".changes/fix-linux-updater-permission-error.md",
|
||||
".changes/fix-restore-minimized-window-position.md",
|
||||
".changes/fix-restore-minimized-window-state.md",
|
||||
".changes/fix-restore-window-state-deadlock.md",
|
||||
".changes/fix-upload-handle-non-success-download.md",
|
||||
".changes/fs-dialog-file-path-methods.md",
|
||||
".changes/fs-dialog-file-path-traits.md",
|
||||
".changes/fs-dialog-non-exhaustive-error.md",
|
||||
".changes/fs-dialog-safe-file-path.md",
|
||||
".changes/fs-scope-recursive-allow-read-dir.md",
|
||||
".changes/fs-windows-path.md",
|
||||
".changes/fs-write-file-utf8-chars.md",
|
||||
".changes/geolocation-permission-refactor.md",
|
||||
".changes/geolocation-release.md",
|
||||
".changes/global-shortcut-0.6.md",
|
||||
".changes/haptics-release.md",
|
||||
".changes/iife-varname-spacing.md",
|
||||
".changes/ios-dialog-save.md",
|
||||
".changes/native-dialog-button-text.md",
|
||||
".changes/notification-body-optional-ios.md",
|
||||
".changes/notification-permission-type-change.md",
|
||||
".changes/positioner-v2-handleIconState.md",
|
||||
".changes/rc.md",
|
||||
".changes/remove-target-sdk.md",
|
||||
".changes/resolve-content-uris.md",
|
||||
".changes/shell-open-regex-match-string.md",
|
||||
".changes/shell-regex-match-string.md",
|
||||
".changes/shell-schema-required-sidcar.md",
|
||||
".changes/single-instance-deep-link.md",
|
||||
".changes/single-instance-optional-deep-link.md",
|
||||
".changes/single-instance-windows-sys.0.59.md",
|
||||
".changes/sql-uuid-type.md",
|
||||
".changes/store-api-refactor.md",
|
||||
".changes/store-auto-save.md",
|
||||
".changes/store-remove-mobile-plugin.md",
|
||||
".changes/swift-build-older-versions.md",
|
||||
".changes/tauri-rc-8.md",
|
||||
".changes/update-fs-api-docs.md",
|
||||
".changes/update-geolocation-api.md",
|
||||
".changes/update-tauri-rc-12.md",
|
||||
".changes/update-tauri-rc-3.md",
|
||||
".changes/updater-endpoint-version-encoded.md",
|
||||
".changes/updater-endpoints-result.md",
|
||||
".changes/updater-insecure-transport-protocol.md",
|
||||
".changes/updater-js-headers-download-crate.md",
|
||||
".changes/updater-js-headers-download.md"
|
||||
".changes/updater-js-headers-download.md",
|
||||
".changes/window-state-physical-size.md"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"shell": "patch"
|
||||
---
|
||||
|
||||
Fix the plugin schema requiring to set `sidecar` property when it is in fact optional.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"single-instance": "patch"
|
||||
---
|
||||
|
||||
Put deep link integration behined a feature
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"store-js": patch
|
||||
---
|
||||
|
||||
**Breaking change**: Removed the `Store` constructor and added the `createStore` API.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"store": patch
|
||||
---
|
||||
|
||||
Add a setting `auto_save` to enable a store to debounce save on modification (on calls like set, clear, delete, reset)
|
||||
|
||||
**Breaking change**: Removed the `with_store` API and added `StoreExt::store_builder`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"geolocation-js": patch
|
||||
---
|
||||
|
||||
Update API to match other plugins.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Update to tauri 2.0.0-rc.12.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'updater': 'patch'
|
||||
---
|
||||
|
||||
Encode `+` when making updater requests which can be cause incorrectly interpolating the endpoint when using `{{current_version}}` in the endpoint where the current version contains a build number, for example `1.8.0+1`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
**Breaking change**, Changed `UpdaterBuilder::endpoints` method to return a `Result`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
Add `dangerousInsecureTransportProtocol` config option to allow using insecure transport protocols, like `http`
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": patch:breaking
|
||||
---
|
||||
|
||||
Window's size is now stored in physical size instead of logical size
|
||||
@@ -148,13 +148,7 @@ jobs:
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: clippy ${{ matrix.package }}
|
||||
if: matrix.package != 'tauri-plugin-sql'
|
||||
run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings
|
||||
|
||||
- name: clippy ${{ matrix.package }} mysql
|
||||
if: matrix.package == 'tauri-plugin-sql'
|
||||
run: cargo clippy --package ${{ matrix.package }} --all-targets --no-default-features --features mysql -- -D warnings
|
||||
|
||||
- name: clippy ${{ matrix.package }} postgres
|
||||
if: matrix.package == 'tauri-plugin-sql'
|
||||
run: cargo clippy --package ${{ matrix.package }} --all-targets --no-default-features --features postgres -- -D warnings
|
||||
- name: clippy ${{ matrix.package }} --all-features
|
||||
run: cargo clippy --package ${{ matrix.package }} --all-targets --all-features -- -D warnings
|
||||
|
||||
@@ -215,21 +215,9 @@ jobs:
|
||||
run: cargo +stable install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: test ${{ matrix.package }}
|
||||
if: matrix.package != 'tauri-plugin-sql' && matrix.package != 'tauri-plugin-http'
|
||||
if: matrix.package != 'tauri-plugin-http'
|
||||
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features
|
||||
|
||||
- name: test ${{ matrix.package }}
|
||||
if: matrix.package == 'tauri-plugin-http'
|
||||
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets
|
||||
|
||||
- name: test ${{ matrix.package }} sqlite
|
||||
if: matrix.package == 'tauri-plugin-sql'
|
||||
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features sqlite
|
||||
|
||||
- name: test ${{ matrix.package }} mysql
|
||||
if: matrix.package == 'tauri-plugin-sql'
|
||||
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features mysql
|
||||
|
||||
- name: test ${{ matrix.package }} postgres
|
||||
if: matrix.package == 'tauri-plugin-sql'
|
||||
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features postgres
|
||||
|
||||
+7
-1
@@ -26,9 +26,15 @@ target/
|
||||
# compiled plugins
|
||||
dist-js/
|
||||
|
||||
# plugins .tauri director
|
||||
# plugins .tauri directory
|
||||
/plugins/*/.tauri
|
||||
|
||||
# examples
|
||||
examples/*/dist
|
||||
plugins/*/examples/*/dist
|
||||
examples/*/src-tauri/gen/schemas
|
||||
plugins/*/examples/*/src-tauri/gen/schemas
|
||||
|
||||
# logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
+6
-1
@@ -19,4 +19,9 @@ plugins/*/examples/*/src-tauri/gen/
|
||||
api-iife.js
|
||||
init-iife.js
|
||||
CHANGELOG.md
|
||||
*schema.json
|
||||
*schema.json
|
||||
|
||||
# mobile build
|
||||
**/ios/.build
|
||||
**/.tauri
|
||||
plugins/*/android/build
|
||||
|
||||
Generated
+701
-474
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -11,10 +11,10 @@ resolver = "2"
|
||||
[workspace.dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = { version = "2.0.0-rc.10", default-features = false }
|
||||
tauri-build = "2.0.0-rc.9"
|
||||
tauri-plugin = "2.0.0-rc.9"
|
||||
tauri-utils = "2.0.0-rc.9"
|
||||
tauri = { version = "2.0.0-rc.16", default-features = false }
|
||||
tauri-build = "2.0.0-rc.13"
|
||||
tauri-plugin = "2.0.0-rc.13"
|
||||
tauri-utils = "2.0.0-rc.13"
|
||||
serde_json = "1"
|
||||
thiserror = "1"
|
||||
url = "2"
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/dist/*
|
||||
!/dist/.gitkeep
|
||||
@@ -1,5 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `store-js@2.0.0-rc.2`
|
||||
|
||||
## \[2.0.0-rc.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner-js@2.0.0-rc.2`
|
||||
- Upgraded to `clipboard-manager-js@2.0.0-rc.2`
|
||||
|
||||
## \[2.0.0-rc.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
Vendored
+12
-10
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "svelte-app",
|
||||
"private": true,
|
||||
"version": "2.0.0-rc.3",
|
||||
"version": "2.0.0-rc.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --clearScreen false",
|
||||
@@ -9,32 +9,34 @@
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-rc.4",
|
||||
"@tauri-apps/plugin-barcode-scanner": "2.0.0-rc.1",
|
||||
"@tauri-apps/api": "2.0.0-rc.6",
|
||||
"@tauri-apps/plugin-barcode-scanner": "2.0.0-rc.2",
|
||||
"@tauri-apps/plugin-biometric": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-cli": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.0.0-rc.2",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-fs": "2.0.0-rc.2",
|
||||
"@tauri-apps/plugin-geolocation": "2.0.0-rc.2",
|
||||
"@tauri-apps/plugin-global-shortcut": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-haptics": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-http": "2.0.0-rc.2",
|
||||
"@tauri-apps/plugin-nfc": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-notification": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-os": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-process": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-shell": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-store": "2.0.0-rc.1",
|
||||
"@tauri-apps/plugin-store": "2.0.0-rc.2",
|
||||
"@tauri-apps/plugin-updater": "2.0.0-rc.2",
|
||||
"@zerodevx/svelte-json-view": "1.0.10"
|
||||
"@zerodevx/svelte-json-view": "1.0.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/codicon": "^1.1.37",
|
||||
"@iconify-json/ph": "^1.1.8",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
||||
"@tauri-apps/cli": "2.0.0-rc.12",
|
||||
"@unocss/extractor-svelte": "^0.62.0",
|
||||
"@tauri-apps/cli": "2.0.0-rc.17",
|
||||
"@unocss/extractor-svelte": "^0.63.0",
|
||||
"svelte": "^4.2.19",
|
||||
"unocss": "^0.62.0",
|
||||
"vite": "^5.0.13"
|
||||
"unocss": "^0.63.0",
|
||||
"vite": "^5.4.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,35 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.8]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `cli@2.0.0-rc.2`
|
||||
- Upgraded to `dialog@2.0.0-rc.8`
|
||||
- Upgraded to `fs@2.0.0-rc.6`
|
||||
- Upgraded to `shell@2.0.0-rc.4`
|
||||
- Upgraded to `store@2.0.0-rc.4`
|
||||
- Upgraded to `updater@2.0.0-rc.4`
|
||||
- Upgraded to `http@2.0.0-rc.6`
|
||||
|
||||
## \[2.0.0-rc.7]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager@2.0.0-rc.4`
|
||||
- Upgraded to `fs@2.0.0-rc.5`
|
||||
- Upgraded to `notification@2.0.0-rc.5`
|
||||
- Upgraded to `dialog@2.0.0-rc.7`
|
||||
- Upgraded to `http@2.0.0-rc.5`
|
||||
|
||||
## \[2.0.0-rc.6]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `dialog@2.0.0-rc.6`
|
||||
- Upgraded to `fs@2.0.0-rc.4`
|
||||
- Upgraded to `http@2.0.0-rc.4`
|
||||
|
||||
## \[2.0.0-rc.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "api"
|
||||
publish = false
|
||||
version = "2.0.0-rc.5"
|
||||
version = "2.0.0-rc.8"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
rust-version = { workspace = true }
|
||||
@@ -20,21 +20,21 @@ serde = { workspace = true }
|
||||
tiny_http = "0.12"
|
||||
log = { workspace = true }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-rc.2" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-rc.3", features = [
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-rc.6", features = [
|
||||
"watch",
|
||||
] }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-rc.3" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-rc.5" }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-rc.4" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-rc.8" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [
|
||||
"multipart",
|
||||
], version = "2.0.0-rc.3" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-rc.4", features = [
|
||||
], version = "2.0.0-rc.6" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-rc.5", features = [
|
||||
"windows7-compat",
|
||||
] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-rc.1" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-rc.1" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-rc.3" }
|
||||
tauri-plugin-store = { path = "../../../plugins/store", version = "2.0.0-rc.3" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-rc.4" }
|
||||
tauri-plugin-store = { path = "../../../plugins/store", version = "2.0.0-rc.4" }
|
||||
|
||||
[dependencies.tauri]
|
||||
workspace = true
|
||||
@@ -50,17 +50,17 @@ features = [
|
||||
]
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-rc.1" }
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-rc.2" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-rc.2" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-rc.3" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-rc.4" }
|
||||
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0-rc.3" }
|
||||
|
||||
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-rc.4" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-rc.3" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-rc.3" }
|
||||
|
||||
[target."cfg(target_os = \"windows\")".dependencies]
|
||||
window-shadows = "0.2"
|
||||
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.0-rc.3" }
|
||||
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.0-rc.3" }
|
||||
|
||||
[features]
|
||||
prod = ["tauri/custom-protocol"]
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
"barcode-scanner:allow-scan",
|
||||
"barcode-scanner:allow-cancel",
|
||||
"barcode-scanner:allow-request-permissions",
|
||||
"barcode-scanner:allow-check-permissions"
|
||||
"barcode-scanner:allow-check-permissions",
|
||||
"geolocation:allow-check-permissions",
|
||||
"geolocation:allow-request-permissions",
|
||||
"geolocation:allow-watch-position",
|
||||
"geolocation:allow-get-current-position"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -45,6 +45,8 @@ pub fn run() {
|
||||
app.handle().plugin(tauri_plugin_cli::init())?;
|
||||
app.handle()
|
||||
.plugin(tauri_plugin_global_shortcut::Builder::new().build())?;
|
||||
app.handle()
|
||||
.plugin(tauri_plugin_window_state::Builder::new().build())?;
|
||||
app.handle()
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())?;
|
||||
}
|
||||
@@ -53,6 +55,8 @@ pub fn run() {
|
||||
app.handle().plugin(tauri_plugin_barcode_scanner::init())?;
|
||||
app.handle().plugin(tauri_plugin_nfc::init())?;
|
||||
app.handle().plugin(tauri_plugin_biometric::init())?;
|
||||
app.handle().plugin(tauri_plugin_geolocation::init())?;
|
||||
app.handle().plugin(tauri_plugin_haptics::init())?;
|
||||
}
|
||||
|
||||
let mut webview_window_builder =
|
||||
@@ -63,8 +67,7 @@ pub fn run() {
|
||||
.user_agent(&format!("Tauri API - {}", std::env::consts::OS))
|
||||
.title("Tauri API Validation")
|
||||
.inner_size(1000., 800.)
|
||||
.min_inner_size(600., 400.)
|
||||
.content_protected(true);
|
||||
.min_inner_size(600., 400.);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "Tauri API",
|
||||
"version": "2.0.0",
|
||||
"identifier": "com.tauri.api",
|
||||
|
||||
+168
-165
@@ -1,203 +1,208 @@
|
||||
<script>
|
||||
import { writable } from "svelte/store";
|
||||
import { open } from "@tauri-apps/plugin-shell";
|
||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||
import { getCurrentWebview } from "@tauri-apps/api/webview";
|
||||
import * as os from "@tauri-apps/plugin-os";
|
||||
import { writable } from 'svelte/store'
|
||||
import { open } from '@tauri-apps/plugin-shell'
|
||||
import { getCurrentWindow } from '@tauri-apps/api/window'
|
||||
import { getCurrentWebview } from '@tauri-apps/api/webview'
|
||||
import * as os from '@tauri-apps/plugin-os'
|
||||
|
||||
import Welcome from "./views/Welcome.svelte";
|
||||
import Cli from "./views/Cli.svelte";
|
||||
import Communication from "./views/Communication.svelte";
|
||||
import Dialog from "./views/Dialog.svelte";
|
||||
import FileSystem from "./views/FileSystem.svelte";
|
||||
import Http from "./views/Http.svelte";
|
||||
import Notifications from "./views/Notifications.svelte";
|
||||
import Shortcuts from "./views/Shortcuts.svelte";
|
||||
import Shell from "./views/Shell.svelte";
|
||||
import Store from "./views/Store.svelte";
|
||||
import Updater from "./views/Updater.svelte";
|
||||
import Clipboard from "./views/Clipboard.svelte";
|
||||
import WebRTC from "./views/WebRTC.svelte";
|
||||
import Scanner from "./views/Scanner.svelte";
|
||||
import Biometric from "./views/Biometric.svelte";
|
||||
import Welcome from './views/Welcome.svelte'
|
||||
import Cli from './views/Cli.svelte'
|
||||
import Communication from './views/Communication.svelte'
|
||||
import Dialog from './views/Dialog.svelte'
|
||||
import FileSystem from './views/FileSystem.svelte'
|
||||
import Http from './views/Http.svelte'
|
||||
import Notifications from './views/Notifications.svelte'
|
||||
import Shortcuts from './views/Shortcuts.svelte'
|
||||
import Shell from './views/Shell.svelte'
|
||||
import Store from './views/Store.svelte'
|
||||
import Updater from './views/Updater.svelte'
|
||||
import Clipboard from './views/Clipboard.svelte'
|
||||
import WebRTC from './views/WebRTC.svelte'
|
||||
import Scanner from './views/Scanner.svelte'
|
||||
import Biometric from './views/Biometric.svelte'
|
||||
import Geolocation from './views/Geolocation.svelte'
|
||||
|
||||
import { onMount, tick } from "svelte";
|
||||
import { ask } from "@tauri-apps/plugin-dialog";
|
||||
import Nfc from "./views/Nfc.svelte";
|
||||
import { onMount, tick } from 'svelte'
|
||||
import { ask } from '@tauri-apps/plugin-dialog'
|
||||
import Nfc from './views/Nfc.svelte'
|
||||
|
||||
const appWindow = getCurrentWindow();
|
||||
const appWindow = getCurrentWindow()
|
||||
|
||||
if (appWindow.label !== "main") {
|
||||
if (appWindow.label !== 'main') {
|
||||
appWindow.onCloseRequested(async (event) => {
|
||||
const confirmed = await confirm("Are you sure?");
|
||||
const confirmed = await confirm('Are you sure?')
|
||||
if (!confirmed) {
|
||||
// user did not confirm closing the window; let's prevent it
|
||||
event.preventDefault();
|
||||
event.preventDefault()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
getCurrentWebview().onDragDropEvent((event) => {
|
||||
onMessage(`File drop: ${JSON.stringify(event.payload)}`);
|
||||
});
|
||||
onMessage(`File drop: ${JSON.stringify(event.payload)}`)
|
||||
})
|
||||
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
const isMobile =
|
||||
userAgent.includes("android") || userAgent.includes("iphone");
|
||||
const userAgent = navigator.userAgent.toLowerCase()
|
||||
const isMobile = userAgent.includes('android') || userAgent.includes('iphone')
|
||||
|
||||
const views = [
|
||||
{
|
||||
label: "Welcome",
|
||||
label: 'Welcome',
|
||||
component: Welcome,
|
||||
icon: "i-ph-hand-waving",
|
||||
icon: 'i-ph-hand-waving'
|
||||
},
|
||||
{
|
||||
label: "Communication",
|
||||
label: 'Communication',
|
||||
component: Communication,
|
||||
icon: "i-codicon-radio-tower",
|
||||
icon: 'i-codicon-radio-tower'
|
||||
},
|
||||
!isMobile && {
|
||||
label: "CLI",
|
||||
label: 'CLI',
|
||||
component: Cli,
|
||||
icon: "i-codicon-terminal",
|
||||
icon: 'i-codicon-terminal'
|
||||
},
|
||||
{
|
||||
label: "Dialog",
|
||||
label: 'Dialog',
|
||||
component: Dialog,
|
||||
icon: "i-codicon-multiple-windows",
|
||||
icon: 'i-codicon-multiple-windows'
|
||||
},
|
||||
{
|
||||
label: "File system",
|
||||
label: 'File system',
|
||||
component: FileSystem,
|
||||
icon: "i-codicon-files",
|
||||
icon: 'i-codicon-files'
|
||||
},
|
||||
{
|
||||
label: "HTTP",
|
||||
label: 'HTTP',
|
||||
component: Http,
|
||||
icon: "i-ph-globe-hemisphere-west",
|
||||
icon: 'i-ph-globe-hemisphere-west'
|
||||
},
|
||||
{
|
||||
label: "Notifications",
|
||||
label: 'Notifications',
|
||||
component: Notifications,
|
||||
icon: "i-codicon-bell-dot",
|
||||
icon: 'i-codicon-bell-dot'
|
||||
},
|
||||
!isMobile && {
|
||||
label: "Shortcuts",
|
||||
label: 'Shortcuts',
|
||||
component: Shortcuts,
|
||||
icon: "i-codicon-record-keys",
|
||||
icon: 'i-codicon-record-keys'
|
||||
},
|
||||
{
|
||||
label: "Shell",
|
||||
label: 'Shell',
|
||||
component: Shell,
|
||||
icon: "i-codicon-terminal-bash",
|
||||
icon: 'i-codicon-terminal-bash'
|
||||
},
|
||||
{
|
||||
label: "Store",
|
||||
label: 'Store',
|
||||
component: Store,
|
||||
icon: "i-codicon-file-code",
|
||||
icon: 'i-codicon-file-code'
|
||||
},
|
||||
!isMobile && {
|
||||
label: "Updater",
|
||||
label: 'Updater',
|
||||
component: Updater,
|
||||
icon: "i-codicon-cloud-download",
|
||||
icon: 'i-codicon-cloud-download'
|
||||
},
|
||||
{
|
||||
label: "Clipboard",
|
||||
label: 'Clipboard',
|
||||
component: Clipboard,
|
||||
icon: "i-codicon-clippy",
|
||||
icon: 'i-codicon-clippy'
|
||||
},
|
||||
{
|
||||
label: "WebRTC",
|
||||
label: 'WebRTC',
|
||||
component: WebRTC,
|
||||
icon: "i-ph-broadcast",
|
||||
icon: 'i-ph-broadcast'
|
||||
},
|
||||
isMobile && {
|
||||
label: "Scanner",
|
||||
label: 'Scanner',
|
||||
component: Scanner,
|
||||
icon: "i-ph-scan",
|
||||
icon: 'i-ph-scan'
|
||||
},
|
||||
isMobile && {
|
||||
label: "NFC",
|
||||
label: 'NFC',
|
||||
component: Nfc,
|
||||
icon: "i-ph-nfc",
|
||||
icon: 'i-ph-nfc'
|
||||
},
|
||||
isMobile && {
|
||||
label: "Biometric",
|
||||
label: 'Biometric',
|
||||
component: Biometric,
|
||||
icon: "i-ph-scan",
|
||||
icon: 'i-ph-scan'
|
||||
},
|
||||
];
|
||||
isMobile && {
|
||||
label: 'Geolocation',
|
||||
component: Geolocation,
|
||||
icon: 'i-ph-map-pin'
|
||||
}
|
||||
]
|
||||
|
||||
let selected = views[0];
|
||||
let selected = views[0]
|
||||
function select(view) {
|
||||
selected = view;
|
||||
selected = view
|
||||
}
|
||||
|
||||
// Window controls
|
||||
let isWindowMaximized;
|
||||
let isWindowMaximized
|
||||
onMount(async () => {
|
||||
isWindowMaximized = await appWindow.isMaximized();
|
||||
isWindowMaximized = await appWindow.isMaximized()
|
||||
appWindow.onResized(async () => {
|
||||
isWindowMaximized = await appWindow.isMaximized();
|
||||
});
|
||||
});
|
||||
isWindowMaximized = await appWindow.isMaximized()
|
||||
})
|
||||
})
|
||||
|
||||
function minimize() {
|
||||
appWindow.minimize();
|
||||
appWindow.minimize()
|
||||
}
|
||||
|
||||
async function toggleMaximize() {
|
||||
(await appWindow.isMaximized())
|
||||
;(await appWindow.isMaximized())
|
||||
? appWindow.unmaximize()
|
||||
: appWindow.maximize();
|
||||
: appWindow.maximize()
|
||||
}
|
||||
|
||||
let confirmed_close = false;
|
||||
let confirmed_close = false
|
||||
async function close() {
|
||||
if (!confirmed_close) {
|
||||
confirmed_close = await ask(
|
||||
"Are you sure that you want to close this window?",
|
||||
'Are you sure that you want to close this window?',
|
||||
{
|
||||
title: "Tauri API",
|
||||
title: 'Tauri API'
|
||||
}
|
||||
);
|
||||
)
|
||||
if (confirmed_close) {
|
||||
appWindow.close();
|
||||
appWindow.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// dark/light
|
||||
let isDark;
|
||||
let isDark
|
||||
onMount(() => {
|
||||
isDark = localStorage && localStorage.getItem("theme") == "dark";
|
||||
applyTheme(isDark);
|
||||
});
|
||||
isDark = localStorage && localStorage.getItem('theme') == 'dark'
|
||||
applyTheme(isDark)
|
||||
})
|
||||
function applyTheme(isDark) {
|
||||
const html = document.querySelector("html");
|
||||
isDark ? html.classList.add("dark") : html.classList.remove("dark");
|
||||
localStorage && localStorage.setItem("theme", isDark ? "dark" : "");
|
||||
const html = document.querySelector('html')
|
||||
isDark ? html.classList.add('dark') : html.classList.remove('dark')
|
||||
localStorage && localStorage.setItem('theme', isDark ? 'dark' : '')
|
||||
}
|
||||
function toggleDark() {
|
||||
isDark = !isDark;
|
||||
applyTheme(isDark);
|
||||
isDark = !isDark
|
||||
applyTheme(isDark)
|
||||
}
|
||||
|
||||
// Console
|
||||
let messages = writable([]);
|
||||
let consoleTextEl;
|
||||
let messages = writable([])
|
||||
let consoleTextEl
|
||||
async function onMessage(value) {
|
||||
messages.update((r) => [
|
||||
...r,
|
||||
{
|
||||
html:
|
||||
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` +
|
||||
(typeof value === "string" ? value : JSON.stringify(value, null, 1)) +
|
||||
"</pre>",
|
||||
},
|
||||
]);
|
||||
await tick();
|
||||
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight;
|
||||
(typeof value === 'string' ? value : JSON.stringify(value, null, 1)) +
|
||||
'</pre>'
|
||||
}
|
||||
])
|
||||
await tick()
|
||||
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight
|
||||
}
|
||||
|
||||
// this function is renders HTML without sanitizing it so it's insecure
|
||||
@@ -209,111 +214,109 @@
|
||||
html:
|
||||
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` +
|
||||
html +
|
||||
"</pre>",
|
||||
},
|
||||
]);
|
||||
await tick();
|
||||
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight;
|
||||
'</pre>'
|
||||
}
|
||||
])
|
||||
await tick()
|
||||
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight
|
||||
}
|
||||
|
||||
function clear() {
|
||||
messages.update(() => []);
|
||||
messages.update(() => [])
|
||||
}
|
||||
|
||||
let consoleEl, consoleH, cStartY;
|
||||
let minConsoleHeight = 50;
|
||||
let consoleEl, consoleH, cStartY
|
||||
let minConsoleHeight = 50
|
||||
function startResizingConsole(e) {
|
||||
cStartY = e.clientY;
|
||||
cStartY = e.clientY
|
||||
|
||||
const styles = window.getComputedStyle(consoleEl);
|
||||
consoleH = parseInt(styles.height, 10);
|
||||
const styles = window.getComputedStyle(consoleEl)
|
||||
consoleH = parseInt(styles.height, 10)
|
||||
|
||||
const moveHandler = (e) => {
|
||||
const dy = e.clientY - cStartY;
|
||||
const newH = consoleH - dy;
|
||||
const dy = e.clientY - cStartY
|
||||
const newH = consoleH - dy
|
||||
consoleEl.style.height = `${
|
||||
newH < minConsoleHeight ? minConsoleHeight : newH
|
||||
}px`;
|
||||
};
|
||||
}px`
|
||||
}
|
||||
const upHandler = () => {
|
||||
document.removeEventListener("mouseup", upHandler);
|
||||
document.removeEventListener("mousemove", moveHandler);
|
||||
};
|
||||
document.addEventListener("mouseup", upHandler);
|
||||
document.addEventListener("mousemove", moveHandler);
|
||||
document.removeEventListener('mouseup', upHandler)
|
||||
document.removeEventListener('mousemove', moveHandler)
|
||||
}
|
||||
document.addEventListener('mouseup', upHandler)
|
||||
document.addEventListener('mousemove', moveHandler)
|
||||
}
|
||||
|
||||
let isWindows;
|
||||
let isWindows
|
||||
onMount(async () => {
|
||||
isWindows = (await os.platform()) === "windows";
|
||||
});
|
||||
isWindows = (await os.platform()) === 'windows'
|
||||
})
|
||||
|
||||
// mobile
|
||||
let isSideBarOpen = false;
|
||||
let sidebar;
|
||||
let sidebarToggle;
|
||||
let isDraggingSideBar = false;
|
||||
let draggingStartPosX = 0;
|
||||
let draggingEndPosX = 0;
|
||||
const clamp = (min, num, max) => Math.min(Math.max(num, min), max);
|
||||
let isSideBarOpen = false
|
||||
let sidebar
|
||||
let sidebarToggle
|
||||
let isDraggingSideBar = false
|
||||
let draggingStartPosX = 0
|
||||
let draggingEndPosX = 0
|
||||
const clamp = (min, num, max) => Math.min(Math.max(num, min), max)
|
||||
|
||||
function toggleSidebar(sidebar, isSideBarOpen) {
|
||||
sidebar.style.setProperty(
|
||||
"--translate-x",
|
||||
`${isSideBarOpen ? "0" : "-18.75"}rem`
|
||||
);
|
||||
'--translate-x',
|
||||
`${isSideBarOpen ? '0' : '-18.75'}rem`
|
||||
)
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
sidebar = document.querySelector("#sidebar");
|
||||
sidebarToggle = document.querySelector("#sidebarToggle");
|
||||
sidebar = document.querySelector('#sidebar')
|
||||
sidebarToggle = document.querySelector('#sidebarToggle')
|
||||
|
||||
document.addEventListener("click", (e) => {
|
||||
document.addEventListener('click', (e) => {
|
||||
if (sidebarToggle.contains(e.target)) {
|
||||
isSideBarOpen = !isSideBarOpen;
|
||||
isSideBarOpen = !isSideBarOpen
|
||||
} else if (isSideBarOpen && !sidebar.contains(e.target)) {
|
||||
isSideBarOpen = false;
|
||||
isSideBarOpen = false
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
document.addEventListener("touchstart", (e) => {
|
||||
if (sidebarToggle.contains(e.target)) return;
|
||||
document.addEventListener('touchstart', (e) => {
|
||||
if (sidebarToggle.contains(e.target)) return
|
||||
|
||||
const x = e.touches[0].clientX;
|
||||
const x = e.touches[0].clientX
|
||||
if ((0 < x && x < 20 && !isSideBarOpen) || isSideBarOpen) {
|
||||
isDraggingSideBar = true;
|
||||
draggingStartPosX = x;
|
||||
isDraggingSideBar = true
|
||||
draggingStartPosX = x
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
document.addEventListener("touchmove", (e) => {
|
||||
document.addEventListener('touchmove', (e) => {
|
||||
if (isDraggingSideBar) {
|
||||
const x = e.touches[0].clientX;
|
||||
draggingEndPosX = x;
|
||||
const delta = (x - draggingStartPosX) / 10;
|
||||
const x = e.touches[0].clientX
|
||||
draggingEndPosX = x
|
||||
const delta = (x - draggingStartPosX) / 10
|
||||
sidebar.style.setProperty(
|
||||
"--translate-x",
|
||||
'--translate-x',
|
||||
`-${clamp(0, isSideBarOpen ? 0 - delta : 18.75 - delta, 18.75)}rem`
|
||||
);
|
||||
)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
document.addEventListener("touchend", () => {
|
||||
document.addEventListener('touchend', () => {
|
||||
if (isDraggingSideBar) {
|
||||
const delta = (draggingEndPosX - draggingStartPosX) / 10;
|
||||
isSideBarOpen = isSideBarOpen
|
||||
? delta > -(18.75 / 2)
|
||||
: delta > 18.75 / 2;
|
||||
const delta = (draggingEndPosX - draggingStartPosX) / 10
|
||||
isSideBarOpen = isSideBarOpen ? delta > -(18.75 / 2) : delta > 18.75 / 2
|
||||
}
|
||||
|
||||
isDraggingSideBar = false;
|
||||
});
|
||||
});
|
||||
isDraggingSideBar = false
|
||||
})
|
||||
})
|
||||
|
||||
$: {
|
||||
const sidebar = document.querySelector("#sidebar");
|
||||
const sidebar = document.querySelector('#sidebar')
|
||||
if (sidebar) {
|
||||
toggleSidebar(sidebar, isSideBarOpen);
|
||||
toggleSidebar(sidebar, isSideBarOpen)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -332,7 +335,7 @@
|
||||
children:items-center children:justify-center"
|
||||
>
|
||||
<span
|
||||
title={isDark ? "Switch to Light mode" : "Switch to Dark mode"}
|
||||
title={isDark ? 'Switch to Light mode' : 'Switch to Dark mode'}
|
||||
class="hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
on:click={toggleDark}
|
||||
>
|
||||
@@ -350,7 +353,7 @@
|
||||
<div class="i-codicon-chrome-minimize" />
|
||||
</span>
|
||||
<span
|
||||
title={isWindowMaximized ? "Restore" : "Maximize"}
|
||||
title={isWindowMaximized ? 'Restore' : 'Maximize'}
|
||||
class="hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
on:click={toggleMaximize}
|
||||
>
|
||||
@@ -393,7 +396,7 @@
|
||||
bg-darkPrimaryLighter transition-colors-250 overflow-hidden grid select-none px-2"
|
||||
>
|
||||
<img
|
||||
on:click={() => open("https://tauri.app/")}
|
||||
on:click={() => open('https://tauri.app/')}
|
||||
class="self-center p-7 cursor-pointer"
|
||||
src="tauri_logo.png"
|
||||
alt="Tauri logo"
|
||||
@@ -449,8 +452,8 @@
|
||||
href="##"
|
||||
class="nv {selected === view ? 'nv_selected' : ''}"
|
||||
on:click={() => {
|
||||
select(view);
|
||||
isSideBarOpen = false;
|
||||
select(view)
|
||||
isSideBarOpen = false
|
||||
}}
|
||||
>
|
||||
<div class="{view.icon} mr-2" />
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
<script>
|
||||
import * as clipboard from "@tauri-apps/plugin-clipboard-manager";
|
||||
import { open } from "@tauri-apps/plugin-dialog";
|
||||
import { arrayBufferToBase64 } from "../lib/utils";
|
||||
import { readFile } from "@tauri-apps/plugin-fs";
|
||||
import * as clipboard from '@tauri-apps/plugin-clipboard-manager'
|
||||
import { open } from '@tauri-apps/plugin-dialog'
|
||||
import { arrayBufferToBase64 } from '../lib/utils'
|
||||
import { readFile } from '@tauri-apps/plugin-fs'
|
||||
|
||||
export let onMessage;
|
||||
export let insecureRenderHtml;
|
||||
let text = "clipboard message";
|
||||
export let onMessage
|
||||
export let insecureRenderHtml
|
||||
let text = 'clipboard message'
|
||||
|
||||
function writeText() {
|
||||
clipboard
|
||||
.writeText(text)
|
||||
.then(() => {
|
||||
onMessage("Wrote to the clipboard");
|
||||
onMessage('Wrote to the clipboard')
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
async function writeImage() {
|
||||
try {
|
||||
const res = await open({
|
||||
title: "Image to write to clipboard",
|
||||
const path = await open({
|
||||
title: 'Image to write to clipboard',
|
||||
filters: [
|
||||
{
|
||||
name: "Clipboard IMG",
|
||||
extensions: ["png", "jpg", "jpeg"],
|
||||
},
|
||||
],
|
||||
});
|
||||
const bytes = await readFile(res.path);
|
||||
await clipboard.writeImage(bytes);
|
||||
onMessage("wrote image");
|
||||
name: 'Clipboard IMG',
|
||||
extensions: ['png', 'jpg', 'jpeg']
|
||||
}
|
||||
]
|
||||
})
|
||||
const bytes = await readFile(path)
|
||||
await clipboard.writeImage(bytes)
|
||||
onMessage('wrote image')
|
||||
} catch (e) {
|
||||
onMessage(e);
|
||||
onMessage(e)
|
||||
}
|
||||
}
|
||||
|
||||
async function read() {
|
||||
try {
|
||||
const image = await clipboard.readImage();
|
||||
const image = await clipboard.readImage()
|
||||
arrayBufferToBase64(await image.rgba(), function (base64) {
|
||||
const src = "data:image/png;base64," + base64;
|
||||
insecureRenderHtml('<img src="' + src + '"></img>');
|
||||
});
|
||||
return;
|
||||
const src = 'data:image/png;base64,' + base64
|
||||
insecureRenderHtml('<img src="' + src + '"></img>')
|
||||
})
|
||||
return
|
||||
} catch (_) {}
|
||||
|
||||
clipboard
|
||||
.readText()
|
||||
.then((contents) => {
|
||||
onMessage(`Clipboard contents: ${contents}`);
|
||||
onMessage(`Clipboard contents: ${contents}`)
|
||||
})
|
||||
.catch((e) => {
|
||||
onMessage(e);
|
||||
});
|
||||
onMessage(e)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -65,6 +65,5 @@
|
||||
/>
|
||||
<button class="btn" type="button" on:click={writeText}>Write</button>
|
||||
<button class="btn" type="button" on:click={writeImage}>Pick Image</button>
|
||||
|
||||
<button class="btn" type="button" on:click={read}>Read</button>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<script>
|
||||
import {
|
||||
checkPermissions,
|
||||
requestPermissions,
|
||||
getCurrentPosition
|
||||
} from '@tauri-apps/plugin-geolocation'
|
||||
|
||||
export let onMessage
|
||||
|
||||
async function getPosition() {
|
||||
let permissions = await checkPermissions()
|
||||
if (
|
||||
permissions.location === 'prompt' ||
|
||||
permissions.location === 'prompt-with-rationale'
|
||||
) {
|
||||
permissions = await requestPermissions(['location'])
|
||||
}
|
||||
|
||||
if (permissions.location === 'granted') {
|
||||
getCurrentPosition().then(onMessage).catch(onMessage)
|
||||
} else {
|
||||
onMessage('permission denied')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<button class="btn" id="cli-matches" on:click={getPosition}>
|
||||
Get Position
|
||||
</button>
|
||||
+6
-6
@@ -10,20 +10,20 @@
|
||||
"format:check": "prettier --check ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.10.0",
|
||||
"@rollup/plugin-node-resolve": "15.2.3",
|
||||
"@eslint/js": "9.11.1",
|
||||
"@rollup/plugin-node-resolve": "15.3.0",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
"@rollup/plugin-typescript": "11.1.6",
|
||||
"@types/eslint__js": "8.42.3",
|
||||
"covector": "^0.12.0",
|
||||
"eslint": "9.10.0",
|
||||
"covector": "^0.12.3",
|
||||
"eslint": "9.11.1",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-security": "3.0.1",
|
||||
"prettier": "3.3.3",
|
||||
"rollup": "4.21.2",
|
||||
"rollup": "4.22.4",
|
||||
"tslib": "2.7.0",
|
||||
"typescript": "5.6.2",
|
||||
"typescript-eslint": "8.5.0"
|
||||
"typescript-eslint": "8.7.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"semver": ">=7.5.2",
|
||||
|
||||
@@ -13,6 +13,13 @@ links = "tauri-plugin-autostart"
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
macos = { level = "full", notes = "" }
|
||||
android = { level = "none", notes = "" }
|
||||
ios = { level = "none", notes = "" }
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ disable the automatic start on boot.
|
||||
- `allow-disable`
|
||||
- `allow-is-enabled`
|
||||
|
||||
## Permission Table
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -295,53 +295,39 @@
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "allow-disable -> Enables the disable command without any pre-configured scope.",
|
||||
"description": "Enables the disable command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-disable"
|
||||
]
|
||||
"const": "allow-disable"
|
||||
},
|
||||
{
|
||||
"description": "deny-disable -> Denies the disable command without any pre-configured scope.",
|
||||
"description": "Denies the disable command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-disable"
|
||||
]
|
||||
"const": "deny-disable"
|
||||
},
|
||||
{
|
||||
"description": "allow-enable -> Enables the enable command without any pre-configured scope.",
|
||||
"description": "Enables the enable command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-enable"
|
||||
]
|
||||
"const": "allow-enable"
|
||||
},
|
||||
{
|
||||
"description": "deny-enable -> Denies the enable command without any pre-configured scope.",
|
||||
"description": "Denies the enable command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-enable"
|
||||
]
|
||||
"const": "deny-enable"
|
||||
},
|
||||
{
|
||||
"description": "allow-is-enabled -> Enables the is_enabled command without any pre-configured scope.",
|
||||
"description": "Enables the is_enabled command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-is-enabled"
|
||||
]
|
||||
"const": "allow-is-enabled"
|
||||
},
|
||||
{
|
||||
"description": "deny-is-enabled -> Denies the is_enabled command without any pre-configured scope.",
|
||||
"description": "Denies the is_enabled command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-is-enabled"
|
||||
]
|
||||
"const": "deny-is-enabled"
|
||||
},
|
||||
{
|
||||
"description": "default -> This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n",
|
||||
"description": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default"
|
||||
]
|
||||
"const": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.2]
|
||||
|
||||
- [`79d6e19c`](https://github.com/tauri-apps/plugins-workspace/commit/79d6e19c4b38bae0cab29eb88df379e2237d9aac) ([#1777](https://github.com/tauri-apps/plugins-workspace/pull/1777)) Fixed an issue which caused checkPermission and requestPermission to be mixed up.
|
||||
|
||||
## \[2.0.0-rc.4]
|
||||
|
||||
- [`713c54ef`](https://github.com/tauri-apps/plugins-workspace/commit/713c54ef8365d36afd84585dcabed2fbb751223d) ([#1749](https://github.com/tauri-apps/plugins-workspace/pull/1749) by [@olivierlemasle](https://github.com/tauri-apps/plugins-workspace/../../olivierlemasle)) Remove unused Android dependencies.
|
||||
|
||||
@@ -14,6 +14,14 @@ rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "none", notes = "" }
|
||||
linux = { level = "none", notes = "" }
|
||||
macos = { level = "none", notes = "" }
|
||||
android = { level = "full", notes = "" }
|
||||
ios = { level = "full", notes = "" }
|
||||
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(r=n.Format||(n.Format={})).QRCode="QR_CODE",r.UPC_A="UPC_A",r.UPC_E="UPC_E",r.EAN8="EAN_8",r.EAN13="EAN_13",r.Code39="CODE_39",r.Code93="CODE_93",r.Code128="CODE_128",r.Codabar="CODABAR",r.ITF="ITF",r.Aztec="AZTEC",r.DataMatrix="DATA_MATRIX",r.PDF417="PDF_417",n.cancel=async function(){await e("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return e(`plugin:${n}|request_permissions`)}("barcode-scanner").then((n=>n.camera))},n.openAppSettings=async function(){await e("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return e(`plugin:${n}|check_permissions`)}("barcode-scanner").then((n=>n.camera))},n.scan=async function(n){return await e("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(r=n.Format||(n.Format={})).QRCode="QR_CODE",r.UPC_A="UPC_A",r.UPC_E="UPC_E",r.EAN8="EAN_8",r.EAN13="EAN_13",r.Code39="CODE_39",r.Code93="CODE_93",r.Code128="CODE_128",r.Codabar="CODABAR",r.ITF="ITF",r.Aztec="AZTEC",r.DataMatrix="DATA_MATRIX",r.PDF417="PDF_417",n.cancel=async function(){await e("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return e(`plugin:${n}|check_permissions`)}("barcode-scanner").then((n=>n.camera))},n.openAppSettings=async function(){await e("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return e(`plugin:${n}|request_permissions`)}("barcode-scanner").then((n=>n.camera))},n.scan=async function(n){return await e("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
import {
|
||||
invoke,
|
||||
requestPermissions as checkPermissions_,
|
||||
checkPermissions as requestPermissions_
|
||||
requestPermissions as requestPermissions_,
|
||||
checkPermissions as checkPermissions_
|
||||
} from '@tauri-apps/api/core'
|
||||
|
||||
export type { PermissionState } from '@tauri-apps/api/core'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-barcode-scanner",
|
||||
"version": "2.0.0-rc.1",
|
||||
"version": "2.0.0-rc.2",
|
||||
"description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
|
||||
@@ -16,7 +16,7 @@ It allows all barcode related features.
|
||||
- `allow-scan`
|
||||
- `allow-vibrate`
|
||||
|
||||
## Permission Table
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -295,95 +295,69 @@
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "allow-cancel -> Enables the cancel command without any pre-configured scope.",
|
||||
"description": "Enables the cancel command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-cancel"
|
||||
]
|
||||
"const": "allow-cancel"
|
||||
},
|
||||
{
|
||||
"description": "deny-cancel -> Denies the cancel command without any pre-configured scope.",
|
||||
"description": "Denies the cancel command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-cancel"
|
||||
]
|
||||
"const": "deny-cancel"
|
||||
},
|
||||
{
|
||||
"description": "allow-check-permissions -> Enables the check_permissions command without any pre-configured scope.",
|
||||
"description": "Enables the check_permissions command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-check-permissions"
|
||||
]
|
||||
"const": "allow-check-permissions"
|
||||
},
|
||||
{
|
||||
"description": "deny-check-permissions -> Denies the check_permissions command without any pre-configured scope.",
|
||||
"description": "Denies the check_permissions command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-check-permissions"
|
||||
]
|
||||
"const": "deny-check-permissions"
|
||||
},
|
||||
{
|
||||
"description": "allow-open-app-settings -> Enables the open_app_settings command without any pre-configured scope.",
|
||||
"description": "Enables the open_app_settings command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-open-app-settings"
|
||||
]
|
||||
"const": "allow-open-app-settings"
|
||||
},
|
||||
{
|
||||
"description": "deny-open-app-settings -> Denies the open_app_settings command without any pre-configured scope.",
|
||||
"description": "Denies the open_app_settings command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-open-app-settings"
|
||||
]
|
||||
"const": "deny-open-app-settings"
|
||||
},
|
||||
{
|
||||
"description": "allow-request-permissions -> Enables the request_permissions command without any pre-configured scope.",
|
||||
"description": "Enables the request_permissions command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-request-permissions"
|
||||
]
|
||||
"const": "allow-request-permissions"
|
||||
},
|
||||
{
|
||||
"description": "deny-request-permissions -> Denies the request_permissions command without any pre-configured scope.",
|
||||
"description": "Denies the request_permissions command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-request-permissions"
|
||||
]
|
||||
"const": "deny-request-permissions"
|
||||
},
|
||||
{
|
||||
"description": "allow-scan -> Enables the scan command without any pre-configured scope.",
|
||||
"description": "Enables the scan command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-scan"
|
||||
]
|
||||
"const": "allow-scan"
|
||||
},
|
||||
{
|
||||
"description": "deny-scan -> Denies the scan command without any pre-configured scope.",
|
||||
"description": "Denies the scan command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-scan"
|
||||
]
|
||||
"const": "deny-scan"
|
||||
},
|
||||
{
|
||||
"description": "allow-vibrate -> Enables the vibrate command without any pre-configured scope.",
|
||||
"description": "Enables the vibrate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-vibrate"
|
||||
]
|
||||
"const": "allow-vibrate"
|
||||
},
|
||||
{
|
||||
"description": "deny-vibrate -> Denies the vibrate command without any pre-configured scope.",
|
||||
"description": "Denies the vibrate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-vibrate"
|
||||
]
|
||||
"const": "deny-vibrate"
|
||||
},
|
||||
{
|
||||
"description": "default -> This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n",
|
||||
"description": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default"
|
||||
]
|
||||
"const": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -13,6 +13,14 @@ rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "none", notes = "" }
|
||||
linux = { level = "none", notes = "" }
|
||||
macos = { level = "none", notes = "" }
|
||||
android = { level = "full", notes = "" }
|
||||
ios = { level = "full", notes = "" }
|
||||
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ It allows acccess to all biometric commands.
|
||||
- `allow-authenticate`
|
||||
- `allow-status`
|
||||
|
||||
## Permission Table
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -295,39 +295,29 @@
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "allow-authenticate -> Enables the authenticate command without any pre-configured scope.",
|
||||
"description": "Enables the authenticate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-authenticate"
|
||||
]
|
||||
"const": "allow-authenticate"
|
||||
},
|
||||
{
|
||||
"description": "deny-authenticate -> Denies the authenticate command without any pre-configured scope.",
|
||||
"description": "Denies the authenticate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-authenticate"
|
||||
]
|
||||
"const": "deny-authenticate"
|
||||
},
|
||||
{
|
||||
"description": "allow-status -> Enables the status command without any pre-configured scope.",
|
||||
"description": "Enables the status command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-status"
|
||||
]
|
||||
"const": "allow-status"
|
||||
},
|
||||
{
|
||||
"description": "deny-status -> Denies the status command without any pre-configured scope.",
|
||||
"description": "Denies the status command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-status"
|
||||
]
|
||||
"const": "deny-status"
|
||||
},
|
||||
{
|
||||
"description": "default -> This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n",
|
||||
"description": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default"
|
||||
]
|
||||
"const": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.2]
|
||||
|
||||
- [`68579934`](https://github.com/tauri-apps/plugins-workspace/commit/68579934c93f6ed2edbc97474560d6a8a00e8f70) ([#1856](https://github.com/tauri-apps/plugins-workspace/pull/1856) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Expose `Matches`, `SubcommandMatches` and `ArgData` structs.
|
||||
|
||||
## \[2.0.0-rc.1]
|
||||
|
||||
- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-cli"
|
||||
version = "2.0.0-rc.1"
|
||||
version = "2.0.0-rc.2"
|
||||
description = "Parse arguments from your Tauri application's command line interface."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -13,6 +13,14 @@ links = "tauri-plugin-cli"
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
macos = { level = "full", notes = "" }
|
||||
android = { level = "none", notes = "" }
|
||||
ios = { level = "none", notes = "" }
|
||||
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Allows reading the CLI matches
|
||||
|
||||
- `allow-cli-matches`
|
||||
|
||||
## Permission Table
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -295,25 +295,19 @@
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "allow-cli-matches -> Enables the cli_matches command without any pre-configured scope.",
|
||||
"description": "Enables the cli_matches command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-cli-matches"
|
||||
]
|
||||
"const": "allow-cli-matches"
|
||||
},
|
||||
{
|
||||
"description": "deny-cli-matches -> Denies the cli_matches command without any pre-configured scope.",
|
||||
"description": "Denies the cli_matches command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-cli-matches"
|
||||
]
|
||||
"const": "deny-cli-matches"
|
||||
},
|
||||
{
|
||||
"description": "default -> Allows reading the CLI matches",
|
||||
"description": "Allows reading the CLI matches",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default"
|
||||
]
|
||||
"const": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -18,3 +18,5 @@ impl Serialize for Error {
|
||||
serializer.serialize_str(self.to_string().as_ref())
|
||||
}
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
@@ -23,8 +23,9 @@ mod error;
|
||||
mod parser;
|
||||
|
||||
use config::{Arg, Config};
|
||||
pub use error::Error;
|
||||
type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
pub use error::{Error, Result};
|
||||
pub use parser::{ArgData, Matches, SubcommandMatches};
|
||||
|
||||
pub struct Cli<R: Runtime>(PluginApi<R, Config>);
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.2]
|
||||
|
||||
- [`341a5320`](https://github.com/tauri-apps/plugins-workspace/commit/341a5320c33d3c7b041abf7eb0ab7ad8009e6c3f) ([#1771](https://github.com/tauri-apps/plugins-workspace/pull/1771)) Fix warnings and clear implementation on Android below SDK 28.
|
||||
|
||||
## \[2.0.0-rc.1]
|
||||
|
||||
- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.0.0-rc.3"
|
||||
version = "2.0.0-rc.4"
|
||||
description = "Read and write to the system clipboard."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -14,6 +14,14 @@ rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
macos = { level = "full", notes = "" }
|
||||
android = { level = "partial", notes = "Only plain-text content support" }
|
||||
ios = { level = "partial", notes = "Only plain-text content support" }
|
||||
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
@@ -29,4 +37,4 @@ tauri = { workspace = true, features = ["wry"] }
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
arboard = "3"
|
||||
image = "0.24"
|
||||
image = "0.25"
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
package app.tauri.clipboard
|
||||
|
||||
import android.R.attr.value
|
||||
import android.app.Activity
|
||||
import android.content.ClipData
|
||||
import android.content.ClipDescription
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import app.tauri.annotation.Command
|
||||
import app.tauri.annotation.InvokeArg
|
||||
import app.tauri.annotation.TauriPlugin
|
||||
@@ -59,6 +59,9 @@ internal class ReadClipDataSerializer @JvmOverloads constructor(t: Class<ReadCli
|
||||
|
||||
jgen.writeEndObject()
|
||||
}
|
||||
else -> {
|
||||
throw Exception("unimplemented ReadClipData")
|
||||
}
|
||||
}
|
||||
|
||||
jgen.writeEndObject()
|
||||
@@ -93,7 +96,7 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
is WriteOptions.PlainText -> {
|
||||
ClipData.newPlainText(args.label, args.text)
|
||||
} else -> {
|
||||
invoke.reject("Invalid write options provided")
|
||||
invoke.reject("unimplemented WriteOptions")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -128,7 +131,11 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
@Command
|
||||
fun clear(invoke: Invoke) {
|
||||
if (manager.hasPrimaryClip()) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
manager.clearPrimaryClip()
|
||||
} else {
|
||||
manager.setPrimaryClip(ClipData.newPlainText("", ""))
|
||||
}
|
||||
}
|
||||
invoke.resolve()
|
||||
}
|
||||
|
||||
@@ -114,6 +114,11 @@ async function writeHtml(html: string, altHtml?: string): Promise<void> {
|
||||
|
||||
/**
|
||||
* Clears the clipboard.
|
||||
*
|
||||
* #### Platform-specific
|
||||
*
|
||||
* - **Android:** Only supported on SDK 28+. For older releases we write an empty string to the clipboard instead.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { clear } from '@tauri-apps/plugin-clipboard-manager';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-clipboard-manager",
|
||||
"version": "2.0.0-rc.1",
|
||||
"version": "2.0.0-rc.2",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
|
||||
@@ -8,7 +8,7 @@ Clipboard interaction needs to be explicitly enabled.
|
||||
|
||||
|
||||
|
||||
## Permission Table
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -295,95 +295,69 @@
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "allow-clear -> Enables the clear command without any pre-configured scope.",
|
||||
"description": "Enables the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-clear"
|
||||
]
|
||||
"const": "allow-clear"
|
||||
},
|
||||
{
|
||||
"description": "deny-clear -> Denies the clear command without any pre-configured scope.",
|
||||
"description": "Denies the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-clear"
|
||||
]
|
||||
"const": "deny-clear"
|
||||
},
|
||||
{
|
||||
"description": "allow-read-image -> Enables the read_image command without any pre-configured scope.",
|
||||
"description": "Enables the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-read-image"
|
||||
]
|
||||
"const": "allow-read-image"
|
||||
},
|
||||
{
|
||||
"description": "deny-read-image -> Denies the read_image command without any pre-configured scope.",
|
||||
"description": "Denies the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-read-image"
|
||||
]
|
||||
"const": "deny-read-image"
|
||||
},
|
||||
{
|
||||
"description": "allow-read-text -> Enables the read_text command without any pre-configured scope.",
|
||||
"description": "Enables the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-read-text"
|
||||
]
|
||||
"const": "allow-read-text"
|
||||
},
|
||||
{
|
||||
"description": "deny-read-text -> Denies the read_text command without any pre-configured scope.",
|
||||
"description": "Denies the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-read-text"
|
||||
]
|
||||
"const": "deny-read-text"
|
||||
},
|
||||
{
|
||||
"description": "allow-write-html -> Enables the write_html command without any pre-configured scope.",
|
||||
"description": "Enables the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-write-html"
|
||||
]
|
||||
"const": "allow-write-html"
|
||||
},
|
||||
{
|
||||
"description": "deny-write-html -> Denies the write_html command without any pre-configured scope.",
|
||||
"description": "Denies the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-write-html"
|
||||
]
|
||||
"const": "deny-write-html"
|
||||
},
|
||||
{
|
||||
"description": "allow-write-image -> Enables the write_image command without any pre-configured scope.",
|
||||
"description": "Enables the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-write-image"
|
||||
]
|
||||
"const": "allow-write-image"
|
||||
},
|
||||
{
|
||||
"description": "deny-write-image -> Denies the write_image command without any pre-configured scope.",
|
||||
"description": "Denies the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-write-image"
|
||||
]
|
||||
"const": "deny-write-image"
|
||||
},
|
||||
{
|
||||
"description": "allow-write-text -> Enables the write_text command without any pre-configured scope.",
|
||||
"description": "Enables the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-write-text"
|
||||
]
|
||||
"const": "allow-write-text"
|
||||
},
|
||||
{
|
||||
"description": "deny-write-text -> Denies the write_text command without any pre-configured scope.",
|
||||
"description": "Denies the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-write-text"
|
||||
]
|
||||
"const": "deny-write-text"
|
||||
},
|
||||
{
|
||||
"description": "default -> No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n",
|
||||
"description": "No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default"
|
||||
]
|
||||
"const": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ impl<R: Runtime> Clipboard<R> {
|
||||
&image.bytes,
|
||||
image.width as u32,
|
||||
image.height as u32,
|
||||
image::ColorType::Rgba8,
|
||||
image::ExtendedColorType::Rgba8,
|
||||
)?;
|
||||
|
||||
let image = Image::new_owned(buffer, image.width as u32, image.height as u32);
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.7]
|
||||
|
||||
- [`3168e176`](https://github.com/tauri-apps/plugins-workspace/commit/3168e176031a61215be542595ba90ca51f8f2d97) ([#1806](https://github.com/tauri-apps/plugins-workspace/pull/1806) by [@auggiebennett](https://github.com/tauri-apps/plugins-workspace/../../auggiebennett)) Fix fails to start when having spaces in the main binary path on Windows
|
||||
|
||||
## \[2.0.0-rc.6]
|
||||
|
||||
- [`6f3f6679`](https://github.com/tauri-apps/plugins-workspace/commit/6f3f66794a87ef9d1c16667c425d5ad7091a9c2f) ([#1780](https://github.com/tauri-apps/plugins-workspace/pull/1780)) Added `DeepLink::on_open_url` function to match the JavaScript API implementation,
|
||||
which wraps the `deep-link://new-url` event and also send the current deep link if there's any.
|
||||
|
||||
## \[2.0.0-rc.5]
|
||||
|
||||
- [`984110a9`](https://github.com/tauri-apps/plugins-workspace/commit/984110a978774712bad4d746ed06134d54debcd0) ([#1770](https://github.com/tauri-apps/plugins-workspace/pull/1770) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Emit the `deep-link://new-url` event on Linux and Windows when the app is executed with a deep link CLI argument,
|
||||
matching the iOS and macOS behavior.
|
||||
|
||||
## \[2.0.0-rc.2]
|
||||
|
||||
- [`64a6240f`](https://github.com/tauri-apps/plugins-workspace/commit/64a6240f79fcd52267c8d721b727ae695055d7ff) ([#1759](https://github.com/tauri-apps/plugins-workspace/pull/1759) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Implement `get_current` on Linux and Windows.
|
||||
@@ -108,6 +122,6 @@
|
||||
- [`eccd6f9`](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
|
||||
commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
|
||||
ithub.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
|
||||
](https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
|
||||
]\(https://github.com/tauri-apps/plugins-workspace/commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
|
||||
commit/eccd6f977af7629255b6f5a5205666c9079a86ed)([#504](https://github.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
|
||||
ithub.com/tauri-apps/plugins-workspace/pull/504)) Initial release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-deep-link"
|
||||
version = "2.0.0-rc.4"
|
||||
version = "2.0.0-rc.7"
|
||||
description = "Set your Tauri application as the default handler for an URL"
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -14,6 +14,13 @@ rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
macos = { level = "partial", notes = "Runtime deep link registration is not supported" }
|
||||
android = { level = "partial", notes = "Runtime deep link registration is not supported" }
|
||||
ios = { level = "partial", notes = "Runtime deep link registration is not supported" }
|
||||
|
||||
[build-dependencies]
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
@@ -31,7 +38,7 @@ url = { workspace = true }
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
dunce = "1"
|
||||
windows-registry = "0.2"
|
||||
windows-registry = "0.3"
|
||||
windows-result = "0.2"
|
||||
|
||||
[target."cfg(target_os = \"linux\")".dependencies]
|
||||
|
||||
@@ -145,7 +145,7 @@ await onOpenUrl((urls) => {
|
||||
})
|
||||
```
|
||||
|
||||
Note that the Plugin will only emit events on macOS, iOS and Android. On Windows and Linux the OS will spawn a new instance of your app with the URL as a CLI argument. If you want your app to behave on Windows & Linux similar to the other platforms you can use the [single-instance](../single-instance/) plugin.
|
||||
Note that the Plugin will only emit events on macOS, iOS and Android. On Windows and Linux the OS will spawn a new instance of your app with the URL as a CLI argument. If you want your app to behave on Windows & Linux similar to the other platforms you can use the [single-instance](../single-instance/) plugin with the `deep-link` feature enabled.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-rc.4",
|
||||
"@tauri-apps/api": "2.0.0-rc.6",
|
||||
"@tauri-apps/plugin-deep-link": "2.0.0-rc.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.0.0-rc.12",
|
||||
"@tauri-apps/cli": "2.0.0-rc.17",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.0.13"
|
||||
"vite": "^5.4.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,9 @@ serde_json = { workspace = true }
|
||||
tauri = { workspace = true, features = ["wry", "compression"] }
|
||||
tauri-plugin-deep-link = { path = "../../../" }
|
||||
tauri-plugin-log = { path = "../../../../log" }
|
||||
tauri-plugin-single-instance = { path = "../../../../single-instance" }
|
||||
tauri-plugin-single-instance = { path = "../../../../single-instance", features = [
|
||||
"deep-link",
|
||||
] }
|
||||
log = "0.4"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -41,15 +41,6 @@
|
||||
<data android:host="tauri.app" />
|
||||
|
||||
</intent-filter>
|
||||
<intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="http" />
|
||||
<data android:scheme="https" />
|
||||
<data android:host="91f4-177-23-156-161.ngrok-free.app" />
|
||||
<data android:pathPrefix="/open" />
|
||||
</intent-filter>
|
||||
<!-- DEEP LINK PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
|
||||
</activity>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.0.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.0.0</string>
|
||||
<string>0.1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
|
||||
-1
@@ -6,7 +6,6 @@
|
||||
<array>
|
||||
<string>applinks:fabianlars.de</string>
|
||||
<string>applinks:tauri.app</string>
|
||||
<string>applinks:91f4-177-23-156-161.ngrok-free.app</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -2,20 +2,27 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use tauri::Listener;
|
||||
use tauri_plugin_deep_link::DeepLinkExt;
|
||||
|
||||
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
|
||||
#[tauri::command]
|
||||
fn greet(name: &str) -> String {
|
||||
format!("Hello, {}! You've been greeted from Rust!", name)
|
||||
format!("Hello, {name}! You've been greeted from Rust!")
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_single_instance::init(|_app, argv, _cwd| {
|
||||
#[allow(unused_mut)]
|
||||
let mut builder = tauri::Builder::default();
|
||||
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
builder = builder.plugin(tauri_plugin_single_instance::init(|_app, argv, _cwd| {
|
||||
println!("single instance triggered: {argv:?}");
|
||||
}))
|
||||
}));
|
||||
}
|
||||
|
||||
builder
|
||||
.plugin(tauri_plugin_deep_link::init())
|
||||
.plugin(
|
||||
tauri_plugin_log::Builder::default()
|
||||
@@ -26,16 +33,14 @@ pub fn run() {
|
||||
// ensure deep links are registered on the system
|
||||
// this is useful because AppImages requires additional setup to be available in the system
|
||||
// and calling register() makes the deep links immediately available - without any user input
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
use tauri_plugin_deep_link::DeepLinkExt;
|
||||
// additionally, we manually register on Windows on debug builds for development
|
||||
#[cfg(any(target_os = "linux", all(debug_assertions, windows)))]
|
||||
app.deep_link().register_all()?;
|
||||
|
||||
app.deep_link().register_all()?;
|
||||
}
|
||||
|
||||
app.listen("deep-link://new-url", |url| {
|
||||
dbg!(url);
|
||||
app.deep_link().on_open_url(|event| {
|
||||
dbg!(event.urls());
|
||||
});
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![greet])
|
||||
|
||||
@@ -4,7 +4,7 @@ Allows reading the opened deep link via the get_current command
|
||||
|
||||
- `allow-get-current`
|
||||
|
||||
## Permission Table
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -295,67 +295,49 @@
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "allow-get-current -> Enables the get_current command without any pre-configured scope.",
|
||||
"description": "Enables the get_current command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-get-current"
|
||||
]
|
||||
"const": "allow-get-current"
|
||||
},
|
||||
{
|
||||
"description": "deny-get-current -> Denies the get_current command without any pre-configured scope.",
|
||||
"description": "Denies the get_current command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-get-current"
|
||||
]
|
||||
"const": "deny-get-current"
|
||||
},
|
||||
{
|
||||
"description": "allow-is-registered -> Enables the is_registered command without any pre-configured scope.",
|
||||
"description": "Enables the is_registered command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-is-registered"
|
||||
]
|
||||
"const": "allow-is-registered"
|
||||
},
|
||||
{
|
||||
"description": "deny-is-registered -> Denies the is_registered command without any pre-configured scope.",
|
||||
"description": "Denies the is_registered command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-is-registered"
|
||||
]
|
||||
"const": "deny-is-registered"
|
||||
},
|
||||
{
|
||||
"description": "allow-register -> Enables the register command without any pre-configured scope.",
|
||||
"description": "Enables the register command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-register"
|
||||
]
|
||||
"const": "allow-register"
|
||||
},
|
||||
{
|
||||
"description": "deny-register -> Denies the register command without any pre-configured scope.",
|
||||
"description": "Denies the register command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-register"
|
||||
]
|
||||
"const": "deny-register"
|
||||
},
|
||||
{
|
||||
"description": "allow-unregister -> Enables the unregister command without any pre-configured scope.",
|
||||
"description": "Enables the unregister command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-unregister"
|
||||
]
|
||||
"const": "allow-unregister"
|
||||
},
|
||||
{
|
||||
"description": "deny-unregister -> Denies the unregister command without any pre-configured scope.",
|
||||
"description": "Denies the unregister command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-unregister"
|
||||
]
|
||||
"const": "deny-unregister"
|
||||
},
|
||||
{
|
||||
"description": "default -> Allows reading the opened deep link via the get_current command",
|
||||
"description": "Allows reading the opened deep link via the get_current command",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default"
|
||||
]
|
||||
"const": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use tauri::{
|
||||
plugin::{Builder, PluginApi, TauriPlugin},
|
||||
AppHandle, Manager, Runtime,
|
||||
AppHandle, EventId, Listener, Manager, Runtime,
|
||||
};
|
||||
|
||||
mod commands;
|
||||
@@ -57,7 +59,10 @@ fn init_deep_link<R: Runtime>(
|
||||
},
|
||||
)?;
|
||||
|
||||
return Ok(DeepLink(handle));
|
||||
return Ok(DeepLink {
|
||||
app: app.clone(),
|
||||
plugin_handle: handle,
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(target_os = "ios")]
|
||||
@@ -70,26 +75,22 @@ fn init_deep_link<R: Runtime>(
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
let args = std::env::args();
|
||||
let current = if let Some(config) = api.config() {
|
||||
imp::deep_link_from_args(config, args)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Ok(DeepLink {
|
||||
let deep_link = DeepLink {
|
||||
app: app.clone(),
|
||||
current: std::sync::Mutex::new(current.map(|url| vec![url])),
|
||||
current: Default::default(),
|
||||
config: api.config().clone(),
|
||||
})
|
||||
};
|
||||
deep_link.handle_cli_arguments(args);
|
||||
|
||||
Ok(deep_link)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
mod imp {
|
||||
use tauri::{plugin::PluginHandle, Runtime};
|
||||
use tauri::{ipc::Channel, plugin::PluginHandle, AppHandle, Runtime};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tauri::ipc::Channel;
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@@ -104,7 +105,10 @@ mod imp {
|
||||
}
|
||||
|
||||
/// Access to the deep-link APIs.
|
||||
pub struct DeepLink<R: Runtime>(pub(crate) PluginHandle<R>);
|
||||
pub struct DeepLink<R: Runtime> {
|
||||
pub(crate) app: AppHandle<R>,
|
||||
pub(crate) plugin_handle: PluginHandle<R>,
|
||||
}
|
||||
|
||||
impl<R: Runtime> DeepLink<R> {
|
||||
/// Get the current URLs that triggered the deep link. Use this on app load to check whether your app was started via a deep link.
|
||||
@@ -115,7 +119,7 @@ mod imp {
|
||||
/// Note that you must manually check the arguments when registering deep link schemes dynamically with [`Self::register`].
|
||||
/// Additionally, the deep link might have been provided as a CLI argument so you should check if its format matches what you expect.
|
||||
pub fn get_current(&self) -> crate::Result<Option<Vec<url::Url>>> {
|
||||
self.0
|
||||
self.plugin_handle
|
||||
.run_mobile_plugin::<GetCurrentResponse>("getCurrent", ())
|
||||
.map(|v| v.url.map(|url| vec![url]))
|
||||
.map_err(Into::into)
|
||||
@@ -179,31 +183,6 @@ mod imp {
|
||||
pub(crate) config: Option<crate::config::Config>,
|
||||
}
|
||||
|
||||
pub(crate) fn deep_link_from_args<S: AsRef<str>, I: Iterator<Item = S>>(
|
||||
config: &crate::config::Config,
|
||||
mut args: I,
|
||||
) -> Option<url::Url> {
|
||||
if cfg!(windows) || cfg!(target_os = "linux") {
|
||||
args.next(); // bin name
|
||||
let arg = args.next();
|
||||
|
||||
let maybe_deep_link = args.next().is_none(); // single argument
|
||||
if !maybe_deep_link {
|
||||
return None;
|
||||
}
|
||||
|
||||
if let Some(url) = arg.and_then(|arg| arg.as_ref().parse::<url::Url>().ok()) {
|
||||
if config.desktop.contains_scheme(&url.scheme().to_string()) {
|
||||
return Some(url);
|
||||
} else if cfg!(debug_assertions) {
|
||||
log::warn!("argument {url} does not match any configured deep link scheme; skipping it");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
impl<R: Runtime> DeepLink<R> {
|
||||
/// Checks if the provided list of arguments (which should match [`std::env::args`])
|
||||
/// contains a deep link argument (for Linux and Windows).
|
||||
@@ -216,17 +195,31 @@ mod imp {
|
||||
///
|
||||
/// This function updates the [`Self::get_current`] value and emits a `deep-link://new-url` event.
|
||||
#[cfg(desktop)]
|
||||
pub fn handle_cli_arguments<S: AsRef<str>, I: Iterator<Item = S>>(&self, args: I) {
|
||||
pub fn handle_cli_arguments<S: AsRef<str>, I: Iterator<Item = S>>(&self, mut args: I) {
|
||||
use tauri::Emitter;
|
||||
|
||||
let Some(config) = &self.config else {
|
||||
return;
|
||||
};
|
||||
|
||||
if let Some(url) = deep_link_from_args(config, args) {
|
||||
let mut current = self.current.lock().unwrap();
|
||||
current.replace(vec![url.clone()]);
|
||||
let _ = self.app.emit("deep-link://new-url", vec![url]);
|
||||
if cfg!(windows) || cfg!(target_os = "linux") {
|
||||
args.next(); // bin name
|
||||
let arg = args.next();
|
||||
|
||||
let maybe_deep_link = args.next().is_none(); // single argument
|
||||
if !maybe_deep_link {
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(url) = arg.and_then(|arg| arg.as_ref().parse::<url::Url>().ok()) {
|
||||
if config.desktop.contains_scheme(&url.scheme().to_string()) {
|
||||
let mut current = self.current.lock().unwrap();
|
||||
current.replace(vec![url.clone()]);
|
||||
let _ = self.app.emit("deep-link://new-url", vec![url]);
|
||||
} else if cfg!(debug_assertions) {
|
||||
log::warn!("argument {url} does not match any configured deep link scheme; skipping it");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,11 +274,11 @@ mod imp {
|
||||
key_reg.set_string("URL Protocol", "")?;
|
||||
|
||||
let icon_reg = CURRENT_USER.create(format!("{key_base}\\DefaultIcon"))?;
|
||||
icon_reg.set_string("", &format!("{},0", &exe))?;
|
||||
icon_reg.set_string("", &format!("{exe},0"))?;
|
||||
|
||||
let cmd_reg = CURRENT_USER.create(format!("{key_base}\\shell\\open\\command"))?;
|
||||
|
||||
cmd_reg.set_string("", &format!("{} \"%1\"", &exe))?;
|
||||
cmd_reg.set_string("", &format!("\"{exe}\" \"%1\""))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -415,13 +408,13 @@ mod imp {
|
||||
_protocol.as_ref()
|
||||
))?;
|
||||
|
||||
let registered_cmd: String = cmd_reg.get_string("")?;
|
||||
let registered_cmd = cmd_reg.get_string("")?;
|
||||
|
||||
let exe = dunce::simplified(&tauri::utils::platform::current_exe()?)
|
||||
.display()
|
||||
.to_string();
|
||||
|
||||
Ok(registered_cmd == format!("{} \"%1\"", &exe))
|
||||
Ok(registered_cmd == format!("\"{exe}\" \"%1\""))
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
@@ -451,6 +444,7 @@ mod imp {
|
||||
}
|
||||
|
||||
pub use imp::DeepLink;
|
||||
use url::Url;
|
||||
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the deep-link APIs.
|
||||
pub trait DeepLinkExt<R: Runtime> {
|
||||
@@ -463,6 +457,54 @@ impl<R: Runtime, T: Manager<R>> crate::DeepLinkExt<R> for T {
|
||||
}
|
||||
}
|
||||
|
||||
/// Event that is triggered when the app was requested to open a new URL.
|
||||
///
|
||||
/// Typed [`tauri::Event`].
|
||||
pub struct OpenUrlEvent {
|
||||
id: EventId,
|
||||
urls: Vec<Url>,
|
||||
}
|
||||
|
||||
impl OpenUrlEvent {
|
||||
/// The event ID which can be used to stop listening to the event via [`tauri::Listener::unlisten`].
|
||||
pub fn id(&self) -> EventId {
|
||||
self.id
|
||||
}
|
||||
|
||||
/// The event URLs.
|
||||
pub fn urls(self) -> Vec<Url> {
|
||||
self.urls
|
||||
}
|
||||
}
|
||||
|
||||
impl<R: Runtime> DeepLink<R> {
|
||||
/// Handle a new deep link being triggered to open the app.
|
||||
///
|
||||
/// To avoid race conditions, if the app was started with a deep link,
|
||||
/// the closure gets immediately called with the deep link URL.
|
||||
pub fn on_open_url<F: Fn(OpenUrlEvent) + Send + Sync + 'static>(&self, f: F) -> EventId {
|
||||
let f = Arc::new(f);
|
||||
let f_ = f.clone();
|
||||
let event_id = self.app.listen("deep-link://new-url", move |event| {
|
||||
if let Ok(urls) = serde_json::from_str(event.payload()) {
|
||||
f(OpenUrlEvent {
|
||||
id: event.id(),
|
||||
urls,
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
if let Ok(Some(current)) = self.get_current() {
|
||||
f_(OpenUrlEvent {
|
||||
id: event_id,
|
||||
urls: current,
|
||||
})
|
||||
}
|
||||
|
||||
event_id
|
||||
}
|
||||
}
|
||||
|
||||
/// Initializes the plugin.
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R, Option<config::Config>> {
|
||||
Builder::new("deep-link")
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.8]
|
||||
|
||||
- [`6bf1bd8d`](https://github.com/tauri-apps/plugins-workspace/commit/6bf1bd8d44bb95618590aa066e638509b014e0f9) ([#1805](https://github.com/tauri-apps/plugins-workspace/pull/1805) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update rfd to 0.15
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-rc.6`
|
||||
|
||||
### breaking
|
||||
|
||||
- [`04459afb`](https://github.com/tauri-apps/plugins-workspace/commit/04459afbb67aafa5cd57e6a148c2beb0a8d3e04a) ([#1842](https://github.com/tauri-apps/plugins-workspace/pull/1842) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Changed `MessageDialogBuilder::ok_button_label` and `MessageDialogBuilder::cancel_button_label` to `MessageDialogBuilder::buttons` which takes an enum now
|
||||
|
||||
## \[2.0.0-rc.7]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-rc.5`
|
||||
|
||||
## \[2.0.0-rc.6]
|
||||
|
||||
- [`2b898f07`](https://github.com/tauri-apps/plugins-workspace/commit/2b898f078688c57309ca17962bf02e665c406514) ([#1769](https://github.com/tauri-apps/plugins-workspace/pull/1769) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update Tauri scopes (asset protocol) when using the `open()` command to select directories.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-rc.4`
|
||||
|
||||
## \[2.0.0-rc.5]
|
||||
|
||||
- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add utility methods on `FilePath` and `SafeFilePath` enums which are:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.0.0-rc.5"
|
||||
version = "2.0.0-rc.8"
|
||||
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -14,6 +14,13 @@ rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "" }
|
||||
macos = { level = "full", notes = "" }
|
||||
android = { level = "partial", notes = "Does not support folder picker" }
|
||||
ios = { level = "partial", notes = "Does not support folder picker" }
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
@@ -27,13 +34,13 @@ tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
url = { workspace = true }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-rc.3" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-rc.6" }
|
||||
|
||||
[target.'cfg(target_os = "ios")'.dependencies]
|
||||
tauri = { workspace = true, features = ["wry"] }
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
rfd = { version = "0.14", default-features = false, features = [
|
||||
rfd = { version = "0.15", default-features = false, features = [
|
||||
"tokio",
|
||||
"gtk3",
|
||||
"common-controls-v6",
|
||||
|
||||
@@ -16,7 +16,7 @@ All dialog types are enabled.
|
||||
- `allow-save`
|
||||
- `allow-open`
|
||||
|
||||
## Permission Table
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -295,81 +295,59 @@
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "allow-ask -> Enables the ask command without any pre-configured scope.",
|
||||
"description": "Enables the ask command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-ask"
|
||||
]
|
||||
"const": "allow-ask"
|
||||
},
|
||||
{
|
||||
"description": "deny-ask -> Denies the ask command without any pre-configured scope.",
|
||||
"description": "Denies the ask command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-ask"
|
||||
]
|
||||
"const": "deny-ask"
|
||||
},
|
||||
{
|
||||
"description": "allow-confirm -> Enables the confirm command without any pre-configured scope.",
|
||||
"description": "Enables the confirm command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-confirm"
|
||||
]
|
||||
"const": "allow-confirm"
|
||||
},
|
||||
{
|
||||
"description": "deny-confirm -> Denies the confirm command without any pre-configured scope.",
|
||||
"description": "Denies the confirm command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-confirm"
|
||||
]
|
||||
"const": "deny-confirm"
|
||||
},
|
||||
{
|
||||
"description": "allow-message -> Enables the message command without any pre-configured scope.",
|
||||
"description": "Enables the message command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-message"
|
||||
]
|
||||
"const": "allow-message"
|
||||
},
|
||||
{
|
||||
"description": "deny-message -> Denies the message command without any pre-configured scope.",
|
||||
"description": "Denies the message command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-message"
|
||||
]
|
||||
"const": "deny-message"
|
||||
},
|
||||
{
|
||||
"description": "allow-open -> Enables the open command without any pre-configured scope.",
|
||||
"description": "Enables the open command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-open"
|
||||
]
|
||||
"const": "allow-open"
|
||||
},
|
||||
{
|
||||
"description": "deny-open -> Denies the open command without any pre-configured scope.",
|
||||
"description": "Denies the open command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-open"
|
||||
]
|
||||
"const": "deny-open"
|
||||
},
|
||||
{
|
||||
"description": "allow-save -> Enables the save command without any pre-configured scope.",
|
||||
"description": "Enables the save command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-save"
|
||||
]
|
||||
"const": "allow-save"
|
||||
},
|
||||
{
|
||||
"description": "deny-save -> Denies the save command without any pre-configured scope.",
|
||||
"description": "Denies the save command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-save"
|
||||
]
|
||||
"const": "deny-save"
|
||||
},
|
||||
{
|
||||
"description": "default -> This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n",
|
||||
"description": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default"
|
||||
]
|
||||
"const": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -8,7 +8,10 @@ use serde::{Deserialize, Serialize};
|
||||
use tauri::{command, Manager, Runtime, State, Window};
|
||||
use tauri_plugin_fs::FsExt;
|
||||
|
||||
use crate::{Dialog, FileDialogBuilder, FilePath, MessageDialogKind, Result};
|
||||
use crate::{
|
||||
Dialog, FileDialogBuilder, FilePath, MessageDialogButtons, MessageDialogKind, Result, CANCEL,
|
||||
OK,
|
||||
};
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(untagged)]
|
||||
@@ -132,14 +135,17 @@ pub(crate) async fn open<R: Runtime>(
|
||||
let res = if options.directory {
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
let tauri_scope = window.state::<tauri::scope::Scopes>();
|
||||
|
||||
if options.multiple {
|
||||
let folders = dialog_builder.blocking_pick_folders();
|
||||
if let Some(folders) = &folders {
|
||||
for folder in folders {
|
||||
if let Ok(path) = folder.clone().into_path() {
|
||||
if let Some(s) = window.try_fs_scope() {
|
||||
s.allow_directory(path, options.recursive);
|
||||
s.allow_directory(&path, options.recursive);
|
||||
}
|
||||
tauri_scope.allow_directory(&path, options.directory)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,8 +157,9 @@ pub(crate) async fn open<R: Runtime>(
|
||||
if let Some(folder) = &folder {
|
||||
if let Ok(path) = folder.clone().into_path() {
|
||||
if let Some(s) = window.try_fs_scope() {
|
||||
s.allow_directory(path, options.recursive);
|
||||
s.allow_directory(&path, options.recursive);
|
||||
}
|
||||
tauri_scope.allow_directory(&path, options.directory)?;
|
||||
}
|
||||
}
|
||||
OpenResponse::Folder(folder.map(|p| p.simplified()))
|
||||
@@ -161,6 +168,8 @@ pub(crate) async fn open<R: Runtime>(
|
||||
#[cfg(mobile)]
|
||||
return Err(crate::Error::FolderPickerNotImplemented);
|
||||
} else if options.multiple {
|
||||
let tauri_scope = window.state::<tauri::scope::Scopes>();
|
||||
|
||||
let files = dialog_builder.blocking_pick_files();
|
||||
if let Some(files) = &files {
|
||||
for file in files {
|
||||
@@ -169,12 +178,13 @@ pub(crate) async fn open<R: Runtime>(
|
||||
s.allow_file(&path);
|
||||
}
|
||||
|
||||
window.state::<tauri::scope::Scopes>().allow_file(&path)?;
|
||||
tauri_scope.allow_file(&path)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
OpenResponse::Files(files.map(|files| files.into_iter().map(|f| f.simplified()).collect()))
|
||||
} else {
|
||||
let tauri_scope = window.state::<tauri::scope::Scopes>();
|
||||
let file = dialog_builder.blocking_pick_file();
|
||||
|
||||
if let Some(file) = &file {
|
||||
@@ -182,7 +192,7 @@ pub(crate) async fn open<R: Runtime>(
|
||||
if let Some(s) = window.try_fs_scope() {
|
||||
s.allow_file(&path);
|
||||
}
|
||||
window.state::<tauri::scope::Scopes>().allow_file(&path)?;
|
||||
tauri_scope.allow_file(&path)?;
|
||||
}
|
||||
}
|
||||
OpenResponse::File(file.map(|f| f.simplified()))
|
||||
@@ -198,7 +208,7 @@ pub(crate) async fn save<R: Runtime>(
|
||||
options: SaveDialogOptions,
|
||||
) -> Result<Option<FilePath>> {
|
||||
let mut dialog_builder = dialog.file();
|
||||
#[cfg(any(windows, target_os = "macos"))]
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
dialog_builder = dialog_builder.set_parent(&window);
|
||||
}
|
||||
@@ -216,13 +226,15 @@ pub(crate) async fn save<R: Runtime>(
|
||||
dialog_builder = dialog_builder.add_filter(filter.name, &extensions);
|
||||
}
|
||||
|
||||
let tauri_scope = window.state::<tauri::scope::Scopes>();
|
||||
|
||||
let path = dialog_builder.blocking_save_file();
|
||||
if let Some(p) = &path {
|
||||
if let Ok(path) = p.clone().into_path() {
|
||||
if let Some(s) = window.try_fs_scope() {
|
||||
s.allow_file(&path);
|
||||
}
|
||||
window.state::<tauri::scope::Scopes>().allow_file(&path)?;
|
||||
tauri_scope.allow_file(&path)?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,16 +247,17 @@ fn message_dialog<R: Runtime>(
|
||||
title: Option<String>,
|
||||
message: String,
|
||||
kind: Option<MessageDialogKind>,
|
||||
ok_button_label: Option<String>,
|
||||
cancel_button_label: Option<String>,
|
||||
buttons: MessageDialogButtons,
|
||||
) -> bool {
|
||||
let mut builder = dialog.message(message);
|
||||
|
||||
builder = builder.buttons(buttons);
|
||||
|
||||
if let Some(title) = title {
|
||||
builder = builder.title(title);
|
||||
}
|
||||
|
||||
#[cfg(any(windows, target_os = "macos"))]
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
builder = builder.parent(&window);
|
||||
}
|
||||
@@ -253,14 +266,6 @@ fn message_dialog<R: Runtime>(
|
||||
builder = builder.kind(kind);
|
||||
}
|
||||
|
||||
if let Some(ok) = ok_button_label {
|
||||
builder = builder.ok_button_label(ok);
|
||||
}
|
||||
|
||||
if let Some(cancel) = cancel_button_label {
|
||||
builder = builder.cancel_button_label(cancel);
|
||||
}
|
||||
|
||||
builder.blocking_show()
|
||||
}
|
||||
|
||||
@@ -279,8 +284,11 @@ pub(crate) async fn message<R: Runtime>(
|
||||
title,
|
||||
message,
|
||||
kind,
|
||||
ok_button_label,
|
||||
None,
|
||||
if let Some(ok_button_label) = ok_button_label {
|
||||
MessageDialogButtons::OkCustom(ok_button_label)
|
||||
} else {
|
||||
MessageDialogButtons::Ok
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
@@ -300,8 +308,7 @@ pub(crate) async fn ask<R: Runtime>(
|
||||
title,
|
||||
message,
|
||||
kind,
|
||||
Some(ok_button_label.unwrap_or_else(|| "Yes".into())),
|
||||
Some(cancel_button_label.unwrap_or_else(|| "No".into())),
|
||||
get_ok_cancel_type(ok_button_label, cancel_button_label),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -321,7 +328,22 @@ pub(crate) async fn confirm<R: Runtime>(
|
||||
title,
|
||||
message,
|
||||
kind,
|
||||
Some(ok_button_label.unwrap_or_else(|| "Ok".into())),
|
||||
Some(cancel_button_label.unwrap_or_else(|| "Cancel".into())),
|
||||
get_ok_cancel_type(ok_button_label, cancel_button_label),
|
||||
))
|
||||
}
|
||||
|
||||
fn get_ok_cancel_type(
|
||||
ok_button_label: Option<String>,
|
||||
cancel_button_label: Option<String>,
|
||||
) -> MessageDialogButtons {
|
||||
if let Some(ok_button_label) = ok_button_label {
|
||||
MessageDialogButtons::OkCancelCustom(
|
||||
ok_button_label,
|
||||
cancel_button_label.unwrap_or(CANCEL.to_string()),
|
||||
)
|
||||
} else if let Some(cancel_button_label) = cancel_button_label {
|
||||
MessageDialogButtons::OkCancelCustom(OK.to_string(), cancel_button_label)
|
||||
} else {
|
||||
MessageDialogButtons::OkCancel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
//! to give results back. This is particularly useful when running dialogs from the main thread.
|
||||
//! When using on asynchronous contexts such as async commands, the [`blocking`] APIs are recommended.
|
||||
|
||||
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
|
||||
use raw_window_handle::{HasDisplayHandle, HasWindowHandle, RawDisplayHandle, RawWindowHandle};
|
||||
use rfd::{AsyncFileDialog, AsyncMessageDialog};
|
||||
use serde::de::DeserializeOwned;
|
||||
use tauri::{plugin::PluginApi, AppHandle, Runtime};
|
||||
|
||||
use crate::{models::*, FileDialogBuilder, FilePath, MessageDialogBuilder};
|
||||
|
||||
const OK: &str = "Ok";
|
||||
use crate::{models::*, FileDialogBuilder, FilePath, MessageDialogBuilder, OK};
|
||||
|
||||
pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
app: &AppHandle<R>,
|
||||
@@ -50,13 +48,34 @@ impl From<MessageDialogKind> for rfd::MessageLevel {
|
||||
}
|
||||
}
|
||||
|
||||
struct WindowHandle(RawWindowHandle);
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct WindowHandle {
|
||||
window_handle: RawWindowHandle,
|
||||
display_handle: RawDisplayHandle,
|
||||
}
|
||||
|
||||
impl WindowHandle {
|
||||
pub(crate) fn new(window_handle: RawWindowHandle, display_handle: RawDisplayHandle) -> Self {
|
||||
Self {
|
||||
window_handle,
|
||||
display_handle,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl HasWindowHandle for WindowHandle {
|
||||
fn window_handle(
|
||||
&self,
|
||||
) -> Result<raw_window_handle::WindowHandle<'_>, raw_window_handle::HandleError> {
|
||||
Ok(unsafe { raw_window_handle::WindowHandle::borrow_raw(self.0) })
|
||||
Ok(unsafe { raw_window_handle::WindowHandle::borrow_raw(self.window_handle) })
|
||||
}
|
||||
}
|
||||
|
||||
impl HasDisplayHandle for WindowHandle {
|
||||
fn display_handle(
|
||||
&self,
|
||||
) -> Result<raw_window_handle::DisplayHandle<'_>, raw_window_handle::HandleError> {
|
||||
Ok(unsafe { raw_window_handle::DisplayHandle::borrow_raw(self.display_handle) })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +98,7 @@ impl<R: Runtime> From<FileDialogBuilder<R>> for AsyncFileDialog {
|
||||
}
|
||||
#[cfg(desktop)]
|
||||
if let Some(parent) = d.parent {
|
||||
builder = builder.set_parent(&WindowHandle(parent));
|
||||
builder = builder.set_parent(&parent);
|
||||
}
|
||||
|
||||
builder = builder.set_can_create_directories(d.can_create_directories.unwrap_or(true));
|
||||
@@ -88,25 +107,27 @@ impl<R: Runtime> From<FileDialogBuilder<R>> for AsyncFileDialog {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MessageDialogButtons> for rfd::MessageButtons {
|
||||
fn from(value: MessageDialogButtons) -> Self {
|
||||
match value {
|
||||
MessageDialogButtons::Ok => Self::Ok,
|
||||
MessageDialogButtons::OkCancel => Self::OkCancel,
|
||||
MessageDialogButtons::OkCustom(ok) => Self::OkCustom(ok),
|
||||
MessageDialogButtons::OkCancelCustom(ok, cancel) => Self::OkCancelCustom(ok, cancel),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<R: Runtime> From<MessageDialogBuilder<R>> for AsyncMessageDialog {
|
||||
fn from(d: MessageDialogBuilder<R>) -> Self {
|
||||
let mut dialog = AsyncMessageDialog::new()
|
||||
.set_title(&d.title)
|
||||
.set_description(&d.message)
|
||||
.set_level(d.kind.into());
|
||||
|
||||
let buttons = match (d.ok_button_label, d.cancel_button_label) {
|
||||
(Some(ok), Some(cancel)) => Some(rfd::MessageButtons::OkCancelCustom(ok, cancel)),
|
||||
(Some(ok), None) => Some(rfd::MessageButtons::OkCustom(ok)),
|
||||
(None, Some(cancel)) => Some(rfd::MessageButtons::OkCancelCustom(OK.into(), cancel)),
|
||||
(None, None) => None,
|
||||
};
|
||||
if let Some(buttons) = buttons {
|
||||
dialog = dialog.set_buttons(buttons);
|
||||
}
|
||||
.set_level(d.kind.into())
|
||||
.set_buttons(d.buttons.into());
|
||||
|
||||
if let Some(parent) = d.parent {
|
||||
dialog = dialog.set_parent(&WindowHandle(parent));
|
||||
dialog = dialog.set_parent(&parent);
|
||||
}
|
||||
|
||||
dialog
|
||||
@@ -192,7 +213,11 @@ pub fn show_message_dialog<R: Runtime, F: FnOnce(bool) + Send + 'static>(
|
||||
) {
|
||||
use rfd::MessageDialogResult;
|
||||
|
||||
let ok_label = dialog.ok_button_label.clone();
|
||||
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,
|
||||
|
||||
+52
-37
@@ -41,6 +41,9 @@ use desktop::*;
|
||||
#[cfg(mobile)]
|
||||
use mobile::*;
|
||||
|
||||
pub(crate) const OK: &str = "Ok";
|
||||
pub(crate) const CANCEL: &str = "Cancel";
|
||||
|
||||
macro_rules! blocking_fn {
|
||||
($self:ident, $fn:ident) => {{
|
||||
let (tx, rx) = sync_channel(0);
|
||||
@@ -89,14 +92,13 @@ impl<R: Runtime> Dialog<R> {
|
||||
/// - Ask dialog:
|
||||
///
|
||||
/// ```
|
||||
/// use tauri_plugin_dialog::DialogExt;
|
||||
/// use tauri_plugin_dialog::{DialogExt, MessageDialogButtons};
|
||||
///
|
||||
/// tauri::Builder::default()
|
||||
/// .setup(|app| {
|
||||
/// app.dialog()
|
||||
/// .message("Are you sure?")
|
||||
/// .ok_button_label("Yes")
|
||||
/// .cancel_button_label("No")
|
||||
/// .buttons(MessageDialogButtons::OkCancelCustom("Yes", "No"))
|
||||
/// .show(|yes| {
|
||||
/// println!("user said {}", if yes { "yes" } else { "no" });
|
||||
/// });
|
||||
@@ -107,13 +109,13 @@ impl<R: Runtime> Dialog<R> {
|
||||
/// - Message dialog with OK button:
|
||||
///
|
||||
/// ```
|
||||
/// use tauri_plugin_dialog::DialogExt;
|
||||
/// use tauri_plugin_dialog::{DialogExt, MessageDialogButtons};
|
||||
///
|
||||
/// tauri::Builder::default()
|
||||
/// .setup(|app| {
|
||||
/// app.dialog()
|
||||
/// .message("Job completed successfully")
|
||||
/// .ok_button_label("Ok")
|
||||
/// .buttons(MessageDialogButtons::Ok)
|
||||
/// .show(|_| {
|
||||
/// println!("dialog closed");
|
||||
/// });
|
||||
@@ -129,7 +131,7 @@ impl<R: Runtime> Dialog<R> {
|
||||
/// but note that it cannot be executed on the main thread as it will freeze your application.
|
||||
///
|
||||
/// ```
|
||||
/// use tauri_plugin_dialog::DialogExt;
|
||||
/// use tauri_plugin_dialog::{DialogExt, MessageDialogButtons};
|
||||
///
|
||||
/// tauri::Builder::default()
|
||||
/// .setup(|app| {
|
||||
@@ -137,8 +139,7 @@ impl<R: Runtime> Dialog<R> {
|
||||
/// std::thread::spawn(move || {
|
||||
/// let yes = handle.dialog()
|
||||
/// .message("Are you sure?")
|
||||
/// .ok_button_label("Yes")
|
||||
/// .cancel_button_label("No")
|
||||
/// .buttons(MessageDialogButtons::OkCancelCustom("Yes", "No"))
|
||||
/// .blocking_show();
|
||||
/// });
|
||||
///
|
||||
@@ -196,10 +197,9 @@ pub struct MessageDialogBuilder<R: Runtime> {
|
||||
pub(crate) title: String,
|
||||
pub(crate) message: String,
|
||||
pub(crate) kind: MessageDialogKind,
|
||||
pub(crate) ok_button_label: Option<String>,
|
||||
pub(crate) cancel_button_label: Option<String>,
|
||||
pub(crate) buttons: MessageDialogButtons,
|
||||
#[cfg(desktop)]
|
||||
pub(crate) parent: Option<raw_window_handle::RawWindowHandle>,
|
||||
pub(crate) parent: Option<crate::desktop::WindowHandle>,
|
||||
}
|
||||
|
||||
/// Payload for the message dialog mobile API.
|
||||
@@ -210,8 +210,8 @@ pub(crate) struct MessageDialogPayload<'a> {
|
||||
title: &'a String,
|
||||
message: &'a String,
|
||||
kind: &'a MessageDialogKind,
|
||||
ok_button_label: &'a Option<String>,
|
||||
cancel_button_label: &'a Option<String>,
|
||||
ok_button_label: Option<&'a str>,
|
||||
cancel_button_label: Option<&'a str>,
|
||||
}
|
||||
|
||||
// raw window handle :(
|
||||
@@ -225,8 +225,7 @@ impl<R: Runtime> MessageDialogBuilder<R> {
|
||||
title: title.into(),
|
||||
message: message.into(),
|
||||
kind: Default::default(),
|
||||
ok_button_label: None,
|
||||
cancel_button_label: None,
|
||||
buttons: Default::default(),
|
||||
#[cfg(desktop)]
|
||||
parent: None,
|
||||
}
|
||||
@@ -234,12 +233,20 @@ 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::OkCustom(ok) => (Some(ok.as_str()), Some(CANCEL)),
|
||||
MessageDialogButtons::OkCancelCustom(ok, cancel) => {
|
||||
(Some(ok.as_str()), Some(cancel.as_str()))
|
||||
}
|
||||
};
|
||||
MessageDialogPayload {
|
||||
title: &self.title,
|
||||
message: &self.message,
|
||||
kind: &self.kind,
|
||||
ok_button_label: &self.ok_button_label,
|
||||
cancel_button_label: &self.cancel_button_label,
|
||||
ok_button_label,
|
||||
cancel_button_label,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,27 +257,25 @@ impl<R: Runtime> MessageDialogBuilder<R> {
|
||||
}
|
||||
|
||||
/// Set parent windows explicitly (optional)
|
||||
///
|
||||
/// ## Platform-specific
|
||||
///
|
||||
/// - **Linux:** Unsupported.
|
||||
#[cfg(desktop)]
|
||||
pub fn parent<W: raw_window_handle::HasWindowHandle>(mut self, parent: &W) -> Self {
|
||||
if let Ok(h) = parent.window_handle() {
|
||||
self.parent.replace(h.as_raw());
|
||||
pub fn parent<W: raw_window_handle::HasWindowHandle + raw_window_handle::HasDisplayHandle>(
|
||||
mut self,
|
||||
parent: &W,
|
||||
) -> Self {
|
||||
if let (Ok(window_handle), Ok(display_handle)) =
|
||||
(parent.window_handle(), parent.display_handle())
|
||||
{
|
||||
self.parent.replace(crate::desktop::WindowHandle::new(
|
||||
window_handle.as_raw(),
|
||||
display_handle.as_raw(),
|
||||
));
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the label for the OK button.
|
||||
pub fn ok_button_label(mut self, label: impl Into<String>) -> Self {
|
||||
self.ok_button_label.replace(label.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the label for the Cancel button.
|
||||
pub fn cancel_button_label(mut self, label: impl Into<String>) -> Self {
|
||||
self.cancel_button_label.replace(label.into());
|
||||
/// Sets the dialog buttons.
|
||||
pub fn buttons(mut self, buttons: MessageDialogButtons) -> Self {
|
||||
self.buttons = buttons;
|
||||
self
|
||||
}
|
||||
|
||||
@@ -314,7 +319,7 @@ pub struct FileDialogBuilder<R: Runtime> {
|
||||
pub(crate) title: Option<String>,
|
||||
pub(crate) can_create_directories: Option<bool>,
|
||||
#[cfg(desktop)]
|
||||
pub(crate) parent: Option<raw_window_handle::RawWindowHandle>,
|
||||
pub(crate) parent: Option<crate::desktop::WindowHandle>,
|
||||
}
|
||||
|
||||
#[cfg(mobile)]
|
||||
@@ -380,9 +385,19 @@ impl<R: Runtime> FileDialogBuilder<R> {
|
||||
/// Sets the parent window of the dialog.
|
||||
#[cfg(desktop)]
|
||||
#[must_use]
|
||||
pub fn set_parent<W: raw_window_handle::HasWindowHandle>(mut self, parent: &W) -> Self {
|
||||
if let Ok(h) = parent.window_handle() {
|
||||
self.parent.replace(h.as_raw());
|
||||
pub fn set_parent<
|
||||
W: raw_window_handle::HasWindowHandle + raw_window_handle::HasDisplayHandle,
|
||||
>(
|
||||
mut self,
|
||||
parent: &W,
|
||||
) -> Self {
|
||||
if let (Ok(window_handle), Ok(display_handle)) =
|
||||
(parent.window_handle(), parent.display_handle())
|
||||
{
|
||||
self.parent.replace(crate::desktop::WindowHandle::new(
|
||||
window_handle.as_raw(),
|
||||
display_handle.as_raw(),
|
||||
));
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
@@ -49,3 +49,18 @@ impl Serialize for MessageDialogKind {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Set of button that will be displayed on the dialog
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub enum MessageDialogButtons {
|
||||
#[default]
|
||||
/// A single `Ok` button with OS default dialog text
|
||||
Ok,
|
||||
/// 2 buttons `Ok` and `Cancel` with OS default dialog texts
|
||||
OkCancel,
|
||||
/// A single `Ok` button with custom text
|
||||
OkCustom(String),
|
||||
/// 2 buttons `Ok` and `Cancel` with custom texts
|
||||
OkCancelCustom(String, String),
|
||||
}
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.6]
|
||||
|
||||
- [`fc9b189e`](https://github.com/tauri-apps/plugins-workspace/commit/fc9b189e83a29bd750714ec6336133c6eabdfa20) ([#1837](https://github.com/tauri-apps/plugins-workspace/pull/1837) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fix failing to deserialize capability file when using an OS specific path in the scope that is not available on the current OS.
|
||||
|
||||
## \[2.0.0-rc.5]
|
||||
|
||||
- [`cc03ccf5`](https://github.com/tauri-apps/plugins-workspace/commit/cc03ccf5e0e4be8bbf50bbdebe957c84be7f779b) ([#1774](https://github.com/tauri-apps/plugins-workspace/pull/1774)) Fix `scope-app`, `scope-app-recursive` and `scope-index` not properly enabling the application paths.
|
||||
|
||||
## \[2.0.0-rc.4]
|
||||
|
||||
- [`9291e4d2`](https://github.com/tauri-apps/plugins-workspace/commit/9291e4d2caa31c883c71e55f2193bd8754d72f03) ([#1640](https://github.com/tauri-apps/plugins-workspace/pull/1640) by [@SRutile](https://github.com/tauri-apps/plugins-workspace/../../SRutile)) Support any UTF-8 character in the writeFile API.
|
||||
|
||||
## \[2.0.0-rc.3]
|
||||
|
||||
- [`a2fe5551`](https://github.com/tauri-apps/plugins-workspace/commit/a2fe55512f908dd11c814ce021d164f01677572a) ([#1727](https://github.com/tauri-apps/plugins-workspace/pull/1727) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add utility methods on `FilePath` and `SafeFilePath` enums which are:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-fs"
|
||||
version = "2.0.0-rc.3"
|
||||
version = "2.0.0-rc.6"
|
||||
description = "Access the file system."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -13,6 +13,13 @@ links = "tauri-plugin-fs"
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.platforms.support]
|
||||
windows = { level = "full", notes = "" }
|
||||
linux = { level = "full", notes = "No write access to `$RESOURCES` folder" }
|
||||
macos = { level = "full", notes = "No write access to `$RESOURCES` folder" }
|
||||
android = { level = "partial", notes = "Access is restricted to Application folder by default" }
|
||||
ios = { level = "partial", notes = "Access is restricted to Application folder by default" }
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
schemars = { workspace = true }
|
||||
@@ -31,6 +38,7 @@ glob = "0.3"
|
||||
notify = { version = "6", optional = true, features = ["serde"] }
|
||||
notify-debouncer-full = { version = "0.3", optional = true }
|
||||
dunce = { workspace = true }
|
||||
percent-encoding = "2"
|
||||
|
||||
[features]
|
||||
watch = ["notify", "notify-debouncer-full"]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user