Compare commits

..

7 Commits

Author SHA1 Message Date
Lucas Nogueira 8cf1cb9d02 update tauri to cef/wry feature flag removal 2026-03-11 11:36:00 -03:00
FabianLars c6561ab6b4 revert to draft07 schema 2026-03-09 12:32:45 +01:00
FabianLars 8d6a6d6d31 Merge remote-tracking branch 'origin/v2' into feat/cef 2026-03-09 12:31:03 +01:00
Lucas Nogueira 352381c6c6 update to latest tauri feat/cef (schemars v1) 2026-02-18 12:45:33 -03:00
Lucas Nogueira e2840a7b52 Merge branch 'v2' into feat/cef 2026-02-18 12:43:41 -03:00
Lucas Nogueira 93ac4cb59b fix mobile build 2026-02-05 17:29:29 -03:00
Lucas Nogueira ad8ec1b6b8 feat(deep-link): handle RunEvent::Opened on Linux for CEF support 2026-02-05 12:32:26 -03:00
235 changed files with 3959 additions and 8262 deletions
-12
View File
@@ -1,17 +1,5 @@
[advisories] [advisories]
ignore = [ ignore = [
# rsa Marvin Attack
"RUSTSEC-2023-0071",
# time crate can't be updated in the repo because of MSRV, users are unaffected # time crate can't be updated in the repo because of MSRV, users are unaffected
"RUSTSEC-2026-0009", "RUSTSEC-2026-0009",
# libflate crates can't be updated in the repo because of MSRV, users are unaffected
"RUSTSEC-2026-0105",
# quick-xml, need an update in plist, can't be updated in the repo because of MSRV, users are unaffected
# Also needs on update in wayland-scanner > arboard > tauri-plugin-clipboard-manager
"RUSTSEC-2026-0194",
# quick-xml, need an update in plist, can't be updated in the repo because of MSRV, users are unaffected
# Also needs on update in wayland-scanner > arboard > tauri-plugin-clipboard-manager
"RUSTSEC-2026-0195",
# quinn-proto, can't be updated in the repo because of MSRV, users are unaffected
"RUSTSEC-2026-0185",
] ]
@@ -0,0 +1,6 @@
---
"sql": minor
"sql-js": minor
---
Add support for Postgres `NUMERIC` and custom data types.
+6
View File
@@ -0,0 +1,6 @@
---
"fs": minor
"fs-js": minor
---
Add `encoding` option for `readTextFile` and `readTextFileLines`
+6
View File
@@ -0,0 +1,6 @@
---
"http": patch
"http-js": patch
---
Correct Response header initialization to support cloning and ensure Set-Cookie visibility.
+6
View File
@@ -0,0 +1,6 @@
---
"updater": patch
"updater-js": patch
---
fix: preserve file extension of updater package, otherwise users may get confused when presented with a sudo dialog suggesting to install a file with the extension `.rpm` using `dpkg -i`
@@ -0,0 +1,6 @@
---
"dialog": minor
"dialog-js": minor
---
Re-use `message` command in Rust side for `ask` and `confirm` commands, `allow-ask` and `allow-confirm` permissions are now aliases to `allow-message`
+6
View File
@@ -0,0 +1,6 @@
---
"fs": minor
"fs-js": minor
---
Enable access for security-scoped resources on iOS by automatically calling `NSURL::startAccessingSecurityScopedResource` on resource access and adding the `stopAccessingSecurityScopedResource` API.
+6
View File
@@ -0,0 +1,6 @@
---
"deep-link": patch
"deep-link-js": patch
---
Validate Android new intent is actually a deep link before triggering the onOpenUrl event.
-11
View File
@@ -5,7 +5,6 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
- [Issue Reporting Guidelines](#issue-reporting-guidelines) - [Issue Reporting Guidelines](#issue-reporting-guidelines)
- [Pull Request Guidelines](#pull-request-guidelines) - [Pull Request Guidelines](#pull-request-guidelines)
- [Development Guide](#development-guide) - [Development Guide](#development-guide)
- [AI Tool Policy](#ai-tool-policy)
## Issue Reporting Guidelines ## Issue Reporting Guidelines
@@ -61,13 +60,3 @@ The easiest way to test your changes is to use the [example app](https://github.
To test local changes against your own application simply point the plugin create to your local repository, for example: To test local changes against your own application simply point the plugin create to your local repository, for example:
`tauri-plugin-sample = { path = "path/to/local/tauri-plugin-sample/" }` `tauri-plugin-sample = { path = "path/to/local/tauri-plugin-sample/" }`
## AI Tool Policy
It takes a lot of time to review a Pull Request while it's very easy to make a nonsensical but plausible looking one using AI tools.
It is unfair for other contributors and the reviewers to spend much of the time dealing with this, hence these rules:
1. Review and test all LLM-generated content before submitting, you're the one responsible for it, not the AI.
2. Don't use AI to respond to review comments (except for translations).
We will close the Pull Request with a `ai-slop` tag if you failed to do so.
+5 -4
View File
@@ -33,19 +33,20 @@ jobs:
audit-js: audit-js:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: Cache pnpm modules - name: Cache pnpm modules
uses: actions/cache@v6 uses: actions/cache@v4
with: with:
path: ~/.pnpm-store path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}- ${{ runner.os }}-
- uses: actions/setup-node@v7 - uses: actions/setup-node@v4
with: with:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v6 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x
run_install: true run_install: true
- name: audit - name: audit
run: pnpm audit run: pnpm audit
+1 -1
View File
@@ -33,7 +33,7 @@ jobs:
audit-rust: audit-rust:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- uses: rustsec/audit-check@v2 - uses: rustsec/audit-check@v2
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: check change files end with .md - name: check change files end with .md
run: | run: |
+6 -5
View File
@@ -21,7 +21,7 @@ jobs:
outputs: outputs:
packages: ${{ steps.filter.outputs.changes }} packages: ${{ steps.filter.outputs.changes }}
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- uses: dorny/paths-filter@v2 - uses: dorny/paths-filter@v2
id: filter id: filter
with: with:
@@ -153,20 +153,21 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: Cache pnpm modules - name: Cache pnpm modules
uses: actions/cache@v6 uses: actions/cache@v4
with: with:
path: ~/.pnpm-store path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}- ${{ runner.os }}-
- uses: actions/setup-node@v7 - uses: actions/setup-node@v4
with: with:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v6 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x
run_install: true run_install: true
- name: build api - name: build api
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- uses: dorny/paths-filter@v2 - uses: dorny/paths-filter@v2
id: filter id: filter
with: with:
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 # required for use of git history fetch-depth: 0 # required for use of git history
- name: covector status - name: covector status
@@ -28,17 +28,18 @@ jobs:
successfulPublish: ${{ steps.covector.outputs.successfulPublish }} successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 # required for use of git history fetch-depth: 0 # required for use of git history
- uses: actions/setup-node@v7 - uses: actions/setup-node@v4
with: with:
node-version: 'lts/*' node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
- uses: pnpm/action-setup@v6 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x
run_install: true run_install: true
- name: cargo login - name: cargo login
@@ -73,7 +74,7 @@ jobs:
- name: Create Pull Request With Versions Bumped - name: Create Pull Request With Versions Bumped
id: cpr id: cpr
uses: peter-evans/create-pull-request@v8.1.1 uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # 7.0.7
if: steps.covector.outputs.commandRan == 'version' if: steps.covector.outputs.commandRan == 'version'
with: with:
title: 'Publish New Versions (${{ github.ref_name }})' title: 'Publish New Versions (${{ github.ref_name }})'
+7 -6
View File
@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: install Rust stable and rustfmt - name: install Rust stable and rustfmt
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
@@ -25,19 +25,20 @@ jobs:
prettier: prettier:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: Cache pnpm modules - name: Cache pnpm modules
uses: actions/cache@v6 uses: actions/cache@v4
with: with:
path: ~/.pnpm-store path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}- ${{ runner.os }}-
- uses: actions/setup-node@v7 - uses: actions/setup-node@v4
with: with:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v6 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x
run_install: true run_install: true
- run: pnpm format:check - run: pnpm format:check
@@ -45,7 +46,7 @@ jobs:
name: taplo (.toml files) name: taplo (.toml files)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: install Rust stable - name: install Rust stable
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
+1 -1
View File
@@ -31,7 +31,7 @@ jobs:
platform: [ubuntu-22.04, macos-latest, windows-latest] platform: [ubuntu-22.04, macos-latest, windows-latest]
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
+5 -4
View File
@@ -36,19 +36,20 @@ jobs:
eslint: eslint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: Cache pnpm modules - name: Cache pnpm modules
uses: actions/cache@v6 uses: actions/cache@v4
with: with:
path: ~/.pnpm-store path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}- ${{ runner.os }}-
- uses: actions/setup-node@v7 - uses: actions/setup-node@v4
with: with:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v6 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x
run_install: true run_install: true
- name: eslint - name: eslint
run: pnpm lint run: pnpm lint
+2 -2
View File
@@ -36,7 +36,7 @@ jobs:
outputs: outputs:
packages: ${{ steps.filter.outputs.changes }} packages: ${{ steps.filter.outputs.changes }}
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- uses: dorny/paths-filter@v2 - uses: dorny/paths-filter@v2
id: filter id: filter
with: with:
@@ -136,7 +136,7 @@ jobs:
package: ${{ fromJSON(needs.changes.outputs.packages) }} package: ${{ fromJSON(needs.changes.outputs.packages) }}
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: install webkit2gtk - name: install webkit2gtk
run: | run: |
+5 -4
View File
@@ -19,25 +19,26 @@ jobs:
sync-to-mirrors: sync-to-mirrors:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: Fetch git tags - name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*' run: git fetch origin 'refs/tags/*:refs/tags/*'
- name: Cache pnpm modules - name: Cache pnpm modules
uses: actions/cache@v6 uses: actions/cache@v4
with: with:
path: ~/.pnpm-store path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}- ${{ runner.os }}-
- uses: actions/setup-node@v7 - uses: actions/setup-node@v4
with: with:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v6 - uses: pnpm/action-setup@v4
with: with:
version: 10.x.x
run_install: true run_install: true
- name: Build packages - name: Build packages
+2 -2
View File
@@ -38,7 +38,7 @@ jobs:
outputs: outputs:
packages: ${{ steps.filter.outputs.changes }} packages: ${{ steps.filter.outputs.changes }}
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- uses: dorny/paths-filter@v2 - uses: dorny/paths-filter@v2
id: filter id: filter
with: with:
@@ -225,7 +225,7 @@ jobs:
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: install webkit2gtk - name: install webkit2gtk
if: contains(matrix.platform.target, 'unknown-linux') if: contains(matrix.platform.target, 'unknown-linux')
Generated
+944 -414
View File
File diff suppressed because it is too large Load Diff
+10 -2
View File
@@ -11,15 +11,17 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
tracing = "0.1" tracing = "0.1"
log = "0.4.21" log = "0.4"
tauri = { version = "2.10", default-features = false } tauri = { version = "2.10", default-features = false }
tauri-runtime-wry = "2"
tauri-runtime-cef = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" }
tauri-build = "2.5" tauri-build = "2.5"
tauri-plugin = "2.5" tauri-plugin = "2.5"
tauri-utils = "2.8" tauri-utils = "2.8"
serde_json = "1" serde_json = "1"
thiserror = "2" thiserror = "2"
url = "2" url = "2"
schemars = "0.8" schemars = "1"
dunce = "1" dunce = "1"
specta = "^2.0.0-rc.16" specta = "^2.0.0-rc.16"
glob = "0.3" glob = "0.3"
@@ -39,3 +41,9 @@ codegen-units = 1
lto = true lto = true
incremental = false incremental = false
opt-level = "s" opt-level = "s"
[patch.crates-io]
tauri = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" }
tauri-utils = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" }
tauri-plugin = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" }
tauri-runtime-wry = { git = "https://github.com/tauri-apps/tauri.git", branch = "refactor/runtime-feature-flag" }
+1 -1
View File
@@ -22,7 +22,7 @@ This repo and all plugins require a Rust version of at least **1.77.2**
| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ | | [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ |
| [nfc](plugins/nfc) | Read and write NFC tags on Android and iOS. | ? | ? | ? | ✅ | ✅ | | [nfc](plugins/nfc) | Read and write NFC tags on Android and iOS. | ? | ? | ? | ✅ | ✅ |
| [notification](plugins/notification) | Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. | ✅ | ✅ | ✅ | ✅ | ✅ | | [notification](plugins/notification) | Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. | ✅ | ✅ | ✅ | ✅ | ✅ |
| [opener](plugins/opener) | Open files and URLs using their default application. | ✅ | ✅ | ✅ | | | | [opener](plugins/opener) | Open files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? |
| [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ | | [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ |
| [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? | | [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? |
| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ❌ | ❌ | | [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ❌ | ❌ |
-40
View File
@@ -1,45 +1,5 @@
# Changelog # Changelog
## \[2.0.42]
### Dependencies
- Upgraded to `dialog-js@2.7.2`
- Upgraded to `store-js@2.4.4`
## \[2.0.41]
### Dependencies
- Upgraded to `log-js@2.9.0`
## \[2.0.40]
### Dependencies
- Upgraded to `barcode-scanner-js@2.4.5`
- Upgraded to `global-shortcut-js@2.3.2`
## \[2.0.39]
### Dependencies
- Upgraded to `fs-js@2.5.1`
- Upgraded to `opener-js@2.5.4`
- Upgraded to `store-js@2.4.3`
- Upgraded to `dialog-js@2.7.1`
- Upgraded to `http-js@2.5.9`
## \[2.0.38]
### Dependencies
- Upgraded to `fs-js@2.5.0`
- Upgraded to `http-js@2.5.8`
- Upgraded to `updater-js@2.10.1`
- Upgraded to `nfc-js@2.3.5`
- Upgraded to `dialog-js@2.7.0`
## \[2.0.37] ## \[2.0.37]
### Dependencies ### Dependencies
+2 -3
View File
@@ -1,13 +1,12 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en" theme="dark">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta <meta
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=0" content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=0"
/> />
<meta name="color-scheme" content="dark light" /> <title>Svelte + Vite App</title>
<title>API Example App</title>
</head> </head>
<body> <body>
+28 -28
View File
@@ -1,7 +1,7 @@
{ {
"name": "api", "name": "api",
"private": true, "private": true,
"version": "2.0.42", "version": "2.0.37",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --clearScreen false", "dev": "vite --clearScreen false",
@@ -10,36 +10,36 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0", "@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-barcode-scanner": "workspace:*", "@tauri-apps/plugin-barcode-scanner": "^2.4.4",
"@tauri-apps/plugin-biometric": "workspace:*", "@tauri-apps/plugin-biometric": "^2.3.2",
"@tauri-apps/plugin-cli": "workspace:*", "@tauri-apps/plugin-cli": "^2.4.1",
"@tauri-apps/plugin-clipboard-manager": "workspace:*", "@tauri-apps/plugin-clipboard-manager": "^2.3.2",
"@tauri-apps/plugin-dialog": "2", "@tauri-apps/plugin-dialog": "^2.6.0",
"@tauri-apps/plugin-fs": "workspace:*", "@tauri-apps/plugin-fs": "^2.4.5",
"@tauri-apps/plugin-geolocation": "workspace:*", "@tauri-apps/plugin-geolocation": "^2.2.0",
"@tauri-apps/plugin-global-shortcut": "workspace:*", "@tauri-apps/plugin-global-shortcut": "^2.3.1",
"@tauri-apps/plugin-haptics": "workspace:*", "@tauri-apps/plugin-haptics": "^2.2.0",
"@tauri-apps/plugin-http": "workspace:*", "@tauri-apps/plugin-http": "^2.5.7",
"@tauri-apps/plugin-nfc": "workspace:*", "@tauri-apps/plugin-nfc": "^2.3.4",
"@tauri-apps/plugin-notification": "workspace:*", "@tauri-apps/plugin-notification": "^2.3.3",
"@tauri-apps/plugin-opener": "workspace:*", "@tauri-apps/plugin-opener": "^2.5.3",
"@tauri-apps/plugin-os": "workspace:*", "@tauri-apps/plugin-os": "^2.3.2",
"@tauri-apps/plugin-process": "workspace:*", "@tauri-apps/plugin-process": "^2.3.1",
"@tauri-apps/plugin-shell": "workspace:*", "@tauri-apps/plugin-shell": "^2.3.5",
"@tauri-apps/plugin-store": "2", "@tauri-apps/plugin-store": "^2.4.2",
"@tauri-apps/plugin-updater": "workspace:*", "@tauri-apps/plugin-updater": "^2.10.0",
"@tauri-apps/plugin-upload": "workspace:*", "@tauri-apps/plugin-upload": "^2.3.0",
"@zerodevx/svelte-json-view": "1.0.11" "@zerodevx/svelte-json-view": "1.0.11"
}, },
"devDependencies": { "devDependencies": {
"@iconify-json/codicon": "^1.2.49", "@iconify-json/codicon": "^1.2.12",
"@iconify-json/ph": "^1.2.2", "@iconify-json/ph": "^1.2.2",
"@sveltejs/vite-plugin-svelte": "^7.0.0", "@sveltejs/vite-plugin-svelte": "^6.0.0",
"@tauri-apps/cli": "2.11.4", "@tauri-apps/cli": "2.10.1",
"@unocss/extractor-svelte": "^66.6.7", "@unocss/extractor-svelte": "^66.3.3",
"svelte": "^5.54.0", "svelte": "^5.20.4",
"unocss": "^66.6.7", "unocss": "^66.3.3",
"vite": "^8.0.1" "vite": "^7.0.7"
} }
} }
-40
View File
@@ -1,45 +1,5 @@
# Changelog # Changelog
## \[2.0.46]
### Dependencies
- Upgraded to `dialog@2.7.2`
- Upgraded to `store@2.4.4`
## \[2.0.45]
### Dependencies
- Upgraded to `log@2.9.0`
## \[2.0.44]
### Dependencies
- Upgraded to `barcode-scanner@2.4.5`
- Upgraded to `global-shortcut@2.3.2`
## \[2.0.43]
### Dependencies
- Upgraded to `fs@2.5.1`
- Upgraded to `opener@2.5.4`
- Upgraded to `store@2.4.3`
- Upgraded to `dialog@2.7.1`
- Upgraded to `http@2.5.9`
## \[2.0.42]
### Dependencies
- Upgraded to `fs@2.5.0`
- Upgraded to `http@2.5.8`
- Upgraded to `updater@2.10.1`
- Upgraded to `nfc@2.3.5`
- Upgraded to `dialog@2.7.0`
## \[2.0.41] ## \[2.0.41]
### Dependencies ### Dependencies
+18 -14
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "api" name = "api"
publish = false publish = false
version = "2.0.46" version = "2.0.41"
description = "An example Tauri Application showcasing the api" description = "An example Tauri Application showcasing the api"
edition = "2021" edition = "2021"
rust-version = { workspace = true } rust-version = { workspace = true }
@@ -20,32 +20,33 @@ serde = { workspace = true }
tiny_http = "0.12" tiny_http = "0.12"
time = "0.3" time = "0.3"
log = { workspace = true } log = { workspace = true }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.9.0" } tauri-plugin-log = { path = "../../../plugins/log", version = "2.8.0" }
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.5.1", features = [ tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.4.5", features = [
"watch", "watch",
] } ] }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.2" } tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.2" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.7.2" } tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.6.0" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ tauri-plugin-http = { path = "../../../plugins/http", features = [
"multipart", "multipart",
"cookies", "cookies",
], version = "2.5.9" } ], version = "2.5.7" }
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.3.3", features = [ tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.3.3", features = [
"windows7-compat", "windows7-compat",
] } ] }
tauri-plugin-os = { path = "../../../plugins/os", version = "2.3.2" } tauri-plugin-os = { path = "../../../plugins/os", version = "2.3.2" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.3.1" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.3.1" }
tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.4" } tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.3" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.5" } tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.5" }
tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.4" } tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.2" }
tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" } tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
tauri-runtime-wry = { workspace = true, optional = true, features = [
"macos-private-api",
] }
tauri-runtime-cef = { workspace = true, optional = true }
[dependencies.tauri] [dependencies.tauri]
workspace = true workspace = true
features = [ features = [
"wry",
"common-controls-v6",
"x11",
"image-ico", "image-ico",
"image-png", "image-png",
"isolation", "isolation",
@@ -56,16 +57,19 @@ features = [
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.1" } tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.1" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.2" } tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.1" }
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.10.1" } tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.10.0" }
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" } tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" }
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.4.5" } tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.4.4" }
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.5" } tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.4" }
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.3.2" } tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.3.2" }
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.3.2" } tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.3.2" }
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.2" } tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.2" }
[features] [features]
default = ["wry"]
wry = ["dep:tauri-runtime-wry"]
cef = ["dep:tauri-runtime-cef"]
prod = ["tauri/custom-protocol"] prod = ["tauri/custom-protocol"]
@@ -15,10 +15,10 @@
] ]
}, },
"core:default", "core:default",
"core:app:allow-set-app-theme",
"fs:default", "fs:default",
"core:window:allow-minimize", "core:window:allow-minimize",
"core:window:allow-toggle-maximize", "core:window:allow-maximize",
"core:window:allow-unmaximize",
"core:window:allow-close", "core:window:allow-close",
"core:window:allow-start-dragging", "core:window:allow-start-dragging",
"notification:default", "notification:default",
@@ -1,11 +1,3 @@
package com.tauri.api package com.tauri.api
import android.os.Bundle class MainActivity : TauriActivity()
import androidx.activity.enableEdgeToEdge
class MainActivity : TauriActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
}
}
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.api" parent="Theme.Material3.DayNight.NoActionBar"> <style name="Theme.api" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
</style> </style>
</resources> </resources>
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.api" parent="Theme.Material3.DayNight.NoActionBar"> <style name="Theme.api" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
</style> </style>
</resources> </resources>
@@ -21,23 +21,7 @@ open class BuildTask : DefaultTask() {
runTauriCli(executable) runTauriCli(executable)
} catch (e: Exception) { } catch (e: Exception) {
if (Os.isFamily(Os.FAMILY_WINDOWS)) { if (Os.isFamily(Os.FAMILY_WINDOWS)) {
// Try different Windows-specific extensions runTauriCli("$executable.cmd")
val fallbacks = listOf(
"$executable.exe",
"$executable.cmd",
"$executable.bat",
)
var lastException: Exception = e
for (fallback in fallbacks) {
try {
runTauriCli(fallback)
return
} catch (fallbackException: Exception) {
lastException = fallbackException
}
}
throw lastException
} else { } else {
throw e; throw e;
} }
@@ -1,6 +1,6 @@
#Tue May 10 19:22:52 CST 2022 #Tue May 10 19:22:52 CST 2022
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
+8 -3
View File
@@ -6,6 +6,11 @@ mod cmd;
#[cfg(desktop)] #[cfg(desktop)]
mod tray; mod tray;
#[cfg(feature = "cef")]
type TauriRuntime = tauri_runtime_cef::CefRuntime<tauri::EventLoopMessage>;
#[cfg(feature = "wry")]
type TauriRuntime = tauri_runtime_wry::Wry<tauri::EventLoopMessage>;
use serde::Serialize; use serde::Serialize;
use tauri::{ use tauri::{
webview::{PageLoadEvent, WebviewWindowBuilder}, webview::{PageLoadEvent, WebviewWindowBuilder},
@@ -17,13 +22,13 @@ struct Reply {
data: String, data: String,
} }
pub type SetupHook = Box<dyn FnOnce(&mut App) -> Result<(), Box<dyn std::error::Error>> + Send>; pub type SetupHook<R> = Box<dyn FnOnce(&mut App<R>) -> Result<(), Box<dyn std::error::Error>> + Send>;
pub type OnEvent = Box<dyn FnMut(&AppHandle, RunEvent)>; pub type OnEvent<R> = Box<dyn FnMut(&AppHandle<R>, RunEvent)>;
#[cfg_attr(mobile, tauri::mobile_entry_point)] #[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() { pub fn run() {
#[allow(unused_mut)] #[allow(unused_mut)]
let mut builder = tauri::Builder::default() let mut builder = tauri::Builder::<TauriRuntime>::new()
.plugin( .plugin(
tauri_plugin_log::Builder::default() tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Info) .level(log::LevelFilter::Info)
+192 -125
View File
@@ -1,16 +1,7 @@
<script module lang="ts"> <script>
export type ViewProps = {
onMessage: (value: unknown) => void
}
</script>
<script lang="ts">
import { onMount, tick } from 'svelte'
import { writable } from 'svelte/store' import { writable } from 'svelte/store'
import { MediaQuery } from 'svelte/reactivity' import { getCurrentWindow } from '@tauri-apps/api/window'
import { getCurrentWindow, type Theme } from '@tauri-apps/api/window'
import { getCurrentWebview } from '@tauri-apps/api/webview' import { getCurrentWebview } from '@tauri-apps/api/webview'
import { setTheme } from '@tauri-apps/api/app'
import * as os from '@tauri-apps/plugin-os' import * as os from '@tauri-apps/plugin-os'
import Welcome from './views/Welcome.svelte' import Welcome from './views/Welcome.svelte'
@@ -32,9 +23,10 @@
import Biometric from './views/Biometric.svelte' import Biometric from './views/Biometric.svelte'
import Geolocation from './views/Geolocation.svelte' import Geolocation from './views/Geolocation.svelte'
import Haptics from './views/Haptics.svelte' import Haptics from './views/Haptics.svelte'
import Nfc from './views/Nfc.svelte'
import TitleBar from './lib/TitleBar.svelte' import { onMount, tick } from 'svelte'
import { ask } from '@tauri-apps/plugin-dialog'
import Nfc from './views/Nfc.svelte'
const appWindow = getCurrentWindow() const appWindow = getCurrentWindow()
@@ -156,98 +148,114 @@
component: Haptics, component: Haptics,
icon: 'i-ph-vibrate' icon: 'i-ph-vibrate'
} }
].filter(Boolean) as { ]
label: string
component: typeof Haptics
icon: string
}[]
let selected = $state.raw(views[0])
// dark/light themes let selected = views[0]
const preferDark = new MediaQuery('prefers-color-scheme: dark') function select(view) {
let theme = $state<Theme | 'auto'>( selected = view
(localStorage.getItem('theme') as Theme | null) || 'auto'
)
async function switchTheme() {
switch (theme) {
case 'dark':
theme = 'light'
break
case 'light':
theme = 'auto'
break
case 'auto':
theme = 'dark'
break
}
applyTheme()
} }
function applyTheme() { // Window controls
const isDark = theme === 'auto' ? preferDark.current : theme === 'dark' let isWindowMaximized
if (isDark) { onMount(async () => {
document.documentElement.classList.add('dark') isWindowMaximized = await appWindow.isMaximized()
document.documentElement.classList.remove('light') appWindow.onResized(async () => {
} else { isWindowMaximized = await appWindow.isMaximized()
document.documentElement.classList.remove('dark') })
document.documentElement.classList.add('light')
}
setTheme(theme === 'auto' ? null : theme)
localStorage.setItem('theme', theme)
}
$effect(() => {
applyTheme()
}) })
// Console function minimize() {
const messages = writable<string[]>([]) appWindow.minimize()
let consoleTextEl: HTMLDivElement
// this function is renders HTML without sanitizing it so it's insecure
// we only use it with our own input data
async function insecureRenderHtml(html: string) {
messages.update((r) => [
...r,
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ${html}</pre>`
])
await tick()
consoleTextEl.scrollTop = consoleTextEl.scrollHeight
} }
async function onMessage(value: unknown) { async function toggleMaximize() {
const valueStr = ;(await appWindow.isMaximized())
typeof value === 'string' ? appWindow.unmaximize()
? value : appWindow.maximize()
: JSON.stringify( }
value instanceof ArrayBuffer
? Array.from(new Uint8Array(value)) let confirmed_close = false
: value, async function close() {
null, if (!confirmed_close) {
1 confirmed_close = await ask(
'Are you sure that you want to close this window?',
{
title: 'Tauri API'
}
) )
insecureRenderHtml(valueStr) if (confirmed_close) {
appWindow.close()
}
}
}
// dark/light
let isDark
onMount(() => {
isDark = localStorage && localStorage.getItem('theme') == 'dark'
applyTheme(isDark)
})
function applyTheme(isDark) {
const html = document.querySelector('html')
isDark ? html.classList.add('dark') : html.classList.remove('dark')
localStorage && localStorage.setItem('theme', isDark ? 'dark' : '')
}
function toggleDark() {
isDark = !isDark
applyTheme(isDark)
}
// Console
let messages = writable([])
let consoleTextEl
async function onMessage(value) {
messages.update((r) => [
...r,
{
html:
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` +
(typeof value === 'string' ? value : JSON.stringify(value, null, 1)) +
'</pre>'
}
])
await tick()
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight
}
// this function renders HTML without sanitizing it so it's insecure
// we only use it with our own input data
async function insecureRenderHtml(html) {
messages.update((r) => [
...r,
{
html:
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` +
html +
'</pre>'
}
])
await tick()
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight
} }
function clear() { function clear() {
messages.update(() => []) messages.update(() => [])
} }
let consoleEl: HTMLDivElement let consoleEl, consoleH, cStartY
let consoleH = 0 let minConsoleHeight = 50
let cStartY = 0 function startResizingConsole(e) {
const minConsoleHeight = 50
function startResizingConsole(e: MouseEvent) {
cStartY = e.clientY cStartY = e.clientY
const styles = window.getComputedStyle(consoleEl) const styles = window.getComputedStyle(consoleEl)
consoleH = parseInt(styles.height, 10) consoleH = parseInt(styles.height, 10)
const moveHandler = (e: MouseEvent) => { const moveHandler = (e) => {
const dy = e.clientY - cStartY const dy = e.clientY - cStartY
const newH = consoleH - dy const newH = consoleH - dy
consoleEl.style.height = `${newH < minConsoleHeight ? minConsoleHeight : newH}px` consoleEl.style.height = `${
newH < minConsoleHeight ? minConsoleHeight : newH
}px`
} }
const upHandler = () => { const upHandler = () => {
document.removeEventListener('mouseup', upHandler) document.removeEventListener('mouseup', upHandler)
@@ -257,19 +265,21 @@
document.addEventListener('mousemove', moveHandler) document.addEventListener('mousemove', moveHandler)
} }
let isWindows = os.platform() === 'windows' let isWindows
onMount(async () => {
isWindows = (await os.platform()) === 'windows'
})
// mobile // mobile
let isSideBarOpen = $state(false) let isSideBarOpen = false
let sidebar: HTMLElement let sidebar
let sidebarToggle: HTMLElement let sidebarToggle
let isDraggingSideBar = false let isDraggingSideBar = false
let draggingStartPosX = 0 let draggingStartPosX = 0
let draggingEndPosX = 0 let draggingEndPosX = 0
const clamp = (min: number, num: number, max: number) => const clamp = (min, num, max) => Math.min(Math.max(num, min), max)
Math.min(Math.max(num, min), max)
function toggleSidebar() { function toggleSidebar(sidebar, isSideBarOpen) {
sidebar.style.setProperty( sidebar.style.setProperty(
'--translate-x', '--translate-x',
`${isSideBarOpen ? '0' : '-18.75'}rem` `${isSideBarOpen ? '0' : '-18.75'}rem`
@@ -277,9 +287,10 @@
} }
onMount(() => { onMount(() => {
document.addEventListener('click', (e) => { sidebar = document.querySelector('#sidebar')
if (!(e.target instanceof Node)) return sidebarToggle = document.querySelector('#sidebarToggle')
document.addEventListener('click', (e) => {
if (sidebarToggle.contains(e.target)) { if (sidebarToggle.contains(e.target)) {
isSideBarOpen = !isSideBarOpen isSideBarOpen = !isSideBarOpen
} else if (isSideBarOpen && !sidebar.contains(e.target)) { } else if (isSideBarOpen && !sidebar.contains(e.target)) {
@@ -288,7 +299,6 @@
}) })
document.addEventListener('touchstart', (e) => { document.addEventListener('touchstart', (e) => {
if (!(e.target instanceof Node)) return
if (sidebarToggle.contains(e.target)) return if (sidebarToggle.contains(e.target)) return
const x = e.touches[0].clientX const x = e.touches[0].clientX
@@ -320,22 +330,76 @@
}) })
}) })
$effect(() => { $: {
toggleSidebar() const sidebar = document.querySelector('#sidebar')
}) if (sidebar) {
toggleSidebar(sidebar, isSideBarOpen)
}
}
</script> </script>
<!-- custom titlebar for Windows --> <!-- custom titlebar for Windows -->
{#if isWindows} {#if isWindows}
<TitleBar {appWindow} {theme} {switchTheme} /> <div
class="w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"
data-tauri-drag-region
>
<span class="lt-sm:pl-10 text-darkPrimaryText">Tauri API Validation</span>
<span
class="
h-100%
children:h-100% children:w-12 children:inline-flex
children:items-center children:justify-center"
>
<button
aria-label="Toggle dark mode"
title={isDark ? 'Switch to Light mode' : 'Switch to Dark mode'}
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
on:click={toggleDark}
>
{#if isDark}
<div class="i-ph-sun"></div>
{:else}
<div class="i-ph-moon"></div>
{/if}
</button>
<button
aria-label="Minimize window"
title="Minimize"
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
on:click={minimize}
>
<div class="i-codicon-chrome-minimize"></div>
</button>
<button
aria-label="Maximize window"
title={isWindowMaximized ? 'Restore' : 'Maximize'}
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
on:click={toggleMaximize}
>
{#if isWindowMaximized}
<div class="i-codicon-chrome-restore"></div>
{:else}
<div class="i-codicon-chrome-maximize"></div>
{/if}
</button>
<button
aria-label="Close window"
title="Close"
class="bg-inherit border-none hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText"
on:click={close}
>
<div class="i-codicon-chrome-close"></div>
</button>
</span>
</div>
{/if} {/if}
<!-- Sidebar toggle, only visible on small screens --> <!-- Sidebar toggle, only visible on small screens -->
<div <div
id="sidebarToggle" id="sidebarToggle"
bind:this={sidebarToggle} class="z-2000 sidebar-toggle hidden lt-sm:flex justify-center absolute items-center w-8 h-8 rd-8
class="z-2000 hidden lt-sm:flex justify-center absolute items-center w-8 h-8 rd-8 bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"
bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark text-accentText dark:text-darkAccentText"
> >
{#if isSideBarOpen} {#if isSideBarOpen}
<span class="i-codicon-close animate-duration-300ms animate-fade-in"></span> <span class="i-codicon-close animate-duration-300ms animate-fade-in"></span>
@@ -345,11 +409,10 @@
</div> </div>
<div <div
class="flex h-screen w-screen overflow-hidden text-primaryText dark:text-darkPrimaryText" class="flex h-screen w-screen overflow-hidden children-pt8 children-pb-2 text-primaryText dark:text-darkPrimaryText"
> >
<aside <aside
id="sidebar" id="sidebar"
bind:this={sidebar}
class="lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999 class="lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999
bg-darkPrimaryLighter transition-colors-250 overflow-hidden grid select-none px-2" bg-darkPrimaryLighter transition-colors-250 overflow-hidden grid select-none px-2"
> >
@@ -357,16 +420,13 @@
<img class="p-7" src="tauri_logo.png" alt="Tauri logo" /> <img class="p-7" src="tauri_logo.png" alt="Tauri logo" />
</a> </a>
{#if !isWindows} {#if !isWindows}
<a href="##" class="nv justify-between" onclick={switchTheme}> <a href="##" class="nv justify-between h-8" on:click={toggleDark}>
{#if theme === 'auto'} {#if isDark}
Switch to Dark mode
<div class="i-ph-circle-half-fill"></div>
{:else if theme === 'dark'}
Switch to Light mode Switch to Light mode
<div class="i-ph-moon"></div>
{:else if theme === 'light'}
Switch to Auto mode
<div class="i-ph-sun"></div> <div class="i-ph-sun"></div>
{:else}
Switch to Dark mode
<div class="i-ph-moon"></div>
{/if} {/if}
</a> </a>
<br /> <br />
@@ -375,7 +435,7 @@
{/if} {/if}
<a <a
class="nv justify-between" class="nv justify-between h-8"
target="_blank" target="_blank"
href="https://tauri.app/v1/guides/" href="https://tauri.app/v1/guides/"
> >
@@ -383,7 +443,7 @@
<span class="i-codicon-link-external"></span> <span class="i-codicon-link-external"></span>
</a> </a>
<a <a
class="nv justify-between" class="nv justify-between h-8"
target="_blank" target="_blank"
href="https://github.com/tauri-apps/tauri" href="https://github.com/tauri-apps/tauri"
> >
@@ -391,7 +451,7 @@
<span class="i-codicon-link-external"></span> <span class="i-codicon-link-external"></span>
</a> </a>
<a <a
class="nv justify-between" class="nv justify-between h-8"
target="_blank" target="_blank"
href="https://github.com/tauri-apps/tauri/tree/dev/examples/api" href="https://github.com/tauri-apps/tauri/tree/dev/examples/api"
> >
@@ -401,19 +461,23 @@
<br /> <br />
<div class="bg-white/5 h-2px"></div> <div class="bg-white/5 h-2px"></div>
<br /> <br />
<div class="flex flex-col overflow-y-auto children-flex-none gap-1"> <div
class="flex flex-col overflow-y-auto children-h-10 children-flex-none gap-1"
>
{#each views as view} {#each views as view}
{#if view}
<a <a
href="##" href="##"
class="nv {selected === view ? 'nv_selected' : ''}" class="nv {selected === view ? 'nv_selected' : ''}"
onclick={() => { on:click={() => {
selected = view select(view)
isSideBarOpen = false isSideBarOpen = false
}} }}
> >
<div class="{view.icon} mr-2"></div> <div class="{view.icon} mr-2"></div>
<p>{view.label}</p></a <p>{view.label}</p></a
> >
{/if}
{/each} {/each}
</div> </div>
</aside> </aside>
@@ -425,7 +489,11 @@
<h1>{selected.label}</h1> <h1>{selected.label}</h1>
<div class="overflow-y-auto"> <div class="overflow-y-auto">
<div class="mr-2"> <div class="mr-2">
<selected.component {onMessage} /> <svelte:component
this={selected.component}
{onMessage}
{insecureRenderHtml}
/>
</div> </div>
</div> </div>
</div> </div>
@@ -435,21 +503,20 @@
id="console" id="console"
class="select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden" class="select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden"
> >
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div <div
role="button" on:mousedown={startResizingConsole}
tabindex="0"
onmousedown={startResizingConsole}
class="bg-black/20 h-2px cursor-ns-resize" class="bg-black/20 h-2px cursor-ns-resize"
></div> ></div>
<div class="flex justify-between items-center px-2"> <div class="flex justify-between items-center px-2">
<p class="font-semibold">Console</p> <p class="font-semibold">Console</p>
<button <button
aria-label="Clear Console" aria-label="Clear Console"
class="cursor-pointer h-85% rd-1 p-1 flex justify-center items-center border-none class="cursor-pointer h-85% rd-1 p-1 flex justify-center items-center border-none bg-inherit
hover:bg-hoverOverlay dark:hover:bg-darkHoverOverlay hover:bg-hoverOverlay dark:hover:bg-darkHoverOverlay
active:bg-hoverOverlay/25 dark:active:bg-darkHoverOverlay/25 active:bg-hoverOverlay/25 dark:active:bg-darkHoverOverlay/25
" "
onclick={clear} on:click={clear}
> >
<div class="i-codicon-clear-all"></div> <div class="i-codicon-clear-all"></div>
</button> </button>
@@ -458,8 +525,8 @@
bind:this={consoleTextEl} bind:this={consoleTextEl}
class="px-2 overflow-y-auto all:font-mono code-block all:text-xs select-text mr-2" class="px-2 overflow-y-auto all:font-mono code-block all:text-xs select-text mr-2"
> >
{#each $messages as messageHtml} {#each $messages as r}
{@html messageHtml} {@html r.html}
{/each} {/each}
</div> </div>
</div> </div>
+9 -32
View File
@@ -1,14 +1,3 @@
:root {
line-height: 1.5;
}
:root.dark {
color-scheme: dark;
}
:root.light {
color-scheme: light;
}
*:not(h1, h2, h3, h4, h5, h6) { *:not(h1, h2, h3, h4, h5, h6) {
margin: 0; margin: 0;
padding: 0; padding: 0;
@@ -19,11 +8,6 @@
font-family: 'Rubik', sans-serif; font-family: 'Rubik', sans-serif;
} }
button {
color: inherit;
background-color: inherit;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0.25rem; width: 0.25rem;
height: 3px; height: 3px;
@@ -49,34 +33,27 @@ code.code-block {
width: 18.75rem; width: 18.75rem;
} }
@media screen and (width < 640px) { @media screen and (max-width: 640px) {
#sidebar { #sidebar {
--translate-x: -18.75rem; --translate-x: -18.75rem;
transform: translateX(var(--translate-x)); transform: translateX(var(--translate-x));
} }
} }
#sidebar, .sidebar-toggle {
main { margin-top: 0.5rem;
padding-top: calc(env(safe-area-inset-top) + 2rem); margin-left: 0.5rem;
} }
#sidebar { body {
padding-left: calc(env(safe-area-inset-left) + 0.5rem); overflow: hidden;
} padding: env(safe-area-inset-top) env(safe-area-inset-right)
env(safe-area-inset-bottom) env(safe-area-inset-left);
main {
padding-right: env(safe-area-inset-right);
}
#sidebarToggle {
margin-top: calc(env(safe-area-inset-top) + 0.5rem);
margin-left: calc(env(safe-area-inset-left) + 0.5rem);
} }
#sidebar, #sidebar,
#console { #console {
padding-bottom: calc(env(safe-area-inset-bottom) + 1.5rem); padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
} }
.transparent { .transparent {
-103
View File
@@ -1,103 +0,0 @@
<script lang="ts">
import type { Theme, Window } from '@tauri-apps/api/window'
import { ask } from '@tauri-apps/plugin-dialog'
import { onMount } from 'svelte'
let {
appWindow,
switchTheme,
theme
}: { appWindow: Window; switchTheme: () => void; theme: Theme | 'auto' } =
$props()
// Window controls
let isWindowMaximized = $state(false)
onMount(async () => {
isWindowMaximized = await appWindow.isMaximized()
appWindow.onResized(async () => {
isWindowMaximized = await appWindow.isMaximized()
})
})
async function minimize() {
await appWindow.minimize()
}
async function toggleMaximize() {
await appWindow.toggleMaximize()
}
let confirmedClose = false
async function close() {
if (!confirmedClose) {
confirmedClose = await ask(
'Are you sure that you want to close this window?',
{
title: 'Tauri API'
}
)
if (confirmedClose) {
appWindow.close()
}
}
}
</script>
<div
class="w-screen select-none h-8 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"
data-tauri-drag-region
>
<span
class="h-100% pl-2 flex-1 flex items-center lt-sm:pl-10 lt-lg:text-darkPrimaryText [app-region:drag]"
>Tauri API Validation</span
>
<span
class="
h-100%
children:h-100% children:w-12 children:inline-flex
children:items-center children:justify-center"
>
<button
aria-label="Toggle dark mode"
title={theme ? 'Switch to Light mode' : 'Switch to Dark mode'}
class="border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
onclick={switchTheme}
>
{#if theme === 'auto'}
<div title="Switch to Dark mode" class="i-ph-circle-half-fill"></div>
{:else if theme === 'dark'}
<div title="Switch to Light mode" class="i-ph-moon"></div>
{:else if theme === 'light'}
<div title="Switch to Auto mode" class="i-ph-sun"></div>
{/if}
</button>
<button
aria-label="Minimize window"
title="Minimize"
class="border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
onclick={minimize}
>
<div class="i-codicon-chrome-minimize"></div>
</button>
<button
aria-label="Maximize window"
title={isWindowMaximized ? 'Restore' : 'Maximize'}
class="border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
onclick={toggleMaximize}
>
{#if isWindowMaximized}
<div class="i-codicon-chrome-restore"></div>
{:else}
<div class="i-codicon-chrome-maximize"></div>
{/if}
</button>
<button
aria-label="Close window"
title="Close"
class="border-none hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText"
onclick={close}
>
<div class="i-codicon-chrome-close"></div>
</button>
</span>
</div>
+2 -1
View File
@@ -5,6 +5,7 @@
import { readFile } from '@tauri-apps/plugin-fs' import { readFile } from '@tauri-apps/plugin-fs'
export let onMessage export let onMessage
export let insecureRenderHtml
let text = 'clipboard message' let text = 'clipboard message'
function writeText() { function writeText() {
@@ -40,7 +41,7 @@
const image = await clipboard.readImage() const image = await clipboard.readImage()
arrayBufferToBase64(await image.rgba(), function (base64) { arrayBufferToBase64(await image.rgba(), function (base64) {
const src = 'data:image/png;base64,' + base64 const src = 'data:image/png;base64,' + base64
onMessage('<img src="' + src + '"></img>') insecureRenderHtml('<img src="' + src + '"></img>')
}) })
return return
} catch (_) {} } catch (_) {}
+70 -80
View File
@@ -1,138 +1,129 @@
<script lang="ts"> <script>
import { import { open, save, confirm, message } from "@tauri-apps/plugin-dialog";
open, import { readFile } from "@tauri-apps/plugin-fs";
save,
confirm,
message,
type PickerMode,
type FileAccessMode
} from '@tauri-apps/plugin-dialog'
import { readFile } from '@tauri-apps/plugin-fs'
import type { ViewProps } from '../App.svelte'
let { onMessage }: ViewProps = $props() export let onMessage;
export let insecureRenderHtml;
let defaultPath = null;
let filter = null;
let multiple = false;
let directory = false;
let pickerMode = "document";
let fileAccessMode = "scoped";
let defaultPath: string | undefined = $state() function arrayBufferToBase64(buffer, callback) {
let filter = $state('')
let multiple = $state(false)
let directory = $state(false)
let pickerMode: PickerMode = $state('document')
let fileAccessMode: FileAccessMode = $state('scoped')
function arrayBufferToBase64(
buffer: ArrayBuffer,
callback: (base64: string) => void
) {
var blob = new Blob([buffer], { var blob = new Blob([buffer], {
type: 'application/octet-binary' type: "application/octet-binary",
}) });
var reader = new FileReader() var reader = new FileReader();
reader.onload = function (evt) { reader.onload = function (evt) {
var dataurl = evt.target!.result as string var dataurl = evt.target.result;
callback(dataurl.split(',')[1]) callback(dataurl.substr(dataurl.indexOf(",") + 1));
} };
reader.readAsDataURL(blob) reader.readAsDataURL(blob);
} }
async function prompt() { async function prompt() {
confirm('Do you want to do something?') confirm("Do you want to do something?")
.then((res) => onMessage(res ? 'Yes' : 'No')) .then((res) => onMessage(res ? "Yes" : "No"))
.catch(onMessage) .catch(onMessage);
} }
async function promptCustom() { async function promptCustom() {
confirm('Is Tauri awesome?', { confirm("Is Tauri awesome?", {
okLabel: 'Absolutely', okLabel: "Absolutely",
cancelLabel: 'Totally' cancelLabel: "Totally",
}) })
.then((res) => .then((res) =>
onMessage( onMessage(
res ? 'Tauri is absolutely awesome' : 'Tauri is totally awesome' res ? "Tauri is absolutely awesome" : "Tauri is totally awesome"
) )
) )
.catch(onMessage) .catch(onMessage);
} }
async function msg() { async function msg() {
await message('Tauri is awesome!').then((res) => onMessage(res)) await message("Tauri is awesome!").then((res) => onMessage(res));
} }
async function msgCustom() { async function msgCustom(result) {
const buttons = { yes: 'awesome', no: 'amazing', cancel: 'stunning' } const buttons = { yes: "awesome", no: "amazing", cancel: "stunning" };
await message(`Tauri is: `, { buttons }) await message(`Tauri is: `, { buttons })
.then((res) => onMessage(`Tauri is ${res}`)) .then((res) => onMessage(`Tauri is ${res}`))
.catch(onMessage) .catch(onMessage);
} }
async function openDialog() { async function openDialog() {
try { try {
const result = await open({ var result = await open({
title: 'My wonderful open dialog', title: "My wonderful open dialog",
defaultPath, defaultPath,
filters: filter filters: filter
? [ ? [
{ {
name: 'Tauri Example', name: "Tauri Example",
extensions: filter.split(',').map((f) => f.trim()) extensions: filter.split(",").map((f) => f.trim()),
} },
] ]
: [], : [],
multiple, multiple,
directory, directory,
pickerMode, pickerMode,
fileAccessMode fileAccessMode,
}) })
if (Array.isArray(result)) { if (Array.isArray(result)) {
onMessage(result) onMessage(result);
} else if (result === null) {
onMessage('user cancelled the selection')
} else { } else {
const pathToRead = result var pathToRead = result;
const isFile = pathToRead.match(/\S+\.\S+$/g) var isFile = pathToRead.match(/\S+\.\S+$/g);
await readFile(pathToRead).then(function (res) { await readFile(pathToRead)
.then(function (res) {
if (isFile) { if (isFile) {
if ( if (
pathToRead.includes('.png') pathToRead.includes(".png") ||
|| pathToRead.includes('.jpg') pathToRead.includes(".jpg") ||
|| pathToRead.includes('.jpeg') pathToRead.includes(".jpeg")
) { ) {
arrayBufferToBase64(res.buffer, function (base64) { arrayBufferToBase64(
const src = 'data:image/png;base64,' + base64 new Uint8Array(res),
onMessage('<img src="' + src + '"></img>') function (base64) {
}) var src = "data:image/png;base64," + base64;
insecureRenderHtml('<img src="' + src + '"></img>');
}
);
} else { } else {
// Convert byte array to UTF-8 string // Convert byte array to UTF-8 string
const decoder = new TextDecoder('utf-8') const decoder = new TextDecoder('utf-8');
const text = decoder.decode(res) const text = decoder.decode(new Uint8Array(res));
onMessage(text) onMessage(text);
} }
} else { } else {
onMessage(res) onMessage(res);
} }
}) })
} }
} catch (exception) { } catch(exception) {
onMessage(exception) onMessage(exception)
} }
} }
function saveDialog() { function saveDialog() {
save({ save({
title: 'My wonderful save dialog', title: "My wonderful save dialog",
defaultPath, defaultPath,
filters: filter filters: filter
? [ ? [
{ {
name: 'Tauri Example', name: "Tauri Example",
extensions: filter.split(',').map((f) => f.trim()) extensions: filter.split(",").map((f) => f.trim()),
} },
] ]
: [] : [],
}) })
.then(onMessage) .then(onMessage)
.catch(onMessage) .catch(onMessage);
} }
</script> </script>
@@ -180,16 +171,15 @@
<br /> <br />
<div class="flex flex-wrap flex-col md:flex-row gap-2 children:flex-shrink-0"> <div class="flex flex-wrap flex-col md:flex-row gap-2 children:flex-shrink-0">
<button class="btn" id="open-dialog" onclick={openDialog}>Open dialog</button> <button class="btn" id="open-dialog" on:click={openDialog}>Open dialog</button>
<button class="btn" id="save-dialog" onclick={saveDialog} <button class="btn" id="save-dialog" on:click={saveDialog}
>Open save dialog</button >Open save dialog</button
> >
<button class="btn" id="prompt-dialog" onclick={prompt}>Prompt</button> <button class="btn" id="prompt-dialog" on:click={prompt}>Prompt</button>
<button class="btn" id="custom-prompt-dialog" onclick={promptCustom} <button class="btn" id="custom-prompt-dialog" on:click={promptCustom}
>Prompt (custom)</button >Prompt (custom)</button
> >
<button class="btn" id="message-dialog" onclick={msg}>Message</button> <button class="btn" id="message-dialog" on:click={msg}>Message</button>
<button class="btn" id="message-dialog" onclick={msgCustom} <button class="btn" id="message-dialog" on:click={msgCustom}>Message (custom)</button>
>Message (custom)</button
>
</div> </div>
+3 -3
View File
@@ -5,7 +5,7 @@
import { arrayBufferToBase64 } from '../lib/utils' import { arrayBufferToBase64 } from '../lib/utils'
import { onDestroy, onMount } from 'svelte' import { onDestroy, onMount } from 'svelte'
const { onMessage } = $props() const { onMessage, insecureRenderHtml } = $props()
let path = $state('') let path = $state('')
let img let img
@@ -118,12 +118,12 @@
new Uint8Array(response), new Uint8Array(response),
function (base64) { function (base64) {
const src = 'data:image/png;base64,' + base64 const src = 'data:image/png;base64,' + base64
onMessage('<img src="' + src + '"></img>') insecureRenderHtml('<img src="' + src + '"></img>')
} }
) )
} else { } else {
const value = String.fromCharCode.apply(null, response) const value = String.fromCharCode.apply(null, response)
onMessage( insecureRenderHtml(
'<textarea id="file-response"></textarea><button id="file-save">Save</button>' '<textarea id="file-response"></textarea><button id="file-save">Save</button>'
) )
setTimeout(() => { setTimeout(() => {
+17 -7
View File
@@ -15,15 +15,25 @@
"@rollup/plugin-node-resolve": "16.0.3", "@rollup/plugin-node-resolve": "16.0.3",
"@rollup/plugin-terser": "1.0.0", "@rollup/plugin-terser": "1.0.0",
"@rollup/plugin-typescript": "12.3.0", "@rollup/plugin-typescript": "12.3.0",
"eslint": "10.4.0", "eslint": "10.0.2",
"eslint-config-prettier": "10.1.8", "eslint-config-prettier": "10.1.8",
"eslint-plugin-security": "4.0.1", "eslint-plugin-security": "4.0.0",
"prettier": "3.8.3", "prettier": "3.8.1",
"rollup": "4.60.3", "rollup": "4.59.0",
"tslib": "2.8.1", "tslib": "2.8.1",
"typescript": "6.0.3", "typescript": "5.9.3",
"typescript-eslint": "8.58.2" "typescript-eslint": "8.56.1"
}, },
"minimumReleaseAge": 4320, "minimumReleaseAge": 4320,
"packageManager": "pnpm@11.13.0" "pnpm": {
"overrides": {
"esbuild@<0.25.0": ">=0.25.0"
},
"onlyBuiltDependencies": [
"esbuild"
]
},
"engines": {
"pnpm": "^10.16.0"
}
} }
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
} }
} }
@@ -24,20 +24,17 @@
}, },
"permission": { "permission": {
"description": "A list of inlined permissions", "description": "A list of inlined permissions",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/Permission" "$ref": "#/definitions/Permission"
} },
"default": []
} }
}, },
"definitions": { "definitions": {
"DefaultPermission": { "DefaultPermission": {
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
"type": "object", "type": "object",
"required": [
"permissions"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -46,10 +43,10 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -62,16 +59,14 @@
"type": "string" "type": "string"
} }
} }
} },
"required": [
"permissions"
]
}, },
"PermissionSet": { "PermissionSet": {
"description": "A set of direct permissions grouped together under a new name.", "description": "A set of direct permissions grouped together under a new name.",
"type": "object", "type": "object",
"required": [
"description",
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
@@ -85,17 +80,19 @@
"description": "All permissions this set contains.", "description": "All permissions this set contains.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/PermissionKind" "type": "string"
}
} }
} }
}, },
"required": [
"identifier",
"description",
"permissions"
]
},
"Permission": { "Permission": {
"description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
"type": "object", "type": "object",
"required": [
"identifier"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -104,14 +101,14 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri internal convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -147,7 +144,10 @@
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
} }
} },
"required": [
"identifier"
]
}, },
"Commands": { "Commands": {
"description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
@@ -155,24 +155,24 @@
"properties": { "properties": {
"allow": { "allow": {
"description": "Allowed command.", "description": "Allowed command.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
}, },
"deny": { "deny": {
"description": "Denied command, which takes priority.", "description": "Denied command, which takes priority.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
} }
} }
}, },
"Scopes": { "Scopes": {
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\nThe configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json\n{\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n}\n```",
"type": "object", "type": "object",
"properties": { "properties": {
"allow": { "allow": {
@@ -257,84 +257,27 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "const": "macOS"
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "const": "windows"
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "const": "linux"
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "const": "android"
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "const": "iOS"
"iOS"
]
}
]
},
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "Enables the disable command without any pre-configured scope.",
"type": "string",
"const": "allow-disable",
"markdownDescription": "Enables the disable command without any pre-configured scope."
},
{
"description": "Denies the disable command without any pre-configured scope.",
"type": "string",
"const": "deny-disable",
"markdownDescription": "Denies the disable command without any pre-configured scope."
},
{
"description": "Enables the enable command without any pre-configured scope.",
"type": "string",
"const": "allow-enable",
"markdownDescription": "Enables the enable command without any pre-configured scope."
},
{
"description": "Denies the enable command without any pre-configured scope.",
"type": "string",
"const": "deny-enable",
"markdownDescription": "Denies the enable command without any pre-configured scope."
},
{
"description": "Enables the is_enabled command without any pre-configured scope.",
"type": "string",
"const": "allow-is-enabled",
"markdownDescription": "Enables the is_enabled command without any pre-configured scope."
},
{
"description": "Denies the is_enabled command without any pre-configured scope.",
"type": "string",
"const": "deny-is-enabled",
"markdownDescription": "Denies the is_enabled command without any pre-configured scope."
},
{
"description": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`",
"type": "string",
"const": "default",
"markdownDescription": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`"
} }
] ]
} }
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }
-4
View File
@@ -1,9 +1,5 @@
# Changelog # Changelog
## \[2.4.5]
- [`d8645ab3`](https://github.com/tauri-apps/plugins-workspace/commit/d8645ab3e5b508456681eb53275c0837db25aeee) ([#3393](https://github.com/tauri-apps/plugins-workspace/pull/3393) by [@AlexisZankowitch](https://github.com/tauri-apps/plugins-workspace/../../AlexisZankowitch)) Fixed a crash on iOS when `cancel()` is invoked by running the cancel handler on the main thread.
## \[2.4.4] ## \[2.4.4]
- [`82fbb0c7`](https://github.com/tauri-apps/plugins-workspace/commit/82fbb0c790288eca72af9ade13828ded7700ff90) ([#3221](https://github.com/tauri-apps/plugins-workspace/pull/3221)) On iOS, fixed an application crash happening when the scanner was started when user denied permission before. - [`82fbb0c7`](https://github.com/tauri-apps/plugins-workspace/commit/82fbb0c790288eca72af9ade13828ded7700ff90) ([#3221](https://github.com/tauri-apps/plugins-workspace/pull/3221)) On iOS, fixed an application crash happening when the scanner was started when user denied permission before.
+2 -2
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-barcode-scanner" name = "tauri-plugin-barcode-scanner"
version = "2.4.5" version = "2.4.4"
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS" description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -31,4 +31,4 @@ log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true }
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function a(n,a={},e){return window.__TAURI_INTERNALS__.invoke(n,a,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(e=n.Format||(n.Format={})).QRCode="QR_CODE",e.UPC_A="UPC_A",e.UPC_E="UPC_E",e.EAN8="EAN_8",e.EAN13="EAN_13",e.Code39="CODE_39",e.Code93="CODE_93",e.Code128="CODE_128",e.Codabar="CODABAR",e.ITF="ITF",e.Aztec="AZTEC",e.DataMatrix="DATA_MATRIX",e.PDF417="PDF_417",e.GS1DataBar="GS1_DATA_BAR",e.GS1DataBarLimited="GS1_DATA_BAR_LIMITED",e.GS1DataBarExpanded="GS1_DATA_BAR_EXPANDED",n.cancel=async function(){await a("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return a(`plugin:${n}|check_permissions`)}("barcode-scanner").then(n=>n.camera)},n.openAppSettings=async function(){await a("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return a(`plugin:${n}|request_permissions`)}("barcode-scanner").then(n=>n.camera)},n.scan=async function(n){return await a("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})} if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function a(n,a={},e){return window.__TAURI_INTERNALS__.invoke(n,a,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(e=n.Format||(n.Format={})).QRCode="QR_CODE",e.UPC_A="UPC_A",e.UPC_E="UPC_E",e.EAN8="EAN_8",e.EAN13="EAN_13",e.Code39="CODE_39",e.Code93="CODE_93",e.Code128="CODE_128",e.Codabar="CODABAR",e.ITF="ITF",e.Aztec="AZTEC",e.DataMatrix="DATA_MATRIX",e.PDF417="PDF_417",e.GS1DataBar="GS1_DATA_BAR",e.GS1DataBarLimited="GS1_DATA_BAR_LIMITED",e.GS1DataBarExpanded="GS1_DATA_BAR_EXPANDED",n.cancel=async function(){await a("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return a(`plugin:${n}|check_permissions`)}("barcode-scanner").then((n=>n.camera))},n.openAppSettings=async function(){await a("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return a(`plugin:${n}|request_permissions`)}("barcode-scanner").then((n=>n.camera))},n.scan=async function(n){return await a("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})}
@@ -337,12 +337,11 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
} }
@objc private func cancel(_ invoke: Invoke) { @objc private func cancel(_ invoke: Invoke) {
DispatchQueue.main.async { [self] in
self.invoke?.reject("cancelled") self.invoke?.reject("cancelled")
self.destroy()
destroy()
invoke.resolve() invoke.resolve()
} }
}
} }
@_cdecl("init_plugin_barcode_scanner") @_cdecl("init_plugin_barcode_scanner")
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-barcode-scanner", "name": "@tauri-apps/plugin-barcode-scanner",
"version": "2.4.5", "version": "2.4.4",
"description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS", "description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
@@ -25,6 +25,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
} }
} }
@@ -24,20 +24,17 @@
}, },
"permission": { "permission": {
"description": "A list of inlined permissions", "description": "A list of inlined permissions",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/Permission" "$ref": "#/definitions/Permission"
} },
"default": []
} }
}, },
"definitions": { "definitions": {
"DefaultPermission": { "DefaultPermission": {
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
"type": "object", "type": "object",
"required": [
"permissions"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -46,10 +43,10 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -62,16 +59,14 @@
"type": "string" "type": "string"
} }
} }
} },
"required": [
"permissions"
]
}, },
"PermissionSet": { "PermissionSet": {
"description": "A set of direct permissions grouped together under a new name.", "description": "A set of direct permissions grouped together under a new name.",
"type": "object", "type": "object",
"required": [
"description",
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
@@ -85,17 +80,19 @@
"description": "All permissions this set contains.", "description": "All permissions this set contains.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/PermissionKind" "type": "string"
}
} }
} }
}, },
"required": [
"identifier",
"description",
"permissions"
]
},
"Permission": { "Permission": {
"description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
"type": "object", "type": "object",
"required": [
"identifier"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -104,14 +101,14 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri internal convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -147,7 +144,10 @@
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
} }
} },
"required": [
"identifier"
]
}, },
"Commands": { "Commands": {
"description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
@@ -155,24 +155,24 @@
"properties": { "properties": {
"allow": { "allow": {
"description": "Allowed command.", "description": "Allowed command.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
}, },
"deny": { "deny": {
"description": "Denied command, which takes priority.", "description": "Denied command, which takes priority.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
} }
} }
}, },
"Scopes": { "Scopes": {
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\nThe configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json\n{\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n}\n```",
"type": "object", "type": "object",
"properties": { "properties": {
"allow": { "allow": {
@@ -257,120 +257,27 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "const": "macOS"
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "const": "windows"
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "const": "linux"
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "const": "android"
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "const": "iOS"
"iOS"
]
}
]
},
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "Enables the cancel command without any pre-configured scope.",
"type": "string",
"const": "allow-cancel",
"markdownDescription": "Enables the cancel command without any pre-configured scope."
},
{
"description": "Denies the cancel command without any pre-configured scope.",
"type": "string",
"const": "deny-cancel",
"markdownDescription": "Denies the cancel command without any pre-configured scope."
},
{
"description": "Enables the check_permissions command without any pre-configured scope.",
"type": "string",
"const": "allow-check-permissions",
"markdownDescription": "Enables the check_permissions command without any pre-configured scope."
},
{
"description": "Denies the check_permissions command without any pre-configured scope.",
"type": "string",
"const": "deny-check-permissions",
"markdownDescription": "Denies the check_permissions command without any pre-configured scope."
},
{
"description": "Enables the open_app_settings command without any pre-configured scope.",
"type": "string",
"const": "allow-open-app-settings",
"markdownDescription": "Enables the open_app_settings command without any pre-configured scope."
},
{
"description": "Denies the open_app_settings command without any pre-configured scope.",
"type": "string",
"const": "deny-open-app-settings",
"markdownDescription": "Denies the open_app_settings command without any pre-configured scope."
},
{
"description": "Enables the request_permissions command without any pre-configured scope.",
"type": "string",
"const": "allow-request-permissions",
"markdownDescription": "Enables the request_permissions command without any pre-configured scope."
},
{
"description": "Denies the request_permissions command without any pre-configured scope.",
"type": "string",
"const": "deny-request-permissions",
"markdownDescription": "Denies the request_permissions command without any pre-configured scope."
},
{
"description": "Enables the scan command without any pre-configured scope.",
"type": "string",
"const": "allow-scan",
"markdownDescription": "Enables the scan command without any pre-configured scope."
},
{
"description": "Denies the scan command without any pre-configured scope.",
"type": "string",
"const": "deny-scan",
"markdownDescription": "Denies the scan command without any pre-configured scope."
},
{
"description": "Enables the vibrate command without any pre-configured scope.",
"type": "string",
"const": "allow-vibrate",
"markdownDescription": "Enables the vibrate command without any pre-configured scope."
},
{
"description": "Denies the vibrate command without any pre-configured scope.",
"type": "string",
"const": "deny-vibrate",
"markdownDescription": "Denies the vibrate command without any pre-configured scope."
},
{
"description": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n\n#### This default permission set includes:\n\n- `allow-cancel`\n- `allow-check-permissions`\n- `allow-open-app-settings`\n- `allow-request-permissions`\n- `allow-scan`\n- `allow-vibrate`",
"type": "string",
"const": "default",
"markdownDescription": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n\n#### This default permission set includes:\n\n- `allow-cancel`\n- `allow-check-permissions`\n- `allow-open-app-settings`\n- `allow-request-permissions`\n- `allow-scan`\n- `allow-vibrate`"
} }
] ]
} }
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
} }
} }
@@ -24,20 +24,17 @@
}, },
"permission": { "permission": {
"description": "A list of inlined permissions", "description": "A list of inlined permissions",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/Permission" "$ref": "#/definitions/Permission"
} },
"default": []
} }
}, },
"definitions": { "definitions": {
"DefaultPermission": { "DefaultPermission": {
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
"type": "object", "type": "object",
"required": [
"permissions"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -46,10 +43,10 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -62,16 +59,14 @@
"type": "string" "type": "string"
} }
} }
} },
"required": [
"permissions"
]
}, },
"PermissionSet": { "PermissionSet": {
"description": "A set of direct permissions grouped together under a new name.", "description": "A set of direct permissions grouped together under a new name.",
"type": "object", "type": "object",
"required": [
"description",
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
@@ -85,17 +80,19 @@
"description": "All permissions this set contains.", "description": "All permissions this set contains.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/PermissionKind" "type": "string"
}
} }
} }
}, },
"required": [
"identifier",
"description",
"permissions"
]
},
"Permission": { "Permission": {
"description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
"type": "object", "type": "object",
"required": [
"identifier"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -104,14 +101,14 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri internal convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -147,7 +144,10 @@
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
} }
} },
"required": [
"identifier"
]
}, },
"Commands": { "Commands": {
"description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
@@ -155,24 +155,24 @@
"properties": { "properties": {
"allow": { "allow": {
"description": "Allowed command.", "description": "Allowed command.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
}, },
"deny": { "deny": {
"description": "Denied command, which takes priority.", "description": "Denied command, which takes priority.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
} }
} }
}, },
"Scopes": { "Scopes": {
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\nThe configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json\n{\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n}\n```",
"type": "object", "type": "object",
"properties": { "properties": {
"allow": { "allow": {
@@ -257,72 +257,27 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "const": "macOS"
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "const": "windows"
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "const": "linux"
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "const": "android"
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "const": "iOS"
"iOS"
]
}
]
},
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "Enables the authenticate command without any pre-configured scope.",
"type": "string",
"const": "allow-authenticate",
"markdownDescription": "Enables the authenticate command without any pre-configured scope."
},
{
"description": "Denies the authenticate command without any pre-configured scope.",
"type": "string",
"const": "deny-authenticate",
"markdownDescription": "Denies the authenticate command without any pre-configured scope."
},
{
"description": "Enables the status command without any pre-configured scope.",
"type": "string",
"const": "allow-status",
"markdownDescription": "Enables the status command without any pre-configured scope."
},
{
"description": "Denies the status command without any pre-configured scope.",
"type": "string",
"const": "deny-status",
"markdownDescription": "Denies the status command without any pre-configured scope."
},
{
"description": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`",
"type": "string",
"const": "default",
"markdownDescription": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`"
} }
] ]
} }
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
} }
} }
+31 -64
View File
@@ -24,20 +24,17 @@
}, },
"permission": { "permission": {
"description": "A list of inlined permissions", "description": "A list of inlined permissions",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/Permission" "$ref": "#/definitions/Permission"
} },
"default": []
} }
}, },
"definitions": { "definitions": {
"DefaultPermission": { "DefaultPermission": {
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
"type": "object", "type": "object",
"required": [
"permissions"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -46,10 +43,10 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -62,16 +59,14 @@
"type": "string" "type": "string"
} }
} }
} },
"required": [
"permissions"
]
}, },
"PermissionSet": { "PermissionSet": {
"description": "A set of direct permissions grouped together under a new name.", "description": "A set of direct permissions grouped together under a new name.",
"type": "object", "type": "object",
"required": [
"description",
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
@@ -85,17 +80,19 @@
"description": "All permissions this set contains.", "description": "All permissions this set contains.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/PermissionKind" "type": "string"
}
} }
} }
}, },
"required": [
"identifier",
"description",
"permissions"
]
},
"Permission": { "Permission": {
"description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
"type": "object", "type": "object",
"required": [
"identifier"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -104,14 +101,14 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri internal convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -147,7 +144,10 @@
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
} }
} },
"required": [
"identifier"
]
}, },
"Commands": { "Commands": {
"description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
@@ -155,24 +155,24 @@
"properties": { "properties": {
"allow": { "allow": {
"description": "Allowed command.", "description": "Allowed command.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
}, },
"deny": { "deny": {
"description": "Denied command, which takes priority.", "description": "Denied command, which takes priority.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
} }
} }
}, },
"Scopes": { "Scopes": {
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\nThe configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json\n{\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n}\n```",
"type": "object", "type": "object",
"properties": { "properties": {
"allow": { "allow": {
@@ -257,60 +257,27 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "const": "macOS"
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "const": "windows"
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "const": "linux"
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "const": "android"
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "const": "iOS"
"iOS"
]
}
]
},
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "Enables the cli_matches command without any pre-configured scope.",
"type": "string",
"const": "allow-cli-matches",
"markdownDescription": "Enables the cli_matches command without any pre-configured scope."
},
{
"description": "Denies the cli_matches command without any pre-configured scope.",
"type": "string",
"const": "deny-cli-matches",
"markdownDescription": "Denies the cli_matches command without any pre-configured scope."
},
{
"description": "Allows reading the CLI matches\n#### This default permission set includes:\n\n- `allow-cli-matches`",
"type": "string",
"const": "default",
"markdownDescription": "Allows reading the CLI matches\n#### This default permission set includes:\n\n- `allow-cli-matches`"
} }
] ]
} }
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }
+1 -1
View File
@@ -32,7 +32,7 @@ log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { 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] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
arboard = { version = "3", features = ["wayland-data-control"] } arboard = { version = "3", features = ["wayland-data-control"] }
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var n;async function t(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,n,t,r){if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:n.get(e)}(this,n,"f")}constructor(e){n.set(this,void 0),function(e,n,t){if("function"==typeof n||!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");n.set(e,t)}(this,n,e)}async close(){return t("plugin:resources|close",{rid:this.rid})}}n=new WeakMap;class a extends r{constructor(e){super(e)}static async new(e,n,r){return t("plugin:image|new",{rgba:i(e),width:n,height:r}).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 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")},e.writeHtml=async function(e,n){await t("plugin:clipboard-manager|write_html",{html:e,altText:n})},e.writeImage=async function(e){await t("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,n){await t("plugin:clipboard-manager|write_text",{label:n?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})} if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var n;async function t(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,n,t,r){if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:n.get(e)}(this,n,"f")}constructor(e){n.set(this,void 0),function(e,n,t){if("function"==typeof n||!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");n.set(e,t)}(this,n,e)}async close(){return t("plugin:resources|close",{rid:this.rid})}}n=new WeakMap;class a extends r{constructor(e){super(e)}static async new(e,n,r){return t("plugin:image|new",{rgba:i(e),width:n,height:r}).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 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")},e.writeHtml=async function(e,n){await t("plugin:clipboard-manager|write_html",{html:e,altText:n})},e.writeImage=async function(e){await t("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,n){await t("plugin:clipboard-manager|write_text",{label:n?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})}
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
} }
} }
@@ -24,20 +24,17 @@
}, },
"permission": { "permission": {
"description": "A list of inlined permissions", "description": "A list of inlined permissions",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/Permission" "$ref": "#/definitions/Permission"
} },
"default": []
} }
}, },
"definitions": { "definitions": {
"DefaultPermission": { "DefaultPermission": {
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
"type": "object", "type": "object",
"required": [
"permissions"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -46,10 +43,10 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -62,16 +59,14 @@
"type": "string" "type": "string"
} }
} }
} },
"required": [
"permissions"
]
}, },
"PermissionSet": { "PermissionSet": {
"description": "A set of direct permissions grouped together under a new name.", "description": "A set of direct permissions grouped together under a new name.",
"type": "object", "type": "object",
"required": [
"description",
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
@@ -85,17 +80,19 @@
"description": "All permissions this set contains.", "description": "All permissions this set contains.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/PermissionKind" "type": "string"
}
} }
} }
}, },
"required": [
"identifier",
"description",
"permissions"
]
},
"Permission": { "Permission": {
"description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
"type": "object", "type": "object",
"required": [
"identifier"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -104,14 +101,14 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri internal convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -147,7 +144,10 @@
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
} }
} },
"required": [
"identifier"
]
}, },
"Commands": { "Commands": {
"description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
@@ -155,24 +155,24 @@
"properties": { "properties": {
"allow": { "allow": {
"description": "Allowed command.", "description": "Allowed command.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
}, },
"deny": { "deny": {
"description": "Denied command, which takes priority.", "description": "Denied command, which takes priority.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
} }
} }
}, },
"Scopes": { "Scopes": {
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\nThe configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json\n{\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n}\n```",
"type": "object", "type": "object",
"properties": { "properties": {
"allow": { "allow": {
@@ -257,120 +257,27 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "const": "macOS"
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "const": "windows"
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "const": "linux"
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "const": "android"
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "const": "iOS"
"iOS"
]
}
]
},
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "Enables the clear command without any pre-configured scope.",
"type": "string",
"const": "allow-clear",
"markdownDescription": "Enables the clear command without any pre-configured scope."
},
{
"description": "Denies the clear command without any pre-configured scope.",
"type": "string",
"const": "deny-clear",
"markdownDescription": "Denies the clear command without any pre-configured scope."
},
{
"description": "Enables the read_image command without any pre-configured scope.",
"type": "string",
"const": "allow-read-image",
"markdownDescription": "Enables the read_image command without any pre-configured scope."
},
{
"description": "Denies the read_image command without any pre-configured scope.",
"type": "string",
"const": "deny-read-image",
"markdownDescription": "Denies the read_image command without any pre-configured scope."
},
{
"description": "Enables the read_text command without any pre-configured scope.",
"type": "string",
"const": "allow-read-text",
"markdownDescription": "Enables the read_text command without any pre-configured scope."
},
{
"description": "Denies the read_text command without any pre-configured scope.",
"type": "string",
"const": "deny-read-text",
"markdownDescription": "Denies the read_text command without any pre-configured scope."
},
{
"description": "Enables the write_html command without any pre-configured scope.",
"type": "string",
"const": "allow-write-html",
"markdownDescription": "Enables the write_html command without any pre-configured scope."
},
{
"description": "Denies the write_html command without any pre-configured scope.",
"type": "string",
"const": "deny-write-html",
"markdownDescription": "Denies the write_html command without any pre-configured scope."
},
{
"description": "Enables the write_image command without any pre-configured scope.",
"type": "string",
"const": "allow-write-image",
"markdownDescription": "Enables the write_image command without any pre-configured scope."
},
{
"description": "Denies the write_image command without any pre-configured scope.",
"type": "string",
"const": "deny-write-image",
"markdownDescription": "Denies the write_image command without any pre-configured scope."
},
{
"description": "Enables the write_text command without any pre-configured scope.",
"type": "string",
"const": "allow-write-text",
"markdownDescription": "Enables the write_text command without any pre-configured scope."
},
{
"description": "Denies the write_text command without any pre-configured scope.",
"type": "string",
"const": "deny-write-text",
"markdownDescription": "Denies the write_text command without any pre-configured scope."
},
{
"description": "No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n",
"type": "string",
"const": "default",
"markdownDescription": "No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n"
} }
] ]
} }
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }
-9
View File
@@ -1,14 +1,5 @@
# Changelog # Changelog
## \[2.4.9]
- [`e6cdc9f5`](https://github.com/tauri-apps/plugins-workspace/commit/e6cdc9f52e2cd975b11b8e4c12879d597f1f76c3) ([#3396](https://github.com/tauri-apps/plugins-workspace/pull/3396) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix broken iOS custom URL schemes
## \[2.4.8]
- [`024ec0c2`](https://github.com/tauri-apps/plugins-workspace/commit/024ec0c29c20cf94579dab9b79d6be0da61a8daa) ([#3214](https://github.com/tauri-apps/plugins-workspace/pull/3214) by [@joshIsCoding](https://github.com/tauri-apps/plugins-workspace/../../joshIsCoding)) Account for differing Android VIEW intent in ChromeOS, fixing deep-link behaviour on Chromium platforms.
- [`015e817c`](https://github.com/tauri-apps/plugins-workspace/commit/015e817cf2d7f66c1b9268606af8318dfe0bc4ee) ([#3186](https://github.com/tauri-apps/plugins-workspace/pull/3186) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Validate Android new intent is actually a deep link before triggering the onOpenUrl event.
## \[2.4.7] ## \[2.4.7]
- [`8374e997`](https://github.com/tauri-apps/plugins-workspace/commit/8374e997b82c95516fc0c1f6d665d9fc3b52edf8) ([#3258](https://github.com/tauri-apps/plugins-workspace/pull/3258) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Fix runtime deep link registration failing on Linux when the app path has spaces. - [`8374e997`](https://github.com/tauri-apps/plugins-workspace/commit/8374e997b82c95516fc0c1f6d665d9fc3b52edf8) ([#3258](https://github.com/tauri-apps/plugins-workspace/pull/3258) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Fix runtime deep link registration failing on Linux when the app path has spaces.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-deep-link" name = "tauri-plugin-deep-link"
version = "2.4.9" version = "2.4.7"
description = "Set your Tauri application as the default handler for an URL" description = "Set your Tauri application as the default handler for an URL"
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@@ -44,14 +44,11 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
private var currentUrl: String? = null private var currentUrl: String? = null
private var channel: Channel? = null private var channel: Channel? = null
private var config: PluginConfig? = null private var config: PluginConfig? = null
companion object { companion object {
var instance: DeepLinkPlugin? = null var instance: DeepLinkPlugin? = null
} }
private fun isViewIntent(action: String?): Boolean {
return action == Intent.ACTION_VIEW || action == "org.chromium.arc.intent.action.VIEW"
}
@Command @Command
fun getCurrent(invoke: Invoke) { fun getCurrent(invoke: Invoke) {
val ret = JSObject() val ret = JSObject()
@@ -77,7 +74,7 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
val intent = activity.intent val intent = activity.intent
if (isViewIntent(intent.action) && intent.data != null) { if (intent.action == Intent.ACTION_VIEW && intent.data != null) {
val url = intent.data.toString() val url = intent.data.toString()
if (isDeepLink(url)) { if (isDeepLink(url)) {
// TODO: check if it makes sense to split up init url and last url // TODO: check if it makes sense to split up init url and last url
@@ -90,7 +87,7 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
} }
override fun onNewIntent(intent: Intent) { override fun onNewIntent(intent: Intent) {
if (isViewIntent(intent.action) && intent.data != null) { if (intent.action == Intent.ACTION_VIEW && intent.data != null) {
val url = intent.data.toString() val url = intent.data.toString()
if (isDeepLink(url)) { if (isDeepLink(url)) {
this.currentUrl = url this.currentUrl = url
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_DEEP_LINK__=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 t;async function i(e,t,i){const _={kind:"Any"};return r("plugin:event|listen",{event:e,target:_,handler:n(t)}).then(n=>async()=>async function(e,n){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e,n),await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n))}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.WINDOW_CREATED="tauri://window-created",e.WINDOW_SUSPENDED="tauri://suspended",e.WINDOW_RESUMED="tauri://resumed",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"}(t||(t={})),e.getCurrent=async function(){return await r("plugin:deep-link|get_current")},e.isRegistered=async function(e){return await r("plugin:deep-link|is_registered",{protocol:e})},e.onOpenUrl=async function(e){return await i("deep-link://new-url",n=>{e(n.payload)})},e.register=async function(e){return await r("plugin:deep-link|register",{protocol:e})},e.unregister=async function(e){return await r("plugin:deep-link|unregister",{protocol:e})},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_PLUGIN_DEEP_LINK__})} if("__TAURI__"in window){var __TAURI_PLUGIN_DEEP_LINK__=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 t;async function i(e,t,i){const _={kind:"Any"};return r("plugin:event|listen",{event:e,target:_,handler:n(t)}).then((n=>async()=>async function(e,n){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e,n),await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}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.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"}(t||(t={})),e.getCurrent=async function(){return await r("plugin:deep-link|get_current")},e.isRegistered=async function(e){return await r("plugin:deep-link|is_registered",{protocol:e})},e.onOpenUrl=async function(e){return await i("deep-link://new-url",(n=>{e(n.payload)}))},e.register=async function(e){return await r("plugin:deep-link|register",{protocol:e})},e.unregister=async function(e){return await r("plugin:deep-link|unregister",{protocol:e})},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_PLUGIN_DEEP_LINK__})}
+1 -3
View File
@@ -25,8 +25,6 @@ fn intent_filter(domain: &AssociatedDomain) -> String {
format!( format!(
r#"<intent-filter {auto_verify}> r#"<intent-filter {auto_verify}>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<!-- ChromeOS ARC++ uses a different action for deep links -->
<action android:name="org.chromium.arc.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
{schemes} {schemes}
@@ -139,7 +137,7 @@ fn main() {
let deep_link_domains = config let deep_link_domains = config
.mobile .mobile
.iter() .iter()
.filter(|domain| !domain.is_app_link()) .filter(|domain| domain.is_app_link())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
if deep_link_domains.is_empty() { if deep_link_domains.is_empty() {
@@ -1,17 +1,5 @@
# Changelog # Changelog
## \[2.2.12]
### Dependencies
- Upgraded to `deep-link-js@2.4.9`
## \[2.2.11]
### Dependencies
- Upgraded to `deep-link-js@2.4.8`
## \[2.2.10] ## \[2.2.10]
### Dependencies ### Dependencies
+6 -6
View File
@@ -1,7 +1,7 @@
{ {
"name": "deep-link-example", "name": "deep-link-example",
"private": true, "private": true,
"version": "2.2.12", "version": "2.2.10",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@@ -10,12 +10,12 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0", "@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-deep-link": "workspace:*" "@tauri-apps/plugin-deep-link": "2.4.7"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "2.11.4", "@tauri-apps/cli": "2.10.1",
"typescript": "^6.0.0", "typescript": "^5.7.3",
"vite": "^8.0.1" "vite": "^7.3.1"
} }
} }
@@ -19,7 +19,9 @@ tauri-build = { workspace = true }
[dependencies] [dependencies]
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tauri = { workspace = true, features = ["wry", "common-controls-v6", "x11"] } tauri = { workspace = true }
tauri-runtime-wry = { workspace = true, optional = true }
tauri-runtime-cef = { workspace = true, optional = true }
tauri-plugin-deep-link = { path = "../../../" } tauri-plugin-deep-link = { path = "../../../" }
tauri-plugin-log = { path = "../../../../log" } tauri-plugin-log = { path = "../../../../log" }
tauri-plugin-single-instance = { path = "../../../../single-instance", features = [ tauri-plugin-single-instance = { path = "../../../../single-instance", features = [
@@ -28,6 +30,9 @@ tauri-plugin-single-instance = { path = "../../../../single-instance", features
log = "0.4" log = "0.4"
[features] [features]
default = ["wry"]
wry = ["dep:tauri-runtime-wry"]
cef = ["dep:tauri-runtime-cef"]
# this feature is used for production builds or when `devUrl` points to the filesystem and the built-in dev server is disabled. # this feature is used for production builds or when `devUrl` points to the filesystem and the built-in dev server is disabled.
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes. # If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
# DO NOT REMOVE!! # DO NOT REMOVE!!
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.deep_link_example" parent="Theme.Material3.DayNight.NoActionBar"> <style name="Theme.deep_link_example" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
</style> </style>
</resources> </resources>
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.deep_link_example" parent="Theme.Material3.DayNight.NoActionBar"> <style name="Theme.deep_link_example" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
</style> </style>
</resources> </resources>
@@ -2,6 +2,11 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#[cfg(feature = "cef")]
type TauriRuntime = tauri_runtime_cef::CefRuntime<tauri::EventLoopMessage>;
#[cfg(feature = "wry")]
type TauriRuntime = tauri_runtime_wry::Wry<tauri::EventLoopMessage>;
use tauri_plugin_deep_link::DeepLinkExt; use tauri_plugin_deep_link::DeepLinkExt;
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
@@ -13,7 +18,7 @@ fn greet(name: &str) -> String {
#[cfg_attr(mobile, tauri::mobile_entry_point)] #[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() { pub fn run() {
#[allow(unused_mut)] #[allow(unused_mut)]
let mut builder = tauri::Builder::default(); let mut builder = tauri::Builder::<TauriRuntime>::new();
#[cfg(desktop)] #[cfg(desktop)]
{ {
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-deep-link", "name": "@tauri-apps/plugin-deep-link",
"version": "2.4.9", "version": "2.4.7",
"description": "Set your Tauri application as the default handler for an URL", "description": "Set your Tauri application as the default handler for an URL",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
@@ -25,9 +25,9 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "2.11.4" "@tauri-apps/cli": "2.10.1"
} }
} }
+31 -100
View File
@@ -24,20 +24,17 @@
}, },
"permission": { "permission": {
"description": "A list of inlined permissions", "description": "A list of inlined permissions",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/Permission" "$ref": "#/definitions/Permission"
} },
"default": []
} }
}, },
"definitions": { "definitions": {
"DefaultPermission": { "DefaultPermission": {
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
"type": "object", "type": "object",
"required": [
"permissions"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -46,10 +43,10 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -62,16 +59,14 @@
"type": "string" "type": "string"
} }
} }
} },
"required": [
"permissions"
]
}, },
"PermissionSet": { "PermissionSet": {
"description": "A set of direct permissions grouped together under a new name.", "description": "A set of direct permissions grouped together under a new name.",
"type": "object", "type": "object",
"required": [
"description",
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
@@ -85,17 +80,19 @@
"description": "All permissions this set contains.", "description": "All permissions this set contains.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/PermissionKind" "type": "string"
}
} }
} }
}, },
"required": [
"identifier",
"description",
"permissions"
]
},
"Permission": { "Permission": {
"description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
"type": "object", "type": "object",
"required": [
"identifier"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -104,14 +101,14 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri internal convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -147,7 +144,10 @@
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
} }
} },
"required": [
"identifier"
]
}, },
"Commands": { "Commands": {
"description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
@@ -155,24 +155,24 @@
"properties": { "properties": {
"allow": { "allow": {
"description": "Allowed command.", "description": "Allowed command.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
}, },
"deny": { "deny": {
"description": "Denied command, which takes priority.", "description": "Denied command, which takes priority.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
} }
} }
}, },
"Scopes": { "Scopes": {
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\nThe configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json\n{\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n}\n```",
"type": "object", "type": "object",
"properties": { "properties": {
"allow": { "allow": {
@@ -257,96 +257,27 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "const": "macOS"
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "const": "windows"
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "const": "linux"
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "const": "android"
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "const": "iOS"
"iOS"
]
}
]
},
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "Enables the get_current command without any pre-configured scope.",
"type": "string",
"const": "allow-get-current",
"markdownDescription": "Enables the get_current command without any pre-configured scope."
},
{
"description": "Denies the get_current command without any pre-configured scope.",
"type": "string",
"const": "deny-get-current",
"markdownDescription": "Denies the get_current command without any pre-configured scope."
},
{
"description": "Enables the is_registered command without any pre-configured scope.",
"type": "string",
"const": "allow-is-registered",
"markdownDescription": "Enables the is_registered command without any pre-configured scope."
},
{
"description": "Denies the is_registered command without any pre-configured scope.",
"type": "string",
"const": "deny-is-registered",
"markdownDescription": "Denies the is_registered command without any pre-configured scope."
},
{
"description": "Enables the register command without any pre-configured scope.",
"type": "string",
"const": "allow-register",
"markdownDescription": "Enables the register command without any pre-configured scope."
},
{
"description": "Denies the register command without any pre-configured scope.",
"type": "string",
"const": "deny-register",
"markdownDescription": "Denies the register command without any pre-configured scope."
},
{
"description": "Enables the unregister command without any pre-configured scope.",
"type": "string",
"const": "allow-unregister",
"markdownDescription": "Enables the unregister command without any pre-configured scope."
},
{
"description": "Denies the unregister command without any pre-configured scope.",
"type": "string",
"const": "deny-unregister",
"markdownDescription": "Denies the unregister command without any pre-configured scope."
},
{
"description": "Allows reading the opened deep link via the get_current command\n#### This default permission set includes:\n\n- `allow-get-current`",
"type": "string",
"const": "default",
"markdownDescription": "Allows reading the opened deep link via the get_current command\n#### This default permission set includes:\n\n- `allow-get-current`"
} }
] ]
} }
+1 -1
View File
@@ -540,7 +540,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R, Option<config::Config>> {
Ok(()) Ok(())
}) })
.on_event(|_app, _event| { .on_event(|_app, _event| {
#[cfg(any(target_os = "macos", target_os = "ios"))] #[cfg(desktop)]
if let tauri::RunEvent::Opened { urls } = _event { if let tauri::RunEvent::Opened { urls } = _event {
use tauri::Emitter; use tauri::Emitter;
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }
-18
View File
@@ -1,23 +1,5 @@
# Changelog # Changelog
## \[2.7.2]
- [`40ae0a7f`](https://github.com/tauri-apps/plugins-workspace/commit/40ae0a7fa0ecc9b0cdbd952297f7a17f37308229) ([#3491](https://github.com/tauri-apps/plugins-workspace/pull/3491) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Use `com.google.android.material.dialog.MaterialAlertDialogBuilder` instead of `AlertDialog` so the dialog follows the app's theme
## \[2.7.1]
### Dependencies
- Upgraded to `fs-js@2.5.1`
## \[2.7.0]
- [`24154472`](https://github.com/tauri-apps/plugins-workspace/commit/24154472a6710a690173df0a121125d1f1b871e8) ([#3287](https://github.com/tauri-apps/plugins-workspace/pull/3287) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Re-use `message` command in Rust side for `ask` and `confirm` commands, `allow-ask` and `allow-confirm` permissions are now aliases to `allow-message`
### Dependencies
- Upgraded to `fs-js@2.5.0`
## \[2.6.0] ## \[2.6.0]
- [`d7a0bb32`](https://github.com/tauri-apps/plugins-workspace/commit/d7a0bb325dad919d6cc132eb3898c33540de77c4) ([#3136](https://github.com/tauri-apps/plugins-workspace/pull/3136) by [@onehumandev](https://github.com/tauri-apps/plugins-workspace/../../onehumandev)) Add `fileAccessMode` option to file picker. - [`d7a0bb32`](https://github.com/tauri-apps/plugins-workspace/commit/d7a0bb325dad919d6cc132eb3898c33540de77c4) ([#3136](https://github.com/tauri-apps/plugins-workspace/pull/3136) by [@onehumandev](https://github.com/tauri-apps/plugins-workspace/../../onehumandev)) Add `fileAccessMode` option to file picker.
+4 -4
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-dialog" name = "tauri-plugin-dialog"
version = "2.7.2" version = "2.6.0"
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application." description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -28,7 +28,7 @@ ios = { level = "partial", notes = "Does not support folder picker" }
tauri-plugin = { workspace = true, features = ["build"] } tauri-plugin = { workspace = true, features = ["build"] }
[dev-dependencies] [dev-dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true }
[dependencies] [dependencies]
serde = { workspace = true } serde = { workspace = true }
@@ -37,10 +37,10 @@ tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
url = { workspace = true } url = { workspace = true }
tauri-plugin-fs = { path = "../fs", version = "2.5.1" } tauri-plugin-fs = { path = "../fs", version = "2.4.5" }
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { 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] [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.16", default-features = false, features = [ rfd = { version = "0.16", default-features = false, features = [
+2 -2
View File
@@ -35,8 +35,8 @@ android {
dependencies { dependencies {
implementation("androidx.core:core-ktx:1.9.0") implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.7.1") implementation("androidx.appcompat:appcompat:1.6.0")
implementation("com.google.android.material:material:1.13.0") implementation("com.google.android.material:material:1.7.0")
testImplementation("junit:junit:4.13.2") testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
@@ -5,6 +5,7 @@
package app.tauri.dialog package app.tauri.dialog
import android.app.Activity import android.app.Activity
import android.app.AlertDialog
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Handler import android.os.Handler
@@ -20,7 +21,6 @@ import app.tauri.plugin.Invoke
import app.tauri.plugin.JSArray import app.tauri.plugin.JSArray
import app.tauri.plugin.JSObject import app.tauri.plugin.JSObject
import app.tauri.plugin.Plugin import app.tauri.plugin.Plugin
import com.google.android.material.dialog.MaterialAlertDialogBuilder
@InvokeArg @InvokeArg
class Filter { class Filter {
@@ -158,7 +158,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
Handler(Looper.getMainLooper()) Handler(Looper.getMainLooper())
.post { .post {
val builder = MaterialAlertDialogBuilder(activity) val builder = AlertDialog.Builder(activity)
if (args.title != null) { if (args.title != null) {
builder.setTitle(args.title) builder.setTitle(args.title)
@@ -191,7 +191,8 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
} }
} }
builder.show() val dialog = builder.create()
dialog.show()
} }
} }
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-dialog", "name": "@tauri-apps/plugin-dialog",
"version": "2.7.2", "version": "2.6.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
} }
} }
+31 -112
View File
@@ -24,20 +24,17 @@
}, },
"permission": { "permission": {
"description": "A list of inlined permissions", "description": "A list of inlined permissions",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/Permission" "$ref": "#/definitions/Permission"
} },
"default": []
} }
}, },
"definitions": { "definitions": {
"DefaultPermission": { "DefaultPermission": {
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
"type": "object", "type": "object",
"required": [
"permissions"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -46,10 +43,10 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -62,16 +59,14 @@
"type": "string" "type": "string"
} }
} }
} },
"required": [
"permissions"
]
}, },
"PermissionSet": { "PermissionSet": {
"description": "A set of direct permissions grouped together under a new name.", "description": "A set of direct permissions grouped together under a new name.",
"type": "object", "type": "object",
"required": [
"description",
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
@@ -85,17 +80,19 @@
"description": "All permissions this set contains.", "description": "All permissions this set contains.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/PermissionKind" "type": "string"
}
} }
} }
}, },
"required": [
"identifier",
"description",
"permissions"
]
},
"Permission": { "Permission": {
"description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
"type": "object", "type": "object",
"required": [
"identifier"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -104,14 +101,14 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri internal convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -147,7 +144,10 @@
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
} }
} },
"required": [
"identifier"
]
}, },
"Commands": { "Commands": {
"description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
@@ -155,24 +155,24 @@
"properties": { "properties": {
"allow": { "allow": {
"description": "Allowed command.", "description": "Allowed command.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
}, },
"deny": { "deny": {
"description": "Denied command, which takes priority.", "description": "Denied command, which takes priority.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
} }
} }
}, },
"Scopes": { "Scopes": {
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\nThe configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json\n{\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n}\n```",
"type": "object", "type": "object",
"properties": { "properties": {
"allow": { "allow": {
@@ -257,108 +257,27 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "const": "macOS"
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "const": "windows"
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "const": "linux"
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "const": "android"
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "const": "iOS"
"iOS"
]
}
]
},
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)",
"type": "string",
"const": "allow-ask",
"markdownDescription": "Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)"
},
{
"description": "Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)",
"type": "string",
"const": "deny-ask",
"markdownDescription": "Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)"
},
{
"description": "Enables the message command without any pre-configured scope.",
"type": "string",
"const": "allow-message",
"markdownDescription": "Enables the message command without any pre-configured scope."
},
{
"description": "Denies the message command without any pre-configured scope.",
"type": "string",
"const": "deny-message",
"markdownDescription": "Denies the message command without any pre-configured scope."
},
{
"description": "Enables the open command without any pre-configured scope.",
"type": "string",
"const": "allow-open",
"markdownDescription": "Enables the open command without any pre-configured scope."
},
{
"description": "Denies the open command without any pre-configured scope.",
"type": "string",
"const": "deny-open",
"markdownDescription": "Denies the open command without any pre-configured scope."
},
{
"description": "Enables the save command without any pre-configured scope.",
"type": "string",
"const": "allow-save",
"markdownDescription": "Enables the save command without any pre-configured scope."
},
{
"description": "Denies the save command without any pre-configured scope.",
"type": "string",
"const": "deny-save",
"markdownDescription": "Denies the save command without any pre-configured scope."
},
{
"description": "Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)",
"type": "string",
"const": "allow-confirm",
"markdownDescription": "Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)"
},
{
"description": "Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)",
"type": "string",
"const": "deny-confirm",
"markdownDescription": "Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)"
},
{
"description": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-message`\n- `allow-save`\n- `allow-open`",
"type": "string",
"const": "default",
"markdownDescription": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-message`\n- `allow-save`\n- `allow-open`"
} }
] ]
} }
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }
-10
View File
@@ -1,15 +1,5 @@
# Changelog # Changelog
## \[2.5.1]
- [`ec054013`](https://github.com/tauri-apps/plugins-workspace/commit/ec0540138bece081e9a87982091947360e61987a) ([#3323](https://github.com/tauri-apps/plugins-workspace/pull/3323) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated dependency `toml` from 0.9 to 1
## \[2.5.0]
- [`e97a4ded`](https://github.com/tauri-apps/plugins-workspace/commit/e97a4dedab8608d9d57029784ee8a2607ca3a996) ([#3244](https://github.com/tauri-apps/plugins-workspace/pull/3244) by [@SeijiOkuda](https://github.com/tauri-apps/plugins-workspace/../../SeijiOkuda)) Add `encoding` option for `readTextFile` and `readTextFileLines`
- [`f75d21db`](https://github.com/tauri-apps/plugins-workspace/commit/f75d21db3351d6f12adf585c2c797c20ece94f7f) ([#3360](https://github.com/tauri-apps/plugins-workspace/pull/3360) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Removed the dependency on `tauri-utils`'s `build` feature
- [`f5f68063`](https://github.com/tauri-apps/plugins-workspace/commit/f5f68063e459c33522f44a04df3120d9d039ec13) ([#3185](https://github.com/tauri-apps/plugins-workspace/pull/3185) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Enable access for security-scoped resources on iOS by automatically calling `NSURL::startAccessingSecurityScopedResource` on resource access and adding the `stopAccessingSecurityScopedResource` API.
## \[2.4.5] ## \[2.4.5]
- [`521cd8b3`](https://github.com/tauri-apps/plugins-workspace/commit/521cd8b372c862d96b1637775710e4d7cf2443e2) ([#3155](https://github.com/tauri-apps/plugins-workspace/pull/3155) by [@EliasStar](https://github.com/tauri-apps/plugins-workspace/../../EliasStar)) Fix off by one error in the implementation of readTextFileLines causing all lines to end with an (additional) null byte. - [`521cd8b3`](https://github.com/tauri-apps/plugins-workspace/commit/521cd8b372c862d96b1637775710e4d7cf2443e2) ([#3155](https://github.com/tauri-apps/plugins-workspace/pull/3155) by [@EliasStar](https://github.com/tauri-apps/plugins-workspace/../../EliasStar)) Fix off by one error in the implementation of readTextFileLines causing all lines to end with an (additional) null byte.
+3 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-fs" name = "tauri-plugin-fs"
version = "2.5.1" version = "2.4.5"
description = "Access the file system." description = "Access the file system."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@@ -20,8 +20,8 @@ ios = { level = "partial", notes = "Access is restricted to Application folder b
tauri-plugin = { workspace = true, features = ["build"] } tauri-plugin = { workspace = true, features = ["build"] }
schemars = { workspace = true } schemars = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
toml = "1.0" toml = "0.9"
tauri-utils = { workspace = true } tauri-utils = { workspace = true, features = ["build"] }
[dependencies] [dependencies]
serde = { workspace = true } serde = { workspace = true }
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -220,7 +220,10 @@ permissions = [
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
) )
.global_api_script_path("./api-iife.js") .global_api_script_path("./api-iife.js")
.global_scope_schema(schemars::schema_for!(FsScopeEntry)) .global_scope_schema(
schemars::SchemaGenerator::new(schemars::generate::SchemaSettings::draft07())
.into_root_schema_for::<FsScopeEntry>(),
)
.android_path("android") .android_path("android")
.build(); .build();
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-fs", "name": "@tauri-apps/plugin-fs",
"version": "2.5.1", "version": "2.4.5",
"description": "Access the file system.", "description": "Access the file system.",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
@@ -25,6 +25,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
} }
} }
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -707,7 +707,7 @@ pub async fn read_text_file_lines_next<R: Runtime>(
let lines = resource_table.get::<StdLinesResource>(rid)?; let lines = resource_table.get::<StdLinesResource>(rid)?;
let ret = StdLinesResource::with_lock(&lines, |lines| -> CommandResult<Vec<u8>> { let ret = StdLinesResource::with_lock(&lines, |lines| -> CommandResult<Vec<u8>> {
// This is an optimization to include whether we finished iteration or not (1 or 0) // This is an optimization to include wether we finished iteration or not (1 or 0)
// at the end of returned vector so we can use `tauri::ipc::Response` // at the end of returned vector so we can use `tauri::ipc::Response`
// and avoid serialization overhead of separate values. // and avoid serialization overhead of separate values.
match lines.next() { match lines.next() {
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }
+1 -1
View File
@@ -30,7 +30,7 @@ thiserror = { workspace = true }
specta = { workspace = true, optional = true } specta = { workspace = true, optional = true }
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true }
[features] [features]
specta = ["dep:specta", "tauri/specta"] specta = ["dep:specta", "tauri/specta"]
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_GEOLOCATION__=function(t){"use strict";function n(t,n,i,e){if("function"==typeof n?t!==n||!e:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?e:"a"===i?e.call(t):e?e.value:n.get(t)}function i(t,n,i,e,s){if("function"==typeof n||!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(t,i),i}var e,s,o,a;"function"==typeof SuppressedError&&SuppressedError;const r="__TAURI_TO_IPC_KEY__";class c{constructor(t){e.set(this,void 0),s.set(this,0),o.set(this,[]),a.set(this,void 0),i(this,e,t||(()=>{})),this.id=function(t,n=!1){return window.__TAURI_INTERNALS__.transformCallback(t,n)}(t=>{const r=t.index;if("end"in t)return void(r==n(this,s,"f")?this.cleanupCallback():i(this,a,r));const c=t.message;if(r==n(this,s,"f")){for(n(this,e,"f").call(this,c),i(this,s,n(this,s,"f")+1);n(this,s,"f")in n(this,o,"f");){const t=n(this,o,"f")[n(this,s,"f")];n(this,e,"f").call(this,t),delete n(this,o,"f")[n(this,s,"f")],i(this,s,n(this,s,"f")+1)}n(this,s,"f")===n(this,a,"f")&&this.cleanupCallback()}else n(this,o,"f")[r]=c})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(t){i(this,e,t)}get onmessage(){return n(this,e,"f")}[(e=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap,r)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[r]()}}async function _(t,n={},i){return window.__TAURI_INTERNALS__.invoke(t,n,i)}return t.checkPermissions=async function(){return await async function(t){return _(`plugin:${t}|check_permissions`)}("geolocation")},t.clearWatch=async function(t){await _("plugin:geolocation|clear_watch",{channelId:t})},t.getCurrentPosition=async function(t){return await _("plugin:geolocation|get_current_position",{options:t})},t.requestPermissions=async function(t){return await _("plugin:geolocation|request_permissions",{permissions:t})},t.watchPosition=async function(t,n){const i=new c;return i.onmessage=t=>{"string"==typeof t?n(null,t):n(t)},await _("plugin:geolocation|watch_position",{options:t,channel:i}),i.id},t}({});Object.defineProperty(window.__TAURI__,"geolocation",{value:__TAURI_PLUGIN_GEOLOCATION__})} if("__TAURI__"in window){var __TAURI_PLUGIN_GEOLOCATION__=function(t){"use strict";function n(t,n,i,e){if("function"==typeof n?t!==n||!e:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?e:"a"===i?e.call(t):e?e.value:n.get(t)}function i(t,n,i,e,s){if("function"==typeof n||!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(t,i),i}var e,s,o,a;"function"==typeof SuppressedError&&SuppressedError;const r="__TAURI_TO_IPC_KEY__";class c{constructor(t){e.set(this,void 0),s.set(this,0),o.set(this,[]),a.set(this,void 0),i(this,e,t||(()=>{})),this.id=function(t,n=!1){return window.__TAURI_INTERNALS__.transformCallback(t,n)}((t=>{const r=t.index;if("end"in t)return void(r==n(this,s,"f")?this.cleanupCallback():i(this,a,r));const c=t.message;if(r==n(this,s,"f")){for(n(this,e,"f").call(this,c),i(this,s,n(this,s,"f")+1);n(this,s,"f")in n(this,o,"f");){const t=n(this,o,"f")[n(this,s,"f")];n(this,e,"f").call(this,t),delete n(this,o,"f")[n(this,s,"f")],i(this,s,n(this,s,"f")+1)}n(this,s,"f")===n(this,a,"f")&&this.cleanupCallback()}else n(this,o,"f")[r]=c}))}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(t){i(this,e,t)}get onmessage(){return n(this,e,"f")}[(e=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap,r)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[r]()}}async function _(t,n={},i){return window.__TAURI_INTERNALS__.invoke(t,n,i)}return t.checkPermissions=async function(){return await async function(t){return _(`plugin:${t}|check_permissions`)}("geolocation")},t.clearWatch=async function(t){await _("plugin:geolocation|clear_watch",{channelId:t})},t.getCurrentPosition=async function(t){return await _("plugin:geolocation|get_current_position",{options:t})},t.requestPermissions=async function(t){return await _("plugin:geolocation|request_permissions",{permissions:t})},t.watchPosition=async function(t,n){const i=new c;return i.onmessage=t=>{"string"==typeof t?n(null,t):n(t)},await _("plugin:geolocation|watch_position",{options:t,channel:i}),i.id},t}({});Object.defineProperty(window.__TAURI__,"geolocation",{value:__TAURI_PLUGIN_GEOLOCATION__})}
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.11.0" "@tauri-apps/api": "^2.10.1"
} }
} }
@@ -24,20 +24,17 @@
}, },
"permission": { "permission": {
"description": "A list of inlined permissions", "description": "A list of inlined permissions",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/Permission" "$ref": "#/definitions/Permission"
} },
"default": []
} }
}, },
"definitions": { "definitions": {
"DefaultPermission": { "DefaultPermission": {
"description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
"type": "object", "type": "object",
"required": [
"permissions"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -46,10 +43,10 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -62,16 +59,14 @@
"type": "string" "type": "string"
} }
} }
} },
"required": [
"permissions"
]
}, },
"PermissionSet": { "PermissionSet": {
"description": "A set of direct permissions grouped together under a new name.", "description": "A set of direct permissions grouped together under a new name.",
"type": "object", "type": "object",
"required": [
"description",
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
@@ -85,17 +80,19 @@
"description": "All permissions this set contains.", "description": "All permissions this set contains.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/PermissionKind" "type": "string"
}
} }
} }
}, },
"required": [
"identifier",
"description",
"permissions"
]
},
"Permission": { "Permission": {
"description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
"type": "object", "type": "object",
"required": [
"identifier"
],
"properties": { "properties": {
"version": { "version": {
"description": "The version of the permission.", "description": "The version of the permission.",
@@ -104,14 +101,14 @@
"null" "null"
], ],
"format": "uint64", "format": "uint64",
"minimum": 1.0 "minimum": 1
}, },
"identifier": { "identifier": {
"description": "A unique identifier for the permission.", "description": "A unique identifier for the permission.",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.", "description": "Human-readable description of what the permission does.\nTauri internal convention is to use `<h4>` headings in markdown content\nfor Tauri documentation generation purposes.",
"type": [ "type": [
"string", "string",
"null" "null"
@@ -147,7 +144,10 @@
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
} }
} },
"required": [
"identifier"
]
}, },
"Commands": { "Commands": {
"description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
@@ -155,24 +155,24 @@
"properties": { "properties": {
"allow": { "allow": {
"description": "Allowed command.", "description": "Allowed command.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
}, },
"deny": { "deny": {
"description": "Denied command, which takes priority.", "description": "Denied command, which takes priority.",
"default": [],
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"default": []
} }
} }
}, },
"Scopes": { "Scopes": {
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command.\nThe configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json\n{\n \"allow\": [{ \"path\": \"$HOME/**\" }],\n \"deny\": [{ \"path\": \"$HOME/secret.txt\" }]\n}\n```",
"type": "object", "type": "object",
"properties": { "properties": {
"allow": { "allow": {
@@ -257,114 +257,27 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "const": "macOS"
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "const": "windows"
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "const": "linux"
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "const": "android"
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "const": "iOS"
"iOS"
]
}
]
},
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "Enables the check_permissions command without any pre-configured scope.",
"type": "string",
"const": "allow-check-permissions",
"markdownDescription": "Enables the check_permissions command without any pre-configured scope."
},
{
"description": "Denies the check_permissions command without any pre-configured scope.",
"type": "string",
"const": "deny-check-permissions",
"markdownDescription": "Denies the check_permissions command without any pre-configured scope."
},
{
"description": "Enables the clear_permissions command without any pre-configured scope.",
"type": "string",
"const": "allow-clear-permissions",
"markdownDescription": "Enables the clear_permissions command without any pre-configured scope."
},
{
"description": "Denies the clear_permissions command without any pre-configured scope.",
"type": "string",
"const": "deny-clear-permissions",
"markdownDescription": "Denies the clear_permissions command without any pre-configured scope."
},
{
"description": "Enables the clear_watch command without any pre-configured scope.",
"type": "string",
"const": "allow-clear-watch",
"markdownDescription": "Enables the clear_watch command without any pre-configured scope."
},
{
"description": "Denies the clear_watch command without any pre-configured scope.",
"type": "string",
"const": "deny-clear-watch",
"markdownDescription": "Denies the clear_watch command without any pre-configured scope."
},
{
"description": "Enables the get_current_position command without any pre-configured scope.",
"type": "string",
"const": "allow-get-current-position",
"markdownDescription": "Enables the get_current_position command without any pre-configured scope."
},
{
"description": "Denies the get_current_position command without any pre-configured scope.",
"type": "string",
"const": "deny-get-current-position",
"markdownDescription": "Denies the get_current_position command without any pre-configured scope."
},
{
"description": "Enables the request_permissions command without any pre-configured scope.",
"type": "string",
"const": "allow-request-permissions",
"markdownDescription": "Enables the request_permissions command without any pre-configured scope."
},
{
"description": "Denies the request_permissions command without any pre-configured scope.",
"type": "string",
"const": "deny-request-permissions",
"markdownDescription": "Denies the request_permissions command without any pre-configured scope."
},
{
"description": "Enables the watch_position command without any pre-configured scope.",
"type": "string",
"const": "allow-watch-position",
"markdownDescription": "Enables the watch_position command without any pre-configured scope."
},
{
"description": "Denies the watch_position command without any pre-configured scope.",
"type": "string",
"const": "deny-watch-position",
"markdownDescription": "Denies the watch_position command without any pre-configured scope."
} }
] ]
} }
-3
View File
@@ -1,7 +1,4 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "guest-js"
},
"include": ["guest-js/*.ts"] "include": ["guest-js/*.ts"]
} }

Some files were not shown because too many files have changed in this diff Show More