mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-01 12:08:06 +02:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70136b1fe8 | |||
| 62ce5df52c | |||
| a04ea2f382 | |||
| 9dec9605ed | |||
| 7b9fa6607b | |||
| cb96aa0627 | |||
| 1d7dc86ec3 | |||
| 35ea5956d0 | |||
| 14c858391d | |||
| a3b5396113 | |||
| 040004a6b9 | |||
| 69d45a06a6 | |||
| c873e4d6c7 | |||
| 4e37316af0 | |||
| 753c7be0a6 | |||
| bff722451d | |||
| 62dafda652 | |||
| 644eb448bb | |||
| 75d82868b2 | |||
| 685c4094c5 | |||
| c281df8d79 | |||
| 79691e93e0 |
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"clipboard-manager": "minor"
|
||||
"clipboard-manager-js": "minor"
|
||||
---
|
||||
|
||||
Add support for `read_image` and `write_image` to the clipboard plugin (desktop).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"clipboard-manager": patch
|
||||
---
|
||||
|
||||
The `write` and `read` commands are now called `write_text` and `read_text` so the permission name was changed.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
dialog: patch
|
||||
---
|
||||
|
||||
Fixed an issue where the dialog apis panicked when they were called with no application windows open.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fs": patch
|
||||
---
|
||||
|
||||
Fixes `watch` and `watchImmediate` which previously ignored the `baseDir` parameter.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"http": patch
|
||||
---
|
||||
|
||||
Fixes scope not allowing subpaths, query parameters and hash when those values are empty.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
Add a `on_before_exit` hook for cleanup before spawning the updater on Windows, defaults to `app.cleanup_before_exit` when used through `UpdaterExt`
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
Fix deserialization of `windows > installerArgs` config field.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
On Windows, fallback to `passive` install mode when not defined in config.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
Fix Windows powershell window flashing on update
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
"authenticator": patch
|
||||
"autostart": patch
|
||||
"barcode-scanner": patch
|
||||
"biometric": patch
|
||||
"cli": patch
|
||||
"clipboard-manager": patch
|
||||
"deep-link": patch
|
||||
"dialog": patch
|
||||
"fs": patch
|
||||
"global-shortcut": patch
|
||||
"http": patch
|
||||
"localhost": patch
|
||||
"log-plugin": patch
|
||||
"nfc": patch
|
||||
"notification": patch
|
||||
"os": patch
|
||||
"persisted-scope": patch
|
||||
"positioner": patch
|
||||
"process": patch
|
||||
"shell": patch
|
||||
"single-instance": patch
|
||||
"sql": patch
|
||||
"store": patch
|
||||
"stronghold": patch
|
||||
"updater": patch
|
||||
"upload": patch
|
||||
"websocket": patch
|
||||
"window-state": patch
|
||||
---
|
||||
|
||||
The global API script is now only added to the binary when the `withGlobalTauri` config is true.
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
"global-shortcut": "patch"
|
||||
---
|
||||
|
||||
**Breaking change** Refactored the plugin Rust APIs for better DX and flexibility:
|
||||
|
||||
- Changed `Builder::with_handler` to be a method instead of a static method, it will also be triggered for any and all shortcuts even if the shortcut is registered through JS.
|
||||
- Added `Builder::with_shortcut` and `Builder::with_shortcuts` to register shortcuts on the plugin builder.
|
||||
- Added `on_shortcut` and `on_all_shortcuts` to register shortcuts with a handler.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"http": patch
|
||||
---
|
||||
|
||||
Add `unsafe-headers` cargo feature flag to allow using [forbidden headers](https://fetch.spec.whatwg.org/#terminology-headers).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Fix development mode check to set the app ID on macOS.
|
||||
@@ -3,14 +3,28 @@
|
||||
"changes": [
|
||||
".changes/beta.md",
|
||||
".changes/clipboard-html.md",
|
||||
".changes/clipboard-manager-image.md",
|
||||
".changes/clipboard-text-command-rename.md",
|
||||
".changes/dialog-can-create-directories.md",
|
||||
".changes/dialog-linux-freeze.md",
|
||||
".changes/dialog-main-thread.md",
|
||||
".changes/enhance-http-scope.md",
|
||||
".changes/file-autogen-fix.md",
|
||||
".changes/fix-fs-watcher-basedir.md",
|
||||
".changes/fix-http-scope-url-match.md",
|
||||
".changes/fix-shutdown-timing.md",
|
||||
".changes/fix-updater-installer-args-deserialization.md",
|
||||
".changes/fix-updater-installmode.md",
|
||||
".changes/fix-updater-powershell-flashing.md",
|
||||
".changes/fix-zbus-import.md",
|
||||
".changes/global-api-script-refactor.md",
|
||||
".changes/global-shortcut-refactor.md",
|
||||
".changes/http-unsafe-headers.md",
|
||||
".changes/http-user-agent.md",
|
||||
".changes/msrv-1.75.md",
|
||||
".changes/notification-fix-dev-check.md",
|
||||
".changes/public-with-store.md",
|
||||
".changes/shell-fix-schema-command-property-name.md",
|
||||
".changes/shell-shellexcute.md",
|
||||
".changes/tauri-beta-4.md",
|
||||
".changes/tauri-beta-8.md",
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'store': patch
|
||||
---
|
||||
|
||||
Fix `with_store` and `StoreCollection` changed to private in #1011
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"shell": "patch"
|
||||
---
|
||||
|
||||
Change shell's schema property name `command` to `cmd`.
|
||||
@@ -46,10 +46,17 @@ jobs:
|
||||
git config --global user.name "${{ github.event.pusher.name }}"
|
||||
git config --global user.email "${{ github.event.pusher.email }}"
|
||||
|
||||
- name: Setup target dir on /mnt
|
||||
run: |
|
||||
sudo mkdir /mnt/target
|
||||
WORKSPACE_OWNER="$(stat -c '%U:%G' "${GITHUB_WORKSPACE}")"
|
||||
sudo chown -R "${WORKSPACE_OWNER}" /mnt/target
|
||||
|
||||
- name: covector version or publish (publish when no change files present)
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
id: covector
|
||||
env:
|
||||
CARGO_TARGET_DIR: /mnt/target
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -42,6 +42,7 @@ jobs:
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
base: v2
|
||||
filters: |
|
||||
tauri-plugin-authenticator:
|
||||
- .github/workflows/test-rust.yml
|
||||
|
||||
Generated
+358
-306
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -10,9 +10,9 @@ resolver = "2"
|
||||
[workspace.dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = "2.0.0-beta.9"
|
||||
tauri-build = "2.0.0-beta.7"
|
||||
tauri-plugin = "2.0.0-beta.7"
|
||||
tauri = "2.0.0-beta.12"
|
||||
tauri-build = "2.0.0-beta.10"
|
||||
tauri-plugin = "2.0.0-beta.10"
|
||||
serde_json = "1"
|
||||
thiserror = "1"
|
||||
url = "2"
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager-js@2.1.0-beta.0`
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "svelte-app",
|
||||
"private": true,
|
||||
"version": "2.0.0-beta.2",
|
||||
"version": "2.0.0-beta.3",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --clearScreen false",
|
||||
@@ -9,11 +9,11 @@
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4",
|
||||
"@tauri-apps/api": "2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-barcode-scanner": "2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-biometric": "2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-cli": "2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.1.0-beta.0",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-fs": "2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-global-shortcut": "2.0.0-beta.2",
|
||||
@@ -30,7 +30,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-beta.7",
|
||||
"@tauri-apps/cli": "2.0.0-beta.9",
|
||||
"@unocss/extractor-svelte": "^0.58.0",
|
||||
"internal-ip": "^8.0.0",
|
||||
"svelte": "^4.2.8",
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager@2.1.0-beta.0`
|
||||
- Upgraded to `dialog@2.0.0-beta.3`
|
||||
- Upgraded to `fs@2.0.0-beta.3`
|
||||
- Upgraded to `http@2.0.0-beta.3`
|
||||
- Upgraded to `updater@2.0.0-beta.3`
|
||||
- Upgraded to `barcode-scanner@2.0.0-beta.3`
|
||||
- Upgraded to `biometric@2.0.0-beta.3`
|
||||
- Upgraded to `cli@2.0.0-beta.3`
|
||||
- Upgraded to `global-shortcut@2.0.0-beta.3`
|
||||
- Upgraded to `log-plugin@2.0.0-beta.3`
|
||||
- Upgraded to `nfc@2.0.0-beta.3`
|
||||
- Upgraded to `notification@2.0.0-beta.3`
|
||||
- Upgraded to `os@2.0.0-beta.3`
|
||||
- Upgraded to `process@2.0.0-beta.3`
|
||||
- Upgraded to `shell@2.0.0-beta.3`
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "api"
|
||||
publish = false
|
||||
version = "2.0.0-beta.2"
|
||||
version = "2.0.0-beta.3"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
rust-version = { workspace = true }
|
||||
@@ -19,15 +19,15 @@ serde_json = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
tiny_http = "0.11"
|
||||
log = { workspace = true }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.2", features = [ "watch" ] }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.2" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.2", features = [ "windows7-compat" ] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.3", features = [ "watch" ] }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.1.0-beta.0" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.3" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.3", features = [ "windows7-compat" ] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.3" }
|
||||
|
||||
[dependencies.tauri]
|
||||
workspace = true
|
||||
@@ -41,14 +41,14 @@ tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.2"
|
||||
]
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-beta.3" }
|
||||
|
||||
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-beta.2" }
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-beta.3" }
|
||||
|
||||
[target."cfg(target_os = \"windows\")".dependencies]
|
||||
window-shadows = "0.2"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"tray:default",
|
||||
"event:default",
|
||||
"window:default",
|
||||
"image:default",
|
||||
"notification:default",
|
||||
"os:allow-platform",
|
||||
"dialog:allow-open",
|
||||
@@ -54,8 +55,10 @@
|
||||
},
|
||||
"shell:allow-kill",
|
||||
"shell:allow-stdin-write",
|
||||
"clipboard-manager:allow-read",
|
||||
"clipboard-manager:allow-write",
|
||||
"clipboard-manager:allow-read-text",
|
||||
"clipboard-manager:allow-write-text",
|
||||
"clipboard-manager:allow-read-image",
|
||||
"clipboard-manager:allow-write-image",
|
||||
"fs:allow-rename",
|
||||
"fs:allow-mkdir",
|
||||
"fs:allow-remove",
|
||||
|
||||
@@ -41,8 +41,7 @@
|
||||
"type": "object",
|
||||
"required": [
|
||||
"identifier",
|
||||
"permissions",
|
||||
"windows"
|
||||
"permissions"
|
||||
],
|
||||
"properties": {
|
||||
"identifier": {
|
||||
@@ -93,14 +92,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
@@ -115,7 +110,7 @@
|
||||
],
|
||||
"properties": {
|
||||
"urls": {
|
||||
"description": "Remote domains this capability refers to. Can use glob patterns.",
|
||||
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
@@ -2297,6 +2292,12 @@
|
||||
"properties": {
|
||||
"identifier": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2362,7 +2363,7 @@
|
||||
"type": "object",
|
||||
"required": [
|
||||
"args",
|
||||
"command",
|
||||
"cmd",
|
||||
"name",
|
||||
"sidecar"
|
||||
],
|
||||
@@ -2375,7 +2376,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"command": {
|
||||
"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`.",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -2397,7 +2398,7 @@
|
||||
"type": "object",
|
||||
"required": [
|
||||
"args",
|
||||
"command",
|
||||
"cmd",
|
||||
"name",
|
||||
"sidecar"
|
||||
],
|
||||
@@ -2410,7 +2411,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"command": {
|
||||
"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`.",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -2532,31 +2533,99 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-read"
|
||||
"clipboard-manager:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.",
|
||||
"description": "clipboard-manager:allow-clear -> Enables the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-write"
|
||||
"clipboard-manager:allow-clear"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.",
|
||||
"description": "clipboard-manager:allow-read-image -> Enables the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-read"
|
||||
"clipboard-manager:allow-read-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.",
|
||||
"description": "clipboard-manager:allow-read-text -> Enables the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-write"
|
||||
"clipboard-manager:allow-read-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-write-html -> Enables the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-write-html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-write-image -> Enables the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-write-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-write-text -> Enables the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-write-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-clear -> Denies the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-clear"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-read-image -> Denies the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-read-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-read-text -> Denies the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-read-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-write-html -> Denies the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-write-html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-write-image -> Denies the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-write-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-write-text -> Denies the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-write-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"dialog:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -4680,6 +4749,12 @@
|
||||
"fs:write-files"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"global-shortcut:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "global-shortcut:allow-is-registered -> Enables the is_registered command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4827,13 +4902,6 @@
|
||||
"image:allow-from-bytes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-from-ico-bytes -> Enables the from_ico_bytes command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-from-ico-bytes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4841,20 +4909,6 @@
|
||||
"image:allow-from-path"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-from-png-bytes -> Enables the from_png_bytes command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-from-png-bytes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-height -> Enables the height command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-height"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-new -> Enables the new command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4870,10 +4924,10 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-width -> Enables the width command without any pre-configured scope.",
|
||||
"description": "image:allow-size -> Enables the size command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-width"
|
||||
"image:allow-size"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -4883,13 +4937,6 @@
|
||||
"image:deny-from-bytes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-from-ico-bytes -> Denies the from_ico_bytes command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-from-ico-bytes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4897,20 +4944,6 @@
|
||||
"image:deny-from-path"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-from-png-bytes -> Denies the from_png_bytes command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-from-png-bytes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-height -> Denies the height command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-height"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-new -> Denies the new command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4926,10 +4959,10 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-width -> Denies the width command without any pre-configured scope.",
|
||||
"description": "image:deny-size -> Denies the size command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-width"
|
||||
"image:deny-size"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -5317,6 +5350,12 @@
|
||||
"notification:deny-request-permission"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"os:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "os:allow-arch -> Enables the arch command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5548,6 +5587,12 @@
|
||||
"path:deny-resolve-directory"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"process:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "process:allow-exit -> Enables the exit command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5597,6 +5642,12 @@
|
||||
"resources:deny-close"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5660,6 +5711,13 @@
|
||||
"tray:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:allow-get-by-id -> Enables the get_by_id command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tray:allow-get-by-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:allow-new -> Enables the new command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5667,6 +5725,13 @@
|
||||
"tray:allow-new"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:allow-remove-by-id -> Enables the remove_by_id command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tray:allow-remove-by-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5723,6 +5788,13 @@
|
||||
"tray:allow-set-visible"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:deny-get-by-id -> Denies the get_by_id command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tray:deny-get-by-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:deny-new -> Denies the new command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5730,6 +5802,13 @@
|
||||
"tray:deny-new"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:deny-remove-by-id -> Denies the remove_by_id command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tray:deny-remove-by-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "A list of capabilities.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Capability"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A list of capabilities.",
|
||||
"type": "object",
|
||||
@@ -34,8 +41,7 @@
|
||||
"type": "object",
|
||||
"required": [
|
||||
"identifier",
|
||||
"permissions",
|
||||
"windows"
|
||||
"permissions"
|
||||
],
|
||||
"properties": {
|
||||
"identifier": {
|
||||
@@ -86,14 +92,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
@@ -108,7 +110,7 @@
|
||||
],
|
||||
"properties": {
|
||||
"urls": {
|
||||
"description": "Remote domains this capability refers to. Can use glob patterns.",
|
||||
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
@@ -2290,6 +2292,12 @@
|
||||
"properties": {
|
||||
"identifier": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2355,7 +2363,7 @@
|
||||
"type": "object",
|
||||
"required": [
|
||||
"args",
|
||||
"command",
|
||||
"cmd",
|
||||
"name",
|
||||
"sidecar"
|
||||
],
|
||||
@@ -2368,7 +2376,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"command": {
|
||||
"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`.",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -2390,7 +2398,7 @@
|
||||
"type": "object",
|
||||
"required": [
|
||||
"args",
|
||||
"command",
|
||||
"cmd",
|
||||
"name",
|
||||
"sidecar"
|
||||
],
|
||||
@@ -2403,7 +2411,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"command": {
|
||||
"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`.",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -2503,6 +2511,12 @@
|
||||
"app:deny-version"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"barcode-scanner:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "barcode-scanner:allow-cancel -> Enables the cancel command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2587,6 +2601,12 @@
|
||||
"barcode-scanner:deny-vibrate"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"biometric:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "biometric:allow-authenticate -> Enables the authenticate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2616,31 +2636,99 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-read"
|
||||
"clipboard-manager:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.",
|
||||
"description": "clipboard-manager:allow-clear -> Enables the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-write"
|
||||
"clipboard-manager:allow-clear"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.",
|
||||
"description": "clipboard-manager:allow-read-image -> Enables the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-read"
|
||||
"clipboard-manager:allow-read-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.",
|
||||
"description": "clipboard-manager:allow-read-text -> Enables the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-write"
|
||||
"clipboard-manager:allow-read-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-write-html -> Enables the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-write-html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-write-image -> Enables the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-write-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:allow-write-text -> Enables the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:allow-write-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-clear -> Denies the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-clear"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-read-image -> Denies the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-read-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-read-text -> Denies the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-read-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-write-html -> Denies the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-write-html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-write-image -> Denies the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-write-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "clipboard-manager:deny-write-text -> Denies the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"clipboard-manager:deny-write-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"dialog:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -4827,6 +4915,83 @@
|
||||
"http:deny-fetch-send"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:default -> Default permissions for the plugin.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-from-bytes -> Enables the from_bytes command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-from-bytes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-from-path"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-new -> Enables the new command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-new"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-rgba -> Enables the rgba command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-rgba"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:allow-size -> Enables the size command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:allow-size"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-from-bytes -> Denies the from_bytes command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-from-bytes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-from-path"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-new -> Denies the new command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-new"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-rgba -> Denies the rgba command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-rgba"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "image:deny-size -> Denies the size command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"image:deny-size"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "log:default -> Allows the log command",
|
||||
"type": "string",
|
||||
@@ -5163,6 +5328,12 @@
|
||||
"menu:deny-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"nfc:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "nfc:allow-is-available -> Enables the is_available command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5254,6 +5425,12 @@
|
||||
"notification:deny-request-permission"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"os:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "os:allow-arch -> Enables the arch command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5485,6 +5662,12 @@
|
||||
"path:deny-resolve-directory"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"process:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "process:allow-exit -> Enables the exit command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5534,6 +5717,12 @@
|
||||
"resources:deny-close"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"shell:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5597,6 +5786,13 @@
|
||||
"tray:default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:allow-get-by-id -> Enables the get_by_id command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tray:allow-get-by-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:allow-new -> Enables the new command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5604,6 +5800,13 @@
|
||||
"tray:allow-new"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:allow-remove-by-id -> Enables the remove_by_id command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tray:allow-remove-by-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5660,6 +5863,13 @@
|
||||
"tray:allow-set-visible"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:deny-get-by-id -> Denies the get_by_id command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tray:deny-get-by-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:deny-new -> Denies the new command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -5667,6 +5877,13 @@
|
||||
"tray:deny-new"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:deny-remove-by-id -> Denies the remove_by_id command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tray:deny-remove-by-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
|
||||
@@ -80,9 +80,10 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
|
||||
i @ "icon-1" | i @ "icon-2" => {
|
||||
if let Some(tray) = app.tray_by_id("tray-1") {
|
||||
let _ = tray.set_icon(Some(if i == "icon-1" {
|
||||
tauri::Image::from_ico_bytes(include_bytes!("../icons/icon.ico")).unwrap()
|
||||
tauri::image::Image::from_bytes(include_bytes!("../icons/icon.ico"))
|
||||
.unwrap()
|
||||
} else {
|
||||
tauri::Image::from_png_bytes(include_bytes!(
|
||||
tauri::image::Image::from_bytes(include_bytes!(
|
||||
"../icons/tray_icon_with_transparency.png"
|
||||
))
|
||||
.unwrap()
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
"build": {
|
||||
"devUrl": "http://localhost:5173",
|
||||
"frontendDist": "../dist",
|
||||
"beforeDevCommand": "yarn dev",
|
||||
"beforeBuildCommand": "yarn build"
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
"beforeBuildCommand": "pnpm build"
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
export function arrayBufferToBase64(buffer, callback) {
|
||||
const blob = new Blob([buffer], {
|
||||
type: "application/octet-binary",
|
||||
});
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (evt) {
|
||||
const dataurl = evt.target.result;
|
||||
callback(dataurl.substr(dataurl.indexOf(",") + 1));
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
}
|
||||
@@ -1,23 +1,59 @@
|
||||
<script>
|
||||
import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
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";
|
||||
|
||||
function write() {
|
||||
writeText(text)
|
||||
function writeText() {
|
||||
clipboard
|
||||
.writeText(text)
|
||||
.then(() => {
|
||||
onMessage("Wrote to the clipboard");
|
||||
})
|
||||
.catch(onMessage);
|
||||
}
|
||||
|
||||
function read() {
|
||||
readText()
|
||||
async function writeImage() {
|
||||
try {
|
||||
const res = 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");
|
||||
} catch (e) {
|
||||
onMessage(e);
|
||||
}
|
||||
}
|
||||
|
||||
async function read() {
|
||||
try {
|
||||
const image = await clipboard.readImage();
|
||||
arrayBufferToBase64(await image.rgba(), function (base64) {
|
||||
const src = "data:image/png;base64," + base64;
|
||||
insecureRenderHtml('<img src="' + src + '"></img>');
|
||||
});
|
||||
return;
|
||||
} catch (_) {}
|
||||
|
||||
clipboard
|
||||
.readText()
|
||||
.then((contents) => {
|
||||
onMessage(`Clipboard contents: ${contents}`);
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch((e) => {
|
||||
onMessage(e);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -27,6 +63,8 @@
|
||||
placeholder="Text to write to the clipboard"
|
||||
bind:value={text}
|
||||
/>
|
||||
<button class="btn" type="button" on:click={write}>Write</button>
|
||||
<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>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script>
|
||||
import * as fs from "@tauri-apps/plugin-fs";
|
||||
import { convertFileSrc } from "@tauri-apps/api/core";
|
||||
import { arrayBufferToBase64 } from "../lib/utils";
|
||||
|
||||
export let onMessage;
|
||||
export let insecureRenderHtml;
|
||||
@@ -20,18 +21,6 @@
|
||||
return dirSelect.value ? parseInt(dir.value) : null;
|
||||
}
|
||||
|
||||
function arrayBufferToBase64(buffer, callback) {
|
||||
const blob = new Blob([buffer], {
|
||||
type: "application/octet-binary",
|
||||
});
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (evt) {
|
||||
const dataurl = evt.target.result;
|
||||
callback(dataurl.substr(dataurl.indexOf(",") + 1));
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
}
|
||||
|
||||
const DirOptions = Object.keys(fs.BaseDirectory)
|
||||
.filter((key) => isNaN(parseInt(key)))
|
||||
.map((dir) => [dir, fs.BaseDirectory[dir]]);
|
||||
@@ -215,7 +204,7 @@
|
||||
<button class="btn" on:click={stat}>Stat</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<h3>Watch</h3>
|
||||
|
||||
<input
|
||||
@@ -225,7 +214,9 @@
|
||||
/>
|
||||
<br />
|
||||
<div>
|
||||
<label for="watch-debounce-delay">Debounce delay in milliseconds (`0` disables the debouncer)</label>
|
||||
<label for="watch-debounce-delay"
|
||||
>Debounce delay in milliseconds (`0` disables the debouncer)</label
|
||||
>
|
||||
<input
|
||||
class="input"
|
||||
id="watch-debounce-delay"
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-authenticator"
|
||||
version = "2.0.0-beta.2"
|
||||
version = "2.0.0-beta.3"
|
||||
description = "Use hardware security-keys in your Tauri App."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -11,5 +11,7 @@ const COMMANDS: &[&str] = &[
|
||||
];
|
||||
|
||||
fn main() {
|
||||
tauri_plugin::Builder::new(COMMANDS).build();
|
||||
tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4"
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ fn verify_signature(
|
||||
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
PluginBuilder::new("authenticator")
|
||||
.js_init_script(include_str!("api-iife.js").to_string())
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
init_auth,
|
||||
register,
|
||||
|
||||
@@ -95,7 +95,8 @@ impl U2f {
|
||||
challenge: Challenge,
|
||||
response: RegisterResponse,
|
||||
) -> Result<Registration> {
|
||||
if expiration(challenge.timestamp) > Duration::seconds(300) {
|
||||
// Safe to unwrap since 300 is within the constraints of Duration::try_seconds
|
||||
if expiration(challenge.timestamp) > Duration::try_seconds(300).unwrap() {
|
||||
return Err(U2fError::ChallengeExpired);
|
||||
}
|
||||
|
||||
@@ -152,7 +153,8 @@ impl U2f {
|
||||
sign_resp: SignResponse,
|
||||
counter: u32,
|
||||
) -> Result<u32> {
|
||||
if expiration(challenge.timestamp) > Duration::seconds(300) {
|
||||
// Safe to unwrap since 300 is within the constraints of Duration::try_seconds
|
||||
if expiration(challenge.timestamp) > Duration::try_seconds(300).unwrap() {
|
||||
return Err(U2fError::ChallengeExpired);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-autostart"
|
||||
version = "2.0.0-beta.2"
|
||||
version = "2.0.0-beta.3"
|
||||
description = "Automatically launch your application at startup."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -5,5 +5,7 @@
|
||||
const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"];
|
||||
|
||||
fn main() {
|
||||
tauri_plugin::Builder::new(COMMANDS).build();
|
||||
tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4"
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
|
||||
@@ -107,7 +107,6 @@ pub fn init<R: Runtime>(
|
||||
args: Option<Vec<&'static str>>,
|
||||
) -> TauriPlugin<R> {
|
||||
Builder::new("autostart")
|
||||
.js_init_script(include_str!("api-iife.js").to_string())
|
||||
.invoke_handler(tauri::generate_handler![enable, disable, is_enabled])
|
||||
.setup(move |app, _api| {
|
||||
let mut builder = AutoLaunchBuilder::new();
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-barcode-scanner"
|
||||
version = "2.0.0-beta.2"
|
||||
version = "2.0.0-beta.3"
|
||||
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -13,6 +13,7 @@ const COMMANDS: &[&str] = &[
|
||||
|
||||
fn main() {
|
||||
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.android_path("android")
|
||||
.ios_path("ios")
|
||||
.try_build()
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4"
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-biometric"
|
||||
version = "2.0.0-beta.2"
|
||||
version = "2.0.0-beta.3"
|
||||
description = "Prompt the user for biometric authentication on Android and iOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -6,6 +6,7 @@ const COMMANDS: &[&str] = &["authenticate", "status"];
|
||||
|
||||
fn main() {
|
||||
tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.android_path("android")
|
||||
.ios_path("ios")
|
||||
.build();
|
||||
|
||||
@@ -27,6 +27,6 @@
|
||||
"tslib": "2.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4"
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ impl<R: Runtime, T: Manager<R>> crate::BiometricExt<R> for T {
|
||||
/// Initializes the plugin.
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
Builder::new("biometric")
|
||||
.js_init_script(include_str!("api-iife.js").to_string())
|
||||
.setup(|app, api| {
|
||||
#[cfg(target_os = "android")]
|
||||
let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BiometricPlugin")?;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-cli"
|
||||
version = "2.0.0-beta.2"
|
||||
version = "2.0.0-beta.3"
|
||||
description = "Parse arguments from your Tauri application's command line interface."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -5,5 +5,7 @@
|
||||
const COMMANDS: &[&str] = &["cli_matches"];
|
||||
|
||||
fn main() {
|
||||
tauri_plugin::Builder::new(COMMANDS).build();
|
||||
tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4"
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ fn cli_matches<R: Runtime>(_app: AppHandle<R>, cli: State<'_, Cli<R>>) -> Result
|
||||
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R, Config> {
|
||||
Builder::new("cli")
|
||||
.js_init_script(include_str!("api-iife.js").to_string())
|
||||
.invoke_handler(tauri::generate_handler![cli_matches])
|
||||
.setup(|app, api| {
|
||||
app.manage(Cli(api));
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.1.0-beta.0]
|
||||
|
||||
- [`9dec960`](https://github.com/tauri-apps/plugins-workspace/commit/9dec9605ed1ce19dbef697e55debddf9008ecba1)([#845](https://github.com/tauri-apps/plugins-workspace/pull/845)) Add support for `read_image` and `write_image` to the clipboard plugin (desktop).
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
- [`dc6d332`](https://github.com/tauri-apps/plugins-workspace/commit/dc6d3321e5305fa8b7250553bd179cbee995998a)([#977](https://github.com/tauri-apps/plugins-workspace/pull/977)) Add support for writing HTML content to the clipboard.
|
||||
@@ -45,5 +49,12 @@
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.0.0-beta.2"
|
||||
version = "2.1.0-beta.0"
|
||||
description = "Read and write to the system clipboard."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -25,3 +25,4 @@ thiserror = { workspace = true }
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
arboard = "3"
|
||||
image = "0.24"
|
||||
|
||||
@@ -87,7 +87,7 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
|
||||
@Command
|
||||
@Suppress("MoveVariableDeclarationIntoWhen")
|
||||
fun write(invoke: Invoke) {
|
||||
fun writeText(invoke: Invoke) {
|
||||
val args = invoke.parseArgs(WriteOptions::class.java)
|
||||
|
||||
val clipData = when (args) {
|
||||
@@ -106,7 +106,7 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
}
|
||||
|
||||
@Command
|
||||
fun read(invoke: Invoke) {
|
||||
fun readText(invoke: Invoke) {
|
||||
val data = if (manager.hasPrimaryClip()) {
|
||||
if (manager.primaryClipDescription?.hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN) == true) {
|
||||
val item: ClipData.Item = manager.primaryClip!!.getItemAt(0)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARDMANAGER__=function(e){"use strict";var r;async function t(e,r={},t){return window.__TAURI_INTERNALS__.invoke(e,r,t)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,r,t,n){if("a"===t&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!n:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?n:"a"===t?n.call(e):n?n.value:r.get(e)}(this,r,"f")}constructor(e){r.set(this,void 0),function(e,r,t,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!a:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?a.call(e,t):a?a.value=t:r.set(e,t)}(this,r,e,"f")}async close(){return t("plugin:resources|close",{rid:this.rid})}}r=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,r,n){return t("plugin:image|new",{rgba:i(e),width:r,height:n}).then((e=>new a(e)))}static async fromBytes(e){return t("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return t("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return t("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return t("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof a?e.rid:e}return e.clear=async function(){await t("plugin:clipboard-manager|clear")},e.readImage=async function(){return await t("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return(await t("plugin:clipboard-manager|read_text")).plainText.text},e.writeHtml=async function(e,r){return t("plugin:clipboard-manager|write_html",{data:{html:{html:e,altHtml:r}}})},e.writeImage=async function(e){return t("plugin:clipboard-manager|write_image",{data:{image:{image:i(e)}}})},e.writeText=async function(e,r){return t("plugin:clipboard-manager|write_text",{data:{plainText:{label:r?.label,text:e}}})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARDMANAGER__})}
|
||||
@@ -2,10 +2,18 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
const COMMANDS: &[&str] = &["write", "read"];
|
||||
const COMMANDS: &[&str] = &[
|
||||
"write_text",
|
||||
"read_text",
|
||||
"write_image",
|
||||
"read_image",
|
||||
"write_html",
|
||||
"clear",
|
||||
];
|
||||
|
||||
fn main() {
|
||||
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.android_path("android")
|
||||
.ios_path("ios")
|
||||
.try_build()
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { Image, transformImage } from "@tauri-apps/api/image";
|
||||
|
||||
type ClipResponse = Record<"plainText", { text: string }>;
|
||||
|
||||
@@ -29,7 +30,7 @@ async function writeText(
|
||||
text: string,
|
||||
opts?: { label?: string },
|
||||
): Promise<void> {
|
||||
return invoke("plugin:clipboard-manager|write", {
|
||||
return invoke("plugin:clipboard-manager|write_text", {
|
||||
data: {
|
||||
plainText: {
|
||||
label: opts?.label,
|
||||
@@ -49,12 +50,60 @@ async function writeText(
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function readText(): Promise<string> {
|
||||
const kind: ClipResponse = await invoke("plugin:clipboard-manager|read");
|
||||
const kind: ClipResponse = await invoke("plugin:clipboard-manager|read_text");
|
||||
return kind.plainText.text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes HTML or fallbacks to write provided plain text to the clipboard.
|
||||
* Gets the clipboard content as Uint8Array image.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { readImage } from '@tauri-apps/plugin-clipboard-manager';
|
||||
*
|
||||
* const clipboardImage = await readImage();
|
||||
* const blob = new Blob([clipboardImage.bytes], { type: 'image' })
|
||||
* const url = URL.createObjectURL(blob)
|
||||
* ```
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function readImage(): Promise<Image> {
|
||||
return await invoke<number>("plugin:clipboard-manager|read_image").then(
|
||||
(rid) => new Image(rid),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes image buffer to the clipboard.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { writeImage } from '@tauri-apps/plugin-clipboard-manager';
|
||||
* const buffer = [
|
||||
* // A red pixel
|
||||
* 255, 0, 0, 255,
|
||||
*
|
||||
* // A green pixel
|
||||
* 0, 255, 0, 255,
|
||||
* ];
|
||||
* await writeImage(buffer);
|
||||
*
|
||||
* @returns A promise indicating the success or failure of the operation.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function writeImage(
|
||||
image: string | Image | Uint8Array | ArrayBuffer | number[],
|
||||
): Promise<void> {
|
||||
return invoke("plugin:clipboard-manager|write_image", {
|
||||
data: {
|
||||
image: {
|
||||
image: transformImage(image),
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* * Writes HTML or fallbacks to write provided plain text to the clipboard.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager';
|
||||
@@ -92,4 +141,4 @@ async function clear(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
export { writeText, readText, writeHtml, clear };
|
||||
export { writeText, readText, writeHtml, clear, readImage, writeImage };
|
||||
|
||||
@@ -16,7 +16,7 @@ enum ReadClipData: Codable {
|
||||
}
|
||||
|
||||
class ClipboardPlugin: Plugin {
|
||||
@objc public func write(_ invoke: Invoke) throws {
|
||||
@objc public func writeText(_ invoke: Invoke) throws {
|
||||
let options = try invoke.parseArgs(WriteOptions.self)
|
||||
let clipboard = UIPasteboard.general
|
||||
switch options {
|
||||
@@ -30,7 +30,7 @@ class ClipboardPlugin: Plugin {
|
||||
|
||||
}
|
||||
|
||||
@objc public func read(_ invoke: Invoke) throws {
|
||||
@objc public func readText(_ invoke: Invoke) throws {
|
||||
let clipboard = UIPasteboard.general
|
||||
if let text = clipboard.string {
|
||||
invoke.resolve(ReadClipData.plainText(text: text))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-clipboard-manager",
|
||||
"version": "2.0.0-beta.2",
|
||||
"version": "2.1.0-beta.0",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4"
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-clear"
|
||||
description = "Enables the clear command without any pre-configured scope."
|
||||
commands.allow = ["clear"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "deny-clear"
|
||||
description = "Denies the clear command without any pre-configured scope."
|
||||
commands.deny = ["clear"]
|
||||
@@ -1,13 +0,0 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-read"
|
||||
description = "Enables the read command without any pre-configured scope."
|
||||
commands.allow = ["read"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "deny-read"
|
||||
description = "Denies the read command without any pre-configured scope."
|
||||
commands.deny = ["read"]
|
||||
@@ -0,0 +1,13 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-read-image"
|
||||
description = "Enables the read_image command without any pre-configured scope."
|
||||
commands.allow = ["read_image"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "deny-read-image"
|
||||
description = "Denies the read_image command without any pre-configured scope."
|
||||
commands.deny = ["read_image"]
|
||||
@@ -0,0 +1,13 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-read-text"
|
||||
description = "Enables the read_text command without any pre-configured scope."
|
||||
commands.allow = ["read_text"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "deny-read-text"
|
||||
description = "Denies the read_text command without any pre-configured scope."
|
||||
commands.deny = ["read_text"]
|
||||
@@ -1,13 +0,0 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-write"
|
||||
description = "Enables the write command without any pre-configured scope."
|
||||
commands.allow = ["write"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "deny-write"
|
||||
description = "Denies the write command without any pre-configured scope."
|
||||
commands.deny = ["write"]
|
||||
@@ -0,0 +1,13 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-write-html"
|
||||
description = "Enables the write_html command without any pre-configured scope."
|
||||
commands.allow = ["write_html"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "deny-write-html"
|
||||
description = "Denies the write_html command without any pre-configured scope."
|
||||
commands.deny = ["write_html"]
|
||||
@@ -0,0 +1,13 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-write-image"
|
||||
description = "Enables the write_image command without any pre-configured scope."
|
||||
commands.allow = ["write_image"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "deny-write-image"
|
||||
description = "Denies the write_image command without any pre-configured scope."
|
||||
commands.deny = ["write_image"]
|
||||
@@ -0,0 +1,13 @@
|
||||
# Automatically generated - DO NOT EDIT!
|
||||
|
||||
"$schema" = "../../schemas/schema.json"
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-write-text"
|
||||
description = "Enables the write_text command without any pre-configured scope."
|
||||
commands.allow = ["write_text"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "deny-write-text"
|
||||
description = "Denies the write_text command without any pre-configured scope."
|
||||
commands.deny = ["write_text"]
|
||||
@@ -1,6 +1,14 @@
|
||||
| Permission | Description |
|
||||
|------|-----|
|
||||
|`allow-read`|Enables the read command without any pre-configured scope.|
|
||||
|`deny-read`|Denies the read command without any pre-configured scope.|
|
||||
|`allow-write`|Enables the write command without any pre-configured scope.|
|
||||
|`deny-write`|Denies the write command without any pre-configured scope.|
|
||||
|`allow-clear`|Enables the clear command without any pre-configured scope.|
|
||||
|`deny-clear`|Denies the clear command without any pre-configured scope.|
|
||||
|`allow-read-image`|Enables the read_image command without any pre-configured scope.|
|
||||
|`deny-read-image`|Denies the read_image command without any pre-configured scope.|
|
||||
|`allow-read-text`|Enables the read_text command without any pre-configured scope.|
|
||||
|`deny-read-text`|Denies the read_text command without any pre-configured scope.|
|
||||
|`allow-write-html`|Enables the write_html command without any pre-configured scope.|
|
||||
|`deny-write-html`|Denies the write_html command without any pre-configured scope.|
|
||||
|`allow-write-image`|Enables the write_image command without any pre-configured scope.|
|
||||
|`deny-write-image`|Denies the write_image command without any pre-configured scope.|
|
||||
|`allow-write-text`|Enables the write_text command without any pre-configured scope.|
|
||||
|`deny-write-text`|Denies the write_text command without any pre-configured scope.|
|
||||
|
||||
@@ -139,14 +139,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
@@ -299,31 +295,87 @@
|
||||
"type": "string",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "allow-read -> Enables the read command without any pre-configured scope.",
|
||||
"description": "allow-clear -> Enables the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-read"
|
||||
"allow-clear"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deny-read -> Denies the read command without any pre-configured scope.",
|
||||
"description": "deny-clear -> Denies the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-read"
|
||||
"deny-clear"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "allow-write -> Enables the write command without any pre-configured scope.",
|
||||
"description": "allow-read-image -> Enables the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-write"
|
||||
"allow-read-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deny-write -> Denies the write command without any pre-configured scope.",
|
||||
"description": "deny-read-image -> Denies the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-write"
|
||||
"deny-read-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "allow-read-text -> Enables the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-read-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deny-read-text -> Denies the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-read-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "allow-write-html -> Enables the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-write-html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deny-write-html -> Denies the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-write-html"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "allow-write-image -> Enables the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-write-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deny-write-image -> Denies the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-write-image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "allow-write-text -> Enables the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"allow-write-text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "deny-write-text -> Denies the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"deny-write-text"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARDMANAGER__=function(n){"use strict";async function r(n,r={},a){return window.__TAURI_INTERNALS__.invoke(n,r,a)}return"function"==typeof SuppressedError&&SuppressedError,n.clear=async function(){await r("plugin:clipboard-manager|clear")},n.readText=async function(){return(await r("plugin:clipboard-manager|read")).plainText.text},n.writeHtml=async function(n,a){return r("plugin:clipboard-manager|write_html",{data:{html:{html:n,altHtml:a}}})},n.writeText=async function(n,a){return r("plugin:clipboard-manager|write",{data:{plainText:{label:a?.label,text:n}}})},n}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARDMANAGER__})}
|
||||
@@ -2,25 +2,45 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use tauri::{command, AppHandle, Runtime, State};
|
||||
use tauri::{command, AppHandle, Manager, ResourceId, Runtime, State};
|
||||
|
||||
use crate::{ClipKind, Clipboard, ClipboardContents, Result};
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn write<R: Runtime>(
|
||||
pub(crate) async fn write_text<R: Runtime>(
|
||||
_app: AppHandle<R>,
|
||||
clipboard: State<'_, Clipboard<R>>,
|
||||
data: ClipKind,
|
||||
) -> Result<()> {
|
||||
clipboard.write(data)
|
||||
clipboard.write_text(data)
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn read<R: Runtime>(
|
||||
pub(crate) async fn write_image<R: Runtime>(
|
||||
_app: AppHandle<R>,
|
||||
clipboard: State<'_, Clipboard<R>>,
|
||||
data: ClipKind,
|
||||
) -> Result<()> {
|
||||
clipboard.write_image(data)
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn read_text<R: Runtime>(
|
||||
_app: AppHandle<R>,
|
||||
clipboard: State<'_, Clipboard<R>>,
|
||||
) -> Result<ClipboardContents> {
|
||||
clipboard.read()
|
||||
clipboard.read_text()
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn read_image<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
clipboard: State<'_, Clipboard<R>>,
|
||||
) -> Result<ResourceId> {
|
||||
let image = clipboard.read_image()?.to_owned();
|
||||
let mut resources_table = app.resources_table();
|
||||
let rid = resources_table.add(image);
|
||||
Ok(rid)
|
||||
}
|
||||
|
||||
#[command]
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use arboard::ImageData;
|
||||
use image::ImageEncoder;
|
||||
use serde::de::DeserializeOwned;
|
||||
use tauri::{plugin::PluginApi, AppHandle, Runtime};
|
||||
use tauri::{image::Image, plugin::PluginApi, AppHandle, Runtime};
|
||||
|
||||
use crate::models::*;
|
||||
|
||||
use std::sync::Mutex;
|
||||
use std::{borrow::Cow, sync::Mutex};
|
||||
|
||||
pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
app: &AppHandle<R>,
|
||||
@@ -27,17 +29,38 @@ pub struct Clipboard<R: Runtime> {
|
||||
}
|
||||
|
||||
impl<R: Runtime> Clipboard<R> {
|
||||
pub fn write(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
pub fn write_text(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
match kind {
|
||||
ClipKind::PlainText { text, .. } => match &self.clipboard {
|
||||
Ok(clipboard) => clipboard.lock().unwrap().set_text(text).map_err(Into::into),
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
},
|
||||
_ => Err(crate::Error::Clipboard("Invalid clip kind!".to_string())),
|
||||
_ => Err(crate::Error::Clipboard("Invalid clip kind".to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn read(&self) -> crate::Result<ClipboardContents> {
|
||||
pub fn write_image(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
match kind {
|
||||
ClipKind::Image { image, .. } => match &self.clipboard {
|
||||
Ok(clipboard) => {
|
||||
let image = image.into_img(&self.app)?;
|
||||
clipboard
|
||||
.lock()
|
||||
.unwrap()
|
||||
.set_image(ImageData {
|
||||
bytes: Cow::Borrowed(image.rgba()),
|
||||
width: image.width() as usize,
|
||||
height: image.height() as usize,
|
||||
})
|
||||
.map_err(Into::into)
|
||||
}
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
},
|
||||
_ => Err(crate::Error::Clipboard("Invalid clip kind".to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn read_text(&self) -> crate::Result<ClipboardContents> {
|
||||
match &self.clipboard {
|
||||
Ok(clipboard) => {
|
||||
let text = clipboard.lock().unwrap().get_text()?;
|
||||
@@ -67,4 +90,24 @@ impl<R: Runtime> Clipboard<R> {
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn read_image(&self) -> crate::Result<Image<'_>> {
|
||||
match &self.clipboard {
|
||||
Ok(clipboard) => {
|
||||
let image = clipboard.lock().unwrap().get_image()?;
|
||||
|
||||
let mut buffer: Vec<u8> = Vec::new();
|
||||
image::codecs::png::PngEncoder::new(&mut buffer).write_image(
|
||||
&image.bytes,
|
||||
image.width as u32,
|
||||
image.height as u32,
|
||||
image::ColorType::Rgba8,
|
||||
)?;
|
||||
|
||||
let image = Image::new_owned(buffer, image.width as u32, image.height as u32);
|
||||
Ok(image)
|
||||
}
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,12 @@ pub enum Error {
|
||||
PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError),
|
||||
#[error("{0}")]
|
||||
Clipboard(String),
|
||||
#[cfg(desktop)]
|
||||
#[error(transparent)]
|
||||
Tauri(#[from] tauri::Error),
|
||||
#[cfg(desktop)]
|
||||
#[error("invalid image: {0}")]
|
||||
Image(#[from] image::ImageError),
|
||||
}
|
||||
|
||||
impl Serialize for Error {
|
||||
|
||||
@@ -48,13 +48,12 @@ impl<R: Runtime, T: Manager<R>> crate::ClipboardExt<R> for T {
|
||||
/// Initializes the plugin.
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
Builder::new("clipboard-manager")
|
||||
.js_init_script(include_str!("api-iife.js").to_string())
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::write,
|
||||
commands::read,
|
||||
#[cfg(desktop)]
|
||||
commands::write_text,
|
||||
commands::read_text,
|
||||
commands::read_image,
|
||||
commands::write_image,
|
||||
commands::write_html,
|
||||
#[cfg(desktop)]
|
||||
commands::clear
|
||||
])
|
||||
.setup(|app, api| {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
use serde::de::DeserializeOwned;
|
||||
use tauri::{
|
||||
image::Image,
|
||||
plugin::{PluginApi, PluginHandle},
|
||||
AppHandle, Runtime,
|
||||
};
|
||||
@@ -32,14 +33,26 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
pub struct Clipboard<R: Runtime>(PluginHandle<R>);
|
||||
|
||||
impl<R: Runtime> Clipboard<R> {
|
||||
pub fn write(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
pub fn write_text(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
self.0.run_mobile_plugin("write", kind).map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn read(&self) -> crate::Result<ClipboardContents> {
|
||||
pub fn write_image(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
Err(crate::Error::Clipboard(
|
||||
"Unsupported on this platform".to_string(),
|
||||
))
|
||||
}
|
||||
|
||||
pub fn read_text(&self) -> crate::Result<ClipboardContents> {
|
||||
self.0.run_mobile_plugin("read", ()).map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn read_image(&self) -> crate::Result<Image<'_>> {
|
||||
Err(crate::Error::Clipboard(
|
||||
"Unsupported on this platform".to_string(),
|
||||
))
|
||||
}
|
||||
|
||||
// Treat HTML as unsupported on mobile until tested
|
||||
pub fn write_html(&self, _kind: ClipKind) -> crate::Result<()> {
|
||||
Err(crate::Error::Clipboard(
|
||||
|
||||
@@ -4,13 +4,18 @@
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[derive(Deserialize)]
|
||||
#[cfg_attr(mobile, derive(Serialize))]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum ClipKind {
|
||||
PlainText {
|
||||
label: Option<String>,
|
||||
text: String,
|
||||
},
|
||||
#[cfg(desktop)]
|
||||
Image {
|
||||
image: tauri::image::JsImage,
|
||||
},
|
||||
Html {
|
||||
html: String,
|
||||
alt_html: Option<String>,
|
||||
@@ -20,5 +25,12 @@ pub enum ClipKind {
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum ClipboardContents {
|
||||
PlainText { text: String },
|
||||
PlainText {
|
||||
text: String,
|
||||
},
|
||||
Image {
|
||||
bytes: Vec<u8>,
|
||||
width: usize,
|
||||
height: usize,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
|
||||
|
||||
## \[2.0.0-beta.2]
|
||||
|
||||
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-deep-link"
|
||||
version = "2.0.0-beta.2"
|
||||
version = "2.0.0-beta.3"
|
||||
description = "Set your Tauri application as the default handler for an URL"
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
@@ -33,6 +33,7 @@ fn intent_filter(domain: &AssociatedDomain) -> String {
|
||||
|
||||
fn main() {
|
||||
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.android_path("android")
|
||||
.try_build()
|
||||
{
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4",
|
||||
"@tauri-apps/api": "2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-deep-link": "2.0.0-beta.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.0.0-beta.7",
|
||||
"@tauri-apps/cli": "2.0.0-beta.9",
|
||||
"internal-ip": "^8.0.0",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.0.12"
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4"
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
|
||||
@@ -128,7 +128,6 @@ impl<R: Runtime, T: Manager<R>> crate::DeepLinkExt<R> for T {
|
||||
/// Initializes the plugin.
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R, Option<config::Config>> {
|
||||
Builder::new("deep-link")
|
||||
.js_init_script(include_str!("api-iife.js").to_string())
|
||||
.invoke_handler(tauri::generate_handler![commands::get_current])
|
||||
.setup(|app, api| {
|
||||
app.manage(init_deep_link(app, api)?);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user