mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-22 17:10:53 +02:00
Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 03afae6d72 | |||
| 57ac986453 | |||
| 2ed6d6c1de | |||
| cdfd462955 | |||
| d6e0b6bbb1 | |||
| 40ae0a7fa0 | |||
| edc52ea056 | |||
| a0d949d93e | |||
| 13c63af965 | |||
| cad301fcc1 | |||
| 254f222e0e | |||
| b1439be667 | |||
| d157387722 | |||
| 41f6274270 | |||
| f08980f123 | |||
| 78df86f810 | |||
| aecec42d5d | |||
| 0767dcbd5c | |||
| 4be7690085 | |||
| c2b3981248 | |||
| 0c23b8ecfe | |||
| 4350ca652d | |||
| 1953f00188 | |||
| 9883f396dc | |||
| d8645ab3e5 | |||
| cb863d57c6 | |||
| d67e4f8cdc | |||
| e571e0be9d | |||
| 83ac944abf | |||
| 0139c54d0e | |||
| cad34b73fa | |||
| c0d64bf7d9 | |||
| e919bab3eb | |||
| 95c9291cee | |||
| 114e902537 | |||
| 6972acdca6 | |||
| 8bbc7a0d1d | |||
| 2d013294ef | |||
| 5c7668b6bb | |||
| ec0540138b | |||
| b86e999beb | |||
| c463d8ab14 | |||
| 1bb7beb307 | |||
| 3412fa2741 | |||
| af81fdac98 | |||
| c1fd33b3a2 | |||
| 250857b7b7 | |||
| 964e13f124 | |||
| e6cdc9f52e | |||
| 9228419e13 | |||
| 04d92139c8 | |||
| 5260fc90b0 | |||
| ea5c70060b | |||
| d016a8ab1e |
@@ -1,5 +1,17 @@
|
|||||||
[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",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -33,20 +33,19 @@ jobs:
|
|||||||
audit-js:
|
audit-js:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- name: Cache pnpm modules
|
- name: Cache pnpm modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v6
|
||||||
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@v4
|
- uses: actions/setup-node@v7
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v6
|
||||||
with:
|
with:
|
||||||
version: 10.x.x
|
|
||||||
run_install: true
|
run_install: true
|
||||||
- name: audit
|
- name: audit
|
||||||
run: pnpm audit
|
run: pnpm audit
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
audit-rust:
|
audit-rust:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: rustsec/audit-check@v2
|
- uses: rustsec/audit-check@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: check change files end with .md
|
- name: check change files end with .md
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
packages: ${{ steps.filter.outputs.changes }}
|
packages: ${{ steps.filter.outputs.changes }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: dorny/paths-filter@v2
|
- uses: dorny/paths-filter@v2
|
||||||
id: filter
|
id: filter
|
||||||
with:
|
with:
|
||||||
@@ -153,21 +153,20 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Cache pnpm modules
|
- name: Cache pnpm modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v6
|
||||||
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@v4
|
- uses: actions/setup-node@v7
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v6
|
||||||
with:
|
with:
|
||||||
version: 10.x.x
|
|
||||||
run_install: true
|
run_install: true
|
||||||
|
|
||||||
- name: build api
|
- name: build api
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: dorny/paths-filter@v2
|
- uses: dorny/paths-filter@v2
|
||||||
id: filter
|
id: filter
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
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,18 +28,17 @@ jobs:
|
|||||||
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # required for use of git history
|
fetch-depth: 0 # required for use of git history
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v7
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v6
|
||||||
with:
|
with:
|
||||||
version: 10.x.x
|
|
||||||
run_install: true
|
run_install: true
|
||||||
|
|
||||||
- name: cargo login
|
- name: cargo login
|
||||||
@@ -74,7 +73,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@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # 7.0.7
|
uses: peter-evans/create-pull-request@v8.1.1
|
||||||
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 }})'
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: install Rust stable and rustfmt
|
- name: install Rust stable and rustfmt
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
@@ -25,20 +25,19 @@ jobs:
|
|||||||
prettier:
|
prettier:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- name: Cache pnpm modules
|
- name: Cache pnpm modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v6
|
||||||
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@v4
|
- uses: actions/setup-node@v7
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v6
|
||||||
with:
|
with:
|
||||||
version: 10.x.x
|
|
||||||
run_install: true
|
run_install: true
|
||||||
- run: pnpm format:check
|
- run: pnpm format:check
|
||||||
|
|
||||||
@@ -46,7 +45,7 @@ jobs:
|
|||||||
name: taplo (.toml files)
|
name: taplo (.toml files)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: install Rust stable
|
- name: install Rust stable
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|||||||
@@ -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@v4
|
- uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
|||||||
@@ -36,20 +36,19 @@ jobs:
|
|||||||
eslint:
|
eslint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- name: Cache pnpm modules
|
- name: Cache pnpm modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v6
|
||||||
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@v4
|
- uses: actions/setup-node@v7
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v6
|
||||||
with:
|
with:
|
||||||
version: 10.x.x
|
|
||||||
run_install: true
|
run_install: true
|
||||||
- name: eslint
|
- name: eslint
|
||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
packages: ${{ steps.filter.outputs.changes }}
|
packages: ${{ steps.filter.outputs.changes }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- 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@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: install webkit2gtk
|
- name: install webkit2gtk
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -19,26 +19,25 @@ jobs:
|
|||||||
sync-to-mirrors:
|
sync-to-mirrors:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- 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@v4
|
uses: actions/cache@v6
|
||||||
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@v4
|
- uses: actions/setup-node@v7
|
||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v6
|
||||||
with:
|
with:
|
||||||
version: 10.x.x
|
|
||||||
run_install: true
|
run_install: true
|
||||||
|
|
||||||
- name: Build packages
|
- name: Build packages
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
packages: ${{ steps.filter.outputs.changes }}
|
packages: ${{ steps.filter.outputs.changes }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- 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@v4
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: install webkit2gtk
|
- name: install webkit2gtk
|
||||||
if: contains(matrix.platform.target, 'unknown-linux')
|
if: contains(matrix.platform.target, 'unknown-linux')
|
||||||
|
|||||||
Generated
+356
-520
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -11,7 +11,7 @@ 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"
|
log = "0.4.21"
|
||||||
tauri = { version = "2.10", default-features = false }
|
tauri = { version = "2.10", default-features = false }
|
||||||
tauri-build = "2.5"
|
tauri-build = "2.5"
|
||||||
tauri-plugin = "2.5"
|
tauri-plugin = "2.5"
|
||||||
|
|||||||
@@ -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. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||||
|
|||||||
@@ -1,5 +1,35 @@
|
|||||||
# 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]
|
## \[2.0.38]
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en" theme="dark">
|
<html lang="en">
|
||||||
<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"
|
||||||
/>
|
/>
|
||||||
<title>Svelte + Vite App</title>
|
<meta name="color-scheme" content="dark light" />
|
||||||
|
<title>API Example App</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+22
-22
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "api",
|
"name": "api",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.0.38",
|
"version": "2.0.42",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --clearScreen false",
|
"dev": "vite --clearScreen false",
|
||||||
@@ -10,33 +10,33 @@
|
|||||||
"tauri": "tauri"
|
"tauri": "tauri"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1",
|
"@tauri-apps/api": "^2.11.0",
|
||||||
"@tauri-apps/plugin-barcode-scanner": "^2.4.4",
|
"@tauri-apps/plugin-barcode-scanner": "workspace:*",
|
||||||
"@tauri-apps/plugin-biometric": "^2.3.2",
|
"@tauri-apps/plugin-biometric": "workspace:*",
|
||||||
"@tauri-apps/plugin-cli": "^2.4.1",
|
"@tauri-apps/plugin-cli": "workspace:*",
|
||||||
"@tauri-apps/plugin-clipboard-manager": "^2.3.2",
|
"@tauri-apps/plugin-clipboard-manager": "workspace:*",
|
||||||
"@tauri-apps/plugin-dialog": "^2.7.0",
|
"@tauri-apps/plugin-dialog": "2",
|
||||||
"@tauri-apps/plugin-fs": "^2.5.0",
|
"@tauri-apps/plugin-fs": "workspace:*",
|
||||||
"@tauri-apps/plugin-geolocation": "^2.3.2",
|
"@tauri-apps/plugin-geolocation": "workspace:*",
|
||||||
"@tauri-apps/plugin-global-shortcut": "^2.3.1",
|
"@tauri-apps/plugin-global-shortcut": "workspace:*",
|
||||||
"@tauri-apps/plugin-haptics": "^2.3.2",
|
"@tauri-apps/plugin-haptics": "workspace:*",
|
||||||
"@tauri-apps/plugin-http": "^2.5.8",
|
"@tauri-apps/plugin-http": "workspace:*",
|
||||||
"@tauri-apps/plugin-nfc": "^2.3.5",
|
"@tauri-apps/plugin-nfc": "workspace:*",
|
||||||
"@tauri-apps/plugin-notification": "^2.3.3",
|
"@tauri-apps/plugin-notification": "workspace:*",
|
||||||
"@tauri-apps/plugin-opener": "^2.5.3",
|
"@tauri-apps/plugin-opener": "workspace:*",
|
||||||
"@tauri-apps/plugin-os": "^2.3.2",
|
"@tauri-apps/plugin-os": "workspace:*",
|
||||||
"@tauri-apps/plugin-process": "^2.3.1",
|
"@tauri-apps/plugin-process": "workspace:*",
|
||||||
"@tauri-apps/plugin-shell": "^2.3.5",
|
"@tauri-apps/plugin-shell": "workspace:*",
|
||||||
"@tauri-apps/plugin-store": "^2.4.2",
|
"@tauri-apps/plugin-store": "2",
|
||||||
"@tauri-apps/plugin-updater": "^2.10.1",
|
"@tauri-apps/plugin-updater": "workspace:*",
|
||||||
"@tauri-apps/plugin-upload": "^2.4.0",
|
"@tauri-apps/plugin-upload": "workspace:*",
|
||||||
"@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.49",
|
||||||
"@iconify-json/ph": "^1.2.2",
|
"@iconify-json/ph": "^1.2.2",
|
||||||
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
||||||
"@tauri-apps/cli": "2.10.1",
|
"@tauri-apps/cli": "2.11.4",
|
||||||
"@unocss/extractor-svelte": "^66.6.7",
|
"@unocss/extractor-svelte": "^66.6.7",
|
||||||
"svelte": "^5.54.0",
|
"svelte": "^5.54.0",
|
||||||
"unocss": "^66.6.7",
|
"unocss": "^66.6.7",
|
||||||
|
|||||||
@@ -1,5 +1,35 @@
|
|||||||
# 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]
|
## \[2.0.42]
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "api"
|
name = "api"
|
||||||
publish = false
|
publish = false
|
||||||
version = "2.0.42"
|
version = "2.0.46"
|
||||||
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,24 +20,24 @@ 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.8.0" }
|
tauri-plugin-log = { path = "../../../plugins/log", version = "2.9.0" }
|
||||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.5.0", features = [
|
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.5.1", 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.0" }
|
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.7.2" }
|
||||||
tauri-plugin-http = { path = "../../../plugins/http", features = [
|
tauri-plugin-http = { path = "../../../plugins/http", features = [
|
||||||
"multipart",
|
"multipart",
|
||||||
"cookies",
|
"cookies",
|
||||||
], version = "2.5.8" }
|
], version = "2.5.9" }
|
||||||
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.3" }
|
tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.4" }
|
||||||
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.2" }
|
tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.4" }
|
||||||
tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
|
tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
|
||||||
|
|
||||||
[dependencies.tauri]
|
[dependencies.tauri]
|
||||||
@@ -56,12 +56,12 @@ 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.1" }
|
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.2" }
|
||||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.10.1" }
|
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.10.1" }
|
||||||
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.4" }
|
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.4.5" }
|
||||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.5" }
|
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.5" }
|
||||||
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" }
|
||||||
|
|||||||
@@ -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-maximize",
|
"core:window:allow-toggle-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,3 +1,11 @@
|
|||||||
package com.tauri.api
|
package com.tauri.api
|
||||||
|
|
||||||
class MainActivity : TauriActivity()
|
import android.os.Bundle
|
||||||
|
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.MaterialComponents.DayNight.NoActionBar">
|
<style name="Theme.api" parent="Theme.Material3.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.MaterialComponents.DayNight.NoActionBar">
|
<style name="Theme.api" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
+17
-1
@@ -21,7 +21,23 @@ 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)) {
|
||||||
runTauriCli("$executable.cmd")
|
// Try different Windows-specific extensions
|
||||||
|
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
-1
@@ -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.9-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
+128
-195
@@ -1,7 +1,16 @@
|
|||||||
<script>
|
<script module lang="ts">
|
||||||
|
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 { getCurrentWindow } from '@tauri-apps/api/window'
|
import { MediaQuery } from 'svelte/reactivity'
|
||||||
|
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'
|
||||||
@@ -23,11 +32,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 { onMount, tick } from 'svelte'
|
|
||||||
import { ask } from '@tauri-apps/plugin-dialog'
|
|
||||||
import Nfc from './views/Nfc.svelte'
|
import Nfc from './views/Nfc.svelte'
|
||||||
|
|
||||||
|
import TitleBar from './lib/TitleBar.svelte'
|
||||||
|
|
||||||
const appWindow = getCurrentWindow()
|
const appWindow = getCurrentWindow()
|
||||||
|
|
||||||
if (appWindow.label !== 'main') {
|
if (appWindow.label !== 'main') {
|
||||||
@@ -148,114 +156,98 @@
|
|||||||
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])
|
||||||
|
|
||||||
let selected = views[0]
|
// dark/light themes
|
||||||
function select(view) {
|
const preferDark = new MediaQuery('prefers-color-scheme: dark')
|
||||||
selected = view
|
let theme = $state<Theme | 'auto'>(
|
||||||
}
|
(localStorage.getItem('theme') as Theme | null) || 'auto'
|
||||||
|
)
|
||||||
|
|
||||||
// Window controls
|
async function switchTheme() {
|
||||||
let isWindowMaximized
|
switch (theme) {
|
||||||
onMount(async () => {
|
case 'dark':
|
||||||
isWindowMaximized = await appWindow.isMaximized()
|
theme = 'light'
|
||||||
appWindow.onResized(async () => {
|
break
|
||||||
isWindowMaximized = await appWindow.isMaximized()
|
case 'light':
|
||||||
})
|
theme = 'auto'
|
||||||
})
|
break
|
||||||
|
case 'auto':
|
||||||
function minimize() {
|
theme = 'dark'
|
||||||
appWindow.minimize()
|
break
|
||||||
}
|
|
||||||
|
|
||||||
async function toggleMaximize() {
|
|
||||||
;(await appWindow.isMaximized())
|
|
||||||
? appWindow.unmaximize()
|
|
||||||
: appWindow.maximize()
|
|
||||||
}
|
|
||||||
|
|
||||||
let confirmed_close = false
|
|
||||||
async function close() {
|
|
||||||
if (!confirmed_close) {
|
|
||||||
confirmed_close = await ask(
|
|
||||||
'Are you sure that you want to close this window?',
|
|
||||||
{
|
|
||||||
title: 'Tauri API'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (confirmed_close) {
|
|
||||||
appWindow.close()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
applyTheme()
|
||||||
}
|
}
|
||||||
|
|
||||||
// dark/light
|
function applyTheme() {
|
||||||
let isDark
|
const isDark = theme === 'auto' ? preferDark.current : theme === 'dark'
|
||||||
onMount(() => {
|
if (isDark) {
|
||||||
isDark = localStorage && localStorage.getItem('theme') == 'dark'
|
document.documentElement.classList.add('dark')
|
||||||
applyTheme(isDark)
|
document.documentElement.classList.remove('light')
|
||||||
|
} else {
|
||||||
|
document.documentElement.classList.remove('dark')
|
||||||
|
document.documentElement.classList.add('light')
|
||||||
|
}
|
||||||
|
setTheme(theme === 'auto' ? null : theme)
|
||||||
|
localStorage.setItem('theme', theme)
|
||||||
|
}
|
||||||
|
|
||||||
|
$effect(() => {
|
||||||
|
applyTheme()
|
||||||
})
|
})
|
||||||
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
|
// Console
|
||||||
let messages = writable([])
|
const messages = writable<string[]>([])
|
||||||
let consoleTextEl
|
let consoleTextEl: HTMLDivElement
|
||||||
async function onMessage(value) {
|
|
||||||
|
// 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) => [
|
messages.update((r) => [
|
||||||
...r,
|
...r,
|
||||||
{
|
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ${html}</pre>`
|
||||||
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()
|
await tick()
|
||||||
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight
|
consoleTextEl.scrollTop = consoleTextEl.scrollHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
// this function renders HTML without sanitizing it so it's insecure
|
async function onMessage(value: unknown) {
|
||||||
// we only use it with our own input data
|
const valueStr =
|
||||||
async function insecureRenderHtml(html) {
|
typeof value === 'string'
|
||||||
messages.update((r) => [
|
? value
|
||||||
...r,
|
: JSON.stringify(
|
||||||
{
|
value instanceof ArrayBuffer
|
||||||
html:
|
? Array.from(new Uint8Array(value))
|
||||||
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` +
|
: value,
|
||||||
html +
|
null,
|
||||||
'</pre>'
|
1
|
||||||
}
|
)
|
||||||
])
|
insecureRenderHtml(valueStr)
|
||||||
await tick()
|
|
||||||
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
messages.update(() => [])
|
messages.update(() => [])
|
||||||
}
|
}
|
||||||
|
|
||||||
let consoleEl, consoleH, cStartY
|
let consoleEl: HTMLDivElement
|
||||||
let minConsoleHeight = 50
|
let consoleH = 0
|
||||||
function startResizingConsole(e) {
|
let cStartY = 0
|
||||||
|
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) => {
|
const moveHandler = (e: MouseEvent) => {
|
||||||
const dy = e.clientY - cStartY
|
const dy = e.clientY - cStartY
|
||||||
const newH = consoleH - dy
|
const newH = consoleH - dy
|
||||||
consoleEl.style.height = `${
|
consoleEl.style.height = `${newH < minConsoleHeight ? minConsoleHeight : newH}px`
|
||||||
newH < minConsoleHeight ? minConsoleHeight : newH
|
|
||||||
}px`
|
|
||||||
}
|
}
|
||||||
const upHandler = () => {
|
const upHandler = () => {
|
||||||
document.removeEventListener('mouseup', upHandler)
|
document.removeEventListener('mouseup', upHandler)
|
||||||
@@ -265,21 +257,19 @@
|
|||||||
document.addEventListener('mousemove', moveHandler)
|
document.addEventListener('mousemove', moveHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
let isWindows
|
let isWindows = os.platform() === 'windows'
|
||||||
onMount(async () => {
|
|
||||||
isWindows = (await os.platform()) === 'windows'
|
|
||||||
})
|
|
||||||
|
|
||||||
// mobile
|
// mobile
|
||||||
let isSideBarOpen = false
|
let isSideBarOpen = $state(false)
|
||||||
let sidebar
|
let sidebar: HTMLElement
|
||||||
let sidebarToggle
|
let sidebarToggle: HTMLElement
|
||||||
let isDraggingSideBar = false
|
let isDraggingSideBar = false
|
||||||
let draggingStartPosX = 0
|
let draggingStartPosX = 0
|
||||||
let draggingEndPosX = 0
|
let draggingEndPosX = 0
|
||||||
const clamp = (min, num, max) => Math.min(Math.max(num, min), max)
|
const clamp = (min: number, num: number, max: number) =>
|
||||||
|
Math.min(Math.max(num, min), max)
|
||||||
|
|
||||||
function toggleSidebar(sidebar, isSideBarOpen) {
|
function toggleSidebar() {
|
||||||
sidebar.style.setProperty(
|
sidebar.style.setProperty(
|
||||||
'--translate-x',
|
'--translate-x',
|
||||||
`${isSideBarOpen ? '0' : '-18.75'}rem`
|
`${isSideBarOpen ? '0' : '-18.75'}rem`
|
||||||
@@ -287,10 +277,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
sidebar = document.querySelector('#sidebar')
|
|
||||||
sidebarToggle = document.querySelector('#sidebarToggle')
|
|
||||||
|
|
||||||
document.addEventListener('click', (e) => {
|
document.addEventListener('click', (e) => {
|
||||||
|
if (!(e.target instanceof Node)) return
|
||||||
|
|
||||||
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)) {
|
||||||
@@ -299,6 +288,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
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
|
||||||
@@ -330,76 +320,22 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
$: {
|
$effect(() => {
|
||||||
const sidebar = document.querySelector('#sidebar')
|
toggleSidebar()
|
||||||
if (sidebar) {
|
})
|
||||||
toggleSidebar(sidebar, isSideBarOpen)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- custom titlebar for Windows -->
|
<!-- custom titlebar for Windows -->
|
||||||
{#if isWindows}
|
{#if isWindows}
|
||||||
<div
|
<TitleBar {appWindow} {theme} {switchTheme} />
|
||||||
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"
|
||||||
class="z-2000 sidebar-toggle hidden lt-sm:flex justify-center absolute items-center w-8 h-8 rd-8
|
bind:this={sidebarToggle}
|
||||||
bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"
|
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 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>
|
||||||
@@ -409,10 +345,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="flex h-screen w-screen overflow-hidden children-pt8 children-pb-2 text-primaryText dark:text-darkPrimaryText"
|
class="flex h-screen w-screen overflow-hidden 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"
|
||||||
>
|
>
|
||||||
@@ -420,13 +357,16 @@
|
|||||||
<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 h-8" on:click={toggleDark}>
|
<a href="##" class="nv justify-between" onclick={switchTheme}>
|
||||||
{#if isDark}
|
{#if theme === 'auto'}
|
||||||
Switch to Light mode
|
|
||||||
<div class="i-ph-sun"></div>
|
|
||||||
{:else}
|
|
||||||
Switch to Dark mode
|
Switch to Dark mode
|
||||||
|
<div class="i-ph-circle-half-fill"></div>
|
||||||
|
{:else if theme === 'dark'}
|
||||||
|
Switch to Light mode
|
||||||
<div class="i-ph-moon"></div>
|
<div class="i-ph-moon"></div>
|
||||||
|
{:else if theme === 'light'}
|
||||||
|
Switch to Auto mode
|
||||||
|
<div class="i-ph-sun"></div>
|
||||||
{/if}
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
<br />
|
<br />
|
||||||
@@ -435,7 +375,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<a
|
<a
|
||||||
class="nv justify-between h-8"
|
class="nv justify-between"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href="https://tauri.app/v1/guides/"
|
href="https://tauri.app/v1/guides/"
|
||||||
>
|
>
|
||||||
@@ -443,7 +383,7 @@
|
|||||||
<span class="i-codicon-link-external"></span>
|
<span class="i-codicon-link-external"></span>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
class="nv justify-between h-8"
|
class="nv justify-between"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href="https://github.com/tauri-apps/tauri"
|
href="https://github.com/tauri-apps/tauri"
|
||||||
>
|
>
|
||||||
@@ -451,7 +391,7 @@
|
|||||||
<span class="i-codicon-link-external"></span>
|
<span class="i-codicon-link-external"></span>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
class="nv justify-between h-8"
|
class="nv justify-between"
|
||||||
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"
|
||||||
>
|
>
|
||||||
@@ -461,23 +401,19 @@
|
|||||||
<br />
|
<br />
|
||||||
<div class="bg-white/5 h-2px"></div>
|
<div class="bg-white/5 h-2px"></div>
|
||||||
<br />
|
<br />
|
||||||
<div
|
<div class="flex flex-col overflow-y-auto children-flex-none gap-1">
|
||||||
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>
|
||||||
@@ -489,11 +425,7 @@
|
|||||||
<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">
|
||||||
<svelte:component
|
<selected.component {onMessage} />
|
||||||
this={selected.component}
|
|
||||||
{onMessage}
|
|
||||||
{insecureRenderHtml}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -503,20 +435,21 @@
|
|||||||
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
|
||||||
on:mousedown={startResizingConsole}
|
role="button"
|
||||||
|
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 bg-inherit
|
class="cursor-pointer h-85% rd-1 p-1 flex justify-center items-center border-none
|
||||||
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
|
||||||
"
|
"
|
||||||
on:click={clear}
|
onclick={clear}
|
||||||
>
|
>
|
||||||
<div class="i-codicon-clear-all"></div>
|
<div class="i-codicon-clear-all"></div>
|
||||||
</button>
|
</button>
|
||||||
@@ -525,8 +458,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 r}
|
{#each $messages as messageHtml}
|
||||||
{@html r.html}
|
{@html messageHtml}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
: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;
|
||||||
@@ -8,6 +19,11 @@
|
|||||||
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;
|
||||||
@@ -33,27 +49,34 @@ code.code-block {
|
|||||||
width: 18.75rem;
|
width: 18.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 640px) {
|
@media screen and (width < 640px) {
|
||||||
#sidebar {
|
#sidebar {
|
||||||
--translate-x: -18.75rem;
|
--translate-x: -18.75rem;
|
||||||
transform: translateX(var(--translate-x));
|
transform: translateX(var(--translate-x));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-toggle {
|
#sidebar,
|
||||||
margin-top: 0.5rem;
|
main {
|
||||||
margin-left: 0.5rem;
|
padding-top: calc(env(safe-area-inset-top) + 2rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
#sidebar {
|
||||||
overflow: hidden;
|
padding-left: calc(env(safe-area-inset-left) + 0.5rem);
|
||||||
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) + 24px);
|
padding-bottom: calc(env(safe-area-inset-bottom) + 1.5rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.transparent {
|
.transparent {
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<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>
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
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() {
|
||||||
@@ -41,7 +40,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
|
||||||
insecureRenderHtml('<img src="' + src + '"></img>')
|
onMessage('<img src="' + src + '"></img>')
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
|||||||
@@ -1,129 +1,138 @@
|
|||||||
<script>
|
<script lang="ts">
|
||||||
import { open, save, confirm, message } from "@tauri-apps/plugin-dialog";
|
import {
|
||||||
import { readFile } from "@tauri-apps/plugin-fs";
|
open,
|
||||||
|
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'
|
||||||
|
|
||||||
export let onMessage;
|
let { onMessage }: ViewProps = $props()
|
||||||
export let insecureRenderHtml;
|
|
||||||
let defaultPath = null;
|
|
||||||
let filter = null;
|
|
||||||
let multiple = false;
|
|
||||||
let directory = false;
|
|
||||||
let pickerMode = "document";
|
|
||||||
let fileAccessMode = "scoped";
|
|
||||||
|
|
||||||
function arrayBufferToBase64(buffer, callback) {
|
let defaultPath: string | undefined = $state()
|
||||||
|
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;
|
var dataurl = evt.target!.result as string
|
||||||
callback(dataurl.substr(dataurl.indexOf(",") + 1));
|
callback(dataurl.split(',')[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(result) {
|
async function msgCustom() {
|
||||||
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 {
|
||||||
var result = await open({
|
const 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 {
|
||||||
var pathToRead = result;
|
const pathToRead = result
|
||||||
var isFile = pathToRead.match(/\S+\.\S+$/g);
|
const isFile = pathToRead.match(/\S+\.\S+$/g)
|
||||||
|
|
||||||
await readFile(pathToRead)
|
await readFile(pathToRead).then(function (res) {
|
||||||
.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 {
|
|
||||||
// Convert byte array to UTF-8 string
|
|
||||||
const decoder = new TextDecoder('utf-8');
|
|
||||||
const text = decoder.decode(new Uint8Array(res));
|
|
||||||
onMessage(text);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
onMessage(res);
|
// Convert byte array to UTF-8 string
|
||||||
|
const decoder = new TextDecoder('utf-8')
|
||||||
|
const text = decoder.decode(res)
|
||||||
|
onMessage(text)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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>
|
||||||
|
|
||||||
@@ -171,15 +180,16 @@
|
|||||||
<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" on:click={openDialog}>Open dialog</button>
|
<button class="btn" id="open-dialog" onclick={openDialog}>Open dialog</button>
|
||||||
<button class="btn" id="save-dialog" on:click={saveDialog}
|
<button class="btn" id="save-dialog" onclick={saveDialog}
|
||||||
>Open save dialog</button
|
>Open save dialog</button
|
||||||
>
|
>
|
||||||
<button class="btn" id="prompt-dialog" on:click={prompt}>Prompt</button>
|
<button class="btn" id="prompt-dialog" onclick={prompt}>Prompt</button>
|
||||||
<button class="btn" id="custom-prompt-dialog" on:click={promptCustom}
|
<button class="btn" id="custom-prompt-dialog" onclick={promptCustom}
|
||||||
>Prompt (custom)</button
|
>Prompt (custom)</button
|
||||||
>
|
>
|
||||||
<button class="btn" id="message-dialog" on:click={msg}>Message</button>
|
<button class="btn" id="message-dialog" onclick={msg}>Message</button>
|
||||||
<button class="btn" id="message-dialog" on:click={msgCustom}>Message (custom)</button>
|
<button class="btn" id="message-dialog" onclick={msgCustom}
|
||||||
|
>Message (custom)</button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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, insecureRenderHtml } = $props()
|
const { onMessage } = $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
|
||||||
insecureRenderHtml('<img src="' + src + '"></img>')
|
onMessage('<img src="' + src + '"></img>')
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
const value = String.fromCharCode.apply(null, response)
|
const value = String.fromCharCode.apply(null, response)
|
||||||
insecureRenderHtml(
|
onMessage(
|
||||||
'<textarea id="file-response"></textarea><button id="file-save">Save</button>'
|
'<textarea id="file-response"></textarea><button id="file-save">Save</button>'
|
||||||
)
|
)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
+7
-17
@@ -15,25 +15,15 @@
|
|||||||
"@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.1.0",
|
"eslint": "10.4.0",
|
||||||
"eslint-config-prettier": "10.1.8",
|
"eslint-config-prettier": "10.1.8",
|
||||||
"eslint-plugin-security": "4.0.0",
|
"eslint-plugin-security": "4.0.1",
|
||||||
"prettier": "3.8.1",
|
"prettier": "3.8.3",
|
||||||
"rollup": "4.59.0",
|
"rollup": "4.60.3",
|
||||||
"tslib": "2.8.1",
|
"tslib": "2.8.1",
|
||||||
"typescript": "5.9.3",
|
"typescript": "6.0.3",
|
||||||
"typescript-eslint": "8.57.1"
|
"typescript-eslint": "8.58.2"
|
||||||
},
|
},
|
||||||
"minimumReleaseAge": 4320,
|
"minimumReleaseAge": 4320,
|
||||||
"pnpm": {
|
"packageManager": "pnpm@11.13.0"
|
||||||
"overrides": {
|
|
||||||
"esbuild@<0.25.0": ">=0.25.0"
|
|
||||||
},
|
|
||||||
"onlyBuiltDependencies": [
|
|
||||||
"esbuild"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"pnpm": "^10.16.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# 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.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-barcode-scanner"
|
name = "tauri-plugin-barcode-scanner"
|
||||||
version = "2.4.4"
|
version = "2.4.5"
|
||||||
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 }
|
||||||
|
|||||||
@@ -337,10 +337,11 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc private func cancel(_ invoke: Invoke) {
|
@objc private func cancel(_ invoke: Invoke) {
|
||||||
self.invoke?.reject("cancelled")
|
DispatchQueue.main.async { [self] in
|
||||||
|
self.invoke?.reject("cancelled")
|
||||||
destroy()
|
self.destroy()
|
||||||
invoke.resolve()
|
invoke.resolve()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tauri-apps/plugin-barcode-scanner",
|
"name": "@tauri-apps/plugin-barcode-scanner",
|
||||||
"version": "2.4.4",
|
"version": "2.4.5",
|
||||||
"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.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,6 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# 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]
|
## \[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.
|
- [`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.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-deep-link"
|
name = "tauri-plugin-deep-link"
|
||||||
version = "2.4.8"
|
version = "2.4.9"
|
||||||
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 }
|
||||||
|
|||||||
@@ -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.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.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__})}
|
||||||
|
|||||||
@@ -139,7 +139,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,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## \[2.2.12]
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
- Upgraded to `deep-link-js@2.4.9`
|
||||||
|
|
||||||
## \[2.2.11]
|
## \[2.2.11]
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "deep-link-example",
|
"name": "deep-link-example",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.2.11",
|
"version": "2.2.12",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -10,12 +10,12 @@
|
|||||||
"tauri": "tauri"
|
"tauri": "tauri"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1",
|
"@tauri-apps/api": "^2.11.0",
|
||||||
"@tauri-apps/plugin-deep-link": "2.4.8"
|
"@tauri-apps/plugin-deep-link": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "2.10.1",
|
"@tauri-apps/cli": "2.11.4",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^6.0.0",
|
||||||
"vite": "^8.0.1"
|
"vite": "^8.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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.MaterialComponents.DayNight.NoActionBar">
|
<style name="Theme.deep_link_example" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
+1
-1
@@ -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.MaterialComponents.DayNight.NoActionBar">
|
<style name="Theme.deep_link_example" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tauri-apps/plugin-deep-link",
|
"name": "@tauri-apps/plugin-deep-link",
|
||||||
"version": "2.4.8",
|
"version": "2.4.9",
|
||||||
"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.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "2.10.1"
|
"@tauri-apps/cli": "2.11.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
# 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]
|
## \[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`
|
- [`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`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-dialog"
|
name = "tauri-plugin-dialog"
|
||||||
version = "2.7.0"
|
version = "2.7.2"
|
||||||
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 }
|
||||||
@@ -37,7 +37,7 @@ 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.0" }
|
tauri-plugin-fs = { path = "../fs", version = "2.5.1" }
|
||||||
|
|
||||||
[target.'cfg(target_os = "ios")'.dependencies]
|
[target.'cfg(target_os = "ios")'.dependencies]
|
||||||
tauri = { workspace = true, features = ["wry"] }
|
tauri = { workspace = true, features = ["wry"] }
|
||||||
|
|||||||
@@ -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.6.0")
|
implementation("androidx.appcompat:appcompat:1.7.1")
|
||||||
implementation("com.google.android.material:material:1.7.0")
|
implementation("com.google.android.material:material:1.13.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,7 +5,6 @@
|
|||||||
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
|
||||||
@@ -21,6 +20,7 @@ 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 = AlertDialog.Builder(activity)
|
val builder = MaterialAlertDialogBuilder(activity)
|
||||||
|
|
||||||
if (args.title != null) {
|
if (args.title != null) {
|
||||||
builder.setTitle(args.title)
|
builder.setTitle(args.title)
|
||||||
@@ -191,8 +191,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val dialog = builder.create()
|
builder.show()
|
||||||
dialog.show()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tauri-apps/plugin-dialog",
|
"name": "@tauri-apps/plugin-dialog",
|
||||||
"version": "2.7.0",
|
"version": "2.7.2",
|
||||||
"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.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# 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]
|
## \[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`
|
- [`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`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-fs"
|
name = "tauri-plugin-fs"
|
||||||
version = "2.5.0"
|
version = "2.5.1"
|
||||||
description = "Access the file system."
|
description = "Access the file system."
|
||||||
authors = { workspace = true }
|
authors = { workspace = true }
|
||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
@@ -20,7 +20,7 @@ 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 = "0.9"
|
toml = "1.0"
|
||||||
tauri-utils = { workspace = true }
|
tauri-utils = { workspace = true }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tauri-apps/plugin-fs",
|
"name": "@tauri-apps/plugin-fs",
|
||||||
"version": "2.5.0",
|
"version": "2.5.1",
|
||||||
"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.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 wether we finished iteration or not (1 or 0)
|
// This is an optimization to include whether 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() {
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## \[2.3.2]
|
||||||
|
|
||||||
|
- [`cb863d57`](https://github.com/tauri-apps/plugins-workspace/commit/cb863d57c60790efc41b2bd77d065bd91b4ef2b1) ([#3408](https://github.com/tauri-apps/plugins-workspace/pull/3408) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update crate `global-hotkey` to 0.8 to fix cpu usage while pressing the keys on windows and to add F13-F24 mappings on Linux/X11.
|
||||||
|
|
||||||
## \[2.3.1]
|
## \[2.3.1]
|
||||||
|
|
||||||
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-global-shortcut"
|
name = "tauri-plugin-global-shortcut"
|
||||||
version = "2.3.1"
|
version = "2.3.2"
|
||||||
description = "Register global hotkeys listeners on your Tauri application."
|
description = "Register global hotkeys listeners on your Tauri application."
|
||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
authors = { workspace = true }
|
authors = { workspace = true }
|
||||||
@@ -27,4 +27,4 @@ log = { workspace = true }
|
|||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
|
||||||
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
|
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
|
||||||
global-hotkey = { version = "0.7", features = ["serde"] }
|
global-hotkey = { version = "0.8", features = ["serde"] }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tauri-apps/plugin-global-shortcut",
|
"name": "@tauri-apps/plugin-global-shortcut",
|
||||||
"version": "2.3.1",
|
"version": "2.3.2",
|
||||||
"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.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
if("__TAURI__"in window){var __TAURI_PLUGIN_HAPTICS__=function(r){"use strict";async function t(r,t={},e){return window.__TAURI_INTERNALS__.invoke(r,t,e)}var e;"function"==typeof SuppressedError&&SuppressedError,function(r){r.WINDOW_RESIZED="tauri://resize",r.WINDOW_MOVED="tauri://move",r.WINDOW_CLOSE_REQUESTED="tauri://close-requested",r.WINDOW_DESTROYED="tauri://destroyed",r.WINDOW_FOCUS="tauri://focus",r.WINDOW_BLUR="tauri://blur",r.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",r.WINDOW_THEME_CHANGED="tauri://theme-changed",r.WINDOW_CREATED="tauri://window-created",r.WEBVIEW_CREATED="tauri://webview-created",r.DRAG_ENTER="tauri://drag-enter",r.DRAG_OVER="tauri://drag-over",r.DRAG_DROP="tauri://drag-drop",r.DRAG_LEAVE="tauri://drag-leave"}(e||(e={}));const a={async vibrate(r){try{return{status:"ok",data:await t("plugin:haptics|vibrate",{duration:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async impactFeedback(r){try{return{status:"ok",data:await t("plugin:haptics|impact_feedback",{style:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async notificationFeedback(r){try{return{status:"ok",data:await t("plugin:haptics|notification_feedback",{type:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async selectionFeedback(){try{return{status:"ok",data:await t("plugin:haptics|selection_feedback")}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}}},{vibrate:i,impactFeedback:c,notificationFeedback:n,selectionFeedback:o}=a;return r.impactFeedback=c,r.notificationFeedback=n,r.selectionFeedback=o,r.vibrate=i,r}({});Object.defineProperty(window.__TAURI__,"haptics",{value:__TAURI_PLUGIN_HAPTICS__})}
|
if("__TAURI__"in window){var __TAURI_PLUGIN_HAPTICS__=function(r){"use strict";async function t(r,t={},e){return window.__TAURI_INTERNALS__.invoke(r,t,e)}var e;"function"==typeof SuppressedError&&SuppressedError,function(r){r.WINDOW_RESIZED="tauri://resize",r.WINDOW_MOVED="tauri://move",r.WINDOW_CLOSE_REQUESTED="tauri://close-requested",r.WINDOW_DESTROYED="tauri://destroyed",r.WINDOW_FOCUS="tauri://focus",r.WINDOW_BLUR="tauri://blur",r.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",r.WINDOW_THEME_CHANGED="tauri://theme-changed",r.WINDOW_CREATED="tauri://window-created",r.WINDOW_SUSPENDED="tauri://suspended",r.WINDOW_RESUMED="tauri://resumed",r.WEBVIEW_CREATED="tauri://webview-created",r.DRAG_ENTER="tauri://drag-enter",r.DRAG_OVER="tauri://drag-over",r.DRAG_DROP="tauri://drag-drop",r.DRAG_LEAVE="tauri://drag-leave"}(e||(e={}));const a={async vibrate(r){try{return{status:"ok",data:await t("plugin:haptics|vibrate",{duration:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async impactFeedback(r){try{return{status:"ok",data:await t("plugin:haptics|impact_feedback",{style:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async notificationFeedback(r){try{return{status:"ok",data:await t("plugin:haptics|notification_feedback",{type:r})}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}},async selectionFeedback(){try{return{status:"ok",data:await t("plugin:haptics|selection_feedback")}}catch(r){if(r instanceof Error)throw r;return{status:"error",error:r}}}},{vibrate:i,impactFeedback:c,notificationFeedback:n,selectionFeedback:o}=a;return r.impactFeedback=c,r.notificationFeedback=n,r.selectionFeedback=o,r.vibrate=i,r}({});Object.defineProperty(window.__TAURI__,"haptics",{value:__TAURI_PLUGIN_HAPTICS__})}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## \[2.5.9]
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
- Upgraded to `fs-js@2.5.1`
|
||||||
|
|
||||||
## \[2.5.8]
|
## \[2.5.8]
|
||||||
|
|
||||||
- [`29712892`](https://github.com/tauri-apps/plugins-workspace/commit/29712892526cfc2d35c9002e0a56925084ae1b73) ([#3252](https://github.com/tauri-apps/plugins-workspace/pull/3252) by [@NVolcz](https://github.com/tauri-apps/plugins-workspace/../../NVolcz)) Correct Response header initialization to support cloning and ensure Set-Cookie visibility.
|
- [`29712892`](https://github.com/tauri-apps/plugins-workspace/commit/29712892526cfc2d35c9002e0a56925084ae1b73) ([#3252](https://github.com/tauri-apps/plugins-workspace/pull/3252) by [@NVolcz](https://github.com/tauri-apps/plugins-workspace/../../NVolcz)) Correct Response header initialization to support cloning and ensure Set-Cookie visibility.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-http"
|
name = "tauri-plugin-http"
|
||||||
version = "2.5.8"
|
version = "2.5.9"
|
||||||
description = "Access an HTTP client written in Rust."
|
description = "Access an HTTP client written in Rust."
|
||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
authors = { workspace = true }
|
authors = { workspace = true }
|
||||||
@@ -30,7 +30,7 @@ serde_json = { workspace = true }
|
|||||||
tauri = { workspace = true }
|
tauri = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
tokio = { version = "1", features = ["sync", "macros"] }
|
tokio = { version = "1", features = ["sync", "macros"] }
|
||||||
tauri-plugin-fs = { path = "../fs", version = "2.5.0" }
|
tauri-plugin-fs = { path = "../fs", version = "2.5.1" }
|
||||||
urlpattern = "0.3"
|
urlpattern = "0.3"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
http = "1"
|
http = "1"
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ Afterwards all the plugin's APIs are available through the JavaScript guest bind
|
|||||||
import { fetch } from '@tauri-apps/plugin-http'
|
import { fetch } from '@tauri-apps/plugin-http'
|
||||||
const response = await fetch('http://localhost:3003/users/2', {
|
const response = await fetch('http://localhost:3003/users/2', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
timeout: 30
|
connectTimeout: 30
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tauri-apps/plugin-http",
|
"name": "@tauri-apps/plugin-http",
|
||||||
"version": "2.5.8",
|
"version": "2.5.9",
|
||||||
"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.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## \[2.9.0]
|
||||||
|
|
||||||
|
- [`f08980f1`](https://github.com/tauri-apps/plugins-workspace/commit/f08980f123f191b9505bd290acd8fff0fdefeed9) ([#3445](https://github.com/tauri-apps/plugins-workspace/pull/3445) by [@bajoca05](https://github.com/tauri-apps/plugins-workspace/../../bajoca05)) Added the `FileOpenStrategy` for log rotation. It defaults to append into existing file if any (previous behaviour), and brings a new feature to create a new file per session: `FileOpenStrategy::Rotate`.
|
||||||
|
- [`254f222e`](https://github.com/tauri-apps/plugins-workspace/commit/254f222e0e2bc79370f977855b6b39d956d3b568) ([#3477](https://github.com/tauri-apps/plugins-workspace/pull/3477) by [@bajoca05](https://github.com/tauri-apps/plugins-workspace/../../bajoca05)) Migrated from the `log` crate's `kv_unstable` feature flag to the `kv` feature flag stabilized in `0.4.21`.
|
||||||
|
- [`0c23b8ec`](https://github.com/tauri-apps/plugins-workspace/commit/0c23b8ecfe7c2aca582a81ab7339b11e350b3cac) ([#3446](https://github.com/tauri-apps/plugins-workspace/pull/3446) by [@fee1-dead](https://github.com/tauri-apps/plugins-workspace/../../fee1-dead)) Removed an unused dependency `byte-unit`.
|
||||||
|
|
||||||
## \[2.8.0]
|
## \[2.8.0]
|
||||||
|
|
||||||
- [`2a625adf`](https://github.com/tauri-apps/plugins-workspace/commit/2a625adff30238904035b86b6e2db7595597e857) ([#3065](https://github.com/tauri-apps/plugins-workspace/pull/3065) by [@BinaryMuse](https://github.com/tauri-apps/plugins-workspace/../../BinaryMuse)) Allow specifying a log formatter per target using the `format` method on `Target`.
|
- [`2a625adf`](https://github.com/tauri-apps/plugins-workspace/commit/2a625adff30238904035b86b6e2db7595597e857) ([#3065](https://github.com/tauri-apps/plugins-workspace/pull/3065) by [@BinaryMuse](https://github.com/tauri-apps/plugins-workspace/../../BinaryMuse)) Allow specifying a log formatter per target using the `format` method on `Target`.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-log"
|
name = "tauri-plugin-log"
|
||||||
version = "2.8.0"
|
version = "2.9.0"
|
||||||
description = "Configurable logging for your Tauri app."
|
description = "Configurable logging for your Tauri app."
|
||||||
authors = { workspace = true }
|
authors = { workspace = true }
|
||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
@@ -25,8 +25,7 @@ serde_json = { workspace = true }
|
|||||||
tauri = { workspace = true }
|
tauri = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
serde_repr = "0.1"
|
serde_repr = "0.1"
|
||||||
byte-unit = "5"
|
log = { workspace = true, features = ["kv"] }
|
||||||
log = { workspace = true, features = ["kv_unstable"] }
|
|
||||||
time = { version = "0.3", features = [
|
time = { version = "0.3", features = [
|
||||||
"formatting",
|
"formatting",
|
||||||
"local-offset",
|
"local-offset",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
if("__TAURI__"in window){var __TAURI_PLUGIN_LOG__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var a,t;async function o(e,a,t){const o={kind:"Any"};return r("plugin:event|listen",{event:e,target:o,handler:n(a)}).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))}async function i(e,n,a){const t=function(e){if(e){if(!e.startsWith("Error")){const n=e.split("\n").map(e=>e.split("@")).filter(([e,n])=>e.length>0&&"[native code]"!==n);return n[2]?.filter(e=>e.length>0).join("@")}{const n=e.split("\n"),r=n[3]?.trim();if(!r)return;const a=/at\s+(?<functionName>.*?)\s+\((?<fileName>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+)\)/,t=r.match(a);if(t){const{functionName:e,fileName:n,lineNumber:r,columnNumber:a}=t.groups;return`${e}@${n}:${r}:${a}`}{const e=/at\s+(?<fileName>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+)/,n=r.match(e);if(n){const{fileName:e,lineNumber:r,columnNumber:a}=n.groups;return`<anonymous>@${e}:${r}:${a}`}}}}}((new Error).stack),{file:o,line:i,keyValues:u}=a??{};await r("plugin:log|log",{level:e,message:n,location:t,file:o,line:i,keyValues:u})}async function u(e){return await o("log://log",n=>{const{level:r}=n.payload;let{message:a}=n.payload;a=a.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),e({message:a,level:r})})}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.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"}(a||(a={})),e.LogLevel=void 0,(t=e.LogLevel||(e.LogLevel={}))[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warn=4]="Warn",t[t.Error=5]="Error",e.attachConsole=async function(){return await u(({level:n,message:r})=>{switch(n){case e.LogLevel.Trace:console.log(r);break;case e.LogLevel.Debug:console.debug(r);break;case e.LogLevel.Info:console.info(r);break;case e.LogLevel.Warn:console.warn(r);break;case e.LogLevel.Error:console.error(r);break;default:throw new Error(`unknown log level ${n}`)}})},e.attachLogger=u,e.debug=async function(n,r){await i(e.LogLevel.Debug,n,r)},e.error=async function(n,r){await i(e.LogLevel.Error,n,r)},e.info=async function(n,r){await i(e.LogLevel.Info,n,r)},e.trace=async function(n,r){await i(e.LogLevel.Trace,n,r)},e.warn=async function(n,r){await i(e.LogLevel.Warn,n,r)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})}
|
if("__TAURI__"in window){var __TAURI_PLUGIN_LOG__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var a,t;async function o(e,a,t){const o={kind:"Any"};return r("plugin:event|listen",{event:e,target:o,handler:n(a)}).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))}async function i(e,n,a){const t=function(e){if(e){if(!e.startsWith("Error")){const n=e.split("\n").map(e=>e.split("@")).filter(([e,n])=>e.length>0&&"[native code]"!==n);return n[2]?.filter(e=>e.length>0).join("@")}{const n=e.split("\n"),r=n[3]?.trim();if(!r)return;const a=/at\s+(?<functionName>.*?)\s+\((?<fileName>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+)\)/,t=r.match(a);if(t){const{functionName:e,fileName:n,lineNumber:r,columnNumber:a}=t.groups;return`${e}@${n}:${r}:${a}`}{const e=/at\s+(?<fileName>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+)/,n=r.match(e);if(n){const{fileName:e,lineNumber:r,columnNumber:a}=n.groups;return`<anonymous>@${e}:${r}:${a}`}}}}}((new Error).stack),{file:o,line:i,keyValues:u}=a??{};await r("plugin:log|log",{level:e,message:n,location:t,file:o,line:i,keyValues:u})}async function u(e){return await o("log://log",n=>{const{level:r}=n.payload;let{message:a}=n.payload;a=a.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),e({message:a,level:r})})}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.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"}(a||(a={})),e.LogLevel=void 0,(t=e.LogLevel||(e.LogLevel={}))[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warn=4]="Warn",t[t.Error=5]="Error",e.attachConsole=async function(){return await u(({level:n,message:r})=>{switch(n){case e.LogLevel.Trace:console.log(r);break;case e.LogLevel.Debug:console.debug(r);break;case e.LogLevel.Info:console.info(r);break;case e.LogLevel.Warn:console.warn(r);break;case e.LogLevel.Error:console.error(r);break;default:throw new Error(`unknown log level ${n}`)}})},e.attachLogger=u,e.debug=async function(n,r){await i(e.LogLevel.Debug,n,r)},e.error=async function(n,r){await i(e.LogLevel.Error,n,r)},e.info=async function(n,r){await i(e.LogLevel.Info,n,r)},e.trace=async function(n,r){await i(e.LogLevel.Trace,n,r)},e.warn=async function(n,r){await i(e.LogLevel.Warn,n,r)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tauri-apps/plugin-log",
|
"name": "@tauri-apps/plugin-log",
|
||||||
"version": "2.8.0",
|
"version": "2.9.0",
|
||||||
"description": "Configurable logging for your Tauri app.",
|
"description": "Configurable logging for your Tauri app.",
|
||||||
"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.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+152
-4
@@ -43,9 +43,10 @@ mod ios {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_MAX_FILE_SIZE: u64 = 40000;
|
const DEFAULT_MAX_FILE_SIZE: u64 = 40_000;
|
||||||
const DEFAULT_ROTATION_STRATEGY: RotationStrategy = RotationStrategy::KeepOne;
|
const DEFAULT_ROTATION_STRATEGY: RotationStrategy = RotationStrategy::KeepOne;
|
||||||
const DEFAULT_TIMEZONE_STRATEGY: TimezoneStrategy = TimezoneStrategy::UseUtc;
|
const DEFAULT_TIMEZONE_STRATEGY: TimezoneStrategy = TimezoneStrategy::UseUtc;
|
||||||
|
const DEFAULT_FILE_OPEN_STRATEGY: FileOpenStrategy = FileOpenStrategy::Append;
|
||||||
const DEFAULT_LOG_TARGETS: [Target; 2] = [
|
const DEFAULT_LOG_TARGETS: [Target; 2] = [
|
||||||
Target::new(TargetKind::Stdout),
|
Target::new(TargetKind::Stdout),
|
||||||
Target::new(TargetKind::LogDir { file_name: None }),
|
Target::new(TargetKind::LogDir { file_name: None }),
|
||||||
@@ -146,15 +147,26 @@ impl TimezoneStrategy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
pub enum FileOpenStrategy {
|
||||||
|
/// Open existing file from last session and append, if any.
|
||||||
|
Append,
|
||||||
|
/// Create a new file on each session start, rotating the last session if any.
|
||||||
|
Rotate,
|
||||||
|
}
|
||||||
|
|
||||||
/// A custom log writer that rotates the log file when it exceeds specified size.
|
/// A custom log writer that rotates the log file when it exceeds specified size.
|
||||||
struct RotatingFile {
|
struct RotatingFile {
|
||||||
dir: PathBuf,
|
dir: PathBuf,
|
||||||
file_name: String,
|
file_name: String,
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
|
/// Maximum file size before rotating in bytes
|
||||||
max_size: u64,
|
max_size: u64,
|
||||||
|
/// Current file size in bytes
|
||||||
current_size: u64,
|
current_size: u64,
|
||||||
rotation_strategy: RotationStrategy,
|
rotation_strategy: RotationStrategy,
|
||||||
timezone_strategy: TimezoneStrategy,
|
timezone_strategy: TimezoneStrategy,
|
||||||
|
file_open_strategy: FileOpenStrategy,
|
||||||
inner: Option<File>,
|
inner: Option<File>,
|
||||||
buffer: Vec<u8>,
|
buffer: Vec<u8>,
|
||||||
}
|
}
|
||||||
@@ -166,6 +178,7 @@ impl RotatingFile {
|
|||||||
max_size: u64,
|
max_size: u64,
|
||||||
rotation_strategy: RotationStrategy,
|
rotation_strategy: RotationStrategy,
|
||||||
timezone_strategy: TimezoneStrategy,
|
timezone_strategy: TimezoneStrategy,
|
||||||
|
file_open_strategy: FileOpenStrategy,
|
||||||
) -> Result<Self, Error> {
|
) -> Result<Self, Error> {
|
||||||
let dir = dir.as_ref().to_path_buf();
|
let dir = dir.as_ref().to_path_buf();
|
||||||
let path = dir.join(&file_name).with_extension("log");
|
let path = dir.join(&file_name).with_extension("log");
|
||||||
@@ -178,12 +191,15 @@ impl RotatingFile {
|
|||||||
current_size: 0,
|
current_size: 0,
|
||||||
rotation_strategy,
|
rotation_strategy,
|
||||||
timezone_strategy,
|
timezone_strategy,
|
||||||
|
file_open_strategy,
|
||||||
inner: None,
|
inner: None,
|
||||||
buffer: Vec::new(),
|
buffer: Vec::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
rotator.open_file()?;
|
rotator.open_file()?;
|
||||||
if rotator.current_size >= rotator.max_size {
|
if rotator.current_size >= rotator.max_size
|
||||||
|
|| (rotator.current_size > 0 && rotator.file_open_strategy == FileOpenStrategy::Rotate)
|
||||||
|
{
|
||||||
rotator.rotate()?;
|
rotator.rotate()?;
|
||||||
}
|
}
|
||||||
if let RotationStrategy::KeepSome(keep_count) = rotator.rotation_strategy {
|
if let RotationStrategy::KeepSome(keep_count) = rotator.rotation_strategy {
|
||||||
@@ -396,6 +412,7 @@ pub struct Builder {
|
|||||||
dispatch: fern::Dispatch,
|
dispatch: fern::Dispatch,
|
||||||
rotation_strategy: RotationStrategy,
|
rotation_strategy: RotationStrategy,
|
||||||
timezone_strategy: TimezoneStrategy,
|
timezone_strategy: TimezoneStrategy,
|
||||||
|
file_open_strategy: FileOpenStrategy,
|
||||||
max_file_size: u128,
|
max_file_size: u128,
|
||||||
targets: Vec<Target>,
|
targets: Vec<Target>,
|
||||||
is_skip_logger: bool,
|
is_skip_logger: bool,
|
||||||
@@ -423,6 +440,7 @@ impl Default for Builder {
|
|||||||
dispatch,
|
dispatch,
|
||||||
rotation_strategy: DEFAULT_ROTATION_STRATEGY,
|
rotation_strategy: DEFAULT_ROTATION_STRATEGY,
|
||||||
timezone_strategy: DEFAULT_TIMEZONE_STRATEGY,
|
timezone_strategy: DEFAULT_TIMEZONE_STRATEGY,
|
||||||
|
file_open_strategy: DEFAULT_FILE_OPEN_STRATEGY,
|
||||||
max_file_size: DEFAULT_MAX_FILE_SIZE as u128,
|
max_file_size: DEFAULT_MAX_FILE_SIZE as u128,
|
||||||
targets: DEFAULT_LOG_TARGETS.into(),
|
targets: DEFAULT_LOG_TARGETS.into(),
|
||||||
is_skip_logger: false,
|
is_skip_logger: false,
|
||||||
@@ -435,11 +453,18 @@ impl Builder {
|
|||||||
Default::default()
|
Default::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the [`RotationStrategy`].
|
||||||
|
///
|
||||||
|
/// Default is [`RotationStrategy::KeepOne`]
|
||||||
pub fn rotation_strategy(mut self, rotation_strategy: RotationStrategy) -> Self {
|
pub fn rotation_strategy(mut self, rotation_strategy: RotationStrategy) -> Self {
|
||||||
self.rotation_strategy = rotation_strategy;
|
self.rotation_strategy = rotation_strategy;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the [`TimezoneStrategy`].
|
||||||
|
/// Calling this method overrides the format set in [`Self::format`].
|
||||||
|
///
|
||||||
|
/// Default is [`TimezoneStrategy::UseUtc`]
|
||||||
pub fn timezone_strategy(mut self, timezone_strategy: TimezoneStrategy) -> Self {
|
pub fn timezone_strategy(mut self, timezone_strategy: TimezoneStrategy) -> Self {
|
||||||
self.timezone_strategy = timezone_strategy.clone();
|
self.timezone_strategy = timezone_strategy.clone();
|
||||||
|
|
||||||
@@ -456,15 +481,28 @@ impl Builder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the maximum file size for log rotation.
|
/// Sets the strategy to open the log file.
|
||||||
///
|
///
|
||||||
/// Values larger than `u64::MAX` will be clamped to `u64::MAX`.
|
/// The default is [`FileOpenStrategy::Append`].
|
||||||
|
pub fn file_open_strategy(mut self, file_open_strategy: FileOpenStrategy) -> Self {
|
||||||
|
self.file_open_strategy = file_open_strategy;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets the maximum file size in bytes for log rotation.
|
||||||
|
///
|
||||||
|
/// Values larger than [`u64::MAX`] will be clamped to [`u64::MAX`].
|
||||||
/// In v3, this parameter will be changed to `u64`.
|
/// In v3, this parameter will be changed to `u64`.
|
||||||
|
///
|
||||||
|
/// Default is `40_000`
|
||||||
pub fn max_file_size(mut self, max_file_size: u128) -> Self {
|
pub fn max_file_size(mut self, max_file_size: u128) -> Self {
|
||||||
self.max_file_size = max_file_size.min(u64::MAX as u128);
|
self.max_file_size = max_file_size.min(u64::MAX as u128);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Clears the format so that only the message is logged.
|
||||||
|
///
|
||||||
|
/// e.g. `log::info!("message")` will log out `message`
|
||||||
pub fn clear_format(mut self) -> Self {
|
pub fn clear_format(mut self) -> Self {
|
||||||
self.dispatch = self.dispatch.format(|out, message, _record| {
|
self.dispatch = self.dispatch.format(|out, message, _record| {
|
||||||
out.finish(format_args!("{message}"));
|
out.finish(format_args!("{message}"));
|
||||||
@@ -472,6 +510,37 @@ impl Builder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the formatter of this dispatch. The closure should accept a
|
||||||
|
/// callback, a message and a log record, and write the resulting
|
||||||
|
/// format to the writer.
|
||||||
|
///
|
||||||
|
/// The log record is passed for completeness, but the `args()` method of
|
||||||
|
/// the record should be ignored, and the [`std::fmt::Arguments`] given
|
||||||
|
/// should be used instead. `record.args()` may be used to retrieve the
|
||||||
|
/// _original_ log message, but in order to allow for true log
|
||||||
|
/// chaining, formatters should use the given message instead whenever
|
||||||
|
/// including the message in the output.
|
||||||
|
///
|
||||||
|
/// To avoid all allocation of intermediate results, the formatter is
|
||||||
|
/// "completed" by calling a callback, which then calls the rest of the
|
||||||
|
/// logging chain with the new formatted message. The callback object keeps
|
||||||
|
/// track of if it was called or not via a stack boolean as well, so if
|
||||||
|
/// you don't use `out.finish` the log message will continue down
|
||||||
|
/// the logger chain unformatted.
|
||||||
|
///
|
||||||
|
/// Example usage:
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// tauri_plugin_log::Builder::new()
|
||||||
|
/// .format(|out, message, record| {
|
||||||
|
/// out.finish(format_args!(
|
||||||
|
/// "[{} {}] {}",
|
||||||
|
/// record.level(),
|
||||||
|
/// record.target(),
|
||||||
|
/// message
|
||||||
|
/// ))
|
||||||
|
/// });
|
||||||
|
/// ```
|
||||||
pub fn format<F>(mut self, formatter: F) -> Self
|
pub fn format<F>(mut self, formatter: F) -> Self
|
||||||
where
|
where
|
||||||
F: Fn(FormatCallback, &Arguments, &Record) + Sync + Send + 'static,
|
F: Fn(FormatCallback, &Arguments, &Record) + Sync + Send + 'static,
|
||||||
@@ -480,16 +549,64 @@ impl Builder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the overarching level filter for this logger.
|
||||||
|
/// All messages not already filtered by something set by [`Self::level_for`] will be affected.
|
||||||
|
///
|
||||||
|
/// All messages filtered will be discarded if less severe than the given level.
|
||||||
|
///
|
||||||
|
/// Default level is [`log::LevelFilter::Trace`].
|
||||||
pub fn level(mut self, level_filter: impl Into<LevelFilter>) -> Self {
|
pub fn level(mut self, level_filter: impl Into<LevelFilter>) -> Self {
|
||||||
self.dispatch = self.dispatch.level(level_filter.into());
|
self.dispatch = self.dispatch.level(level_filter.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets a per-target log level filter. Default target for log messages is
|
||||||
|
/// `crate_name::module_name` or
|
||||||
|
/// `crate_name` for logs in the crate root. Targets can also be set with
|
||||||
|
/// `info!(target: "target-name", ...)`.
|
||||||
|
///
|
||||||
|
/// For each log record fern will first try to match the most specific
|
||||||
|
/// level_for, and then progressively more general ones until either a
|
||||||
|
/// matching level is found, or the default level is used.
|
||||||
|
///
|
||||||
|
/// For example, a log for the target `hyper::http::h1` will first test a
|
||||||
|
/// level_for for `hyper::http::h1`, then for `hyper::http`, then for
|
||||||
|
/// `hyper`, then use the default level.
|
||||||
|
///
|
||||||
|
/// Examples:
|
||||||
|
///
|
||||||
|
/// A program wants to include a lot of debugging output, but the library
|
||||||
|
/// "hyper" is known to work well, so debug output from it should be
|
||||||
|
/// excluded:
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// # fn main() {
|
||||||
|
/// tauri_plugin_log::Builder::new()
|
||||||
|
/// .level(log::LevelFilter::Trace)
|
||||||
|
/// .level_for("hyper", log::LevelFilter::Info)
|
||||||
|
/// # ;
|
||||||
|
/// # }
|
||||||
|
/// ```
|
||||||
pub fn level_for(mut self, module: impl Into<Cow<'static, str>>, level: LevelFilter) -> Self {
|
pub fn level_for(mut self, module: impl Into<Cow<'static, str>>, level: LevelFilter) -> Self {
|
||||||
self.dispatch = self.dispatch.level_for(module, level);
|
self.dispatch = self.dispatch.level_for(module, level);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Adds a custom filter which can reject messages passing through this logger.
|
||||||
|
///
|
||||||
|
/// [`Self::level`] and [`Self::level_for`] are preferred if applicable.
|
||||||
|
///
|
||||||
|
/// Example usage:
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// # fn main() {
|
||||||
|
/// tauri_plugin_log::Builder::new()
|
||||||
|
/// .level(log::LevelFilter::Info)
|
||||||
|
/// .filter(|metadata| {
|
||||||
|
/// // Reject messages with the `Error` log level.
|
||||||
|
/// metadata.level() != log::LevelFilter::Error
|
||||||
|
/// })
|
||||||
|
/// # }
|
||||||
pub fn filter<F>(mut self, filter: F) -> Self
|
pub fn filter<F>(mut self, filter: F) -> Self
|
||||||
where
|
where
|
||||||
F: Fn(&log::Metadata) -> bool + Send + Sync + 'static,
|
F: Fn(&log::Metadata) -> bool + Send + Sync + 'static,
|
||||||
@@ -511,6 +628,19 @@ impl Builder {
|
|||||||
/// tauri_plugin_log::Builder::new()
|
/// tauri_plugin_log::Builder::new()
|
||||||
/// .target(Target::new(TargetKind::Webview));
|
/// .target(Target::new(TargetKind::Webview));
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// The default targets are
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// # use tauri_plugin_log::{Target, TargetKind, Builder};
|
||||||
|
/// # Builder::new()
|
||||||
|
/// # .targets(
|
||||||
|
/// [
|
||||||
|
/// Target::new(TargetKind::Stdout),
|
||||||
|
/// Target::new(TargetKind::LogDir { file_name: None }),
|
||||||
|
/// ]
|
||||||
|
/// # );
|
||||||
|
/// ```
|
||||||
pub fn target(mut self, target: Target) -> Self {
|
pub fn target(mut self, target: Target) -> Self {
|
||||||
self.targets.push(target);
|
self.targets.push(target);
|
||||||
self
|
self
|
||||||
@@ -543,6 +673,19 @@ impl Builder {
|
|||||||
/// Target::new(TargetKind::LogDir { file_name: Some("rust".into()) }).filter(|metadata| !metadata.target().starts_with(WEBVIEW_TARGET)),
|
/// Target::new(TargetKind::LogDir { file_name: Some("rust".into()) }).filter(|metadata| !metadata.target().starts_with(WEBVIEW_TARGET)),
|
||||||
/// ]);
|
/// ]);
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// The default targets are
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// # use tauri_plugin_log::{Target, TargetKind, Builder};
|
||||||
|
/// # Builder::new()
|
||||||
|
/// # .targets(
|
||||||
|
/// [
|
||||||
|
/// Target::new(TargetKind::Stdout),
|
||||||
|
/// Target::new(TargetKind::LogDir { file_name: None }),
|
||||||
|
/// ]
|
||||||
|
/// # );
|
||||||
|
/// ```
|
||||||
pub fn targets(mut self, targets: impl IntoIterator<Item = Target>) -> Self {
|
pub fn targets(mut self, targets: impl IntoIterator<Item = Target>) -> Self {
|
||||||
self.targets = Vec::from_iter(targets);
|
self.targets = Vec::from_iter(targets);
|
||||||
self
|
self
|
||||||
@@ -569,6 +712,7 @@ impl Builder {
|
|||||||
mut dispatch: fern::Dispatch,
|
mut dispatch: fern::Dispatch,
|
||||||
rotation_strategy: RotationStrategy,
|
rotation_strategy: RotationStrategy,
|
||||||
timezone_strategy: TimezoneStrategy,
|
timezone_strategy: TimezoneStrategy,
|
||||||
|
file_open_strategy: FileOpenStrategy,
|
||||||
max_file_size: u64,
|
max_file_size: u64,
|
||||||
targets: Vec<Target>,
|
targets: Vec<Target>,
|
||||||
) -> Result<(log::LevelFilter, Box<dyn log::Log>), Error> {
|
) -> Result<(log::LevelFilter, Box<dyn log::Log>), Error> {
|
||||||
@@ -621,6 +765,7 @@ impl Builder {
|
|||||||
max_file_size,
|
max_file_size,
|
||||||
rotation_strategy.clone(),
|
rotation_strategy.clone(),
|
||||||
timezone_strategy.clone(),
|
timezone_strategy.clone(),
|
||||||
|
file_open_strategy.clone(),
|
||||||
)?;
|
)?;
|
||||||
fern::Output::writer(Box::new(rotator), "\n")
|
fern::Output::writer(Box::new(rotator), "\n")
|
||||||
}
|
}
|
||||||
@@ -636,6 +781,7 @@ impl Builder {
|
|||||||
max_file_size,
|
max_file_size,
|
||||||
rotation_strategy.clone(),
|
rotation_strategy.clone(),
|
||||||
timezone_strategy.clone(),
|
timezone_strategy.clone(),
|
||||||
|
file_open_strategy.clone(),
|
||||||
)?;
|
)?;
|
||||||
fern::Output::writer(Box::new(rotator), "\n")
|
fern::Output::writer(Box::new(rotator), "\n")
|
||||||
}
|
}
|
||||||
@@ -681,6 +827,7 @@ impl Builder {
|
|||||||
self.dispatch,
|
self.dispatch,
|
||||||
self.rotation_strategy,
|
self.rotation_strategy,
|
||||||
self.timezone_strategy,
|
self.timezone_strategy,
|
||||||
|
self.file_open_strategy,
|
||||||
self.max_file_size as u64,
|
self.max_file_size as u64,
|
||||||
self.targets,
|
self.targets,
|
||||||
)?;
|
)?;
|
||||||
@@ -697,6 +844,7 @@ impl Builder {
|
|||||||
self.dispatch,
|
self.dispatch,
|
||||||
self.rotation_strategy,
|
self.rotation_strategy,
|
||||||
self.timezone_strategy,
|
self.timezone_strategy,
|
||||||
|
self.file_open_strategy,
|
||||||
self.max_file_size as u64,
|
self.max_file_size as u64,
|
||||||
self.targets,
|
self.targets,
|
||||||
)?;
|
)?;
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,6 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "guest-js"
|
||||||
|
},
|
||||||
"include": ["guest-js/*.ts"]
|
"include": ["guest-js/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## \[2.5.4]
|
||||||
|
|
||||||
|
- [`c1fd33b3`](https://github.com/tauri-apps/plugins-workspace/commit/c1fd33b3a2735f2e25c1d026dc524af932db3315) ([#3343](https://github.com/tauri-apps/plugins-workspace/pull/3343) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix `revealItemInDir`/`reveal_items_in_dir` can't reveal network paths like `\\wsl.localhost\Ubuntu\etc` on Windows
|
||||||
|
|
||||||
## \[2.5.3]
|
## \[2.5.3]
|
||||||
|
|
||||||
- [`3d0d2e04`](https://github.com/tauri-apps/plugins-workspace/commit/3d0d2e041bbad9766aebecaeba291a28d8d7bf5c) ([#3163](https://github.com/tauri-apps/plugins-workspace/pull/3163) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Properly ignore `with: inAppBrowser` on desktop. This prevents an issue were `open_url` seamingly did nothing on desktop.
|
- [`3d0d2e04`](https://github.com/tauri-apps/plugins-workspace/commit/3d0d2e041bbad9766aebecaeba291a28d8d7bf5c) ([#3163](https://github.com/tauri-apps/plugins-workspace/pull/3163) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Properly ignore `with: inAppBrowser` on desktop. This prevents an issue were `open_url` seamingly did nothing on desktop.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tauri-plugin-opener"
|
name = "tauri-plugin-opener"
|
||||||
version = "2.5.3"
|
version = "2.5.4"
|
||||||
description = "Open files and URLs using their default application."
|
description = "Open files and URLs using their default application."
|
||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
authors = { workspace = true }
|
authors = { workspace = true }
|
||||||
@@ -41,6 +41,7 @@ features = [
|
|||||||
"Win32_UI_WindowsAndMessaging",
|
"Win32_UI_WindowsAndMessaging",
|
||||||
"Win32_System_Com",
|
"Win32_System_Com",
|
||||||
"Win32_System_Registry",
|
"Win32_System_Registry",
|
||||||
|
"Win32_Storage_FileSystem",
|
||||||
]
|
]
|
||||||
|
|
||||||
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"netbsd\", target_os = \"openbsd\"))".dependencies]
|
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"netbsd\", target_os = \"openbsd\"))".dependencies]
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
| Linux | ✓ |
|
| Linux | ✓ |
|
||||||
| Windows | ✓ |
|
| Windows | ✓ |
|
||||||
| macOS | ✓ |
|
| macOS | ✓ |
|
||||||
| Android | ? |
|
| Android | ✓ |
|
||||||
| iOS | ? |
|
| iOS | ✓ |
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tauri-apps/plugin-opener",
|
"name": "@tauri-apps/plugin-opener",
|
||||||
"version": "2.5.3",
|
"version": "2.5.4",
|
||||||
"description": "Open files and URLs using their default application.",
|
"description": "Open files and URLs using their default application.",
|
||||||
"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.10.1"
|
"@tauri-apps/api": "^2.11.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ pub enum Error {
|
|||||||
Win32Error(#[from] windows::core::Error),
|
Win32Error(#[from] windows::core::Error),
|
||||||
#[error("Path doesn't have a parent: {0}")]
|
#[error("Path doesn't have a parent: {0}")]
|
||||||
NoParent(PathBuf),
|
NoParent(PathBuf),
|
||||||
|
// TODO: Add the underlying io::Error to this variant
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
#[error("Failed to convert path '{0}' to ITEMIDLIST")]
|
#[error("Failed to convert path '{0}' to ITEMIDLIST")]
|
||||||
FailedToConvertPathToItemIdList(PathBuf),
|
FailedToConvertPathToItemIdList(PathBuf),
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ mod open;
|
|||||||
mod reveal_item_in_dir;
|
mod reveal_item_in_dir;
|
||||||
mod scope;
|
mod scope;
|
||||||
mod scope_entry;
|
mod scope_entry;
|
||||||
|
#[cfg(windows)]
|
||||||
|
mod windows_shell_path;
|
||||||
|
|
||||||
pub use error::Error;
|
pub use error::Error;
|
||||||
type Result<T> = std::result::Result<T, Error>;
|
type Result<T> = std::result::Result<T, Error>;
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
/// Reveal a path the system's default explorer.
|
/// Reveal a path in the system's default explorer.
|
||||||
///
|
///
|
||||||
/// ## Platform-specific:
|
/// ## Platform-specific:
|
||||||
///
|
///
|
||||||
/// - **Android / iOS:** Unsupported.
|
/// - **Android / iOS:** Unsupported.
|
||||||
pub fn reveal_item_in_dir<P: AsRef<Path>>(path: P) -> crate::Result<()> {
|
pub fn reveal_item_in_dir<P: AsRef<Path>>(path: P) -> crate::Result<()> {
|
||||||
let path = dunce::canonicalize(path.as_ref())?;
|
let path = canonicalize(path.as_ref())?;
|
||||||
|
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
windows,
|
windows,
|
||||||
@@ -35,7 +35,7 @@ pub fn reveal_item_in_dir<P: AsRef<Path>>(path: P) -> crate::Result<()> {
|
|||||||
Err(crate::Error::UnsupportedPlatform)
|
Err(crate::Error::UnsupportedPlatform)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reveal the paths the system's default explorer.
|
/// Reveal multiple paths in the system's default explorer.
|
||||||
///
|
///
|
||||||
/// ## Platform-specific:
|
/// ## Platform-specific:
|
||||||
///
|
///
|
||||||
@@ -48,7 +48,7 @@ where
|
|||||||
let mut canonicalized = vec![];
|
let mut canonicalized = vec![];
|
||||||
|
|
||||||
for path in paths {
|
for path in paths {
|
||||||
let path = dunce::canonicalize(path.as_ref())?;
|
let path = canonicalize(path.as_ref())?;
|
||||||
canonicalized.push(path);
|
canonicalized.push(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,10 +75,21 @@ where
|
|||||||
Err(crate::Error::UnsupportedPlatform)
|
Err(crate::Error::UnsupportedPlatform)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn canonicalize(path: &Path) -> crate::Result<PathBuf> {
|
||||||
|
#[cfg(windows)]
|
||||||
|
let path = crate::windows_shell_path::absolute_and_check_exists(dunce::simplified(path))?;
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
let path = std::fs::canonicalize(path)?;
|
||||||
|
Ok(path)
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
mod imp {
|
mod imp {
|
||||||
use std::collections::HashMap;
|
use std::{
|
||||||
use std::path::{Path, PathBuf};
|
borrow::Cow,
|
||||||
|
collections::HashMap,
|
||||||
|
path::{Path, PathBuf},
|
||||||
|
};
|
||||||
|
|
||||||
use windows::Win32::UI::Shell::Common::ITEMIDLIST;
|
use windows::Win32::UI::Shell::Common::ITEMIDLIST;
|
||||||
use windows::{
|
use windows::{
|
||||||
@@ -101,10 +112,9 @@ mod imp {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut grouped_paths: HashMap<&Path, Vec<&Path>> = HashMap::new();
|
let mut grouped_paths: HashMap<Cow<Path>, Vec<&Path>> = HashMap::new();
|
||||||
for path in paths {
|
for path in paths {
|
||||||
let parent = path
|
let parent = crate::windows_shell_path::shell_parent_path(path)
|
||||||
.parent()
|
|
||||||
.ok_or_else(|| crate::Error::NoParent(path.to_path_buf()))?;
|
.ok_or_else(|| crate::Error::NoParent(path.to_path_buf()))?;
|
||||||
grouped_paths.entry(parent).or_default().push(path);
|
grouped_paths.entry(parent).or_default().push(path);
|
||||||
}
|
}
|
||||||
@@ -112,7 +122,7 @@ mod imp {
|
|||||||
let _ = unsafe { CoInitialize(None) };
|
let _ = unsafe { CoInitialize(None) };
|
||||||
|
|
||||||
for (parent, to_reveals) in grouped_paths {
|
for (parent, to_reveals) in grouped_paths {
|
||||||
let parent_item_id_list = OwnedItemIdList::new(parent)?;
|
let parent_item_id_list = OwnedItemIdList::new(&parent)?;
|
||||||
let to_reveals_item_id_list = to_reveals
|
let to_reveals_item_id_list = to_reveals
|
||||||
.iter()
|
.iter()
|
||||||
.map(|to_reveal| OwnedItemIdList::new(to_reveal))
|
.map(|to_reveal| OwnedItemIdList::new(to_reveal))
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user