mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-14 14:27:48 +02:00
Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cbd593e76 | |||
| f7600b5fff | |||
| fb85e5dd76 | |||
| 6f3f66794a | |||
| 79d6e19c4b | |||
| aebd4f6185 | |||
| 341a5320c3 | |||
| cc03ccf5e0 | |||
| 009299ebec | |||
| 204e5aacad | |||
| 8a45c35160 | |||
| ebf821afd1 | |||
| 984110a978 | |||
| 2b898f0786 | |||
| b2269333e3 | |||
| 41afcae399 | |||
| 9291e4d2ca | |||
| 3715f3c9a6 | |||
| 253ae66210 | |||
| 949e2d6c45 | |||
| 64a6240f79 | |||
| 77680f6ed8 | |||
| 8c3a6a253d | |||
| 57fd28126c | |||
| a34fade500 | |||
| 713c54ef83 | |||
| a9b2a9af84 | |||
| c23b3d4bc8 | |||
| 0dd97d9115 | |||
| 3912800db3 | |||
| c23d7c51f6 | |||
| 5906cf4335 | |||
| d4a54157f0 | |||
| 3d301c654e | |||
| 12e80ffe00 | |||
| a2fe55512f | |||
| d00519e3e3 | |||
| 6995127778 |
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"barcode-scanner": patch
|
||||
---
|
||||
|
||||
Remove unused Android dependencies.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"barcode-scanner": patch
|
||||
---
|
||||
|
||||
Validate missing `NSCameraUsageDescription` Info.plist value.
|
||||
@@ -268,7 +268,8 @@
|
||||
},
|
||||
"single-instance": {
|
||||
"path": "./plugins/single-instance",
|
||||
"manager": "rust"
|
||||
"manager": "rust",
|
||||
"dependencies": ["deep-link"]
|
||||
},
|
||||
"sql": {
|
||||
"path": "./plugins/sql",
|
||||
|
||||
@@ -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
|
||||
"deep-link-js": patch
|
||||
---
|
||||
|
||||
Implement `get_current` on Linux and Windows.
|
||||
@@ -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
|
||||
---
|
||||
|
||||
Added `register_all` to register all desktop schemes - useful for Linux to not require a formal AppImage installation.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"dialog": patch
|
||||
---
|
||||
|
||||
Update Tauri scopes (asset protocol) when using the `open()` command to select directories.
|
||||
@@ -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 @@
|
||||
---
|
||||
"window-state": patch
|
||||
---
|
||||
|
||||
Fix can't restore a minimized window's size and position properly
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
"fs": patch
|
||||
"dialog": patch
|
||||
---
|
||||
|
||||
Add utility methods on `FilePath` and `SafeFilePath` enums which are:
|
||||
|
||||
- `path`
|
||||
- `simplified`
|
||||
- `into_path`
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"fs": patch
|
||||
"dialog": patch
|
||||
---
|
||||
|
||||
Implement `Serialize`, `Deserialize`, `From`, `TryFrom` and `FromStr` traits for `FilePath` and `SafeFilePath` enums.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"fs": patch
|
||||
"dialog": patch
|
||||
---
|
||||
|
||||
Mark `Error` enum as `#[non_exhuastive]`.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"fs": patch
|
||||
"dialog": patch
|
||||
---
|
||||
|
||||
Add `SafeFilePath` enum.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fs": patch
|
||||
---
|
||||
|
||||
Support any UTF-8 character in the writeFile API.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
The notification body is now optional on iOS to match the other platforms.
|
||||
+24
-1
@@ -2,34 +2,57 @@
|
||||
"tag": "rc",
|
||||
"changes": [
|
||||
".changes/android-dialog-save.md",
|
||||
".changes/barcode-dependencies.md",
|
||||
".changes/barcode-scanner-validate-plist.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/dialog-asset-scope.md",
|
||||
".changes/dialog-file-response-non-exhaustive.md",
|
||||
".changes/dialog-return-path.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-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/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-release.md",
|
||||
".changes/global-shortcut-0.6.md",
|
||||
".changes/haptics-release.md",
|
||||
".changes/iife-varname-spacing.md",
|
||||
".changes/ios-dialog-save.md",
|
||||
".changes/notification-body-optional-ios.md",
|
||||
".changes/notification-permission-type-change.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/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-remove-mobile-plugin.md",
|
||||
".changes/swift-build-older-versions.md",
|
||||
".changes/tauri-rc-8.md",
|
||||
".changes/update-fs-api-docs.md",
|
||||
".changes/update-tauri-rc-12.md",
|
||||
".changes/update-tauri-rc-3.md",
|
||||
".changes/updater-js-headers-download.md"
|
||||
".changes/updater-js-headers-download-crate.md",
|
||||
".changes/updater-js-headers-download.md",
|
||||
".changes/window-state-physical-size.md"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"single-instance": patch
|
||||
---
|
||||
|
||||
Integrate with the deep link plugin out of the box.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"single-instance": "patch"
|
||||
---
|
||||
|
||||
Put deep link integration behined a feature
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"sql": patch
|
||||
---
|
||||
|
||||
Added support for `UUID` columns to the postgres implementation.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Update to tauri 2.0.0-rc.12.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": "patch"
|
||||
---
|
||||
|
||||
Add a second argument in `Update.download` and `Update.donloadAndInstall` JS APIs to modify headers and timeout when downloading the update.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": patch:breaking
|
||||
---
|
||||
|
||||
Window's size is now stored in physical size instead of logical size
|
||||
+6
-2
@@ -12,11 +12,15 @@ pnpm-lock.yaml
|
||||
|
||||
# examples gen directory
|
||||
examples/*/src-tauri/gen/
|
||||
plugins/examples/*/src-tauri/gen/
|
||||
plugins/*/examples/*/src-tauri/gen/
|
||||
|
||||
# autogenerated files
|
||||
**/autogenerated/**/*.md
|
||||
api-iife.js
|
||||
init-iife.js
|
||||
CHANGELOG.md
|
||||
*schema.json
|
||||
*schema.json
|
||||
|
||||
# mobile build
|
||||
**/ios/.build
|
||||
**/.tauri
|
||||
|
||||
Generated
+317
-409
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.8", default-features = false }
|
||||
tauri-build = "2.0.0-rc.7"
|
||||
tauri-plugin = "2.0.0-rc.7"
|
||||
tauri-utils = "2.0.0-rc.7"
|
||||
tauri = { version = "2.0.0-rc.12", default-features = false }
|
||||
tauri-build = "2.0.0-rc.11"
|
||||
tauri-plugin = "2.0.0-rc.11"
|
||||
tauri-utils = "2.0.0-rc.11"
|
||||
serde_json = "1"
|
||||
thiserror = "1"
|
||||
url = "2"
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## \[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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "svelte-app",
|
||||
"private": true,
|
||||
"version": "2.0.0-rc.3",
|
||||
"version": "2.0.0-rc.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --clearScreen false",
|
||||
@@ -10,10 +10,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-rc.4",
|
||||
"@tauri-apps/plugin-barcode-scanner": "2.0.0-rc.1",
|
||||
"@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-global-shortcut": "2.0.0-rc.1",
|
||||
@@ -31,7 +31,7 @@
|
||||
"@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.10",
|
||||
"@tauri-apps/cli": "2.0.0-rc.14",
|
||||
"@unocss/extractor-svelte": "^0.62.0",
|
||||
"svelte": "^4.2.19",
|
||||
"unocss": "^0.62.0",
|
||||
|
||||
@@ -1,5 +1,39 @@
|
||||
# Changelog
|
||||
|
||||
## \[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
|
||||
|
||||
- Upgraded to `barcode-scanner@2.0.0-rc.4`
|
||||
- Upgraded to `notification@2.0.0-rc.4`
|
||||
|
||||
## \[2.0.0-rc.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-rc.3`
|
||||
- Upgraded to `dialog@2.0.0-rc.5`
|
||||
- Upgraded to `updater@2.0.0-rc.3`
|
||||
- Upgraded to `http@2.0.0-rc.3`
|
||||
|
||||
## \[2.0.0-rc.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "api"
|
||||
publish = false
|
||||
version = "2.0.0-rc.3"
|
||||
version = "2.0.0-rc.7"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
rust-version = { workspace = true }
|
||||
@@ -20,15 +20,15 @@ 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.2", features = [
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-rc.5", 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.4" }
|
||||
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.7" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [
|
||||
"multipart",
|
||||
], version = "2.0.0-rc.2" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-rc.3", features = [
|
||||
], version = "2.0.0-rc.5" }
|
||||
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" }
|
||||
@@ -52,15 +52,13 @@ 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-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-rc.2" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-rc.2" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-rc.3" }
|
||||
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.3" }
|
||||
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"
|
||||
|
||||
[features]
|
||||
prod = ["tauri/custom-protocol"]
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Request camera access for WebRTC</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>Request microphone access for WebRTC</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Request camera access for WebRTC</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>Request microphone access for WebRTC</string>
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>Authenticate with biometrics</string>
|
||||
<key>NFCReaderUsageDescription</key>
|
||||
<string>Read and write to NFC tags for testing</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 54;
|
||||
objectVersion = 56;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
@@ -22,26 +22,26 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0E96CE07CD20273DD46BF325 /* main.rs */ = {isa = PBXFileReference; path = main.rs; sourceTree = "<group>"; };
|
||||
1C1AB1B414CA2795AFBEDDB9 /* tray.rs */ = {isa = PBXFileReference; path = tray.rs; sourceTree = "<group>"; };
|
||||
0E96CE07CD20273DD46BF325 /* main.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = main.rs; sourceTree = "<group>"; };
|
||||
1C1AB1B414CA2795AFBEDDB9 /* tray.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = tray.rs; sourceTree = "<group>"; };
|
||||
248286BAA086BB1A5F98B2B2 /* libapp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libapp.a; sourceTree = "<group>"; };
|
||||
2F63E2AA460089BB58D40C79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
338E66700FD330B99D434DD7 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
|
||||
384966E551417F94A02D2706 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
4B2D1B108AE002010BDEC6D2 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
59CFE20DCF760BE67D9CE3D6 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
5AC703CEBA41A121596066F3 /* api_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = api_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
5AC703CEBA41A121596066F3 /* Tauri API.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tauri API.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
62601E25FA39E62BE119B74D /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
|
||||
6B7E79E23E646BA7968B457C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
71EB788DE4662CFC0D97F567 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
74A8FDFB350B966F5AAD4A24 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = SOURCE_ROOT; };
|
||||
785D025E9542F7E098BF22B5 /* lib.rs */ = {isa = PBXFileReference; path = lib.rs; sourceTree = "<group>"; };
|
||||
785D025E9542F7E098BF22B5 /* lib.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = lib.rs; sourceTree = "<group>"; };
|
||||
879941AE3DAA14534BBC6391 /* api_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = api_iOS.entitlements; sourceTree = "<group>"; };
|
||||
90D3B673AFAB8D8AB561F616 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
|
||||
B6082E363D51372A7658C351 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
DC377692DC31A070A0188C9D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
EC8C7948C50C3C9B5D96CB61 /* bindings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bindings.h; sourceTree = "<group>"; };
|
||||
F835F52713CE8F029D5D252C /* cmd.rs */ = {isa = PBXFileReference; path = cmd.rs; sourceTree = "<group>"; };
|
||||
F835F52713CE8F029D5D252C /* cmd.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = cmd.rs; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -104,7 +104,7 @@
|
||||
4AC51E67B71E27F15B02C5CD /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5AC703CEBA41A121596066F3 /* api_iOS.app */,
|
||||
5AC703CEBA41A121596066F3 /* Tauri API.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -172,7 +172,7 @@
|
||||
);
|
||||
name = api_iOS;
|
||||
productName = api_iOS;
|
||||
productReference = 5AC703CEBA41A121596066F3 /* api_iOS.app */;
|
||||
productReference = 5AC703CEBA41A121596066F3 /* Tauri API.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@@ -386,6 +386,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = Q93MBH6S2F;
|
||||
ENABLE_BITCODE = NO;
|
||||
"EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64";
|
||||
@@ -395,19 +396,37 @@
|
||||
"\".\"",
|
||||
);
|
||||
INFOPLIST_FILE = api_iOS/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = "$(inherited) $(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)";
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)";
|
||||
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)";
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)",
|
||||
"$(SDKROOT)/usr/lib/swift",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64]" = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)",
|
||||
"$(SDKROOT)/usr/lib/swift",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)",
|
||||
"$(SDKROOT)/usr/lib/swift",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api;
|
||||
PRODUCT_NAME = "Tauri API";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALID_ARCHS = "arm64 arm64-sim";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
};
|
||||
name = debug;
|
||||
};
|
||||
@@ -422,6 +441,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = Q93MBH6S2F;
|
||||
ENABLE_BITCODE = NO;
|
||||
"EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64";
|
||||
@@ -431,19 +451,37 @@
|
||||
"\".\"",
|
||||
);
|
||||
INFOPLIST_FILE = api_iOS/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = "$(inherited) $(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)";
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64]" = "$(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)";
|
||||
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = "$(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)";
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)",
|
||||
"$(SDKROOT)/usr/lib/swift",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64]" = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)",
|
||||
"$(SDKROOT)/usr/lib/swift",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION)",
|
||||
"$(SDKROOT)/usr/lib/swift",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
|
||||
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api;
|
||||
PRODUCT_NAME = "Tauri API";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALID_ARCHS = "arm64 arm64-sim";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
};
|
||||
name = release;
|
||||
};
|
||||
|
||||
@@ -40,9 +40,13 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>Authenticate with biometrics</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Request camera access for WebRTC</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>Request microphone access for WebRTC</string>
|
||||
<key>NFCReaderUsageDescription</key>
|
||||
<string>Read and write to NFC tags for testing</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,5 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
<dict>
|
||||
<key>com.apple.developer.nfc.readersession.formats</key>
|
||||
<array>
|
||||
<string>TAG</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -2,7 +2,7 @@ name: api
|
||||
options:
|
||||
bundleIdPrefix: com.tauri.api
|
||||
deploymentTarget:
|
||||
iOS: 13.0
|
||||
iOS: 14.0
|
||||
fileGroups: [../../src]
|
||||
configs:
|
||||
debug: debug
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -150,42 +150,42 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-meta -> This allows non-recursive read access to metadata of the `$APP` folder, including file listing and statistics.",
|
||||
"description": "fs:allow-app-meta -> This allows non-recursive read access to metadata of the application folders, including file listing and statistics.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-meta"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-meta-recursive -> This allows full recursive read access to metadata of the `$APP` folder, including file listing and statistics.",
|
||||
"description": "fs:allow-app-meta-recursive -> This allows full recursive read access to metadata of the application folders, including file listing and statistics.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-meta-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-read -> This allows non-recursive read access to the `$APP` folder.",
|
||||
"description": "fs:allow-app-read -> This allows non-recursive read access to the application folders.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-read"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-read-recursive -> This allows full recursive read access to the complete `$APP` folder, files and subdirectories.",
|
||||
"description": "fs:allow-app-read-recursive -> This allows full recursive read access to the complete application folders, files and subdirectories.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-read-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-write -> This allows non-recursive write access to the `$APP` folder.",
|
||||
"description": "fs:allow-app-write -> This allows non-recursive write access to the application folders.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-write"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-write-recursive -> This allows full recursive write access to the complete `$APP` folder, files and subdirectories.",
|
||||
"description": "fs:allow-app-write-recursive -> This allows full recursive write access to the complete application folders, files and subdirectories.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-write-recursive"
|
||||
@@ -1606,28 +1606,28 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app -> This scope permits access to all files and list content of top level directories in the `$APP`folder.",
|
||||
"description": "fs:scope-app -> This scope permits access to all files and list content of top level directories in the application folders.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-index -> This scope permits to list all files and folders in the `$APP`folder.",
|
||||
"description": "fs:scope-app-index -> This scope permits to list all files and folders in the application directories.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-index"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete application folders, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder.",
|
||||
"description": "fs:scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appcache"
|
||||
@@ -1648,7 +1648,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder.",
|
||||
"description": "fs:scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appconfig"
|
||||
@@ -1669,7 +1669,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA`folder.",
|
||||
"description": "fs:scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appdata"
|
||||
@@ -1690,7 +1690,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder.",
|
||||
"description": "fs:scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applocaldata"
|
||||
@@ -1711,7 +1711,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG`folder.",
|
||||
"description": "fs:scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applog"
|
||||
@@ -1732,7 +1732,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO`folder.",
|
||||
"description": "fs:scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-audio"
|
||||
@@ -1753,7 +1753,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE`folder.",
|
||||
"description": "fs:scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-cache"
|
||||
@@ -1774,7 +1774,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG`folder.",
|
||||
"description": "fs:scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-config"
|
||||
@@ -1795,7 +1795,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA`folder.",
|
||||
"description": "fs:scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-data"
|
||||
@@ -1816,7 +1816,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder.",
|
||||
"description": "fs:scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-desktop"
|
||||
@@ -1837,7 +1837,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder.",
|
||||
"description": "fs:scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-document"
|
||||
@@ -1858,7 +1858,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder.",
|
||||
"description": "fs:scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-download"
|
||||
@@ -1879,7 +1879,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE`folder.",
|
||||
"description": "fs:scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-exe"
|
||||
@@ -1900,7 +1900,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT`folder.",
|
||||
"description": "fs:scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-font"
|
||||
@@ -1921,7 +1921,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME`folder.",
|
||||
"description": "fs:scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-home"
|
||||
@@ -1942,7 +1942,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder.",
|
||||
"description": "fs:scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-localdata"
|
||||
@@ -1963,7 +1963,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG`folder.",
|
||||
"description": "fs:scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-log"
|
||||
@@ -1984,7 +1984,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE`folder.",
|
||||
"description": "fs:scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-picture"
|
||||
@@ -2005,7 +2005,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder.",
|
||||
"description": "fs:scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-public"
|
||||
@@ -2026,7 +2026,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder.",
|
||||
"description": "fs:scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-resource"
|
||||
@@ -2047,7 +2047,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder.",
|
||||
"description": "fs:scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-runtime"
|
||||
@@ -2068,7 +2068,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP`folder.",
|
||||
"description": "fs:scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-temp"
|
||||
@@ -2089,7 +2089,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder.",
|
||||
"description": "fs:scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-template"
|
||||
@@ -2110,7 +2110,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO`folder.",
|
||||
"description": "fs:scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-video"
|
||||
@@ -2427,7 +2427,7 @@
|
||||
]
|
||||
},
|
||||
"cmd": {
|
||||
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
||||
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
@@ -2462,7 +2462,7 @@
|
||||
]
|
||||
},
|
||||
"cmd": {
|
||||
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
||||
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
@@ -4746,42 +4746,42 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-meta -> This allows non-recursive read access to metadata of the `$APP` folder, including file listing and statistics.",
|
||||
"description": "fs:allow-app-meta -> This allows non-recursive read access to metadata of the application folders, including file listing and statistics.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-meta"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-meta-recursive -> This allows full recursive read access to metadata of the `$APP` folder, including file listing and statistics.",
|
||||
"description": "fs:allow-app-meta-recursive -> This allows full recursive read access to metadata of the application folders, including file listing and statistics.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-meta-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-read -> This allows non-recursive read access to the `$APP` folder.",
|
||||
"description": "fs:allow-app-read -> This allows non-recursive read access to the application folders.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-read"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-read-recursive -> This allows full recursive read access to the complete `$APP` folder, files and subdirectories.",
|
||||
"description": "fs:allow-app-read-recursive -> This allows full recursive read access to the complete application folders, files and subdirectories.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-read-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-write -> This allows non-recursive write access to the `$APP` folder.",
|
||||
"description": "fs:allow-app-write -> This allows non-recursive write access to the application folders.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-write"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:allow-app-write-recursive -> This allows full recursive write access to the complete `$APP` folder, files and subdirectories.",
|
||||
"description": "fs:allow-app-write-recursive -> This allows full recursive write access to the complete application folders, files and subdirectories.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:allow-app-write-recursive"
|
||||
@@ -6209,28 +6209,28 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app -> This scope permits access to all files and list content of top level directories in the `$APP`folder.",
|
||||
"description": "fs:scope-app -> This scope permits access to all files and list content of top level directories in the application folders.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-index -> This scope permits to list all files and folders in the `$APP`folder.",
|
||||
"description": "fs:scope-app-index -> This scope permits to list all files and folders in the application directories.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-index"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete `$APP` folder, including sub directories and files.",
|
||||
"description": "fs:scope-app-recursive -> This scope permits recursive access to the complete application folders, including sub directories and files.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-app-recursive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder.",
|
||||
"description": "fs:scope-appcache -> This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appcache"
|
||||
@@ -6251,7 +6251,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder.",
|
||||
"description": "fs:scope-appconfig -> This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appconfig"
|
||||
@@ -6272,7 +6272,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA`folder.",
|
||||
"description": "fs:scope-appdata -> This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-appdata"
|
||||
@@ -6293,7 +6293,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder.",
|
||||
"description": "fs:scope-applocaldata -> This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applocaldata"
|
||||
@@ -6314,7 +6314,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG`folder.",
|
||||
"description": "fs:scope-applog -> This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-applog"
|
||||
@@ -6335,7 +6335,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO`folder.",
|
||||
"description": "fs:scope-audio -> This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-audio"
|
||||
@@ -6356,7 +6356,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE`folder.",
|
||||
"description": "fs:scope-cache -> This scope permits access to all files and list content of top level directories in the `$CACHE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-cache"
|
||||
@@ -6377,7 +6377,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG`folder.",
|
||||
"description": "fs:scope-config -> This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-config"
|
||||
@@ -6398,7 +6398,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA`folder.",
|
||||
"description": "fs:scope-data -> This scope permits access to all files and list content of top level directories in the `$DATA` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-data"
|
||||
@@ -6419,7 +6419,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP`folder.",
|
||||
"description": "fs:scope-desktop -> This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-desktop"
|
||||
@@ -6440,7 +6440,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT`folder.",
|
||||
"description": "fs:scope-document -> This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-document"
|
||||
@@ -6461,7 +6461,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD`folder.",
|
||||
"description": "fs:scope-download -> This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-download"
|
||||
@@ -6482,7 +6482,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE`folder.",
|
||||
"description": "fs:scope-exe -> This scope permits access to all files and list content of top level directories in the `$EXE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-exe"
|
||||
@@ -6503,7 +6503,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT`folder.",
|
||||
"description": "fs:scope-font -> This scope permits access to all files and list content of top level directories in the `$FONT` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-font"
|
||||
@@ -6524,7 +6524,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME`folder.",
|
||||
"description": "fs:scope-home -> This scope permits access to all files and list content of top level directories in the `$HOME` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-home"
|
||||
@@ -6545,7 +6545,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA`folder.",
|
||||
"description": "fs:scope-localdata -> This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-localdata"
|
||||
@@ -6566,7 +6566,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG`folder.",
|
||||
"description": "fs:scope-log -> This scope permits access to all files and list content of top level directories in the `$LOG` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-log"
|
||||
@@ -6587,7 +6587,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE`folder.",
|
||||
"description": "fs:scope-picture -> This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-picture"
|
||||
@@ -6608,7 +6608,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC`folder.",
|
||||
"description": "fs:scope-public -> This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-public"
|
||||
@@ -6629,7 +6629,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE`folder.",
|
||||
"description": "fs:scope-resource -> This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-resource"
|
||||
@@ -6650,7 +6650,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME`folder.",
|
||||
"description": "fs:scope-runtime -> This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-runtime"
|
||||
@@ -6671,7 +6671,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP`folder.",
|
||||
"description": "fs:scope-temp -> This scope permits access to all files and list content of top level directories in the `$TEMP` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-temp"
|
||||
@@ -6692,7 +6692,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE`folder.",
|
||||
"description": "fs:scope-template -> This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-template"
|
||||
@@ -6713,7 +6713,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "fs:scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO`folder.",
|
||||
"description": "fs:scope-video -> This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fs:scope-video"
|
||||
|
||||
@@ -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())?;
|
||||
}
|
||||
@@ -63,8 +65,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",
|
||||
@@ -100,6 +100,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"iOS": {
|
||||
"minimumSystemVersion": "14.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
+5
-5
@@ -10,20 +10,20 @@
|
||||
"format:check": "prettier --check ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.9.1",
|
||||
"@eslint/js": "9.10.0",
|
||||
"@rollup/plugin-node-resolve": "15.2.3",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
"@rollup/plugin-typescript": "11.1.6",
|
||||
"@types/eslint__js": "8.42.3",
|
||||
"covector": "^0.12.0",
|
||||
"eslint": "9.9.1",
|
||||
"eslint": "9.10.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-security": "3.0.1",
|
||||
"prettier": "3.3.3",
|
||||
"rollup": "4.21.2",
|
||||
"rollup": "4.21.3",
|
||||
"tslib": "2.7.0",
|
||||
"typescript": "5.5.4",
|
||||
"typescript-eslint": "8.4.0"
|
||||
"typescript": "5.6.2",
|
||||
"typescript-eslint": "8.5.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"semver": ">=7.5.2",
|
||||
|
||||
@@ -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,14 @@
|
||||
# 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.
|
||||
- [`8c3a6a25`](https://github.com/tauri-apps/plugins-workspace/commit/8c3a6a253d7029d370659d2102f91a458745d345) ([#1758](https://github.com/tauri-apps/plugins-workspace/pull/1758) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Validate missing `NSCameraUsageDescription` Info.plist value.
|
||||
|
||||
## \[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)) Use `PermissionState` from the `tauri` crate, which now also includes a "prompt with rationale" variant for Android (returned when your app must explain to the user why it needs the permission).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-barcode-scanner"
|
||||
version = "2.0.0-rc.3"
|
||||
version = "2.0.0-rc.4"
|
||||
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -47,9 +47,5 @@ dependencies {
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
implementation("com.journeyapps:zxing-android-embedded:4.3.0") {
|
||||
isTransitive = false
|
||||
}
|
||||
implementation("com.google.zxing:core:3.3.0")
|
||||
implementation(project(":tauri-android"))
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:hardwareAccelerated="true">
|
||||
|
||||
<!-- Paste the following line into the AndroidManifest.xml of your project -->
|
||||
<!-- See also: https://capacitorjs.com/docs/plugins/android#manifest -->
|
||||
<!-- <uses-feature android:name="android.hardware.camera" android:required="false" /> -->
|
||||
|
||||
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera.any"/>
|
||||
</manifest>
|
||||
|
||||
@@ -42,7 +42,6 @@ import app.tauri.annotation.Permission
|
||||
import app.tauri.annotation.PermissionCallback
|
||||
import app.tauri.annotation.TauriPlugin
|
||||
import app.tauri.plugin.Invoke
|
||||
import app.tauri.plugin.JSArray
|
||||
import app.tauri.plugin.JSObject
|
||||
import app.tauri.plugin.Plugin
|
||||
import com.google.common.util.concurrent.ListenableFuture
|
||||
@@ -50,7 +49,6 @@ import com.google.mlkit.vision.barcode.BarcodeScannerOptions
|
||||
import com.google.mlkit.vision.barcode.BarcodeScanning
|
||||
import com.google.mlkit.vision.barcode.common.Barcode
|
||||
import com.google.mlkit.vision.common.InputImage
|
||||
import org.json.JSONException
|
||||
import java.util.Collections
|
||||
import java.util.concurrent.ExecutionException
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -9,8 +9,8 @@ import WebKit
|
||||
|
||||
struct ScanOptions: Decodable {
|
||||
var formats: [SupportedFormat]?
|
||||
let windowed: Bool?
|
||||
let cameraDirection: String?
|
||||
var windowed: Bool?
|
||||
var cameraDirection: String?
|
||||
}
|
||||
|
||||
enum SupportedFormat: String, CaseIterable, Decodable {
|
||||
@@ -262,6 +262,13 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
|
||||
|
||||
self.invoke = invoke
|
||||
|
||||
let entry = Bundle.main.infoDictionary?["NSCameraUsageDescription"] as? String
|
||||
|
||||
if entry == nil || entry?.count == 0 {
|
||||
invoke.reject("NSCameraUsageDescription is not in the app Info.plist")
|
||||
return
|
||||
}
|
||||
|
||||
var iOS14min: Bool = false
|
||||
if #available(iOS 14.0, *) { iOS14min = true }
|
||||
if !iOS14min && self.getPermissionState() != "granted" {
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ class BiometricStatus {
|
||||
struct AuthOptions: Decodable {
|
||||
let reason: String
|
||||
var allowDeviceCredential: Bool?
|
||||
let fallbackTitle: String?
|
||||
let cancelTitle: String?
|
||||
var fallbackTitle: String?
|
||||
var cancelTitle: String?
|
||||
}
|
||||
|
||||
class BiometricPlugin: Plugin {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# Changelog
|
||||
|
||||
## \[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.
|
||||
|
||||
## \[2.0.0-rc.3]
|
||||
|
||||
- [`4654591d`](https://github.com/tauri-apps/plugins-workspace/commit/4654591d820403d6fa1a007fd55bb0d85947a6cc) ([#1732](https://github.com/tauri-apps/plugins-workspace/pull/1732) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Allow empty configuration values.
|
||||
@@ -104,3 +118,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.
|
||||
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.3"
|
||||
version = "2.0.0-rc.6"
|
||||
description = "Set your Tauri application as the default handler for an URL"
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -21,3 +21,5 @@ dist-ssr
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
dist/
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-rc.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `deep-link-js@2.0.0-rc.2`
|
||||
|
||||
## \[2.0.0-rc.0]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "deep-link-example",
|
||||
"private": true,
|
||||
"version": "2.0.0-rc.0",
|
||||
"version": "2.0.0-rc.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -11,10 +11,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-rc.4",
|
||||
"@tauri-apps/plugin-deep-link": "2.0.0-rc.1"
|
||||
"@tauri-apps/plugin-deep-link": "2.0.0-rc.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.0.0-rc.10",
|
||||
"@tauri-apps/cli": "2.0.0-rc.14",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.0.13"
|
||||
}
|
||||
|
||||
@@ -22,6 +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", 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,17 +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()
|
||||
#[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()
|
||||
@@ -20,9 +30,17 @@ pub fn run() {
|
||||
.build(),
|
||||
)
|
||||
.setup(|app| {
|
||||
app.listen("deep-link://new-url", |url| {
|
||||
dbg!(url);
|
||||
// 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
|
||||
// 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().on_open_url(|event| {
|
||||
dbg!(event.urls());
|
||||
});
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![greet])
|
||||
|
||||
@@ -29,8 +29,13 @@
|
||||
},
|
||||
"deep-link": {
|
||||
"mobile": [
|
||||
{ "host": "fabianlars.de", "pathPrefix": ["/intent"] },
|
||||
{ "host": "tauri.app" }
|
||||
{
|
||||
"host": "fabianlars.de",
|
||||
"pathPrefix": ["/intent"]
|
||||
},
|
||||
{
|
||||
"host": "tauri.app"
|
||||
}
|
||||
],
|
||||
"desktop": {
|
||||
"schemes": ["fabianlars", "my-tauri-app"]
|
||||
|
||||
@@ -14,7 +14,9 @@ import { type UnlistenFn, listen } from '@tauri-apps/api/event'
|
||||
* const urls = await getCurrent();
|
||||
* ```
|
||||
*
|
||||
* #### - **Windows / Linux**: Unsupported.
|
||||
* #### - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values.
|
||||
* 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..
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-deep-link",
|
||||
"version": "2.0.0-rc.1",
|
||||
"version": "2.0.0-rc.2",
|
||||
"description": "Set your Tauri application as the default handler for an URL",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
use serde::{Deserialize, Deserializer};
|
||||
use tauri_utils::config::DeepLinkProtocol;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct AssociatedDomain {
|
||||
#[serde(deserialize_with = "deserialize_associated_host")]
|
||||
pub host: String,
|
||||
@@ -29,7 +29,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct Config {
|
||||
/// Mobile requires `https://<host>` urls.
|
||||
#[serde(default)]
|
||||
@@ -41,7 +41,7 @@ pub struct Config {
|
||||
pub desktop: DesktopProtocol,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[derive(Deserialize, Clone)]
|
||||
#[serde(untagged)]
|
||||
#[allow(unused)] // Used in tauri-bundler
|
||||
pub enum DesktopProtocol {
|
||||
@@ -54,3 +54,26 @@ impl Default for DesktopProtocol {
|
||||
Self::List(Vec::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl DesktopProtocol {
|
||||
#[allow(dead_code)]
|
||||
pub fn contains_scheme(&self, scheme: &String) -> bool {
|
||||
match self {
|
||||
Self::One(protocol) => protocol.schemes.contains(scheme),
|
||||
Self::List(protocols) => protocols
|
||||
.iter()
|
||||
.any(|protocol| protocol.schemes.contains(scheme)),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn schemes(&self) -> Vec<String> {
|
||||
match self {
|
||||
Self::One(protocol) => protocol.schemes.clone(),
|
||||
Self::List(protocols) => protocols
|
||||
.iter()
|
||||
.flat_map(|protocol| protocol.schemes.clone())
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+145
-19
@@ -2,10 +2,11 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use serde::de::DeserializeOwned;
|
||||
use std::sync::Arc;
|
||||
|
||||
use tauri::{
|
||||
plugin::{Builder, PluginApi, TauriPlugin},
|
||||
AppHandle, Manager, Runtime,
|
||||
AppHandle, EventId, Listener, Manager, Runtime,
|
||||
};
|
||||
|
||||
mod commands;
|
||||
@@ -17,12 +18,14 @@ pub use error::{Error, Result};
|
||||
#[cfg(target_os = "android")]
|
||||
const PLUGIN_IDENTIFIER: &str = "app.tauri.deep_link";
|
||||
|
||||
fn init_deep_link<R: Runtime, C: DeserializeOwned>(
|
||||
fn init_deep_link<R: Runtime>(
|
||||
app: &AppHandle<R>,
|
||||
_api: PluginApi<R, C>,
|
||||
api: PluginApi<R, Option<config::Config>>,
|
||||
) -> crate::Result<DeepLink<R>> {
|
||||
#[cfg(target_os = "android")]
|
||||
{
|
||||
let _api = api;
|
||||
|
||||
use tauri::{
|
||||
ipc::{Channel, InvokeResponseBody},
|
||||
Emitter,
|
||||
@@ -56,22 +59,38 @@ fn init_deep_link<R: Runtime, C: DeserializeOwned>(
|
||||
},
|
||||
)?;
|
||||
|
||||
return Ok(DeepLink(handle));
|
||||
return Ok(DeepLink {
|
||||
app: app.clone(),
|
||||
plugin_handle: handle,
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
Ok(DeepLink {
|
||||
#[cfg(target_os = "ios")]
|
||||
return Ok(DeepLink {
|
||||
app: app.clone(),
|
||||
current: Default::default(),
|
||||
})
|
||||
config: api.config().clone(),
|
||||
});
|
||||
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
let args = std::env::args();
|
||||
let deep_link = DeepLink {
|
||||
app: app.clone(),
|
||||
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")]
|
||||
@@ -86,16 +105,21 @@ 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.
|
||||
///
|
||||
/// ## Platform-specific:
|
||||
///
|
||||
/// - **Windows / Linux**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
|
||||
/// - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values.
|
||||
/// 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)
|
||||
@@ -154,23 +178,76 @@ mod imp {
|
||||
|
||||
/// Access to the deep-link APIs.
|
||||
pub struct DeepLink<R: Runtime> {
|
||||
#[allow(dead_code)]
|
||||
pub(crate) app: AppHandle<R>,
|
||||
#[allow(dead_code)]
|
||||
pub(crate) current: Mutex<Option<Vec<url::Url>>>,
|
||||
pub(crate) config: Option<crate::config::Config>,
|
||||
}
|
||||
|
||||
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).
|
||||
///
|
||||
/// On Linux and Windows the deep links trigger a new app instance with the deep link URL as its only argument.
|
||||
///
|
||||
/// This function does what it can to verify if the argument is actually a deep link, though it could also be a regular CLI argument.
|
||||
/// To enhance its checks, we only match deep links against the schemes defined in the Tauri configuration
|
||||
/// i.e. dynamic schemes WON'T be processed.
|
||||
///
|
||||
/// 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, mut args: I) {
|
||||
use tauri::Emitter;
|
||||
|
||||
let Some(config) = &self.config else {
|
||||
return;
|
||||
};
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 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.
|
||||
///
|
||||
/// ## Platform-specific:
|
||||
///
|
||||
/// - **Windows / Linux**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
|
||||
/// - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values.
|
||||
/// 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>>> {
|
||||
#[cfg(not(any(windows, target_os = "linux")))]
|
||||
return Ok(self.current.lock().unwrap().clone());
|
||||
#[cfg(any(windows, target_os = "linux"))]
|
||||
Err(crate::Error::UnsupportedPlatform)
|
||||
}
|
||||
|
||||
/// Registers all schemes defined in the configuration file.
|
||||
///
|
||||
/// This is useful to ensure the schemes are registered even if the user did not install the app properly
|
||||
/// (e.g. an AppImage that was not properly registered with an AppImage launcher).
|
||||
pub fn register_all(&self) -> crate::Result<()> {
|
||||
let Some(config) = &self.config else {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
for scheme in config.desktop.schemes() {
|
||||
self.register(scheme)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Register the app as the default handler for the specified protocol.
|
||||
@@ -367,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> {
|
||||
@@ -379,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,34 @@
|
||||
# Changelog
|
||||
|
||||
## \[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:
|
||||
|
||||
- `path`
|
||||
- `simplified`
|
||||
- `into_path`
|
||||
- [`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)) Implement `Serialize`, `Deserialize`, `From`, `TryFrom` and `FromStr` traits for `FilePath` and `SafeFilePath` enums.
|
||||
- [`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)) Mark `Error` enum as `#[non_exhuastive]`.
|
||||
- [`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 `SafeFilePath` enum.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-rc.3`
|
||||
|
||||
## \[2.0.0-rc.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.0.0-rc.4"
|
||||
version = "2.0.0-rc.7"
|
||||
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -26,9 +26,8 @@ serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
dunce = { workspace = true }
|
||||
url = { workspace = true }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-rc.2" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-rc.5" }
|
||||
|
||||
[target.'cfg(target_os = "ios")'.dependencies]
|
||||
tauri = { workspace = true, features = ["wry"] }
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -132,14 +132,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.path() {
|
||||
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)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,10 +152,11 @@ pub(crate) async fn open<R: Runtime>(
|
||||
} else {
|
||||
let folder = dialog_builder.blocking_pick_folder();
|
||||
if let Some(folder) = &folder {
|
||||
if let Ok(path) = folder.path() {
|
||||
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,28 +165,31 @@ 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 {
|
||||
if let Ok(path) = file.path() {
|
||||
if let Ok(path) = file.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)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
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 {
|
||||
if let Ok(path) = file.path() {
|
||||
if let Ok(path) = file.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)?;
|
||||
}
|
||||
}
|
||||
OpenResponse::File(file.map(|f| f.simplified()))
|
||||
@@ -216,13 +223,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.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)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use serde::{ser::Serializer, Serialize};
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[non_exhaustive]
|
||||
pub enum Error {
|
||||
#[error(transparent)]
|
||||
Tauri(#[from] tauri::Error),
|
||||
@@ -20,8 +21,6 @@ pub enum Error {
|
||||
FolderPickerNotImplemented,
|
||||
#[error(transparent)]
|
||||
Fs(#[from] tauri_plugin_fs::Error),
|
||||
#[error("URL is not a valid path")]
|
||||
InvalidPathUrl,
|
||||
}
|
||||
|
||||
impl Serialize for Error {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde::Serialize;
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
Manager, Runtime,
|
||||
@@ -24,6 +24,7 @@ use std::{
|
||||
|
||||
pub use models::*;
|
||||
|
||||
pub use tauri_plugin_fs::FilePath;
|
||||
#[cfg(desktop)]
|
||||
mod desktop;
|
||||
#[cfg(mobile)]
|
||||
@@ -294,57 +295,6 @@ impl<R: Runtime> MessageDialogBuilder<R> {
|
||||
blocking_fn!(self, show)
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents either a filesystem path or a URI pointing to a file
|
||||
/// such as `file://` URIs or Android `content://` URIs.
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum FilePath {
|
||||
Url(url::Url),
|
||||
Path(PathBuf),
|
||||
}
|
||||
|
||||
impl From<PathBuf> for FilePath {
|
||||
fn from(value: PathBuf) -> Self {
|
||||
Self::Path(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<url::Url> for FilePath {
|
||||
fn from(value: url::Url) -> Self {
|
||||
Self::Url(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<FilePath> for tauri_plugin_fs::FilePath {
|
||||
fn from(value: FilePath) -> Self {
|
||||
match value {
|
||||
FilePath::Path(p) => tauri_plugin_fs::FilePath::Path(p),
|
||||
FilePath::Url(url) => tauri_plugin_fs::FilePath::Url(url),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl FilePath {
|
||||
fn simplified(self) -> Self {
|
||||
match self {
|
||||
Self::Url(url) => Self::Url(url),
|
||||
Self::Path(p) => Self::Path(dunce::simplified(&p).to_path_buf()),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn path(&self) -> Result<PathBuf> {
|
||||
match self {
|
||||
Self::Url(url) => url
|
||||
.to_file_path()
|
||||
.map(PathBuf::from)
|
||||
.map_err(|_| Error::InvalidPathUrl),
|
||||
Self::Path(p) => Ok(p.to_owned()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct Filter {
|
||||
pub name: String,
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
# Changelog
|
||||
|
||||
## \[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:
|
||||
|
||||
- `path`
|
||||
- `simplified`
|
||||
- `into_path`
|
||||
- [`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)) Implement `Serialize`, `Deserialize`, `From`, `TryFrom` and `FromStr` traits for `FilePath` and `SafeFilePath` enums.
|
||||
- [`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)) Mark `Error` enum as `#[non_exhuastive]`.
|
||||
- [`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 `SafeFilePath` enum.
|
||||
|
||||
## \[2.0.0-rc.2]
|
||||
|
||||
- [`f7280c88`](https://github.com/tauri-apps/plugins-workspace/commit/f7280c88309cdf1f2330574fec31e26e01e9cdbd) ([#1710](https://github.com/tauri-apps/plugins-workspace/pull/1710) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix can't use Windows paths like `C:/Users/UserName/file.txt`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-fs"
|
||||
version = "2.0.0-rc.2"
|
||||
version = "2.0.0-rc.5"
|
||||
description = "Access the file system."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -30,6 +30,8 @@ uuid = { version = "1", features = ["v4"] }
|
||||
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"]
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-2
@@ -52,7 +52,6 @@ const BASE_DIR_VARS: &[&str] = &[
|
||||
"TEMPLATE",
|
||||
"VIDEO",
|
||||
"RESOURCE",
|
||||
"APP",
|
||||
"LOG",
|
||||
"TEMP",
|
||||
"APPCONFIG",
|
||||
@@ -118,7 +117,7 @@ path = "${upper}/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-{lower}"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `${upper}`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `${upper}` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "${upper}"
|
||||
|
||||
@@ -270,7 +270,7 @@ class FileHandle extends Resource {
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { open, BaseDirectory } from "@tauri-apps/plugin-fs"
|
||||
* // if "$APP/foo/bar.txt" contains the text "hello world":
|
||||
* // if "$APPCONFIG/foo/bar.txt" contains the text "hello world":
|
||||
* const file = await open("foo/bar.txt", { baseDir: BaseDirectory.AppConfig });
|
||||
* const buf = new Uint8Array(100);
|
||||
* const numberOfBytesRead = await file.read(buf); // 11 bytes
|
||||
@@ -1015,7 +1015,7 @@ async function writeFile(
|
||||
|
||||
await invoke('plugin:fs|write_file', data, {
|
||||
headers: {
|
||||
path: path instanceof URL ? path.toString() : path,
|
||||
path: encodeURIComponent(path instanceof URL ? path.toString() : path),
|
||||
options: JSON.stringify(options)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
"$schema" = "schemas/schema.json"
|
||||
|
||||
# Scopes Section
|
||||
# This section contains scopes, which define file level access
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-app-recursive"
|
||||
description = "This scope permits recursive access to the complete application folders, including sub directories and files."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCONFIG"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCONFIG/**"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPDATA"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPDATA/**"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOCALDATA"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOCALDATA/**"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCACHE"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCACHE/**"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOG"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOG/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-app"
|
||||
description = "This scope permits access to all files and list content of top level directories in the application folders."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCONFIG"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCONFIG/*"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPDATA"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPDATA/*"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOCALDATA"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOCALDATA/*"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCACHE"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCACHE/*"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOG"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOG/*"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-app-index"
|
||||
description = "This scope permits to list all files and folders in the application directories."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCONFIG"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPDATA"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOCALDATA"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCACHE"
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOG"
|
||||
|
||||
# Sets Section
|
||||
# This section combines the scope elements with enablement of commands
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-read-recursive"
|
||||
description = "This allows full recursive read access to the complete application folders, files and subdirectories."
|
||||
permissions = ["read-all", "scope-app-recursive"]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-write-recursive"
|
||||
description = "This allows full recursive write access to the complete application folders, files and subdirectories."
|
||||
permissions = ["write-all", "scope-app-recursive"]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-read"
|
||||
description = "This allows non-recursive read access to the application folders."
|
||||
permissions = ["read-all", "scope-app"]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-write"
|
||||
description = "This allows non-recursive write access to the application folders."
|
||||
permissions = ["write-all", "scope-app"]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-meta-recursive"
|
||||
description = "This allows full recursive read access to metadata of the application folders, including file listing and statistics."
|
||||
permissions = ["read-meta", "scope-app-recursive"]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-meta"
|
||||
description = "This allows non-recursive read access to metadata of the application folders, including file listing and statistics."
|
||||
permissions = ["read-meta", "scope-app-index"]
|
||||
@@ -1,82 +0,0 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
# Scopes Section
|
||||
# This section contains scopes, which define file level access
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-app-recursive"
|
||||
description = "This scope permits recursive access to the complete `$APP` folder, including sub directories and files."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APP"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APP/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-app"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APP`folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APP"
|
||||
[[permission.scope.allow]]
|
||||
path = "$APP/*"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-app-index"
|
||||
description = "This scope permits to list all files and folders in the `$APP`folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APP"
|
||||
|
||||
# Sets Section
|
||||
# This section combines the scope elements with enablement of commands
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-read-recursive"
|
||||
description = "This allows full recursive read access to the complete `$APP` folder, files and subdirectories."
|
||||
permissions = [
|
||||
"read-all",
|
||||
"scope-app-recursive"
|
||||
]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-write-recursive"
|
||||
description = "This allows full recursive write access to the complete `$APP` folder, files and subdirectories."
|
||||
permissions = [
|
||||
"write-all",
|
||||
"scope-app-recursive"
|
||||
]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-read"
|
||||
description = "This allows non-recursive read access to the `$APP` folder."
|
||||
permissions = [
|
||||
"read-all",
|
||||
"scope-app"
|
||||
]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-write"
|
||||
description = "This allows non-recursive write access to the `$APP` folder."
|
||||
permissions = [
|
||||
"write-all",
|
||||
"scope-app"
|
||||
]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-meta-recursive"
|
||||
description = "This allows full recursive read access to metadata of the `$APP` folder, including file listing and statistics."
|
||||
permissions = [
|
||||
"read-meta",
|
||||
"scope-app-recursive"
|
||||
]
|
||||
|
||||
[[set]]
|
||||
identifier = "allow-app-meta"
|
||||
description = "This allows non-recursive read access to metadata of the `$APP` folder, including file listing and statistics."
|
||||
permissions = [
|
||||
"read-meta",
|
||||
"scope-app-index"
|
||||
]
|
||||
@@ -16,7 +16,7 @@ path = "$APPCACHE/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-appcache"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPCACHE`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCACHE"
|
||||
|
||||
@@ -16,7 +16,7 @@ path = "$APPCONFIG/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-appconfig"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPCONFIG`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPCONFIG"
|
||||
|
||||
@@ -16,7 +16,7 @@ path = "$APPDATA/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-appdata"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPDATA`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPDATA` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPDATA"
|
||||
|
||||
@@ -16,7 +16,7 @@ path = "$APPLOCALDATA/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-applocaldata"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOCALDATA"
|
||||
|
||||
@@ -16,7 +16,7 @@ path = "$APPLOG/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-applog"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPLOG`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$APPLOG` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$APPLOG"
|
||||
|
||||
@@ -16,7 +16,7 @@ path = "$AUDIO/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-audio"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$AUDIO`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$AUDIO` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$AUDIO"
|
||||
|
||||
@@ -16,7 +16,7 @@ path = "$CACHE/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-cache"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$CACHE`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$CACHE` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$CACHE"
|
||||
|
||||
@@ -16,7 +16,7 @@ path = "$CONFIG/**"
|
||||
|
||||
[[permission]]
|
||||
identifier = "scope-config"
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$CONFIG`folder."
|
||||
description = "This scope permits access to all files and list content of top level directories in the `$CONFIG` folder."
|
||||
|
||||
[[permission.scope.allow]]
|
||||
path = "$CONFIG"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user