mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-14 14:27:48 +02:00
Compare commits
177 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f545c65ad | |||
| 37dbd4c38d | |||
| 2b53546ce5 | |||
| 293f363c0d | |||
| e3d41f4011 | |||
| 8638740223 | |||
| bb51a41d67 | |||
| 6698774f3f | |||
| c079d8c81b | |||
| 3db3b204b4 | |||
| cc29f7dbdb | |||
| 81c31b4114 | |||
| d3b9a60e31 | |||
| 2cb80325a0 | |||
| 4b3bc1ee13 | |||
| 5dcfdec03b | |||
| f79f2b79b3 | |||
| ce7750451d | |||
| 56406214a0 | |||
| 4c8ccf6767 | |||
| 1d85ae72b4 | |||
| 4aed0a48a2 | |||
| fa8ccec4f6 | |||
| 278755f1f5 | |||
| d229dd6661 | |||
| 86723a5372 | |||
| ed46dca74f | |||
| 5c97db96bd | |||
| 4210cf316a | |||
| 57e979adaf | |||
| 4a5ab18a22 | |||
| 1f9e7ab4a0 | |||
| 9144521b90 | |||
| 2b0cd3d882 | |||
| c967307706 | |||
| 27b258cf31 | |||
| 3dca7ff5ea | |||
| e39ea8ddf8 | |||
| 7768f245f9 | |||
| fe05b872aa | |||
| df1516da14 | |||
| 4aeee08cde | |||
| 69ee862fb7 | |||
| a70172dd93 | |||
| 37466eb87e | |||
| 500ff10fbd | |||
| 8d7689f6f9 | |||
| b0daeed1e8 | |||
| dbdd60a591 | |||
| 7e2fcc5e74 | |||
| dbe0277824 | |||
| ddb5ca188f | |||
| 7fc29c326b | |||
| cf832fe106 | |||
| 0e9541fe89 | |||
| f9bcc1c21d | |||
| 773b498392 | |||
| 3e620c6951 | |||
| a32e3200de | |||
| 73d8562849 | |||
| 73364a8b96 | |||
| 066058f631 | |||
| c6a5b7ae47 | |||
| d3c7ee5a61 | |||
| 719b651753 | |||
| 40ce253abf | |||
| 184f4edbbc | |||
| 8f857dc4e1 | |||
| 8cd4a39864 | |||
| 80af01181a | |||
| 42607f0dbd | |||
| 160498dae5 | |||
| 6db4320e98 | |||
| cc63614f1e | |||
| 02111b9526 | |||
| 03fab3c6ad | |||
| 6a6c9daeb2 | |||
| d95a1b382f | |||
| 24eb3398d0 | |||
| adbc333a0f | |||
| b74ccb6639 | |||
| c290049051 | |||
| 509c23ed36 | |||
| 11d98e911e | |||
| 30295ecc8e | |||
| ea294c776a | |||
| 19aa220411 | |||
| 85c4b8b67a | |||
| ed682dd96e | |||
| c3c55d5b4e | |||
| 0d3b6b8aca | |||
| 67df245eee | |||
| 382fc3a7bf | |||
| 7c59242905 | |||
| da76481ad3 | |||
| 25aecc0074 | |||
| 58176114f9 | |||
| 4cc2e50d16 | |||
| e096f63bda | |||
| 01211ff075 | |||
| 9299c919c7 | |||
| c7f92ddf2f | |||
| 1adb912547 | |||
| 67405aed06 | |||
| 8cb4e3d14d | |||
| 056a458d30 | |||
| 9ca77efff2 | |||
| 70d99086de | |||
| 035a4824d6 | |||
| cd7549f22e | |||
| 38aedb45e3 | |||
| 32a5f92c8f | |||
| cf00900298 | |||
| 83f9899f78 | |||
| c5e8cd31ec | |||
| 0cdbde386f | |||
| 2985957afc | |||
| fe09260483 | |||
| 775f7b88ed | |||
| 39108ceacb | |||
| c00b00a93c | |||
| d2ea535a16 | |||
| eec61a8a6d | |||
| 7701cf4107 | |||
| 539b566fad | |||
| 3ffa47c0e8 | |||
| df5a6483c2 | |||
| 27d610387c | |||
| 71d755f5f5 | |||
| 7c442019e1 | |||
| 9b99416965 | |||
| 7de603ebff | |||
| 35d821cbf1 | |||
| 563ca73de0 | |||
| 27eb8c74af | |||
| 4aa61dcc9e | |||
| e6b6748085 | |||
| 90fef3ae2d | |||
| cc352416e5 | |||
| 5e73de50e7 | |||
| 46dfb75d92 | |||
| 3af968ce8f | |||
| 4f8df2f86b | |||
| 65ea3d9adf | |||
| 776ff9c97e | |||
| 5c883bdd33 | |||
| af2892f6a1 | |||
| a5792e220a | |||
| eef088dde4 | |||
| 8d00fc08f0 | |||
| c7336bc330 | |||
| 84208e0a53 | |||
| 2a28c81da6 | |||
| 56750d31e6 | |||
| 899c6262f8 | |||
| 6a19feca1d | |||
| ad5ec05e26 | |||
| b67dc85936 | |||
| b01da63d55 | |||
| aabb440159 | |||
| e1eb82fe92 | |||
| a18d442765 | |||
| c98545b3ae | |||
| 3df9bc73f8 | |||
| 9b2e9ab6c9 | |||
| e7b022d62e | |||
| 4195240f36 | |||
| a67f7cb7c8 | |||
| 3f7c4ddc96 | |||
| 12900556a0 | |||
| 4899ae007a | |||
| 3db81b4fe3 | |||
| bd4bf06e6c | |||
| f780e87ee3 | |||
| 537053d317 | |||
| 4f9e58d751 | |||
| e9a0803d95 |
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"clipboard-manager": "patch"
|
||||
---
|
||||
|
||||
Expose `Clipboard` struct
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"log-js": patch
|
||||
---
|
||||
|
||||
Added `attachLogger` helper function to register a function that should be called for each log entry.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"single-instance": patch
|
||||
---
|
||||
|
||||
Added the `semver` feature flag to make the single instance mechanism only trigger for semver compatible versions.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"websocket": patch
|
||||
---
|
||||
|
||||
**Breaking change:** Enable rustls by default and added a method to configure the TLS Connector for tungstenite.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"http": patch
|
||||
---
|
||||
|
||||
**Breaking change:** Removed the `default-tls` feature flag. The `rustls-tls`, `http2`, `macos-system-configuration`, and `charset` feature flags are now enabled by default.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
**Breaking change:** The `rustls-tls` feature flag is now enabled by default.
|
||||
@@ -2,6 +2,7 @@
|
||||
"tag": "beta",
|
||||
"changes": [
|
||||
".changes/beta.md",
|
||||
".changes/clipboard-expose-struct.md",
|
||||
".changes/clipboard-html.md",
|
||||
".changes/clipboard-manager-image.md",
|
||||
".changes/clipboard-text-command-rename.md",
|
||||
@@ -11,11 +12,17 @@
|
||||
".changes/dialog-path-return-mismatch.md",
|
||||
".changes/enhance-fs-scope-type.md",
|
||||
".changes/enhance-http-scope.md",
|
||||
".changes/feat-log-attachlogger.md",
|
||||
".changes/feat-single-instance-semver.md",
|
||||
".changes/feat-websocket-tls-connector.md",
|
||||
".changes/file-autogen-fix.md",
|
||||
".changes/fix-autolaunch-macos.md",
|
||||
".changes/fix-fs-watcher-basedir.md",
|
||||
".changes/fix-http-default-features.md",
|
||||
".changes/fix-http-scope-url-match.md",
|
||||
".changes/fix-shutdown-timing.md",
|
||||
".changes/fix-updater-cleanup.md",
|
||||
".changes/fix-updater-default-features.md",
|
||||
".changes/fix-updater-installer-args-deserialization.md",
|
||||
".changes/fix-updater-installmode.md",
|
||||
".changes/fix-updater-powershell-flashing.md",
|
||||
@@ -27,13 +34,22 @@
|
||||
".changes/msrv-1.75.md",
|
||||
".changes/notification-fix-dev-check.md",
|
||||
".changes/public-with-store.md",
|
||||
".changes/remove-unc-path-prefix.md",
|
||||
".changes/reqwest-0.12.md",
|
||||
".changes/scoped-resources-table.md",
|
||||
".changes/shell-fix-schema-command-property-name.md",
|
||||
".changes/shell-shellexcute.md",
|
||||
".changes/single-instance.macos.md",
|
||||
".changes/tauri-beta-14-dependencies.md",
|
||||
".changes/tauri-beta-14.md",
|
||||
".changes/tauri-beta-15.md",
|
||||
".changes/tauri-beta-4.md",
|
||||
".changes/tauri-beta-8.md",
|
||||
".changes/tauri-beta-9.md",
|
||||
".changes/upload-returnval.md",
|
||||
".changes/window-state-custom-filename.md",
|
||||
".changes/window-state-default-filename.md",
|
||||
".changes/window-state-js-binding.md",
|
||||
".changes/window-state-json.md"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
dialog: patch
|
||||
fs: patch
|
||||
store: patch
|
||||
---
|
||||
|
||||
**Breaking Change:** All apis that return paths to the frontend will now remove the `\\?\` UNC prefix on Windows.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"upload": patch
|
||||
---
|
||||
|
||||
**Breaking change**: Removed http3 feature and added http2 feature.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"fs": "patch"
|
||||
"http": "patch"
|
||||
"updater": "patch"
|
||||
"clipboard-manager": "patch"
|
||||
---
|
||||
|
||||
Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"authenticator": patch
|
||||
"http": patch
|
||||
"updater": patch
|
||||
"upload": patch
|
||||
---
|
||||
|
||||
Update dependencies to align with tauri 2.0.0-beta.14.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"fs": patch
|
||||
"http": patch
|
||||
"updater": patch
|
||||
"clipboard-manager": patch
|
||||
---
|
||||
|
||||
Update for tauri 2.0.0-beta.15.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"upload": patch
|
||||
"upload-js": patch
|
||||
---
|
||||
|
||||
Return the upload response as a string and error out if the status code is not within 200-299.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"window-state": "patch"
|
||||
"window-state-js": "patch"
|
||||
---
|
||||
|
||||
Add `Builder::with_filename` to support using a custom filename. Also add `AppHandleExt::file_name` and a similar function in JS, to retrieve it later.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": "patch"
|
||||
---
|
||||
|
||||
**Breaking change**: Renamed `STATE_FILENAME` const to `DEFAULT_FILENAME`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": patch
|
||||
---
|
||||
|
||||
Fix `restore_window` and `filename` js binding missing permission
|
||||
@@ -43,10 +43,10 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: "lts/*"
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
version: 8.x.x
|
||||
run_install: true
|
||||
- name: audit
|
||||
run: pnpm audit
|
||||
|
||||
@@ -132,10 +132,10 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: "lts/*"
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
version: 8.x.x
|
||||
run_install: true
|
||||
|
||||
- name: build api
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
version: 8.x.x
|
||||
run_install: true
|
||||
|
||||
- name: install webkit2gtk and libudev for [authenticator]
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
version: 8.x.x
|
||||
run_install: true
|
||||
|
||||
- name: install webkit2gtk and libudev for [authenticator]
|
||||
@@ -64,5 +64,5 @@ jobs:
|
||||
title: "Publish New Versions"
|
||||
commit-message: "publish new versions"
|
||||
labels: "version updates"
|
||||
branch: "release"
|
||||
branch: "ci/release-v1"
|
||||
body: ${{ steps.covector.outputs.change }}
|
||||
|
||||
@@ -46,10 +46,10 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: "lts/*"
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
version: 8.x.x
|
||||
run_install: true
|
||||
- name: eslint
|
||||
run: pnpm lint
|
||||
@@ -66,10 +66,10 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: "lts/*"
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
version: 8.x.x
|
||||
run_install: true
|
||||
- name: prettier check
|
||||
run: pnpm format-check
|
||||
|
||||
@@ -34,11 +34,11 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: "lts/*"
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
version: 8.x.x
|
||||
run_install: true
|
||||
|
||||
- name: Build packages
|
||||
|
||||
Generated
+187
-618
File diff suppressed because it is too large
Load Diff
+5
-3
@@ -10,19 +10,21 @@ resolver = "2"
|
||||
[workspace.dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = "2.0.0-beta.14"
|
||||
tauri-build = "2.0.0-beta.11"
|
||||
tauri-plugin = "2.0.0-beta.11"
|
||||
tauri = "2.0.0-beta.15"
|
||||
tauri-build = "2.0.0-beta.12"
|
||||
tauri-plugin = "2.0.0-beta.12"
|
||||
serde_json = "1"
|
||||
thiserror = "1"
|
||||
url = "2"
|
||||
schemars = "0.8"
|
||||
dunce = "1"
|
||||
|
||||
[workspace.package]
|
||||
edition = "2021"
|
||||
authors = ["Tauri Programme within The Commons Conservancy"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
rust-version = "1.75"
|
||||
repository = "https://github.com/tauri-apps/plugins-workspace"
|
||||
|
||||
# default to small, optimized release binaries
|
||||
[profile.release]
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log-js@2.0.0-beta.3`
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "svelte-app",
|
||||
"private": true,
|
||||
"version": "2.0.0-beta.3",
|
||||
"version": "2.0.0-beta.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --clearScreen false",
|
||||
@@ -9,7 +9,7 @@
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6",
|
||||
"@tauri-apps/api": "2.0.0-beta.8",
|
||||
"@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",
|
||||
@@ -24,17 +24,17 @@
|
||||
"@tauri-apps/plugin-process": "2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-shell": "2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-updater": "2.0.0-beta.2",
|
||||
"@zerodevx/svelte-json-view": "1.0.7"
|
||||
"@zerodevx/svelte-json-view": "1.0.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/codicon": "^1.1.37",
|
||||
"@iconify-json/ph": "^1.1.8",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
||||
"@tauri-apps/cli": "2.0.0-beta.9",
|
||||
"@unocss/extractor-svelte": "^0.58.0",
|
||||
"@tauri-apps/cli": "2.0.0-beta.13",
|
||||
"@unocss/extractor-svelte": "^0.59.0",
|
||||
"internal-ip": "^8.0.0",
|
||||
"svelte": "^4.2.8",
|
||||
"unocss": "^0.58.0",
|
||||
"vite": "^5.0.12"
|
||||
"unocss": "^0.59.0",
|
||||
"vite": "^5.0.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager@2.1.0-beta.1`
|
||||
- Upgraded to `http@2.0.0-beta.5`
|
||||
- Upgraded to `updater@2.0.0-beta.4`
|
||||
- Upgraded to `dialog@2.0.0-beta.5`
|
||||
- Upgraded to `fs@2.0.0-beta.5`
|
||||
|
||||
## \[2.0.0-beta.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "api"
|
||||
publish = false
|
||||
version = "2.0.0-beta.4"
|
||||
version = "2.0.0-beta.5"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
rust-version = { workspace = true }
|
||||
@@ -17,13 +17,13 @@ tauri-build = { workspace = true, features = [ "codegen", "isolation" ] }
|
||||
[dependencies]
|
||||
serde_json = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
tiny_http = "0.11"
|
||||
tiny_http = "0.12"
|
||||
log = { workspace = true }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.3" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.4", 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.4" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.4" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.5", features = [ "watch" ] }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.1.0-beta.1" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.5" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.5" }
|
||||
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" }
|
||||
@@ -43,7 +43,7 @@ tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.3"
|
||||
[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.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" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-beta.4" }
|
||||
|
||||
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-beta.3" }
|
||||
|
||||
@@ -22,10 +22,16 @@
|
||||
"tray:default",
|
||||
"event:default",
|
||||
"window:default",
|
||||
"window:allow-minimize",
|
||||
"window:allow-maximize",
|
||||
"window:allow-unmaximize",
|
||||
"window:allow-close",
|
||||
"window:allow-start-dragging",
|
||||
"image:default",
|
||||
"notification:default",
|
||||
"os:allow-platform",
|
||||
"dialog:allow-open",
|
||||
"dialog:allow-ask",
|
||||
"dialog:allow-save",
|
||||
"dialog:allow-confirm",
|
||||
"dialog:allow-message",
|
||||
@@ -56,6 +62,8 @@
|
||||
},
|
||||
"shell:allow-kill",
|
||||
"shell:allow-stdin-write",
|
||||
"process:allow-exit",
|
||||
"process:allow-restart",
|
||||
"clipboard-manager:allow-read-text",
|
||||
"clipboard-manager:allow-write-text",
|
||||
"clipboard-manager:allow-read-image",
|
||||
|
||||
@@ -5983,6 +5983,13 @@
|
||||
"webview:allow-set-webview-size"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "webview:allow-set-webview-zoom -> Enables the set_webview_zoom command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"webview:allow-set-webview-zoom"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "webview:allow-webview-close -> Enables the webview_close command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -6060,6 +6067,13 @@
|
||||
"webview:deny-set-webview-size"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "webview:deny-set-webview-zoom -> Denies the set_webview_zoom command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"webview:deny-set-webview-zoom"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "webview:deny-webview-close -> Denies the webview_close command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
|
||||
@@ -145,10 +145,12 @@ pub fn run() {
|
||||
|
||||
app.run(move |_app_handle, _event| {
|
||||
#[cfg(desktop)]
|
||||
if let RunEvent::ExitRequested { api, .. } = &_event {
|
||||
// Keep the event loop running even if all windows are closed
|
||||
// This allow us to catch system tray events when there is no window
|
||||
api.prevent_exit();
|
||||
if let RunEvent::ExitRequested { code, api, .. } = &_event {
|
||||
if code.is_none() {
|
||||
// Keep the event loop running even if all windows are closed
|
||||
// This allow us to catch system tray events when there is no window
|
||||
api.prevent_exit();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+10
-9
@@ -13,26 +13,27 @@
|
||||
"@rollup/plugin-node-resolve": "15.2.3",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
"@rollup/plugin-typescript": "11.1.6",
|
||||
"@typescript-eslint/eslint-plugin": "6.20.0",
|
||||
"@typescript-eslint/parser": "6.20.0",
|
||||
"@typescript-eslint/eslint-plugin": "7.7.0",
|
||||
"@typescript-eslint/parser": "7.7.0",
|
||||
"covector": "^0.10.2",
|
||||
"eslint": "8.56.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-config-standard-with-typescript": "43.0.1",
|
||||
"eslint-plugin-import": "2.29.1",
|
||||
"eslint-plugin-n": "16.6.2",
|
||||
"eslint-plugin-n": "17.2.1",
|
||||
"eslint-plugin-promise": "6.1.1",
|
||||
"eslint-plugin-security": "2.1.0",
|
||||
"prettier": "3.2.2",
|
||||
"rollup": "4.9.6",
|
||||
"typescript": "5.3.3"
|
||||
"eslint-plugin-security": "3.0.0",
|
||||
"prettier": "3.2.5",
|
||||
"rollup": "4.14.3",
|
||||
"tslib": "2.6.2",
|
||||
"typescript": "5.4.5"
|
||||
},
|
||||
"resolutions": {
|
||||
"semver": ">=7.5.2",
|
||||
"optionator": ">=0.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"pnpm": ">=7.33.1"
|
||||
"pnpm": "^8.0.0"
|
||||
},
|
||||
"pnpm": {
|
||||
"auditConfig": {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.4]
|
||||
|
||||
- [`7e2fcc5`](https://github.com/tauri-apps/plugins-workspace/commit/7e2fcc5e74df7c3c718e40f75bfb0eafc7d69d8d)([#1146](https://github.com/tauri-apps/plugins-workspace/pull/1146)) Update dependencies to align with tauri 2.0.0-beta.14.
|
||||
|
||||
## \[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.
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
[package]
|
||||
name = "tauri-plugin-authenticator"
|
||||
version = "2.0.0-beta.3"
|
||||
version = "2.0.0-beta.4"
|
||||
description = "Use hardware security-keys in your Tauri App."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-authenticator"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
@@ -26,7 +27,7 @@ thiserror = { workspace = true }
|
||||
authenticator = "0.3.1"
|
||||
once_cell = "1"
|
||||
sha2 = "0.10"
|
||||
base64 = "0.21"
|
||||
base64 = "0.22"
|
||||
chrono = "0.4"
|
||||
bytes = "1"
|
||||
byteorder = "1"
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,15 @@ authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-autostart"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,16 @@ edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-barcode-scanner"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
targets = [ "x86_64-linux-android" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ pub struct BarcodeScanner<R: Runtime>(PluginHandle<R>);
|
||||
|
||||
impl<R: Runtime> BarcodeScanner<R> {}
|
||||
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the barcode scanner APIs.
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the barcode scanner APIs.
|
||||
pub trait BarcodeScannerExt<R: Runtime> {
|
||||
fn barcode_scanner(&self) -> &BarcodeScanner<R>;
|
||||
}
|
||||
|
||||
@@ -5,14 +5,15 @@ description = "Prompt the user for biometric authentication on Android and iOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-biometric"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -23,10 +23,7 @@
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"devDependencies": {
|
||||
"tslib": "2.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ impl<R: Runtime> Biometric<R> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the biometric APIs.
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the biometric APIs.
|
||||
pub trait BiometricExt<R: Runtime> {
|
||||
fn biometric(&self) -> &Biometric<R>;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,15 @@ edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-cli"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
@@ -21,4 +22,4 @@ serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
clap = { version = "4", features = [ "string" ] }
|
||||
clap = { version = "4", features = ["string"] }
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.1.0-beta.1]
|
||||
|
||||
- [`27b258c`](https://github.com/tauri-apps/plugins-workspace/commit/27b258cf31ae5557c99ae66537fb9196368d4d8b)([#1185](https://github.com/tauri-apps/plugins-workspace/pull/1185)) Expose `Clipboard` struct
|
||||
- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources.
|
||||
- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Update for tauri 2.0.0-beta.15.
|
||||
|
||||
## \[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).
|
||||
@@ -51,7 +57,7 @@
|
||||
|
||||
- [`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!
|
||||
\`]\(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]
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
[package]
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.1.0-beta.0"
|
||||
version = "2.1.0-beta.1"
|
||||
description = "Read and write to the system clipboard."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-clipboard-manager"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use tauri::{command, AppHandle, Manager, ResourceId, Runtime, State};
|
||||
use tauri::{command, AppHandle, Manager, ResourceId, Runtime, State, Webview};
|
||||
|
||||
use crate::{ClipKind, Clipboard, ClipboardContents, Result};
|
||||
|
||||
@@ -17,11 +17,12 @@ pub(crate) async fn write_text<R: Runtime>(
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn write_image<R: Runtime>(
|
||||
_app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
clipboard: State<'_, Clipboard<R>>,
|
||||
data: ClipKind,
|
||||
) -> Result<()> {
|
||||
clipboard.write_image(data)
|
||||
let resources_table = webview.resources_table();
|
||||
clipboard.write_image_inner(data, &resources_table)
|
||||
}
|
||||
|
||||
#[command]
|
||||
@@ -34,11 +35,11 @@ pub(crate) async fn read_text<R: Runtime>(
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn read_image<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
clipboard: State<'_, Clipboard<R>>,
|
||||
) -> Result<ResourceId> {
|
||||
let image = clipboard.read_image()?.to_owned();
|
||||
let mut resources_table = app.resources_table();
|
||||
let mut resources_table = webview.resources_table();
|
||||
let rid = resources_table.add(image);
|
||||
Ok(rid)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use arboard::ImageData;
|
||||
use image::ImageEncoder;
|
||||
use serde::de::DeserializeOwned;
|
||||
use tauri::{image::Image, plugin::PluginApi, AppHandle, Runtime};
|
||||
use tauri::{image::Image, plugin::PluginApi, AppHandle, Manager, ResourceTable, Runtime};
|
||||
|
||||
use crate::models::*;
|
||||
|
||||
@@ -39,11 +39,15 @@ impl<R: Runtime> Clipboard<R> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn write_image(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
pub(crate) fn write_image_inner(
|
||||
&self,
|
||||
kind: ClipKind,
|
||||
resources_table: &ResourceTable,
|
||||
) -> crate::Result<()> {
|
||||
match kind {
|
||||
ClipKind::Image { image, .. } => match &self.clipboard {
|
||||
Ok(clipboard) => {
|
||||
let image = image.into_img(&self.app)?;
|
||||
let image = image.into_img(resources_table)?;
|
||||
clipboard
|
||||
.lock()
|
||||
.unwrap()
|
||||
@@ -60,6 +64,11 @@ impl<R: Runtime> Clipboard<R> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn write_image(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
let resources_table = self.app.resources_table();
|
||||
self.write_image_inner(kind, &resources_table)
|
||||
}
|
||||
|
||||
pub fn read_text(&self) -> crate::Result<ClipboardContents> {
|
||||
match &self.clipboard {
|
||||
Ok(clipboard) => {
|
||||
|
||||
@@ -30,11 +30,11 @@ mod models;
|
||||
pub use error::{Error, Result};
|
||||
|
||||
#[cfg(desktop)]
|
||||
use desktop::Clipboard;
|
||||
pub use desktop::Clipboard;
|
||||
#[cfg(mobile)]
|
||||
use mobile::Clipboard;
|
||||
pub use mobile::Clipboard;
|
||||
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the clipboard APIs.
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the clipboard APIs.
|
||||
pub trait ClipboardExt<R: Runtime> {
|
||||
fn clipboard(&self) -> &Clipboard<R>;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,16 @@ impl<R: Runtime> Clipboard<R> {
|
||||
self.0.run_mobile_plugin("write", kind).map_err(Into::into)
|
||||
}
|
||||
|
||||
pub(crate) fn write_image_inner(
|
||||
&self,
|
||||
kind: ClipKind,
|
||||
resources_table: &tauri::ResourceTable,
|
||||
) -> crate::Result<()> {
|
||||
Err(crate::Error::Clipboard(
|
||||
"Unsupported on this platform".to_string(),
|
||||
))
|
||||
}
|
||||
|
||||
pub fn write_image(&self, kind: ClipKind) -> crate::Result<()> {
|
||||
Err(crate::Error::Clipboard(
|
||||
"Unsupported on this platform".to_string(),
|
||||
|
||||
@@ -6,17 +6,18 @@ authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-deep-link"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
targets = [ "x86_64-linux-android" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-linux-android"]
|
||||
|
||||
[build-dependencies]
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -8,7 +8,6 @@ pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6",
|
||||
"@tauri-apps/api": "2.0.0-beta.8",
|
||||
"@tauri-apps/plugin-deep-link": "2.0.0-beta.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.0.0-beta.9",
|
||||
"@tauri-apps/cli": "2.0.0-beta.13",
|
||||
"internal-ip": "^8.0.0",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.0.12"
|
||||
"vite": "^5.0.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ mod imp {
|
||||
|
||||
pub use imp::DeepLink;
|
||||
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the deep-link APIs.
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the deep-link APIs.
|
||||
pub trait DeepLinkExt<R: Runtime> {
|
||||
fn deep_link(&self) -> &DeepLink<R>;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.5]
|
||||
|
||||
- [`bb51a41`](https://github.com/tauri-apps/plugins-workspace/commit/bb51a41d67ebf989e8aedf10c4b1a7f9514d1bdf)([#1168](https://github.com/tauri-apps/plugins-workspace/pull/1168)) **Breaking Change:** All apis that return paths to the frontend will now remove the `\\?\` UNC prefix on Windows.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-beta.5`
|
||||
|
||||
## \[2.0.0-beta.4]
|
||||
|
||||
- [`4cd8112`](https://github.com/tauri-apps/plugins-workspace/commit/4cd81126fdf25e1847546f8fdbd924aa4bfeabb5)([#1056](https://github.com/tauri-apps/plugins-workspace/pull/1056)) Fixed an issue where dialogs on android would return the Content URI instead of the file path
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
[package]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.0.0-beta.4"
|
||||
version = "2.0.0-beta.5"
|
||||
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-dialog"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
@@ -22,10 +23,8 @@ serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.4" }
|
||||
|
||||
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
glib = "0.16"
|
||||
dunce = { workspace = true }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.5" }
|
||||
|
||||
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
rfd = { version = "0.14", default-features = false, features = [ "tokio", "gtk3", "common-controls-v6" ] }
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,12 @@ pub(crate) async fn open<R: Runtime>(
|
||||
}
|
||||
}
|
||||
}
|
||||
OpenResponse::Folders(folders)
|
||||
OpenResponse::Folders(folders.map(|folders| {
|
||||
folders
|
||||
.iter()
|
||||
.map(|p| dunce::simplified(p).to_path_buf())
|
||||
.collect()
|
||||
}))
|
||||
} else {
|
||||
let folder = dialog_builder.blocking_pick_folder();
|
||||
if let Some(path) = &folder {
|
||||
@@ -137,7 +142,7 @@ pub(crate) async fn open<R: Runtime>(
|
||||
s.allow_directory(path, options.recursive);
|
||||
}
|
||||
}
|
||||
OpenResponse::Folder(folder)
|
||||
OpenResponse::Folder(folder.map(|p| dunce::simplified(&p).to_path_buf()))
|
||||
}
|
||||
}
|
||||
#[cfg(mobile)]
|
||||
@@ -154,7 +159,15 @@ pub(crate) async fn open<R: Runtime>(
|
||||
.allow_file(&file.path)?;
|
||||
}
|
||||
}
|
||||
OpenResponse::Files(files)
|
||||
OpenResponse::Files(files.map(|files| {
|
||||
files
|
||||
.into_iter()
|
||||
.map(|mut f| {
|
||||
f.path = dunce::simplified(&f.path).to_path_buf();
|
||||
f
|
||||
})
|
||||
.collect()
|
||||
}))
|
||||
} else {
|
||||
let file = dialog_builder.blocking_pick_file();
|
||||
if let Some(file) = &file {
|
||||
@@ -165,7 +178,10 @@ pub(crate) async fn open<R: Runtime>(
|
||||
.state::<tauri::scope::Scopes>()
|
||||
.allow_file(&file.path)?;
|
||||
}
|
||||
OpenResponse::File(file)
|
||||
OpenResponse::File(file.map(|mut f| {
|
||||
f.path = dunce::simplified(&f.path).to_path_buf();
|
||||
f
|
||||
}))
|
||||
};
|
||||
Ok(res)
|
||||
}
|
||||
@@ -208,7 +224,7 @@ pub(crate) async fn save<R: Runtime>(
|
||||
window.state::<tauri::scope::Scopes>().allow_file(p)?;
|
||||
}
|
||||
|
||||
Ok(path)
|
||||
Ok(path.map(|p| dunce::simplified(&p).to_path_buf()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ macro_rules! blocking_fn {
|
||||
}};
|
||||
}
|
||||
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the dialog APIs.
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the dialog APIs.
|
||||
pub trait DialogExt<R: Runtime> {
|
||||
fn dialog(&self) -> &Dialog<R>;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.5]
|
||||
|
||||
- [`bb51a41`](https://github.com/tauri-apps/plugins-workspace/commit/bb51a41d67ebf989e8aedf10c4b1a7f9514d1bdf)([#1168](https://github.com/tauri-apps/plugins-workspace/pull/1168)) **Breaking Change:** All apis that return paths to the frontend will now remove the `\\?\` UNC prefix on Windows.
|
||||
- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources.
|
||||
- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Update for tauri 2.0.0-beta.15.
|
||||
|
||||
## \[2.0.0-beta.4]
|
||||
|
||||
- [`9c2fb93`](https://github.com/tauri-apps/plugins-workspace/commit/9c2fb9306ecd3936a2aef56b3c012899036db098) Enhance the scope type to also allow a plain string representing the path to allow or deny.
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
[package]
|
||||
name = "tauri-plugin-fs"
|
||||
version = "2.0.0-beta.4"
|
||||
version = "2.0.0-beta.5"
|
||||
description = "Access the file system."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-fs"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
+55
-55
@@ -9,7 +9,7 @@ use tauri::{
|
||||
ipc::{CommandScope, GlobalScope},
|
||||
path::{BaseDirectory, SafePathBuf},
|
||||
utils::config::FsScope,
|
||||
AppHandle, Manager, Resource, ResourceId, Runtime,
|
||||
Manager, Resource, ResourceId, Runtime, Webview,
|
||||
};
|
||||
|
||||
use std::{
|
||||
@@ -72,14 +72,14 @@ pub struct BaseOptions {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn create<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<ResourceId> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -91,7 +91,7 @@ pub fn create<R: Runtime>(
|
||||
resolved_path.display()
|
||||
)
|
||||
})?;
|
||||
let rid = app.resources_table().add(StdFileResource::new(file));
|
||||
let rid = webview.resources_table().add(StdFileResource::new(file));
|
||||
Ok(rid)
|
||||
}
|
||||
|
||||
@@ -122,14 +122,14 @@ fn default_true() -> bool {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn open<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<OpenOptions>,
|
||||
) -> CommandResult<ResourceId> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -164,14 +164,14 @@ pub fn open<R: Runtime>(
|
||||
)
|
||||
})?;
|
||||
|
||||
let rid = app.resources_table().add(StdFileResource::new(file));
|
||||
let rid = webview.resources_table().add(StdFileResource::new(file));
|
||||
|
||||
Ok(rid)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn close<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> CommandResult<()> {
|
||||
app.resources_table().close(rid).map_err(Into::into)
|
||||
pub fn close<R: Runtime>(webview: Webview<R>, rid: ResourceId) -> CommandResult<()> {
|
||||
webview.resources_table().close(rid).map_err(Into::into)
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
@@ -183,7 +183,7 @@ pub struct CopyFileOptions {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn copy_file<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
from_path: SafePathBuf,
|
||||
@@ -191,14 +191,14 @@ pub fn copy_file<R: Runtime>(
|
||||
options: Option<CopyFileOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_from_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
from_path,
|
||||
options.as_ref().and_then(|o| o.from_path_base_dir),
|
||||
)?;
|
||||
let resolved_to_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
to_path,
|
||||
@@ -225,14 +225,14 @@ pub struct MkdirOptions {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn mkdir<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<MkdirOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -292,14 +292,14 @@ fn read_dir_inner<P: AsRef<Path>>(path: P) -> crate::Result<Vec<DirEntry>> {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read_dir<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<Vec<DirEntry>> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -318,12 +318,12 @@ pub fn read_dir<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
rid: ResourceId,
|
||||
len: u32,
|
||||
) -> CommandResult<(Vec<u8>, usize)> {
|
||||
let mut data = vec![0; len as usize];
|
||||
let file = app.resources_table().get::<StdFileResource>(rid)?;
|
||||
let file = webview.resources_table().get::<StdFileResource>(rid)?;
|
||||
let nread = StdFileResource::with_lock(&file, |mut file| file.read(&mut data))
|
||||
.map_err(|e| format!("faied to read bytes from file with error: {e}"))?;
|
||||
Ok((data, nread))
|
||||
@@ -331,14 +331,14 @@ pub fn read<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read_file<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<Vec<u8>> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -356,14 +356,14 @@ pub fn read_file<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read_text_file<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<String> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -381,7 +381,7 @@ pub fn read_text_file<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read_text_file_lines<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
@@ -390,7 +390,7 @@ pub fn read_text_file_lines<R: Runtime>(
|
||||
use std::io::BufRead;
|
||||
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -405,17 +405,17 @@ pub fn read_text_file_lines<R: Runtime>(
|
||||
})?;
|
||||
|
||||
let lines = BufReader::new(file).lines();
|
||||
let rid = app.resources_table().add(StdLinesResource::new(lines));
|
||||
let rid = webview.resources_table().add(StdLinesResource::new(lines));
|
||||
|
||||
Ok(rid)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn read_text_file_lines_next<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
rid: ResourceId,
|
||||
) -> CommandResult<(Option<String>, bool)> {
|
||||
let mut resource_table = app.resources_table();
|
||||
let mut resource_table = webview.resources_table();
|
||||
let lines = resource_table.get::<StdLinesResource>(rid)?;
|
||||
|
||||
let ret = StdLinesResource::with_lock(&lines, |lines| {
|
||||
@@ -437,14 +437,14 @@ pub struct RemoveOptions {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn remove<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<RemoveOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -505,7 +505,7 @@ pub struct RenameOptions {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn rename<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
old_path: SafePathBuf,
|
||||
@@ -513,14 +513,14 @@ pub fn rename<R: Runtime>(
|
||||
options: Option<RenameOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_old_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
old_path,
|
||||
options.as_ref().and_then(|o| o.old_path_base_dir),
|
||||
)?;
|
||||
let resolved_new_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
new_path,
|
||||
@@ -547,13 +547,13 @@ pub enum SeekMode {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn seek<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
rid: ResourceId,
|
||||
offset: i64,
|
||||
whence: SeekMode,
|
||||
) -> CommandResult<u64> {
|
||||
use std::io::{Seek, SeekFrom};
|
||||
let file = app.resources_table().get::<StdFileResource>(rid)?;
|
||||
let file = webview.resources_table().get::<StdFileResource>(rid)?;
|
||||
StdFileResource::with_lock(&file, |mut file| {
|
||||
file.seek(match whence {
|
||||
SeekMode::Start => SeekFrom::Start(offset as u64),
|
||||
@@ -567,14 +567,14 @@ pub fn seek<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn stat<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<FileInfo> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -591,14 +591,14 @@ pub fn stat<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn lstat<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<FileInfo> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -614,8 +614,8 @@ pub fn lstat<R: Runtime>(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn fstat<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> CommandResult<FileInfo> {
|
||||
let file = app.resources_table().get::<StdFileResource>(rid)?;
|
||||
pub fn fstat<R: Runtime>(webview: Webview<R>, rid: ResourceId) -> CommandResult<FileInfo> {
|
||||
let file = webview.resources_table().get::<StdFileResource>(rid)?;
|
||||
let metadata = StdFileResource::with_lock(&file, |file| file.metadata())
|
||||
.map_err(|e| format!("failed to get metadata of file with error: {e}"))?;
|
||||
Ok(get_stat(metadata))
|
||||
@@ -623,7 +623,7 @@ pub fn fstat<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> CommandResult<Fi
|
||||
|
||||
#[tauri::command]
|
||||
pub fn truncate<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
@@ -631,7 +631,7 @@ pub fn truncate<R: Runtime>(
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -658,11 +658,11 @@ pub fn truncate<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn ftruncate<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
rid: ResourceId,
|
||||
len: Option<u64>,
|
||||
) -> CommandResult<()> {
|
||||
let file = app.resources_table().get::<StdFileResource>(rid)?;
|
||||
let file = webview.resources_table().get::<StdFileResource>(rid)?;
|
||||
StdFileResource::with_lock(&file, |file| file.set_len(len.unwrap_or(0)))
|
||||
.map_err(|e| format!("failed to truncate file with error: {e}"))
|
||||
.map_err(Into::into)
|
||||
@@ -670,11 +670,11 @@ pub fn ftruncate<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn write<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
rid: ResourceId,
|
||||
data: Vec<u8>,
|
||||
) -> CommandResult<usize> {
|
||||
let file = app.resources_table().get::<StdFileResource>(rid)?;
|
||||
let file = webview.resources_table().get::<StdFileResource>(rid)?;
|
||||
StdFileResource::with_lock(&file, |mut file| file.write(&data))
|
||||
.map_err(|e| format!("failed to write bytes to file with error: {e}"))
|
||||
.map_err(Into::into)
|
||||
@@ -700,7 +700,7 @@ fn default_create_value() -> bool {
|
||||
}
|
||||
|
||||
fn write_file_inner<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
command_scope: &CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
@@ -708,7 +708,7 @@ fn write_file_inner<R: Runtime>(
|
||||
options: Option<WriteFileOptions>,
|
||||
) -> CommandResult<()> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
global_scope,
|
||||
command_scope,
|
||||
path,
|
||||
@@ -753,19 +753,19 @@ fn write_file_inner<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn write_file<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
data: Vec<u8>,
|
||||
options: Option<WriteFileOptions>,
|
||||
) -> CommandResult<()> {
|
||||
write_file_inner(app, &global_scope, &command_scope, path, &data, options)
|
||||
write_file_inner(webview, &global_scope, &command_scope, path, &data, options)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn write_text_file<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
@@ -773,7 +773,7 @@ pub fn write_text_file<R: Runtime>(
|
||||
options: Option<WriteFileOptions>,
|
||||
) -> CommandResult<()> {
|
||||
write_file_inner(
|
||||
app,
|
||||
webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -784,14 +784,14 @@ pub fn write_text_file<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub fn exists<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
command_scope: CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
options: Option<BaseOptions>,
|
||||
) -> CommandResult<bool> {
|
||||
let resolved_path = resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -801,7 +801,7 @@ pub fn exists<R: Runtime>(
|
||||
}
|
||||
|
||||
pub fn resolve_path<R: Runtime>(
|
||||
app: &AppHandle<R>,
|
||||
app: &Webview<R>,
|
||||
global_scope: &GlobalScope<Entry>,
|
||||
command_scope: &CommandScope<Entry>,
|
||||
path: SafePathBuf,
|
||||
|
||||
@@ -8,7 +8,7 @@ use serde::Deserialize;
|
||||
use tauri::{
|
||||
ipc::{Channel, CommandScope, GlobalScope},
|
||||
path::{BaseDirectory, SafePathBuf},
|
||||
AppHandle, Manager, Resource, ResourceId, Runtime,
|
||||
Manager, Resource, ResourceId, Runtime, Webview,
|
||||
};
|
||||
|
||||
use std::{
|
||||
@@ -82,7 +82,7 @@ pub struct WatchOptions {
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn watch<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
paths: Vec<SafePathBuf>,
|
||||
options: WatchOptions,
|
||||
on_event: Channel,
|
||||
@@ -92,7 +92,7 @@ pub async fn watch<R: Runtime>(
|
||||
let mut resolved_paths = Vec::with_capacity(paths.capacity());
|
||||
for path in paths {
|
||||
resolved_paths.push(resolve_path(
|
||||
&app,
|
||||
&webview,
|
||||
&global_scope,
|
||||
&command_scope,
|
||||
path,
|
||||
@@ -124,7 +124,7 @@ pub async fn watch<R: Runtime>(
|
||||
WatcherKind::Watcher(watcher)
|
||||
};
|
||||
|
||||
let rid = app
|
||||
let rid = webview
|
||||
.resources_table()
|
||||
.add(WatcherResource::new(kind, resolved_paths));
|
||||
|
||||
@@ -132,8 +132,8 @@ pub async fn watch<R: Runtime>(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn unwatch<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> CommandResult<()> {
|
||||
let watcher = app.resources_table().take::<WatcherResource>(rid)?;
|
||||
pub async fn unwatch<R: Runtime>(webview: Webview<R>, rid: ResourceId) -> CommandResult<()> {
|
||||
let watcher = webview.resources_table().take::<WatcherResource>(rid)?;
|
||||
WatcherResource::with_lock(&watcher, |watcher| {
|
||||
match &mut watcher.kind {
|
||||
WatcherKind::Debouncer(ref mut debouncer) => {
|
||||
|
||||
@@ -6,14 +6,15 @@ edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-global-shortcut"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.5]
|
||||
|
||||
- [`500ff10`](https://github.com/tauri-apps/plugins-workspace/commit/500ff10fbd89fdfc73caf9d153029dad567b4ff1)([#1166](https://github.com/tauri-apps/plugins-workspace/pull/1166)) **Breaking change:** Removed the `default-tls` feature flag. The `rustls-tls`, `http2`, `macos-system-configuration`, and `charset` feature flags are now enabled by default.
|
||||
- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources.
|
||||
- [`7e2fcc5`](https://github.com/tauri-apps/plugins-workspace/commit/7e2fcc5e74df7c3c718e40f75bfb0eafc7d69d8d)([#1146](https://github.com/tauri-apps/plugins-workspace/pull/1146)) Update dependencies to align with tauri 2.0.0-beta.14.
|
||||
- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Update for tauri 2.0.0-beta.15.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-beta.5`
|
||||
|
||||
## \[2.0.0-beta.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
+15
-7
@@ -1,11 +1,12 @@
|
||||
[package]
|
||||
name = "tauri-plugin-http"
|
||||
version = "2.0.0-beta.4"
|
||||
version = "2.0.0-beta.5"
|
||||
description = "Access an HTTP client written in Rust."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-http"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
@@ -25,23 +26,28 @@ serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.4" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.5" }
|
||||
urlpattern = "0.2"
|
||||
regex = "1"
|
||||
http = "0.2"
|
||||
reqwest = { version = "0.11", default-features = false }
|
||||
http = "1"
|
||||
reqwest = { version = "0.12", default-features = false }
|
||||
url = { workspace = true }
|
||||
data-url = "0.3"
|
||||
|
||||
[features]
|
||||
default = [
|
||||
"rustls-tls",
|
||||
"http2",
|
||||
"charset",
|
||||
"macos-system-configuration"
|
||||
]
|
||||
multipart = [ "reqwest/multipart" ]
|
||||
json = [ "reqwest/json" ]
|
||||
stream = [ "reqwest/stream" ]
|
||||
native-tls = [ "reqwest/native-tls" ]
|
||||
native-tls-vendored = [ "reqwest/native-tls-vendored" ]
|
||||
rustls-tls = [ "reqwest/rustls-tls" ]
|
||||
default-tls = [ "reqwest/default-tls" ]
|
||||
native-tls-alpn = [ "reqwest/native-tls-alpn" ]
|
||||
rustls-tls = [ "reqwest/rustls-tls" ]
|
||||
rustls-tls-manual-roots = [ "reqwest/rustls-tls-manual-roots" ]
|
||||
rustls-tls-webpki-roots = [ "reqwest/rustls-tls-webpki-roots" ]
|
||||
rustls-tls-native-roots = [ "reqwest/rustls-tls-native-roots" ]
|
||||
@@ -52,5 +58,7 @@ brotli = [ "reqwest/brotli" ]
|
||||
deflate = [ "reqwest/deflate" ]
|
||||
trust-dns = [ "reqwest/trust-dns" ]
|
||||
socks = [ "reqwest/socks" ]
|
||||
http3 = [ "reqwest/http3" ]
|
||||
http2 = [ "reqwest/http2" ]
|
||||
charset = [ "reqwest/charset" ]
|
||||
macos-system-configuration = [ "reqwest/macos-system-configuration" ]
|
||||
unsafe-headers = [ ]
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ use tauri::{
|
||||
async_runtime::Mutex,
|
||||
command,
|
||||
ipc::{CommandScope, GlobalScope},
|
||||
AppHandle, Manager, ResourceId, Runtime,
|
||||
Manager, ResourceId, Runtime, Webview,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
@@ -137,7 +137,7 @@ fn attach_proxy(
|
||||
|
||||
#[command]
|
||||
pub async fn fetch<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
client_config: ClientConfig,
|
||||
command_scope: CommandScope<Entry>,
|
||||
global_scope: GlobalScope<Entry>,
|
||||
@@ -249,7 +249,7 @@ pub async fn fetch<R: Runtime>(
|
||||
}
|
||||
|
||||
let fut = async move { Ok(request.send().await.map_err(Into::into)) };
|
||||
let mut resources_table = app.resources_table();
|
||||
let mut resources_table = webview.resources_table();
|
||||
let rid = resources_table.add(FetchRequest::new(Box::pin(fut)));
|
||||
|
||||
Ok(rid)
|
||||
@@ -270,7 +270,7 @@ pub async fn fetch<R: Runtime>(
|
||||
.body(reqwest::Body::from(body))?;
|
||||
|
||||
let fut = async move { Ok(Ok(reqwest::Response::from(response))) };
|
||||
let mut resources_table = app.resources_table();
|
||||
let mut resources_table = webview.resources_table();
|
||||
let rid = resources_table.add(FetchRequest::new(Box::pin(fut)));
|
||||
Ok(rid)
|
||||
}
|
||||
@@ -279,9 +279,9 @@ pub async fn fetch<R: Runtime>(
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub async fn fetch_cancel<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> crate::Result<()> {
|
||||
pub async fn fetch_cancel<R: Runtime>(webview: Webview<R>, rid: ResourceId) -> crate::Result<()> {
|
||||
let req = {
|
||||
let resources_table = app.resources_table();
|
||||
let resources_table = webview.resources_table();
|
||||
resources_table.get::<FetchRequest>(rid)?
|
||||
};
|
||||
let mut req = req.0.lock().await;
|
||||
@@ -292,11 +292,11 @@ pub async fn fetch_cancel<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> cra
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn fetch_send<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
rid: ResourceId,
|
||||
) -> crate::Result<FetchResponse> {
|
||||
let req = {
|
||||
let mut resources_table = app.resources_table();
|
||||
let mut resources_table = webview.resources_table();
|
||||
resources_table.take::<FetchRequest>(rid)?
|
||||
};
|
||||
|
||||
@@ -315,7 +315,7 @@ pub async fn fetch_send<R: Runtime>(
|
||||
));
|
||||
}
|
||||
|
||||
let mut resources_table = app.resources_table();
|
||||
let mut resources_table = webview.resources_table();
|
||||
let rid = resources_table.add(ReqwestResponse(res));
|
||||
|
||||
Ok(FetchResponse {
|
||||
@@ -329,11 +329,11 @@ pub async fn fetch_send<R: Runtime>(
|
||||
|
||||
#[tauri::command]
|
||||
pub(crate) async fn fetch_read_body<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
webview: Webview<R>,
|
||||
rid: ResourceId,
|
||||
) -> crate::Result<tauri::ipc::Response> {
|
||||
let res = {
|
||||
let mut resources_table = app.resources_table();
|
||||
let mut resources_table = webview.resources_table();
|
||||
resources_table.take::<ReqwestResponse>(rid)?
|
||||
};
|
||||
let res = Arc::into_inner(res).unwrap().0;
|
||||
|
||||
@@ -6,6 +6,7 @@ authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
## \[2.0.0-beta.3]
|
||||
|
||||
- [`ed46dca`](https://github.com/tauri-apps/plugins-workspace/commit/ed46dca74ff3947dbbcb26a7b571c129bf925698) Added `attachLogger` helper function to register a function that should be called for each log entry.
|
||||
|
||||
## \[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]
|
||||
|
||||
@@ -6,14 +6,15 @@ authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-log"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
@@ -21,17 +22,17 @@ serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
serde_repr = "0.1"
|
||||
byte-unit = "5"
|
||||
log = { workspace = true, features = [ "kv_unstable" ] }
|
||||
time = { version = "0.3", features = [ "formatting", "local-offset" ] }
|
||||
log = { workspace = true, features = ["kv_unstable"] }
|
||||
time = { version = "0.3", features = ["formatting", "local-offset"] }
|
||||
fern = "0.6"
|
||||
|
||||
[target."cfg(target_os = \"android\")".dependencies]
|
||||
android_logger = "0.11"
|
||||
android_logger = "0.13"
|
||||
|
||||
[target."cfg(target_os = \"ios\")".dependencies]
|
||||
swift-rs = "1.0.1"
|
||||
swift-rs = "1"
|
||||
objc = "0.2"
|
||||
cocoa = "0.24"
|
||||
|
||||
[features]
|
||||
colored = [ "fern/colored" ]
|
||||
colored = ["fern/colored"]
|
||||
|
||||
@@ -23,7 +23,9 @@ tauri-plugin-log = "2.0.0-beta"
|
||||
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
|
||||
```
|
||||
|
||||
You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
|
||||
If you want the single instance mechanism to only trigger for semver compatible instances of your apps, for example if you expect users to have multiple installations of your app installed, you can add `features = ["semver"]` to the dependency declaration in `Cargo.toml`.
|
||||
|
||||
Then you can install the JavaScript Guest bindings using your preferred JavaScript package manager:
|
||||
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_LOG__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var a,t;async function o(e,a,t){const o="string"==typeof t?.target?{kind:"AnyLabel",label:t.target}:t?.target??{kind:"Any"};return r("plugin:event|listen",{event:e,target:o,handler:n(a)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(e,n,a){const t=(new Error).stack?.split("\n").map((e=>e.split("@"))),o=t?.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:i,line:c,keyValues:l}=a??{};let u=o?.[0]?.filter((e=>e.length>0)).join("@");"Error"===u&&(u="webview::unknown"),await r("plugin:log|log",{level:e,message:n,location:u,file:i,line:c,keyValues:l})}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WEBVIEW_CREATED="tauri://webview-created",e.FILE_DROP="tauri://file-drop",e.FILE_DROP_HOVER="tauri://file-drop-hover",e.FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(a||(a={})),function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(t||(t={})),e.attachConsole=async function(){return await o("log://log",(e=>{const n=e.payload,r=n.message.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"");switch(n.level){case t.Trace:console.log(r);break;case t.Debug:console.debug(r);break;case t.Info:console.info(r);break;case t.Warn:console.warn(r);break;case t.Error:console.error(r);break;default:throw new Error(`unknown log level ${n.level}`)}}))},e.debug=async function(e,n){await i(t.Debug,e,n)},e.error=async function(e,n){await i(t.Error,e,n)},e.info=async function(e,n){await i(t.Info,e,n)},e.trace=async function(e,n){await i(t.Trace,e,n)},e.warn=async function(e,n){await i(t.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_LOG__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var a,t;async function o(e,a,t){const o="string"==typeof t?.target?{kind:"AnyLabel",label:t.target}:t?.target??{kind:"Any"};return r("plugin:event|listen",{event:e,target:o,handler:n(a)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(e,n,a){const t=(new Error).stack?.split("\n").map((e=>e.split("@"))),o=t?.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:i,line:c,keyValues:l}=a??{};let u=o?.[0]?.filter((e=>e.length>0)).join("@");"Error"===u&&(u="webview::unknown"),await r("plugin:log|log",{level:e,message:n,location:u,file:i,line:c,keyValues:l})}async function c(e){return await o("log://log",(n=>{const{level:r}=n.payload;let{message:a}=n.payload;a=a.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),e({message:a,level:r})}))}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WEBVIEW_CREATED="tauri://webview-created",e.FILE_DROP="tauri://file-drop",e.FILE_DROP_HOVER="tauri://file-drop-hover",e.FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(a||(a={})),function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(t||(t={})),e.attachConsole=async function(){return c((({level:e,message:n})=>{switch(e){case t.Trace:console.log(n);break;case t.Debug:console.debug(n);break;case t.Info:console.info(n);break;case t.Warn:console.warn(n);break;case t.Error:console.error(n);break;default:throw new Error(`unknown log level ${e}`)}}))},e.attachLogger=c,e.debug=async function(e,n){await i(t.Debug,e,n)},e.error=async function(e,n){await i(t.Error,e,n)},e.info=async function(e,n){await i(t.Info,e,n)},e.trace=async function(e,n){await i(t.Trace,e,n)},e.warn=async function(e,n){await i(t.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})}
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { listen, UnlistenFn } from "@tauri-apps/api/event";
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { listen, type UnlistenFn, type Event } from "@tauri-apps/api/event";
|
||||
|
||||
export type LogOptions = {
|
||||
file?: string;
|
||||
@@ -189,19 +188,38 @@ interface RecordPayload {
|
||||
message: string;
|
||||
}
|
||||
|
||||
export async function attachConsole(): Promise<UnlistenFn> {
|
||||
return await listen("log://log", (event) => {
|
||||
const payload = event.payload as RecordPayload;
|
||||
type LoggerFn = (fn: RecordPayload) => void;
|
||||
|
||||
/**
|
||||
* Attaches a listener for the log, and calls the passed function for each log entry.
|
||||
* @param fn
|
||||
*
|
||||
* @returns a function to cancel the listener.
|
||||
*/
|
||||
export async function attachLogger(fn: LoggerFn): Promise<UnlistenFn> {
|
||||
return await listen("log://log", (event: Event<RecordPayload>) => {
|
||||
const { level } = event.payload;
|
||||
let { message } = event.payload;
|
||||
|
||||
// Strip ANSI escape codes
|
||||
const message = payload.message.replace(
|
||||
message = message.replace(
|
||||
// TODO: Investigate security/detect-unsafe-regex
|
||||
// eslint-disable-next-line no-control-regex, security/detect-unsafe-regex
|
||||
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
|
||||
"",
|
||||
);
|
||||
fn({ message, level });
|
||||
});
|
||||
}
|
||||
|
||||
switch (payload.level) {
|
||||
/**
|
||||
* Attaches a listener that writes log entries to the console as they come in.
|
||||
*
|
||||
* @returns a function to cancel the listener.
|
||||
*/
|
||||
export async function attachConsole(): Promise<UnlistenFn> {
|
||||
return attachLogger(({ level, message }: RecordPayload) => {
|
||||
switch (level) {
|
||||
case LogLevel.Trace:
|
||||
console.log(message);
|
||||
break;
|
||||
@@ -219,7 +237,7 @@ export async function attachConsole(): Promise<UnlistenFn> {
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
throw new Error(`unknown log level ${payload.level}`);
|
||||
throw new Error(`unknown log level ${level}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-log",
|
||||
"version": "2.0.0-beta.2",
|
||||
"version": "2.0.0-beta.3",
|
||||
"description": "Configurable logging for your Tauri app.",
|
||||
"license": "MIT or APACHE-2.0",
|
||||
"authors": [
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,15 @@ description = "Read and write NFC tags on Android and iOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-nfc"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -23,10 +23,7 @@
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"devDependencies": {
|
||||
"tslib": "2.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ impl<R: Runtime> Nfc<R> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the nfc APIs.
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the NFC APIs.
|
||||
pub trait NfcExt<R: Runtime> {
|
||||
fn nfc(&self) -> &Nfc<R>;
|
||||
}
|
||||
|
||||
@@ -6,15 +6,16 @@ edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-notification"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
@@ -23,12 +24,12 @@ tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
rand = "0.8"
|
||||
time = { version = "0.3", features = [ "serde", "parsing", "formatting" ] }
|
||||
url = { version = "2", features = [ "serde" ] }
|
||||
time = { version = "0.3", features = ["serde", "parsing", "formatting"] }
|
||||
url = { version = "2", features = ["serde"] }
|
||||
serde_repr = "0.1"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
win7-notifications = { version = "0.3.1", optional = true }
|
||||
win7-notifications = { version = "0.4.3", optional = true }
|
||||
windows-version = { version = "0.1", optional = true }
|
||||
|
||||
[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies]
|
||||
@@ -42,14 +43,14 @@ mac-notification-sys = "0.6"
|
||||
chrono = { version = "0.4", optional = true }
|
||||
|
||||
[target."cfg(target_os=\"windows\")".dependencies]
|
||||
winrt-notification = { package = "tauri-winrt-notification", version = "0.1" }
|
||||
winrt-notification = { package = "tauri-winrt-notification", version = "0.2" }
|
||||
|
||||
[dev-dependencies]
|
||||
color-backtrace = "0.5"
|
||||
color-backtrace = "0.6"
|
||||
ctor = "0.2"
|
||||
maplit = "1.0"
|
||||
|
||||
[features]
|
||||
default = [ "zbus", "async" ]
|
||||
async = [ ]
|
||||
windows7-compat = [ "win7-notifications", "windows-version" ]
|
||||
default = ["zbus", "async"]
|
||||
async = []
|
||||
windows7-compat = ["win7-notifications", "windows-version"]
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ impl<R: Runtime> NotificationBuilder<R> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the notification APIs.
|
||||
/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the notification APIs.
|
||||
pub trait NotificationExt<R: Runtime> {
|
||||
fn notification(&self) -> &Notification<R>;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,15 @@ edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-os"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.0-beta.5`
|
||||
|
||||
## \[2.0.0-beta.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
[package]
|
||||
name = "tauri-plugin-persisted-scope"
|
||||
version = "2.0.0-beta.4"
|
||||
version = "2.0.0-beta.5"
|
||||
description = "Save filesystem and asset scopes and restore them when the app is reopened."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
@@ -19,7 +20,7 @@ log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
aho-corasick = "1"
|
||||
bincode = "1"
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.4" }
|
||||
tauri-plugin-fs = { path = "../fs", version = "2.0.0-beta.5" }
|
||||
|
||||
[features]
|
||||
protocol-asset = [ "tauri/protocol-asset" ]
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
## \[1.0.5]
|
||||
|
||||
- `TrayLeft`, `TrayRight` and `TrayCenter` will now position the window according to the tray position relative to the monitor dimensions to prevent windows being displayed partially off-screen.
|
||||
- [3d27909](https://github.com/tauri-apps/plugins-workspace/commit/3d279094d44be78cdc5d1de3938f1414e13db6b0) fix(positioner): Prevent tray relative windows from being moved off-screen ([#291](https://github.com/tauri-apps/plugins-workspace/pull/291)) on 2023-09-27
|
||||
|
||||
## \[0.2.7]
|
||||
|
||||
- Update Tauri to v1.0.0
|
||||
|
||||
@@ -6,14 +6,15 @@ authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-positioner"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true }
|
||||
@@ -24,4 +25,4 @@ thiserror = { workspace = true }
|
||||
serde_repr = "0.1"
|
||||
|
||||
[features]
|
||||
tray-icon = [ "tauri/tray-icon" ]
|
||||
tray-icon = ["tauri/tray-icon"]
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,13 +36,11 @@ struct Tray(std::sync::Mutex<Option<(PhysicalPosition<f64>, PhysicalSize<f64>)>>
|
||||
#[cfg(feature = "tray-icon")]
|
||||
pub fn on_tray_event<R: Runtime>(app: &AppHandle<R>, event: &TrayIconEvent) {
|
||||
let position = PhysicalPosition {
|
||||
x: event.x,
|
||||
y: event.y,
|
||||
};
|
||||
let size = PhysicalSize {
|
||||
width: event.icon_rect.right - event.icon_rect.left,
|
||||
height: event.icon_rect.bottom - event.icon_rect.top,
|
||||
x: event.position.x,
|
||||
y: event.position.y,
|
||||
};
|
||||
// tray-icon emits PhysicalSize so the scale factor should not matter.
|
||||
let size = event.icon_rect.size.to_physical(1.0);
|
||||
app.state::<Tray>()
|
||||
.0
|
||||
.lock()
|
||||
|
||||
@@ -6,14 +6,15 @@ edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-process"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { workspace = true }
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,15 @@ edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
links = "tauri-plugin-shell"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-plugin = { workspace = true, features = [ "build" ] }
|
||||
tauri-plugin = { workspace = true, features = ["build"] }
|
||||
schemars = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
|
||||
@@ -26,6 +27,6 @@ log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
shared_child = "1"
|
||||
regex = "1"
|
||||
open = { version = "5", features = [ "shellexecute-on-windows" ] }
|
||||
open = { version = "5", features = ["shellexecute-on-windows"] }
|
||||
encoding_rs = "0.8"
|
||||
os_pipe = "1"
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
"@tauri-apps/api": "2.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-beta.6]
|
||||
|
||||
- [`ed46dca`](https://github.com/tauri-apps/plugins-workspace/commit/ed46dca74ff3947dbbcb26a7b571c129bf925698) Added the `semver` feature flag to make the single instance mechanism only trigger for semver compatible versions.
|
||||
|
||||
## \[2.0.0-beta.5]
|
||||
|
||||
- [`dabac0e`](https://github.com/tauri-apps/plugins-workspace/commit/dabac0eedfd6e6d192c6c5a214e708b3c0223f6f)([#1035](https://github.com/tauri-apps/plugins-workspace/pull/1035)) Added implementation for MacOS.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user