diff --git a/.changes/config.json b/.changes/config.json index 5f5fe841..93ed46e3 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -14,10 +14,20 @@ "command": "pnpm build", "dryRunCommand": "pnpm build" }, + { + "command": "echo '
\n

PNPM Publish

\n\n```'", + "dryRunCommand": true, + "pipe": true + }, { "command": "npm publish --provenance --access public", "dryRunCommand": "npm publish --provenance --access public --dry-run", "pipe": true + }, + { + "command": "echo '```\n\n
\n'", + "dryRunCommand": true, + "pipe": true } ] }, @@ -56,12 +66,13 @@ "dependencies": [ "barcode-scanner", "biometric", - "log-plugin", + "log", "cli", "clipboard-manager", "dialog", "fs", "global-shortcut", + "opener", "http", "nfc", "notification", @@ -87,6 +98,7 @@ "dialog-js", "fs-js", "global-shortcut-js", + "opener-js", "http-js", "nfc-js", "notification-js", @@ -168,7 +180,8 @@ }, "dialog-js": { "path": "./plugins/dialog", - "manager": "javascript" + "manager": "javascript", + "dependencies": ["fs-js"] }, "geolocation": { "path": "./plugins/geolocation", @@ -186,6 +199,14 @@ "path": "./plugins/global-shortcut", "manager": "javascript" }, + "opener": { + "path": "./plugins/opener", + "manager": "rust" + }, + "opener-js": { + "path": "./plugins/opener", + "manager": "javascript" + }, "haptics": { "path": "./plugins/haptics", "manager": "rust" @@ -201,13 +222,14 @@ }, "http-js": { "path": "./plugins/http", - "manager": "javascript" + "manager": "javascript", + "dependencies": ["fs-js"] }, "localhost": { "path": "./plugins/localhost", "manager": "rust" }, - "log-plugin": { + "log": { "path": "./plugins/log", "manager": "rust" }, diff --git a/.changes/log-timezone_strategy-loglevel-fix.md b/.changes/log-timezone_strategy-loglevel-fix.md new file mode 100644 index 00000000..b3787e0d --- /dev/null +++ b/.changes/log-timezone_strategy-loglevel-fix.md @@ -0,0 +1,6 @@ +--- +"log": patch +"log-js": patch +--- + +Fix timezone_strategy overwriting previously set LogLevels. diff --git a/.changes/readme.md b/.changes/readme.md index 96cb9f77..6d9396ba 100644 --- a/.changes/readme.md +++ b/.changes/readme.md @@ -6,6 +6,8 @@ As you create PRs and make changes that require a version bump, please add a new When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process. +**Note, that in this repository, even if only the Rust code or only the JavaScript code of a plugin changed, both packages need to be bumped with the same increment!** + Use the following format: ```md diff --git a/.github/workflows/check-change-files.yml b/.github/workflows/check-change-files.yml new file mode 100644 index 00000000..898f265f --- /dev/null +++ b/.github/workflows/check-change-files.yml @@ -0,0 +1,44 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT + +name: check change files + +on: + pull_request: + paths: + - '.changes/*.md' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: check change files end with .md + run: | + for file in .changes/* + do + if [[ ! "$file" =~ \.(md|json)$ ]]; then + echo ".changes directory should only contain files that end with .md" + echo "found an invalid file in .changes directory:" + echo "$file" + exit 1 + fi + done + + - uses: dorny/paths-filter@v3 + id: filter + with: + list-files: shell + filters: | + changes: + - added|modified: '.changes/*.md' + + - name: check + run: node ./.scripts/ci/check-change-files.js ${{ steps.filter.outputs.changes_files }} + if: ${{ steps.filter.outputs.changes == 'true' }} diff --git a/.github/workflows/check-generated-files.yml b/.github/workflows/check-generated-files.yml index 96bbdd05..d2c2c874 100644 --- a/.github/workflows/check-generated-files.yml +++ b/.github/workflows/check-generated-files.yml @@ -53,6 +53,10 @@ jobs: - .github/workflows/check-generated-files.yml - plugins/global-shortcut/guest-js/** - plugins/global-shortcut/src/api-iife.js + opener: + - .github/workflows/check-generated-files.yml + - plugins/opener/guest-js/** + - plugins/opener/src/api-iife.js haptics: - .github/workflows/check-generated-files.yml - plugins/haptics/guest-js/** diff --git a/.github/workflows/lint-rust.yml b/.github/workflows/lint-rust.yml index 39cc37fe..db922ef1 100644 --- a/.github/workflows/lint-rust.yml +++ b/.github/workflows/lint-rust.yml @@ -66,6 +66,9 @@ jobs: tauri-plugin-global-shortcut: - .github/workflows/lint-rust.yml - plugins/global-shortcut/** + tauri-plugin-opener: + - .github/workflows/lint-rust.yml + - plugins/opener/** tauri-plugin-haptics: - .github/workflows/lint-rust.yml - plugins/haptics/** @@ -126,7 +129,7 @@ jobs: clippy: needs: changes if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml index 016e3673..496efe6e 100644 --- a/.github/workflows/test-rust.yml +++ b/.github/workflows/test-rust.yml @@ -47,109 +47,140 @@ jobs: tauri-plugin-autostart: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/autostart/** tauri-plugin-cli: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/cli/** tauri-plugin-clipboard-manager: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/clipboard-manager/** tauri-plugin-deep-link: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/deep-link/** tauri-plugin-dialog: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/dialog/** - plugins/fs/** tauri-plugin-fs: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/fs/** tauri-plugin-geolocation: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/geolocation/** tauri-plugin-global-shortcut: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/global-shortcut/** + tauri-plugin-opener: + - .github/workflows/test-rust.yml + - Cargo.toml + - Cargo.lock + - plugins/opener/** tauri-plugin-haptics: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/haptics/** tauri-plugin-http: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/http/** - plugins/fs/** tauri-plugin-localhost: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/localhost/** tauri-plugin-log: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/log/** tauri-plugin-notification: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/notification/** tauri-plugin-os: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/os/** tauri-plugin-persisted-scope: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/persisted-scope/** - plugins/fs/** tauri-plugin-positioner: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/positioner/** tauri-plugin-process: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/process/** tauri-plugin-shell: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/shell/** tauri-plugin-single-instance: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/single-instance/** tauri-plugin-sql: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/sql/** tauri-plugin-store: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/store/** tauri-plugin-stronghold: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/stronghold/** tauri-plugin-updater: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/updater/** tauri-plugin-upload: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/upload/** tauri-plugin-websocket: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/websocket/** tauri-plugin-window-state: - .github/workflows/test-rust.yml - Cargo.toml + - Cargo.lock - plugins/window-state/** test: @@ -168,7 +199,7 @@ jobs: } - { target: x86_64-unknown-linux-gnu, - os: ubuntu-latest, + os: ubuntu-22.04, runner: 'cargo', command: 'test' } diff --git a/.scripts/ci/check-change-files.js b/.scripts/ci/check-change-files.js new file mode 100644 index 00000000..c9ff7e9b --- /dev/null +++ b/.scripts/ci/check-change-files.js @@ -0,0 +1,86 @@ +#!/usr/bin/env node + +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { readFileSync, readdirSync } from 'fs' +import { join } from 'path' + +/* const ignorePackages = [ + 'api-example', + 'api-example-js', + 'deep-link-example', + 'deep-link-example-js' +] */ + +const rsOnly = ['localhost', 'persisted-scope', 'single-instance'] + +function checkChangeFiles(changeFiles) { + let code = 0 + + for (const file of changeFiles) { + const content = readFileSync(file, 'utf8') + const [frontMatter] = /^---[\s\S.]*---\n/i.exec(content) + const packages = frontMatter + .split('\n') + .filter((l) => !(l === '---' || !l)) + .map((l) => l.replace(/('|")/g, '').split(':')) + + const rsPackages = Object.fromEntries( + packages + .filter((v) => !v[0].endsWith('-js')) + .map((v) => [v[0], v[1].trim()]) + ) + const jsPackages = Object.fromEntries( + packages + .filter((v) => v[0].endsWith('-js')) + .map((v) => [v[0].slice(0, -3), v[1].trim()]) + ) + + for (const pkg in rsPackages) { + if (rsOnly.includes(pkg)) continue + + if (!jsPackages[pkg]) { + console.error( + `Missing "${rsPackages[pkg]}" bump for JS package "${pkg}-js" in ${file}.` + ) + code = 1 + } else if (rsPackages[pkg] != jsPackages[pkg]) { + console.error( + `"${pkg}" and "${pkg}-js" have different version bumps in ${file}.` + ) + code = 1 + } + } + + for (const pkg in jsPackages) { + if (!rsPackages[pkg]) { + console.error( + `Missing "${jsPackages[pkg]}" bump for Rust package "${pkg}" in ${file}.` + ) + code = 1 + } else if (rsPackages[pkg] != jsPackages[pkg]) { + console.error( + `"${pkg}" and "${pkg}-js" have different version bumps in ${file}.` + ) + code = 1 + } + } + } + + process.exit(code) +} + +const [_bin, _script, ...files] = process.argv + +if (files.length > 0) { + checkChangeFiles( + files.filter((f) => f.toLowerCase() !== '.changes/readme.md') + ) +} else { + const changeFiles = readdirSync('.changes') + .filter((f) => f.endsWith('.md') && f.toLowerCase() !== 'readme.md') + .map((p) => join('.changes', p)) + checkChangeFiles(changeFiles) +} diff --git a/.taurignore b/.taurignore new file mode 100644 index 00000000..28a49db3 --- /dev/null +++ b/.taurignore @@ -0,0 +1,2 @@ +plugins/*/permissions/autogenerated/ +plugins/*/android/.tauri/tauri-api/build/ diff --git a/Cargo.lock b/Cargo.lock index 2044a052..0e1f2448 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,19 +10,13 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -102,12 +96,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned-vec" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" - [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -125,9 +113,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -163,9 +151,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -178,47 +166,47 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "api" -version = "2.0.2" +version = "2.0.17" dependencies = [ "log", "serde", @@ -238,6 +226,7 @@ dependencies = [ "tauri-plugin-log", "tauri-plugin-nfc", "tauri-plugin-notification", + "tauri-plugin-opener", "tauri-plugin-os", "tauri-plugin-process", "tauri-plugin-shell", @@ -285,9 +274,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" dependencies = [ "derive_arbitrary", ] @@ -310,17 +299,6 @@ dependencies = [ "x11rb", ] -[[package]] -name = "arg_enum_proc_macro" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "arrayref" version = "0.3.9" @@ -341,9 +319,9 @@ checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "ashpd" -version = "0.9.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe7e0dd0ac5a401dc116ed9f9119cf9decc625600474cb41f0fc0a0050abc9a" +checksum = "e9c39d707614dbcc6bed00015539f488d8e3fe3e66ed60961efc0c90f4b380b3" dependencies = [ "enumflags2", "futures-channel", @@ -396,9 +374,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.12" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" +checksum = "df895a515f70646414f4b45c0b79082783b80552b373a68283012928df56f522" dependencies = [ "brotli", "flate2", @@ -434,9 +412,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock", "cfg-if", @@ -489,7 +467,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -524,7 +502,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -572,7 +550,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f012b8cc0c850f34117ec8252a44418f2e34a2cf501de89e29b241ae5f79471" dependencies = [ "dirs 4.0.0", - "thiserror", + "thiserror 1.0.69", "winreg 0.10.1", ] @@ -582,29 +560,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "av1-grain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" -dependencies = [ - "anyhow", - "arrayvec", - "log", - "nom", - "num-rational", - "v_frame", -] - -[[package]] -name = "avif-serialize" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" -dependencies = [ - "arrayvec", -] - [[package]] name = "backtrace" version = "0.3.74" @@ -614,7 +569,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.0", + "miniz_oxide", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -659,12 +614,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bit_field" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" - [[package]] name = "bitflags" version = "1.3.2" @@ -673,19 +622,13 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" dependencies = [ "serde", ] -[[package]] -name = "bitstream-io" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c12d1856e42f0d817a835fe55853957c85c8c8a470114029143d3f12671446e" - [[package]] name = "bitvec" version = "1.0.1" @@ -742,6 +685,25 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" +dependencies = [ + "objc-sys", +] + +[[package]] +name = "block2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e58aa60e59d8dbfcc36138f5f18be5f24394d33b38b24f7fd0b1caa33095f22f" +dependencies = [ + "block-sys", + "objc2", +] + [[package]] name = "block2" version = "0.5.1" @@ -766,33 +728,32 @@ dependencies = [ [[package]] name = "borsh" -version = "1.3.0" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" +checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" dependencies = [ "borsh-derive", - "cfg_aliases 0.1.1", + "cfg_aliases", ] [[package]] name = "borsh-derive" -version = "1.3.0" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" +checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" dependencies = [ "once_cell", - "proc-macro-crate 2.0.2", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.79", - "syn_derive", + "syn 2.0.90", ] [[package]] name = "brotli" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -809,12 +770,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "built" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" - [[package]] name = "bumpalo" version = "3.16.0" @@ -823,9 +778,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-unit" -version = "5.1.4" +version = "5.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ac19bdf0b2665407c39d82dbc937e951e7e2001609f0fb32edd0af45a2d63e" +checksum = "e1cd29c3c585209b0cbc7309bfe3ed7efd8c84c21b7af29c8bfae908f8777174" dependencies = [ "rust_decimal", "serde", @@ -856,9 +811,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" [[package]] name = "byteorder" @@ -874,9 +829,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.7.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" dependencies = [ "serde", ] @@ -887,12 +842,12 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cairo-sys-rs", "glib", "libc", "once_cell", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -926,36 +881,34 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +checksum = "afc309ed89476c8957c50fb818f56fe894db857866c3e163335faa91dc34eb85" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "cargo_toml" -version = "0.17.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" +checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" dependencies = [ "serde", - "toml 0.8.2", + "toml 0.8.19", ] [[package]] name = "cc" -version = "1.1.22" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ - "jobserver", - "libc", "shlex", ] @@ -992,12 +945,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "cfg_aliases" version = "0.2.1" @@ -1060,18 +1007,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.18" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.18" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -1081,9 +1028,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "clipboard-win" @@ -1100,7 +1047,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f79398230a6e2c08f5c9760610eb6924b52aa9e7950a619602baba59dcbbdbb2" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block", "cocoa-foundation", "core-foundation 0.10.0", @@ -1116,7 +1063,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e14045fb83be07b5acf1c0884b2180461635b433455fa35d1cd6f17f1450679d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block", "core-foundation 0.10.0", "core-graphics-types 0.2.0", @@ -1134,28 +1081,11 @@ dependencies = [ "termcolor", ] -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - [[package]] name = "colorchoice" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" - -[[package]] -name = "colored" -version = "1.9.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" -dependencies = [ - "is-terminal", - "lazy_static", - "winapi", -] +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -1243,12 +1173,13 @@ dependencies = [ [[package]] name = "cookie_store" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" +checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9" dependencies = [ "cookie", - "idna 0.5.0", + "document-features", + "idna", "log", "publicsuffix", "serde", @@ -1303,7 +1234,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.10.0", "core-graphics-types 0.2.0", "foreign-types 0.5.0", @@ -1327,7 +1258,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.10.0", "libc", ] @@ -1343,9 +1274,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -1383,25 +1314,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-queue" version = "0.3.11" @@ -1470,17 +1382,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] name = "ctor" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1516,7 +1428,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1540,7 +1452,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1551,14 +1463,14 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] name = "dary_heap" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" +checksum = "04d2cd9c18b9f454ed67da600630b021a8a80bf33f8c95896ab33aaf1c26b728" [[package]] name = "data-encoding" @@ -1607,26 +1519,15 @@ dependencies = [ "serde", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive_arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1639,7 +1540,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1672,6 +1573,15 @@ dependencies = [ "dirs-sys 0.4.1", ] +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys 0.5.0", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -1689,7 +1599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", - "redox_users", + "redox_users 0.4.6", "winapi", ] @@ -1701,10 +1611,22 @@ checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", "option-ext", - "redox_users", + "redox_users 0.4.6", "windows-sys 0.48.0", ] +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users 0.5.0", + "windows-sys 0.59.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -1712,7 +1634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users", + "redox_users 0.4.6", "winapi", ] @@ -1730,7 +1652,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1739,7 +1661,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.5", + "libloading 0.8.6", ] [[package]] @@ -1762,7 +1684,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1774,6 +1696,15 @@ dependencies = [ "const-random", ] +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -1890,14 +1821,14 @@ dependencies = [ [[package]] name = "embed-resource" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e24052d7be71f0efb50c201557f6fe7d237cfd5a64fd5bcd7fd8fe32dbbffa" +checksum = "b68b6f9f63a0b6a38bc447d4ce84e2b388f3ec95c99c641c8ff0dd3ef89a6379" dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.8.2", + "toml 0.8.19", "vswhom", "winreg 0.52.0", ] @@ -1910,9 +1841,9 @@ checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -1941,7 +1872,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1972,12 +1903,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2010,52 +1941,36 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ "event-listener", "pin-project-lite", ] -[[package]] -name = "exr" -version = "1.72.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" -dependencies = [ - "bit_field", - "flume", - "half", - "lebe", - "miniz_oxide 0.7.4", - "rayon-core", - "smallvec", - "zune-inflate", -] - [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "fdeflate" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" +checksum = "07c6f4c64c1d33a3111c4466f7365ebdcc37c5bd1ea0d62aae2e3d722aacbedb" dependencies = [ "simd-adler32", ] [[package]] name = "fern" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" +checksum = "69ff9c9d5fb3e6da8ac2f77ab76fe7e8087d512ce095200f8f29ac5b656cf6dc" dependencies = [ - "colored 1.9.4", + "colored", "log", ] @@ -2087,11 +2002,11 @@ dependencies = [ [[package]] name = "file-id" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6584280525fb2059cba3db2c04abf947a1a29a45ddae89f3870f8281704fafc9" +checksum = "6bc904b9bbefcadbd8e3a9fb0d464a9b979de6324c03b3c663e8994f46a5be36" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2108,28 +2023,19 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", -] - -[[package]] -name = "fluent-uri" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" -dependencies = [ - "bitflags 1.3.2", + "miniz_oxide", ] [[package]] name = "flume" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", @@ -2169,7 +2075,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -2220,9 +2126,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2235,9 +2141,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2245,15 +2151,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -2273,15 +2179,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ "fastrand", "futures-core", @@ -2292,32 +2198,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2462,9 +2368,9 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc3655aa6818d65bc620d6911f05aa7b6aeb596291e1e9f79e52df85583d1e30" +checksum = "4fd4b8790c0792e3b11895efdf5f289ebe8b59107a6624f1cce68f24ff8c7035" dependencies = [ "rustix", "windows-targets 0.52.6", @@ -2504,21 +2410,11 @@ dependencies = [ "polyval", ] -[[package]] -name = "gif" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" -dependencies = [ - "color_quant", - "weezl", -] - [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" @@ -2536,7 +2432,7 @@ dependencies = [ "once_cell", "pin-project-lite", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2558,7 +2454,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "futures-channel", "futures-core", "futures-executor", @@ -2572,7 +2468,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2582,11 +2478,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", - "proc-macro-crate 2.0.2", + "proc-macro-crate 2.0.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -2607,9 +2503,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "global-hotkey" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1b75248f33c73df1ed69673f6cb36d2e048ae84d29aa1d3e53199d138ebb1df" +checksum = "b00d88f1be7bf4cd2e61623ce08e84be2dfa4eab458e5d632d3dab95f16c1f64" dependencies = [ "crossbeam-channel", "keyboard-types", @@ -2617,7 +2513,7 @@ dependencies = [ "objc2-app-kit", "once_cell", "serde", - "thiserror", + "thiserror 1.0.69", "windows-sys 0.59.0", "x11-dl", ] @@ -2693,14 +2589,14 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] name = "h2" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", @@ -2708,23 +2604,13 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.5.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -2744,6 +2630,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + [[package]] name = "hashlink" version = "0.9.1" @@ -2765,12 +2657,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hermit-abi" version = "0.4.0" @@ -2832,7 +2718,7 @@ checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", - "itoa 1.0.11", + "itoa 1.0.14", ] [[package]] @@ -2866,9 +2752,9 @@ checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2878,9 +2764,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", @@ -2890,7 +2776,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.11", + "itoa 1.0.14", "pin-project-lite", "smallvec", "tokio", @@ -2908,7 +2794,7 @@ dependencies = [ "hyper", "hyper-util", "rustls", - "rustls-native-certs 0.8.0", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls", @@ -2934,9 +2820,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -2985,69 +2871,172 @@ dependencies = [ ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icrate" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "3fb69199826926eb864697bddd27f73d9fddcffc004f5733131e15b465e30642" +dependencies = [ + "block2 0.4.0", + "objc2", +] [[package]] -name = "idna" -version = "0.3.0" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "idna" -version = "0.5.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "image" -version = "0.25.2" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" dependencies = [ - "bytemuck", - "byteorder-lite", - "color_quant", - "exr", - "gif", - "image-webp", - "num-traits", - "png", - "qoi", - "ravif", - "rayon", - "rgb", - "tiff", - "zune-core", - "zune-jpeg", + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "image-webp" -version = "0.1.3" +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "byteorder-lite", - "quick-error 2.0.1", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "imgref" -version = "1.10.1" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "image" +version = "0.25.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", + "tiff", +] [[package]] name = "indexmap" @@ -3062,12 +3051,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.2", "serde", ] @@ -3082,11 +3071,11 @@ dependencies = [ [[package]] name = "inotify" -version = "0.9.6" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.7.0", "inotify-sys", "libc", ] @@ -3110,26 +3099,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "interpolate_name" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "iota-crypto" version = "0.23.2" @@ -3178,15 +3147,15 @@ dependencies = [ "stronghold-derive", "stronghold-utils", "stronghold_engine", - "thiserror", + "thiserror 1.0.69", "zeroize", ] [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-docker" @@ -3197,17 +3166,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "is-terminal" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" -dependencies = [ - "hermit-abi 0.4.0", - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "is-wsl" version = "0.4.0" @@ -3230,15 +3188,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d101775d2bc8f99f4ac18bf29b9ed70c0dd138b9a1e88d7b80179470cbbe8bd2" -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "0.4.8" @@ -3247,9 +3196,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "javascriptcore-rs" @@ -3285,7 +3234,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", "windows-sys 0.45.0", ] @@ -3296,15 +3245,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - [[package]] name = "jpeg-decoder" version = "0.3.1" @@ -3313,32 +3253,32 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "json-patch" -version = "2.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" +checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" dependencies = [ "jsonptr", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "jsonptr" -version = "0.4.7" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" +checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" dependencies = [ - "fluent-uri", "serde", "serde_json", ] @@ -3362,7 +3302,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "serde", "unicode-segmentation", ] @@ -3409,12 +3349,6 @@ dependencies = [ "spin", ] -[[package]] -name = "lebe" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" - [[package]] name = "libappindicator" version = "0.9.0" @@ -3441,9 +3375,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libflate" @@ -3469,17 +3403,6 @@ dependencies = [ "rle-decode-fast", ] -[[package]] -name = "libfuzzer-sys" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" -dependencies = [ - "arbitrary", - "cc", - "once_cell", -] - [[package]] name = "libloading" version = "0.7.4" @@ -3492,9 +3415,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets 0.52.6", @@ -3502,9 +3425,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -3512,16 +3435,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "libc", "redox_syscall", ] [[package]] name = "libsodium-sys-stable" -version = "1.21.2" +version = "1.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42631d334de875c636a1aae7adb515653ac2e771e5a2ce74b1053f5a4412df3a" +checksum = "798a1c6d8c3424c0686ca46f2929d81809b371ef61a68c5d1880570584d32b85" dependencies = [ "cc", "libc", @@ -3551,6 +3474,18 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.12" @@ -3576,15 +3511,6 @@ dependencies = [ "value-bag", ] -[[package]] -name = "loop9" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" -dependencies = [ - "imgref", -] - [[package]] name = "mac" version = "0.1.1" @@ -3639,16 +3565,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" -[[package]] -name = "maybe-rayon" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" -dependencies = [ - "cfg-if", - "rayon", -] - [[package]] name = "md-5" version = "0.10.6" @@ -3711,15 +3627,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -3732,37 +3639,25 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - -[[package]] -name = "mio" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] [[package]] name = "mockito" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b34bd91b9e5c5b06338d392463e1318d683cf82ec3d3af4014609be6e2108d" +checksum = "652cd6d169a36eaf9d1e6bce1a221130439a966d7f27858af66a33a66e9c4ee2" dependencies = [ "assert-json-diff", "bytes", - "colored 2.1.0", + "colored", "futures-util", "http", "http-body", @@ -3780,9 +3675,9 @@ dependencies = [ [[package]] name = "muda" -version = "0.15.1" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8123dfd4996055ac9b15a60ad263b44b01e539007523ad7a4a533a3d93b0591" +checksum = "fdae9c00e61cc0579bcac625e8ad22104c60548a025bfc972dc83868a28e1484" dependencies = [ "crossbeam-channel", "dpi", @@ -3794,7 +3689,7 @@ dependencies = [ "once_cell", "png", "serde", - "thiserror", + "thiserror 1.0.69", "windows-sys 0.59.0", ] @@ -3810,7 +3705,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -3821,13 +3716,13 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "jni-sys", "log", "ndk-sys", "num_enum", "raw-window-handle", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3865,12 +3760,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", + "cfg_aliases", "libc", "memoffset 0.9.1", ] @@ -3891,51 +3787,43 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "noop_proc_macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" - [[package]] name = "notify" -version = "6.1.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" dependencies = [ - "bitflags 2.6.0", - "crossbeam-channel", + "bitflags 2.7.0", "filetime", "fsevent-sys", "inotify", "kqueue", "libc", "log", - "mio 0.8.11", - "serde", + "mio", + "notify-types", "walkdir", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "notify-debouncer-full" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f5dab59c348b9b50cf7f261960a20e389feb2713636399cd9082cd4b536154" +checksum = "d2d88b1a7538054351c8258338df7c931a590513fb3745e8c15eb9ff4199b8d1" dependencies = [ - "crossbeam-channel", "file-id", "log", "notify", - "parking_lot", + "notify-types", "walkdir", ] [[package]] name = "notify-rust" -version = "4.11.3" +version = "4.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5134a72dc570b178bff81b01e81ab14a6fcc015391ed4b3b14853090658cd3a3" +checksum = "96ae13fb6065b0865d2310dfa55ce319245052ed95fbbe2bc87c99962c58d73f" dependencies = [ "log", "mac-notification-sys", @@ -3945,13 +3833,12 @@ dependencies = [ ] [[package]] -name = "num-bigint" -version = "0.4.6" +name = "notify-types" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" dependencies = [ - "num-integer", - "num-traits", + "serde", ] [[package]] @@ -3977,17 +3864,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -4008,17 +3884,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -4044,10 +3909,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 2.0.2", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -4084,6 +3949,9 @@ name = "objc-sys" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" +dependencies = [ + "cc", +] [[package]] name = "objc2" @@ -4101,8 +3969,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.6.0", - "block2", + "bitflags 2.7.0", + "block2 0.5.1", "libc", "objc2", "objc2-core-data", @@ -4111,14 +3979,38 @@ dependencies = [ "objc2-quartz-core", ] +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.7.0", + "block2 0.5.1", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2 0.5.1", + "objc2", + "objc2-foundation", +] + [[package]] name = "objc2-core-data" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.6.0", - "block2", + "bitflags 2.7.0", + "block2 0.5.1", "objc2", "objc2-foundation", ] @@ -4129,12 +4021,24 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ - "block2", + "block2 0.5.1", "objc2", "objc2-foundation", "objc2-metal", ] +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2 0.5.1", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + [[package]] name = "objc2-encode" version = "4.0.3" @@ -4147,22 +4051,46 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.6.0", - "block2", + "bitflags 2.7.0", + "block2 0.5.1", "dispatch", "libc", "objc2", ] +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2 0.5.1", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + [[package]] name = "objc2-metal" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.6.0", - "block2", + "bitflags 2.7.0", + "block2 0.5.1", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-osa-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6788b04a18ea31e3dc3ab256b8546639e5bbae07c1a0dc4ea8615252bc6aee9a" +dependencies = [ + "bitflags 2.7.0", "objc2", + "objc2-app-kit", "objc2-foundation", ] @@ -4172,13 +4100,81 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.6.0", - "block2", + "bitflags 2.7.0", + "block2 0.5.1", "objc2", "objc2-foundation", "objc2-metal", ] +[[package]] +name = "objc2-symbols" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.7.0", + "block2 0.5.1", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2 0.5.1", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.7.0", + "block2 0.5.1", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68bc69301064cebefc6c4c90ce9cba69225239e4b8ff99d445a2b5563797da65" +dependencies = [ + "bitflags 2.7.0", + "block2 0.5.1", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + [[package]] name = "objc_id" version = "0.1.1" @@ -4190,21 +4186,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -4214,9 +4207,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open" -version = "5.3.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a877bf6abd716642a53ef1b89fb498923a4afca5c754f9050b4d081c05c4b3" +checksum = "3ecd52f0b8d15c40ce4820aa251ed5de032e5d91fab27f7db2f40d42a8bdf69c" dependencies = [ "is-wsl", "libc", @@ -4225,11 +4218,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "foreign-types 0.3.2", "libc", @@ -4246,7 +4239,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -4257,18 +4250,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.2+3.3.2" +version = "300.4.1+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -4305,9 +4298,9 @@ dependencies = [ [[package]] name = "os_info" -version = "3.8.2" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" +checksum = "e5ca711d8b83edbb00b44d504503cd247c9c0bd8b0fa2694f2a1a3d8165379ce" dependencies = [ "log", "serde", @@ -4324,6 +4317,20 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "osakit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35366a452fce3f8947eb2f33226a133aaf0cacedef2af67ade348d58be7f85d0" +dependencies = [ + "icrate", + "objc2-foundation", + "objc2-osa-kit", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "pango" version = "0.18.3" @@ -4386,9 +4393,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "pbkdf2" @@ -4519,7 +4526,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -4551,9 +4558,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -4606,7 +4613,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64 0.22.1", - "indexmap 2.5.0", + "indexmap 2.7.0", "quick-xml 0.32.0", "serde", "time", @@ -4622,18 +4629,18 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.4.0", + "hermit-abi", "pin-project-lite", "rustix", "tracing", @@ -4663,12 +4670,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "powerfmt" version = "0.2.0" @@ -4702,12 +4703,20 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit 0.22.22", ] [[package]] @@ -4742,32 +4751,13 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] -[[package]] -name = "profiling" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" -dependencies = [ - "profiling-procmacros", -] - -[[package]] -name = "profiling-procmacros" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" -dependencies = [ - "quote", - "syn 2.0.79", -] - [[package]] name = "psl-types" version = "2.0.11" @@ -4796,35 +4786,20 @@ dependencies = [ [[package]] name = "publicsuffix" -version = "2.2.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457" +checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf" dependencies = [ - "idna 0.3.0", + "idna", "psl-types", ] -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - [[package]] name = "quick-error" version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - [[package]] name = "quick-xml" version = "0.31.0" @@ -4854,9 +4829,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", @@ -4865,34 +4840,38 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror", + "thiserror 2.0.9", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom 0.2.15", "rand 0.8.5", "ring", "rustc-hash", "rustls", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.9", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", @@ -4996,82 +4975,12 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rav1e" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" -dependencies = [ - "arbitrary", - "arg_enum_proc_macro", - "arrayvec", - "av1-grain", - "bitstream-io", - "built", - "cfg-if", - "interpolate_name", - "itertools", - "libc", - "libfuzzer-sys", - "log", - "maybe-rayon", - "new_debug_unreachable", - "noop_proc_macro", - "num-derive", - "num-traits", - "once_cell", - "paste", - "profiling", - "rand 0.8.5", - "rand_chacha 0.3.1", - "simd_helpers", - "system-deps", - "thiserror", - "v_frame", - "wasm-bindgen", -] - -[[package]] -name = "ravif" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc13288f5ab39e6d7c9d501759712e6969fcc9734220846fc9ed26cae2cc4234" -dependencies = [ - "avif-serialize", - "imgref", - "loop9", - "quick-error 2.0.1", - "rav1e", - "rayon", - "rgb", -] - [[package]] name = "raw-window-handle" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "read-progress-stream" version = "1.0.0" @@ -5085,11 +4994,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -5100,14 +5009,25 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 2.0.9", ] [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -5117,9 +5037,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -5143,9 +5063,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "async-compression", "base64 0.22.1", @@ -5175,7 +5095,7 @@ dependencies = [ "pin-project-lite", "quinn", "rustls", - "rustls-native-certs 0.7.3", + "rustls-native-certs", "rustls-pemfile", "rustls-pki-types", "serde", @@ -5210,12 +5130,12 @@ dependencies = [ [[package]] name = "rfd" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af382a047821a08aa6bfc09ab0d80ff48d45d8726f7cd8e44891f7cb4a4278e" +checksum = "46f6f80a9b882647d9014673ca9925d30ffc9750f2eed2b4490e189eaebd01e8" dependencies = [ "ashpd", - "block2", + "block2 0.5.1", "glib-sys", "gobject-sys", "gtk-sys", @@ -5231,15 +5151,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rgb" -version = "0.8.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" -dependencies = [ - "bytemuck", -] - [[package]] name = "ring" version = "0.17.8" @@ -5292,9 +5203,9 @@ checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" [[package]] name = "rsa" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" dependencies = [ "const-oid", "digest", @@ -5368,9 +5279,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustc_version" @@ -5383,11 +5294,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno", "libc", "linux-raw-sys", @@ -5396,9 +5307,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "once_cell", "ring", @@ -5410,45 +5321,33 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "rustls-pki-types", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-native-certs" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.0.1", ] [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -5468,7 +5367,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ "fnv", - "quick-error 1.2.3", + "quick-error", "tempfile", "wait-timeout", ] @@ -5499,9 +5398,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -5530,7 +5429,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5582,18 +5481,31 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", "security-framework-sys", ] +[[package]] +name = "security-framework" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1415a607e92bec364ea2cf9264646dcce0f91e6d65281bd6f2819cca3bf39c8" +dependencies = [ + "bitflags 2.7.0", + "core-foundation 0.10.0", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -5630,9 +5542,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -5650,13 +5562,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5667,16 +5579,16 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ - "itoa 1.0.11", + "itoa 1.0.14", "memchr", "ryu", "serde", @@ -5690,7 +5602,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5709,22 +5621,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.11", + "itoa 1.0.14", "ryu", "serde", ] [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.7.0", "serde", "serde_derive", "serde_json", @@ -5734,14 +5646,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5839,15 +5751,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -[[package]] -name = "simd_helpers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" -dependencies = [ - "quote", -] - [[package]] name = "simdutf8" version = "0.1.5" @@ -5898,9 +5801,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -5913,7 +5816,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08" dependencies = [ "bytemuck", - "cfg_aliases 0.2.1", + "cfg_aliases", "core-graphics 0.24.0", "foreign-types 0.5.0", "js-sys", @@ -5962,7 +5865,7 @@ checksum = "4ccbb212565d2dc177bc15ecb7b039d66c4490da892436a4eee5b394d620c9bc" dependencies = [ "paste", "specta-macros", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -5974,7 +5877,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -6040,7 +5943,7 @@ dependencies = [ "hashbrown 0.14.5", "hashlink", "hex", - "indexmap 2.5.0", + "indexmap 2.7.0", "log", "memchr", "once_cell", @@ -6053,7 +5956,7 @@ dependencies = [ "sha2", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tokio-stream", @@ -6072,7 +5975,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -6095,7 +5998,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.79", + "syn 2.0.90", "tempfile", "tokio", "url", @@ -6109,7 +6012,7 @@ checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.6.0", + "bitflags 2.7.0", "byteorder", "bytes", "crc", @@ -6124,7 +6027,7 @@ dependencies = [ "hex", "hkdf", "hmac", - "itoa 1.0.11", + "itoa 1.0.14", "log", "md-5", "memchr", @@ -6138,7 +6041,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.69", "time", "tracing", "whoami", @@ -6152,7 +6055,7 @@ checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.6.0", + "bitflags 2.7.0", "byteorder", "crc", "dotenvy", @@ -6165,7 +6068,7 @@ dependencies = [ "hkdf", "hmac", "home", - "itoa 1.0.11", + "itoa 1.0.14", "log", "md-5", "memchr", @@ -6177,7 +6080,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.69", "time", "tracing", "whoami", @@ -6281,7 +6184,7 @@ dependencies = [ "nix 0.24.3", "rand 0.8.5", "serde", - "thiserror", + "thiserror 1.0.69", "windows 0.36.1", "zeroize", ] @@ -6310,7 +6213,7 @@ dependencies = [ "paste", "serde", "stronghold-runtime", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -6350,9 +6253,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -6360,31 +6263,30 @@ dependencies = [ ] [[package]] -name = "syn_derive" -version = "0.1.8" +name = "sync_wrapper" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.79", + "futures-core", ] [[package]] -name = "sync_wrapper" -version = "1.0.1" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "futures-core", + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] name = "sys-locale" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" dependencies = [ "libc", ] @@ -6395,7 +6297,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -6419,17 +6321,17 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml 0.8.2", + "toml 0.8.19", "version-compare", ] [[package]] name = "tao" -version = "0.30.2" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e48d7c56b3f7425d061886e8ce3b6acfab1993682ed70bef50fd133d721ee6" +checksum = "3731d04d4ac210cd5f344087733943b9bfb1a32654387dad4d1c70de21aee2c9" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cocoa", "core-foundation 0.10.0", "core-graphics 0.24.0", @@ -6440,7 +6342,6 @@ dependencies = [ "gdkwayland-sys", "gdkx11-sys", "gtk", - "instant", "jni", "lazy_static", "libc", @@ -6470,7 +6371,7 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -6481,9 +6382,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" dependencies = [ "filetime", "libc", @@ -6498,9 +6399,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.0.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3fad474c02a3bcd4a304afff97159a31b9bab84e29563f7109c7b0ce8cd774e" +checksum = "2979ec5ec5a9310b15d1548db3b8de98d8f75abf2b5b00fec9cd5c0553ecc09c" dependencies = [ "anyhow", "bytes", @@ -6538,7 +6439,7 @@ dependencies = [ "tauri-runtime", "tauri-runtime-wry", "tauri-utils", - "thiserror", + "thiserror 2.0.9", "tokio", "tray-icon", "url", @@ -6552,9 +6453,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.1" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "935f9b3c49b22b3e2e485a57f46d61cd1ae07b1cbb2ba87387a387caf2d8c4e7" +checksum = "8e950124f6779c6cf98e3260c7a6c8488a74aa6350dd54c6950fdaa349bca2df" dependencies = [ "anyhow", "cargo_toml", @@ -6570,15 +6471,15 @@ dependencies = [ "tauri-codegen", "tauri-utils", "tauri-winres", - "toml 0.8.2", + "toml 0.8.19", "walkdir", ] [[package]] name = "tauri-codegen" -version = "2.0.1" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95d7443dd4f0b597704b6a14b964ee2ed16e99928d8e6292ae9825f09fbcd30e" +checksum = "f77894f9ddb5cb6c04fcfe8c8869ebe0aded4dabf19917118d48be4a95599ab5" dependencies = [ "base64 0.22.1", "brotli", @@ -6592,9 +6493,9 @@ dependencies = [ "serde", "serde_json", "sha2", - "syn 2.0.79", + "syn 2.0.90", "tauri-utils", - "thiserror", + "thiserror 2.0.9", "time", "url", "uuid", @@ -6603,23 +6504,23 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.1" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d2c0963ccfc3f5194415f2cce7acc975942a8797fbabfb0aa1ed6f59326ae7f" +checksum = "3240a5caed760a532e8f687be6f05b2c7d11a1d791fb53ccc08cfeb3e5308736" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-plugin" -version = "2.0.1" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e6660a409963e4d57b9bfab4addd141eeff41bd3a7fb14e13004a832cf7ef6" +checksum = "5841b9a0200e954ef7457f8d327091424328891e267a97b641dc246cc54d0dec" dependencies = [ "anyhow", "glob", @@ -6628,38 +6529,37 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml 0.8.2", + "toml 0.8.19", "walkdir", ] [[package]] name = "tauri-plugin-autostart" -version = "2.0.1" +version = "2.2.0" dependencies = [ "auto-launch", - "log", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-barcode-scanner" -version = "2.0.1" +version = "2.2.0" dependencies = [ "log", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-biometric" -version = "2.0.1" +version = "2.2.0" dependencies = [ "log", "serde", @@ -6667,12 +6567,12 @@ dependencies = [ "serde_repr", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-cli" -version = "2.0.1" +version = "2.2.0" dependencies = [ "clap", "log", @@ -6680,44 +6580,43 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.0.1" +version = "2.2.1" dependencies = [ "arboard", - "image", "log", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-deep-link" -version = "2.0.1" +version = "2.2.0" dependencies = [ "dunce", - "log", "rust-ini", "serde", "serde_json", "tauri", "tauri-plugin", "tauri-utils", - "thiserror", + "thiserror 2.0.9", + "tracing", "url", - "windows-registry 0.3.0", - "windows-result 0.2.0", + "windows-registry 0.4.0", + "windows-result 0.3.0", ] [[package]] name = "tauri-plugin-dialog" -version = "2.0.1" +version = "2.2.0" dependencies = [ "log", "raw-window-handle", @@ -6727,13 +6626,13 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-fs", - "thiserror", + "thiserror 2.0.9", "url", ] [[package]] name = "tauri-plugin-fs" -version = "2.0.1" +version = "2.2.0" dependencies = [ "anyhow", "dunce", @@ -6747,14 +6646,16 @@ dependencies = [ "serde_repr", "tauri", "tauri-plugin", - "thiserror", + "tauri-utils", + "thiserror 2.0.9", + "toml 0.8.19", "url", "uuid", ] [[package]] name = "tauri-plugin-geolocation" -version = "2.0.1" +version = "2.2.3" dependencies = [ "log", "serde", @@ -6762,12 +6663,12 @@ dependencies = [ "specta", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-global-shortcut" -version = "2.0.1" +version = "2.2.0" dependencies = [ "global-hotkey", "log", @@ -6775,12 +6676,12 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-haptics" -version = "2.0.1" +version = "2.2.3" dependencies = [ "log", "serde", @@ -6788,12 +6689,12 @@ dependencies = [ "specta", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-http" -version = "2.0.1" +version = "2.3.0" dependencies = [ "data-url", "http", @@ -6805,48 +6706,49 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-fs", - "thiserror", + "thiserror 2.0.9", "tokio", + "tracing", "url", "urlpattern", ] [[package]] name = "tauri-plugin-localhost" -version = "2.0.1" +version = "2.2.0" dependencies = [ "http", "log", "serde", "serde_json", "tauri", - "thiserror", + "thiserror 2.0.9", "tiny_http", ] [[package]] name = "tauri-plugin-log" -version = "2.0.1" +version = "2.2.1" dependencies = [ "android_logger", "byte-unit", - "cocoa", "fern", "log", - "objc", + "objc2", + "objc2-foundation", "serde", "serde_json", "serde_repr", "swift-rs", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", "time", ] [[package]] name = "tauri-plugin-nfc" -version = "2.0.1" +version = "2.2.0" dependencies = [ "log", "serde", @@ -6854,12 +6756,12 @@ dependencies = [ "serde_repr", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-notification" -version = "2.0.1" +version = "2.2.1" dependencies = [ "color-backtrace", "ctor", @@ -6872,18 +6774,38 @@ dependencies = [ "serde_repr", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", "time", "url", "win7-notifications", "windows-version", ] +[[package]] +name = "tauri-plugin-opener" +version = "2.2.5" +dependencies = [ + "dunce", + "glob", + "objc2-app-kit", + "objc2-foundation", + "open", + "schemars", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.9", + "url", + "windows 0.58.0", + "zbus", +] + [[package]] name = "tauri-plugin-os" -version = "2.0.1" +version = "2.2.0" dependencies = [ - "gethostname 0.5.0", + "gethostname 1.0.0", "log", "os_info", "serde", @@ -6892,12 +6814,12 @@ dependencies = [ "sys-locale", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-persisted-scope" -version = "2.0.1" +version = "2.2.0" dependencies = [ "aho-corasick", "bincode", @@ -6906,12 +6828,12 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin-fs", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-positioner" -version = "2.0.1" +version = "2.2.0" dependencies = [ "log", "serde", @@ -6919,12 +6841,12 @@ dependencies = [ "serde_repr", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-plugin-process" -version = "2.0.1" +version = "2.2.0" dependencies = [ "tauri", "tauri-plugin", @@ -6932,7 +6854,7 @@ dependencies = [ [[package]] name = "tauri-plugin-shell" -version = "2.0.1" +version = "2.2.0" dependencies = [ "encoding_rs", "log", @@ -6945,59 +6867,59 @@ dependencies = [ "shared_child", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", "tokio", ] [[package]] name = "tauri-plugin-single-instance" -version = "2.0.1" +version = "2.2.1" dependencies = [ - "log", "semver", "serde", "serde_json", "tauri", "tauri-plugin-deep-link", - "thiserror", + "thiserror 2.0.9", + "tracing", "windows-sys 0.59.0", "zbus", ] [[package]] name = "tauri-plugin-sql" -version = "2.0.1" +version = "2.2.0" dependencies = [ "futures-core", - "indexmap 2.5.0", + "indexmap 2.7.0", "log", "serde", "serde_json", "sqlx", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", "time", "tokio", ] [[package]] name = "tauri-plugin-store" -version = "2.0.1" +version = "2.2.0" dependencies = [ "dunce", - "log", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", "tokio", + "tracing", ] [[package]] name = "tauri-plugin-stronghold" -version = "2.0.1" +version = "2.2.0" dependencies = [ "hex", "iota-crypto", @@ -7012,21 +6934,22 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", "zeroize", ] [[package]] name = "tauri-plugin-updater" -version = "2.0.2" +version = "2.5.0" dependencies = [ "base64 0.22.1", - "dirs 5.0.1", + "dirs 6.0.0", "flate2", "futures-util", "http", "infer", "minisign-verify", + "osakit", "percent-encoding", "reqwest", "semver", @@ -7036,7 +6959,7 @@ dependencies = [ "tauri", "tauri-plugin", "tempfile", - "thiserror", + "thiserror 2.0.9", "time", "tokio", "url", @@ -7046,7 +6969,7 @@ dependencies = [ [[package]] name = "tauri-plugin-upload" -version = "2.0.1" +version = "2.2.1" dependencies = [ "futures-util", "log", @@ -7057,14 +6980,14 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", "tokio", "tokio-util", ] [[package]] name = "tauri-plugin-websocket" -version = "2.0.1" +version = "2.3.0" dependencies = [ "futures-util", "http", @@ -7074,29 +6997,29 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", "tokio", "tokio-tungstenite", ] [[package]] name = "tauri-plugin-window-state" -version = "2.0.1" +version = "2.2.1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "log", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror", + "thiserror 2.0.9", ] [[package]] name = "tauri-runtime" -version = "2.0.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af12ad1af974b274ef1d32a94e6eba27a312b429ef28fcb98abc710df7f9151d" +checksum = "2274ef891ccc0a8d318deffa9d70053f947664d12d58b9c0d1ae5e89237e01f7" dependencies = [ "dpi", "gtk", @@ -7106,16 +7029,16 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "thiserror", + "thiserror 2.0.9", "url", "windows 0.58.0", ] [[package]] name = "tauri-runtime-wry" -version = "2.0.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45e88aa0b11b302d836e6ea3e507a6359044c4a8bc86b865ba99868c695753d" +checksum = "3707b40711d3b9f6519150869e358ffbde7c57567fb9b5a8b51150606939b2a0" dependencies = [ "gtk", "http", @@ -7139,9 +7062,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c38b0230d6880cf6dd07b6d7dd7789a0869f98ac12146e0d18d1c1049215a045" +checksum = "96fb10e7cc97456b2d5b9c03e335b5de5da982039a303a20d10006885e4523a0" dependencies = [ "aes-gcm", "brotli", @@ -7151,6 +7074,7 @@ dependencies = [ "getrandom 0.2.15", "glob", "html5ever", + "http", "infer", "json-patch", "kuchikiki", @@ -7168,8 +7092,8 @@ dependencies = [ "serde_with", "serialize-to-javascript", "swift-rs", - "thiserror", - "toml 0.8.2", + "thiserror 2.0.9", + "toml 0.8.19", "url", "urlpattern", "uuid", @@ -7199,9 +7123,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -7238,22 +7162,42 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +dependencies = [ + "thiserror-impl 2.0.9", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -7274,7 +7218,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa 1.0.11", + "itoa 1.0.14", "libc", "num-conv", "num_threads", @@ -7321,6 +7265,16 @@ dependencies = [ "log", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -7338,14 +7292,14 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.2", + "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -7363,7 +7317,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -7395,7 +7349,7 @@ checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" dependencies = [ "either", "futures-util", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -7412,15 +7366,15 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.24.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" +checksum = "be4bf6fecd69fcdede0ec680aaf474cdab988f9de6bc73d3758f0160e3b7025a" dependencies = [ "futures-util", "log", "native-tls", "rustls", - "rustls-native-certs 0.8.0", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-native-tls", @@ -7456,21 +7410,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.22.22", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -7481,24 +7435,35 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.7.0", + "toml_datetime", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -7509,9 +7474,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -7521,29 +7486,29 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] [[package]] name = "tray-icon" -version = "0.19.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "533fc2d4105e0e3d96ce1c71f2d308c9fbbe2ef9c587cab63dd627ab5bde218f" +checksum = "d48a05076dd272615d03033bf04f480199f7d1b66a8ac64d75c625fc4a70c06b" dependencies = [ "core-graphics 0.24.0", "crossbeam-channel", @@ -7556,7 +7521,7 @@ dependencies = [ "once_cell", "png", "serde", - "thiserror", + "thiserror 1.0.69", "windows-sys 0.59.0", ] @@ -7574,9 +7539,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.24.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +checksum = "413083a99c579593656008130e29255e54dcaae495be556cc26888f211648c24" dependencies = [ "byteorder", "bytes", @@ -7589,7 +7554,7 @@ dependencies = [ "rustls", "rustls-pki-types", "sha1", - "thiserror", + "thiserror 2.0.9", "utf-8", ] @@ -7659,24 +7624,21 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" @@ -7689,9 +7651,9 @@ dependencies = [ [[package]] name = "unicode-properties" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] name = "unicode-segmentation" @@ -7748,12 +7710,12 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", "serde", ] @@ -7776,12 +7738,24 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf8-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -7790,30 +7764,19 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom 0.2.15", "serde", ] -[[package]] -name = "v_frame" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" -dependencies = [ - "aligned-vec", - "num-traits", - "wasm-bindgen", -] - [[package]] name = "value-bag" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" [[package]] name = "vcpkg" @@ -7901,9 +7864,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" dependencies = [ "cfg-if", "once_cell", @@ -7912,36 +7875,37 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7949,28 +7913,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" [[package]] name = "wasm-streams" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -7995,11 +7959,11 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.6" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3f45d1222915ef1fd2057220c1d9d9624b7654443ea35c3877f7a52bd0a5a2d" +checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "rustix", "wayland-backend", "wayland-scanner", @@ -8007,11 +7971,11 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.32.4" +version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5755d77ae9040bb872a25026555ce4cb0ae75fd923e90d25fba07d81057de0" +checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -8041,9 +8005,19 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -8095,9 +8069,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -8118,9 +8092,9 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61ff3d9d0ee4efcb461b14eb3acfda2702d10dc329f339303fc3e57215ae2c" +checksum = "823e7ebcfaea51e78f72c87fc3b65a1e602c321f407a0b36dbb327d7bb7cd921" dependencies = [ "webview2-com-macros", "webview2-com-sys", @@ -8138,16 +8112,16 @@ checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] name = "webview2-com-sys" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886" +checksum = "7a82bce72db6e5ee83c68b5de1e2cd6ea195b9fbff91cb37df5884cbe3222df4" dependencies = [ - "thiserror", + "thiserror 1.0.69", "windows 0.58.0", "windows-core 0.58.0", ] @@ -8298,7 +8272,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -8309,7 +8283,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -8320,7 +8294,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -8331,7 +8305,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -8347,13 +8321,13 @@ dependencies = [ [[package]] name = "windows-registry" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafa604f2104cf5ae2cc2db1dee84b7e6a5d11b05f737b60def0ffdc398cbc0a" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ - "windows-result 0.2.0", - "windows-strings 0.2.0", - "windows-targets 0.52.6", + "windows-result 0.3.0", + "windows-strings 0.3.0", + "windows-targets 0.53.0", ] [[package]] @@ -8374,6 +8348,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08106ce80268c4067c0571ca55a9b4e9516518eaa1a1fe9b37ca403ae1d1a34" +dependencies = [ + "windows-targets 0.53.0", +] + [[package]] name = "windows-strings" version = "0.1.0" @@ -8386,11 +8369,11 @@ dependencies = [ [[package]] name = "windows-strings" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978d65aedf914c664c510d9de43c8fd85ca745eaff1ed53edf409b479e441663" +checksum = "b888f919960b42ea4e11c2f408fadb55f78a9f236d5eef084103c8ce52893491" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.53.0", ] [[package]] @@ -8468,13 +8451,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows-version" version = "0.1.1" @@ -8502,6 +8501,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" @@ -8526,6 +8531,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.36.1" @@ -8550,12 +8561,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.36.1" @@ -8580,6 +8603,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" @@ -8604,6 +8633,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -8622,6 +8657,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -8646,6 +8687,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.5.40" @@ -8655,6 +8702,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" @@ -8674,16 +8730,27 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wry" -version = "0.44.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440600584cfbd8b0d28eace95c1f2c253db05dae43780b79380aa1e868f04c73" +checksum = "1e644bf458e27b11b0ecafc9e5633d1304fdae82baca1d42185669752fe6ca4f" dependencies = [ "base64 0.22.1", - "block", - "cocoa", - "core-graphics 0.24.0", + "block2 0.5.1", + "cookie", "crossbeam-channel", "dpi", "dunce", @@ -8696,15 +8763,19 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "objc", - "objc_id", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", "once_cell", "percent-encoding", "raw-window-handle", "sha2", "soup3", "tao-macros", - "thiserror", + "thiserror 2.0.9", + "url", "webkit2gtk", "webkit2gtk-sys", "webview2-com", @@ -8793,11 +8864,35 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", +] + [[package]] name = "zbus" -version = "4.0.1" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b8e3d6ae3342792a6cc2340e4394334c7402f3d793b390d2c5494a4032b3030" +checksum = "192a0d989036cd60a1e91a54c9851fb9ad5bd96125d41803eed79d2e2ef74bd7" dependencies = [ "async-broadcast", "async-executor", @@ -8809,24 +8904,21 @@ dependencies = [ "async-task", "async-trait", "blocking", - "derivative", "enumflags2", "event-listener", "futures-core", - "futures-sink", "futures-util", "hex", - "nix 0.27.1", + "nix 0.29.0", "ordered-stream", - "rand 0.8.5", "serde", "serde_repr", - "sha1", "static_assertions", "tokio", "tracing", "uds_windows", - "windows-sys 0.52.0", + "windows-sys 0.59.0", + "winnow 0.6.20", "xdg-home", "zbus_macros", "zbus_names", @@ -8835,26 +8927,28 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "4.0.1" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7a3e850ff1e7217a3b7a07eba90d37fe9bb9e89a310f718afcde5885ca9b6d7" +checksum = "3685b5c81fce630efc3e143a4ded235b107f1b1cdf186c3f115529e5e5ae4265" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "regex", - "syn 1.0.109", + "syn 2.0.90", + "zbus_names", + "zvariant", "zvariant_utils", ] [[package]] name = "zbus_names" -version = "3.0.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +checksum = "519629a3f80976d89c575895b05677cbc45eaf9f70d62a364d819ba646409cc8" dependencies = [ "serde", "static_assertions", + "winnow 0.6.20", "zvariant", ] @@ -8876,7 +8970,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", ] [[package]] @@ -8897,23 +9012,45 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] name = "zip" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494" +checksum = "99d52293fc86ea7cf13971b3bb81eb21683636e7ae24c729cdaf1b7c4157a352" dependencies = [ "arbitrary", "crc32fast", "crossbeam-utils", "displaydoc", "flate2", - "indexmap 2.5.0", + "indexmap 2.7.0", "memchr", - "thiserror", + "thiserror 2.0.9", "zopfli", ] @@ -8931,64 +9068,45 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "zune-core" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" - -[[package]] -name = "zune-inflate" -version = "0.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "zune-jpeg" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" -dependencies = [ - "zune-core", -] - [[package]] name = "zvariant" -version = "4.0.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e09e8be97d44eeab994d752f341e67b3b0d80512a8b315a0671d47232ef1b65" +checksum = "55e6b9b5f1361de2d5e7d9fd1ee5f6f7fcb6060618a1f82f3472f58f2b8d4be9" dependencies = [ "endi", "enumflags2", "serde", "static_assertions", "url", + "winnow 0.6.20", "zvariant_derive", + "zvariant_utils", ] [[package]] name = "zvariant_derive" -version = "4.0.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a5857e2856435331636a9fbb415b09243df4521a267c5bedcd5289b4d5799e" +checksum = "573a8dd76961957108b10f7a45bac6ab1ea3e9b7fe01aff88325dc57bb8f5c8b" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.90", "zvariant_utils", ] [[package]] name = "zvariant_utils" -version = "1.1.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172" +checksum = "ddd46446ea2a1f353bfda53e35f17633afa79f4fe290a611c94645c69fe96a50" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "serde", + "static_assertions", + "syn 2.0.90", + "winnow 0.6.20", ] diff --git a/Cargo.toml b/Cargo.toml index f4d619d3..d85be889 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,18 +10,20 @@ resolver = "2" [workspace.dependencies] serde = { version = "1", features = ["derive"] } +tracing = "0.1" log = "0.4" -tauri = { version = "2.0.1", default-features = false } -tauri-build = "2.0.1" -tauri-plugin = "2.0.1" -tauri-utils = "2.0.1" +tauri = { version = "2", default-features = false } +tauri-build = "2" +tauri-plugin = "2" +tauri-utils = "2" serde_json = "1" -thiserror = "1" +thiserror = "2" url = "2" schemars = "0.8" dunce = "1" -specta = "=2.0.0-rc.20" -#tauri-specta = "=2.0.0-rc.11" +specta = "^2.0.0-rc.16" +glob = "0.3" +zbus = "5" [workspace.package] edition = "2021" diff --git a/README.md b/README.md index dbb5b0c6..33039295 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,45 @@ +# Official Tauri Plugins + +This repo and all plugins require a Rust version of at least **1.77.2** + ## Plugins Found Here | | | Win | Mac | Lin | iOS | And | | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | --- | --- | --- | -| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ? | ? | +| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ❌ | ❌ | | [barcode-scanner](plugins/barcode-scanner) | Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes. | ? | ? | ? | ✅ | ✅ | | [biometric](plugins/biometric) | Prompt the user for biometric authentication on Android and iOS. | ? | ? | ? | ✅ | ✅ | -| [cli](plugins/cli) | Parse arguments from your Command Line Interface | ✅ | ✅ | ✅ | ? | ? | +| [cli](plugins/cli) | Parse arguments from your Command Line Interface | ✅ | ✅ | ✅ | ❌ | ❌ | | [clipboard-manager](plugins/clipboard-manager) | Read and write to the system clipboard. | ✅ | ✅ | ✅ | ✅ | ✅ | | [deep-link](plugins/deep-link) | Set your Tauri application as the default handler for an URL. | ✅ | ✅ | ✅ | ✅ | ✅ | | [dialog](plugins/dialog) | Native system dialogs for opening and saving files along with message dialogs. | ✅ | ✅ | ✅ | ✅ | ✅ | | [fs](plugins/fs) | Access the file system. | ✅ | ✅ | ✅ | ? | ? | +| [geolocation](plugins/geolocation) | Get and track current device position. | ? | ? | ? | ✅ | ✅ | | [global-shortcut](plugins/global-shortcut) | Register global shortcuts. | ✅ | ✅ | ✅ | ? | ? | +| [haptics](plugins/haptics) | Haptic feedback and vibrations. | ? | ? | ? | ✅ | ✅ | | [http](plugins/http) | Access the HTTP client written in Rust. | ✅ | ✅ | ✅ | ✅ | ✅ | | [localhost](plugins/localhost) | Use a localhost server in production apps. | ✅ | ✅ | ✅ | ? | ? | | [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ | | [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. | ✅ | ✅ | ✅ | ✅ | ✅ | +| [opener](plugins/opener) | Open files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? | | [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ | | [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. | ✅ | ✅ | ✅ | ❌ | ❌ | | [process](plugins/process) | This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. | ✅ | ✅ | ✅ | ? | ? | | [shell](plugins/shell) | Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? | -| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? | -| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? | +| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ✅ | ✅ | ❌ | ❌ | +| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ✅ | ✅ | | [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ✅ | ✅ | | [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? | -| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ? | ? | +| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ❌ | ❌ | | [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? | | [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? | -| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? | +| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ❌ | ❌ | -_This repo and all plugins require a Rust version of at least **1.77.2**_ +- ✅: (Partially) Supported +- ❌: Not supported +- `?` : Unknown/Untested or Planned ## Contributing diff --git a/examples/api/CHANGELOG.md b/examples/api/CHANGELOG.md index 022ce3f2..6c65df1d 100644 --- a/examples/api/CHANGELOG.md +++ b/examples/api/CHANGELOG.md @@ -1,5 +1,114 @@ # Changelog +## \[2.0.13] + +### Dependencies + +- Upgraded to `updater-js@2.5.0` + +## \[2.0.12] + +### Dependencies + +- Upgraded to `clipboard-manager-js@2.2.1` +- Upgraded to `http-js@2.3.0` +- Upgraded to `log-js@2.2.1` +- Upgraded to `updater-js@2.4.0` + +## \[2.0.11] + +### Dependencies + +- Upgraded to `opener-js@2.2.5` + +## \[2.0.10] + +### Dependencies + +- Upgraded to `notification-js@2.2.1` +- Upgraded to `opener-js@2.2.4` + +## \[2.0.9] + +### Dependencies + +- Upgraded to `opener-js@2.2.3` +- Upgraded to `updater-js@2.3.1` + +## \[2.0.8] + +### Dependencies + +- Upgraded to `opener-js@2.2.2` + +## \[2.0.7] + +### Dependencies + +- Upgraded to `updater-js@2.3.0` +- Upgraded to `opener-js@2.2.1` + +## \[2.0.6] + +### Dependencies + +- Upgraded to `barcode-scanner-js@2.1.0` +- Upgraded to `biometric-js@2.1.0` +- Upgraded to `cli-js@2.1.0` +- Upgraded to `clipboard-manager-js@2.1.0` +- Upgraded to `dialog-js@2.1.0` +- Upgraded to `fs-js@2.1.0` +- Upgraded to `global-shortcut-js@2.1.0` +- Upgraded to `http-js@2.1.0` +- Upgraded to `log-js@2.1.0` +- Upgraded to `nfc-js@2.1.0` +- Upgraded to `notification-js@2.1.0` +- Upgraded to `opener-js@2.1.0` +- Upgraded to `os-js@2.1.0` +- Upgraded to `process-js@2.1.0` +- Upgraded to `shell-js@2.1.0` +- Upgraded to `store-js@2.2.0` +- Upgraded to `updater-js@2.1.0` + +## \[2.0.5] + +### Dependencies + +- Upgraded to `fs-js@2.0.4` +- Upgraded to `dialog-js@2.0.2` +- Upgraded to `http-js@2.0.2` + +## \[2.0.4] + +### Dependencies + +- Upgraded to `log-js@2.0.2` + +## \[2.0.3] + +### Dependencies + +- Upgraded to `clipboard-manager-js@2.0.1` +- Upgraded to `log-js@2.0.1` +- Upgraded to `fs-js@2.0.3` +- Upgraded to `opener-js@2.0.0` + +## \[2.0.2] + +### Dependencies + +- Upgraded to `fs-js@2.0.2` + +## \[2.0.1] + +### Dependencies + +- Upgraded to `dialog-js@2.0.1` +- Upgraded to `fs-js@2.0.1` +- Upgraded to `http-js@2.0.1` +- Upgraded to `shell-js@2.0.1` +- Upgraded to `store-js@2.1.0` + ## \[2.0.0] - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. diff --git a/examples/api/package.json b/examples/api/package.json index 599276b8..f86e2c6f 100644 --- a/examples/api/package.json +++ b/examples/api/package.json @@ -1,42 +1,44 @@ { - "name": "svelte-app", + "name": "api", "private": true, - "version": "2.0.0", + "version": "2.0.13", "type": "module", "scripts": { "dev": "vite --clearScreen false", "build": "vite build", - "serve": "vite preview" + "serve": "vite preview", + "tauri": "tauri" }, "dependencies": { - "@tauri-apps/api": "2.0.1", - "@tauri-apps/plugin-barcode-scanner": "2.0.0", - "@tauri-apps/plugin-biometric": "2.0.0", - "@tauri-apps/plugin-cli": "2.0.0", - "@tauri-apps/plugin-clipboard-manager": "2.0.0", - "@tauri-apps/plugin-dialog": "2.0.0", - "@tauri-apps/plugin-fs": "2.0.0", - "@tauri-apps/plugin-geolocation": "2.0.0", - "@tauri-apps/plugin-global-shortcut": "2.0.0", - "@tauri-apps/plugin-haptics": "2.0.0", - "@tauri-apps/plugin-http": "2.0.0", - "@tauri-apps/plugin-nfc": "2.0.0", - "@tauri-apps/plugin-notification": "2.0.0", - "@tauri-apps/plugin-os": "2.0.0", - "@tauri-apps/plugin-process": "2.0.0", - "@tauri-apps/plugin-shell": "2.0.0", - "@tauri-apps/plugin-store": "2.0.0", - "@tauri-apps/plugin-updater": "2.0.0", + "@tauri-apps/api": "2.2.0", + "@tauri-apps/plugin-barcode-scanner": "^2.2.0", + "@tauri-apps/plugin-biometric": "^2.2.0", + "@tauri-apps/plugin-cli": "^2.2.0", + "@tauri-apps/plugin-clipboard-manager": "^2.2.1", + "@tauri-apps/plugin-dialog": "^2.2.0", + "@tauri-apps/plugin-fs": "^2.2.0", + "@tauri-apps/plugin-geolocation": "^2.2.0", + "@tauri-apps/plugin-global-shortcut": "^2.2.0", + "@tauri-apps/plugin-opener": "^2.2.5", + "@tauri-apps/plugin-haptics": "^2.2.0", + "@tauri-apps/plugin-http": "^2.3.0", + "@tauri-apps/plugin-nfc": "^2.2.0", + "@tauri-apps/plugin-notification": "^2.2.1", + "@tauri-apps/plugin-os": "^2.2.0", + "@tauri-apps/plugin-process": "^2.2.0", + "@tauri-apps/plugin-shell": "^2.2.0", + "@tauri-apps/plugin-store": "^2.2.0", + "@tauri-apps/plugin-updater": "^2.5.0", "@zerodevx/svelte-json-view": "1.0.11" }, "devDependencies": { - "@iconify-json/codicon": "^1.1.37", - "@iconify-json/ph": "^1.1.8", - "@sveltejs/vite-plugin-svelte": "^3.0.1", - "@tauri-apps/cli": "2.0.0", - "@unocss/extractor-svelte": "^0.63.0", - "svelte": "^4.2.19", - "unocss": "^0.63.0", - "vite": "^5.4.7" + "@iconify-json/codicon": "^1.2.6", + "@iconify-json/ph": "^1.2.1", + "@sveltejs/vite-plugin-svelte": "^5.0.1", + "@tauri-apps/cli": "2.2.7", + "@unocss/extractor-svelte": "^65.0.0", + "svelte": "^5.10.0", + "unocss": "^65.0.0", + "vite": "^6.0.3" } } diff --git a/examples/api/src-tauri/CHANGELOG.md b/examples/api/src-tauri/CHANGELOG.md index 0f557732..dc3c417c 100644 --- a/examples/api/src-tauri/CHANGELOG.md +++ b/examples/api/src-tauri/CHANGELOG.md @@ -1,5 +1,138 @@ # Changelog +## \[2.0.17] + +### Dependencies + +- Upgraded to `updater@2.5.0` + +## \[2.0.16] + +### Dependencies + +- Upgraded to `clipboard-manager@2.2.1` +- Upgraded to `http@2.3.0` +- Upgraded to `log@2.2.1` +- Upgraded to `updater@2.4.0` + +## \[2.0.15] + +### Dependencies + +- Upgraded to `haptics@2.2.3` +- Upgraded to `geolocation@2.2.3` +- Upgraded to `opener@2.2.5` + +## \[2.0.14] + +### Dependencies + +- Upgraded to `geolocation@2.2.2` +- Upgraded to `haptics@2.2.2` +- Upgraded to `notification@2.2.1` +- Upgraded to `opener@2.2.4` + +## \[2.0.13] + +### Dependencies + +- Upgraded to `geolocation@2.2.1` +- Upgraded to `haptics@2.2.1` + +## \[2.0.12] + +### Dependencies + +- Upgraded to `opener@2.2.3` +- Upgraded to `updater@2.3.1` + +## \[2.0.11] + +### Dependencies + +- Upgraded to `opener@2.2.2` + +## \[2.0.10] + +### Dependencies + +- Upgraded to `updater@2.3.0` +- Upgraded to `opener@2.2.1` + +## \[2.0.9] + +### Dependencies + +- Upgraded to `barcode-scanner@2.1.0` +- Upgraded to `biometric@2.1.0` +- Upgraded to `cli@2.1.0` +- Upgraded to `clipboard-manager@2.1.0` +- Upgraded to `dialog@2.1.0` +- Upgraded to `fs@2.2.0` +- Upgraded to `geolocation@2.1.0` +- Upgraded to `global-shortcut@2.1.0` +- Upgraded to `haptics@2.1.0` +- Upgraded to `http@2.1.0` +- Upgraded to `log@2.1.0` +- Upgraded to `nfc@2.1.0` +- Upgraded to `notification@2.1.0` +- Upgraded to `opener@2.1.0` +- Upgraded to `os@2.1.0` +- Upgraded to `process@2.1.0` +- Upgraded to `shell@2.1.0` +- Upgraded to `store@2.2.0` +- Upgraded to `updater@2.2.0` + +## \[2.0.8] + +### Dependencies + +- Upgraded to `fs@2.1.1` +- Upgraded to `dialog@2.0.5` +- Upgraded to `http@2.0.5` + +## \[2.0.7] + +### Dependencies + +- Upgraded to `log@2.0.4` + +## \[2.0.6] + +### Dependencies + +- Upgraded to `fs@2.1.0` +- Upgraded to `updater@2.1.0` +- Upgraded to `dialog@2.0.4` +- Upgraded to `log-plugin@2.0.3` +- Upgraded to `http@2.0.4` +- Upgraded to `opener@2.0.0` + +## \[2.0.5] + +### Dependencies + +- Upgraded to `clipboard-manager@2.0.2` +- Upgraded to `log-plugin@2.0.2` + +## \[2.0.4] + +### Dependencies + +- Upgraded to `fs@2.0.3` +- Upgraded to `dialog@2.0.3` +- Upgraded to `http@2.0.3` + +## \[2.0.3] + +### Dependencies + +- Upgraded to `dialog@2.0.2` +- Upgraded to `fs@2.0.2` +- Upgraded to `http@2.0.2` +- Upgraded to `shell@2.0.2` +- Upgraded to `store@2.1.0` + ## \[2.0.2] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index 50cd940f..e38c2e47 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "api" publish = false -version = "2.0.2" +version = "2.0.17" description = "An example Tauri Application showcasing the api" edition = "2021" rust-version = { workspace = true } @@ -19,22 +19,23 @@ serde_json = { workspace = true } serde = { workspace = true } tiny_http = "0.12" log = { workspace = true } -tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.1" } -tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.1", features = [ +tauri-plugin-log = { path = "../../../plugins/log", version = "2.2.1" } +tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.2.0", features = [ "watch", ] } -tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.1" } -tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.1" } +tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.2.1" } +tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.2.0" } tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart", -], version = "2.0.1" } -tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.1", features = [ +], version = "2.3.0" } +tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.2.1", features = [ "windows7-compat", ] } -tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.1" } -tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.1" } -tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.1" } -tauri-plugin-store = { path = "../../../plugins/store", version = "2.0.1" } +tauri-plugin-os = { path = "../../../plugins/os", version = "2.2.0" } +tauri-plugin-process = { path = "../../../plugins/process", version = "2.2.0" } +tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.2.5" } +tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.2.0" } +tauri-plugin-store = { path = "../../../plugins/store", version = "2.2.0" } [dependencies.tauri] workspace = true @@ -50,17 +51,17 @@ features = [ ] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.1" } -tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.1" } -tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.2" } -tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0" } +tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.2.0" } +tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.2.0" } +tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.5.0" } +tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" } [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] -tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.1" } -tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.1" } -tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.1" } -tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.1" } -tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.1" } +tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.2.0" } +tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.2.0" } +tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.2.0" } +tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.2.3" } +tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.2.3" } [features] prod = ["tauri/custom-protocol"] diff --git a/examples/api/src-tauri/capabilities/base.json b/examples/api/src-tauri/capabilities/base.json index b76e898c..92532e7d 100644 --- a/examples/api/src-tauri/capabilities/base.json +++ b/examples/api/src-tauri/capabilities/base.json @@ -53,6 +53,7 @@ } ] }, + "shell:allow-open", "shell:allow-kill", "shell:allow-stdin-write", "process:allow-exit", @@ -79,10 +80,11 @@ ], "deny": ["$APPDATA/db/*.stronghold"] }, - "store:allow-entries", - "store:allow-get", - "store:allow-set", - "store:allow-save", - "store:allow-load" + "store:default", + "opener:default", + { + "identifier": "opener:allow-open-path", + "allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }] + } ] } diff --git a/examples/api/src-tauri/capabilities/desktop.json b/examples/api/src-tauri/capabilities/desktop.json index 2edd44cd..82d8354f 100644 --- a/examples/api/src-tauri/capabilities/desktop.json +++ b/examples/api/src-tauri/capabilities/desktop.json @@ -9,6 +9,8 @@ "updater:default", "global-shortcut:allow-unregister", "global-shortcut:allow-register", - "global-shortcut:allow-unregister-all" + "global-shortcut:allow-unregister-all", + { "identifier": "fs:allow-watch", "allow": ["*", "**/*"] }, + "fs:allow-unwatch" ] } diff --git a/examples/api/src-tauri/capabilities/mobile.json b/examples/api/src-tauri/capabilities/mobile.json index 93d46ad2..da77f5e5 100644 --- a/examples/api/src-tauri/capabilities/mobile.json +++ b/examples/api/src-tauri/capabilities/mobile.json @@ -15,6 +15,10 @@ "geolocation:allow-check-permissions", "geolocation:allow-request-permissions", "geolocation:allow-watch-position", - "geolocation:allow-get-current-position" + "geolocation:allow-get-current-position", + "haptics:allow-impact-feedback", + "haptics:allow-notification-feedback", + "haptics:allow-selection-feedback", + "haptics:allow-vibrate" ] } diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index f3cacc43..dc133799 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -36,6 +36,7 @@ pub fn run() { .plugin(tauri_plugin_notification::init()) .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_process::init()) + .plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_store::Builder::default().build()) .setup(move |app| { @@ -67,7 +68,8 @@ pub fn run() { .user_agent(&format!("Tauri API - {}", std::env::consts::OS)) .title("Tauri API Validation") .inner_size(1000., 800.) - .min_inner_size(600., 400.); + .min_inner_size(600., 400.) + .visible(false); } #[cfg(target_os = "windows")] diff --git a/examples/api/src-tauri/src/tray.rs b/examples/api/src-tauri/src/tray.rs index bf3ba5d6..7b1321a5 100644 --- a/examples/api/src-tauri/src/tray.rs +++ b/examples/api/src-tauri/src/tray.rs @@ -45,7 +45,7 @@ pub fn create_tray(app: &tauri::AppHandle) -> tauri::Result<()> { .tooltip("Tauri") .icon(app.default_window_icon().unwrap().clone()) .menu(&menu1) - .menu_on_left_click(false) + .show_menu_on_left_click(false) .on_menu_event(move |app, event| match event.id.as_ref() { "quit" => { app.exit(0); diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index ea626fa2..9396f6f9 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -1,6 +1,5 @@ -

+

This binary can be run from the terminal and takes the following arguments:
@@ -17,7 +17,7 @@
   --verbose
Additionally, it has a update --background subcommand. -

+

Note that the arguments are only parsed, not implemented. diff --git a/examples/api/src/views/Haptics.svelte b/examples/api/src/views/Haptics.svelte new file mode 100644 index 00000000..9ddf15c1 --- /dev/null +++ b/examples/api/src/views/Haptics.svelte @@ -0,0 +1,46 @@ + + +
+ + + + + +
+ +
+ +

+ Depending on your device settings for haptic feedback some of the buttons may + not work. +

diff --git a/examples/api/src/views/Http.svelte b/examples/api/src/views/Http.svelte index e1848803..5c7c3c49 100644 --- a/examples/api/src/views/Http.svelte +++ b/examples/api/src/views/Http.svelte @@ -1,69 +1,69 @@ @@ -82,7 +82,7 @@ placeholder="Request body" rows="5" bind:value={httpBody} - /> + >
diff --git a/examples/api/src/views/Opener.svelte b/examples/api/src/views/Opener.svelte new file mode 100644 index 00000000..eca634ac --- /dev/null +++ b/examples/api/src/views/Opener.svelte @@ -0,0 +1,66 @@ + + +
+
+ + + with + +
+ +
+ + + with + +
+ +
+ + +
+
diff --git a/examples/api/src/views/Scanner.svelte b/examples/api/src/views/Scanner.svelte index 57ff904c..ea0609e3 100644 --- a/examples/api/src/views/Scanner.svelte +++ b/examples/api/src/views/Scanner.svelte @@ -1,38 +1,44 @@ @@ -59,11 +65,12 @@

Aim your camera at a QR code

- +
-
+
@@ -111,7 +118,7 @@ transition: 0.3s; } .square:after { - content: ""; + content: ''; top: 0; display: block; padding-bottom: 100%; @@ -141,7 +148,8 @@ width: 100%; margin: 1rem; border: 2px solid #fff; - box-shadow: 0px 0px 2px 1px rgb(0 0 0 / 0.5), + box-shadow: + 0px 0px 2px 1px rgb(0 0 0 / 0.5), inset 0px 0px 2px 1px rgb(0 0 0 / 0.5); border-radius: 1rem; } diff --git a/examples/api/src/views/Store.svelte b/examples/api/src/views/Store.svelte index d8e6653b..6248b009 100644 --- a/examples/api/src/views/Store.svelte +++ b/examples/api/src/views/Store.svelte @@ -1,5 +1,5 @@ @@ -44,7 +81,12 @@
- +
+ + + + +
diff --git a/examples/api/src/views/Updater.svelte b/examples/api/src/views/Updater.svelte index 819c65e0..2fa5e436 100644 --- a/examples/api/src/views/Updater.svelte +++ b/examples/api/src/views/Updater.svelte @@ -1,56 +1,56 @@
@@ -61,7 +61,7 @@ {:else}
{progress}% -
+
{/if}
diff --git a/package.json b/package.json index c74b41d4..54215699 100644 --- a/package.json +++ b/package.json @@ -7,23 +7,24 @@ "build": "pnpm run -r --parallel --filter !plugins-workspace --filter !\"./plugins/*/examples/**\" --filter !\"./examples/*\" build", "lint": "eslint .", "format": "prettier --write .", - "format:check": "prettier --check ." + "format:check": "prettier --check .", + "example:api:dev": "pnpm run --filter \"api\" tauri dev" }, "devDependencies": { - "@eslint/js": "9.12.0", - "@rollup/plugin-node-resolve": "15.3.0", + "@eslint/js": "9.19.0", + "@rollup/plugin-node-resolve": "16.0.0", "@rollup/plugin-terser": "0.4.4", "@rollup/plugin-typescript": "11.1.6", "@types/eslint__js": "8.42.3", "covector": "^0.12.3", - "eslint": "9.12.0", - "eslint-config-prettier": "9.1.0", + "eslint": "9.19.0", + "eslint-config-prettier": "10.0.1", "eslint-plugin-security": "3.0.1", - "prettier": "3.3.3", - "rollup": "4.22.4", - "tslib": "2.7.0", - "typescript": "5.6.2", - "typescript-eslint": "8.8.0" + "prettier": "3.4.2", + "rollup": "4.34.6", + "tslib": "2.8.1", + "typescript": "5.7.3", + "typescript-eslint": "8.23.0" }, "resolutions": { "semver": ">=7.5.2", diff --git a/plugins/autostart/CHANGELOG.md b/plugins/autostart/CHANGELOG.md index cd26fad7..85b3d5c1 100644 --- a/plugins/autostart/CHANGELOG.md +++ b/plugins/autostart/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -88,11 +92,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/autostart/Cargo.toml b/plugins/autostart/Cargo.toml index 77f555e6..d0a80ddf 100644 --- a/plugins/autostart/Cargo.toml +++ b/plugins/autostart/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-autostart" -version = "2.0.1" +version = "2.2.0" description = "Automatically launch your application at startup." authors = { workspace = true } license = { workspace = true } @@ -27,6 +27,5 @@ tauri-plugin = { workspace = true, features = ["build"] } serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } -log = { workspace = true } thiserror = { workspace = true } auto-launch = "0.5" diff --git a/plugins/autostart/README.md b/plugins/autostart/README.md index 0a1415db..76d68f73 100644 --- a/plugins/autostart/README.md +++ b/plugins/autostart/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-autostart#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust use tauri_plugin_autostart::MacosLauncher; diff --git a/plugins/autostart/package.json b/plugins/autostart/package.json index 9ea68630..876d9295 100644 --- a/plugins/autostart/package.json +++ b/plugins/autostart/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-autostart", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/autostart/src/lib.rs b/plugins/autostart/src/lib.rs index bd3866b3..5550bfa1 100644 --- a/plugins/autostart/src/lib.rs +++ b/plugins/autostart/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/autostart/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/autostart) -//! //! Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux. #![doc( @@ -13,8 +11,6 @@ #![cfg(not(any(target_os = "android", target_os = "ios")))] use auto_launch::{AutoLaunch, AutoLaunchBuilder}; -#[cfg(target_os = "macos")] -use log::info; use serde::{ser::Serializer, Serialize}; use tauri::{ command, @@ -135,7 +131,6 @@ pub fn init( } else { exe_path }; - info!("auto_start path {}", &app_path); builder.set_app_path(&app_path); } #[cfg(target_os = "linux")] diff --git a/plugins/barcode-scanner/CHANGELOG.md b/plugins/barcode-scanner/CHANGELOG.md index 447499bc..3fa878fd 100644 --- a/plugins/barcode-scanner/CHANGELOG.md +++ b/plugins/barcode-scanner/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/barcode-scanner/Cargo.toml b/plugins/barcode-scanner/Cargo.toml index 8fabe711..018b4908 100644 --- a/plugins/barcode-scanner/Cargo.toml +++ b/plugins/barcode-scanner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-barcode-scanner" -version = "2.0.1" +version = "2.2.0" description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS" edition = { workspace = true } authors = { workspace = true } diff --git a/plugins/barcode-scanner/README.md b/plugins/barcode-scanner/README.md index eba7ca9e..4abbef0a 100644 --- a/plugins/barcode-scanner/README.md +++ b/plugins/barcode-scanner/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/barcode-scanner/package.json b/plugins/barcode-scanner/package.json index b90be3d7..9e8c8b56 100644 --- a/plugins/barcode-scanner/package.json +++ b/plugins/barcode-scanner/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-barcode-scanner", - "version": "2.0.0", + "version": "2.2.0", "description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/biometric/CHANGELOG.md b/plugins/biometric/CHANGELOG.md index 1eac8a95..4cd2731d 100644 --- a/plugins/biometric/CHANGELOG.md +++ b/plugins/biometric/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/biometric/Cargo.toml b/plugins/biometric/Cargo.toml index 816c5ef1..b96f55b3 100644 --- a/plugins/biometric/Cargo.toml +++ b/plugins/biometric/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-biometric" -version = "2.0.1" +version = "2.2.0" description = "Prompt the user for biometric authentication on Android and iOS." edition = { workspace = true } authors = { workspace = true } diff --git a/plugins/biometric/README.md b/plugins/biometric/README.md index 2028595d..c7844f7b 100644 --- a/plugins/biometric/README.md +++ b/plugins/biometric/README.md @@ -56,7 +56,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-biometric#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/biometric/package.json b/plugins/biometric/package.json index 5d0cd5c0..fe689d45 100644 --- a/plugins/biometric/package.json +++ b/plugins/biometric/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-biometric", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/cli/CHANGELOG.md b/plugins/cli/CHANGELOG.md index 879c20b6..c2c011e2 100644 --- a/plugins/cli/CHANGELOG.md +++ b/plugins/cli/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -89,10 +93,3 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/cli/Cargo.toml b/plugins/cli/Cargo.toml index b4db6991..500ba957 100644 --- a/plugins/cli/Cargo.toml +++ b/plugins/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-cli" -version = "2.0.1" +version = "2.2.0" description = "Parse arguments from your Tauri application's command line interface." edition = { workspace = true } authors = { workspace = true } diff --git a/plugins/cli/README.md b/plugins/cli/README.md index 05d5bd35..91a8080b 100644 --- a/plugins/cli/README.md +++ b/plugins/cli/README.md @@ -55,7 +55,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-cli#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/cli/package.json b/plugins/cli/package.json index 481082bb..e5ff8b73 100644 --- a/plugins/cli/package.json +++ b/plugins/cli/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-cli", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/cli/src/lib.rs b/plugins/cli/src/lib.rs index 38f64f83..3e144376 100644 --- a/plugins/cli/src/lib.rs +++ b/plugins/cli/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/cli/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/cli) -//! //! Parse arguments from your Command Line Interface. //! //! - Supported platforms: Windows, Linux and macOS. diff --git a/plugins/clipboard-manager/CHANGELOG.md b/plugins/clipboard-manager/CHANGELOG.md index 68dee776..91cfc44d 100644 --- a/plugins/clipboard-manager/CHANGELOG.md +++ b/plugins/clipboard-manager/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## \[2.2.1] + +- [`ce11079f`](https://github.com/tauri-apps/plugins-workspace/commit/ce11079f19852fbefdecf0e4c7d947af3624fee0) ([#2280](https://github.com/tauri-apps/plugins-workspace/pull/2280) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Explicitly drop `arboard::Clipboard` on exit. Add recommendation to not use read methods on the mainthread. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.0.1] + +- [`3fa0fc09`](https://github.com/tauri-apps/plugins-workspace/commit/3fa0fc09bbee0d619801e5757af9fb3c09883c97) ([#2099](https://github.com/tauri-apps/plugins-workspace/pull/2099) by [@rasteiner](https://github.com/tauri-apps/plugins-workspace/../../rasteiner)) Fix clipboard manager client side api not copying fallback alternative text when calling `writeHtml`. + +## \[2.0.2] + +- [`d57df4de`](https://github.com/tauri-apps/plugins-workspace/commit/d57df4debe7c75cfbd6d6558fff1beb07dbee54c) ([#1986](https://github.com/tauri-apps/plugins-workspace/pull/1986) by [@RikaKagurasaka](https://github.com/tauri-apps/plugins-workspace/../../RikaKagurasaka)) Fix that `read_image` wrongly set the image rgba data with binary PNG data. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -108,38 +124,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - hub.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/clipboard-manager/Cargo.toml b/plugins/clipboard-manager/Cargo.toml index 3c086574..5b486fcf 100644 --- a/plugins/clipboard-manager/Cargo.toml +++ b/plugins/clipboard-manager/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-clipboard-manager" -version = "2.0.1" +version = "2.2.1" description = "Read and write to the system clipboard." edition = { workspace = true } authors = { workspace = true } @@ -37,4 +37,3 @@ tauri = { workspace = true, features = ["wry"] } [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] arboard = "3" -image = "0.25" diff --git a/plugins/clipboard-manager/README.md b/plugins/clipboard-manager/README.md index daec970d..57b89526 100644 --- a/plugins/clipboard-manager/README.md +++ b/plugins/clipboard-manager/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { @@ -72,7 +72,6 @@ import { writeText, readText, writeHtml, - readHtml, clear } from '@tauri-apps/plugin-clipboard-manager' await writeText('Tauri is awesome!') diff --git a/plugins/clipboard-manager/api-iife.js b/plugins/clipboard-manager/api-iife.js index 7750e01d..fb245a4e 100644 --- a/plugins/clipboard-manager/api-iife.js +++ b/plugins/clipboard-manager/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var t;async function r(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,r,n,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,r)}(this,t,e)}async close(){return r("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,t,n){return r("plugin:image|new",{rgba:i(e),width:t,height:n}).then((e=>new a(e)))}static async fromBytes(e){return r("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return r("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return r("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return r("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof a?e.rid:e}return e.clear=async function(){await r("plugin:clipboard-manager|clear")},e.readImage=async function(){return await r("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await r("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,t){await r("plugin:clipboard-manager|write_html",{html:e,altHtml:t})},e.writeImage=async function(e){await r("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,t){await r("plugin:clipboard-manager|write_text",{label:t?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var t;async function r(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,r){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,r)}(this,t,e)}async close(){return r("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,t,n){return r("plugin:image|new",{rgba:i(e),width:t,height:n}).then((e=>new a(e)))}static async fromBytes(e){return r("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return r("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return r("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return r("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof a?e.rid:e}return e.clear=async function(){await r("plugin:clipboard-manager|clear")},e.readImage=async function(){return await r("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await r("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,t){await r("plugin:clipboard-manager|write_html",{html:e,altText:t})},e.writeImage=async function(e){await r("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,t){await r("plugin:clipboard-manager|write_text",{label:t?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})} diff --git a/plugins/clipboard-manager/guest-js/index.ts b/plugins/clipboard-manager/guest-js/index.ts index f7f31842..19851fe0 100644 --- a/plugins/clipboard-manager/guest-js/index.ts +++ b/plugins/clipboard-manager/guest-js/index.ts @@ -65,6 +65,7 @@ async function readText(): Promise { * 0, 255, 0, 255, * ]; * await writeImage(buffer); + * ``` * * @returns A promise indicating the success or failure of the operation. * @@ -90,7 +91,7 @@ async function writeImage( * import { readImage } from '@tauri-apps/plugin-clipboard-manager'; * * const clipboardImage = await readImage(); - * const blob = new Blob([clipboardImage.bytes], { type: 'image' }) + * const blob = new Blob([await clipboardImage.rbga()], { type: 'image' }) * const url = URL.createObjectURL(blob) * ``` * @since 2.0.0 @@ -110,9 +111,11 @@ async function readImage(): Promise { * * @example * ```typescript - * import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager'; + * import { writeHtml } from '@tauri-apps/plugin-clipboard-manager'; * await writeHtml('

Tauri is awesome!

', 'plaintext'); - * await writeHtml('

Tauri is awesome!

', '

Tauri is awesome

'); // Will write "

Tauri is awesome

" as plain text + * // The following will write "

Tauri is awesome

" as plain text + * await writeHtml('

Tauri is awesome!

', '

Tauri is awesome

'); + * // we can read html data only as a string so there's just readText(), no readHtml() * assert(await readText(), '

Tauri is awesome!

'); * ``` * @@ -120,10 +123,10 @@ async function readImage(): Promise { * * @since 2.0.0 */ -async function writeHtml(html: string, altHtml?: string): Promise { +async function writeHtml(html: string, altText?: string): Promise { await invoke('plugin:clipboard-manager|write_html', { html, - altHtml + altText }) } diff --git a/plugins/clipboard-manager/package.json b/plugins/clipboard-manager/package.json index f4897994..ff1ba9e7 100644 --- a/plugins/clipboard-manager/package.json +++ b/plugins/clipboard-manager/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-clipboard-manager", - "version": "2.0.0", + "version": "2.2.1", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/clipboard-manager/src/desktop.rs b/plugins/clipboard-manager/src/desktop.rs index bb8ba318..f3570cc0 100644 --- a/plugins/clipboard-manager/src/desktop.rs +++ b/plugins/clipboard-manager/src/desktop.rs @@ -3,7 +3,6 @@ // SPDX-License-Identifier: MIT use arboard::ImageData; -use image::ImageEncoder; use serde::de::DeserializeOwned; use tauri::{image::Image, plugin::PluginApi, AppHandle, Runtime}; @@ -15,7 +14,7 @@ pub fn init( ) -> crate::Result> { Ok(Clipboard { app: app.clone(), - clipboard: arboard::Clipboard::new().map(Mutex::new), + clipboard: arboard::Clipboard::new().map(|c| Mutex::new(Some(c))), }) } @@ -23,13 +22,21 @@ pub fn init( pub struct Clipboard { #[allow(dead_code)] app: AppHandle, - clipboard: Result, arboard::Error>, + // According to arboard docs the clipboard must be dropped before exit. + // Since tauri doesn't call drop on exit we'll use an Option to take() on RunEvent::Exit. + clipboard: Result>, arboard::Error>, } impl Clipboard { pub fn write_text<'a, T: Into>>(&self, text: T) -> crate::Result<()> { match &self.clipboard { - Ok(clipboard) => clipboard.lock().unwrap().set_text(text).map_err(Into::into), + Ok(clipboard) => clipboard + .lock() + .unwrap() + .as_mut() + .unwrap() + .set_text(text) + .map_err(Into::into), Err(e) => Err(crate::Error::Clipboard(e.to_string())), } } @@ -39,6 +46,8 @@ impl Clipboard { Ok(clipboard) => clipboard .lock() .unwrap() + .as_mut() + .unwrap() .set_image(ImageData { bytes: Cow::Borrowed(image.rgba()), width: image.width() as usize, @@ -49,10 +58,11 @@ impl Clipboard { } } + /// Warning: This method should not be used on the main thread! Otherwise the underlying libraries may deadlock on Linux, freezing the whole app, when trying to copy data copied from this app, for example if the user copies text from the WebView. pub fn read_text(&self) -> crate::Result { match &self.clipboard { Ok(clipboard) => { - let text = clipboard.lock().unwrap().get_text()?; + let text = clipboard.lock().unwrap().as_mut().unwrap().get_text()?; Ok(text) } Err(e) => Err(crate::Error::Clipboard(e.to_string())), @@ -68,6 +78,8 @@ impl Clipboard { Ok(clipboard) => clipboard .lock() .unwrap() + .as_mut() + .unwrap() .set_html(html, alt_text) .map_err(Into::into), Err(e) => Err(crate::Error::Clipboard(e.to_string())), @@ -76,28 +88,36 @@ impl Clipboard { pub fn clear(&self) -> crate::Result<()> { match &self.clipboard { - Ok(clipboard) => clipboard.lock().unwrap().clear().map_err(Into::into), + Ok(clipboard) => clipboard + .lock() + .unwrap() + .as_mut() + .unwrap() + .clear() + .map_err(Into::into), Err(e) => Err(crate::Error::Clipboard(e.to_string())), } } + /// Warning: This method should not be used on the main thread! Otherwise the underlying libraries may deadlock on Linux, freezing the whole app, when trying to copy data copied from this app, for example if the user copies text from the WebView. pub fn read_image(&self) -> crate::Result> { match &self.clipboard { Ok(clipboard) => { - let image = clipboard.lock().unwrap().get_image()?; - - let mut buffer: Vec = Vec::new(); - image::codecs::png::PngEncoder::new(&mut buffer).write_image( - &image.bytes, + let image = clipboard.lock().unwrap().as_mut().unwrap().get_image()?; + let image = Image::new_owned( + image.bytes.to_vec(), image.width as u32, image.height as u32, - image::ExtendedColorType::Rgba8, - )?; - - let image = Image::new_owned(buffer, image.width as u32, image.height as u32); + ); Ok(image) } Err(e) => Err(crate::Error::Clipboard(e.to_string())), } } + + pub(crate) fn cleanup(&self) { + if let Ok(clipboard) = &self.clipboard { + clipboard.lock().unwrap().take(); + } + } } diff --git a/plugins/clipboard-manager/src/error.rs b/plugins/clipboard-manager/src/error.rs index 7e36a11b..1b8cf482 100644 --- a/plugins/clipboard-manager/src/error.rs +++ b/plugins/clipboard-manager/src/error.rs @@ -15,9 +15,6 @@ pub enum Error { Clipboard(String), #[error(transparent)] Tauri(#[from] tauri::Error), - #[cfg(desktop)] - #[error("invalid image: {0}")] - Image(#[from] image::ImageError), } impl Serialize for Error { diff --git a/plugins/clipboard-manager/src/lib.rs b/plugins/clipboard-manager/src/lib.rs index 3924d7f1..0cbb4e41 100644 --- a/plugins/clipboard-manager/src/lib.rs +++ b/plugins/clipboard-manager/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/clipboard-manager/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/clipboard-manager) -//! //! Read and write to the system clipboard. #![doc( @@ -13,7 +11,7 @@ use tauri::{ plugin::{Builder, TauriPlugin}, - Manager, Runtime, + Manager, RunEvent, Runtime, }; #[cfg(desktop)] @@ -61,5 +59,11 @@ pub fn init() -> TauriPlugin { app.manage(clipboard); Ok(()) }) + .on_event(|_app, _event| { + #[cfg(desktop)] + if let RunEvent::Exit = _event { + _app.clipboard().cleanup(); + } + }) .build() } diff --git a/plugins/deep-link/CHANGELOG.md b/plugins/deep-link/CHANGELOG.md index 2f2da36d..4c3c9b9a 100644 --- a/plugins/deep-link/CHANGELOG.md +++ b/plugins/deep-link/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.0.1] + +- [`b2aea045`](https://github.com/tauri-apps/plugins-workspace/commit/b2aea0456799775a7243706fdd7a5abf9a193992) ([#2008](https://github.com/tauri-apps/plugins-workspace/pull/2008) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) `onOpenUrl()` will now not call `getCurrent()` anymore, matching the documented behavior. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/deep-link/Cargo.toml b/plugins/deep-link/Cargo.toml index db5c0247..b43b1dfa 100644 --- a/plugins/deep-link/Cargo.toml +++ b/plugins/deep-link/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-deep-link" -version = "2.0.1" +version = "2.2.0" description = "Set your Tauri application as the default handler for an URL" authors = { workspace = true } license = { workspace = true } @@ -32,14 +32,14 @@ serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } tauri-utils = { workspace = true } -log = { workspace = true } +tracing = { workspace = true } thiserror = { workspace = true } url = { workspace = true } [target."cfg(windows)".dependencies] dunce = "1" -windows-registry = "0.3" -windows-result = "0.2" +windows-registry = "0.4" +windows-result = "0.3" [target."cfg(target_os = \"linux\")".dependencies] rust-ini = "0.21" diff --git a/plugins/deep-link/README.md b/plugins/deep-link/README.md index 77fae2c8..61a36a80 100644 --- a/plugins/deep-link/README.md +++ b/plugins/deep-link/README.md @@ -133,7 +133,7 @@ Under `tauri.conf.json > plugins > deep-link`, configure the domains (mobile) an First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/deep-link/api-iife.js b/plugins/deep-link/api-iife.js index eba7152f..6d9e3e18 100644 --- a/plugins/deep-link/api-iife.js +++ b/plugins/deep-link/api-iife.js @@ -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 a={kind:"Any"};return r("plugin:event|listen",{event:e,target:a,handler:n(t)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function a(){return await r("plugin:deep-link|get_current")}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=a,e.isRegistered=async function(e){return await r("plugin:deep-link|is_registered",{protocol:e})},e.onOpenUrl=async function(e){const n=await a();return n&&e(n),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 a={kind:"Any"};return r("plugin:event|listen",{event:e,target:a,handler:n(t)}).then((n=>async()=>async function(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__})} diff --git a/plugins/deep-link/examples/app/CHANGELOG.md b/plugins/deep-link/examples/app/CHANGELOG.md index ba903aea..5e89d0f4 100644 --- a/plugins/deep-link/examples/app/CHANGELOG.md +++ b/plugins/deep-link/examples/app/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## \[2.2.0] + +### Dependencies + +- Upgraded to `deep-link-js@2.1.0` + +## \[2.0.1] + +### Dependencies + +- Upgraded to `deep-link-js@2.0.1` + ## \[2.0.0] - [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release. diff --git a/plugins/deep-link/examples/app/package.json b/plugins/deep-link/examples/app/package.json index 98864087..8cd45fa1 100644 --- a/plugins/deep-link/examples/app/package.json +++ b/plugins/deep-link/examples/app/package.json @@ -1,7 +1,7 @@ { "name": "deep-link-example", "private": true, - "version": "2.0.0", + "version": "2.2.0", "type": "module", "scripts": { "dev": "vite", @@ -10,12 +10,12 @@ "tauri": "tauri" }, "dependencies": { - "@tauri-apps/api": "2.0.1", - "@tauri-apps/plugin-deep-link": "2.0.0" + "@tauri-apps/api": "2.2.0", + "@tauri-apps/plugin-deep-link": "2.2.0" }, "devDependencies": { - "@tauri-apps/cli": "2.0.0", + "@tauri-apps/cli": "2.2.7", "typescript": "^5.2.2", - "vite": "^5.4.7" + "vite": "^6.0.0" } } diff --git a/plugins/deep-link/guest-js/index.ts b/plugins/deep-link/guest-js/index.ts index 49afbab7..461bec8a 100644 --- a/plugins/deep-link/guest-js/index.ts +++ b/plugins/deep-link/guest-js/index.ts @@ -73,7 +73,7 @@ export async function unregister(protocol: string): Promise { * await isRegistered("my-scheme"); * ``` * - * #### - **macOS / Android / iOS**: Unsupported, always returns `true`. + * #### - **macOS / Android / iOS**: Unsupported. * * @since 2.0.0 */ @@ -92,18 +92,13 @@ export async function isRegistered(protocol: string): Promise { * await onOpenUrl((urls) => { console.log(urls) }); * ``` * - * #### - **Windows / Linux**: Unsupported, the OS will spawn a new app instance passing the URL as a CLI argument. + * #### - **Windows / Linux**: Unsupported without the single-instance plugin. The OS will spawn a new app instance passing the URL as a CLI argument. * * @since 2.0.0 */ export async function onOpenUrl( handler: (urls: string[]) => void ): Promise { - const current = await getCurrent() - if (current) { - handler(current) - } - return await listen('deep-link://new-url', (event) => { handler(event.payload) }) diff --git a/plugins/deep-link/package.json b/plugins/deep-link/package.json index c2ca9aa2..0b05dd86 100644 --- a/plugins/deep-link/package.json +++ b/plugins/deep-link/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-deep-link", - "version": "2.0.0", + "version": "2.2.0", "description": "Set your Tauri application as the default handler for an URL", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/deep-link/src/lib.rs b/plugins/deep-link/src/lib.rs index 25cdd317..c259e6b2 100644 --- a/plugins/deep-link/src/lib.rs +++ b/plugins/deep-link/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use std::sync::Arc; - use tauri::{ plugin::{Builder, PluginApi, TauriPlugin}, AppHandle, EventId, Listener, Manager, Runtime, @@ -217,7 +215,7 @@ mod imp { current.replace(vec![url.clone()]); let _ = self.app.emit("deep-link://new-url", vec![url]); } else if cfg!(debug_assertions) { - log::warn!("argument {url} does not match any configured deep link scheme; skipping it"); + tracing::warn!("argument {url} does not match any configured deep link scheme; skipping it"); } } } @@ -478,13 +476,10 @@ impl OpenUrlEvent { } impl DeepLink { - /// Handle a new deep link being triggered to open the app. + /// Helper function for the `deep-link://new-url` event to run a function each time the protocol is triggered while the app is running. /// - /// To avoid race conditions, if the app was started with a deep link, - /// the closure gets immediately called with the deep link URL. + /// Use `get_current` on app load to check whether your app was started via a deep link. pub fn on_open_url(&self, f: F) -> EventId { - let f = Arc::new(f); - let f_ = f.clone(); let event_id = self.app.listen("deep-link://new-url", move |event| { if let Ok(urls) = serde_json::from_str(event.payload()) { f(OpenUrlEvent { @@ -494,13 +489,6 @@ impl DeepLink { } }); - if let Ok(Some(current)) = self.get_current() { - f_(OpenUrlEvent { - id: event_id, - urls: current, - }) - } - event_id } } diff --git a/plugins/dialog/CHANGELOG.md b/plugins/dialog/CHANGELOG.md index 150e092e..07989c79 100644 --- a/plugins/dialog/CHANGELOG.md +++ b/plugins/dialog/CHANGELOG.md @@ -1,5 +1,38 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +### Dependencies + +- Upgraded to `fs-js@2.1.0` + +## \[2.0.2] + +### Dependencies + +- Upgraded to `fs-js@2.0.4` + +## \[2.0.4] + +- [`76f99ce9`](https://github.com/tauri-apps/plugins-workspace/commit/76f99ce999a2ff9e40235c1675e3eb6570b5e1e2) ([#2108](https://github.com/tauri-apps/plugins-workspace/pull/2108) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The `Dialog` struct is now correctly exported, primarily to fix the documentation on `docs.rs`. + +### Dependencies + +- Upgraded to `fs@2.1.0` + +## \[2.0.3] + +### Dependencies + +- Upgraded to `fs@2.0.3` + +## \[2.0.1] + +- [`2302c2db`](https://github.com/tauri-apps/plugins-workspace/commit/2302c2db1c49673e61dcbda8cdb01b2c57e9ba6f) ([#1910](https://github.com/tauri-apps/plugins-workspace/pull/1910) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Fix `ask` and `confirm` not using system button texts +- [`aee14ed4`](https://github.com/tauri-apps/plugins-workspace/commit/aee14ed4261cdedc4ed7cc2686f01f437859a5c7) ([#1892](https://github.com/tauri-apps/plugins-workspace/pull/1892) by [@nashaofu](https://github.com/tauri-apps/plugins-workspace/../../nashaofu)) Set `save` dialog mime type from the `filters` extensions on Android. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -205,86 +238,3 @@ - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! d6e80b)([#545](https://github.com/tauri-apps/plugins-workspace/pull/545)) Fixes docs.rs build by enabling the `tauri/dox` feature flag. -- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11. - -### Dependencies - -- Upgraded to `fs@2.0.0-alpha.1` - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \` - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - ri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \` - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - hub.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - ri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \` - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - alpha release! - pull/371)) First v2 alpha release! - ri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \` - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - 71]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - 7ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - 71]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - kspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! - lpha release! - pull/371)) First v2 alpha release! diff --git a/plugins/dialog/Cargo.toml b/plugins/dialog/Cargo.toml index eec855bd..3ca0df2d 100644 --- a/plugins/dialog/Cargo.toml +++ b/plugins/dialog/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-dialog" -version = "2.0.1" +version = "2.2.0" description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application." edition = { workspace = true } authors = { workspace = true } @@ -34,7 +34,7 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } url = { workspace = true } -tauri-plugin-fs = { path = "../fs", version = "2.0.1" } +tauri-plugin-fs = { path = "../fs", version = "2.2.0" } [target.'cfg(target_os = "ios")'.dependencies] tauri = { workspace = true, features = ["wry"] } diff --git a/plugins/dialog/README.md b/plugins/dialog/README.md index 2259e35b..63d71767 100644 --- a/plugins/dialog/README.md +++ b/plugins/dialog/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-dialog#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/dialog/api-iife.js b/plugins/dialog/api-iife.js index ee604570..c2e0870c 100644 --- a/plugins/dialog/api-iife.js +++ b/plugins/dialog/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()??"Yes",cancelButtonLabel:i?.cancelLabel?.toString()??"No"})},t.confirm=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()??"Ok",cancelButtonLabel:i?.cancelLabel?.toString()??"Cancel"})},t.message=async function(t,e){const i="string"==typeof e?{title:e}:e;await n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,yesButtonLabel:i?.okLabel?.toString(),noButtonLabel:i?.cancelLabel?.toString()})},t.confirm=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString(),cancelButtonLabel:i?.cancelLabel?.toString()})},t.message=async function(t,e){const i="string"==typeof e?{title:e}:e;await n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})} diff --git a/plugins/dialog/guest-js/index.ts b/plugins/dialog/guest-js/index.ts index a6301ebe..150be95a 100644 --- a/plugins/dialog/guest-js/index.ts +++ b/plugins/dialog/guest-js/index.ts @@ -257,8 +257,8 @@ async function ask( message: message.toString(), title: opts?.title?.toString(), kind: opts?.kind, - okButtonLabel: opts?.okLabel?.toString() ?? 'Yes', - cancelButtonLabel: opts?.cancelLabel?.toString() ?? 'No' + yesButtonLabel: opts?.okLabel?.toString(), + noButtonLabel: opts?.cancelLabel?.toString() }) } @@ -287,8 +287,8 @@ async function confirm( message: message.toString(), title: opts?.title?.toString(), kind: opts?.kind, - okButtonLabel: opts?.okLabel?.toString() ?? 'Ok', - cancelButtonLabel: opts?.cancelLabel?.toString() ?? 'Cancel' + okButtonLabel: opts?.okLabel?.toString(), + cancelButtonLabel: opts?.cancelLabel?.toString() }) } diff --git a/plugins/dialog/package.json b/plugins/dialog/package.json index 72ebd27a..52fef579 100644 --- a/plugins/dialog/package.json +++ b/plugins/dialog/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-dialog", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/dialog/src/commands.rs b/plugins/dialog/src/commands.rs index 8690a8b0..c3caf027 100644 --- a/plugins/dialog/src/commands.rs +++ b/plugins/dialog/src/commands.rs @@ -10,7 +10,7 @@ use tauri_plugin_fs::FsExt; use crate::{ Dialog, FileDialogBuilder, FilePath, MessageDialogButtons, MessageDialogKind, Result, CANCEL, - OK, + NO, OK, YES, }; #[derive(Serialize)] @@ -143,7 +143,7 @@ pub(crate) async fn open( for folder in folders { if let Ok(path) = folder.clone().into_path() { if let Some(s) = window.try_fs_scope() { - s.allow_directory(&path, options.recursive); + s.allow_directory(&path, options.recursive)?; } tauri_scope.allow_directory(&path, options.directory)?; } @@ -157,7 +157,7 @@ pub(crate) async fn open( if let Some(folder) = &folder { if let Ok(path) = folder.clone().into_path() { if let Some(s) = window.try_fs_scope() { - s.allow_directory(&path, options.recursive); + s.allow_directory(&path, options.recursive)?; } tauri_scope.allow_directory(&path, options.directory)?; } @@ -175,7 +175,7 @@ pub(crate) async fn open( for file in files { if let Ok(path) = file.clone().into_path() { if let Some(s) = window.try_fs_scope() { - s.allow_file(&path); + s.allow_file(&path)?; } tauri_scope.allow_file(&path)?; @@ -190,7 +190,7 @@ pub(crate) async fn open( if let Some(file) = &file { if let Ok(path) = file.clone().into_path() { if let Some(s) = window.try_fs_scope() { - s.allow_file(&path); + s.allow_file(&path)?; } tauri_scope.allow_file(&path)?; } @@ -232,7 +232,7 @@ pub(crate) async fn save( if let Some(p) = &path { if let Ok(path) = p.clone().into_path() { if let Some(s) = window.try_fs_scope() { - s.allow_file(&path); + s.allow_file(&path)?; } tauri_scope.allow_file(&path)?; } @@ -299,8 +299,8 @@ pub(crate) async fn ask( title: Option, message: String, kind: Option, - ok_button_label: Option, - cancel_button_label: Option, + yes_button_label: Option, + no_button_label: Option, ) -> Result { Ok(message_dialog( window, @@ -308,7 +308,16 @@ pub(crate) async fn ask( title, message, kind, - get_ok_cancel_type(ok_button_label, cancel_button_label), + if let Some(yes_button_label) = yes_button_label { + MessageDialogButtons::OkCancelCustom( + yes_button_label, + no_button_label.unwrap_or(NO.to_string()), + ) + } else if let Some(no_button_label) = no_button_label { + MessageDialogButtons::OkCancelCustom(YES.to_string(), no_button_label) + } else { + MessageDialogButtons::YesNo + }, )) } @@ -328,22 +337,15 @@ pub(crate) async fn confirm( title, message, kind, - get_ok_cancel_type(ok_button_label, cancel_button_label), + if let Some(ok_button_label) = ok_button_label { + MessageDialogButtons::OkCancelCustom( + ok_button_label, + cancel_button_label.unwrap_or(CANCEL.to_string()), + ) + } else if let Some(cancel_button_label) = cancel_button_label { + MessageDialogButtons::OkCancelCustom(OK.to_string(), cancel_button_label) + } else { + MessageDialogButtons::OkCancel + }, )) } - -fn get_ok_cancel_type( - ok_button_label: Option, - cancel_button_label: Option, -) -> MessageDialogButtons { - if let Some(ok_button_label) = ok_button_label { - MessageDialogButtons::OkCancelCustom( - ok_button_label, - cancel_button_label.unwrap_or(CANCEL.to_string()), - ) - } else if let Some(cancel_button_label) = cancel_button_label { - MessageDialogButtons::OkCancelCustom(OK.to_string(), cancel_button_label) - } else { - MessageDialogButtons::OkCancel - } -} diff --git a/plugins/dialog/src/desktop.rs b/plugins/dialog/src/desktop.rs index d30f6bfe..d1a3e8b2 100644 --- a/plugins/dialog/src/desktop.rs +++ b/plugins/dialog/src/desktop.rs @@ -112,6 +112,7 @@ impl From for rfd::MessageButtons { match value { MessageDialogButtons::Ok => Self::Ok, MessageDialogButtons::OkCancel => Self::OkCancel, + MessageDialogButtons::YesNo => Self::YesNo, MessageDialogButtons::OkCustom(ok) => Self::OkCustom(ok), MessageDialogButtons::OkCancelCustom(ok, cancel) => Self::OkCancelCustom(ok, cancel), } diff --git a/plugins/dialog/src/lib.rs b/plugins/dialog/src/lib.rs index a7538e1b..2ef1c1ea 100644 --- a/plugins/dialog/src/lib.rs +++ b/plugins/dialog/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/dialog/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/dialog) -//! //! Native system dialogs for opening and saving files along with message dialogs. #![doc( @@ -41,8 +39,15 @@ use desktop::*; #[cfg(mobile)] use mobile::*; +#[cfg(desktop)] +pub use desktop::Dialog; +#[cfg(mobile)] +pub use mobile::Dialog; + pub(crate) const OK: &str = "Ok"; pub(crate) const CANCEL: &str = "Cancel"; +pub(crate) const YES: &str = "Yes"; +pub(crate) const NO: &str = "No"; macro_rules! blocking_fn { ($self:ident, $fn:ident) => {{ @@ -236,6 +241,7 @@ impl MessageDialogBuilder { let (ok_button_label, cancel_button_label) = match &self.buttons { MessageDialogButtons::Ok => (Some(OK), None), MessageDialogButtons::OkCancel => (Some(OK), Some(CANCEL)), + MessageDialogButtons::YesNo => (Some(YES), Some(NO)), MessageDialogButtons::OkCustom(ok) => (Some(ok.as_str()), Some(CANCEL)), MessageDialogButtons::OkCancelCustom(ok, cancel) => { (Some(ok.as_str()), Some(cancel.as_str())) diff --git a/plugins/dialog/src/models.rs b/plugins/dialog/src/models.rs index 3f9eb6c1..d6452bce 100644 --- a/plugins/dialog/src/models.rs +++ b/plugins/dialog/src/models.rs @@ -59,6 +59,8 @@ pub enum MessageDialogButtons { Ok, /// 2 buttons `Ok` and `Cancel` with OS default dialog texts OkCancel, + /// 2 buttons `Yes` and `No` with OS default dialog texts + YesNo, /// A single `Ok` button with custom text OkCustom(String), /// 2 buttons `Ok` and `Cancel` with custom texts diff --git a/plugins/fs/CHANGELOG.md b/plugins/fs/CHANGELOG.md index 41e6411a..533714ad 100644 --- a/plugins/fs/CHANGELOG.md +++ b/plugins/fs/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.0.4] + +- [`77b85507`](https://github.com/tauri-apps/plugins-workspace/commit/77b855074aad612f2b28e6a3b5881fac767a05ae) ([#2171](https://github.com/tauri-apps/plugins-workspace/pull/2171) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed docs.rs build. + +## \[2.0.3] + +- [`ed981027`](https://github.com/tauri-apps/plugins-workspace/commit/ed981027dd4fba7d0e2f836eb5db34d344388d73) ([#1962](https://github.com/tauri-apps/plugins-workspace/pull/1962) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Improve performance of `readTextFile` and `readTextFileLines` APIs +- [`3e78173d`](https://github.com/tauri-apps/plugins-workspace/commit/3e78173df9ce90aa3b19e1f36d1f8712c5020fb6) ([#2018](https://github.com/tauri-apps/plugins-workspace/pull/2018) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Fix `readDir` function failing to read directories that contain broken symlinks. +- [`5092ea5e`](https://github.com/tauri-apps/plugins-workspace/commit/5092ea5e89817c0550d09b0a4ad17bf1253b23df) ([#1964](https://github.com/tauri-apps/plugins-workspace/pull/1964) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add support for using `ReadableStream` with `writeFile` API. + +## \[2.0.2] + +- [`77149dc4`](https://github.com/tauri-apps/plugins-workspace/commit/77149dc4320d26b413e4a6bbe82c654367c51b32) ([#1965](https://github.com/tauri-apps/plugins-workspace/pull/1965) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Fix `writeTextFile` converting UTF-8 characters (for example `äöü`) in the given path into replacement character (`�`) + +## \[2.0.3] + +- [`14cee64c`](https://github.com/tauri-apps/plugins-workspace/commit/14cee64c82a72655ae6a4ac0892736a2959dbda5) ([#1958](https://github.com/tauri-apps/plugins-workspace/pull/1958) by [@bWanShiTong](https://github.com/tauri-apps/plugins-workspace/../../bWanShiTong)) Fix compilation on targets with pointer width of `16` or `32` + +## \[2.0.1] + +- [`ae802456`](https://github.com/tauri-apps/plugins-workspace/commit/ae8024565f074f313084777c8b10d1b5e3bbe220) ([#1950](https://github.com/tauri-apps/plugins-workspace/pull/1950) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Improve performance of the `FileHandle.read` and `writeTextFile` APIs. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -149,33 +175,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - /pull/454)) Fix `writeBinaryFile` crashing with `command 'write_binary_file' not found` -- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - s/plugins-workspace/pull/371)) First v2 alpha release! - ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - kspace/pull/371)) First v2 alpha release! - s/plugins-workspace/pull/371)) First v2 alpha release! - ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - uri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - kspace/pull/371)) First v2 alpha release! - s/plugins-workspace/pull/371)) First v2 alpha release! - ac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/fs/Cargo.toml b/plugins/fs/Cargo.toml index 1d9b5f34..5768da73 100644 --- a/plugins/fs/Cargo.toml +++ b/plugins/fs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-fs" -version = "2.0.1" +version = "2.2.0" description = "Access the file system." authors = { workspace = true } license = { workspace = true } @@ -14,7 +14,7 @@ rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"] [package.metadata.platforms.support] -windows = { level = "full", notes = "" } +windows = { level = "full", notes = "Apps installed via MSI or NSIS in `perMachine` and `both` mode require admin permissions for write acces in `$RESOURCES` folder" } linux = { level = "full", notes = "No write access to `$RESOURCES` folder" } macos = { level = "full", notes = "No write access to `$RESOURCES` folder" } android = { level = "partial", notes = "Access is restricted to Application folder by default" } @@ -24,6 +24,8 @@ ios = { level = "partial", notes = "Access is restricted to Application folder b tauri-plugin = { workspace = true, features = ["build"] } schemars = { workspace = true } serde = { workspace = true } +toml = "0.8" +tauri-utils = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } @@ -34,9 +36,13 @@ thiserror = { workspace = true } url = { workspace = true } anyhow = "1" uuid = { version = "1", features = ["v4"] } -glob = "0.3" -notify = { version = "6", optional = true, features = ["serde"] } -notify-debouncer-full = { version = "0.3", optional = true } +glob = { workspace = true } +# TODO: Remove `serialization-compat-6` in v3 +notify = { version = "8", optional = true, features = [ + "serde", + "serialization-compat-6", +] } +notify-debouncer-full = { version = "0.5", optional = true } dunce = { workspace = true } percent-encoding = "2" diff --git a/plugins/fs/README.md b/plugins/fs/README.md index af5c63a8..dea88824 100644 --- a/plugins/fs/README.md +++ b/plugins/fs/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-fs#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/fs/api-iife.js b/plugins/fs/api-iife.js index b855277d..1edae3de 100644 --- a/plugins/fs/api-iife.js +++ b/plugins/fs/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_FS__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var i,o,r,a,s,c;"function"==typeof SuppressedError&&SuppressedError;class f{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),o.set(this,0),r.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:a})=>{if(a===e(this,o,"f")){n(this,o,a+1),e(this,i,"f").call(this,t);const s=Object.keys(e(this,r,"f"));if(s.length>0){let t=a+1;for(const n of s.sort()){if(parseInt(n)!==t)break;{const o=e(this,r,"f")[n];delete e(this,r,"f")[n],e(this,i,"f").call(this,o),t+=1}}n(this,o,t)}}else e(this,r,"f")[a.toString()]=t}))}set onmessage(t){n(this,i,t)}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function l(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}i=new WeakMap,o=new WeakMap,r=new WeakMap;class u{get rid(){return e(this,a,"f")}constructor(t){a.set(this,void 0),n(this,a,t)}async close(){return l("plugin:resources|close",{rid:this.rid})}}function p(t){return{isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:null!==t.mtime?new Date(t.mtime):null,atime:null!==t.atime?new Date(t.atime):null,birthtime:null!==t.birthtime?new Date(t.birthtime):null,readonly:t.readonly,fileAttributes:t.fileAttributes,dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,blksize:t.blksize,blocks:t.blocks}}a=new WeakMap,t.BaseDirectory=void 0,(s=t.BaseDirectory||(t.BaseDirectory={}))[s.Audio=1]="Audio",s[s.Cache=2]="Cache",s[s.Config=3]="Config",s[s.Data=4]="Data",s[s.LocalData=5]="LocalData",s[s.Document=6]="Document",s[s.Download=7]="Download",s[s.Picture=8]="Picture",s[s.Public=9]="Public",s[s.Video=10]="Video",s[s.Resource=11]="Resource",s[s.Temp=12]="Temp",s[s.AppConfig=13]="AppConfig",s[s.AppData=14]="AppData",s[s.AppLocalData=15]="AppLocalData",s[s.AppCache=16]="AppCache",s[s.AppLog=17]="AppLog",s[s.Desktop=18]="Desktop",s[s.Executable=19]="Executable",s[s.Font=20]="Font",s[s.Home=21]="Home",s[s.Runtime=22]="Runtime",s[s.Template=23]="Template",t.SeekMode=void 0,(c=t.SeekMode||(t.SeekMode={}))[c.Start=0]="Start",c[c.Current=1]="Current",c[c.End=2]="End";class w extends u{async read(t){if(0===t.byteLength)return 0;const[e,n]=await l("plugin:fs|read",{rid:this.rid,len:t.byteLength});return t.set(e),0===n?null:n}async seek(t,e){return await l("plugin:fs|seek",{rid:this.rid,offset:t,whence:e})}async stat(){return p(await l("plugin:fs|fstat",{rid:this.rid}))}async truncate(t){await l("plugin:fs|ftruncate",{rid:this.rid,len:t})}async write(t){return await l("plugin:fs|write",{rid:this.rid,data:t})}}async function h(t){await l("plugin:fs|unwatch",{rid:t})}return t.FileHandle=w,t.copyFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol||e instanceof URL&&"file:"!==e.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|copy_file",{fromPath:t instanceof URL?t.toString():t,toPath:e instanceof URL?e.toString():e,options:n})},t.create=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|create",{path:t instanceof URL?t.toString():t,options:e});return new w(n)},t.exists=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})},t.lstat=async function(t,e){return p(await l("plugin:fs|lstat",{path:t instanceof URL?t.toString():t,options:e}))},t.mkdir=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})},t.open=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|open",{path:t instanceof URL?t.toString():t,options:e});return new w(n)},t.readDir=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})},t.readFile=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|read_file",{path:t instanceof URL?t.toString():t,options:e});return n instanceof ArrayBuffer?new Uint8Array(n):Uint8Array.from(n)},t.readTextFile=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})},t.readTextFileLines=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=t instanceof URL?t.toString():t;return await Promise.resolve({path:n,rid:null,async next(){null===this.rid&&(this.rid=await l("plugin:fs|read_text_file_lines",{path:n,options:e}));const[t,i]=await l("plugin:fs|read_text_file_lines_next",{rid:this.rid});return i&&(this.rid=null),{value:i?"":t,done:i}},[Symbol.asyncIterator](){return this}})},t.remove=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})},t.rename=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol||e instanceof URL&&"file:"!==e.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|rename",{oldPath:t instanceof URL?t.toString():t,newPath:e instanceof URL?e.toString():e,options:n})},t.stat=async function(t,e){return p(await l("plugin:fs|stat",{path:t instanceof URL?t.toString():t,options:e}))},t.truncate=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|truncate",{path:t instanceof URL?t.toString():t,len:e,options:n})},t.watch=async function(t,e,n){const i={recursive:!1,delayMs:2e3,...n},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new f;r.onmessage=e;const a=await l("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{h(a)}},t.watchImmediate=async function(t,e,n){const i={recursive:!1,...n,delayMs:null},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new f;r.onmessage=e;const a=await l("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{h(a)}},t.writeFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|write_file",e,{headers:{path:encodeURIComponent(t instanceof URL?t.toString():t),options:JSON.stringify(n)}})},t.writeTextFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:n})},t}({});Object.defineProperty(window.__TAURI__,"fs",{value:__TAURI_PLUGIN_FS__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_FS__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var i,o,r,a;"function"==typeof SuppressedError&&SuppressedError;const s="__TAURI_TO_IPC_KEY__";class f{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),o.set(this,0),r.set(this,[]),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:a})=>{if(a==e(this,o,"f"))for(e(this,i,"f").call(this,t),n(this,o,e(this,o,"f")+1);e(this,o,"f")in e(this,r,"f");){const t=e(this,r,"f")[e(this,o,"f")];e(this,i,"f").call(this,t),delete e(this,r,"f")[e(this,o,"f")],n(this,o,e(this,o,"f")+1)}else e(this,r,"f")[a]=t}))}set onmessage(t){n(this,i,t)}get onmessage(){return e(this,i,"f")}[(i=new WeakMap,o=new WeakMap,r=new WeakMap,s)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[s]()}}async function c(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}class l{get rid(){return e(this,a,"f")}constructor(t){a.set(this,void 0),n(this,a,t)}async close(){return c("plugin:resources|close",{rid:this.rid})}}var u,p;function w(t){return{isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:null!==t.mtime?new Date(t.mtime):null,atime:null!==t.atime?new Date(t.atime):null,birthtime:null!==t.birthtime?new Date(t.birthtime):null,readonly:t.readonly,fileAttributes:t.fileAttributes,dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,blksize:t.blksize,blocks:t.blocks}}a=new WeakMap,t.BaseDirectory=void 0,(u=t.BaseDirectory||(t.BaseDirectory={}))[u.Audio=1]="Audio",u[u.Cache=2]="Cache",u[u.Config=3]="Config",u[u.Data=4]="Data",u[u.LocalData=5]="LocalData",u[u.Document=6]="Document",u[u.Download=7]="Download",u[u.Picture=8]="Picture",u[u.Public=9]="Public",u[u.Video=10]="Video",u[u.Resource=11]="Resource",u[u.Temp=12]="Temp",u[u.AppConfig=13]="AppConfig",u[u.AppData=14]="AppData",u[u.AppLocalData=15]="AppLocalData",u[u.AppCache=16]="AppCache",u[u.AppLog=17]="AppLog",u[u.Desktop=18]="Desktop",u[u.Executable=19]="Executable",u[u.Font=20]="Font",u[u.Home=21]="Home",u[u.Runtime=22]="Runtime",u[u.Template=23]="Template",t.SeekMode=void 0,(p=t.SeekMode||(t.SeekMode={}))[p.Start=0]="Start",p[p.Current=1]="Current",p[p.End=2]="End";class h extends l{async read(t){if(0===t.byteLength)return 0;const e=await c("plugin:fs|read",{rid:this.rid,len:t.byteLength}),n=function(t){const e=new Uint8ClampedArray(t),n=e.byteLength;let i=0;for(let t=0;tt instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{y(a)}},t.watchImmediate=async function(t,e,n){const i={recursive:!1,...n,delayMs:null},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new f;r.onmessage=e;const a=await c("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{y(a)}},t.writeFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");if(e instanceof ReadableStream){const i=await d(t,n);for await(const t of e)await i.write(t);await i.close()}else await c("plugin:fs|write_file",e,{headers:{path:encodeURIComponent(t instanceof URL?t.toString():t),options:JSON.stringify(n)}})},t.writeTextFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const i=new TextEncoder;await c("plugin:fs|write_text_file",i.encode(e),{headers:{path:encodeURIComponent(t instanceof URL?t.toString():t),options:JSON.stringify(n)}})},t}({});Object.defineProperty(window.__TAURI__,"fs",{value:__TAURI_PLUGIN_FS__})} diff --git a/plugins/fs/build.rs b/plugins/fs/build.rs index cb9d00da..9c34586e 100644 --- a/plugins/fs/build.rs +++ b/plugins/fs/build.rs @@ -7,6 +7,8 @@ use std::{ path::{Path, PathBuf}, }; +use tauri_utils::acl::manifest::PermissionFile; + #[path = "src/scope.rs"] #[allow(dead_code)] mod scope; @@ -16,10 +18,23 @@ mod scope; #[serde(untagged)] #[allow(unused)] enum FsScopeEntry { - /// FS scope path. + /// A path that can be accessed by the webview when using the fs APIs. + /// FS scope path pattern. + /// + /// The pattern can start with a variable that resolves to a system base directory. + /// The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, + /// `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, + /// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, + /// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. Value(PathBuf), Object { - /// FS scope path. + /// A path that can be accessed by the webview when using the fs APIs. + /// + /// The pattern can start with a variable that resolves to a system base directory. + /// The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, + /// `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, + /// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, + /// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. path: PathBuf, }, } @@ -62,31 +77,32 @@ const BASE_DIR_VARS: &[&str] = &[ "APPCACHE", "APPLOG", ]; -const COMMANDS: &[&str] = &[ - "mkdir", - "create", - "copy_file", - "remove", - "rename", - "truncate", - "ftruncate", - "write", - "write_file", - "write_text_file", - "read_dir", - "read_file", - "read", - "open", - "read_text_file", - "read_text_file_lines", - "read_text_file_lines_next", - "seek", - "stat", - "lstat", - "fstat", - "exists", - "watch", - "unwatch", +const COMMANDS: &[(&str, &[&str])] = &[ + ("mkdir", &[]), + ("create", &[]), + ("copy_file", &[]), + ("remove", &[]), + ("rename", &[]), + ("truncate", &[]), + ("ftruncate", &[]), + ("write", &[]), + ("write_file", &["open", "write"]), + ("write_text_file", &[]), + ("read_dir", &[]), + ("read_file", &[]), + ("read", &[]), + ("open", &[]), + ("read_text_file", &[]), + ("read_text_file_lines", &["read_text_file_lines_next"]), + ("read_text_file_lines_next", &[]), + ("seek", &[]), + ("stat", &[]), + ("lstat", &[]), + ("fstat", &[]), + ("exists", &[]), + ("watch", &[]), + ("unwatch", &[]), + ("size", &[]), ]; fn main() { @@ -192,9 +208,59 @@ permissions = [ } } - tauri_plugin::Builder::new(COMMANDS) - .global_api_script_path("./api-iife.js") - .global_scope_schema(schemars::schema_for!(FsScopeEntry)) - .android_path("android") - .build(); + tauri_plugin::Builder::new( + &COMMANDS + .iter() + // FIXME: https://docs.rs/crate/tauri-plugin-fs/2.1.0/builds/1571296 + .filter(|c| c.1.is_empty()) + .map(|c| c.0) + .collect::>(), + ) + .global_api_script_path("./api-iife.js") + .global_scope_schema(schemars::schema_for!(FsScopeEntry)) + .android_path("android") + .build(); + + // workaround to include nested permissions as `tauri_plugin` doesn't support it + let permissions_dir = autogenerated.join("commands"); + for (command, nested_commands) in COMMANDS { + if nested_commands.is_empty() { + continue; + } + + let permission_path = permissions_dir.join(format!("{command}.toml")); + + let content = std::fs::read_to_string(&permission_path) + .unwrap_or_else(|_| panic!("failed to read {command}.toml")); + + let mut permission_file = toml::from_str::(&content) + .unwrap_or_else(|_| panic!("failed to deserialize {command}.toml")); + + for p in permission_file + .permission + .iter_mut() + .filter(|p| p.identifier.starts_with("allow")) + { + for c in nested_commands.iter().map(|s| s.to_string()) { + if !p.commands.allow.contains(&c) { + p.commands.allow.push(c); + } + } + } + + let out = toml::to_string_pretty(&permission_file) + .unwrap_or_else(|_| panic!("failed to serialize {command}.toml")); + let out = format!( + r#"# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +{out}"# + ); + + if content != out { + std::fs::write(permission_path, out) + .unwrap_or_else(|_| panic!("failed to write {command}.toml")); + } + } } diff --git a/plugins/fs/guest-js/index.ts b/plugins/fs/guest-js/index.ts index 1f314f71..9d894bc5 100644 --- a/plugins/fs/guest-js/index.ts +++ b/plugins/fs/guest-js/index.ts @@ -10,20 +10,33 @@ * This module prevents path traversal, not allowing parent directory accessors to be used * (i.e. "/usr/path/to/../file" or "../path/to/file" paths are not allowed). * Paths accessed with this API must be either relative to one of the {@link BaseDirectory | base directories} - * or created with the {@link https://v2.tauri.app/reference/javascript/api/namespacepath | path API}. + * or created with the {@link https://v2.tauri.app/reference/javascript/api/namespacepath/ | path API}. * * The API has a scope configuration that forces you to restrict the paths that can be accessed using glob patterns. * - * The scope configuration is an array of glob patterns describing folder paths that are allowed. - * For instance, this scope configuration only allows accessing files on the - * *databases* folder of the {@link https://v2.tauri.app/reference/javascript/api/namespacepath/#appdatadir | `$APPDATA` directory}: + * The scope configuration is an array of glob patterns describing file/directory paths that are allowed. + * For instance, this scope configuration allows **all** enabled `fs` APIs to (only) access files in the + * *databases* directory of the {@link https://v2.tauri.app/reference/javascript/api/namespacepath/#appdatadir | `$APPDATA` directory}: * ```json * { - * "plugins": { - * "fs": { - * "scope": ["$APPDATA/databases/*"] + * "permissions": [ + * { + * "identifier": "fs:scope", + * "allow": [{ "path": "$APPDATA/databases/*" }] * } - * } + * ] + * } + * ``` + * + * Scopes can also be applied to specific `fs` APIs by using the API's identifier instead of `fs:scope`: + * ```json + * { + * "permissions": [ + * { + * "identifier": "fs:allow-exists", + * "allow": [{ "path": "$APPDATA/databases/*" }] + * } + * ] * } * ``` * @@ -56,8 +69,6 @@ * * Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access. * - * Note that this scope applies to **all** APIs on this module. - * * @module */ @@ -243,6 +254,26 @@ function parseFileInfo(r: UnparsedFileInfo): FileInfo { } } +// https://mstn.github.io/2018/06/08/fixed-size-arrays-in-typescript/ +type FixedSizeArray = ReadonlyArray & { + length: N +} + +// https://gist.github.com/zapthedingbat/38ebfbedd98396624e5b5f2ff462611d +/** Converts a big-endian eight byte array to number */ +function fromBytes(buffer: FixedSizeArray): number { + const bytes = new Uint8ClampedArray(buffer) + const size = bytes.byteLength + let x = 0 + for (let i = 0; i < size; i++) { + // eslint-disable-next-line security/detect-object-injection + const byte = bytes[i] + x *= 0x100 + x += byte + } + return x +} + /** * The Tauri abstraction for reading and writing files. * @@ -285,12 +316,20 @@ class FileHandle extends Resource { return 0 } - const [data, nread] = await invoke<[number[], number]>('plugin:fs|read', { + const data = await invoke('plugin:fs|read', { rid: this.rid, len: buffer.byteLength }) - buffer.set(data) + // Rust side will never return an empty array for this command and + // ensure there is at least 8 elements there. + // + // This is an optimization to include the number of read bytes (as bigendian bytes) + // at the end of returned array to avoid serialization overhead of separate values. + const nread = fromBytes(data.slice(-8) as FixedSizeArray) + + const bytes = data instanceof ArrayBuffer ? new Uint8Array(data) : data + buffer.set(bytes.slice(0, bytes.length - 8)) return nread === 0 ? null : nread } @@ -389,11 +428,11 @@ class FileHandle extends Resource { } /** - * Writes `p.byteLength` bytes from `p` to the underlying data stream. It - * resolves to the number of bytes written from `p` (`0` <= `n` <= - * `p.byteLength`) or reject with the error encountered that caused the + * Writes `data.byteLength` bytes from `data` to the underlying data stream. It + * resolves to the number of bytes written from `data` (`0` <= `n` <= + * `data.byteLength`) or reject with the error encountered that caused the * write to stop early. `write()` must reject with a non-null error if - * would resolve to `n` < `p.byteLength`. `write()` must not modify the + * would resolve to `n` < `data.byteLength`. `write()` must not modify the * slice data, even temporarily. * * @example @@ -731,10 +770,14 @@ async function readTextFile( throw new TypeError('Must be a file URL.') } - return await invoke('plugin:fs|read_text_file', { + const arr = await invoke('plugin:fs|read_text_file', { path: path instanceof URL ? path.toString() : path, options }) + + const bytes = arr instanceof ArrayBuffer ? arr : Uint8Array.from(arr) + + return new TextDecoder().decode(bytes) } /** @@ -765,6 +808,7 @@ async function readTextFileLines( return await Promise.resolve({ path: pathStr, rid: null as number | null, + async next(): Promise> { if (this.rid === null) { this.rid = await invoke('plugin:fs|read_text_file_lines', { @@ -773,19 +817,35 @@ async function readTextFileLines( }) } - const [line, done] = await invoke<[string | null, boolean]>( + const arr = await invoke( 'plugin:fs|read_text_file_lines_next', { rid: this.rid } ) - // an iteration is over, reset rid for next iteration - if (done) this.rid = null + const bytes = + arr instanceof ArrayBuffer ? new Uint8Array(arr) : Uint8Array.from(arr) + + // Rust side will never return an empty array for this command and + // ensure there is at least one elements there. + // + // This is an optimization to include whether we finished iteration or not (1 or 0) + // at the end of returned array to avoid serialization overhead of separate values. + const done = bytes[bytes.byteLength - 1] === 1 + + if (done) { + // a full iteration is over, reset rid for next iteration + this.rid = null + return { value: null, done } + } + + const line = new TextDecoder().decode(bytes.slice(0, bytes.byteLength)) return { - value: done ? '' : line!, + value: line, done } }, + [Symbol.asyncIterator](): AsyncIterableIterator { return this } @@ -1006,19 +1066,27 @@ interface WriteFileOptions { */ async function writeFile( path: string | URL, - data: Uint8Array, + data: Uint8Array | ReadableStream, options?: WriteFileOptions ): Promise { if (path instanceof URL && path.protocol !== 'file:') { throw new TypeError('Must be a file URL.') } - await invoke('plugin:fs|write_file', data, { - headers: { - path: encodeURIComponent(path instanceof URL ? path.toString() : path), - options: JSON.stringify(options) + if (data instanceof ReadableStream) { + const file = await open(path, options) + for await (const chunk of data) { + await file.write(chunk) } - }) + await file.close() + } else { + await invoke('plugin:fs|write_file', data, { + headers: { + path: encodeURIComponent(path instanceof URL ? path.toString() : path), + options: JSON.stringify(options) + } + }) + } } /** @@ -1041,10 +1109,13 @@ async function writeTextFile( throw new TypeError('Must be a file URL.') } - await invoke('plugin:fs|write_text_file', { - path: path instanceof URL ? path.toString() : path, - data, - options + const encoder = new TextEncoder() + + await invoke('plugin:fs|write_text_file', encoder.encode(data), { + headers: { + path: encodeURIComponent(path instanceof URL ? path.toString() : path), + options: JSON.stringify(options) + } }) } @@ -1251,6 +1322,31 @@ async function watchImmediate( } } +/** + * Get the size of a file or directory. For files, the `stat` functions can be used as well. + * + * If `path` is a directory, this function will recursively iterate over every file and every directory inside of `path` and therefore will be very time consuming if used on larger directories. + * + * @example + * ```typescript + * import { size, BaseDirectory } from '@tauri-apps/plugin-fs'; + * // Get the size of the `$APPDATA/tauri` directory. + * const dirSize = await size('tauri', { baseDir: BaseDirectory.AppData }); + * console.log(dirSize); // 1024 + * ``` + * + * @since 2.1.0 + */ +async function size(path: string | URL): Promise { + if (path instanceof URL && path.protocol !== 'file:') { + throw new TypeError('Must be a file URL.') + } + + return await invoke('plugin:fs|size', { + path: path instanceof URL ? path.toString() : path + }) +} + export type { CreateOptions, OpenOptions, @@ -1298,5 +1394,6 @@ export { writeTextFile, exists, watch, - watchImmediate + watchImmediate, + size } diff --git a/plugins/fs/package.json b/plugins/fs/package.json index 7a6cf527..09efc93d 100644 --- a/plugins/fs/package.json +++ b/plugins/fs/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-fs", - "version": "2.0.0", + "version": "2.2.0", "description": "Access the file system.", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/fs/permissions/autogenerated/commands/read_text_file_lines.toml b/plugins/fs/permissions/autogenerated/commands/read_text_file_lines.toml index 1ba629cb..84b4ebb2 100644 --- a/plugins/fs/permissions/autogenerated/commands/read_text_file_lines.toml +++ b/plugins/fs/permissions/autogenerated/commands/read_text_file_lines.toml @@ -5,9 +5,18 @@ [[permission]] identifier = "allow-read-text-file-lines" description = "Enables the read_text_file_lines command without any pre-configured scope." -commands.allow = ["read_text_file_lines"] + +[permission.commands] +allow = [ + "read_text_file_lines", + "read_text_file_lines_next", +] +deny = [] [[permission]] identifier = "deny-read-text-file-lines" description = "Denies the read_text_file_lines command without any pre-configured scope." -commands.deny = ["read_text_file_lines"] + +[permission.commands] +allow = [] +deny = ["read_text_file_lines"] diff --git a/plugins/fs/permissions/autogenerated/commands/size.toml b/plugins/fs/permissions/autogenerated/commands/size.toml new file mode 100644 index 00000000..8a0ea55c --- /dev/null +++ b/plugins/fs/permissions/autogenerated/commands/size.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-size" +description = "Enables the size command without any pre-configured scope." +commands.allow = ["size"] + +[[permission]] +identifier = "deny-size" +description = "Denies the size command without any pre-configured scope." +commands.deny = ["size"] diff --git a/plugins/fs/permissions/autogenerated/commands/write_file.toml b/plugins/fs/permissions/autogenerated/commands/write_file.toml index cb0450fc..ea7d5136 100644 --- a/plugins/fs/permissions/autogenerated/commands/write_file.toml +++ b/plugins/fs/permissions/autogenerated/commands/write_file.toml @@ -5,9 +5,19 @@ [[permission]] identifier = "allow-write-file" description = "Enables the write_file command without any pre-configured scope." -commands.allow = ["write_file"] + +[permission.commands] +allow = [ + "write_file", + "open", + "write", +] +deny = [] [[permission]] identifier = "deny-write-file" description = "Denies the write_file command without any pre-configured scope." -commands.deny = ["write_file"] + +[permission.commands] +allow = [] +deny = ["write_file"] diff --git a/plugins/fs/permissions/autogenerated/reference.md b/plugins/fs/permissions/autogenerated/reference.md index 79ec2f55..3cec32ed 100644 --- a/plugins/fs/permissions/autogenerated/reference.md +++ b/plugins/fs/permissions/autogenerated/reference.md @@ -24,6 +24,7 @@ This default permission set prevents access to critical components of the Tauri application by default. On Windows the webview data folder access is denied. +#### Included permissions within this default permission set: - `create-app-specific-dirs` @@ -3409,6 +3410,32 @@ Denies the seek command without any pre-configured scope. +`fs:allow-size` + + + + +Enables the size command without any pre-configured scope. + + + + + + + +`fs:deny-size` + + + + +Denies the size command without any pre-configured scope. + + + + + + + `fs:allow-stat` diff --git a/plugins/fs/permissions/default.toml b/plugins/fs/permissions/default.toml index d519d758..4cc7bd51 100644 --- a/plugins/fs/permissions/default.toml +++ b/plugins/fs/permissions/default.toml @@ -26,6 +26,7 @@ This default permission set prevents access to critical components of the Tauri application by default. On Windows the webview data folder access is denied. +#### Included permissions within this default permission set: """ permissions = [ "create-app-specific-dirs", diff --git a/plugins/fs/permissions/read-meta.toml b/plugins/fs/permissions/read-meta.toml index 09c731ad..83024b0c 100644 --- a/plugins/fs/permissions/read-meta.toml +++ b/plugins/fs/permissions/read-meta.toml @@ -3,4 +3,4 @@ [[permission]] identifier = "read-meta" description = "This enables all index or metadata related commands without any pre-configured accessible paths." -commands.allow = ["read_dir", "stat", "lstat", "fstat", "exists"] +commands.allow = ["read_dir", "stat", "lstat", "fstat", "exists", "size"] diff --git a/plugins/fs/permissions/schemas/schema.json b/plugins/fs/permissions/schemas/schema.json index 57ab0634..2c13d5c6 100644 --- a/plugins/fs/permissions/schemas/schema.json +++ b/plugins/fs/permissions/schemas/schema.json @@ -1589,6 +1589,16 @@ "type": "string", "const": "deny-seek" }, + { + "description": "Enables the size command without any pre-configured scope.", + "type": "string", + "const": "allow-size" + }, + { + "description": "Denies the size command without any pre-configured scope.", + "type": "string", + "const": "deny-size" + }, { "description": "Enables the stat command without any pre-configured scope.", "type": "string", @@ -1665,7 +1675,7 @@ "const": "create-app-specific-dirs" }, { - "description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n", + "description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n#### Included permissions within this default permission set:\n", "type": "string", "const": "default" }, diff --git a/plugins/fs/src/commands.rs b/plugins/fs/src/commands.rs index cb40c3ee..29d1104f 100644 --- a/plugins/fs/src/commands.rs +++ b/plugins/fs/src/commands.rs @@ -9,20 +9,20 @@ use tauri::{ ipc::{CommandScope, GlobalScope}, path::BaseDirectory, utils::config::FsScope, - AppHandle, Manager, Resource, ResourceId, Runtime, Webview, + Manager, Resource, ResourceId, Runtime, Webview, }; use std::{ borrow::Cow, fs::File, - io::{BufReader, Lines, Read, Write}, + io::{BufRead, BufReader, Read, Write}, path::{Path, PathBuf}, str::FromStr, sync::Mutex, time::{SystemTime, UNIX_EPOCH}, }; -use crate::{scope::Entry, Error, FsExt, SafeFilePath}; +use crate::{scope::Entry, Error, SafeFilePath}; #[derive(Debug, thiserror::Error)] pub enum CommandError { @@ -245,32 +245,12 @@ pub fn mkdir( #[serde(rename_all = "camelCase")] #[non_exhaustive] pub struct DirEntry { - pub name: Option, + pub name: String, pub is_directory: bool, pub is_file: bool, pub is_symlink: bool, } -fn read_dir_inner>(path: P) -> crate::Result> { - let mut files_and_dirs: Vec = vec![]; - for entry in std::fs::read_dir(path)? { - let path = entry?.path(); - let file_type = path.metadata()?.file_type(); - files_and_dirs.push(DirEntry { - is_directory: file_type.is_dir(), - is_file: file_type.is_file(), - is_symlink: std::fs::symlink_metadata(&path) - .map(|md| md.file_type().is_symlink()) - .unwrap_or(false), - name: path - .file_name() - .map(|name| name.to_string_lossy()) - .map(|name| name.to_string()), - }); - } - Result::Ok(files_and_dirs) -} - #[tauri::command] pub async fn read_dir( webview: Webview, @@ -287,27 +267,73 @@ pub async fn read_dir( options.as_ref().and_then(|o| o.base_dir), )?; - read_dir_inner(&resolved_path) - .map_err(|e| { - format!( - "failed to read directory at path: {} with error: {e}", - resolved_path.display() - ) + let entries = std::fs::read_dir(&resolved_path).map_err(|e| { + format!( + "failed to read directory at path: {} with error: {e}", + resolved_path.display() + ) + })?; + + let entries = entries + .filter_map(|entry| { + let entry = entry.ok()?; + let name = entry.file_name().into_string().ok()?; + let metadata = entry.file_type(); + macro_rules! method_or_false { + ($method:ident) => { + if let Ok(metadata) = &metadata { + metadata.$method() + } else { + false + } + }; + } + Some(DirEntry { + name, + is_file: method_or_false!(is_file), + is_directory: method_or_false!(is_dir), + is_symlink: method_or_false!(is_symlink), + }) }) - .map_err(Into::into) + .collect(); + + Ok(entries) } #[tauri::command] pub async fn read( webview: Webview, rid: ResourceId, - len: u32, -) -> CommandResult<(Vec, usize)> { - let mut data = vec![0; len as usize]; + len: usize, +) -> CommandResult { + let mut data = vec![0; len]; let file = webview.resources_table().get::(rid)?; let nread = StdFileResource::with_lock(&file, |mut file| file.read(&mut data)) .map_err(|e| format!("faied to read bytes from file with error: {e}"))?; - Ok((data, nread)) + + // This is an optimization to include the number of read bytes (as bigendian bytes) + // at the end of returned vector so we can use `tauri::ipc::Response` + // and avoid serialization overhead of separate values. + #[cfg(target_pointer_width = "16")] + let nread = { + let nread = nread.to_be_bytes(); + let mut out = [0; 8]; + out[6..].copy_from_slice(&nread); + out + }; + #[cfg(target_pointer_width = "32")] + let nread = { + let nread = nread.to_be_bytes(); + let mut out = [0; 8]; + out[4..].copy_from_slice(&nread); + out + }; + #[cfg(target_pointer_width = "64")] + let nread = nread.to_be_bytes(); + + data.extend(nread); + + Ok(tauri::ipc::Response::new(data)) } #[tauri::command] @@ -346,6 +372,7 @@ pub async fn read_file( Ok(tauri::ipc::Response::new(contents)) } +// TODO, remove in v3, rely on `read_file` command instead #[tauri::command] pub async fn read_text_file( webview: Webview, @@ -353,33 +380,8 @@ pub async fn read_text_file( command_scope: CommandScope, path: SafeFilePath, options: Option, -) -> CommandResult { - let (mut file, path) = resolve_file( - &webview, - &global_scope, - &command_scope, - path, - OpenOptions { - base: BaseOptions { - base_dir: options.as_ref().and_then(|o| o.base_dir), - }, - options: crate::OpenOptions { - read: true, - ..Default::default() - }, - }, - )?; - - let mut contents = String::new(); - - file.read_to_string(&mut contents).map_err(|e| { - format!( - "failed to read file as text at path: {} with error: {e}", - path.display() - ) - })?; - - Ok(contents) +) -> CommandResult { + read_file(webview, global_scope, command_scope, path, options).await } #[tauri::command] @@ -390,8 +392,6 @@ pub fn read_text_file_lines( path: SafeFilePath, options: Option, ) -> CommandResult { - use std::io::BufRead; - let resolved_path = resolve_path( &webview, &global_scope, @@ -407,7 +407,7 @@ pub fn read_text_file_lines( ) })?; - let lines = BufReader::new(file).lines(); + let lines = BufReader::new(file); let rid = webview.resources_table().add(StdLinesResource::new(lines)); Ok(rid) @@ -417,18 +417,28 @@ pub fn read_text_file_lines( pub async fn read_text_file_lines_next( webview: Webview, rid: ResourceId, -) -> CommandResult<(Option, bool)> { +) -> CommandResult { let mut resource_table = webview.resources_table(); let lines = resource_table.get::(rid)?; - let ret = StdLinesResource::with_lock(&lines, |lines| { - lines.next().map(|a| (a.ok(), false)).unwrap_or_else(|| { - let _ = resource_table.close(rid); - (None, true) - }) + let ret = StdLinesResource::with_lock(&lines, |lines| -> CommandResult> { + // This is an optimization to include wether we finished iteration or not (1 or 0) + // at the end of returned vector so we can use `tauri::ipc::Response` + // and avoid serialization overhead of separate values. + match lines.next() { + Some(Ok(mut bytes)) => { + bytes.push(false as u8); + Ok(bytes) + } + Some(Err(_)) => Ok(vec![false as u8]), + None => { + resource_table.close(rid)?; + Ok(vec![true as u8]) + } + } }); - Ok(ret) + ret.map(tauri::ipc::Response::new) } #[derive(Debug, Clone, Deserialize)] @@ -779,18 +789,43 @@ fn default_create_value() -> bool { true } -fn write_file_inner( +#[tauri::command] +pub async fn write_file( webview: Webview, - global_scope: &GlobalScope, - command_scope: &CommandScope, - path: SafeFilePath, - data: &[u8], - options: Option, + global_scope: GlobalScope, + command_scope: CommandScope, + request: tauri::ipc::Request<'_>, ) -> CommandResult<()> { + let data = match request.body() { + tauri::ipc::InvokeBody::Raw(data) => Cow::Borrowed(data), + tauri::ipc::InvokeBody::Json(serde_json::Value::Array(data)) => Cow::Owned( + data.iter() + .flat_map(|v| v.as_number().and_then(|v| v.as_u64().map(|v| v as u8))) + .collect(), + ), + _ => return Err(anyhow::anyhow!("unexpected invoke body").into()), + }; + + let path = request + .headers() + .get("path") + .ok_or_else(|| anyhow::anyhow!("missing file path").into()) + .and_then(|p| { + percent_encoding::percent_decode(p.as_ref()) + .decode_utf8() + .map_err(|_| anyhow::anyhow!("path is not a valid UTF-8").into()) + }) + .and_then(|p| SafeFilePath::from_str(&p).map_err(CommandError::from))?; + let options: Option = request + .headers() + .get("options") + .and_then(|p| p.to_str().ok()) + .and_then(|opts| serde_json::from_str(opts).ok()); + let (mut file, path) = resolve_file( &webview, - global_scope, - command_scope, + &global_scope, + &command_scope, path, if let Some(opts) = options { OpenOptions { @@ -823,7 +858,7 @@ fn write_file_inner( }, )?; - file.write_all(data) + file.write_all(&data) .map_err(|e| { format!( "failed to write bytes to file at path: {} with error: {e}", @@ -833,69 +868,43 @@ fn write_file_inner( .map_err(Into::into) } +// TODO, remove in v3, rely on `write_file` command instead #[tauri::command] -pub async fn write_file( +pub async fn write_text_file( webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, request: tauri::ipc::Request<'_>, ) -> CommandResult<()> { - let data = match request.body() { - tauri::ipc::InvokeBody::Raw(data) => Cow::Borrowed(data), - tauri::ipc::InvokeBody::Json(serde_json::Value::Array(data)) => Cow::Owned( - data.iter() - .flat_map(|v| v.as_number().and_then(|v| v.as_u64().map(|v| v as u8))) - .collect(), - ), - _ => return Err(anyhow::anyhow!("unexpected invoke body").into()), - }; - - let path = request - .headers() - .get("path") - .ok_or_else(|| anyhow::anyhow!("missing file path").into()) - .and_then(|p| { - percent_encoding::percent_decode(p.as_ref()) - .decode_utf8() - .map_err(|_| anyhow::anyhow!("path is not a valid UTF-8").into()) - }) - .and_then(|p| SafeFilePath::from_str(&p).map_err(CommandError::from))?; - let options = request - .headers() - .get("options") - .and_then(|p| p.to_str().ok()) - .and_then(|opts| serde_json::from_str(opts).ok()); - write_file_inner(webview, &global_scope, &command_scope, path, &data, options) + write_file(webview, global_scope, command_scope, request).await } #[tauri::command] -pub async fn write_text_file( - #[allow(unused)] app: AppHandle, - #[allow(unused)] webview: Webview, - #[allow(unused)] global_scope: GlobalScope, - #[allow(unused)] command_scope: CommandScope, +pub fn exists( + webview: Webview, + global_scope: GlobalScope, + command_scope: CommandScope, path: SafeFilePath, - data: String, - #[allow(unused)] options: Option, -) -> CommandResult<()> { - write_file_inner( - webview, + options: Option, +) -> CommandResult { + let resolved_path = resolve_path( + &webview, &global_scope, &command_scope, path, - data.as_bytes(), - options, - ) + options.as_ref().and_then(|o| o.base_dir), + )?; + Ok(resolved_path.exists()) } #[tauri::command] -pub fn exists( +pub async fn size( webview: Webview, global_scope: GlobalScope, command_scope: CommandScope, path: SafeFilePath, options: Option, -) -> CommandResult { +) -> CommandResult { let resolved_path = resolve_path( &webview, &global_scope, @@ -903,7 +912,38 @@ pub fn exists( path, options.as_ref().and_then(|o| o.base_dir), )?; - Ok(resolved_path.exists()) + + let metadata = resolved_path.metadata()?; + + if metadata.is_file() { + Ok(metadata.len()) + } else { + let size = get_dir_size(&resolved_path).map_err(|e| { + format!( + "failed to get size at path: {} with error: {e}", + resolved_path.display() + ) + })?; + + Ok(size) + } +} + +fn get_dir_size(path: &PathBuf) -> CommandResult { + let mut size = 0; + + for entry in std::fs::read_dir(path)? { + let entry = entry?; + let metadata = entry.metadata()?; + + if metadata.is_file() { + size += metadata.len(); + } else if metadata.is_dir() { + size += get_dir_size(&entry.path())?; + } + } + + Ok(size) } #[cfg(not(target_os = "android"))] @@ -951,6 +991,8 @@ pub fn resolve_file( path: SafeFilePath, open_options: OpenOptions, ) -> CommandResult<(File, PathBuf)> { + use crate::FsExt; + match path { SafeFilePath::Url(url) => { let path = url.as_str().into(); @@ -983,40 +1025,81 @@ pub fn resolve_path( path }; + let fs_scope = webview.state::(); + let scope = tauri::scope::fs::Scope::new( webview, &FsScope::Scope { - allow: webview - .fs_scope() - .allowed - .lock() - .unwrap() - .clone() - .into_iter() - .chain(global_scope.allows().iter().filter_map(|e| e.path.clone())) + allow: global_scope + .allows() + .iter() + .filter_map(|e| e.path.clone()) .chain(command_scope.allows().iter().filter_map(|e| e.path.clone())) .collect(), - deny: webview - .fs_scope() - .denied - .lock() - .unwrap() - .clone() - .into_iter() - .chain(global_scope.denies().iter().filter_map(|e| e.path.clone())) + deny: global_scope + .denies() + .iter() + .filter_map(|e| e.path.clone()) .chain(command_scope.denies().iter().filter_map(|e| e.path.clone())) .collect(), - require_literal_leading_dot: webview.fs_scope().require_literal_leading_dot, + require_literal_leading_dot: fs_scope.require_literal_leading_dot, }, )?; - if scope.is_allowed(&path) { + let require_literal_leading_dot = fs_scope.require_literal_leading_dot.unwrap_or(cfg!(unix)); + + if is_forbidden(&fs_scope.scope, &path, require_literal_leading_dot) + || is_forbidden(&scope, &path, require_literal_leading_dot) + { + return Err(CommandError::Plugin(Error::PathForbidden(path))); + } + + if fs_scope.scope.is_allowed(&path) || scope.is_allowed(&path) { Ok(path) } else { Err(CommandError::Plugin(Error::PathForbidden(path))) } } +fn is_forbidden>( + scope: &tauri::fs::Scope, + path: P, + require_literal_leading_dot: bool, +) -> bool { + let path = path.as_ref(); + let path = if path.is_symlink() { + match std::fs::read_link(path) { + Ok(p) => p, + Err(_) => return false, + } + } else { + path.to_path_buf() + }; + let path = if !path.exists() { + crate::Result::Ok(path) + } else { + std::fs::canonicalize(path).map_err(Into::into) + }; + + if let Ok(path) = path { + let path: PathBuf = path.components().collect(); + scope.forbidden_patterns().iter().any(|p| { + p.matches_path_with( + &path, + glob::MatchOptions { + // this is needed so `/dir/*` doesn't match files within subdirectories such as `/dir/subdir/file.txt` + // see: + require_literal_separator: true, + require_literal_leading_dot, + ..Default::default() + }, + ) + }) + } else { + false + } +} + struct StdFileResource(Mutex); impl StdFileResource { @@ -1032,14 +1115,38 @@ impl StdFileResource { impl Resource for StdFileResource {} -struct StdLinesResource(Mutex>>); +/// Same as [std::io::Lines] but with bytes +struct LinesBytes(T); + +impl Iterator for LinesBytes { + type Item = std::io::Result>; + + fn next(&mut self) -> Option>> { + let mut buf = Vec::new(); + match self.0.read_until(b'\n', &mut buf) { + Ok(0) => None, + Ok(_n) => { + if buf.last() == Some(&b'\n') { + buf.pop(); + if buf.last() == Some(&b'\r') { + buf.pop(); + } + } + Some(Ok(buf)) + } + Err(e) => Some(Err(e)), + } + } +} + +struct StdLinesResource(Mutex>>); impl StdLinesResource { - fn new(lines: Lines>) -> Self { - Self(Mutex::new(lines)) + fn new(lines: BufReader) -> Self { + Self(Mutex::new(LinesBytes(lines))) } - fn with_lock>) -> R>(&self, mut f: F) -> R { + fn with_lock>) -> R>(&self, mut f: F) -> R { let mut lines = self.0.lock().unwrap(); f(&mut lines) } @@ -1138,7 +1245,12 @@ fn get_stat(metadata: std::fs::Metadata) -> FileInfo { } } +#[cfg(test)] mod test { + use std::io::{BufRead, BufReader}; + + use super::LinesBytes; + #[test] fn safe_file_path_parse() { use super::SafeFilePath; @@ -1152,4 +1264,24 @@ mod test { Ok(SafeFilePath::Url(_)) )); } + + #[test] + fn test_lines_bytes() { + let base = String::from("line 1\nline2\nline 3\nline 4"); + let bytes = base.as_bytes(); + + let string1 = base.lines().collect::(); + let string2 = BufReader::new(bytes) + .lines() + .map_while(Result::ok) + .collect::(); + let string3 = LinesBytes(BufReader::new(bytes)) + .flatten() + .flat_map(String::from_utf8) + .collect::(); + + assert_eq!(string1, string2); + assert_eq!(string1, string3); + assert_eq!(string2, string3); + } } diff --git a/plugins/fs/src/file_path.rs b/plugins/fs/src/file_path.rs index 9ff7a947..735fc105 100644 --- a/plugins/fs/src/file_path.rs +++ b/plugins/fs/src/file_path.rs @@ -138,7 +138,7 @@ impl<'de> serde::Deserialize<'de> for FilePath { { struct FilePathVisitor; - impl<'de> serde::de::Visitor<'de> for FilePathVisitor { + impl serde::de::Visitor<'_> for FilePathVisitor { type Value = FilePath; fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { @@ -169,7 +169,7 @@ impl<'de> serde::Deserialize<'de> for SafeFilePath { { struct SafeFilePathVisitor; - impl<'de> serde::de::Visitor<'de> for SafeFilePathVisitor { + impl serde::de::Visitor<'_> for SafeFilePathVisitor { type Value = SafeFilePath; fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { diff --git a/plugins/fs/src/lib.rs b/plugins/fs/src/lib.rs index a1cf2766..731c7040 100644 --- a/plugins/fs/src/lib.rs +++ b/plugins/fs/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/fs/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/fs) -//! //! Access the file system. #![doc( @@ -17,7 +15,7 @@ use serde::Deserialize; use tauri::{ ipc::ScopeObject, plugin::{Builder as PluginBuilder, TauriPlugin}, - utils::acl::Value, + utils::{acl::Value, config::FsScope}, AppHandle, DragDropEvent, Manager, RunEvent, Runtime, WindowEvent, }; @@ -41,7 +39,6 @@ pub use desktop::Fs; pub use mobile::Fs; pub use error::Error; -pub use scope::{Event as ScopeEvent, Scope}; pub use file_path::FilePath; pub use file_path::SafeFilePath; @@ -367,21 +364,26 @@ impl ScopeObject for scope::Entry { } } +pub(crate) struct Scope { + pub(crate) scope: tauri::fs::Scope, + pub(crate) require_literal_leading_dot: Option, +} + pub trait FsExt { - fn fs_scope(&self) -> &Scope; - fn try_fs_scope(&self) -> Option<&Scope>; + fn fs_scope(&self) -> tauri::fs::Scope; + fn try_fs_scope(&self) -> Option; /// Cross platform file system APIs that also support manipulating Android files. fn fs(&self) -> &Fs; } impl> FsExt for T { - fn fs_scope(&self) -> &Scope { - self.state::().inner() + fn fs_scope(&self) -> tauri::fs::Scope { + self.state::().scope.clone() } - fn try_fs_scope(&self) -> Option<&Scope> { - self.try_state::().map(|s| s.inner()) + fn try_fs_scope(&self) -> Option { + self.try_state::().map(|s| s.scope.clone()) } fn fs(&self) -> &Fs { @@ -415,17 +417,20 @@ pub fn init() -> TauriPlugin> { commands::write_file, commands::write_text_file, commands::exists, + commands::size, #[cfg(feature = "watch")] watcher::watch, #[cfg(feature = "watch")] watcher::unwatch ]) .setup(|app, api| { - let mut scope = Scope::default(); - scope.require_literal_leading_dot = api - .config() - .as_ref() - .and_then(|c| c.require_literal_leading_dot); + let scope = Scope { + require_literal_leading_dot: api + .config() + .as_ref() + .and_then(|c| c.require_literal_leading_dot), + scope: tauri::fs::Scope::new(app, &FsScope::default())?, + }; #[cfg(target_os = "android")] { @@ -448,9 +453,9 @@ pub fn init() -> TauriPlugin> { let scope = app.fs_scope(); for path in paths { if path.is_file() { - scope.allow_file(path); + let _ = scope.allow_file(path); } else { - scope.allow_directory(path, true); + let _ = scope.allow_directory(path, true); } } } diff --git a/plugins/fs/src/scope.rs b/plugins/fs/src/scope.rs index e8361d51..7914706a 100644 --- a/plugins/fs/src/scope.rs +++ b/plugins/fs/src/scope.rs @@ -2,130 +2,18 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use std::{ - collections::HashMap, - path::{Path, PathBuf}, - sync::{ - atomic::{AtomicU32, Ordering}, - Mutex, - }, -}; +use std::path::PathBuf; use serde::Deserialize; -#[derive(Deserialize)] -#[serde(untagged)] -pub(crate) enum EntryRaw { - Value(PathBuf), - Object { path: PathBuf }, -} - #[derive(Debug)] pub struct Entry { pub path: Option, } -pub type EventId = u32; -type EventListener = Box; - -/// Scope change event. -#[derive(Debug, Clone)] -pub enum Event { - /// A path has been allowed. - PathAllowed(PathBuf), - /// A path has been forbidden. - PathForbidden(PathBuf), -} - -#[derive(Default)] -pub struct Scope { - pub(crate) allowed: Mutex>, - pub(crate) denied: Mutex>, - event_listeners: Mutex>, - next_event_id: AtomicU32, - pub(crate) require_literal_leading_dot: Option, -} - -impl Scope { - /// Extend the allowed patterns with the given directory. - /// - /// After this function has been called, the frontend will be able to use the Tauri API to read - /// the directory and all of its files. If `recursive` is `true`, subdirectories will be accessible too. - pub fn allow_directory>(&self, path: P, recursive: bool) { - let path = path.as_ref(); - - { - let mut allowed = self.allowed.lock().unwrap(); - allowed.push(path.to_path_buf()); - allowed.push(path.join(if recursive { "**" } else { "*" })); - } - - self.emit(Event::PathAllowed(path.to_path_buf())); - } - - /// Extend the allowed patterns with the given file path. - /// - /// After this function has been called, the frontend will be able to use the Tauri API to read the contents of this file. - pub fn allow_file>(&self, path: P) { - let path = path.as_ref(); - - self.allowed.lock().unwrap().push(path.to_path_buf()); - - self.emit(Event::PathAllowed(path.to_path_buf())); - } - - /// Set the given directory path to be forbidden by this scope. - /// - /// **Note:** this takes precedence over allowed paths, so its access gets denied **always**. - pub fn forbid_directory>(&self, path: P, recursive: bool) { - let path = path.as_ref(); - - { - let mut denied = self.denied.lock().unwrap(); - denied.push(path.to_path_buf()); - denied.push(path.join(if recursive { "**" } else { "*" })); - } - - self.emit(Event::PathForbidden(path.to_path_buf())); - } - - /// Set the given file path to be forbidden by this scope. - /// - /// **Note:** this takes precedence over allowed paths, so its access gets denied **always**. - pub fn forbid_file>(&self, path: P) { - let path = path.as_ref(); - - self.denied.lock().unwrap().push(path.to_path_buf()); - - self.emit(Event::PathForbidden(path.to_path_buf())); - } - - /// List of allowed paths. - pub fn allowed(&self) -> Vec { - self.allowed.lock().unwrap().clone() - } - - /// List of forbidden paths. - pub fn forbidden(&self) -> Vec { - self.denied.lock().unwrap().clone() - } - - fn next_event_id(&self) -> u32 { - self.next_event_id.fetch_add(1, Ordering::Relaxed) - } - - fn emit(&self, event: Event) { - let listeners = self.event_listeners.lock().unwrap(); - let handlers = listeners.values(); - for listener in handlers { - listener(&event); - } - } - - /// Listen to an event on this scope. - pub fn listen(&self, f: F) -> EventId { - let id = self.next_event_id(); - self.event_listeners.lock().unwrap().insert(id, Box::new(f)); - id - } +#[derive(Deserialize)] +#[serde(untagged)] +pub(crate) enum EntryRaw { + Value(PathBuf), + Object { path: PathBuf }, } diff --git a/plugins/fs/src/watcher.rs b/plugins/fs/src/watcher.rs index cf2af503..7d851822 100644 --- a/plugins/fs/src/watcher.rs +++ b/plugins/fs/src/watcher.rs @@ -3,7 +3,7 @@ // SPDX-License-Identifier: MIT use notify::{Config, Event, RecommendedWatcher, RecursiveMode, Watcher}; -use notify_debouncer_full::{new_debouncer, DebounceEventResult, Debouncer, FileIdMap}; +use notify_debouncer_full::{new_debouncer, DebounceEventResult, Debouncer, RecommendedCache}; use serde::Deserialize; use tauri::{ ipc::{Channel, CommandScope, GlobalScope}, @@ -47,7 +47,7 @@ impl WatcherResource { impl Resource for WatcherResource {} enum WatcherKind { - Debouncer(Debouncer), + Debouncer(Debouncer), Watcher(RecommendedWatcher), } @@ -111,8 +111,7 @@ pub async fn watch( let (tx, rx) = channel(); let mut debouncer = new_debouncer(Duration::from_millis(delay), None, tx)?; for path in &resolved_paths { - debouncer.watcher().watch(path.as_ref(), recursive_mode)?; - debouncer.cache().add_root(path, recursive_mode); + debouncer.watch(path, recursive_mode)?; } watch_debounced(on_event, rx); WatcherKind::Debouncer(debouncer) @@ -120,7 +119,7 @@ pub async fn watch( let (tx, rx) = channel(); let mut watcher = RecommendedWatcher::new(tx, Config::default())?; for path in &resolved_paths { - watcher.watch(path.as_ref(), recursive_mode)?; + watcher.watch(path, recursive_mode)?; } watch_raw(on_event, rx); WatcherKind::Watcher(watcher) @@ -140,14 +139,14 @@ pub async fn unwatch(webview: Webview, rid: ResourceId) -> Comman match &mut watcher.kind { WatcherKind::Debouncer(ref mut debouncer) => { for path in &watcher.paths { - debouncer.watcher().unwatch(path.as_ref()).map_err(|e| { + debouncer.unwatch(path).map_err(|e| { format!("failed to unwatch path: {} with error: {e}", path.display()) })?; } } WatcherKind::Watcher(ref mut w) => { for path in &watcher.paths { - w.unwatch(path.as_ref()).map_err(|e| { + w.unwatch(path).map_err(|e| { format!("failed to unwatch path: {} with error: {e}", path.display()) })?; } diff --git a/plugins/geolocation/CHANGELOG.md b/plugins/geolocation/CHANGELOG.md index 32952ac7..26bd66b6 100644 --- a/plugins/geolocation/CHANGELOG.md +++ b/plugins/geolocation/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## \[2.2.3] + +- [`406e6f48`](https://github.com/tauri-apps/plugins-workspace/commit/406e6f484cdc13d35c50fb949f7489ca9eeccc44) ([#2323](https://github.com/tauri-apps/plugins-workspace/pull/2323) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused build failures when the `haptics` or `geolocation` plugin was used without their `specta` feature flag enabled. + +## \[2.2.2] + +- [`c9c13a0f`](https://github.com/tauri-apps/plugins-workspace/commit/c9c13a0fe7cdaac223843f5ba33176252f8e22f5) ([#2316](https://github.com/tauri-apps/plugins-workspace/pull/2316) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) **Breaking change:** `specta` integration is now behind a `specta` feature flag like in Tauri. +- [`c9c13a0f`](https://github.com/tauri-apps/plugins-workspace/commit/c9c13a0fe7cdaac223843f5ba33176252f8e22f5) ([#2316](https://github.com/tauri-apps/plugins-workspace/pull/2316) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Unlock and widen `specta` version range to match Tauri. No API changes. + +## \[2.2.1] + +- [`fb67ab2b`](https://github.com/tauri-apps/plugins-workspace/commit/fb67ab2b926502bfc20d6b43fbdd156691ea8526) ([#2281](https://github.com/tauri-apps/plugins-workspace/pull/2281) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Added `specta-util` to fix a "dependency not found" compilation error. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/geolocation/Cargo.toml b/plugins/geolocation/Cargo.toml index 550a66cb..3fc3baaf 100644 --- a/plugins/geolocation/Cargo.toml +++ b/plugins/geolocation/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tauri-plugin-geolocation" description = "Get and track the device's current position" -version = "2.0.1" +version = "2.2.3" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } @@ -26,10 +26,13 @@ tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri = { workspace = true, features = ["specta"] } +tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -specta = { workspace = true } +specta = { workspace = true, optional = true } [target.'cfg(target_os = "ios")'.dependencies] tauri = { workspace = true, features = ["wry"] } + +[features] +specta = ["dep:specta", "tauri/specta"] diff --git a/plugins/geolocation/README.md b/plugins/geolocation/README.md index 0557cc98..bf8e1741 100644 --- a/plugins/geolocation/README.md +++ b/plugins/geolocation/README.md @@ -81,7 +81,7 @@ The Google Play Store uses this property to decide whether it should show the ap First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { @@ -92,6 +92,20 @@ fn main() { } ``` +Then, for instance, grant the plugin the permission to check or request permissions from the user and to read the device position + +`src-tauri/capabilities/default.json` + +```json + "permissions": [ + "core:default", + "geolocation:allow-check-permissions", + "geolocation:allow-request-permissions", + "geolocation:allow-get-current-position", + "geolocation:allow-watch-position", + ] +``` + Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript @@ -100,7 +114,7 @@ import { requestPermissions, getCurrentPosition, watchPosition -} from '@tauri-apps/plugin-log' +} from '@tauri-apps/plugin-geolocation' let permissions = await checkPermissions() if ( diff --git a/plugins/geolocation/api-iife.js b/plugins/geolocation/api-iife.js index 912c073e..34316795 100644 --- a/plugins/geolocation/api-iife.js +++ b/plugins/geolocation/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_GEOLOCATION__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var i,o,s;"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),o.set(this,0),s.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:r})=>{if(r===e(this,o,"f")){n(this,o,r+1),e(this,i,"f").call(this,t);const a=Object.keys(e(this,s,"f"));if(a.length>0){let t=r+1;for(const n of a.sort()){if(parseInt(n)!==t)break;{const o=e(this,s,"f")[n];delete e(this,s,"f")[n],e(this,i,"f").call(this,o),t+=1}}n(this,o,t)}}else e(this,s,"f")[r.toString()]=t}))}set onmessage(t){n(this,i,t)}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}return i=new WeakMap,o=new WeakMap,s=new WeakMap,t.checkPermissions=async function(){return await async function(t){return a(`plugin:${t}|check_permissions`)}("geolocation")},t.clearWatch=async function(t){await a("plugin:geolocation|clear_watch",{channelId:t})},t.getCurrentPosition=async function(t){return await a("plugin:geolocation|get_current_position",{options:t})},t.requestPermissions=async function(t){return await a("plugin:geolocation|request_permissions",{permissions:t})},t.watchPosition=async function(t,e){const n=new r;return n.onmessage=t=>{"string"==typeof t?e(null,t):e(t)},await a("plugin:geolocation|watch_position",{options:t,channel:n}),n.id},t}({});Object.defineProperty(window.__TAURI__,"geolocation",{value:__TAURI_PLUGIN_GEOLOCATION__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_GEOLOCATION__=function(t){"use strict";function n(t,n,e,i){if("a"===e&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!i:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?i:"a"===e?i.call(t):i?i.value:n.get(t)}function e(t,n,e,i,s){if("function"==typeof n||!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(t,e),e}var i,s,o;"function"==typeof SuppressedError&&SuppressedError;const r="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),s.set(this,0),o.set(this,[]),this.id=function(t,n=!1){return window.__TAURI_INTERNALS__.transformCallback(t,n)}((({message:t,id:r})=>{if(r==n(this,s,"f"))for(n(this,i,"f").call(this,t),e(this,s,n(this,s,"f")+1);n(this,s,"f")in n(this,o,"f");){const t=n(this,o,"f")[n(this,s,"f")];n(this,i,"f").call(this,t),delete n(this,o,"f")[n(this,s,"f")],e(this,s,n(this,s,"f")+1)}else n(this,o,"f")[r]=t}))}set onmessage(t){e(this,i,t)}get onmessage(){return n(this,i,"f")}[(i=new WeakMap,s=new WeakMap,o=new WeakMap,r)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[r]()}}async function c(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return t.checkPermissions=async function(){return await async function(t){return c(`plugin:${t}|check_permissions`)}("geolocation")},t.clearWatch=async function(t){await c("plugin:geolocation|clear_watch",{channelId:t})},t.getCurrentPosition=async function(t){return await c("plugin:geolocation|get_current_position",{options:t})},t.requestPermissions=async function(t){return await c("plugin:geolocation|request_permissions",{permissions:t})},t.watchPosition=async function(t,n){const e=new a;return e.onmessage=t=>{"string"==typeof t?n(null,t):n(t)},await c("plugin:geolocation|watch_position",{options:t,channel:e}),e.id},t}({});Object.defineProperty(window.__TAURI__,"geolocation",{value:__TAURI_PLUGIN_GEOLOCATION__})} diff --git a/plugins/geolocation/package.json b/plugins/geolocation/package.json index 998d2456..c52b7e08 100644 --- a/plugins/geolocation/package.json +++ b/plugins/geolocation/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-geolocation", - "version": "2.0.0", + "version": "2.2.3", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/geolocation/src/commands.rs b/plugins/geolocation/src/commands.rs index 9f9b7aa0..d2cae848 100644 --- a/plugins/geolocation/src/commands.rs +++ b/plugins/geolocation/src/commands.rs @@ -7,7 +7,6 @@ use tauri::{command, ipc::Channel, AppHandle, Runtime}; use crate::{GeolocationExt, PermissionStatus, PermissionType, Position, PositionOptions, Result}; #[command] -#[specta::specta] pub(crate) async fn get_current_position( app: AppHandle, options: Option, @@ -16,7 +15,6 @@ pub(crate) async fn get_current_position( } #[command] -#[specta::specta] pub(crate) async fn watch_position( app: AppHandle, options: PositionOptions, @@ -26,19 +24,16 @@ pub(crate) async fn watch_position( } #[command] -#[specta::specta] pub(crate) async fn clear_watch(app: AppHandle, channel_id: u32) -> Result<()> { app.geolocation().clear_watch(channel_id) } #[command] -#[specta::specta] pub(crate) async fn check_permissions(app: AppHandle) -> Result { app.geolocation().check_permissions() } #[command] -#[specta::specta] pub(crate) async fn request_permissions( app: AppHandle, permissions: Option>, diff --git a/plugins/geolocation/src/error.rs b/plugins/geolocation/src/error.rs index 30ff7f44..0fba5445 100644 --- a/plugins/geolocation/src/error.rs +++ b/plugins/geolocation/src/error.rs @@ -3,18 +3,18 @@ // SPDX-License-Identifier: MIT use serde::{ser::Serializer, Serialize}; -use specta::Type; pub type Result = std::result::Result; // TODO: Improve Error handling (different typed errors instead of one (stringified) PluginInvokeError for all mobile errors) -#[derive(Debug, thiserror::Error, Type)] +#[derive(Debug, thiserror::Error)] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub enum Error { #[cfg(mobile)] #[error(transparent)] PluginInvoke( - #[serde(skip)] + #[cfg_attr(feature = "specta", serde(skip))] #[from] tauri::plugin::mobile::PluginInvokeError, ), diff --git a/plugins/geolocation/src/lib.rs b/plugins/geolocation/src/lib.rs index eed4a475..55f50aa0 100644 --- a/plugins/geolocation/src/lib.rs +++ b/plugins/geolocation/src/lib.rs @@ -7,8 +7,6 @@ use tauri::{ Manager, Runtime, }; -//use tauri_specta::*; - pub use models::*; #[cfg(desktop)] @@ -27,24 +25,6 @@ use desktop::Geolocation; #[cfg(mobile)] use mobile::Geolocation; -/* macro_rules! specta_builder { - () => { - ts::builder() - .commands(collect_commands![ - commands::get_current_position, - commands::watch_position, - commands::clear_watch, - commands::check_permissions, - commands::request_permissions - ]) - .header("// @ts-nocheck") - .config( - specta::ts::ExportConfig::default() - .bigint(specta::ts::BigIntExportBehavior::Number), - ) - }; -} */ - /// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the geolocation APIs. pub trait GeolocationExt { fn geolocation(&self) -> &Geolocation; @@ -58,9 +38,6 @@ impl> crate::GeolocationExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { - /* let (invoke_handler, register_events) = - specta_builder!().build_plugin_utils("geolocation").unwrap(); */ - Builder::new("geolocation") .invoke_handler(tauri::generate_handler![ commands::get_current_position, @@ -79,22 +56,3 @@ pub fn init() -> TauriPlugin { }) .build() } - -/* #[cfg(test)] -mod test { - use super::*; - - #[test] - fn export_types() { - specta_builder!() - .path("./guest-js/bindings.ts") - .config( - specta::ts::ExportConfig::default() - .formatter(specta::ts::formatter::prettier) - .bigint(specta::ts::BigIntExportBehavior::Number), - ) - .export_for_plugin("geolocation") - .expect("failed to export specta types"); - } -} - */ diff --git a/plugins/geolocation/src/models.rs b/plugins/geolocation/src/models.rs index 165c036f..c08bb27a 100644 --- a/plugins/geolocation/src/models.rs +++ b/plugins/geolocation/src/models.rs @@ -3,10 +3,10 @@ // SPDX-License-Identifier: MIT use serde::{Deserialize, Serialize}; -use specta::Type; use tauri::plugin::PermissionState; -#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(rename_all = "camelCase")] pub struct PermissionStatus { /// Permission state for the location alias. @@ -25,7 +25,8 @@ pub struct PermissionStatus { pub coarse_location: PermissionState, } -#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(rename_all = "camelCase")] pub struct PositionOptions { /// High accuracy mode (such as GPS, if available) @@ -46,14 +47,16 @@ pub struct PositionOptions { pub maximum_age: u32, } -#[derive(Debug, Clone, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(rename_all = "camelCase")] pub enum PermissionType { Location, CoarseLocation, } -#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(rename_all = "camelCase")] pub struct Coordinates { /// Latitude in decimal degrees. @@ -73,7 +76,8 @@ pub struct Coordinates { pub heading: Option, } -#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(rename_all = "camelCase")] pub struct Position { /// Creation time for these coordinates. @@ -83,7 +87,8 @@ pub struct Position { pub coords: Coordinates, } -#[derive(Debug, Clone, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(untagged)] pub enum WatchEvent { Position(Position), diff --git a/plugins/global-shortcut/CHANGELOG.md b/plugins/global-shortcut/CHANGELOG.md index 5cd07c7d..32f8748d 100644 --- a/plugins/global-shortcut/CHANGELOG.md +++ b/plugins/global-shortcut/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -104,22 +108,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - st v2 alpha release! - ]\(https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/global-shortcut/Cargo.toml b/plugins/global-shortcut/Cargo.toml index a26be3fb..a9ff1fe0 100644 --- a/plugins/global-shortcut/Cargo.toml +++ b/plugins/global-shortcut/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-global-shortcut" -version = "2.0.1" +version = "2.2.0" description = "Register global hotkeys listeners on your Tauri application." edition = { workspace = true } authors = { workspace = true } diff --git a/plugins/global-shortcut/README.md b/plugins/global-shortcut/README.md index 12a9b08d..53e7b19f 100644 --- a/plugins/global-shortcut/README.md +++ b/plugins/global-shortcut/README.md @@ -55,7 +55,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-global-shortcut#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/global-shortcut/api-iife.js b/plugins/global-shortcut/api-iife.js index 67ec9e47..b172d68d 100644 --- a/plugins/global-shortcut/api-iife.js +++ b/plugins/global-shortcut/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBAL_SHORTCUT__=function(t){"use strict";function e(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)}function r(t,e,r,s,n){if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var s,n,i;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o===e(this,n,"f")){r(this,n,o+1),e(this,s,"f").call(this,t);const a=Object.keys(e(this,i,"f"));if(a.length>0){let t=o+1;for(const r of a.sort()){if(parseInt(r)!==t)break;{const n=e(this,i,"f")[r];delete e(this,i,"f")[r],e(this,s,"f").call(this,n),t+=1}}r(this,n,t)}}else e(this,i,"f")[o.toString()]=t}))}set onmessage(t){r(this,s,t)}get onmessage(){return e(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return s=new WeakMap,n=new WeakMap,i=new WeakMap,t.isRegistered=async function(t){return await a("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new o;return r.onmessage=e,await a("plugin:global-shortcut|register",{shortcuts:Array.isArray(t)?t:[t],handler:r})},t.unregister=async function(t){return await a("plugin:global-shortcut|unregister",{shortcuts:Array.isArray(t)?t:[t]})},t.unregisterAll=async function(){return await a("plugin:global-shortcut|unregister_all",{})},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBAL_SHORTCUT__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBAL_SHORTCUT__=function(t){"use strict";function e(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)}function r(t,e,r,s,i){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var s,i,n;"function"==typeof SuppressedError&&SuppressedError;const o="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),i.set(this,0),n.set(this,[]),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o==e(this,i,"f"))for(e(this,s,"f").call(this,t),r(this,i,e(this,i,"f")+1);e(this,i,"f")in e(this,n,"f");){const t=e(this,n,"f")[e(this,i,"f")];e(this,s,"f").call(this,t),delete e(this,n,"f")[e(this,i,"f")],r(this,i,e(this,i,"f")+1)}else e(this,n,"f")[o]=t}))}set onmessage(t){r(this,s,t)}get onmessage(){return e(this,s,"f")}[(s=new WeakMap,i=new WeakMap,n=new WeakMap,o)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[o]()}}async function _(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return t.isRegistered=async function(t){return await _("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new a;return r.onmessage=e,await _("plugin:global-shortcut|register",{shortcuts:Array.isArray(t)?t:[t],handler:r})},t.unregister=async function(t){return await _("plugin:global-shortcut|unregister",{shortcuts:Array.isArray(t)?t:[t]})},t.unregisterAll=async function(){return await _("plugin:global-shortcut|unregister_all",{})},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBAL_SHORTCUT__})} diff --git a/plugins/global-shortcut/package.json b/plugins/global-shortcut/package.json index a247f93b..13f014b7 100644 --- a/plugins/global-shortcut/package.json +++ b/plugins/global-shortcut/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-global-shortcut", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/global-shortcut/src/lib.rs b/plugins/global-shortcut/src/lib.rs index 5868ff9d..450bb598 100644 --- a/plugins/global-shortcut/src/lib.rs +++ b/plugins/global-shortcut/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/global-shortcut/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/global-shortcut) -//! //! Register global shortcuts. //! //! - Supported platforms: Windows, Linux and macOS. diff --git a/plugins/haptics/CHANGELOG.md b/plugins/haptics/CHANGELOG.md index f8e3fad7..246fb18e 100644 --- a/plugins/haptics/CHANGELOG.md +++ b/plugins/haptics/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## \[2.2.3] + +- [`406e6f48`](https://github.com/tauri-apps/plugins-workspace/commit/406e6f484cdc13d35c50fb949f7489ca9eeccc44) ([#2323](https://github.com/tauri-apps/plugins-workspace/pull/2323) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused build failures when the `haptics` or `geolocation` plugin was used without their `specta` feature flag enabled. + +## \[2.2.2] + +- [`c9c13a0f`](https://github.com/tauri-apps/plugins-workspace/commit/c9c13a0fe7cdaac223843f5ba33176252f8e22f5) ([#2316](https://github.com/tauri-apps/plugins-workspace/pull/2316) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) **Breaking change:** `specta` integration is now behind a `specta` feature flag like in Tauri. +- [`c9c13a0f`](https://github.com/tauri-apps/plugins-workspace/commit/c9c13a0fe7cdaac223843f5ba33176252f8e22f5) ([#2316](https://github.com/tauri-apps/plugins-workspace/pull/2316) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Unlock and widen `specta` version range to match Tauri. No API changes. + +## \[2.2.1] + +- [`fb67ab2b`](https://github.com/tauri-apps/plugins-workspace/commit/fb67ab2b926502bfc20d6b43fbdd156691ea8526) ([#2281](https://github.com/tauri-apps/plugins-workspace/pull/2281) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Added `specta-util` to fix a "dependency not found" compilation error. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/haptics/Cargo.toml b/plugins/haptics/Cargo.toml index 8335475f..4215130e 100644 --- a/plugins/haptics/Cargo.toml +++ b/plugins/haptics/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tauri-plugin-haptics" description = "Haptic feedback and vibrations on Android and iOS" -version = "2.0.1" +version = "2.2.3" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } @@ -26,10 +26,13 @@ tauri-plugin = { workspace = true, features = ["build"] } [dependencies] serde = { workspace = true } serde_json = { workspace = true } -tauri = { workspace = true, features = ["specta"] } +tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } -specta = { workspace = true } +specta = { workspace = true, optional = true } [target.'cfg(target_os = "ios")'.dependencies] tauri = { workspace = true, features = ["wry"] } + +[features] +specta = ["dep:specta", "tauri/specta"] diff --git a/plugins/haptics/README.md b/plugins/haptics/README.md index b96e267c..44118812 100644 --- a/plugins/haptics/README.md +++ b/plugins/haptics/README.md @@ -58,7 +58,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-haptics#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { @@ -69,6 +69,19 @@ fn main() { } ``` +Second, add the required permissions in the project: + +`src-tauri/capabilities/default.json` + +```json + "permissions": [ + "haptics:allow-impact-feedback", + "haptics:allow-notification-feedback", + "haptics:allow-selection-feedback", + "haptics:allow-vibrate" + ] +``` + Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript diff --git a/plugins/haptics/package.json b/plugins/haptics/package.json index f29bdc24..1c70aae1 100644 --- a/plugins/haptics/package.json +++ b/plugins/haptics/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-haptics", - "version": "2.0.0", + "version": "2.2.3", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/haptics/src/commands.rs b/plugins/haptics/src/commands.rs index b2bbd1b0..76f097c0 100644 --- a/plugins/haptics/src/commands.rs +++ b/plugins/haptics/src/commands.rs @@ -7,13 +7,11 @@ use tauri::{command, AppHandle, Runtime}; use crate::{HapticsExt, ImpactFeedbackStyle, NotificationFeedbackType, Result}; #[command] -#[specta::specta] pub(crate) async fn vibrate(app: AppHandle, duration: u32) -> Result<()> { app.haptics().vibrate(duration) } #[command] -#[specta::specta] pub(crate) async fn impact_feedback( app: AppHandle, style: ImpactFeedbackStyle, @@ -22,7 +20,6 @@ pub(crate) async fn impact_feedback( } #[command] -#[specta::specta] pub(crate) async fn notification_feedback( app: AppHandle, r#type: NotificationFeedbackType, @@ -31,7 +28,6 @@ pub(crate) async fn notification_feedback( } #[command] -#[specta::specta] pub(crate) async fn selection_feedback(app: AppHandle) -> Result<()> { app.haptics().selection_feedback() } diff --git a/plugins/haptics/src/error.rs b/plugins/haptics/src/error.rs index 30ff7f44..0fba5445 100644 --- a/plugins/haptics/src/error.rs +++ b/plugins/haptics/src/error.rs @@ -3,18 +3,18 @@ // SPDX-License-Identifier: MIT use serde::{ser::Serializer, Serialize}; -use specta::Type; pub type Result = std::result::Result; // TODO: Improve Error handling (different typed errors instead of one (stringified) PluginInvokeError for all mobile errors) -#[derive(Debug, thiserror::Error, Type)] +#[derive(Debug, thiserror::Error)] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub enum Error { #[cfg(mobile)] #[error(transparent)] PluginInvoke( - #[serde(skip)] + #[cfg_attr(feature = "specta", serde(skip))] #[from] tauri::plugin::mobile::PluginInvokeError, ), diff --git a/plugins/haptics/src/lib.rs b/plugins/haptics/src/lib.rs index 0a727e14..f56e5212 100644 --- a/plugins/haptics/src/lib.rs +++ b/plugins/haptics/src/lib.rs @@ -7,8 +7,6 @@ use tauri::{ Manager, Runtime, }; -//use tauri_specta::*; - pub use models::*; #[cfg(desktop)] @@ -27,23 +25,6 @@ use desktop::Haptics; #[cfg(mobile)] use mobile::Haptics; -/* macro_rules! specta_builder { - () => { - ts::builder() - .commands(collect_commands![ - commands::vibrate, - commands::impact_feedback, - commands::notification_feedback, - commands::selection_feedback - ]) - .header("// @ts-nocheck") - .config( - specta::ts::ExportConfig::default() - .bigint(specta::ts::BigIntExportBehavior::Number), - ) - }; -} */ - /// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the haptics APIs. pub trait HapticsExt { fn haptics(&self) -> &Haptics; @@ -57,9 +38,6 @@ impl> crate::HapticsExt for T { /// Initializes the plugin. pub fn init() -> TauriPlugin { - /* let (invoke_handler, register_events) = - specta_builder!().build_plugin_utils("haptics").unwrap(); */ - Builder::new("haptics") .invoke_handler(tauri::generate_handler![ commands::vibrate, @@ -77,22 +55,3 @@ pub fn init() -> TauriPlugin { }) .build() } - -/* #[cfg(test)] -mod test { - use super::*; - - #[test] - fn export_types() { - specta_builder!() - .path("./guest-js/bindings.ts") - .config( - specta::ts::ExportConfig::default() - .formatter(specta::ts::formatter::prettier) - .bigint(specta::ts::BigIntExportBehavior::Number), - ) - .export_for_plugin("haptics") - .expect("failed to export specta types"); - } -} - */ diff --git a/plugins/haptics/src/models.rs b/plugins/haptics/src/models.rs index 9f3b2035..50a1fb16 100644 --- a/plugins/haptics/src/models.rs +++ b/plugins/haptics/src/models.rs @@ -3,9 +3,9 @@ // SPDX-License-Identifier: MIT use serde::{Deserialize, Serialize}; -use specta::Type; /* -#[derive(Debug, Clone, Default, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(rename_all = "camelCase")] pub struct HapticsOptions { // TODO: support array to match web api @@ -13,7 +13,8 @@ pub struct HapticsOptions { } */ -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(rename_all = "camelCase")] pub enum ImpactFeedbackStyle { Light, @@ -24,7 +25,8 @@ pub enum ImpactFeedbackStyle { Rigid, } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, Type)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[serde(rename_all = "camelCase")] pub enum NotificationFeedbackType { #[default] diff --git a/plugins/http/CHANGELOG.md b/plugins/http/CHANGELOG.md index 508780fa..e9611f4e 100644 --- a/plugins/http/CHANGELOG.md +++ b/plugins/http/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## \[2.3.0] + +- [`10513649`](https://github.com/tauri-apps/plugins-workspace/commit/105136494c5a5bf4b1f1cc06cc71815412d17ec8) ([#2204](https://github.com/tauri-apps/plugins-workspace/pull/2204) by [@RickeyWard](https://github.com/tauri-apps/plugins-workspace/../../RickeyWard)) Add `dangerous-settings` feature flag and new JS `danger` option to disable tls hostname/certificate validation. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +### Dependencies + +- Upgraded to `fs@2.2.0` + +## \[2.0.2] + +### Dependencies + +- Upgraded to `fs-js@2.0.4` + +## \[2.0.4] + +- [`a3b553dd`](https://github.com/tauri-apps/plugins-workspace/commit/a3b553ddb403771aa699362c4e69a064b7731da5) ([#2079](https://github.com/tauri-apps/plugins-workspace/pull/2079) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add tracing logs for requestes and responses behind `tracing` feature flag. + +### Dependencies + +- Upgraded to `fs@2.1.0` + +## \[2.0.3] + +### Dependencies + +- Upgraded to `fs@2.0.3` + +## \[2.0.1] + +- [`cfd48b3b`](https://github.com/tauri-apps/plugins-workspace/commit/cfd48b3b2ec0fccfc162197518694ed59ceda22c) ([#1941](https://github.com/tauri-apps/plugins-workspace/pull/1941) by [@Nipsuli](https://github.com/tauri-apps/plugins-workspace/../../Nipsuli)) Allow skipping sending `Origin` header in HTTP requests by setting `Origin` header to an empty string when calling `fetch`. +- [`9b2840db`](https://github.com/tauri-apps/plugins-workspace/commit/9b2840db9464cf08db75806270e4441f0af81e5d) ([#1884](https://github.com/tauri-apps/plugins-workspace/pull/1884) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Retain headers order. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -189,100 +226,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - /717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ace/pull/371)) First v2 alpha release! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - 2 alpha release! - ! - 371\)) First v2 alpha release! - /717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ace/pull/371)) First v2 alpha release! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - lpha release! - ! - 371\)) First v2 alpha release! - ub.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ace/pull/371)) First v2 alpha release! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - lpha release! - ! - 371\)) First v2 alpha release! - lpha release! - ! - 371\)) First v2 alpha release! - t v2 alpha release! - ! - 371\)) First v2 alpha release! - ace/pull/371)) First v2 alpha release! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - ! - 371\)) First v2 alpha release! - lpha release! - ! - 371\)) First v2 alpha release! - lpha release! - ! - 371\)) First v2 alpha release! - lpha release! - ! - 371\)) First v2 alpha release! - lpha release! - lpha release! - ! - 371\)) First v2 alpha release! - lpha release! - ! - 371\)) First v2 alpha release! - ha release! - ! - 371\)) First v2 alpha release! diff --git a/plugins/http/Cargo.toml b/plugins/http/Cargo.toml index 64b9aa75..9aa49e0e 100644 --- a/plugins/http/Cargo.toml +++ b/plugins/http/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-http" -version = "2.0.1" +version = "2.3.0" description = "Access an HTTP client written in Rust." edition = { workspace = true } authors = { workspace = true } @@ -34,13 +34,14 @@ serde_json = { workspace = true } tauri = { workspace = true } thiserror = { workspace = true } tokio = { version = "1", features = ["sync", "macros"] } -tauri-plugin-fs = { path = "../fs", version = "2.0.1" } +tauri-plugin-fs = { path = "../fs", version = "2.2.0" } urlpattern = "0.3" regex = "1" http = "1" reqwest = { version = "0.12", default-features = false } url = { workspace = true } data-url = "0.3" +tracing = { workspace = true, optional = true } [features] default = [ @@ -71,3 +72,5 @@ http2 = ["reqwest/http2"] charset = ["reqwest/charset"] macos-system-configuration = ["reqwest/macos-system-configuration"] unsafe-headers = [] +tracing = ["dep:tracing"] +dangerous-settings = [] diff --git a/plugins/http/README.md b/plugins/http/README.md index c3fe92c0..5c3cd9c2 100644 --- a/plugins/http/README.md +++ b/plugins/http/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-http#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/http/api-iife.js b/plugins/http/api-iife.js index 0cfeb063..76b498ad 100644 --- a/plugins/http/api-iife.js +++ b/plugins/http/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_HTTP__=function(e){"use strict";async function t(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;const r="Request canceled";return e.fetch=async function(e,n){const a=n?.signal;if(a?.aborted)throw new Error(r);const o=n?.maxRedirections,s=n?.connectTimeout,i=n?.proxy;n&&(delete n.maxRedirections,delete n.connectTimeout,delete n.proxy);const d=n?.headers?n.headers instanceof Headers?n.headers:new Headers(n.headers):new Headers,c=new Request(e,n),u=await c.arrayBuffer(),f=0!==u.byteLength?Array.from(new Uint8Array(u)):null;for(const[e,t]of c.headers)d.get(e)||d.set(e,t);const _=(d instanceof Headers?Array.from(d.entries()):Array.isArray(d)?d:Object.entries(d)).map((([e,t])=>[e,"string"==typeof t?t:t.toString()]));if(a?.aborted)throw new Error(r);const h=await t("plugin:http|fetch",{clientConfig:{method:c.method,url:c.url,headers:_,data:f,maxRedirections:o,connectTimeout:s,proxy:i}}),l=()=>t("plugin:http|fetch_cancel",{rid:h});if(a?.aborted)throw l(),new Error(r);a?.addEventListener("abort",(()=>{l()}));const{status:p,statusText:w,url:y,headers:T,rid:A}=await t("plugin:http|fetch_send",{rid:h}),g=await t("plugin:http|fetch_read_body",{rid:A}),R=new Response(g instanceof ArrayBuffer&&0!==g.byteLength?g:g instanceof Array&&g.length>0?new Uint8Array(g):null,{status:p,statusText:w});return Object.defineProperty(R,"url",{value:y}),Object.defineProperty(R,"headers",{value:new Headers(T)}),R},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_PLUGIN_HTTP__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_HTTP__=function(e){"use strict";async function t(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;const r="Request canceled";return e.fetch=async function(e,n){const a=n?.signal;if(a?.aborted)throw new Error(r);const o=n?.maxRedirections,s=n?.connectTimeout,i=n?.proxy,d=n?.danger;n&&(delete n.maxRedirections,delete n.connectTimeout,delete n.proxy,delete n.danger);const c=n?.headers?n.headers instanceof Headers?n.headers:new Headers(n.headers):new Headers,u=new Request(e,n),f=await u.arrayBuffer(),_=0!==f.byteLength?Array.from(new Uint8Array(f)):null;for(const[e,t]of u.headers)c.get(e)||c.set(e,t);const h=(c instanceof Headers?Array.from(c.entries()):Array.isArray(c)?c:Object.entries(c)).map((([e,t])=>[e,"string"==typeof t?t:t.toString()]));if(a?.aborted)throw new Error(r);const l=await t("plugin:http|fetch",{clientConfig:{method:u.method,url:u.url,headers:h,data:_,maxRedirections:o,connectTimeout:s,proxy:i,danger:d}}),p=()=>t("plugin:http|fetch_cancel",{rid:l});if(a?.aborted)throw p(),new Error(r);a?.addEventListener("abort",(()=>{p()}));const{status:w,statusText:y,url:g,headers:T,rid:A}=await t("plugin:http|fetch_send",{rid:l}),R=await t("plugin:http|fetch_read_body",{rid:A}),b=new Response(R instanceof ArrayBuffer&&0!==R.byteLength?R:R instanceof Array&&R.length>0?new Uint8Array(R):null,{status:w,statusText:y});return Object.defineProperty(b,"url",{value:g}),Object.defineProperty(b,"headers",{value:new Headers(T)}),b},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_PLUGIN_HTTP__})} diff --git a/plugins/http/guest-js/index.ts b/plugins/http/guest-js/index.ts index 4362e893..bea18e44 100644 --- a/plugins/http/guest-js/index.ts +++ b/plugins/http/guest-js/index.ts @@ -84,6 +84,26 @@ export interface ClientOptions { * Configuration of a proxy that a Client should pass requests to. */ proxy?: Proxy + /** + * Configuration for dangerous settings on the client such as disabling SSL verification. + */ + danger?: DangerousSettings +} + +/** + * Configuration for dangerous settings on the client such as disabling SSL verification. + * + * @since 2.3.0 + */ +export interface DangerousSettings { + /** + * Disables SSL verification. + */ + acceptInvalidCerts?: boolean + /** + * Disables hostname verification. + */ + acceptInvalidHostnames?: boolean } const ERROR_REQUEST_CANCELLED = 'Request canceled' @@ -115,12 +135,14 @@ export async function fetch( const maxRedirections = init?.maxRedirections const connectTimeout = init?.connectTimeout const proxy = init?.proxy + const danger = init?.danger // Remove these fields before creating the request if (init) { delete init.maxRedirections delete init.connectTimeout delete init.proxy + delete init.danger } const headers = init?.headers @@ -172,7 +194,8 @@ export async function fetch( data, maxRedirections, connectTimeout, - proxy + proxy, + danger } }) diff --git a/plugins/http/package.json b/plugins/http/package.json index 24fb27f7..02ea80bf 100644 --- a/plugins/http/package.json +++ b/plugins/http/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-http", - "version": "2.0.0", + "version": "2.3.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/http/src/commands.rs b/plugins/http/src/commands.rs index b9c1cae2..3dc0297e 100644 --- a/plugins/http/src/commands.rs +++ b/plugins/http/src/commands.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use std::{collections::HashMap, future::Future, pin::Pin, sync::Arc, time::Duration}; +use std::{future::Future, pin::Pin, str::FromStr, sync::Arc, time::Duration}; -use http::{header, HeaderName, Method, StatusCode}; +use http::{header, HeaderMap, HeaderName, HeaderValue, Method, StatusCode}; use reqwest::{redirect::Policy, NoProxy}; use serde::{Deserialize, Serialize}; use tauri::{ @@ -75,6 +75,14 @@ pub struct FetchResponse { rid: ResourceId, } +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +#[allow(dead_code)] //feature flags shoudln't affect api +pub struct DangerousSettings { + accept_invalid_certs: bool, + accept_invalid_hostnames: bool, +} + #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ClientConfig { @@ -85,6 +93,7 @@ pub struct ClientConfig { connect_timeout: Option, max_redirections: Option, proxy: Option, + danger: Option, } #[derive(Debug, Deserialize)] @@ -176,16 +185,32 @@ pub async fn fetch( let ClientConfig { method, url, - headers, + headers: headers_raw, data, connect_timeout, max_redirections, proxy, + danger, } = client_config; let scheme = url.scheme(); let method = Method::from_bytes(method.as_bytes())?; - let headers: HashMap = HashMap::from_iter(headers); + + let mut headers = HeaderMap::new(); + for (h, v) in headers_raw { + let name = HeaderName::from_str(&h)?; + #[cfg(not(feature = "unsafe-headers"))] + if is_unsafe_header(&name) { + #[cfg(debug_assertions)] + { + eprintln!("[\x1b[33mWARNING\x1b[0m] Skipping {name} header as it is a forbidden header per fetch spec https://fetch.spec.whatwg.org/#terminology-headers"); + eprintln!("[\x1b[33mWARNING\x1b[0m] if keeping the header is a desired behavior, you can enable `unsafe-headers` feature flag in your Cargo.toml"); + } + continue; + } + + headers.append(name, HeaderValue::from_str(&v)?); + } match scheme { "http" | "https" => { @@ -205,6 +230,24 @@ pub async fn fetch( { let mut builder = reqwest::ClientBuilder::new(); + if let Some(danger_config) = danger { + #[cfg(not(feature = "dangerous-settings"))] + { + #[cfg(debug_assertions)] + { + eprintln!("[\x1b[33mWARNING\x1b[0m] using dangerous settings requires `dangerous-settings` feature flag in your Cargo.toml"); + } + let _ = danger_config; + return Err(Error::DangerousSettings); + } + #[cfg(feature = "dangerous-settings")] + { + builder = builder + .danger_accept_invalid_certs(danger_config.accept_invalid_certs) + .danger_accept_invalid_hostnames(danger_config.accept_invalid_hostnames) + } + } + if let Some(timeout) = connect_timeout { builder = builder.connect_timeout(Duration::from_millis(timeout)); } @@ -228,45 +271,49 @@ pub async fn fetch( let mut request = builder.build()?.request(method.clone(), url); - for (name, value) in &headers { - let name = HeaderName::from_bytes(name.as_bytes())?; - #[cfg(not(feature = "unsafe-headers"))] - if is_unsafe_header(&name) { - continue; - } - - request = request.header(name, value); - } - // POST and PUT requests should always have a 0 length content-length, // if there is no body. https://fetch.spec.whatwg.org/#http-network-or-cache-fetch if data.is_none() && matches!(method, Method::POST | Method::PUT) { - request = request.header(header::CONTENT_LENGTH, 0); + headers.append(header::CONTENT_LENGTH, HeaderValue::from_str("0")?); } - if headers.contains_key(header::RANGE.as_str()) { + if headers.contains_key(header::RANGE) { // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 18 // If httpRequest’s header list contains `Range`, then append (`Accept-Encoding`, `identity`) - request = request.header(header::ACCEPT_ENCODING, "identity"); + headers.append(header::ACCEPT_ENCODING, HeaderValue::from_str("identity")?); } - if !headers.contains_key(header::USER_AGENT.as_str()) { - request = request.header(header::USER_AGENT, HTTP_USER_AGENT); + if !headers.contains_key(header::USER_AGENT) { + headers.append(header::USER_AGENT, HeaderValue::from_str(HTTP_USER_AGENT)?); } - if cfg!(feature = "unsafe-headers") - && !headers.contains_key(header::ORIGIN.as_str()) - { + // ensure we have an Origin header set + if cfg!(not(feature = "unsafe-headers")) || !headers.contains_key(header::ORIGIN) { if let Ok(url) = webview.url() { - request = - request.header(header::ORIGIN, url.origin().ascii_serialization()); + headers.append( + header::ORIGIN, + HeaderValue::from_str(&url.origin().ascii_serialization())?, + ); } } + // In case empty origin is passed, remove it. Some services do not like Origin header + // so this way we can remove it in explicit way. The default behaviour is still to set it + if cfg!(feature = "unsafe-headers") + && headers.get(header::ORIGIN) == Some(&HeaderValue::from_static("")) + { + headers.remove(header::ORIGIN); + }; + if let Some(data) = data { request = request.body(data); } + request = request.headers(headers); + + #[cfg(feature = "tracing")] + tracing::trace!("{:?}", request); + let fut = async move { request.send().await.map_err(Into::into) }; let mut resources_table = webview.resources_table(); let rid = resources_table.add_request(Box::pin(fut)); @@ -288,6 +335,9 @@ pub async fn fetch( .header(header::CONTENT_TYPE, data_url.mime_type().to_string()) .body(reqwest::Body::from(body))?; + #[cfg(feature = "tracing")] + tracing::trace!("{:?}", response); + let fut = async move { Ok(reqwest::Response::from(response)) }; let mut resources_table = webview.resources_table(); let rid = resources_table.add_request(Box::pin(fut)); @@ -335,6 +385,9 @@ pub async fn fetch_send( } }; + #[cfg(feature = "tracing")] + tracing::trace!("{:?}", res); + let status = res.status(); let url = res.url().to_string(); let mut headers = Vec::new(); diff --git a/plugins/http/src/error.rs b/plugins/http/src/error.rs index 78ff08a2..ef8de0c5 100644 --- a/plugins/http/src/error.rs +++ b/plugins/http/src/error.rs @@ -41,6 +41,8 @@ pub enum Error { Tauri(#[from] tauri::Error), #[error(transparent)] Utf8(#[from] std::string::FromUtf8Error), + #[error("dangerous settings used but are not enabled")] + DangerousSettings, } impl Serialize for Error { diff --git a/plugins/http/src/lib.rs b/plugins/http/src/lib.rs index cdffeb6e..d775760c 100644 --- a/plugins/http/src/lib.rs +++ b/plugins/http/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/http/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/http) -//! //! Access the HTTP client written in Rust. pub use reqwest; diff --git a/plugins/localhost/CHANGELOG.md b/plugins/localhost/CHANGELOG.md index 3a2bf060..f2b15a89 100644 --- a/plugins/localhost/CHANGELOG.md +++ b/plugins/localhost/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.1.0] + +- [`3449dd5a`](https://github.com/tauri-apps/plugins-workspace/commit/3449dd5a8f6d12fee8d6389c034fe47e19d72bcd) ([#1982](https://github.com/tauri-apps/plugins-workspace/pull/1982) by [@arihav](https://github.com/tauri-apps/plugins-workspace/../../arihav)) Add custom host binding to allow external access + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/localhost/Cargo.toml b/plugins/localhost/Cargo.toml index 3d9460d0..34ee7ee6 100644 --- a/plugins/localhost/Cargo.toml +++ b/plugins/localhost/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-localhost" -version = "2.0.1" +version = "2.2.0" description = "Expose your apps assets through a localhost server instead of the default custom protocol." authors = { workspace = true } license = { workspace = true } diff --git a/plugins/localhost/README.md b/plugins/localhost/README.md index 4e23c038..dc0d98d2 100644 --- a/plugins/localhost/README.md +++ b/plugins/localhost/README.md @@ -38,7 +38,7 @@ tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspac First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust use tauri::{Manager, window::WindowBuilder, WindowUrl}; diff --git a/plugins/localhost/src/lib.rs b/plugins/localhost/src/lib.rs index a0c4c794..5b00087f 100644 --- a/plugins/localhost/src/lib.rs +++ b/plugins/localhost/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/localhost/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/localhost) -//! //! Expose your apps assets through a localhost server instead of the default custom protocol. //! //! **Note: This plugins brings considerable security risks and you should only use it if you know what your are doing. If in doubt, use the default custom protocol implementation.** @@ -46,6 +44,7 @@ type OnRequest = Option>; pub struct Builder { port: u16, + host: Option, on_request: OnRequest, } @@ -53,10 +52,17 @@ impl Builder { pub fn new(port: u16) -> Self { Self { port, + host: None, on_request: None, } } + // Change the host the plugin binds to. Defaults to `localhost`. + pub fn host>(mut self, host: H) -> Self { + self.host = Some(host.into()); + self + } + pub fn on_request( mut self, f: F, @@ -67,6 +73,7 @@ impl Builder { pub fn build(mut self) -> TauriPlugin { let port = self.port; + let host = self.host.unwrap_or("localhost".to_string()); let on_request = self.on_request.take(); PluginBuilder::new("localhost") @@ -74,7 +81,7 @@ impl Builder { let asset_resolver = app.asset_resolver(); std::thread::spawn(move || { let server = - Server::http(format!("localhost:{port}")).expect("Unable to spawn server"); + Server::http(format!("{host}:{port}")).expect("Unable to spawn server"); for req in server.incoming_requests() { let path = req .url() diff --git a/plugins/log/CHANGELOG.md b/plugins/log/CHANGELOG.md index f0177138..6c7cbdfe 100644 --- a/plugins/log/CHANGELOG.md +++ b/plugins/log/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## \[2.2.1] + +- [`784a54a3`](https://github.com/tauri-apps/plugins-workspace/commit/784a54a39094dfbaaa8dd123eb083c04dc6c3bb2) ([#2344](https://github.com/tauri-apps/plugins-workspace/pull/2344) by [@madsmtm](https://github.com/tauri-apps/plugins-workspace/../../madsmtm)) Use `objc2` instead of `objc`. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.0.2] + +- [`69d508ee`](https://github.com/tauri-apps/plugins-workspace/commit/69d508ee6910ae4064f2398fbacb803b3944d6a8) ([#2157](https://github.com/tauri-apps/plugins-workspace/pull/2157) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Make log functions omit caller location when failed to parse it instead of throwing + +## \[2.0.1] + +- [`371a2f73`](https://github.com/tauri-apps/plugins-workspace/commit/371a2f7361e0b91cf66f1287ffb18b34414a6cb8) ([#2021](https://github.com/tauri-apps/plugins-workspace/pull/2021) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Make webview log target more consistent that it always starts with `webview` + +## \[2.0.2] + +- [`606fa08d`](https://github.com/tauri-apps/plugins-workspace/commit/606fa08dae1acd074b961fb360623f4c86f13ee8) ([#1997](https://github.com/tauri-apps/plugins-workspace/pull/1997) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) **Potentially breaking:** Updated `fern` from 0.6 to 0.7. This is technically a breaking change because `fern` is re-exported in `tauri-plugin-log`. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -96,15 +116,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - v2 alpha release! - https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ase! - https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/log/Cargo.toml b/plugins/log/Cargo.toml index 4f7c34d4..22f0b4e4 100644 --- a/plugins/log/Cargo.toml +++ b/plugins/log/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-log" -version = "2.0.1" +version = "2.2.1" description = "Configurable logging for your Tauri app." authors = { workspace = true } license = { workspace = true } @@ -17,8 +17,8 @@ rustdoc-args = ["--cfg", "docsrs"] windows = { level = "full", notes = "" } linux = { level = "full", notes = "" } macos = { level = "full", notes = "" } -android = { level = "unknown", notes = "" } -ios = { level = "unknown", notes = "" } +android = { level = "full", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] tauri-plugin = { workspace = true, features = ["build"] } @@ -27,20 +27,23 @@ tauri-plugin = { workspace = true, features = ["build"] } serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } +thiserror = { workspace = true } serde_repr = "0.1" byte-unit = "5" log = { workspace = true, features = ["kv_unstable"] } time = { version = "0.3", features = ["formatting", "local-offset"] } -fern = "0.6" -thiserror = "1" +fern = "0.7" [target."cfg(target_os = \"android\")".dependencies] android_logger = "0.14" [target."cfg(target_os = \"ios\")".dependencies] swift-rs = "1" -objc = "0.2" -cocoa = "0.26" +objc2 = "0.5" +objc2-foundation = { version = "0.2", default-features = false, features = [ + "std", + "NSString", +] } [features] colored = ["fern/colored"] diff --git a/plugins/log/README.md b/plugins/log/README.md index 1748d0c0..462bdab9 100644 --- a/plugins/log/README.md +++ b/plugins/log/README.md @@ -54,9 +54,25 @@ yarn add https://github.com/tauri-apps/tauri-plugin-log#v2 ## Usage -First you need to register the core plugin with Tauri: +First, you should enable the `log:default` capability: + +```json +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "Capability for the main window", + "windows": ["main"], + "permissions": [ + "core:default", + "opener:default", + "log:default" # add this! + ] +} +``` + +Then, you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust use tauri_plugin_log::{Target, TargetKind}; diff --git a/plugins/log/api-iife.js b/plugins/log/api-iife.js index 571b8566..66211751 100644 --- a/plugins/log/api-iife.js +++ b/plugins/log/api-iife.js @@ -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){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(e,n,a){const t=(new Error).stack?.split("\n").map((e=>e.split("@"))),o=t?.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:i,line:c,keyValues:u}=a??{};let l=o?.[0]?.filter((e=>e.length>0)).join("@");"Error"===l&&(l="webview::unknown"),await r("plugin:log|log",{level:e,message:n,location:l,file:i,line:c,keyValues:u})}async function c(e){return await o("log://log",(n=>{const{level:r}=n.payload;let{message:a}=n.payload;a=a.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),e({message:a,level:r})}))}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.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={})),function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(t||(t={})),e.attachConsole=async function(){return await c((({level:e,message:n})=>{switch(e){case t.Trace:console.log(n);break;case t.Debug:console.debug(n);break;case t.Info:console.info(n);break;case t.Warn:console.warn(n);break;case t.Error:console.error(n);break;default:throw new Error(`unknown log level ${e}`)}}))},e.attachLogger=c,e.debug=async function(e,n){await i(t.Debug,e,n)},e.error=async function(e,n){await i(t.Error,e,n)},e.info=async function(e,n){await i(t.Info,e,n)},e.trace=async function(e,n){await i(t.Trace,e,n)},e.warn=async function(e,n){await i(t.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})} +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){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+(?.*?)\s+\((?.*?):(?\d+):(?\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+(?.*?):(?\d+):(?\d+)/,n=r.match(e);if(n){const{fileName:e,lineNumber:r,columnNumber:a}=n.groups;return`@${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={})),function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(t||(t={})),e.attachConsole=async function(){return await u((({level:e,message:n})=>{switch(e){case t.Trace:console.log(n);break;case t.Debug:console.debug(n);break;case t.Info:console.info(n);break;case t.Warn:console.warn(n);break;case t.Error:console.error(n);break;default:throw new Error(`unknown log level ${e}`)}}))},e.attachLogger=u,e.debug=async function(e,n){await i(t.Debug,e,n)},e.error=async function(e,n){await i(t.Error,e,n)},e.info=async function(e,n){await i(t.Info,e,n)},e.trace=async function(e,n){await i(t.Trace,e,n)},e.warn=async function(e,n){await i(t.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})} diff --git a/plugins/log/guest-js/index.ts b/plugins/log/guest-js/index.ts index bf9d7f98..5b097993 100644 --- a/plugins/log/guest-js/index.ts +++ b/plugins/log/guest-js/index.ts @@ -44,24 +44,81 @@ enum LogLevel { Error } +function getCallerLocation(stack?: string) { + if (!stack) { + return + } + + if (stack.startsWith('Error')) { + // Assume it's Chromium V8 + // + // Error + // at baz (filename.js:10:15) + // at bar (filename.js:6:3) + // at foo (filename.js:2:3) + // at filename.js:13:1 + + const lines = stack.split('\n') + // Find the third line (caller's caller of the current location) + const callerLine = lines[3]?.trim() + if (!callerLine) { + return + } + + const regex = + /at\s+(?.*?)\s+\((?.*?):(?\d+):(?\d+)\)/ + const match = callerLine.match(regex) + + if (match) { + const { functionName, fileName, lineNumber, columnNumber } = + match.groups as { + functionName: string + fileName: string + lineNumber: string + columnNumber: string + } + return `${functionName}@${fileName}:${lineNumber}:${columnNumber}` + } else { + // Handle cases where the regex does not match (e.g., last line without function name) + const regexNoFunction = + /at\s+(?.*?):(?\d+):(?\d+)/ + const matchNoFunction = callerLine.match(regexNoFunction) + if (matchNoFunction) { + const { fileName, lineNumber, columnNumber } = + matchNoFunction.groups as { + fileName: string + lineNumber: string + columnNumber: string + } + return `@${fileName}:${lineNumber}:${columnNumber}` + } + } + } else { + // Assume it's Webkit JavaScriptCore, example: + // + // baz@filename.js:10:24 + // bar@filename.js:6:6 + // foo@filename.js:2:6 + // global code@filename.js:13:4 + + const traces = stack.split('\n').map((line) => line.split('@')) + const filtered = traces.filter(([name, location]) => { + return name.length > 0 && location !== '[native code]' + }) + // Find the third line (caller's caller of the current location) + return filtered[2]?.filter((v) => v.length > 0).join('@') + } +} + async function log( level: LogLevel, message: string, options?: LogOptions ): Promise { - const traces = new Error().stack?.split('\n').map((line) => line.split('@')) - - const filtered = traces?.filter(([name, location]) => { - return name.length > 0 && location !== '[native code]' - }) + const location = getCallerLocation(new Error().stack) const { file, line, keyValues } = options ?? {} - let location = filtered?.[0]?.filter((v) => v.length > 0).join('@') - if (location === 'Error') { - location = 'webview::unknown' - } - await invoke('plugin:log|log', { level, message, diff --git a/plugins/log/package.json b/plugins/log/package.json index fd021701..bcef5bf3 100644 --- a/plugins/log/package.json +++ b/plugins/log/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-log", - "version": "2.0.0", + "version": "2.2.1", "description": "Configurable logging for your Tauri app.", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index 98035e4e..9f9a4adf 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/log/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/log) -//! //! Logging for Tauri applications. #![doc( @@ -33,35 +31,10 @@ use tauri::{AppHandle, Emitter}; pub use fern; use time::OffsetDateTime; -pub const WEBVIEW_TARGET: &str = "Webview"; +pub const WEBVIEW_TARGET: &str = "webview"; #[cfg(target_os = "ios")] mod ios { - use cocoa::base::id; - use objc::*; - - const UTF8_ENCODING: usize = 4; - pub struct NSString(pub id); - - impl NSString { - pub fn new(s: &str) -> Self { - // Safety: objc runtime calls are unsafe - NSString(unsafe { - let ns_string: id = msg_send![class!(NSString), alloc]; - let ns_string: id = msg_send![ns_string, - initWithBytes:s.as_ptr() - length:s.len() - encoding:UTF8_ENCODING]; - - // The thing is allocated in rust, the thing must be set to autorelease in rust to relinquish control - // or it can not be released correctly in OC runtime - let _: () = msg_send![ns_string, autorelease]; - - ns_string - }) - } - } - swift_rs::swift!(pub fn tauri_log( level: u8, message: *const std::ffi::c_void )); @@ -230,22 +203,16 @@ fn log( line: Option, key_values: Option>, ) { - let location = location.unwrap_or("webview"); - let level = log::Level::from(level); - let metadata = log::MetadataBuilder::new() - .level(level) - .target(WEBVIEW_TARGET) - .build(); + let target = if let Some(location) = location { + format!("{WEBVIEW_TARGET}:{location}") + } else { + WEBVIEW_TARGET.to_string() + }; let mut builder = RecordBuilder::new(); - builder - .level(level) - .metadata(metadata) - .target(location) - .file(file) - .line(line); + builder.level(level).target(&target).file(file).line(line); let key_values = key_values.unwrap_or_default(); let mut kv = HashMap::new(); @@ -311,7 +278,7 @@ impl Builder { let format = time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]") .unwrap(); - self.dispatch = fern::Dispatch::new().format(move |out, message, record| { + self.dispatch = self.dispatch.format(move |out, message, record| { out.finish(format_args!( "{}[{}][{}] {}", timezone_strategy.get_now().format(&format).unwrap(), @@ -380,8 +347,8 @@ impl Builder { /// .clear_targets() /// .targets([ /// Target::new(TargetKind::Webview), - /// Target::new(TargetKind::LogDir { file_name: Some("webview".into()) }).filter(|metadata| metadata.target() == WEBVIEW_TARGET), - /// Target::new(TargetKind::LogDir { file_name: Some("rust".into()) }).filter(|metadata| metadata.target() != WEBVIEW_TARGET), + /// Target::new(TargetKind::LogDir { file_name: Some("webview".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)), /// ]); /// ``` pub fn targets(mut self, targets: impl IntoIterator) -> Self { @@ -437,7 +404,12 @@ impl Builder { log::Level::Info => 2, log::Level::Warn | log::Level::Error => 3, }, - ios::NSString::new(message.as_str()).0 as _, + // The string is allocated in rust, so we must + // autorelease it rust to give it to the Swift + // runtime. + objc2::rc::Retained::autorelease_ptr( + objc2_foundation::NSString::from_str(message.as_str()), + ) as _, ); } }), diff --git a/plugins/nfc/CHANGELOG.md b/plugins/nfc/CHANGELOG.md index 7960011f..132ae5cc 100644 --- a/plugins/nfc/CHANGELOG.md +++ b/plugins/nfc/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/nfc/Cargo.toml b/plugins/nfc/Cargo.toml index 5cf4f6c4..56cc218b 100644 --- a/plugins/nfc/Cargo.toml +++ b/plugins/nfc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-nfc" -version = "2.0.1" +version = "2.2.0" description = "Read and write NFC tags on Android and iOS." edition = { workspace = true } authors = { workspace = true } diff --git a/plugins/nfc/README.md b/plugins/nfc/README.md index e8a9e156..1f8ceb6b 100644 --- a/plugins/nfc/README.md +++ b/plugins/nfc/README.md @@ -56,7 +56,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-nfc#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/nfc/package.json b/plugins/nfc/package.json index e9c9ec8b..c4852e51 100644 --- a/plugins/nfc/package.json +++ b/plugins/nfc/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-nfc", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/notification/CHANGELOG.md b/plugins/notification/CHANGELOG.md index e8dc3380..89eca864 100644 --- a/plugins/notification/CHANGELOG.md +++ b/plugins/notification/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## \[2.2.1] + +- [`da5c59e2`](https://github.com/tauri-apps/plugins-workspace/commit/da5c59e2fe879d177e3cfd52fcacce85440423cb) ([#2271](https://github.com/tauri-apps/plugins-workspace/pull/2271) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated `zbus` dependency to version 5. No API changes. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -124,25 +132,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ub.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11. - -## \[2.0.0-alpha.1] - -- [`d8b4aca`](https://github.com/tauri-apps/plugins-workspace/commit/d8b4aca69f628b170804ecb982e2c319d026ef47)([#414](https://github.com/tauri-apps/plugins-workspace/pull/414)) Use `window.__TAURI_INVOKE__` instead of `window.__TAURI__` in init.js, fixes usage in apps without `withGlobalTauri` enabled. -- [`7d71ad4`](https://github.com/tauri-apps/plugins-workspace/commit/7d71ad4e587bcf47ea34645f5b226945e487b765) Play a default sound when showing a notification on Windows. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ithub.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ithub.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - /commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/notification/Cargo.toml b/plugins/notification/Cargo.toml index 02e5cce8..eb684af3 100644 --- a/plugins/notification/Cargo.toml +++ b/plugins/notification/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-notification" -version = "2.0.1" +version = "2.2.1" description = "Send desktop and mobile notifications on your Tauri application." edition = { workspace = true } authors = { workspace = true } @@ -15,7 +15,7 @@ rustdoc-args = ["--cfg", "docsrs"] targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] [package.metadata.platforms.support] -windows = { level = "full", notes = "" } +windows = { level = "full", notes = "Only works for installed apps. Shows powershell name & icon in development." } linux = { level = "full", notes = "" } macos = { level = "full", notes = "" } android = { level = "full", notes = "" } diff --git a/plugins/notification/README.md b/plugins/notification/README.md index e75ce540..04632493 100644 --- a/plugins/notification/README.md +++ b/plugins/notification/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-notification#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/notification/api-iife.js b/plugins/notification/api-iife.js index 1f961120..9a0c4db6 100644 --- a/plugins/notification/api-iife.js +++ b/plugins/notification/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function t(i,t,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!e:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(i):e?e.value:t.get(i)}function n(i,t,n,e,o){if("function"==typeof t?i!==t||!o:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(i,n),n}var e,o,a,r,c,s;"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,e.set(this,(()=>{})),o.set(this,0),a.set(this,{}),this.id=function(i,t=!1){return window.__TAURI_INTERNALS__.transformCallback(i,t)}((({message:i,id:r})=>{if(r===t(this,o,"f")){n(this,o,r+1),t(this,e,"f").call(this,i);const c=Object.keys(t(this,a,"f"));if(c.length>0){let i=r+1;for(const n of c.sort()){if(parseInt(n)!==i)break;{const o=t(this,a,"f")[n];delete t(this,a,"f")[n],t(this,e,"f").call(this,o),i+=1}}n(this,o,i)}}else t(this,a,"f")[r.toString()]=i}))}set onmessage(i){n(this,e,i)}get onmessage(){return t(this,e,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}e=new WeakMap,o=new WeakMap,a=new WeakMap;class u{constructor(i,t,n){this.plugin=i,this.event=t,this.channelId=n}async unregister(){return d(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function f(i,t,n){const e=new l;return e.onmessage=n,d(`plugin:${i}|register_listener`,{event:t,handler:e}).then((()=>new u(i,t,e.id)))}async function d(i,t={},n){return window.__TAURI_INTERNALS__.invoke(i,t,n)}i.ScheduleEvery=void 0,(r=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",r.Month="month",r.TwoWeeks="twoWeeks",r.Week="week",r.Day="day",r.Hour="hour",r.Minute="minute",r.Second="second";return i.Importance=void 0,(c=i.Importance||(i.Importance={}))[c.None=0]="None",c[c.Min=1]="Min",c[c.Low=2]="Low",c[c.Default=3]="Default",c[c.High=4]="High",i.Visibility=void 0,(s=i.Visibility||(i.Visibility={}))[s.Secret=-1]="Secret",s[s.Private=0]="Private",s[s.Public=1]="Public",i.Schedule=class{static at(i,t=!1,n=!1){return{at:{date:i,repeating:t,allowWhileIdle:n},interval:void 0,every:void 0}}static interval(i,t=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:t},every:void 0}}static every(i,t,n=!1){return{at:void 0,interval:void 0,every:{interval:i,count:t,allowWhileIdle:n}}}},i.active=async function(){return await d("plugin:notification|get_active")},i.cancel=async function(i){await d("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await d("plugin:notification|cancel")},i.channels=async function(){return await d("plugin:notification|listChannels")},i.createChannel=async function(i){await d("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await d("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await f("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await f("notification","notification",i)},i.pending=async function(){return await d("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await d("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await d("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await d("plugin:notification|remove_active")},i.removeChannel=async function(i){await d("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function t(i,t,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!e:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(i):e?e.value:t.get(i)}function n(i,t,n,e,a){if("function"==typeof t||!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(i,n),n}var e,a,o;"function"==typeof SuppressedError&&SuppressedError;const r="__TAURI_TO_IPC_KEY__";class s{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,e.set(this,(()=>{})),a.set(this,0),o.set(this,[]),this.id=function(i,t=!1){return window.__TAURI_INTERNALS__.transformCallback(i,t)}((({message:i,id:r})=>{if(r==t(this,a,"f"))for(t(this,e,"f").call(this,i),n(this,a,t(this,a,"f")+1);t(this,a,"f")in t(this,o,"f");){const i=t(this,o,"f")[t(this,a,"f")];t(this,e,"f").call(this,i),delete t(this,o,"f")[t(this,a,"f")],n(this,a,t(this,a,"f")+1)}else t(this,o,"f")[r]=i}))}set onmessage(i){n(this,e,i)}get onmessage(){return t(this,e,"f")}[(e=new WeakMap,a=new WeakMap,o=new WeakMap,r)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[r]()}}class c{constructor(i,t,n){this.plugin=i,this.event=t,this.channelId=n}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function l(i,t,n){const e=new s;return e.onmessage=n,u(`plugin:${i}|registerListener`,{event:t,handler:e}).then((()=>new c(i,t,e.id)))}async function u(i,t={},n){return window.__TAURI_INTERNALS__.invoke(i,t,n)}var f,h,d;i.ScheduleEvery=void 0,(f=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",f.Month="month",f.TwoWeeks="twoWeeks",f.Week="week",f.Day="day",f.Hour="hour",f.Minute="minute",f.Second="second";return i.Importance=void 0,(h=i.Importance||(i.Importance={}))[h.None=0]="None",h[h.Min=1]="Min",h[h.Low=2]="Low",h[h.Default=3]="Default",h[h.High=4]="High",i.Visibility=void 0,(d=i.Visibility||(i.Visibility={}))[d.Secret=-1]="Secret",d[d.Private=0]="Private",d[d.Public=1]="Public",i.Schedule=class{static at(i,t=!1,n=!1){return{at:{date:i,repeating:t,allowWhileIdle:n},interval:void 0,every:void 0}}static interval(i,t=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:t},every:void 0}}static every(i,t,n=!1){return{at:void 0,interval:void 0,every:{interval:i,count:t,allowWhileIdle:n}}}},i.active=async function(){return await u("plugin:notification|get_active")},i.cancel=async function(i){await u("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await u("plugin:notification|cancel")},i.channels=async function(){return await u("plugin:notification|listChannels")},i.createChannel=async function(i){await u("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await u("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await l("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await l("notification","notification",i)},i.pending=async function(){return await u("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await u("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await u("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await u("plugin:notification|remove_active")},i.removeChannel=async function(i){await u("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})} diff --git a/plugins/notification/package.json b/plugins/notification/package.json index 37bb5f97..931af392 100644 --- a/plugins/notification/package.json +++ b/plugins/notification/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-notification", - "version": "2.0.0", + "version": "2.2.1", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/notification/src/lib.rs b/plugins/notification/src/lib.rs index aa15cc93..5cc30319 100644 --- a/plugins/notification/src/lib.rs +++ b/plugins/notification/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/notification/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/notification) -//! //! Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. #![doc( diff --git a/plugins/opener/CHANGELOG.md b/plugins/opener/CHANGELOG.md new file mode 100644 index 00000000..ff9a9cb5 --- /dev/null +++ b/plugins/opener/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +## \[2.2.5] + +- [`5b821181`](https://github.com/tauri-apps/plugins-workspace/commit/5b8211815825ddae2dcc0c00520e0cfdff002763) ([#2332](https://github.com/tauri-apps/plugins-workspace/pull/2332) by [@betamos](https://github.com/tauri-apps/plugins-workspace/../../betamos)) Fix broken JS commands `opener.openPath` and `opener.openUrl` on mobile. + +## \[2.2.4] + +- [`da5c59e2`](https://github.com/tauri-apps/plugins-workspace/commit/da5c59e2fe879d177e3cfd52fcacce85440423cb) ([#2271](https://github.com/tauri-apps/plugins-workspace/pull/2271) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated `zbus` dependency to version 5. No API changes. + +## \[2.2.3] + +- [`a9ac1e3c`](https://github.com/tauri-apps/plugins-workspace/commit/a9ac1e3c939cec4338a9422ef02323c1d4dde6cd) ([#2253](https://github.com/tauri-apps/plugins-workspace/pull/2253) by [@betamos](https://github.com/tauri-apps/plugins-workspace/../../betamos)) Return an error in `open_path` if the file does not exist when opening with default application. + +## \[2.2.2] + +- [`ee0f65de`](https://github.com/tauri-apps/plugins-workspace/commit/ee0f65de5c645c244c5f0b638e0e0aab687cb9bf) ([#2207](https://github.com/tauri-apps/plugins-workspace/pull/2207) by [@universalappfactory](https://github.com/tauri-apps/plugins-workspace/../../universalappfactory)) Fixed OpenerPlugin packagename for android + +## \[2.2.1] + +- [`18dffc9d`](https://github.com/tauri-apps/plugins-workspace/commit/18dffc9dfecaf0c900e233e041d9ca36c92834b5) ([#2189](https://github.com/tauri-apps/plugins-workspace/pull/2189) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Fix usage on iOS. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.0.0] + +- [`383e636a`](https://github.com/tauri-apps/plugins-workspace/commit/383e636a8e595aec1300999a8aeb7d9bf8c14632) ([#2019](https://github.com/tauri-apps/plugins-workspace/pull/2019) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Initial Release diff --git a/plugins/opener/Cargo.toml b/plugins/opener/Cargo.toml new file mode 100644 index 00000000..044d2796 --- /dev/null +++ b/plugins/opener/Cargo.toml @@ -0,0 +1,67 @@ +[package] +name = "tauri-plugin-opener" +version = "2.2.5" +description = "Open files and URLs using their default application." +edition = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +links = "tauri-plugin-opener" + +[package.metadata.docs.rs] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] + +# Platforms supported by the plugin +# Support levels are "full", "partial", "none", "unknown" +# Details of the support level are left to plugin maintainer +[package.metadata.platforms.support] +windows = { level = "full", notes = "" } +linux = { level = "full", notes = "" } +macos = { level = "full", notes = "" } +android = { level = "partial", notes = "Only allows to open URLs via `open`" } +ios = { level = "partial", notes = "Only allows to open URLs via `open`" } + + +[build-dependencies] +tauri-plugin = { workspace = true, features = ["build"] } +schemars = { workspace = true } +serde = { workspace = true } + +[dependencies] +serde = { workspace = true } +serde_json = { workspace = true } +tauri = { workspace = true } +thiserror = { workspace = true } +open = { version = "5", features = ["shellexecute-on-windows"] } +glob = { workspace = true } + +[target."cfg(windows)".dependencies] +dunce = { workspace = true } + +[target."cfg(windows)".dependencies.windows] +version = "0.58" +features = [ + "Win32_Foundation", + "Win32_UI_Shell_Common", + "Win32_UI_WindowsAndMessaging", + "Win32_System_Com", + "Win32_System_Registry", +] + +[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"netbsd\", target_os = \"openbsd\"))".dependencies] +zbus = { workspace = true } +url = { workspace = true } + +[target."cfg(target_os = \"macos\")".dependencies.objc2-app-kit] +version = "0.2" +default-features = false +features = ["std", "NSWorkspace"] + +[target."cfg(target_os = \"macos\")".dependencies.objc2-foundation] +version = "0.2" +default-features = false +features = ["std", "NSURL", "NSArray", "NSString"] + +[target.'cfg(target_os = "ios")'.dependencies] +tauri = { workspace = true, features = ["wry"] } diff --git a/plugins/opener/LICENSE.spdx b/plugins/opener/LICENSE.spdx new file mode 100644 index 00000000..cdd0df5a --- /dev/null +++ b/plugins/opener/LICENSE.spdx @@ -0,0 +1,20 @@ +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: tauri +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy +PackageSummary: Tauri is a rust project that enables developers to make secure +and small desktop applications using a web frontend. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2019-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/tauri +PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git +Creator: Person: Daniel Thompson-Yvetot \ No newline at end of file diff --git a/plugins/opener/LICENSE_APACHE-2.0 b/plugins/opener/LICENSE_APACHE-2.0 new file mode 100644 index 00000000..4947287f --- /dev/null +++ b/plugins/opener/LICENSE_APACHE-2.0 @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/plugins/opener/LICENSE_MIT b/plugins/opener/LICENSE_MIT new file mode 100644 index 00000000..4d754725 --- /dev/null +++ b/plugins/opener/LICENSE_MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 - Present Tauri Apps Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/plugins/opener/README.md b/plugins/opener/README.md new file mode 100644 index 00000000..71509eaa --- /dev/null +++ b/plugins/opener/README.md @@ -0,0 +1,145 @@ +![opener](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/opener/banner.png) + + + +| Platform | Supported | +| -------- | --------- | +| Linux | ✓ | +| Windows | ✓ | +| macOS | ✓ | +| Android | ? | +| iOS | ? | + +## Install + +_This plugin requires a Rust version of at least **1.77.2**_ + +There are three general methods of installation that we can recommend. + +1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked) +2. Pull sources directly from Github using git tags / revision hashes (most secure) +3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use) + +Install the Core plugin by adding the following to your `Cargo.toml` file: + +`src-tauri/Cargo.toml` + +```toml +[dependencies] +tauri-plugin-opener = "2.0.0" +# alternatively with Git: +tauri-plugin-opener = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +``` + +You can install the JavaScript Guest bindings using your preferred JavaScript package manager: + +> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. + + + +```sh +pnpm add @tauri-apps/plugin-opener +# or +npm add @tauri-apps/plugin-opener +# or +yarn add @tauri-apps/plugin-opener + +# alternatively with Git: +pnpm add https://github.com/tauri-apps/tauri-plugin-opener#v2 +# or +npm add https://github.com/tauri-apps/tauri-plugin-opener#v2 +# or +yarn add https://github.com/tauri-apps/tauri-plugin-opener#v2 +``` + +## Usage + +First you need to register the core plugin with Tauri: + +`src-tauri/src/lib.rs` + +```rust +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_opener::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` + +Afterwards all the plugin's APIs are available through the JavaScript guest bindings: + +```javascript +import { openUrl, openPath, revealItemInDir } from '@tauri-apps/plugin-opener' + +// Opens the URL in the default browser +await openUrl('https://example.com') +// Or with a specific browser/app +await openUrl('https://example.com', 'firefox') + +// Opens the path with the system's default app +await openPath('/path/to/file') +// Or with a specific app +await openPath('/path/to/file', 'firefox') + +// Reveal a path with the system's default explorer +await revealItemInDir('/path/to/file') +``` + +### Usage from Rust + +You can also use those APIs from Rust: + +```rust +use tauri_plugin_opener::OpenerExt; + +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_opener::init()) + .setup(|app| { + let opener = app.opener(); + + // Opens the URL in the default browser + opener.open_url("https://example.com", None::<&str>)?; + // Or with a specific browser/app + opener.open_url("https://example.com", Some("firefox"))?; + + // Opens the path with the system's default app + opener.open_path("/path/to/file", None::<&str>)?; + // Or with a specific app + opener.open_path("/path/to/file", Some("firefox"))?; + + // Reveal a path with the system's default explorer + opener.reveal_item_in_dir("/path/to/file")?; + Ok(()) + }) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` + +## Contributing + +PRs accepted. Please make sure to read the Contributing Guide before making a pull request. + +## Partners + + + + + + + +
+ + CrabNebula + +
+ +For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri). + +## License + +Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy. + +MIT or MIT/Apache 2.0 where applicable. diff --git a/plugins/opener/SECURITY.md b/plugins/opener/SECURITY.md new file mode 100644 index 00000000..4f09bbac --- /dev/null +++ b/plugins/opener/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +**Do not report security vulnerabilities through public GitHub issues.** + +**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.** + +Include as much of the following information: + +- Type of issue (e.g. improper input parsing, privilege escalation, etc.) +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- The distribution affected or used to help us with reproduction of the issue +- Step-by-step instructions to reproduce the issue +- Ideally a reproduction repository +- Impact of the issue, including how an attacker might exploit the issue + +We prefer to receive reports in English. + +## Contact + +Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new). + +Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app). diff --git a/plugins/opener/android/.gitignore b/plugins/opener/android/.gitignore new file mode 100644 index 00000000..c0f21ec2 --- /dev/null +++ b/plugins/opener/android/.gitignore @@ -0,0 +1,2 @@ +/build +/.tauri diff --git a/plugins/opener/android/build.gradle.kts b/plugins/opener/android/build.gradle.kts new file mode 100644 index 00000000..9dcce212 --- /dev/null +++ b/plugins/opener/android/build.gradle.kts @@ -0,0 +1,39 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "app.tauri.opener" + compileSdk = 34 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + implementation("androidx.core:core-ktx:1.9.0") + implementation("com.fasterxml.jackson.core:jackson-databind:2.15.3") + implementation(project(":tauri-android")) +} diff --git a/plugins/opener/android/proguard-rules.pro b/plugins/opener/android/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/plugins/opener/android/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/plugins/opener/android/settings.gradle b/plugins/opener/android/settings.gradle new file mode 100644 index 00000000..14a752e4 --- /dev/null +++ b/plugins/opener/android/settings.gradle @@ -0,0 +1,2 @@ +include ':tauri-android' +project(':tauri-android').projectDir = new File('./.tauri/tauri-api') diff --git a/plugins/opener/android/src/main/AndroidManifest.xml b/plugins/opener/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9a40236b --- /dev/null +++ b/plugins/opener/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/plugins/opener/android/src/main/java/OpenerPlugin.kt b/plugins/opener/android/src/main/java/OpenerPlugin.kt new file mode 100644 index 00000000..16b76032 --- /dev/null +++ b/plugins/opener/android/src/main/java/OpenerPlugin.kt @@ -0,0 +1,30 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package app.tauri.opener + +import android.app.Activity +import android.content.Intent +import android.net.Uri +import app.tauri.annotation.Command +import app.tauri.annotation.TauriPlugin +import app.tauri.plugin.Invoke +import app.tauri.plugin.Plugin +import java.io.File + +@TauriPlugin +class OpenerPlugin(private val activity: Activity) : Plugin(activity) { + @Command + fun open(invoke: Invoke) { + try { + val url = invoke.parseArgs(String::class.java) + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + activity.applicationContext?.startActivity(intent) + invoke.resolve() + } catch (ex: Exception) { + invoke.reject(ex.message) + } + } +} diff --git a/plugins/opener/api-iife.js b/plugins/opener/api-iife.js new file mode 100644 index 00000000..30415a61 --- /dev/null +++ b/plugins/opener/api-iife.js @@ -0,0 +1 @@ +if("__TAURI__"in window){var __TAURI_PLUGIN_OPENER__=function(n){"use strict";async function e(n,e={},_){return window.__TAURI_INTERNALS__.invoke(n,e,_)}return"function"==typeof SuppressedError&&SuppressedError,n.openPath=async function(n,_){await e("plugin:opener|open_path",{path:n,with:_})},n.openUrl=async function(n,_){await e("plugin:opener|open_url",{url:n,with:_})},n.revealItemInDir=async function(n){return e("plugin:opener|reveal_item_in_dir",{path:n})},n}({});Object.defineProperty(window.__TAURI__,"opener",{value:__TAURI_PLUGIN_OPENER__})} diff --git a/plugins/opener/build.rs b/plugins/opener/build.rs new file mode 100644 index 00000000..fbad4d3a --- /dev/null +++ b/plugins/opener/build.rs @@ -0,0 +1,136 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::PathBuf; + +#[path = "src/scope_entry.rs"] +#[allow(dead_code)] +mod scope; + +/// Opener scope application. +#[derive(schemars::JsonSchema)] +#[serde(untagged)] +#[allow(unused)] +enum Application { + /// Open in default application. + Default, + /// If true, allow open with any application. + Enable(bool), + /// Allow specific application to open with. + App(String), +} + +impl Default for Application { + fn default() -> Self { + Self::Default + } +} + +/// Opener scope entry. +#[derive(schemars::JsonSchema)] +#[serde(untagged)] +#[allow(unused)] +enum OpenerScopeEntry { + Url { + /// A URL that can be opened by the webview when using the Opener APIs. + /// + /// Wildcards can be used following the UNIX glob pattern. + /// + /// Examples: + /// + /// - "https://*" : allows all HTTPS origin + /// + /// - "https://*.github.com/tauri-apps/tauri": allows any subdomain of "github.com" with the "tauri-apps/api" path + /// + /// - "https://myapi.service.com/users/*": allows access to any URLs that begins with "https://myapi.service.com/users/" + url: String, + /// An application to open this url with, for example: firefox. + #[serde(default)] + app: Application, + }, + Path { + /// A path that can be opened by the webview when using the Opener APIs. + /// + /// The pattern can start with a variable that resolves to a system base directory. + /// The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, + /// `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, + /// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, + /// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. + path: PathBuf, + /// An application to open this path with, for example: xdg-open. + #[serde(default)] + app: Application, + }, +} + +// Ensure `OpenerScopeEntry` and `scope::EntryRaw` is kept in sync +fn _f() { + match (scope::EntryRaw::Url { + url: String::new(), + app: scope::Application::Enable(true), + }) { + scope::EntryRaw::Url { url, app } => OpenerScopeEntry::Url { + url, + app: match app { + scope::Application::Enable(p) => Application::Enable(p), + scope::Application::App(p) => Application::App(p), + scope::Application::Default => Application::Default, + }, + }, + scope::EntryRaw::Path { path, app } => OpenerScopeEntry::Path { + path, + app: match app { + scope::Application::Enable(p) => Application::Enable(p), + scope::Application::App(p) => Application::App(p), + scope::Application::Default => Application::Default, + }, + }, + }; + match (OpenerScopeEntry::Url { + url: String::new(), + app: Application::Enable(true), + }) { + OpenerScopeEntry::Url { url, app } => scope::EntryRaw::Url { + url, + app: match app { + Application::Enable(p) => scope::Application::Enable(p), + Application::App(p) => scope::Application::App(p), + Application::Default => scope::Application::Default, + }, + }, + OpenerScopeEntry::Path { path, app } => scope::EntryRaw::Path { + path, + app: match app { + Application::Enable(p) => scope::Application::Enable(p), + Application::App(p) => scope::Application::App(p), + Application::Default => scope::Application::Default, + }, + }, + }; +} + +const COMMANDS: &[&str] = &["open_url", "open_path", "reveal_item_in_dir"]; + +fn main() { + tauri_plugin::Builder::new(COMMANDS) + .global_api_script_path("./api-iife.js") + .android_path("android") + .ios_path("ios") + .global_scope_schema(schemars::schema_for!(OpenerScopeEntry)) + .build(); + + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); + let mobile = target_os == "ios" || target_os == "android"; + alias("desktop", !mobile); + alias("mobile", mobile); +} + +// creates a cfg alias if `has_feature` is true. +// `alias` must be a snake case string. +fn alias(alias: &str, has_feature: bool) { + println!("cargo:rustc-check-cfg=cfg({alias})"); + if has_feature { + println!("cargo:rustc-cfg={alias}"); + } +} diff --git a/plugins/opener/guest-js/index.ts b/plugins/opener/guest-js/index.ts new file mode 100644 index 00000000..ade956a6 --- /dev/null +++ b/plugins/opener/guest-js/index.ts @@ -0,0 +1,92 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +/** + * Open files and URLs using their default application. + * + * ## Security + * + * This API has a scope configuration that forces you to restrict the files and urls to be opened. + * + * ### Restricting access to the {@link open | `open`} API + * + * On the configuration object, `open: true` means that the {@link open} API can be used with any URL, + * as the argument is validated with the `^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+` regex. + * You can change that regex by changing the boolean value to a string, e.g. `open: ^https://github.com/`. + * + * @module + */ + +import { invoke } from '@tauri-apps/api/core' + +/** + * Opens a url with the system's default app, or the one specified with {@linkcode openWith}. + * + * @example + * ```typescript + * import { openUrl } from '@tauri-apps/plugin-opener'; + * + * // opens the given URL on the default browser: + * await openUrl('https://github.com/tauri-apps/tauri'); + * // opens the given URL using `firefox`: + * await openUrl('https://github.com/tauri-apps/tauri', 'firefox'); + * ``` + * + * @param url The URL to open. + * @param openWith The app to open the URL with. If not specified, defaults to the system default application for the specified url type. + * + * @since 2.0.0 + */ +export async function openUrl(url: string, openWith?: string): Promise { + await invoke('plugin:opener|open_url', { + url, + with: openWith + }) +} + +/** + * Opens a path with the system's default app, or the one specified with {@linkcode openWith}. + * + * @example + * ```typescript + * import { openPath } from '@tauri-apps/plugin-opener'; + * + * // opens a file using the default program: + * await openPath('/path/to/file'); + * // opens a file using `vlc` command on Windows. + * await openPath('C:/path/to/file', 'vlc'); + * ``` + * + * @param path The path to open. + * @param openWith The app to open the path with. If not specified, defaults to the system default application for the specified path type. + * + * @since 2.0.0 + */ +export async function openPath(path: string, openWith?: string): Promise { + await invoke('plugin:opener|open_path', { + path, + with: openWith + }) +} + +/** + * Reveal a path with the system's default explorer. + * + * #### Platform-specific: + * + * - **Android / iOS:** Unsupported. + * + * @example + * ```typescript + * import { revealItemInDir } from '@tauri-apps/plugin-opener'; + * await revealItemInDir('/path/to/file'); + * ``` + * + * @param path The path to reveal. + * + * @since 2.0.0 + */ +export async function revealItemInDir(path: string) { + return invoke('plugin:opener|reveal_item_in_dir', { path }) +} diff --git a/plugins/opener/guest-js/init.ts b/plugins/opener/guest-js/init.ts new file mode 100644 index 00000000..046db99c --- /dev/null +++ b/plugins/opener/guest-js/init.ts @@ -0,0 +1,61 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { invoke } from '@tauri-apps/api/core' + +// open links with the API +window.addEventListener('click', function (evt) { + // return early if + if ( + // event was prevented + evt.defaultPrevented || + // or not a left click + evt.button !== 0 || + // or meta key pressed + evt.metaKey || + // or al key pressed + evt.altKey + ) + return + + const a = evt + .composedPath() + .find((el) => el instanceof Node && el.nodeName.toUpperCase() === 'A') as + | HTMLAnchorElement + | undefined + + // return early if + if ( + // not tirggered from element + !a || + // or doesn't have a href + !a.href || + // or not supposed to be open in a new tab + !( + a.target === '_blank' || + // or ctrl key pressed + evt.ctrlKey || + // or shift key pressed + evt.shiftKey + ) + ) + return + + const url = new URL(a.href) + + // return early if + if ( + // same origin (internal navigation) + url.origin === window.location.origin || + // not default protocols + ['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p) + ) + return + + evt.preventDefault() + + void invoke('plugin:opener|open_url', { + url + }) +}) diff --git a/plugins/opener/ios/Package.resolved b/plugins/opener/ios/Package.resolved new file mode 100644 index 00000000..5f998e0e --- /dev/null +++ b/plugins/opener/ios/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "SwiftRs", + "repositoryURL": "https://github.com/Brendonovich/swift-rs", + "state": { + "branch": null, + "revision": "b5ed223fcdab165bc21219c1925dc1e77e2bef5e", + "version": "1.0.6" + } + } + ] + }, + "version": 1 +} diff --git a/plugins/opener/ios/Package.swift b/plugins/opener/ios/Package.swift new file mode 100644 index 00000000..8d06936e --- /dev/null +++ b/plugins/opener/ios/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.3 +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import PackageDescription + +let package = Package( + name: "tauri-plugin-opener", + platforms: [ + .macOS(.v10_13), + .iOS(.v13), + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "tauri-plugin-opener", + type: .static, + targets: ["tauri-plugin-opener"]) + ], + dependencies: [ + .package(name: "Tauri", path: "../.tauri/tauri-api") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "tauri-plugin-opener", + dependencies: [ + .byName(name: "Tauri") + ], + path: "Sources") + ] +) diff --git a/plugins/opener/ios/Sources/OpenerPlugin.swift b/plugins/opener/ios/Sources/OpenerPlugin.swift new file mode 100644 index 00000000..81ff76b4 --- /dev/null +++ b/plugins/opener/ios/Sources/OpenerPlugin.swift @@ -0,0 +1,32 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import Foundation +import SwiftRs +import Tauri +import UIKit +import WebKit + +class OpenerPlugin: Plugin { + @objc public func open(_ invoke: Invoke) throws { + do { + let urlString = try invoke.parseArgs(String.self) + if let url = URL(string: urlString) { + if #available(iOS 10, *) { + UIApplication.shared.open(url, options: [:]) + } else { + UIApplication.shared.openURL(url) + } + } + invoke.resolve() + } catch { + invoke.reject(error.localizedDescription) + } + } +} + +@_cdecl("init_plugin_opener") +func initPlugin() -> Plugin { + return OpenerPlugin() +} diff --git a/plugins/opener/package.json b/plugins/opener/package.json new file mode 100644 index 00000000..a7a1b3d2 --- /dev/null +++ b/plugins/opener/package.json @@ -0,0 +1,30 @@ +{ + "name": "@tauri-apps/plugin-opener", + "version": "2.2.5", + "description": "Open files and URLs using their default application.", + "license": "MIT OR Apache-2.0", + "authors": [ + "Tauri Programme within The Commons Conservancy" + ], + "repository": "https://github.com/tauri-apps/plugins-workspace", + "type": "module", + "types": "./dist-js/index.d.ts", + "main": "./dist-js/index.cjs", + "module": "./dist-js/index.js", + "exports": { + "types": "./dist-js/index.d.ts", + "import": "./dist-js/index.js", + "require": "./dist-js/index.cjs" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist-js", + "README.md", + "LICENSE" + ], + "dependencies": { + "@tauri-apps/api": "^2.0.0" + } +} diff --git a/plugins/opener/permissions/allow-default-urls.toml b/plugins/opener/permissions/allow-default-urls.toml new file mode 100644 index 00000000..93495b89 --- /dev/null +++ b/plugins/opener/permissions/allow-default-urls.toml @@ -0,0 +1,17 @@ +"$schema" = "schemas/schema.json" + +[[permission]] +identifier = "allow-default-urls" +description = "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application." + +[[permission.scope.allow]] +url = "mailto:*" + +[[permission.scope.allow]] +url = "tel:*" + +[[permission.scope.allow]] +url = "http://*" + +[[permission.scope.allow]] +url = "https://*" diff --git a/plugins/opener/permissions/autogenerated/commands/open_path.toml b/plugins/opener/permissions/autogenerated/commands/open_path.toml new file mode 100644 index 00000000..ae67b939 --- /dev/null +++ b/plugins/opener/permissions/autogenerated/commands/open_path.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-open-path" +description = "Enables the open_path command without any pre-configured scope." +commands.allow = ["open_path"] + +[[permission]] +identifier = "deny-open-path" +description = "Denies the open_path command without any pre-configured scope." +commands.deny = ["open_path"] diff --git a/plugins/opener/permissions/autogenerated/commands/open_url.toml b/plugins/opener/permissions/autogenerated/commands/open_url.toml new file mode 100644 index 00000000..f1e694b1 --- /dev/null +++ b/plugins/opener/permissions/autogenerated/commands/open_url.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-open-url" +description = "Enables the open_url command without any pre-configured scope." +commands.allow = ["open_url"] + +[[permission]] +identifier = "deny-open-url" +description = "Denies the open_url command without any pre-configured scope." +commands.deny = ["open_url"] diff --git a/plugins/opener/permissions/autogenerated/commands/reveal_item_in_dir.toml b/plugins/opener/permissions/autogenerated/commands/reveal_item_in_dir.toml new file mode 100644 index 00000000..e669620f --- /dev/null +++ b/plugins/opener/permissions/autogenerated/commands/reveal_item_in_dir.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-reveal-item-in-dir" +description = "Enables the reveal_item_in_dir command without any pre-configured scope." +commands.allow = ["reveal_item_in_dir"] + +[[permission]] +identifier = "deny-reveal-item-in-dir" +description = "Denies the reveal_item_in_dir command without any pre-configured scope." +commands.deny = ["reveal_item_in_dir"] diff --git a/plugins/opener/permissions/autogenerated/reference.md b/plugins/opener/permissions/autogenerated/reference.md new file mode 100644 index 00000000..66c232c6 --- /dev/null +++ b/plugins/opener/permissions/autogenerated/reference.md @@ -0,0 +1,109 @@ +## Default Permission + +This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application +as well as reveal file in directories using default file explorer + +- `allow-open-url` +- `allow-reveal-item-in-dir` +- `allow-default-urls` + +## Permission Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdentifierDescription
+ +`opener:allow-default-urls` + + + +This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application. + +
+ +`opener:allow-open-path` + + + +Enables the open_path command without any pre-configured scope. + +
+ +`opener:deny-open-path` + + + +Denies the open_path command without any pre-configured scope. + +
+ +`opener:allow-open-url` + + + +Enables the open_url command without any pre-configured scope. + +
+ +`opener:deny-open-url` + + + +Denies the open_url command without any pre-configured scope. + +
+ +`opener:allow-reveal-item-in-dir` + + + +Enables the reveal_item_in_dir command without any pre-configured scope. + +
+ +`opener:deny-reveal-item-in-dir` + + + +Denies the reveal_item_in_dir command without any pre-configured scope. + +
diff --git a/plugins/opener/permissions/default.toml b/plugins/opener/permissions/default.toml new file mode 100644 index 00000000..846d6e51 --- /dev/null +++ b/plugins/opener/permissions/default.toml @@ -0,0 +1,10 @@ +"$schema" = "schemas/schema.json" + +[default] +description = """This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application +as well as reveal file in directories using default file explorer""" +permissions = [ + "allow-open-url", + "allow-reveal-item-in-dir", + "allow-default-urls", +] diff --git a/plugins/opener/permissions/schemas/schema.json b/plugins/opener/permissions/schemas/schema.json new file mode 100644 index 00000000..b958ac63 --- /dev/null +++ b/plugins/opener/permissions/schemas/schema.json @@ -0,0 +1,340 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionFile", + "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", + "type": "object", + "properties": { + "default": { + "description": "The default permission set for the plugin", + "anyOf": [ + { + "$ref": "#/definitions/DefaultPermission" + }, + { + "type": "null" + } + ] + }, + "set": { + "description": "A list of permissions sets defined", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionSet" + } + }, + "permission": { + "description": "A list of inlined permissions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Permission" + } + } + }, + "definitions": { + "DefaultPermission": { + "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri convention is to use

headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PermissionSet": { + "description": "A set of direct permissions grouped together under a new name.", + "type": "object", + "required": [ + "description", + "identifier", + "permissions" + ], + "properties": { + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does.", + "type": "string" + }, + "permissions": { + "description": "All permissions this set contains.", + "type": "array", + "items": { + "$ref": "#/definitions/PermissionKind" + } + } + } + }, + "Permission": { + "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "version": { + "description": "The version of the permission.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 1.0 + }, + "identifier": { + "description": "A unique identifier for the permission.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the permission does. Tauri internal convention is to use

headings in markdown content for Tauri documentation generation purposes.", + "type": [ + "string", + "null" + ] + }, + "commands": { + "description": "Allowed or denied commands when using this permission.", + "default": { + "allow": [], + "deny": [] + }, + "allOf": [ + { + "$ref": "#/definitions/Commands" + } + ] + }, + "scope": { + "description": "Allowed or denied scoped when using this permission.", + "allOf": [ + { + "$ref": "#/definitions/Scopes" + } + ] + }, + "platforms": { + "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } + } + } + }, + "Commands": { + "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", + "type": "object", + "properties": { + "allow": { + "description": "Allowed command.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "deny": { + "description": "Denied command, which takes priority.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Scopes": { + "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", + "type": "object", + "properties": { + "allow": { + "description": "Data that defines what is allowed by the scope.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + }, + "deny": { + "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + "Value": { + "description": "All supported ACL values.", + "anyOf": [ + { + "description": "Represents a null JSON value.", + "type": "null" + }, + { + "description": "Represents a [`bool`].", + "type": "boolean" + }, + { + "description": "Represents a valid ACL [`Number`].", + "allOf": [ + { + "$ref": "#/definitions/Number" + } + ] + }, + { + "description": "Represents a [`String`].", + "type": "string" + }, + { + "description": "Represents a list of other [`Value`]s.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + { + "description": "Represents a map of [`String`] keys to [`Value`]s.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Value" + } + } + ] + }, + "Number": { + "description": "A valid ACL number.", + "anyOf": [ + { + "description": "Represents an [`i64`].", + "type": "integer", + "format": "int64" + }, + { + "description": "Represents a [`f64`].", + "type": "number", + "format": "double" + } + ] + }, + "Target": { + "description": "Platform target.", + "oneOf": [ + { + "description": "MacOS.", + "type": "string", + "enum": [ + "macOS" + ] + }, + { + "description": "Windows.", + "type": "string", + "enum": [ + "windows" + ] + }, + { + "description": "Linux.", + "type": "string", + "enum": [ + "linux" + ] + }, + { + "description": "Android.", + "type": "string", + "enum": [ + "android" + ] + }, + { + "description": "iOS.", + "type": "string", + "enum": [ + "iOS" + ] + } + ] + }, + "PermissionKind": { + "type": "string", + "oneOf": [ + { + "description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.", + "type": "string", + "const": "allow-default-urls" + }, + { + "description": "Enables the open_path command without any pre-configured scope.", + "type": "string", + "const": "allow-open-path" + }, + { + "description": "Denies the open_path command without any pre-configured scope.", + "type": "string", + "const": "deny-open-path" + }, + { + "description": "Enables the open_url command without any pre-configured scope.", + "type": "string", + "const": "allow-open-url" + }, + { + "description": "Denies the open_url command without any pre-configured scope.", + "type": "string", + "const": "deny-open-url" + }, + { + "description": "Enables the reveal_item_in_dir command without any pre-configured scope.", + "type": "string", + "const": "allow-reveal-item-in-dir" + }, + { + "description": "Denies the reveal_item_in_dir command without any pre-configured scope.", + "type": "string", + "const": "deny-reveal-item-in-dir" + }, + { + "description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer", + "type": "string", + "const": "default" + } + ] + } + } +} \ No newline at end of file diff --git a/plugins/opener/rollup.config.js b/plugins/opener/rollup.config.js new file mode 100644 index 00000000..a7dbd4f6 --- /dev/null +++ b/plugins/opener/rollup.config.js @@ -0,0 +1,22 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { createConfig } from '../../shared/rollup.config.js' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import typescript from '@rollup/plugin-typescript' +import terser from '@rollup/plugin-terser' + +export default createConfig({ + additionalConfigs: { + input: 'guest-js/init.ts', + output: { + file: 'src/init-iife.js', + format: 'iife' + }, + plugins: [typescript(), terser(), nodeResolve()], + onwarn: (warning) => { + throw Object.assign(new Error(), warning) + } + } +}) diff --git a/plugins/opener/src/commands.rs b/plugins/opener/src/commands.rs new file mode 100644 index 00000000..b00d5306 --- /dev/null +++ b/plugins/opener/src/commands.rs @@ -0,0 +1,75 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::{Path, PathBuf}; + +use tauri::{ + ipc::{CommandScope, GlobalScope}, + AppHandle, Runtime, +}; + +use crate::{scope::Scope, Error, OpenerExt}; + +#[tauri::command] +pub async fn open_url( + app: AppHandle, + command_scope: CommandScope, + global_scope: GlobalScope, + url: String, + with: Option, +) -> crate::Result<()> { + let scope = Scope::new( + &app, + command_scope + .allows() + .iter() + .chain(global_scope.allows()) + .collect(), + command_scope + .denies() + .iter() + .chain(global_scope.denies()) + .collect(), + ); + + if scope.is_url_allowed(&url, with.as_deref()) { + app.opener().open_url(url, with) + } else { + Err(Error::ForbiddenUrl { url, with }) + } +} + +#[tauri::command] +pub async fn open_path( + app: AppHandle, + command_scope: CommandScope, + global_scope: GlobalScope, + path: String, + with: Option, +) -> crate::Result<()> { + let scope = Scope::new( + &app, + command_scope + .allows() + .iter() + .chain(global_scope.allows()) + .collect(), + command_scope + .denies() + .iter() + .chain(global_scope.denies()) + .collect(), + ); + + if scope.is_path_allowed(Path::new(&path), with.as_deref())? { + app.opener().open_path(path, with) + } else { + Err(Error::ForbiddenPath { path, with }) + } +} + +#[tauri::command] +pub async fn reveal_item_in_dir(path: PathBuf) -> crate::Result<()> { + crate::reveal_item_in_dir(path) +} diff --git a/plugins/opener/src/error.rs b/plugins/opener/src/error.rs new file mode 100644 index 00000000..157922fc --- /dev/null +++ b/plugins/opener/src/error.rs @@ -0,0 +1,54 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::PathBuf; + +use serde::{Serialize, Serializer}; + +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +pub enum Error { + #[cfg(mobile)] + #[error(transparent)] + PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), + #[error(transparent)] + Tauri(#[from] tauri::Error), + #[error(transparent)] + Io(#[from] std::io::Error), + #[error(transparent)] + Json(#[from] serde_json::Error), + #[error("unknown program {0}")] + UnknownProgramName(String), + #[error("Not allowed to open path {}{}", .path, .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())] + ForbiddenPath { path: String, with: Option }, + #[error("Not allowed to open url {}{}", .url, .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())] + ForbiddenUrl { url: String, with: Option }, + #[error("API not supported on the current platform")] + UnsupportedPlatform, + #[error(transparent)] + #[cfg(windows)] + Win32Error(#[from] windows::core::Error), + #[error("Path doesn't have a parent: {0}")] + NoParent(PathBuf), + #[error("Failed to convert path to file:// url")] + FailedToConvertPathToFileUrl, + #[error(transparent)] + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + Zbus(#[from] zbus::Error), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} diff --git a/plugins/opener/src/init-iife.js b/plugins/opener/src/init-iife.js new file mode 100644 index 00000000..51f6f068 --- /dev/null +++ b/plugins/opener/src/init-iife.js @@ -0,0 +1 @@ +!function(){"use strict";"function"==typeof SuppressedError&&SuppressedError,window.addEventListener("click",(function(e){if(e.defaultPrevented||0!==e.button||e.metaKey||e.altKey)return;const t=e.composedPath().find((e=>e instanceof Node&&"A"===e.nodeName.toUpperCase()));if(!t||!t.href||"_blank"!==t.target&&!e.ctrlKey&&!e.shiftKey)return;const n=new URL(t.href);n.origin===window.location.origin||["http:","https:","mailto:","tel:"].every((e=>n.protocol!==e))||(e.preventDefault(),async function(e,t={},n){window.__TAURI_INTERNALS__.invoke(e,t,n)}("plugin:opener|open_url",{url:n}))}))}(); diff --git a/plugins/opener/src/lib.rs b/plugins/opener/src/lib.rs new file mode 100644 index 00000000..1cb78b86 --- /dev/null +++ b/plugins/opener/src/lib.rs @@ -0,0 +1,221 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::Path; + +use tauri::{plugin::TauriPlugin, Manager, Runtime}; + +#[cfg(mobile)] +use tauri::plugin::PluginHandle; +#[cfg(target_os = "android")] +const PLUGIN_IDENTIFIER: &str = "app.tauri.opener"; +#[cfg(target_os = "ios")] +tauri::ios_plugin_binding!(init_plugin_opener); + +mod commands; +mod error; +mod open; +mod reveal_item_in_dir; +mod scope; +mod scope_entry; + +pub use error::Error; +type Result = std::result::Result; + +pub use open::{open_path, open_url}; +pub use reveal_item_in_dir::reveal_item_in_dir; + +pub struct Opener { + // we use `fn() -> R` to slicence the unused generic error + // while keeping this struct `Send + Sync` without requiring `R` to be + #[cfg(not(mobile))] + _marker: std::marker::PhantomData R>, + #[cfg(mobile)] + mobile_plugin_handle: PluginHandle, +} + +impl Opener { + /// Open a url with a default or specific program. + /// + /// # Examples + /// + /// ```rust,no_run + /// use tauri_plugin_opener::OpenerExt; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// // open the given URL on the system default browser + /// app.opener().open_url("https://github.com/tauri-apps/tauri", None::<&str>)?; + /// Ok(()) + /// }); + /// ``` + /// + /// ## Platform-specific: + /// + /// - **Android / iOS**: Always opens using default program. + #[cfg(desktop)] + pub fn open_url(&self, url: impl Into, with: Option>) -> Result<()> { + crate::open::open(url.into(), with.map(Into::into)).map_err(Into::into) + } + + /// Open a url with a default or specific program. + /// + /// # Examples + /// + /// ```rust,no_run + /// use tauri_plugin_opener::OpenerExt; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// // open the given URL on the system default browser + /// app.opener().open_url("https://github.com/tauri-apps/tauri", None::<&str>)?; + /// Ok(()) + /// }); + /// ``` + /// + /// ## Platform-specific: + /// + /// - **Android / iOS**: Always opens using default program. + #[cfg(mobile)] + pub fn open_url(&self, url: impl Into, _with: Option>) -> Result<()> { + self.mobile_plugin_handle + .run_mobile_plugin("open", url.into()) + .map_err(Into::into) + } + + /// Open a path with a default or specific program. + /// + /// # Examples + /// + /// ```rust,no_run + /// use tauri_plugin_opener::OpenerExt; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// // open the given path on the system default explorer + /// app.opener().open_path("/path/to/file", None::<&str>)?; + /// Ok(()) + /// }); + /// ``` + /// + /// ## Platform-specific: + /// + /// - **Android / iOS**: Always opens using default program. + #[cfg(desktop)] + pub fn open_path( + &self, + path: impl Into, + with: Option>, + ) -> Result<()> { + crate::open::open(path.into(), with.map(Into::into)).map_err(Into::into) + } + + /// Open a path with a default or specific program. + /// + /// # Examples + /// + /// ```rust,no_run + /// use tauri_plugin_opener::OpenerExt; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// // open the given path on the system default explorer + /// app.opener().open_path("/path/to/file", None::<&str>)?; + /// Ok(()) + /// }); + /// ``` + /// + /// ## Platform-specific: + /// + /// - **Android / iOS**: Always opens using default program. + #[cfg(mobile)] + pub fn open_path( + &self, + path: impl Into, + _with: Option>, + ) -> Result<()> { + self.mobile_plugin_handle + .run_mobile_plugin("open", path.into()) + .map_err(Into::into) + } + + pub fn reveal_item_in_dir>(&self, p: P) -> Result<()> { + crate::reveal_item_in_dir::reveal_item_in_dir(p) + } +} + +/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the opener APIs. +pub trait OpenerExt { + fn opener(&self) -> &Opener; +} + +impl> OpenerExt for T { + fn opener(&self) -> &Opener { + self.state::>().inner() + } +} + +/// The opener plugin Builder. +pub struct Builder { + open_js_links_on_click: bool, +} + +impl Default for Builder { + fn default() -> Self { + Self { + open_js_links_on_click: true, + } + } +} + +impl Builder { + /// Create a new opener plugin Builder. + pub fn new() -> Self { + Self::default() + } + + /// Whether the plugin should inject a JS script to open URLs in default browser + /// when clicking on `` elements that has `_blank` target, or when pressing `Ctrl` or `Shift` while clicking it. + /// + /// Enabled by default for `http:`, `https:`, `mailto:`, `tel:` links. + pub fn open_js_links_on_click(mut self, open: bool) -> Self { + self.open_js_links_on_click = open; + self + } + + /// Build and Initializes the plugin. + pub fn build(self) -> TauriPlugin { + let mut builder = tauri::plugin::Builder::new("opener") + .setup(|app, _api| { + #[cfg(target_os = "android")] + let handle = _api.register_android_plugin(PLUGIN_IDENTIFIER, "OpenerPlugin")?; + #[cfg(target_os = "ios")] + let handle = _api.register_ios_plugin(init_plugin_opener)?; + + app.manage(Opener { + #[cfg(not(mobile))] + _marker: std::marker::PhantomData:: R>, + #[cfg(mobile)] + mobile_plugin_handle: handle, + }); + Ok(()) + }) + .invoke_handler(tauri::generate_handler![ + commands::open_url, + commands::open_path, + commands::reveal_item_in_dir + ]); + + if self.open_js_links_on_click { + builder = builder.js_init_script(include_str!("init-iife.js").to_string()); + } + + builder.build() + } +} + +/// Initializes the plugin. +pub fn init() -> TauriPlugin { + Builder::default().build() +} diff --git a/plugins/opener/src/open.rs b/plugins/opener/src/open.rs new file mode 100644 index 00000000..a3d46c50 --- /dev/null +++ b/plugins/opener/src/open.rs @@ -0,0 +1,61 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! Types and functions related to shell. + +use std::{ffi::OsStr, path::Path}; + +pub(crate) fn open, S: AsRef>(path: P, with: Option) -> crate::Result<()> { + match with { + Some(program) => ::open::with_detached(path, program.as_ref()), + None => ::open::that_detached(path), + } + .map_err(Into::into) +} + +/// Opens URL with the program specified in `with`, or system default if `None`. +/// +/// ## Platform-specific: +/// +/// - **Android / iOS**: Always opens using default program. +/// +/// # Examples +/// +/// ```rust,no_run +/// tauri::Builder::default() +/// .setup(|app| { +/// // open the given URL on the system default browser +/// tauri_plugin_opener::open_url("https://github.com/tauri-apps/tauri", None::<&str>)?; +/// Ok(()) +/// }); +/// ``` +pub fn open_url, S: AsRef>(url: P, with: Option) -> crate::Result<()> { + let url = url.as_ref(); + open(url, with) +} + +/// Opens path with the program specified in `with`, or system default if `None`. +/// +/// ## Platform-specific: +/// +/// - **Android / iOS**: Always opens using default program. +/// +/// # Examples +/// +/// ```rust,no_run +/// tauri::Builder::default() +/// .setup(|app| { +/// // open the given URL on the system default explorer +/// tauri_plugin_opener::open_path("/path/to/file", None::<&str>)?; +/// Ok(()) +/// }); +/// ``` +pub fn open_path, S: AsRef>(path: P, with: Option) -> crate::Result<()> { + let path = path.as_ref(); + if with.is_none() { + // Returns an IO error if not exists, and besides `exists()` is a shorthand for `metadata()` + _ = path.metadata()?; + } + open(path, with) +} diff --git a/plugins/opener/src/reveal_item_in_dir.rs b/plugins/opener/src/reveal_item_in_dir.rs new file mode 100644 index 00000000..6d7b9268 --- /dev/null +++ b/plugins/opener/src/reveal_item_in_dir.rs @@ -0,0 +1,196 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::Path; + +/// Reveal a path the system's default explorer. +/// +/// ## Platform-specific: +/// +/// - **Android / iOS:** Unsupported. +pub fn reveal_item_in_dir>(path: P) -> crate::Result<()> { + let path = path.as_ref().canonicalize()?; + + #[cfg(any( + windows, + target_os = "macos", + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + return imp::reveal_item_in_dir(&path); + + #[cfg(not(any( + windows, + target_os = "macos", + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + )))] + Err(crate::Error::UnsupportedPlatform) +} + +#[cfg(windows)] +mod imp { + use super::*; + + use windows::{ + core::{w, HSTRING, PCWSTR}, + Win32::{ + Foundation::ERROR_FILE_NOT_FOUND, + System::Com::CoInitialize, + UI::{ + Shell::{ + ILCreateFromPathW, ILFree, SHOpenFolderAndSelectItems, ShellExecuteExW, + SHELLEXECUTEINFOW, + }, + WindowsAndMessaging::SW_SHOWNORMAL, + }, + }, + }; + + pub fn reveal_item_in_dir(path: &Path) -> crate::Result<()> { + let file = dunce::simplified(path); + + let _ = unsafe { CoInitialize(None) }; + + let dir = file + .parent() + .ok_or_else(|| crate::Error::NoParent(file.to_path_buf()))?; + + let dir = HSTRING::from(dir); + let dir_item = unsafe { ILCreateFromPathW(&dir) }; + + let file_h = HSTRING::from(file); + let file_item = unsafe { ILCreateFromPathW(&file_h) }; + + unsafe { + if let Err(e) = SHOpenFolderAndSelectItems(dir_item, Some(&[file_item]), 0) { + // from https://github.com/electron/electron/blob/10d967028af2e72382d16b7e2025d243b9e204ae/shell/common/platform_util_win.cc#L302 + // On some systems, the above call mysteriously fails with "file not + // found" even though the file is there. In these cases, ShellExecute() + // seems to work as a fallback (although it won't select the file). + if e.code().0 == ERROR_FILE_NOT_FOUND.0 as i32 { + let is_dir = file.is_dir(); + let mut info = SHELLEXECUTEINFOW { + cbSize: std::mem::size_of::() as _, + nShow: SW_SHOWNORMAL.0, + lpFile: PCWSTR(dir.as_ptr()), + lpClass: if is_dir { w!("folder") } else { PCWSTR::null() }, + lpVerb: if is_dir { + w!("explore") + } else { + PCWSTR::null() + }, + ..std::mem::zeroed() + }; + + ShellExecuteExW(&mut info).inspect_err(|_| { + ILFree(Some(dir_item)); + ILFree(Some(file_item)); + })?; + } + } + } + + unsafe { + ILFree(Some(dir_item)); + ILFree(Some(file_item)); + } + + Ok(()) + } +} + +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +mod imp { + + use std::collections::HashMap; + + use super::*; + + pub fn reveal_item_in_dir(path: &Path) -> crate::Result<()> { + let connection = zbus::blocking::Connection::session()?; + + reveal_with_filemanager1(path, &connection) + .or_else(|_| reveal_with_open_uri_portal(path, &connection)) + } + + fn reveal_with_filemanager1( + path: &Path, + connection: &zbus::blocking::Connection, + ) -> crate::Result<()> { + let uri = url::Url::from_file_path(path) + .map_err(|_| crate::Error::FailedToConvertPathToFileUrl)?; + + #[zbus::proxy( + interface = "org.freedesktop.FileManager1", + default_service = "org.freedesktop.FileManager1", + default_path = "/org/freedesktop/FileManager1" + )] + trait FileManager1 { + async fn ShowItems(&self, name: Vec<&str>, arg2: &str) -> crate::Result<()>; + } + + let proxy = FileManager1ProxyBlocking::new(connection)?; + + proxy.ShowItems(vec![uri.as_str()], "") + } + + fn reveal_with_open_uri_portal( + path: &Path, + connection: &zbus::blocking::Connection, + ) -> crate::Result<()> { + let uri = url::Url::from_file_path(path) + .map_err(|_| crate::Error::FailedToConvertPathToFileUrl)?; + + #[zbus::proxy( + interface = "org.freedesktop.portal.Desktop", + default_service = "org.freedesktop.portal.OpenURI", + default_path = "/org/freedesktop/portal/desktop" + )] + trait PortalDesktop { + async fn OpenDirectory( + &self, + arg1: &str, + name: &str, + arg3: HashMap<&str, &str>, + ) -> crate::Result<()>; + } + + let proxy = PortalDesktopProxyBlocking::new(connection)?; + + proxy.OpenDirectory("", uri.as_str(), HashMap::new()) + } +} + +#[cfg(target_os = "macos")] +mod imp { + use super::*; + use objc2_app_kit::NSWorkspace; + use objc2_foundation::{NSArray, NSString, NSURL}; + pub fn reveal_item_in_dir(path: &Path) -> crate::Result<()> { + unsafe { + let path = path.to_string_lossy(); + let path = NSString::from_str(&path); + let urls = vec![NSURL::fileURLWithPath(&path)]; + let urls = NSArray::from_vec(urls); + + let workspace = NSWorkspace::new(); + workspace.activateFileViewerSelectingURLs(&urls); + } + + Ok(()) + } +} diff --git a/plugins/opener/src/scope.rs b/plugins/opener/src/scope.rs new file mode 100644 index 00000000..22c9787e --- /dev/null +++ b/plugins/opener/src/scope.rs @@ -0,0 +1,138 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::{ + marker::PhantomData, + path::{Path, PathBuf}, + sync::Arc, +}; + +use tauri::{ipc::ScopeObject, utils::acl::Value, AppHandle, Manager, Runtime}; + +use crate::{scope_entry::EntryRaw, Error}; + +pub use crate::scope_entry::Application; + +#[derive(Debug)] +pub enum Entry { + Url { + url: glob::Pattern, + app: Application, + }, + Path { + path: Option, + app: Application, + }, +} + +impl ScopeObject for Entry { + type Error = Error; + + fn deserialize( + app_handle: &AppHandle, + raw: Value, + ) -> std::result::Result { + serde_json::from_value(raw.into()) + .and_then(|raw| { + let entry = match raw { + EntryRaw::Url { url, app } => Entry::Url { + url: glob::Pattern::new(&url) + .map_err(|e| serde::de::Error::custom(e.to_string()))?, + app, + }, + EntryRaw::Path { path, app } => { + let path = match app_handle.path().parse(path) { + Ok(path) => Some(path), + #[cfg(not(target_os = "android"))] + Err(tauri::Error::UnknownPath) => None, + Err(err) => return Err(serde::de::Error::custom(err.to_string())), + }; + + Entry::Path { path, app } + } + }; + + Ok(entry) + }) + .map_err(Into::into) + } +} + +impl Application { + fn matches(&self, a: Option<&str>) -> bool { + match self { + Self::Default => a.is_none(), + Self::Enable(enable) => *enable, + Self::App(program) => Some(program.as_str()) == a, + } + } +} + +impl Entry { + fn path(&self) -> Option { + match self { + Self::Url { .. } => None, + Self::Path { path, .. } => path.clone(), + } + } + + fn matches_url(&self, u: &str, a: Option<&str>) -> bool { + match self { + Self::Url { url, app } => url.matches(u) && app.matches(a), + Self::Path { .. } => false, + } + } + + fn matches_path_program(&self, a: Option<&str>) -> bool { + match self { + Self::Url { .. } => false, + Self::Path { app, .. } => app.matches(a), + } + } +} + +#[derive(Debug)] +pub struct Scope<'a, R: Runtime, M: Manager> { + allowed: Vec<&'a Arc>, + denied: Vec<&'a Arc>, + manager: &'a M, + _marker: PhantomData, +} + +impl<'a, R: Runtime, M: Manager> Scope<'a, R, M> { + pub(crate) fn new( + manager: &'a M, + allowed: Vec<&'a Arc>, + denied: Vec<&'a Arc>, + ) -> Self { + Self { + manager, + allowed, + denied, + _marker: PhantomData, + } + } + + pub fn is_url_allowed(&self, url: &str, with: Option<&str>) -> bool { + let denied = self.denied.iter().any(|e| e.matches_url(url, with)); + if denied { + false + } else { + self.allowed.iter().any(|e| e.matches_url(url, with)) + } + } + + pub fn is_path_allowed(&self, path: &Path, with: Option<&str>) -> crate::Result { + let fs_scope = tauri::fs::Scope::new( + self.manager, + &tauri::utils::config::FsScope::Scope { + allow: self.allowed.iter().filter_map(|e| e.path()).collect(), + deny: self.denied.iter().filter_map(|e| e.path()).collect(), + require_literal_leading_dot: None, + }, + )?; + + Ok(fs_scope.is_allowed(path) && self.allowed.iter().any(|e| e.matches_path_program(with))) + } +} diff --git a/plugins/opener/src/scope_entry.rs b/plugins/opener/src/scope_entry.rs new file mode 100644 index 00000000..cf9004a2 --- /dev/null +++ b/plugins/opener/src/scope_entry.rs @@ -0,0 +1,36 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::PathBuf; + +use serde::Deserialize; + +#[derive(Deserialize, Debug)] +#[serde(untagged)] +pub enum Application { + Default, + Enable(bool), + App(String), +} + +impl Default for Application { + fn default() -> Self { + Self::Default + } +} + +#[derive(Deserialize)] +#[serde(untagged, rename_all = "camelCase")] +pub(crate) enum EntryRaw { + Url { + url: String, + #[serde(default)] + app: Application, + }, + Path { + path: PathBuf, + #[serde(default)] + app: Application, + }, +} diff --git a/plugins/opener/tsconfig.json b/plugins/opener/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/opener/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/os/CHANGELOG.md b/plugins/os/CHANGELOG.md index 42311804..cc7fb604 100644 --- a/plugins/os/CHANGELOG.md +++ b/plugins/os/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -98,11 +102,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/os/Cargo.toml b/plugins/os/Cargo.toml index 88cd5ceb..7af6dad3 100644 --- a/plugins/os/Cargo.toml +++ b/plugins/os/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-os" -version = "2.0.1" +version = "2.2.0" description = "Read information about the operating system." edition = { workspace = true } authors = { workspace = true } @@ -31,5 +31,5 @@ log = { workspace = true } thiserror = { workspace = true } os_info = "3" sys-locale = "0.3" -gethostname = "0.5" +gethostname = "1.0" serialize-to-javascript = "=0.1.1" diff --git a/plugins/os/README.md b/plugins/os/README.md index aafda769..f6679504 100644 --- a/plugins/os/README.md +++ b/plugins/os/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-os#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/os/package.json b/plugins/os/package.json index f255299a..95ae0ca9 100644 --- a/plugins/os/package.json +++ b/plugins/os/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-os", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/os/src/lib.rs b/plugins/os/src/lib.rs index 98813578..c041c8ea 100644 --- a/plugins/os/src/lib.rs +++ b/plugins/os/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/os/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/os) -//! //! Read information about the operating system. #![doc( @@ -112,7 +110,7 @@ struct InitJavascript<'a> { exe_extension: &'a str, } -impl<'a> InitJavascript<'a> { +impl InitJavascript<'_> { fn new() -> Self { Self { #[cfg(windows)] diff --git a/plugins/persisted-scope/CHANGELOG.md b/plugins/persisted-scope/CHANGELOG.md index b27277fa..937db6c4 100644 --- a/plugins/persisted-scope/CHANGELOG.md +++ b/plugins/persisted-scope/CHANGELOG.md @@ -1,5 +1,39 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +### Dependencies + +- Upgraded to `fs@2.2.0` + +## \[2.1.1] + +### Dependencies + +- Upgraded to `fs@2.1.1` + +## \[2.1.0] + +- [`fecfd553`](https://github.com/tauri-apps/plugins-workspace/commit/fecfd5533a6452f054fbcd909021f12b0dce834f) ([#2070](https://github.com/tauri-apps/plugins-workspace/pull/2070) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) **Breaking Change:** Replaced the custom `tauri_plugin_fs::Scope` struct with `tauri::fs::Scope`. + +### Dependencies + +- Upgraded to `fs@2.1.0` + +## \[2.0.3] + +### Dependencies + +- Upgraded to `fs@2.0.3` + +## \[2.0.2] + +### Dependencies + +- Upgraded to `fs@2.0.2` + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/persisted-scope/Cargo.toml b/plugins/persisted-scope/Cargo.toml index c03276d0..38585d38 100644 --- a/plugins/persisted-scope/Cargo.toml +++ b/plugins/persisted-scope/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-persisted-scope" -version = "2.0.1" +version = "2.2.0" description = "Save filesystem and asset scopes and restore them when the app is reopened." authors = { workspace = true } license = { workspace = true } @@ -27,7 +27,7 @@ log = { workspace = true } thiserror = { workspace = true } aho-corasick = "1" bincode = "1" -tauri-plugin-fs = { path = "../fs", version = "2.0.1" } +tauri-plugin-fs = { path = "../fs", version = "2.2.0" } [features] protocol-asset = ["tauri/protocol-asset"] diff --git a/plugins/persisted-scope/README.md b/plugins/persisted-scope/README.md index c45a1711..c3ec88fe 100644 --- a/plugins/persisted-scope/README.md +++ b/plugins/persisted-scope/README.md @@ -35,7 +35,7 @@ tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-wo First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs index d9988f8e..6ced7b24 100644 --- a/plugins/persisted-scope/src/lib.rs +++ b/plugins/persisted-scope/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/persisted-scope/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/persisted-scope) -//! //! Save filesystem and asset scopes and restore them when the app is reopened. #![doc( @@ -16,13 +14,11 @@ use serde::{Deserialize, Serialize}; use tauri::{ plugin::{Builder, TauriPlugin}, - scope::fs::Pattern as GlobPattern, Manager, Runtime, }; use tauri_plugin_fs::FsExt; use std::{ - collections::HashSet, fs::{create_dir_all, File}, io::Write, path::Path, @@ -46,81 +42,6 @@ const PATTERNS: &[&str] = &[ ]; const REPLACE_WITH: &[&str] = &[r"[", r"]", r"?", r"*", r"\?", r"\\?\", r"\\?\"]; -trait ScopeExt { - type Pattern: ToString; - - fn allow_file(&self, path: &Path); - fn allow_directory(&self, path: &Path, recursive: bool); - - fn forbid_file(&self, path: &Path); - fn forbid_directory(&self, path: &Path, recursive: bool); - - fn allowed_patterns(&self) -> HashSet; - fn forbidden_patterns(&self) -> HashSet; -} - -impl ScopeExt for tauri::scope::fs::Scope { - type Pattern = GlobPattern; - - fn allow_file(&self, path: &Path) { - let _ = tauri::scope::fs::Scope::allow_file(self, path); - } - - fn allow_directory(&self, path: &Path, recursive: bool) { - let _ = tauri::scope::fs::Scope::allow_directory(self, path, recursive); - } - - fn forbid_file(&self, path: &Path) { - let _ = tauri::scope::fs::Scope::forbid_file(self, path); - } - - fn forbid_directory(&self, path: &Path, recursive: bool) { - let _ = tauri::scope::fs::Scope::forbid_directory(self, path, recursive); - } - - fn allowed_patterns(&self) -> HashSet { - tauri::scope::fs::Scope::allowed_patterns(self) - } - - fn forbidden_patterns(&self) -> HashSet { - tauri::scope::fs::Scope::forbidden_patterns(self) - } -} - -impl ScopeExt for tauri_plugin_fs::Scope { - type Pattern = String; - - fn allow_file(&self, path: &Path) { - tauri_plugin_fs::Scope::allow_file(self, path); - } - - fn allow_directory(&self, path: &Path, recursive: bool) { - tauri_plugin_fs::Scope::allow_directory(self, path, recursive); - } - - fn forbid_file(&self, path: &Path) { - tauri_plugin_fs::Scope::forbid_file(self, path); - } - - fn forbid_directory(&self, path: &Path, recursive: bool) { - tauri_plugin_fs::Scope::forbid_directory(self, path, recursive); - } - - fn allowed_patterns(&self) -> HashSet { - self.allowed() - .into_iter() - .map(|p| p.to_string_lossy().to_string()) - .collect() - } - - fn forbidden_patterns(&self) -> HashSet { - self.forbidden() - .into_iter() - .map(|p| p.to_string_lossy().to_string()) - .collect() - } -} - #[derive(Debug, thiserror::Error)] enum Error { #[error(transparent)] @@ -181,41 +102,41 @@ fn fix_directory(path_str: &str) -> &Path { path } -fn allow_path(scope: &impl ScopeExt, path: &str) { +fn allow_path(scope: &tauri::fs::Scope, path: &str) { let target_type = detect_scope_type(path); match target_type { TargetType::File => { - scope.allow_file(Path::new(path)); + let _ = scope.allow_file(Path::new(path)); } TargetType::Directory => { // We remove the '*' at the end of it, else it will be escaped by the pattern. - scope.allow_directory(fix_directory(path), false); + let _ = scope.allow_directory(fix_directory(path), false); } TargetType::RecursiveDirectory => { // We remove the '**' at the end of it, else it will be escaped by the pattern. - scope.allow_directory(fix_directory(path), true); + let _ = scope.allow_directory(fix_directory(path), true); } } } -fn forbid_path(scope: &impl ScopeExt, path: &str) { +fn forbid_path(scope: &tauri::fs::Scope, path: &str) { let target_type = detect_scope_type(path); match target_type { TargetType::File => { - scope.forbid_file(Path::new(path)); + let _ = scope.forbid_file(Path::new(path)); } TargetType::Directory => { - scope.forbid_directory(fix_directory(path), false); + let _ = scope.forbid_directory(fix_directory(path), false); } TargetType::RecursiveDirectory => { - scope.forbid_directory(fix_directory(path), true); + let _ = scope.forbid_directory(fix_directory(path), true); } } } -fn save_scopes(scope: &impl ScopeExt, app_dir: &Path, scope_state_path: &Path) { +fn save_scopes(scope: &tauri::fs::Scope, app_dir: &Path, scope_state_path: &Path) { let scope = Scope { allowed_paths: scope .allowed_patterns() @@ -252,8 +173,11 @@ pub fn init() -> TauriPlugin { #[cfg(feature = "protocol-asset")] let asset_scope_state_path = app_dir.join(ASSET_SCOPE_STATE_FILENAME); - if let Some(fs_scope) = fs_scope { - fs_scope.forbid_file(&fs_scope_state_path); + if let Some(fs_scope) = &fs_scope { + let _ = fs_scope.forbid_file(&fs_scope_state_path); + } else { + #[cfg(debug_assertions)] + eprintln!("Please make sure to register the `fs` plugin before the `persisted-scope` plugin!"); } #[cfg(feature = "protocol-asset")] let _ = asset_protocol_scope.forbid_file(&asset_scope_state_path); @@ -262,7 +186,7 @@ pub fn init() -> TauriPlugin { // We will still save some semi-broken values because the scope events are quite spammy and we don't want to reduce runtime performance any further. let ac = AhoCorasick::new(PATTERNS).unwrap(/* This should be impossible to fail since we're using a small static input */); - if let Some(fs_scope) = fs_scope { + if let Some(fs_scope) = &fs_scope { if fs_scope_state_path.exists() { let scope: Scope = std::fs::read(&fs_scope_state_path) .map_err(Error::from) @@ -307,11 +231,11 @@ pub fn init() -> TauriPlugin { #[cfg(feature = "protocol-asset")] let app_dir_ = app_dir.clone(); - if let Some(fs_scope) = fs_scope { + if let Some(fs_scope) = &fs_scope { let app_ = app.clone(); fs_scope.listen(move |event| { - if let tauri_plugin_fs::ScopeEvent::PathAllowed(_) = event { - save_scopes(app_.fs_scope(), &app_dir, &fs_scope_state_path); + if let tauri::fs::Event::PathAllowed(_) = event { + save_scopes(&app_.fs_scope(), &app_dir, &fs_scope_state_path); } }); } diff --git a/plugins/positioner/CHANGELOG.md b/plugins/positioner/CHANGELOG.md index ee4c473f..3070b168 100644 --- a/plugins/positioner/CHANGELOG.md +++ b/plugins/positioner/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.1.0] + +- [`4db62635`](https://github.com/tauri-apps/plugins-workspace/commit/4db626354c8e29e37bedcf94787a8dd36ce21c55) ([#2076](https://github.com/tauri-apps/plugins-workspace/pull/2076) by [@jakobwesthoff](https://github.com/tauri-apps/plugins-workspace/../../jakobwesthoff)) Add `moveWindowConstrained` function that is similar to `moveWindow` but constrains the window to the screen dimensions in case of tray icon positions. + +## \[2.0.1] + +- [`3c1f3874`](https://github.com/tauri-apps/plugins-workspace/commit/3c1f3874f4c828637b3aa983cba13c77427faf58) ([#1911](https://github.com/tauri-apps/plugins-workspace/pull/1911) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Added missing permission for `handleIconState` and fixed its event processing logic. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -149,19 +161,3 @@ ## \[0.1.0] - Update package/crate metadata - - [119d9c4](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/119d9c47639e1df16f5520a08f039bdb6f39532b) update metadata on 2021-11-19 - - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - data on 2021-11-19 - - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - nberg/tauri-plugin-positioner/commit/119d9c47639e1df16f5520a08f039bdb6f39532b) update metadata on 2021-11-19 - - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - data on 2021-11-19 - - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - data on 2021-11-19 - - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - \-19 - data on 2021-11-19 - - [39e517c](https://www.github.com/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - m/JonasKruckenberg/tauri-plugin-positioner/commit/39e517c145a4a901839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 - 01839ae9b46e296370ce6ababf) Update update-metadata.md on 2021-11-19 diff --git a/plugins/positioner/Cargo.toml b/plugins/positioner/Cargo.toml index 807d1ed9..3123f44c 100644 --- a/plugins/positioner/Cargo.toml +++ b/plugins/positioner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-positioner" -version = "2.0.1" +version = "2.2.0" description = "Position your windows at well-known locations." authors = { workspace = true } license = { workspace = true } diff --git a/plugins/positioner/README.md b/plugins/positioner/README.md index 1c766849..8a86160d 100644 --- a/plugins/positioner/README.md +++ b/plugins/positioner/README.md @@ -56,7 +56,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-positioner#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust use tauri::tray::TrayIconBuilder; diff --git a/plugins/positioner/api-iife.js b/plugins/positioner/api-iife.js index bce8ee32..dda21778 100644 --- a/plugins/positioner/api-iife.js +++ b/plugins/positioner/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_POSITIONER__=function(t){"use strict";async function e(t,e={},o){return window.__TAURI_INTERNALS__.invoke(t,e,o)}var o;return"function"==typeof SuppressedError&&SuppressedError,t.Position=void 0,(o=t.Position||(t.Position={}))[o.TopLeft=0]="TopLeft",o[o.TopRight=1]="TopRight",o[o.BottomLeft=2]="BottomLeft",o[o.BottomRight=3]="BottomRight",o[o.TopCenter=4]="TopCenter",o[o.BottomCenter=5]="BottomCenter",o[o.LeftCenter=6]="LeftCenter",o[o.RightCenter=7]="RightCenter",o[o.Center=8]="Center",o[o.TrayLeft=9]="TrayLeft",o[o.TrayBottomLeft=10]="TrayBottomLeft",o[o.TrayRight=11]="TrayRight",o[o.TrayBottomRight=12]="TrayBottomRight",o[o.TrayCenter=13]="TrayCenter",o[o.TrayBottomCenter=14]="TrayBottomCenter",t.handleIconState=async function(t){const o={};o[`${t.rect.size.type}`]={width:t.rect.size.width,height:t.rect.size.height};const i={};i[`${t.rect.position.type}`]={x:t.rect.position.x,y:t.rect.position.y},await e("plugin:positioner|set_tray_icon_state",{position:i,size:o})},t.moveWindow=async function(t){await e("plugin:positioner|move_window",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_PLUGIN_POSITIONER__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_POSITIONER__=function(t){"use strict";async function o(t,o={},e){return window.__TAURI_INTERNALS__.invoke(t,o,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,t.Position=void 0,(e=t.Position||(t.Position={}))[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e[e.TopCenter=4]="TopCenter",e[e.BottomCenter=5]="BottomCenter",e[e.LeftCenter=6]="LeftCenter",e[e.RightCenter=7]="RightCenter",e[e.Center=8]="Center",e[e.TrayLeft=9]="TrayLeft",e[e.TrayBottomLeft=10]="TrayBottomLeft",e[e.TrayRight=11]="TrayRight",e[e.TrayBottomRight=12]="TrayBottomRight",e[e.TrayCenter=13]="TrayCenter",e[e.TrayBottomCenter=14]="TrayBottomCenter",t.handleIconState=async function(t){await o("plugin:positioner|set_tray_icon_state",{position:t.rect.position,size:t.rect.size})},t.moveWindow=async function(t){await o("plugin:positioner|move_window",{position:t})},t.moveWindowConstrained=async function(t){await o("plugin:positioner|move_window_constrained",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_PLUGIN_POSITIONER__})} diff --git a/plugins/positioner/build.rs b/plugins/positioner/build.rs index 52d33376..830c61fb 100644 --- a/plugins/positioner/build.rs +++ b/plugins/positioner/build.rs @@ -2,7 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -const COMMANDS: &[&str] = &["move_window"]; +const COMMANDS: &[&str] = &[ + "move_window", + "move_window_constrained", + "set_tray_icon_state", +]; fn main() { tauri_plugin::Builder::new(COMMANDS) diff --git a/plugins/positioner/guest-js/index.ts b/plugins/positioner/guest-js/index.ts index 8ba1d609..74d0295e 100644 --- a/plugins/positioner/guest-js/index.ts +++ b/plugins/positioner/guest-js/index.ts @@ -39,21 +39,22 @@ export async function moveWindow(to: Position): Promise { }) } -export async function handleIconState(event: TrayIconEvent): Promise { - const size = {} as Record - size[`${event.rect.size.type}`] = { - width: event.rect.size.width, - height: event.rect.size.height - } - - const position = {} as Record - position[`${event.rect.position.type}`] = { - x: event.rect.position.x, - y: event.rect.position.y - } +/** + * Moves the `Window` to the given {@link Position} using `WindowExt.move_window_constrained()` + * + * This move operation constrains the window to the screen dimensions in case of + * tray-icon positions. + * @param to The (tray) {@link Position} to move to. + */ +export async function moveWindowConstrained(to: Position): Promise { + await invoke('plugin:positioner|move_window_constrained', { + position: to + }) +} +export async function handleIconState(event: TrayIconEvent): Promise { await invoke('plugin:positioner|set_tray_icon_state', { - position, - size + position: event.rect.position, + size: event.rect.size }) } diff --git a/plugins/positioner/package.json b/plugins/positioner/package.json index faba11e2..fd57b990 100644 --- a/plugins/positioner/package.json +++ b/plugins/positioner/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-positioner", - "version": "2.0.0", + "version": "2.2.0", "description": "Position your windows at well-known locations.", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/positioner/permissions/autogenerated/commands/move_window_constrained.toml b/plugins/positioner/permissions/autogenerated/commands/move_window_constrained.toml new file mode 100644 index 00000000..80343990 --- /dev/null +++ b/plugins/positioner/permissions/autogenerated/commands/move_window_constrained.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-move-window-constrained" +description = "Enables the move_window_constrained command without any pre-configured scope." +commands.allow = ["move_window_constrained"] + +[[permission]] +identifier = "deny-move-window-constrained" +description = "Denies the move_window_constrained command without any pre-configured scope." +commands.deny = ["move_window_constrained"] diff --git a/plugins/positioner/permissions/autogenerated/commands/set_tray_icon_state.toml b/plugins/positioner/permissions/autogenerated/commands/set_tray_icon_state.toml index dcc8fa56..6b85f635 100644 --- a/plugins/positioner/permissions/autogenerated/commands/set_tray_icon_state.toml +++ b/plugins/positioner/permissions/autogenerated/commands/set_tray_icon_state.toml @@ -4,5 +4,10 @@ [[permission]] identifier = "allow-set-tray-icon-state" -description = "Enables the set_tray_icon_state to handle events and set the TrayIcon state." +description = "Enables the set_tray_icon_state command without any pre-configured scope." commands.allow = ["set_tray_icon_state"] + +[[permission]] +identifier = "deny-set-tray-icon-state" +description = "Denies the set_tray_icon_state command without any pre-configured scope." +commands.deny = ["set_tray_icon_state"] diff --git a/plugins/positioner/permissions/autogenerated/reference.md b/plugins/positioner/permissions/autogenerated/reference.md index 324e4e56..72182c02 100644 --- a/plugins/positioner/permissions/autogenerated/reference.md +++ b/plugins/positioner/permissions/autogenerated/reference.md @@ -1,9 +1,10 @@ ## Default Permission -Allows the move_window command +Allows the moveWindow and handleIconState APIs - `allow-move-window` -- `set-tray-icon-state` +- `allow-move-window-constrained` +- `allow-set-tray-icon-state` ## Permission Table @@ -43,12 +44,51 @@ Denies the move_window command without any pre-configured scope. +`positioner:allow-move-window-constrained` + + + + +Enables the move_window_constrained command without any pre-configured scope. + + + + + + + +`positioner:deny-move-window-constrained` + + + + +Denies the move_window_constrained command without any pre-configured scope. + + + + + + + `positioner:allow-set-tray-icon-state` -Enables the set_tray_icon_state to handle events and set the TrayIcon state. +Enables the set_tray_icon_state command without any pre-configured scope. + + + + + + + +`positioner:deny-set-tray-icon-state` + + + + +Denies the set_tray_icon_state command without any pre-configured scope. diff --git a/plugins/positioner/permissions/default.toml b/plugins/positioner/permissions/default.toml index 8492711c..7fc3c3d9 100644 --- a/plugins/positioner/permissions/default.toml +++ b/plugins/positioner/permissions/default.toml @@ -1,4 +1,8 @@ "$schema" = "schemas/schema.json" [default] -description = "Allows the move_window command" -permissions = ["allow-move-window", "set-tray-icon-state"] +description = "Allows the moveWindow and handleIconState APIs" +permissions = [ + "allow-move-window", + "allow-move-window-constrained", + "allow-set-tray-icon-state", +] diff --git a/plugins/positioner/permissions/schemas/schema.json b/plugins/positioner/permissions/schemas/schema.json index 5bddddde..ccf55156 100644 --- a/plugins/positioner/permissions/schemas/schema.json +++ b/plugins/positioner/permissions/schemas/schema.json @@ -305,12 +305,27 @@ "const": "deny-move-window" }, { - "description": "Enables the set_tray_icon_state to handle events and set the TrayIcon state.", + "description": "Enables the move_window_constrained command without any pre-configured scope.", + "type": "string", + "const": "allow-move-window-constrained" + }, + { + "description": "Denies the move_window_constrained command without any pre-configured scope.", + "type": "string", + "const": "deny-move-window-constrained" + }, + { + "description": "Enables the set_tray_icon_state command without any pre-configured scope.", "type": "string", "const": "allow-set-tray-icon-state" }, { - "description": "Allows the move_window command", + "description": "Denies the set_tray_icon_state command without any pre-configured scope.", + "type": "string", + "const": "deny-set-tray-icon-state" + }, + { + "description": "Allows the moveWindow and handleIconState APIs", "type": "string", "const": "default" } diff --git a/plugins/positioner/src/ext.rs b/plugins/positioner/src/ext.rs index 4688cd51..b3d405ea 100644 --- a/plugins/positioner/src/ext.rs +++ b/plugins/positioner/src/ext.rs @@ -8,6 +8,8 @@ use crate::Tray; use serde_repr::Deserialize_repr; #[cfg(feature = "tray-icon")] use tauri::Manager; +#[cfg(feature = "tray-icon")] +use tauri::Monitor; use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, WebviewWindow, Window}; /// Well known window positions. @@ -41,172 +43,265 @@ pub enum Position { pub trait WindowExt { /// Moves the [`Window`] to the given [`Position`] /// - /// All positions are relative to the **current** screen. + /// All (non-tray) positions are relative to the **current** screen. fn move_window(&self, position: Position) -> Result<()>; + #[cfg(feature = "tray-icon")] + /// Moves the [`Window`] to the given [`Position`] while constraining Tray Positions to the dimensions of the screen. + /// + /// All non-tray positions will not be constrained by this method. + /// + /// This method allows you to position your Tray Windows without having them + /// cut off on the screen borders. + fn move_window_constrained(&self, position: Position) -> Result<()>; } impl WindowExt for WebviewWindow { fn move_window(&self, pos: Position) -> Result<()> { self.as_ref().window().move_window(pos) } + + #[cfg(feature = "tray-icon")] + fn move_window_constrained(&self, position: Position) -> Result<()> { + self.as_ref().window().move_window_constrained(position) + } } + impl WindowExt for Window { + #[cfg(feature = "tray-icon")] + fn move_window_constrained(&self, position: Position) -> Result<()> { + // Diverge to basic move_window, if the position is not a tray position + if !matches!( + position, + Position::TrayLeft + | Position::TrayBottomLeft + | Position::TrayRight + | Position::TrayBottomRight + | Position::TrayCenter + | Position::TrayBottomCenter + ) { + return self.move_window(position); + } + + let window_position = calculate_position(self, position)?; + let monitor = get_monitor_for_tray_icon(self)?; + if let Some(monitor) = monitor { + let monitor_size = monitor.size(); + let monitor_position = monitor.position(); + let window_size = self.outer_size()?; + + let right_border_monitor = monitor_position.x as f64 + monitor_size.width as f64; + let left_border_monitor = monitor_position.x as f64; + let right_border_window = window_position.x as f64 + window_size.width as f64; + let left_border_window = window_position.x as f64; + + let constrained_x = if left_border_window < left_border_monitor { + left_border_monitor + } else if right_border_window > right_border_monitor { + right_border_monitor - window_size.width as f64 + } else { + window_position.x as f64 + }; + + let bottom_border_monitor = monitor_position.y as f64 + monitor_size.height as f64; + let top_border_monitor = monitor_position.y as f64; + let bottom_border_window = window_position.y as f64 + window_size.height as f64; + let top_border_window = window_position.y as f64; + + let constrained_y = if top_border_window < top_border_monitor { + top_border_monitor + } else if bottom_border_window > bottom_border_monitor { + bottom_border_monitor - window_size.height as f64 + } else { + window_position.y as f64 + }; + + self.set_position(PhysicalPosition::new(constrained_x, constrained_y))?; + } else { + // Fallback on non constrained positioning + self.set_position(window_position)?; + } + + Ok(()) + } + fn move_window(&self, pos: Position) -> Result<()> { - use Position::*; - - let screen = self.current_monitor()?.unwrap(); - let screen_position = screen.position(); - let screen_size = PhysicalSize:: { - width: screen.size().width as i32, - height: screen.size().height as i32, - }; - let window_size = PhysicalSize:: { - width: self.outer_size()?.width as i32, - height: self.outer_size()?.height as i32, - }; + let position = calculate_position(self, pos)?; + self.set_position(position) + } +} + +#[cfg(feature = "tray-icon")] +/// Retrieve the monitor, where the tray icon is located on. +fn get_monitor_for_tray_icon(window: &Window) -> Result> { + let tray_position = window + .state::() + .0 + .lock() + .unwrap() + .map(|(pos, _)| pos) + .unwrap_or_default(); + + window.monitor_from_point(tray_position.x, tray_position.y) +} + +/// Calculate the top-left position of the window based on the given +/// [`Position`]. +fn calculate_position( + window: &Window, + pos: Position, +) -> Result> { + use Position::*; + + let screen = window.current_monitor()?.unwrap(); + // Only use the screen_position for the Tray independent positioning, + // because a tray event may not be called on the currently active monitor. + let screen_position = screen.position(); + let screen_size = PhysicalSize:: { + width: screen.size().width as i32, + height: screen.size().height as i32, + }; + let window_size = PhysicalSize:: { + width: window.outer_size()?.width as i32, + height: window.outer_size()?.height as i32, + }; + #[cfg(feature = "tray-icon")] + let (tray_position, tray_size) = window + .state::() + .0 + .lock() + .unwrap() + .map(|(pos, size)| { + ( + Some((pos.x as i32, pos.y as i32)), + Some((size.width as i32, size.height as i32)), + ) + }) + .unwrap_or_default(); + + let physical_pos = match pos { + TopLeft => *screen_position, + TopRight => PhysicalPosition { + x: screen_position.x + (screen_size.width - window_size.width), + y: screen_position.y, + }, + BottomLeft => PhysicalPosition { + x: screen_position.x, + y: screen_size.height - (window_size.height - screen_position.y), + }, + BottomRight => PhysicalPosition { + x: screen_position.x + (screen_size.width - window_size.width), + y: screen_size.height - (window_size.height - screen_position.y), + }, + TopCenter => PhysicalPosition { + x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), + y: screen_position.y, + }, + BottomCenter => PhysicalPosition { + x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), + y: screen_size.height - (window_size.height - screen_position.y), + }, + LeftCenter => PhysicalPosition { + x: screen_position.x, + y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), + }, + RightCenter => PhysicalPosition { + x: screen_position.x + (screen_size.width - window_size.width), + y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), + }, + Center => PhysicalPosition { + x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), + y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), + }, #[cfg(feature = "tray-icon")] - let (tray_position, tray_size) = self - .state::() - .0 - .lock() - .unwrap() - .map(|(pos, size)| { - ( - Some((pos.x as i32, pos.y as i32)), - Some((size.width as i32, size.height as i32)), - ) - }) - .unwrap_or_default(); - - let physical_pos = match pos { - TopLeft => *screen_position, - TopRight => PhysicalPosition { - x: screen_position.x + (screen_size.width - window_size.width), - y: screen_position.y, - }, - BottomLeft => PhysicalPosition { - x: screen_position.x, - y: screen_size.height - (window_size.height - screen_position.y), - }, - BottomRight => PhysicalPosition { - x: screen_position.x + (screen_size.width - window_size.width), - y: screen_size.height - (window_size.height - screen_position.y), - }, - TopCenter => PhysicalPosition { - x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), - y: screen_position.y, - }, - BottomCenter => PhysicalPosition { - x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), - y: screen_size.height - (window_size.height - screen_position.y), - }, - LeftCenter => PhysicalPosition { - x: screen_position.x, - y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), - }, - RightCenter => PhysicalPosition { - x: screen_position.x + (screen_size.width - window_size.width), - y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), - }, - Center => PhysicalPosition { - x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), - y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), - }, - #[cfg(feature = "tray-icon")] - TrayLeft => { - if let (Some((tray_x, tray_y)), Some((_, _tray_height))) = - (tray_position, tray_size) - { - let y = tray_y - window_size.height; - // Choose y value based on the target OS - #[cfg(target_os = "windows")] - let y = if y < 0 { tray_y + _tray_height } else { y }; - - #[cfg(target_os = "macos")] - let y = if y < 0 { tray_y } else { y }; - - PhysicalPosition { x: tray_x, y } - } else { - panic!("Tray position not set"); - } + TrayLeft => { + if let (Some((tray_x, tray_y)), Some((_, _tray_height))) = (tray_position, tray_size) { + let y = tray_y - window_size.height; + // Choose y value based on the target OS + #[cfg(target_os = "windows")] + let y = if y < 0 { tray_y + _tray_height } else { y }; + + #[cfg(target_os = "macos")] + let y = if y < 0 { tray_y } else { y }; + + PhysicalPosition { x: tray_x, y } + } else { + panic!("Tray position not set"); } - #[cfg(feature = "tray-icon")] - TrayBottomLeft => { - if let Some((tray_x, tray_y)) = tray_position { - PhysicalPosition { - x: tray_x, - y: tray_y, - } - } else { - panic!("Tray position not set"); + } + #[cfg(feature = "tray-icon")] + TrayBottomLeft => { + if let Some((tray_x, tray_y)) = tray_position { + PhysicalPosition { + x: tray_x, + y: tray_y, } + } else { + panic!("Tray position not set"); } - #[cfg(feature = "tray-icon")] - TrayRight => { - if let (Some((tray_x, tray_y)), Some((tray_width, _tray_height))) = - (tray_position, tray_size) - { - let y = tray_y - window_size.height; - // Choose y value based on the target OS - #[cfg(target_os = "windows")] - let y = if y < 0 { tray_y + _tray_height } else { y }; - - #[cfg(target_os = "macos")] - let y = if y < 0 { tray_y } else { y }; - - PhysicalPosition { - x: tray_x + tray_width, - y, - } - } else { - panic!("Tray position not set"); + } + #[cfg(feature = "tray-icon")] + TrayRight => { + if let (Some((tray_x, tray_y)), Some((tray_width, _tray_height))) = + (tray_position, tray_size) + { + let y = tray_y - window_size.height; + // Choose y value based on the target OS + #[cfg(target_os = "windows")] + let y = if y < 0 { tray_y + _tray_height } else { y }; + + #[cfg(target_os = "macos")] + let y = if y < 0 { tray_y } else { y }; + + PhysicalPosition { + x: tray_x + tray_width, + y, } + } else { + panic!("Tray position not set"); } - #[cfg(feature = "tray-icon")] - TrayBottomRight => { - if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size) - { - PhysicalPosition { - x: tray_x + tray_width, - y: tray_y, - } - } else { - panic!("Tray position not set"); + } + #[cfg(feature = "tray-icon")] + TrayBottomRight => { + if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size) { + PhysicalPosition { + x: tray_x + tray_width, + y: tray_y, } + } else { + panic!("Tray position not set"); } - #[cfg(feature = "tray-icon")] - TrayCenter => { - if let (Some((tray_x, tray_y)), Some((tray_width, _tray_height))) = - (tray_position, tray_size) - { - let x = tray_x + tray_width / 2 - window_size.width / 2; - let y = tray_y - window_size.height; - // Choose y value based on the target OS - #[cfg(target_os = "windows")] - let y = if y < 0 { tray_y + _tray_height } else { y }; - - #[cfg(target_os = "macos")] - let y = if y < 0 { tray_y } else { y }; - - PhysicalPosition { x, y } - } else { - panic!("Tray position not set"); - } + } + #[cfg(feature = "tray-icon")] + TrayCenter => { + if let (Some((tray_x, tray_y)), Some((tray_width, _tray_height))) = + (tray_position, tray_size) + { + let x = tray_x + tray_width / 2 - window_size.width / 2; + let y = tray_y - window_size.height; + // Choose y value based on the target OS + #[cfg(target_os = "windows")] + let y = if y < 0 { tray_y + _tray_height } else { y }; + + #[cfg(target_os = "macos")] + let y = if y < 0 { tray_y } else { y }; + + PhysicalPosition { x, y } + } else { + panic!("Tray position not set"); } - #[cfg(feature = "tray-icon")] - TrayBottomCenter => { - if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size) - { - PhysicalPosition { - x: tray_x + (tray_width / 2) - (window_size.width / 2), - y: tray_y, - } - } else { - panic!("Tray position not set"); + } + #[cfg(feature = "tray-icon")] + TrayBottomCenter => { + if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size) { + PhysicalPosition { + x: tray_x + (tray_width / 2) - (window_size.width / 2), + y: tray_y, } + } else { + panic!("Tray position not set"); } - }; + } + }; - self.set_position(tauri::Position::Physical(physical_pos)) - } + Ok(physical_pos) } diff --git a/plugins/positioner/src/lib.rs b/plugins/positioner/src/lib.rs index 81bfaef8..59d0c3c1 100644 --- a/plugins/positioner/src/lib.rs +++ b/plugins/positioner/src/lib.rs @@ -3,8 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/positioner/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/positioner) -//! //! A plugin for Tauri that helps position your windows at well-known locations. //! //! # Cargo features @@ -63,6 +61,15 @@ async fn move_window(window: tauri::Window, position: Position) - window.move_window(position) } +#[cfg(feature = "tray-icon")] +#[tauri::command] +async fn move_window_constrained( + window: tauri::Window, + position: Position, +) -> Result<()> { + window.move_window_constrained(position) +} + #[cfg(feature = "tray-icon")] #[tauri::command] fn set_tray_icon_state( @@ -82,6 +89,8 @@ pub fn init() -> TauriPlugin { let plugin = plugin::Builder::new("positioner").invoke_handler(tauri::generate_handler![ move_window, #[cfg(feature = "tray-icon")] + move_window_constrained, + #[cfg(feature = "tray-icon")] set_tray_icon_state ]); diff --git a/plugins/process/CHANGELOG.md b/plugins/process/CHANGELOG.md index 8c69c695..7bcdab70 100644 --- a/plugins/process/CHANGELOG.md +++ b/plugins/process/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -84,11 +88,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/process/Cargo.toml b/plugins/process/Cargo.toml index 4c679022..4577844f 100644 --- a/plugins/process/Cargo.toml +++ b/plugins/process/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-process" -version = "2.0.1" +version = "2.2.0" description = "Access the current process of your Tauri application." edition = { workspace = true } authors = { workspace = true } diff --git a/plugins/process/README.md b/plugins/process/README.md index ad7d53ab..9f75bacb 100644 --- a/plugins/process/README.md +++ b/plugins/process/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-process#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/process/package.json b/plugins/process/package.json index bac14def..0eda3235 100644 --- a/plugins/process/package.json +++ b/plugins/process/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-process", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/process/permissions/autogenerated/reference.md b/plugins/process/permissions/autogenerated/reference.md index 10b6a82b..46137369 100644 --- a/plugins/process/permissions/autogenerated/reference.md +++ b/plugins/process/permissions/autogenerated/reference.md @@ -1,7 +1,7 @@ ## Default Permission This permission set configures which -process feeatures are by default exposed. +process features are by default exposed. #### Granted Permissions diff --git a/plugins/process/permissions/default.toml b/plugins/process/permissions/default.toml index 619eb9d8..69a9b00d 100644 --- a/plugins/process/permissions/default.toml +++ b/plugins/process/permissions/default.toml @@ -3,7 +3,7 @@ [default] description = """ This permission set configures which -process feeatures are by default exposed. +process features are by default exposed. #### Granted Permissions diff --git a/plugins/process/permissions/schemas/schema.json b/plugins/process/permissions/schemas/schema.json index bb885bff..1243c7d3 100644 --- a/plugins/process/permissions/schemas/schema.json +++ b/plugins/process/permissions/schemas/schema.json @@ -315,11 +315,11 @@ "const": "deny-restart" }, { - "description": "This permission set configures which\nprocess feeatures are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n", + "description": "This permission set configures which\nprocess features are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n", "type": "string", "const": "default" } ] } } -} \ No newline at end of file +} diff --git a/plugins/process/src/lib.rs b/plugins/process/src/lib.rs index e0e948fc..b83d8964 100644 --- a/plugins/process/src/lib.rs +++ b/plugins/process/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/process/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/process) -//! //! This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. #![doc( diff --git a/plugins/shell/CHANGELOG.md b/plugins/shell/CHANGELOG.md index bcc894c8..cbeec3b4 100644 --- a/plugins/shell/CHANGELOG.md +++ b/plugins/shell/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.0.1] + +- [`51ddf6a7`](https://github.com/tauri-apps/plugins-workspace/commit/51ddf6a71544acfb261ffc9393dab1342da0a219) ([#1881](https://github.com/tauri-apps/plugins-workspace/pull/1881) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) On Windows, Fix `open` JS API hanging and freezing the app. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -108,35 +116,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - d `Command::arg`, `Command::env` and changed `Command::new` input type. -- [`52ef0ad`](https://github.com/tauri-apps/plugins-workspace/commit/52ef0addd84a1737a4e1a4b07113a30d3d496fa1)([#463](https://github.com/tauri-apps/plugins-workspace/pull/463)) Ensure the launched process is detached so it can out-live your tauri app and does not shutdown with it. -- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ins-workspace/pull/555)) Update to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - rkspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - .com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/shell/Cargo.toml b/plugins/shell/Cargo.toml index 31c0cc97..14b98d45 100644 --- a/plugins/shell/Cargo.toml +++ b/plugins/shell/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-shell" -version = "2.0.1" +version = "2.2.0" description = "Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application." edition = { workspace = true } authors = { workspace = true } diff --git a/plugins/shell/README.md b/plugins/shell/README.md index 2f6e5ad6..5f309b8c 100644 --- a/plugins/shell/README.md +++ b/plugins/shell/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-shell#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/shell/api-iife.js b/plugins/shell/api-iife.js index 25ba6d3e..34bac342 100644 --- a/plugins/shell/api-iife.js +++ b/plugins/shell/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(e){"use strict";function t(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function s(e,t,s,n,i){if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var n,i,r;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),i.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:o})=>{if(o===t(this,i,"f")){s(this,i,o+1),t(this,n,"f").call(this,e);const a=Object.keys(t(this,r,"f"));if(a.length>0){let e=o+1;for(const s of a.sort()){if(parseInt(s)!==e)break;{const i=t(this,r,"f")[s];delete t(this,r,"f")[s],t(this,n,"f").call(this,i),e+=1}}s(this,i,e)}}else t(this,r,"f")[o.toString()]=e}))}set onmessage(e){s(this,n,e)}get onmessage(){return t(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}n=new WeakMap,i=new WeakMap,r=new WeakMap;class h{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const s=n=>{this.removeListener(e,s),t(n)};return this.addListener(e,s)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const s=this.eventListeners[e];for(const e of s)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const s=n=>{this.removeListener(e,s),t(n)};return this.prependListener(e,s)}}class c{constructor(e){this.pid=e}async write(e){await a("plugin:shell|stdin_write",{pid:this.pid,buffer:e})}async kill(){await a("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class l extends h{constructor(e,t=[],s){super(),this.stdout=new h,this.stderr=new h,this.program=e,this.args="string"==typeof t?[t]:t,this.options=s??{}}static create(e,t=[],s){return new l(e,t,s)}static sidecar(e,t=[],s){const n=new l(e,t,s);return n.options.sidecar=!0,n}async spawn(){const e=this.program,t=this.args,s=this.options;"object"==typeof t&&Object.freeze(t);const n=new o;return n.onmessage=e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}},await a("plugin:shell|spawn",{program:e,args:t,options:s,onEvent:n}).then((e=>new c(e)))}async execute(){const e=this.program,t=this.args,s=this.options;return"object"==typeof t&&Object.freeze(t),await a("plugin:shell|execute",{program:e,args:t,options:s})}}return e.Child=c,e.Command=l,e.EventEmitter=h,e.open=async function(e,t){await a("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(e){"use strict";function t(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)}function s(e,t,s,i,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var i,n,r;"function"==typeof SuppressedError&&SuppressedError;const o="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),n.set(this,0),r.set(this,[]),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:o})=>{if(o==t(this,n,"f"))for(t(this,i,"f").call(this,e),s(this,n,t(this,n,"f")+1);t(this,n,"f")in t(this,r,"f");){const e=t(this,r,"f")[t(this,n,"f")];t(this,i,"f").call(this,e),delete t(this,r,"f")[t(this,n,"f")],s(this,n,t(this,n,"f")+1)}else t(this,r,"f")[o]=e}))}set onmessage(e){s(this,i,e)}get onmessage(){return t(this,i,"f")}[(i=new WeakMap,n=new WeakMap,r=new WeakMap,o)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[o]()}}async function h(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}class c{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const s=i=>{this.removeListener(e,s),t(i)};return this.addListener(e,s)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const s=this.eventListeners[e];for(const e of s)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const s=i=>{this.removeListener(e,s),t(i)};return this.prependListener(e,s)}}class l{constructor(e){this.pid=e}async write(e){await h("plugin:shell|stdin_write",{pid:this.pid,buffer:e})}async kill(){await h("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class u extends c{constructor(e,t=[],s){super(),this.stdout=new c,this.stderr=new c,this.program=e,this.args="string"==typeof t?[t]:t,this.options=s??{}}static create(e,t=[],s){return new u(e,t,s)}static sidecar(e,t=[],s){const i=new u(e,t,s);return i.options.sidecar=!0,i}async spawn(){const e=this.program,t=this.args,s=this.options;"object"==typeof t&&Object.freeze(t);const i=new a;return i.onmessage=e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}},await h("plugin:shell|spawn",{program:e,args:t,options:s,onEvent:i}).then((e=>new l(e)))}async execute(){const e=this.program,t=this.args,s=this.options;return"object"==typeof t&&Object.freeze(t),await h("plugin:shell|execute",{program:e,args:t,options:s})}}return e.Child=l,e.Command=u,e.EventEmitter=c,e.open=async function(e,t){await h("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})} diff --git a/plugins/shell/build.rs b/plugins/shell/build.rs index a4a74a99..4e19ccd8 100644 --- a/plugins/shell/build.rs +++ b/plugins/shell/build.rs @@ -182,6 +182,7 @@ fn main() { // creates a cfg alias if `has_feature` is true. // `alias` must be a snake case string. fn alias(alias: &str, has_feature: bool) { + println!("cargo:rustc-check-cfg=cfg({alias})"); if has_feature { println!("cargo:rustc-cfg={alias}"); } diff --git a/plugins/shell/package.json b/plugins/shell/package.json index 0975f8f9..126e5b6f 100644 --- a/plugins/shell/package.json +++ b/plugins/shell/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-shell", - "version": "2.0.0", + "version": "2.2.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/shell/src/commands.rs b/plugins/shell/src/commands.rs index 7aac7b6c..5bee6b92 100644 --- a/plugins/shell/src/commands.rs +++ b/plugins/shell/src/commands.rs @@ -11,8 +11,9 @@ use tauri::{ Manager, Runtime, State, Window, }; +#[allow(deprecated)] +use crate::open::Program; use crate::{ - open::Program, process::{CommandEvent, TerminatedPayload}, scope::ExecuteArgs, Shell, @@ -302,8 +303,9 @@ pub fn kill( Ok(()) } +#[allow(deprecated)] #[tauri::command] -pub fn open( +pub async fn open( _window: Window, shell: State<'_, Shell>, path: String, diff --git a/plugins/shell/src/lib.rs b/plugins/shell/src/lib.rs index 1ec90e2e..64cc6122 100644 --- a/plugins/shell/src/lib.rs +++ b/plugins/shell/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/shell/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/shell) -//! //! Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. #![doc( @@ -28,6 +26,8 @@ use tauri::{ mod commands; mod config; mod error; +#[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")] +#[allow(deprecated)] pub mod open; pub mod process; mod scope; @@ -72,6 +72,8 @@ impl Shell { /// /// See [`crate::open::open`] for how it handles security-related measures. #[cfg(desktop)] + #[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")] + #[allow(deprecated)] pub fn open(&self, path: impl Into, with: Option) -> Result<()> { open::open(&self.open_scope, path.into(), with).map_err(Into::into) } @@ -80,6 +82,7 @@ impl Shell { /// /// See [`crate::open::open`] for how it handles security-related measures. #[cfg(mobile)] + #[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")] pub fn open(&self, path: impl Into, _with: Option) -> Result<()> { self.mobile_plugin_handle .run_mobile_plugin("open", path.into()) diff --git a/plugins/shell/src/open.rs b/plugins/shell/src/open.rs index 8366b45b..fe224704 100644 --- a/plugins/shell/src/open.rs +++ b/plugins/shell/src/open.rs @@ -10,6 +10,7 @@ use crate::scope::OpenScope; use std::str::FromStr; /// Program to use on the [`open()`] call. +#[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")] pub enum Program { /// Use the `open` program. Open, @@ -117,6 +118,7 @@ impl Program { /// Ok(()) /// }); /// ``` +#[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")] pub fn open>(scope: &OpenScope, path: P, with: Option) -> crate::Result<()> { scope.open(path.as_ref(), with).map_err(Into::into) } diff --git a/plugins/shell/src/scope.rs b/plugins/shell/src/scope.rs index 8178ab10..d46bfa20 100644 --- a/plugins/shell/src/scope.rs +++ b/plugins/shell/src/scope.rs @@ -4,6 +4,7 @@ use std::sync::Arc; +#[allow(deprecated)] use crate::open::Program; use crate::process::Command; @@ -201,6 +202,7 @@ impl OpenScope { /// /// The path is validated against the `plugins > shell > open` validation regex, which /// defaults to `^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+`. + #[allow(deprecated)] pub fn open(&self, path: &str, with: Option) -> Result<(), Error> { // ensure we pass validation if the configuration has one if let Some(regex) = &self.open { @@ -222,7 +224,7 @@ impl OpenScope { } } -impl<'a> ShellScope<'a> { +impl ShellScope<'_> { /// Validates argument inputs and creates a Tauri sidecar [`Command`]. pub fn prepare_sidecar( &self, diff --git a/plugins/single-instance/CHANGELOG.md b/plugins/single-instance/CHANGELOG.md index 0724caad..e0802b51 100644 --- a/plugins/single-instance/CHANGELOG.md +++ b/plugins/single-instance/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## \[2.2.1] + +- [`da5c59e2`](https://github.com/tauri-apps/plugins-workspace/commit/da5c59e2fe879d177e3cfd52fcacce85440423cb) ([#2271](https://github.com/tauri-apps/plugins-workspace/pull/2271) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated `zbus` dependency to version 5. No API changes. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +### Dependencies + +- Upgraded to `deep-link@2.1.0` + +## \[2.0.2] + +### Dependencies + +- Upgraded to `deep-link@2.0.2` + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. diff --git a/plugins/single-instance/Cargo.toml b/plugins/single-instance/Cargo.toml index 666c0d04..edcbdb77 100644 --- a/plugins/single-instance/Cargo.toml +++ b/plugins/single-instance/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-single-instance" -version = "2.0.1" +version = "2.2.1" description = "Ensure a single instance of your tauri app is running." authors = { workspace = true } license = { workspace = true } @@ -24,9 +24,9 @@ ios = { level = "none", notes = "" } serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } -log = { workspace = true } +tracing = { workspace = true } thiserror = { workspace = true } -tauri-plugin-deep-link = { path = "../deep-link", version = "2.0.1", optional = true } +tauri-plugin-deep-link = { path = "../deep-link", version = "2.2.0", optional = true } semver = { version = "1", optional = true } [target."cfg(target_os = \"windows\")".dependencies.windows-sys] @@ -42,7 +42,7 @@ features = [ ] [target."cfg(target_os = \"linux\")".dependencies] -zbus = "4" +zbus = { workspace = true } [features] semver = ["dep:semver"] diff --git a/plugins/single-instance/README.md b/plugins/single-instance/README.md index 64224602..711be6ae 100644 --- a/plugins/single-instance/README.md +++ b/plugins/single-instance/README.md @@ -35,7 +35,7 @@ tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-wo First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust use tauri::{Manager}; diff --git a/plugins/single-instance/examples/vanilla/package.json b/plugins/single-instance/examples/vanilla/package.json index b4c80cbd..16342f03 100644 --- a/plugins/single-instance/examples/vanilla/package.json +++ b/plugins/single-instance/examples/vanilla/package.json @@ -9,6 +9,6 @@ "author": "", "license": "MIT", "devDependencies": { - "@tauri-apps/cli": "2.0.0" + "@tauri-apps/cli": "2.2.7" } } diff --git a/plugins/single-instance/src/lib.rs b/plugins/single-instance/src/lib.rs index ce7815e8..03fd1ed7 100644 --- a/plugins/single-instance/src/lib.rs +++ b/plugins/single-instance/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/single-instance/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/single-instance) -//! //! Ensure a single instance of your tauri app is running. #![doc( diff --git a/plugins/single-instance/src/platform_impl/macos.rs b/plugins/single-instance/src/platform_impl/macos.rs index 8f35d76c..70284eae 100644 --- a/plugins/single-instance/src/platform_impl/macos.rs +++ b/plugins/single-instance/src/platform_impl/macos.rs @@ -34,7 +34,7 @@ pub fn init(cb: Box>) -> TauriPlugin { listen_for_other_instances(&socket, app.clone(), cb); } _ => { - log::debug!( + tracing::debug!( "single_instance failed to notify - launching normally: {}", e ); @@ -108,11 +108,13 @@ fn listen_for_other_instances( s.split('\0').map(String::from).collect(); cb(app.app_handle(), args, cwd.clone()); } - Err(e) => log::debug!("single_instance failed to be notified: {e}"), + Err(e) => { + tracing::debug!("single_instance failed to be notified: {e}") + } } } Err(err) => { - log::debug!("single_instance failed to be notified: {}", err); + tracing::debug!("single_instance failed to be notified: {}", err); continue; } } @@ -120,7 +122,7 @@ fn listen_for_other_instances( }); } Err(err) => { - log::error!( + tracing::error!( "single_instance failed to listen to other processes - launching normally: {}", err ); diff --git a/plugins/sql/CHANGELOG.md b/plugins/sql/CHANGELOG.md index 8fe92f86..a80c3ff1 100644 --- a/plugins/sql/CHANGELOG.md +++ b/plugins/sql/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.0.2] + +- [`31956469`](https://github.com/tauri-apps/plugins-workspace/commit/319564699638c080b73d506bcaad186ecc4a8236) ([#1928](https://github.com/tauri-apps/plugins-workspace/pull/1928) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed the QueryResult typing by marking `lastInsertId` as optional to reflect postgres-only changes made in the 2.0.0 release. + +## \[2.0.3] + +- [`90ef77c8`](https://github.com/tauri-apps/plugins-workspace/commit/90ef77c8723ac9d0ba7bd3b52a80a2b14843ff99) ([#2038](https://github.com/tauri-apps/plugins-workspace/pull/2038) by [@johncarmack1984](https://github.com/tauri-apps/plugins-workspace/../../johncarmack1984)) Allow blocking on async code without creating a nested runtime. + +## \[2.0.1] + +- [`0ca4cc91`](https://github.com/tauri-apps/plugins-workspace/commit/0ca4cc914c5ea995c98f9e60a2ab49827c219350) ([#1963](https://github.com/tauri-apps/plugins-workspace/pull/1963) by [@yoggys](https://github.com/tauri-apps/plugins-workspace/../../yoggys)) Fixed incorrect documentation of the select method in the Database class. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -100,23 +116,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/sql/Cargo.toml b/plugins/sql/Cargo.toml index 8e6ed457..0449a4be 100644 --- a/plugins/sql/Cargo.toml +++ b/plugins/sql/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-sql" -version = "2.0.1" +version = "2.2.0" description = "Interface with SQL databases." authors = { workspace = true } license = { workspace = true } @@ -19,7 +19,7 @@ windows = { level = "full", notes = "" } linux = { level = "full", notes = "" } macos = { level = "full", notes = "" } android = { level = "full", notes = "" } -ios = { level = "none", notes = "" } +ios = { level = "full", notes = "" } [build-dependencies] tauri-plugin = { workspace = true, features = ["build"] } diff --git a/plugins/sql/README.md b/plugins/sql/README.md index 85318cff..1df02e21 100644 --- a/plugins/sql/README.md +++ b/plugins/sql/README.md @@ -56,7 +56,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-sql#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/sql/guest-js/index.ts b/plugins/sql/guest-js/index.ts index 05eed0e3..11d39e70 100644 --- a/plugins/sql/guest-js/index.ts +++ b/plugins/sql/guest-js/index.ts @@ -10,12 +10,12 @@ export interface QueryResult { /** * The last inserted `id`. * - * This value is always `0` when using the Postgres driver. If the + * This value is not set for Postgres databases. If the * last inserted id is required on Postgres, the `select` function * must be used, with a `RETURNING` clause * (`INSERT INTO todos (title) VALUES ($1) RETURNING id`). */ - lastInsertId: number + lastInsertId?: number } /** @@ -129,12 +129,12 @@ export default class Database { * ```ts * // for sqlite & postgres * const result = await db.select( - * "SELECT * from todos WHERE id = $1", id + * "SELECT * from todos WHERE id = $1", [ id ] * ); * * // for mysql * const result = await db.select( - * "SELECT * from todos WHERE id = ?", id + * "SELECT * from todos WHERE id = ?", [ id ] * ); * ``` */ diff --git a/plugins/sql/package.json b/plugins/sql/package.json index db2c6d2a..162df528 100644 --- a/plugins/sql/package.json +++ b/plugins/sql/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-sql", - "version": "2.0.0", + "version": "2.2.0", "description": "Interface with SQL databases", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/sql/src/commands.rs b/plugins/sql/src/commands.rs index 8cd90e9c..760d00b2 100644 --- a/plugins/sql/src/commands.rs +++ b/plugins/sql/src/commands.rs @@ -23,7 +23,7 @@ pub(crate) async fn load( pool.migrate(&migrator).await?; } - db_instances.0.lock().await.insert(db.clone(), pool); + db_instances.0.write().await.insert(db.clone(), pool); Ok(db) } @@ -36,7 +36,7 @@ pub(crate) async fn close( db_instances: State<'_, DbInstances>, db: Option, ) -> Result { - let mut instances = db_instances.0.lock().await; + let instances = db_instances.0.read().await; let pools = if let Some(db) = db { vec![db] @@ -45,9 +45,7 @@ pub(crate) async fn close( }; for pool in pools { - let db = instances - .get_mut(&pool) - .ok_or(Error::DatabaseNotLoaded(pool))?; + let db = instances.get(&pool).ok_or(Error::DatabaseNotLoaded(pool))?; db.close().await; } @@ -62,9 +60,9 @@ pub(crate) async fn execute( query: String, values: Vec, ) -> Result<(u64, LastInsertId), crate::Error> { - let mut instances = db_instances.0.lock().await; + let instances = db_instances.0.read().await; - let db = instances.get_mut(&db).ok_or(Error::DatabaseNotLoaded(db))?; + let db = instances.get(&db).ok_or(Error::DatabaseNotLoaded(db))?; db.execute(query, values).await } @@ -75,8 +73,8 @@ pub(crate) async fn select( query: String, values: Vec, ) -> Result>, crate::Error> { - let mut instances = db_instances.0.lock().await; + let instances = db_instances.0.read().await; - let db = instances.get_mut(&db).ok_or(Error::DatabaseNotLoaded(db))?; + let db = instances.get(&db).ok_or(Error::DatabaseNotLoaded(db))?; db.select(query, values).await } diff --git a/plugins/sql/src/lib.rs b/plugins/sql/src/lib.rs index ec9362bf..56b2a3a6 100644 --- a/plugins/sql/src/lib.rs +++ b/plugins/sql/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/sql/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/sql) -//! //! Interface with SQL databases through [sqlx](https://github.com/launchbadge/sqlx). It supports the `sqlite`, `mysql` and `postgres` drivers, enabled by a Cargo feature. #![doc( @@ -29,12 +27,12 @@ use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, Manager, RunEvent, Runtime, }; -use tokio::sync::Mutex; +use tokio::sync::{Mutex, RwLock}; use std::collections::HashMap; #[derive(Default)] -pub struct DbInstances(pub Mutex>); +pub struct DbInstances(pub RwLock>); #[derive(Serialize)] #[serde(untagged)] @@ -104,6 +102,15 @@ impl MigrationSource<'static> for MigrationList { } } +/// Allows blocking on async code without creating a nested runtime. +fn run_async_command(cmd: F) -> F::Output { + if tokio::runtime::Handle::try_current().is_ok() { + tokio::task::block_in_place(|| tokio::runtime::Handle::current().block_on(cmd)) + } else { + tauri::async_runtime::block_on(cmd) + } +} + /// Tauri SQL plugin builder. #[derive(Default)] pub struct Builder { @@ -138,14 +145,16 @@ impl Builder { .setup(|app, api| { let config = api.config().clone().unwrap_or_default(); - tauri::async_runtime::block_on(async move { + run_async_command(async move { let instances = DbInstances::default(); - let mut lock = instances.0.lock().await; + let mut lock = instances.0.write().await; for db in config.preload { let pool = DbPool::connect(&db, app).await?; - if let Some(migrations) = self.migrations.as_mut().unwrap().remove(&db) { + if let Some(migrations) = + self.migrations.as_mut().and_then(|mm| mm.remove(&db)) + { let migrator = Migrator::new(migrations).await?; pool.migrate(&migrator).await?; } @@ -164,9 +173,9 @@ impl Builder { }) .on_event(|app, event| { if let RunEvent::Exit = event { - tauri::async_runtime::block_on(async move { + run_async_command(async move { let instances = &*app.state::(); - let instances = instances.0.lock().await; + let instances = instances.0.read().await; for value in instances.values() { value.close().await; } diff --git a/plugins/sql/src/wrapper.rs b/plugins/sql/src/wrapper.rs index 90631dac..d47b2d1c 100644 --- a/plugins/sql/src/wrapper.rs +++ b/plugins/sql/src/wrapper.rs @@ -104,6 +104,11 @@ impl DbPool { } Ok(Self::Postgres(Pool::connect(conn_url).await?)) } + #[cfg(not(any(feature = "sqlite", feature = "postgres", feature = "mysql")))] + _ => Err(crate::Error::InvalidDbUrl(format!( + "{conn_url} - No database driver enabled!" + ))), + #[cfg(any(feature = "sqlite", feature = "postgres", feature = "mysql"))] _ => Err(crate::Error::InvalidDbUrl(conn_url.to_string())), } } diff --git a/plugins/store/CHANGELOG.md b/plugins/store/CHANGELOG.md index 59d4b9b1..fa4e13b1 100644 --- a/plugins/store/CHANGELOG.md +++ b/plugins/store/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.1.0] + +### feat + +- [`8c67d44a`](https://github.com/tauri-apps/plugins-workspace/commit/8c67d44aef60b1427019538d8420787ef35bd3d5) ([#1860](https://github.com/tauri-apps/plugins-workspace/pull/1860) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) - Add `getStore` + - Add an option to use pre-stored (de)serialize functions (registered on rust) + - Add `LazyStore` + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -106,22 +118,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ps://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - eb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ps://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/store/Cargo.toml b/plugins/store/Cargo.toml index d270b1f1..1ed19962 100644 --- a/plugins/store/Cargo.toml +++ b/plugins/store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-store" -version = "2.0.1" +version = "2.2.0" description = "Simple, persistent key-value store." authors = { workspace = true } license = { workspace = true } @@ -27,7 +27,7 @@ tauri-plugin = { workspace = true, features = ["build"] } serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } -log = { workspace = true } +tracing = { workspace = true } thiserror = { workspace = true } dunce = { workspace = true } tokio = { version = "1", features = ["sync", "time", "macros"] } diff --git a/plugins/store/README.md b/plugins/store/README.md index 391d7a0c..8a2fcbf7 100644 --- a/plugins/store/README.md +++ b/plugins/store/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-store#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { @@ -70,7 +70,7 @@ Afterwards all the plugin's APIs are available through the JavaScript guest bind ```typescript import { Store } from '@tauri-apps/plugin-store' -const store = new Store('.settings.dat') +const store = await Store.load('settings.json') await store.set('some-key', { value: 5 }) @@ -81,14 +81,11 @@ if (val) { } else { console.log('val is null') } - -// This manually saves the store. -await store.save() ``` ### Persisting Values -As seen above, values added to the store are not persisted between application loads unless the application is closed gracefully. +Modifications made to the store are automatically saved by default You can manually save a store with: @@ -103,65 +100,44 @@ However, you can also load them manually later like so: await store.load() ``` +### LazyStore + +There's also a high level API `LazyStore` which only loads the store on first access, note that the options will be ignored if a `Store` with that path has already been created + +```typescript +import { LazyStore } from '@tauri-apps/plugin-store' + +const store = new LazyStore('settings.json') +``` + ## Usage from Rust You can also create `Store` instances directly in Rust: ```rust -use tauri_plugin_store::StoreBuilder; +use tauri_plugin_store::StoreExt; use serde_json::json; fn main() { tauri::Builder::default() .plugin(tauri_plugin_store::Builder::default().build()) .setup(|app| { - let mut store = StoreBuilder::new("app_data.bin").build(app.handle().clone()); - - // Attempt to load the store, if it's saved already. - store.load().expect("Failed to load store from disk"); + // This loads the store from disk + let store = app.store("app_data.json")?; // Note that values must be serde_json::Value instances, // otherwise, they will not be compatible with the JavaScript bindings. - store.insert("a".to_string(), json!("b")); - - // You can manually save the store after making changes. - // Otherwise, it will save upon graceful exit as described above. - store.save() + store.set("a".to_string(), json!("b")); + Ok(()) }) .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` -### Loading Gracefully - -If you call `load` on a `Store` that hasn't yet been written to the disk, it will return an error. You must handle this error if you want to gracefully continue and use the default store until you save it to the disk. The example above shows how to do this. - -For example, this would cause a panic if the store has not yet been created: - -```rust -store.load().unwrap(); -``` - -Rather than silently continuing like you may expect. - -You should always handle the error appropriately rather than unwrapping, or you may experience unexpected app crashes: - -```rust -store.load().expect("Failed to load store from disk"); -``` - ### Frontend Interoperability -As you may have noticed, the `Store` crated above isn't accessible to the frontend. To interoperate with stores created by JavaScript use the exported `with_store` method: - -```rust -use tauri::Wry; -use tauri_plugin_store::StoreExt; - -let store = app.store_builder("app_data.bin").build(); -store.insert("key", "value"); -``` +The store created from both Rust side and JavaScript side are stored in the app's resource table and can be accessed by both sides, you can access it by using the same path, with `getStore` and `LazyStore` in the JavaScript side and `get_store` and `store` in the Rust side ## Contributing diff --git a/plugins/store/api-iife.js b/plugins/store/api-iife.js index 77295d7f..273ac694 100644 --- a/plugins/store/api-iife.js +++ b/plugins/store/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(e){"use strict";var t,r;function a(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function i(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,t,r,a){if("a"===r&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,r,a,i){if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,r)}(this,t,e)}async close(){return i("plugin:resources|close",{rid:this.rid})}}async function s(e,t,r){const n={kind:"Any"};return i("plugin:event|listen",{event:e,target:n,handler:a(t)}).then((t=>async()=>async function(e,t){await i("plugin:event|unlisten",{event:e,eventId:t})}(e,t)))}t=new WeakMap,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"}(r||(r={}));class o extends n{constructor(e,t){super(e),this.path=t}async set(e,t){await i("plugin:store|set",{rid:this.rid,key:e,value:t})}async get(e){return await i("plugin:store|get",{rid:this.rid,key:e})}async has(e){return await i("plugin:store|has",{rid:this.rid,key:e})}async delete(e){return await i("plugin:store|delete",{rid:this.rid,key:e})}async clear(){await i("plugin:store|clear",{rid:this.rid})}async reset(){await i("plugin:store|reset",{rid:this.rid})}async keys(){return await i("plugin:store|keys",{rid:this.rid})}async values(){return await i("plugin:store|values",{rid:this.rid})}async entries(){return await i("plugin:store|entries",{rid:this.rid})}async length(){return await i("plugin:store|length",{rid:this.rid})}async load(){await i("plugin:store|load",{rid:this.rid})}async save(){await i("plugin:store|save",{rid:this.rid})}async onKeyChange(e,t){return await s("store://change",(r=>{r.payload.path===this.path&&r.payload.key===e&&t(r.payload.value)}))}async onChange(e){return await s("store://change",(t=>{t.payload.path===this.path&&e(t.payload.key,t.payload.value)}))}}return e.Store=o,e.createStore=async function(e,t){const r=await i("plugin:store|create_store",{path:e,...t});return new o(r,e)},e}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";var e,a;function r(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function s(t,e={},a){return window.__TAURI_INTERNALS__.invoke(t,e,a)}"function"==typeof SuppressedError&&SuppressedError;class i{get rid(){return function(t,e,a,r){if("a"===a&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?r:"a"===a?r.call(t):r?r.value:e.get(t)}(this,e,"f")}constructor(t){e.set(this,void 0),function(t,e,a){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,a)}(this,e,t)}async close(){return s("plugin:resources|close",{rid:this.rid})}}async function n(t,e,a){const i={kind:"Any"};return s("plugin:event|listen",{event:t,target:i,handler:r(e)}).then((e=>async()=>async function(t,e){await s("plugin:event|unlisten",{event:t,eventId:e})}(t,e)))}async function o(t,e){return await u.load(t,e)}e=new WeakMap,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"}(a||(a={}));class u extends i{constructor(t){super(t)}static async load(t,e){const a=await s("plugin:store|load",{path:t,...e});return new u(a)}static async get(t){return await s("plugin:store|get_store",{path:t}).then((t=>t?new u(t):null))}async set(t,e){await s("plugin:store|set",{rid:this.rid,key:t,value:e})}async get(t){const[e,a]=await s("plugin:store|get",{rid:this.rid,key:t});return a?e:void 0}async has(t){return await s("plugin:store|has",{rid:this.rid,key:t})}async delete(t){return await s("plugin:store|delete",{rid:this.rid,key:t})}async clear(){await s("plugin:store|clear",{rid:this.rid})}async reset(){await s("plugin:store|reset",{rid:this.rid})}async keys(){return await s("plugin:store|keys",{rid:this.rid})}async values(){return await s("plugin:store|values",{rid:this.rid})}async entries(){return await s("plugin:store|entries",{rid:this.rid})}async length(){return await s("plugin:store|length",{rid:this.rid})}async reload(){await s("plugin:store|reload",{rid:this.rid})}async save(){await s("plugin:store|save",{rid:this.rid})}async onKeyChange(t,e){return await n("store://change",(a=>{a.payload.resourceId===this.rid&&a.payload.key===t&&e(a.payload.exists?a.payload.value:void 0)}))}async onChange(t){return await n("store://change",(e=>{e.payload.resourceId===this.rid&&t(e.payload.key,e.payload.exists?e.payload.value:void 0)}))}}return t.LazyStore=class{get store(){return this._store||(this._store=o(this.path,this.options)),this._store}constructor(t,e){this.path=t,this.options=e}async init(){await this.store}async set(t,e){return(await this.store).set(t,e)}async get(t){return(await this.store).get(t)}async has(t){return(await this.store).has(t)}async delete(t){return(await this.store).delete(t)}async clear(){await(await this.store).clear()}async reset(){await(await this.store).reset()}async keys(){return(await this.store).keys()}async values(){return(await this.store).values()}async entries(){return(await this.store).entries()}async length(){return(await this.store).length()}async reload(){await(await this.store).reload()}async save(){await(await this.store).save()}async onKeyChange(t,e){return(await this.store).onKeyChange(t,e)}async onChange(t){return(await this.store).onChange(t)}async close(){this._store&&await(await this._store).close()}},t.Store=u,t.getStore=async function(t){return await u.get(t)},t.load=o,t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})} diff --git a/plugins/store/build.rs b/plugins/store/build.rs index 3c9fee01..2e88d59a 100644 --- a/plugins/store/build.rs +++ b/plugins/store/build.rs @@ -3,7 +3,8 @@ // SPDX-License-Identifier: MIT const COMMANDS: &[&str] = &[ - "create_store", + "load", + "get_store", "set", "get", "has", @@ -12,9 +13,9 @@ const COMMANDS: &[&str] = &[ "reset", "keys", "values", - "length", "entries", - "load", + "length", + "reload", "save", ]; diff --git a/plugins/store/examples/AppSettingsManager/package.json b/plugins/store/examples/AppSettingsManager/package.json index ca7e3b95..1a009f15 100644 --- a/plugins/store/examples/AppSettingsManager/package.json +++ b/plugins/store/examples/AppSettingsManager/package.json @@ -8,8 +8,8 @@ "tauri": "tauri" }, "devDependencies": { - "@tauri-apps/cli": "2.0.0", - "vite": "^5.0.12", + "@tauri-apps/cli": "2.2.7", + "vite": "^6.0.0", "typescript": "^5.4.7" } } diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs b/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs index 0dd4e0bc..f20db4fc 100644 --- a/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs +++ b/plugins/store/examples/AppSettingsManager/src-tauri/src/main.rs @@ -5,9 +5,8 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] -use std::time::Duration; - use serde_json::json; +use tauri::Listener; use tauri_plugin_store::StoreExt; mod app; @@ -18,17 +17,11 @@ fn main() { .plugin(tauri_plugin_store::Builder::new().build()) .setup(|app| { // Init store and load it from disk - let store = app - .handle() - .store_builder("settings.json") - .auto_save(Duration::from_millis(100)) - .build(); - - // If there are no saved settings yet, this will return an error so we ignore the return value. - let _ = store.load(); - + let store = app.store("settings.json")?; + app.listen("store://change", |event| { + dbg!(event); + }); let app_settings = AppSettings::load_from_store(&store); - match app_settings { Ok(app_settings) => { let theme = app_settings.theme; diff --git a/plugins/store/examples/AppSettingsManager/src-tauri/tauri.conf.json b/plugins/store/examples/AppSettingsManager/src-tauri/tauri.conf.json index 5a67883d..d3f60daa 100644 --- a/plugins/store/examples/AppSettingsManager/src-tauri/tauri.conf.json +++ b/plugins/store/examples/AppSettingsManager/src-tauri/tauri.conf.json @@ -3,6 +3,7 @@ "version": "0.1.0", "identifier": "com.tauri.app-settings-manager", "build": { + "devUrl": "http://localhost:1420", "frontendDist": "../dist" }, "app": { diff --git a/plugins/store/guest-js/index.ts b/plugins/store/guest-js/index.ts index 259b0662..1df89fd5 100644 --- a/plugins/store/guest-js/index.ts +++ b/plugins/store/guest-js/index.ts @@ -8,8 +8,10 @@ import { invoke, Resource } from '@tauri-apps/api/core' interface ChangePayload { path: string + resourceId?: number key: string - value: T | null + value: T + exists: boolean } /** @@ -17,41 +19,213 @@ interface ChangePayload { */ export type StoreOptions = { /** - * Auto save on modification with debounce duration in milliseconds + * Auto save on modification with debounce duration in milliseconds, it's 100ms by default, pass in `false` to disable it */ - autoSave?: boolean + autoSave?: boolean | number + /** + * Name of a serialize function registered in the rust side plugin builder + */ + serializeFnName?: string + /** + * Name of a deserialize function registered in the rust side plugin builder + */ + deserializeFnName?: string + /** + * Force create a new store with default values even if it already exists. + */ + createNew?: boolean +} + +/** + * Create a new Store or load the existing store with the path. + * + * @example + * ```typescript + * import { Store } from '@tauri-apps/api/store'; + * const store = await Store.load('store.json'); + * ``` + * + * @param path Path to save the store in `app_data_dir` + * @param options Store configuration options + */ +export async function load( + path: string, + options?: StoreOptions +): Promise { + return await Store.load(path, options) } /** - * @param path: Path to save the store in `app_data_dir` - * @param options: Store configuration options + * Gets an already loaded store. + * + * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it. + * + * This function is more useful when you already know the store is loaded + * and just need to access its instance. Prefer {@link Store.load} otherwise. + * + * @example + * ```typescript + * import { getStore } from '@tauri-apps/api/store'; + * const store = await getStore('store.json'); + * ``` + * + * @param path Path of the store. */ -export async function createStore(path: string, options?: StoreOptions) { - const resourceId = await invoke('plugin:store|create_store', { - path, - ...options - }) - return new Store(resourceId, path) +export async function getStore(path: string): Promise { + return await Store.get(path) } /** * A lazy loaded key-value store persisted by the backend layer. */ -export class Store extends Resource { +export class LazyStore implements IStore { + private _store?: Promise + + private get store(): Promise { + if (!this._store) { + this._store = load(this.path, this.options) + } + return this._store + } + + /** + * Note that the options are not applied if someone else already created the store + * @param path Path to save the store in `app_data_dir` + * @param options Store configuration options + */ constructor( - rid: number, - private readonly path: string - ) { + private readonly path: string, + private readonly options?: StoreOptions + ) {} + + /** + * Init/load the store if it's not loaded already + */ + async init(): Promise { + await this.store + } + + async set(key: string, value: unknown): Promise { + return (await this.store).set(key, value) + } + + async get(key: string): Promise { + return (await this.store).get(key) + } + + async has(key: string): Promise { + return (await this.store).has(key) + } + + async delete(key: string): Promise { + return (await this.store).delete(key) + } + + async clear(): Promise { + await (await this.store).clear() + } + + async reset(): Promise { + await (await this.store).reset() + } + + async keys(): Promise { + return (await this.store).keys() + } + + async values(): Promise { + return (await this.store).values() + } + + async entries(): Promise> { + return (await this.store).entries() + } + + async length(): Promise { + return (await this.store).length() + } + + async reload(): Promise { + await (await this.store).reload() + } + + async save(): Promise { + await (await this.store).save() + } + + async onKeyChange( + key: string, + cb: (value: T | undefined) => void + ): Promise { + return (await this.store).onKeyChange(key, cb) + } + + async onChange( + cb: (key: string, value: T | undefined) => void + ): Promise { + return (await this.store).onChange(cb) + } + + async close(): Promise { + if (this._store) { + await (await this._store).close() + } + } +} + +/** + * A key-value store persisted by the backend layer. + */ +export class Store extends Resource implements IStore { + private constructor(rid: number) { super(rid) } /** - * Inserts a key-value pair into the store. + * Create a new Store or load the existing store with the path. * - * @param key - * @param value - * @returns + * @example + * ```typescript + * import { Store } from '@tauri-apps/api/store'; + * const store = await Store.load('store.json'); + * ``` + * + * @param path Path to save the store in `app_data_dir` + * @param options Store configuration options */ + static async load(path: string, options?: StoreOptions): Promise { + const rid = await invoke('plugin:store|load', { + path, + ...options + }) + return new Store(rid) + } + + /** + * Gets an already loaded store. + * + * If the store is not loaded, returns `null`. In this case you must {@link Store.load load} it. + * + * This function is more useful when you already know the store is loaded + * and just need to access its instance. Prefer {@link Store.load} otherwise. + * + * @example + * ```typescript + * import { Store } from '@tauri-apps/api/store'; + * let store = await Store.get('store.json'); + * if (!store) { + * store = await Store.load('store.json'); + * } + * ``` + * + * @param path Path of the store. + */ + static async get(path: string): Promise { + return await invoke('plugin:store|get_store', { path }).then( + (rid) => (rid ? new Store(rid) : null) + ) + } + async set(key: string, value: unknown): Promise { await invoke('plugin:store|set', { rid: this.rid, @@ -60,18 +234,102 @@ export class Store extends Resource { }) } + async get(key: string): Promise { + const [value, exists] = await invoke<[T, boolean]>('plugin:store|get', { + rid: this.rid, + key + }) + return exists ? value : undefined + } + + async has(key: string): Promise { + return await invoke('plugin:store|has', { + rid: this.rid, + key + }) + } + + async delete(key: string): Promise { + return await invoke('plugin:store|delete', { + rid: this.rid, + key + }) + } + + async clear(): Promise { + await invoke('plugin:store|clear', { rid: this.rid }) + } + + async reset(): Promise { + await invoke('plugin:store|reset', { rid: this.rid }) + } + + async keys(): Promise { + return await invoke('plugin:store|keys', { rid: this.rid }) + } + + async values(): Promise { + return await invoke('plugin:store|values', { rid: this.rid }) + } + + async entries(): Promise> { + return await invoke('plugin:store|entries', { rid: this.rid }) + } + + async length(): Promise { + return await invoke('plugin:store|length', { rid: this.rid }) + } + + async reload(): Promise { + await invoke('plugin:store|reload', { rid: this.rid }) + } + + async save(): Promise { + await invoke('plugin:store|save', { rid: this.rid }) + } + + async onKeyChange( + key: string, + cb: (value: T | undefined) => void + ): Promise { + return await listen>('store://change', (event) => { + if (event.payload.resourceId === this.rid && event.payload.key === key) { + cb(event.payload.exists ? event.payload.value : undefined) + } + }) + } + + async onChange( + cb: (key: string, value: T | undefined) => void + ): Promise { + return await listen>('store://change', (event) => { + if (event.payload.resourceId === this.rid) { + cb( + event.payload.key, + event.payload.exists ? event.payload.value : undefined + ) + } + }) + } +} + +interface IStore { /** - * Returns the value for the given `key` or `null` the key does not exist. + * Inserts a key-value pair into the store. * * @param key + * @param value * @returns */ - async get(key: string): Promise { - return await invoke('plugin:store|get', { - rid: this.rid, - key - }) - } + set(key: string, value: unknown): Promise + + /** + * Returns the value for the given `key` or `undefined` if the key does not exist. + * + * @param key + * @returns + */ + get(key: string): Promise /** * Returns `true` if the given `key` exists in the store. @@ -79,12 +337,7 @@ export class Store extends Resource { * @param key * @returns */ - async has(key: string): Promise { - return await invoke('plugin:store|has', { - rid: this.rid, - key - }) - } + has(key: string): Promise /** * Removes a key-value pair from the store. @@ -92,91 +345,67 @@ export class Store extends Resource { * @param key * @returns */ - async delete(key: string): Promise { - return await invoke('plugin:store|delete', { - rid: this.rid, - key - }) - } + delete(key: string): Promise /** * Clears the store, removing all key-value pairs. * - * Note: To clear the storage and reset it to it's `default` value, use `reset` instead. + * Note: To clear the storage and reset it to its `default` value, use {@linkcode reset} instead. * @returns */ - async clear(): Promise { - await invoke('plugin:store|clear', { rid: this.rid }) - } + clear(): Promise /** - * Resets the store to it's `default` value. + * Resets the store to its `default` value. * - * If no default value has been set, this method behaves identical to `clear`. + * If no default value has been set, this method behaves identical to {@linkcode clear}. * @returns */ - async reset(): Promise { - await invoke('plugin:store|reset', { rid: this.rid }) - } + reset(): Promise /** - * Returns a list of all key in the store. + * Returns a list of all keys in the store. * * @returns */ - async keys(): Promise { - return await invoke('plugin:store|keys', { rid: this.rid }) - } + keys(): Promise /** * Returns a list of all values in the store. * * @returns */ - async values(): Promise { - return await invoke('plugin:store|values', { rid: this.rid }) - } + values(): Promise /** * Returns a list of all entries in the store. * * @returns */ - async entries(): Promise> { - return await invoke('plugin:store|entries', { rid: this.rid }) - } + entries(): Promise> /** * Returns the number of key-value pairs in the store. * * @returns */ - async length(): Promise { - return await invoke('plugin:store|length', { rid: this.rid }) - } + length(): Promise /** - * Attempts to load the on-disk state at the stores `path` into memory. + * Attempts to load the on-disk state at the store's `path` into memory. * * This method is useful if the on-disk state was edited by the user and you want to synchronize the changes. * * Note: This method does not emit change events. * @returns */ - async load(): Promise { - await invoke('plugin:store|load', { rid: this.rid }) - } + reload(): Promise /** - * Saves the store to disk at the stores `path`. - * - * As the store is only persisted to disk before the apps exit, changes might be lost in a crash. - * This method lets you persist the store to disk whenever you deem necessary. + * Saves the store to disk at the store's `path`. * @returns */ - async save(): Promise { - await invoke('plugin:store|save', { rid: this.rid }) - } + save(): Promise /** * Listen to changes on a store key. @@ -186,16 +415,10 @@ export class Store extends Resource { * * @since 2.0.0 */ - async onKeyChange( + onKeyChange( key: string, - cb: (value: T | null) => void - ): Promise { - return await listen>('store://change', (event) => { - if (event.payload.path === this.path && event.payload.key === key) { - cb(event.payload.value) - } - }) - } + cb: (value: T | undefined) => void + ): Promise /** * Listen to changes on the store. @@ -204,13 +427,13 @@ export class Store extends Resource { * * @since 2.0.0 */ - async onChange( - cb: (key: string, value: T | null) => void - ): Promise { - return await listen>('store://change', (event) => { - if (event.payload.path === this.path) { - cb(event.payload.key, event.payload.value) - } - }) - } + onChange( + cb: (key: string, value: T | undefined) => void + ): Promise + + /** + * Close the store and cleans up this resource from memory. + * **You should not call any method on this object anymore and should drop any reference to it.** + */ + close(): Promise } diff --git a/plugins/store/package.json b/plugins/store/package.json index 034f8873..a3a28e66 100644 --- a/plugins/store/package.json +++ b/plugins/store/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-store", - "version": "2.0.0", + "version": "2.2.0", "description": "Simple, persistent key-value store.", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/store/permissions/autogenerated/commands/create_store.toml b/plugins/store/permissions/autogenerated/commands/create_store.toml deleted file mode 100644 index cde71c24..00000000 --- a/plugins/store/permissions/autogenerated/commands/create_store.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-create-store" -description = "Enables the create_store command without any pre-configured scope." -commands.allow = ["create_store"] - -[[permission]] -identifier = "deny-create-store" -description = "Denies the create_store command without any pre-configured scope." -commands.deny = ["create_store"] diff --git a/plugins/store/permissions/autogenerated/commands/get_store.toml b/plugins/store/permissions/autogenerated/commands/get_store.toml new file mode 100644 index 00000000..7c19173a --- /dev/null +++ b/plugins/store/permissions/autogenerated/commands/get_store.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-get-store" +description = "Enables the get_store command without any pre-configured scope." +commands.allow = ["get_store"] + +[[permission]] +identifier = "deny-get-store" +description = "Denies the get_store command without any pre-configured scope." +commands.deny = ["get_store"] diff --git a/plugins/store/permissions/autogenerated/commands/reload.toml b/plugins/store/permissions/autogenerated/commands/reload.toml new file mode 100644 index 00000000..92e25253 --- /dev/null +++ b/plugins/store/permissions/autogenerated/commands/reload.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-reload" +description = "Enables the reload command without any pre-configured scope." +commands.allow = ["reload"] + +[[permission]] +identifier = "deny-reload" +description = "Denies the reload command without any pre-configured scope." +commands.deny = ["reload"] diff --git a/plugins/store/permissions/autogenerated/reference.md b/plugins/store/permissions/autogenerated/reference.md index 4e9bf2cc..5640415d 100644 --- a/plugins/store/permissions/autogenerated/reference.md +++ b/plugins/store/permissions/autogenerated/reference.md @@ -9,19 +9,20 @@ All operations are enabled by default. -- `allow-create-store` -- `allow-clear` -- `allow-delete` -- `allow-entries` +- `allow-load` +- `allow-get-store` +- `allow-set` - `allow-get` - `allow-has` +- `allow-delete` +- `allow-clear` +- `allow-reset` - `allow-keys` +- `allow-values` +- `allow-entries` - `allow-length` -- `allow-load` -- `allow-reset` +- `allow-reload` - `allow-save` -- `allow-set` -- `allow-values` ## Permission Table @@ -61,12 +62,12 @@ Denies the clear command without any pre-configured scope. -`store:allow-create-store` +`store:allow-delete` -Enables the create_store command without any pre-configured scope. +Enables the delete command without any pre-configured scope. @@ -74,12 +75,12 @@ Enables the create_store command without any pre-configured scope. -`store:deny-create-store` +`store:deny-delete` -Denies the create_store command without any pre-configured scope. +Denies the delete command without any pre-configured scope. @@ -87,12 +88,12 @@ Denies the create_store command without any pre-configured scope. -`store:allow-delete` +`store:allow-entries` -Enables the delete command without any pre-configured scope. +Enables the entries command without any pre-configured scope. @@ -100,12 +101,12 @@ Enables the delete command without any pre-configured scope. -`store:deny-delete` +`store:deny-entries` -Denies the delete command without any pre-configured scope. +Denies the entries command without any pre-configured scope. @@ -113,12 +114,12 @@ Denies the delete command without any pre-configured scope. -`store:allow-entries` +`store:allow-get` -Enables the entries command without any pre-configured scope. +Enables the get command without any pre-configured scope. @@ -126,12 +127,12 @@ Enables the entries command without any pre-configured scope. -`store:deny-entries` +`store:deny-get` -Denies the entries command without any pre-configured scope. +Denies the get command without any pre-configured scope. @@ -139,12 +140,12 @@ Denies the entries command without any pre-configured scope. -`store:allow-get` +`store:allow-get-store` -Enables the get command without any pre-configured scope. +Enables the get_store command without any pre-configured scope. @@ -152,12 +153,12 @@ Enables the get command without any pre-configured scope. -`store:deny-get` +`store:deny-get-store` -Denies the get command without any pre-configured scope. +Denies the get_store command without any pre-configured scope. @@ -269,6 +270,32 @@ Denies the load command without any pre-configured scope. +`store:allow-reload` + + + + +Enables the reload command without any pre-configured scope. + + + + + + + +`store:deny-reload` + + + + +Denies the reload command without any pre-configured scope. + + + + + + + `store:allow-reset` diff --git a/plugins/store/permissions/default.toml b/plugins/store/permissions/default.toml index bf888679..3a3e4b3a 100644 --- a/plugins/store/permissions/default.toml +++ b/plugins/store/permissions/default.toml @@ -11,17 +11,18 @@ All operations are enabled by default. """ permissions = [ - "allow-create-store", - "allow-clear", - "allow-delete", - "allow-entries", + "allow-load", + "allow-get-store", + "allow-set", "allow-get", "allow-has", + "allow-delete", + "allow-clear", + "allow-reset", "allow-keys", + "allow-values", + "allow-entries", "allow-length", - "allow-load", - "allow-reset", + "allow-reload", "allow-save", - "allow-set", - "allow-values", ] diff --git a/plugins/store/permissions/schemas/schema.json b/plugins/store/permissions/schemas/schema.json index 6ebf788e..4237bc62 100644 --- a/plugins/store/permissions/schemas/schema.json +++ b/plugins/store/permissions/schemas/schema.json @@ -304,16 +304,6 @@ "type": "string", "const": "deny-clear" }, - { - "description": "Enables the create_store command without any pre-configured scope.", - "type": "string", - "const": "allow-create-store" - }, - { - "description": "Denies the create_store command without any pre-configured scope.", - "type": "string", - "const": "deny-create-store" - }, { "description": "Enables the delete command without any pre-configured scope.", "type": "string", @@ -344,6 +334,16 @@ "type": "string", "const": "deny-get" }, + { + "description": "Enables the get_store command without any pre-configured scope.", + "type": "string", + "const": "allow-get-store" + }, + { + "description": "Denies the get_store command without any pre-configured scope.", + "type": "string", + "const": "deny-get-store" + }, { "description": "Enables the has command without any pre-configured scope.", "type": "string", @@ -384,6 +384,16 @@ "type": "string", "const": "deny-load" }, + { + "description": "Enables the reload command without any pre-configured scope.", + "type": "string", + "const": "allow-reload" + }, + { + "description": "Denies the reload command without any pre-configured scope.", + "type": "string", + "const": "deny-reload" + }, { "description": "Enables the reset command without any pre-configured scope.", "type": "string", diff --git a/plugins/store/src/error.rs b/plugins/store/src/error.rs index afd43add..ef5ee593 100644 --- a/plugins/store/src/error.rs +++ b/plugins/store/src/error.rs @@ -3,7 +3,6 @@ // SPDX-License-Identifier: MIT use serde::{Serialize, Serializer}; -use std::path::PathBuf; pub type Result = std::result::Result; @@ -21,9 +20,15 @@ pub enum Error { /// IO error. #[error(transparent)] Io(#[from] std::io::Error), - /// Store not found - #[error("Store \"{0}\" not found")] - NotFound(PathBuf), + // /// Store already exists + // #[error("Store at \"{0}\" already exists")] + // AlreadyExists(PathBuf), + /// Serialize function not found + #[error("Serialize Function \"{0}\" not found")] + SerializeFunctionNotFound(String), + /// Deserialize function not found + #[error("Deserialize Function \"{0}\" not found")] + DeserializeFunctionNotFound(String), /// Some Tauri API failed #[error(transparent)] Tauri(#[from] tauri::Error), diff --git a/plugins/store/src/lib.rs b/plugins/store/src/lib.rs index b05bf4b4..0e59cd81 100644 --- a/plugins/store/src/lib.rs +++ b/plugins/store/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/store/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/store) -//! //! Simple, persistent key-value store. #![doc( @@ -12,234 +10,392 @@ )] pub use error::{Error, Result}; -use log::warn; -use serde::Serialize; +use serde::{Deserialize, Serialize}; pub use serde_json::Value as JsonValue; use std::{ collections::HashMap, path::{Path, PathBuf}, - sync::{Mutex, Weak}, + sync::{Arc, Mutex}, time::Duration, }; -pub use store::{Store, StoreBuilder, StoreInner}; +pub use store::{resolve_store_path, DeserializeFn, SerializeFn, Store, StoreBuilder}; use tauri::{ plugin::{self, TauriPlugin}, - AppHandle, Manager, ResourceId, RunEvent, Runtime, Webview, + AppHandle, Manager, ResourceId, RunEvent, Runtime, State, }; mod error; mod store; #[derive(Serialize, Clone)] +#[serde(rename_all = "camelCase")] struct ChangePayload<'a> { path: &'a Path, + resource_id: Option, key: &'a str, - value: &'a JsonValue, + value: Option<&'a JsonValue>, + exists: bool, } -pub struct StoreCollection { - stores: Mutex>>>>, - // frozen: bool, +#[derive(Debug)] +struct StoreState { + stores: Arc>>, + serialize_fns: HashMap, + deserialize_fns: HashMap, + default_serialize: SerializeFn, + default_deserialize: DeserializeFn, } -#[tauri::command] -async fn create_store( +#[derive(Serialize, Deserialize)] +#[serde(untagged)] +enum AutoSave { + DebounceDuration(u64), + Bool(bool), +} + +fn builder( app: AppHandle, - webview: Webview, + store_state: State<'_, StoreState>, path: PathBuf, - auto_save: Option, -) -> Result { + auto_save: Option, + serialize_fn_name: Option, + deserialize_fn_name: Option, + create_new: bool, +) -> Result> { let mut builder = app.store_builder(path); if let Some(auto_save) = auto_save { - builder = builder.auto_save(Duration::from_millis(auto_save)); + match auto_save { + AutoSave::DebounceDuration(duration) => { + builder = builder.auto_save(Duration::from_millis(duration)); + } + AutoSave::Bool(false) => { + builder = builder.disable_auto_save(); + } + _ => {} + } + } + + if let Some(serialize_fn_name) = serialize_fn_name { + let serialize_fn = store_state + .serialize_fns + .get(&serialize_fn_name) + .ok_or_else(|| crate::Error::SerializeFunctionNotFound(serialize_fn_name))?; + builder = builder.serialize(*serialize_fn); + } + + if let Some(deserialize_fn_name) = deserialize_fn_name { + let deserialize_fn = store_state + .deserialize_fns + .get(&deserialize_fn_name) + .ok_or_else(|| crate::Error::DeserializeFunctionNotFound(deserialize_fn_name))?; + builder = builder.deserialize(*deserialize_fn); } - let store = builder.build(); - Ok(webview.resources_table().add(store)) + + if create_new { + builder = builder.create_new(); + } + + Ok(builder) +} + +#[tauri::command] +async fn load( + app: AppHandle, + store_state: State<'_, StoreState>, + path: PathBuf, + auto_save: Option, + serialize_fn_name: Option, + deserialize_fn_name: Option, + create_new: Option, +) -> Result { + let builder = builder( + app, + store_state, + path, + auto_save, + serialize_fn_name, + deserialize_fn_name, + create_new.unwrap_or_default(), + )?; + let (_, rid) = builder.build_inner()?; + Ok(rid) +} + +#[tauri::command] +async fn get_store( + app: AppHandle, + store_state: State<'_, StoreState>, + path: PathBuf, +) -> Result> { + let stores = store_state.stores.lock().unwrap(); + Ok(stores.get(&resolve_store_path(&app, path)?).copied()) } #[tauri::command] async fn set( - webview: Webview, + app: AppHandle, rid: ResourceId, key: String, value: JsonValue, ) -> Result<()> { - let store = webview.resources_table().get::>(rid)?; + let store = app.resources_table().get::>(rid)?; store.set(key, value); Ok(()) } #[tauri::command] async fn get( - webview: Webview, + app: AppHandle, rid: ResourceId, key: String, -) -> Result> { - let store = webview.resources_table().get::>(rid)?; - Ok(store.get(key)) +) -> Result<(Option, bool)> { + let store = app.resources_table().get::>(rid)?; + let value = store.get(key); + let exists = value.is_some(); + Ok((value, exists)) } #[tauri::command] -async fn has(webview: Webview, rid: ResourceId, key: String) -> Result { - let store = webview.resources_table().get::>(rid)?; +async fn has(app: AppHandle, rid: ResourceId, key: String) -> Result { + let store = app.resources_table().get::>(rid)?; Ok(store.has(key)) } #[tauri::command] -async fn delete(webview: Webview, rid: ResourceId, key: String) -> Result { - let store = webview.resources_table().get::>(rid)?; +async fn delete(app: AppHandle, rid: ResourceId, key: String) -> Result { + let store = app.resources_table().get::>(rid)?; Ok(store.delete(key)) } #[tauri::command] -async fn clear(webview: Webview, rid: ResourceId) -> Result<()> { - let store = webview.resources_table().get::>(rid)?; +async fn clear(app: AppHandle, rid: ResourceId) -> Result<()> { + let store = app.resources_table().get::>(rid)?; store.clear(); Ok(()) } #[tauri::command] -async fn reset(webview: Webview, rid: ResourceId) -> Result<()> { - let store = webview.resources_table().get::>(rid)?; +async fn reset(app: AppHandle, rid: ResourceId) -> Result<()> { + let store = app.resources_table().get::>(rid)?; store.reset(); Ok(()) } #[tauri::command] -async fn keys(webview: Webview, rid: ResourceId) -> Result> { - let store = webview.resources_table().get::>(rid)?; +async fn keys(app: AppHandle, rid: ResourceId) -> Result> { + let store = app.resources_table().get::>(rid)?; Ok(store.keys()) } #[tauri::command] -async fn values(webview: Webview, rid: ResourceId) -> Result> { - let store = webview.resources_table().get::>(rid)?; +async fn values(app: AppHandle, rid: ResourceId) -> Result> { + let store = app.resources_table().get::>(rid)?; Ok(store.values()) } #[tauri::command] async fn entries( - webview: Webview, + app: AppHandle, rid: ResourceId, ) -> Result> { - let store = webview.resources_table().get::>(rid)?; + let store = app.resources_table().get::>(rid)?; Ok(store.entries()) } #[tauri::command] -async fn length(webview: Webview, rid: ResourceId) -> Result { - let store = webview.resources_table().get::>(rid)?; +async fn length(app: AppHandle, rid: ResourceId) -> Result { + let store = app.resources_table().get::>(rid)?; Ok(store.length()) } #[tauri::command] -async fn load(webview: Webview, rid: ResourceId) -> Result<()> { - let store = webview.resources_table().get::>(rid)?; - store.load() +async fn reload(app: AppHandle, rid: ResourceId) -> Result<()> { + let store = app.resources_table().get::>(rid)?; + store.reload() } #[tauri::command] -async fn save(webview: Webview, rid: ResourceId) -> Result<()> { - let store = webview.resources_table().get::>(rid)?; +async fn save(app: AppHandle, rid: ResourceId) -> Result<()> { + let store = app.resources_table().get::>(rid)?; store.save() } pub trait StoreExt { - fn store(&self, path: impl AsRef) -> Store; + /// Create a store or load an existing store with default settings at the given path. + /// + /// If the store is already loaded, its instance is automatically returned. + /// + /// # Examples + /// + /// ``` + /// use tauri_plugin_store::StoreExt; + /// + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let store = app.store("my-store")?; + /// Ok(()) + /// }); + /// ``` + fn store(&self, path: impl AsRef) -> Result>>; + /// Get a store builder. + /// + /// The builder can be used to configure the store. + /// To use the default settings see [`Self::store`]. + /// + /// # Examples + /// + /// ``` + /// use tauri_plugin_store::StoreExt; + /// use std::time::Duration; + /// + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let store = app.store_builder("users.json").auto_save(Duration::from_secs(1)).build()?; + /// Ok(()) + /// }); + /// ``` fn store_builder(&self, path: impl AsRef) -> StoreBuilder; + /// Get a handle of an already loaded store. + /// + /// If the store is not loaded or does not exist, it returns `None`. + /// + /// Note that using this function can cause race conditions if you fallback to creating or loading the store, + /// so you should consider using [`Self::store`] if you are not sure if the store is loaded or not. + /// + /// # Examples + /// + /// ``` + /// use tauri_plugin_store::StoreExt; + /// + /// tauri::Builder::default() + /// .plugin(tauri_plugin_store::Builder::default().build()) + /// .setup(|app| { + /// let store = if let Some(s) = app.get_store("store.json") { + /// s + /// } else { + /// // this is not thread safe; if another thread is doing the same load/create, + /// // there will be a race condition; in this case we could remove the get_store + /// // and only run app.store() as it will return the existing store if it has been loaded + /// app.store("store.json")? + /// }; + /// Ok(()) + /// }); + /// ``` + fn get_store(&self, path: impl AsRef) -> Option>>; } impl> StoreExt for T { - fn store(&self, path: impl AsRef) -> Store { + fn store(&self, path: impl AsRef) -> Result>> { StoreBuilder::new(self.app_handle(), path).build() } fn store_builder(&self, path: impl AsRef) -> StoreBuilder { StoreBuilder::new(self.app_handle(), path) } + + fn get_store(&self, path: impl AsRef) -> Option>> { + let collection = self.state::(); + let stores = collection.stores.lock().unwrap(); + stores + .get(&resolve_store_path(self.app_handle(), path.as_ref()).ok()?) + .and_then(|rid| self.resources_table().get(*rid).ok()) + } +} + +fn default_serialize( + cache: &HashMap, +) -> std::result::Result, Box> { + Ok(serde_json::to_vec_pretty(&cache)?) +} + +fn default_deserialize( + bytes: &[u8], +) -> std::result::Result, Box> { + serde_json::from_slice(bytes).map_err(Into::into) } -// #[derive(Default)] -pub struct Builder { - stores: HashMap>, - // frozen: bool, +pub struct Builder { + serialize_fns: HashMap, + deserialize_fns: HashMap, + default_serialize: SerializeFn, + default_deserialize: DeserializeFn, } -impl Default for Builder { +impl Default for Builder { fn default() -> Self { Self { - stores: Default::default(), - // frozen: false, + serialize_fns: Default::default(), + deserialize_fns: Default::default(), + default_serialize, + default_deserialize, } } } -impl Builder { +impl Builder { pub fn new() -> Self { Self::default() } - // /// Registers a store with the plugin. - // /// - // /// # Examples - // /// - // /// ``` - // /// use tauri_plugin_store::{StoreBuilder, Builder}; - // /// - // /// tauri::Builder::default() - // /// .setup(|app| { - // /// let store = StoreBuilder::new("store.bin").build(app.handle().clone()); - // /// let builder = Builder::default().store(store); - // /// Ok(()) - // /// }); - // /// ``` - // pub fn store(mut self, store: Store) -> Self { - // self.stores.insert(store.path.clone(), store); - // self - // } - - // /// Registers multiple stores with the plugin. - // /// - // /// # Examples - // /// - // /// ``` - // /// use tauri_plugin_store::{StoreBuilder, Builder}; - // /// - // /// tauri::Builder::default() - // /// .setup(|app| { - // /// let store = StoreBuilder::new("store.bin").build(app.handle().clone()); - // /// let builder = Builder::default().stores([store]); - // /// Ok(()) - // /// }); - // /// ``` - // pub fn stores>>(mut self, stores: T) -> Self { - // self.stores = stores - // .into_iter() - // .map(|store| (store.path.clone(), store)) - // .collect(); - // self - // } - - // /// Freezes the collection. - // /// - // /// This causes requests for plugins that haven't been registered to fail - // /// - // /// # Examples - // /// - // /// ``` - // /// use tauri_plugin_store::{StoreBuilder, Builder}; - // /// - // /// tauri::Builder::default() - // /// .setup(|app| { - // /// let store = StoreBuilder::new("store.bin").build(app.handle().clone()); - // /// app.handle().plugin(Builder::default().freeze().build()); - // /// Ok(()) - // /// }); - // /// ``` - // pub fn freeze(mut self) -> Self { - // self.frozen = true; - // self - // } + /// Register a serialize function to access it from the JavaScript side + /// + /// # Examples + /// + /// ``` + /// fn no_pretty_json( + /// cache: &std::collections::HashMap, + /// ) -> Result, Box> { + /// Ok(serde_json::to_vec(&cache)?) + /// } + /// + /// tauri::Builder::default() + /// .plugin( + /// tauri_plugin_store::Builder::default() + /// .register_serialize_fn("no-pretty-json".to_owned(), no_pretty_json) + /// .build(), + /// ); + /// ``` + pub fn register_serialize_fn(mut self, name: String, serialize_fn: SerializeFn) -> Self { + self.serialize_fns.insert(name, serialize_fn); + self + } + + /// Register a deserialize function to access it from the JavaScript side + pub fn register_deserialize_fn(mut self, name: String, deserialize_fn: DeserializeFn) -> Self { + self.deserialize_fns.insert(name, deserialize_fn); + self + } + + /// Use this serialize function for stores by default + /// + /// # Examples + /// + /// ``` + /// fn no_pretty_json( + /// cache: &std::collections::HashMap, + /// ) -> Result, Box> { + /// Ok(serde_json::to_vec(&cache)?) + /// } + /// + /// tauri::Builder::default() + /// .plugin( + /// tauri_plugin_store::Builder::default() + /// .default_serialize_fn(no_pretty_json) + /// .build(), + /// ); + /// ``` + pub fn default_serialize_fn(mut self, serialize_fn: SerializeFn) -> Self { + self.default_serialize = serialize_fn; + self + } + + /// Use this deserialize function for stores by default + pub fn default_deserialize_fn(mut self, deserialize_fn: DeserializeFn) -> Self { + self.default_deserialize = deserialize_fn; + self + } /// Builds the plugin. /// @@ -249,56 +405,37 @@ impl Builder { /// tauri::Builder::default() /// .plugin(tauri_plugin_store::Builder::default().build()) /// .setup(|app| { - /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin").build(); + /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin").build()?; /// Ok(()) /// }); /// ``` - pub fn build(mut self) -> TauriPlugin { + pub fn build(self) -> TauriPlugin { plugin::Builder::new("store") .invoke_handler(tauri::generate_handler![ - create_store, - set, - get, - has, - delete, - clear, - reset, - keys, - values, - length, - entries, - load, - save + load, get_store, set, get, has, delete, clear, reset, keys, values, length, + entries, reload, save, ]) .setup(move |app_handle, _api| { - for (path, store) in self.stores.iter_mut() { - // ignore loading errors, just use the default - if let Err(err) = store.load() { - warn!( - "Failed to load store {path:?} from disk: {err}. Falling back to default values." - ); - } - } - - app_handle.manage(StoreCollection:: { - stores: Mutex::new(HashMap::new()), - // frozen: self.frozen, + app_handle.manage(StoreState { + stores: Arc::new(Mutex::new(HashMap::new())), + serialize_fns: self.serialize_fns, + deserialize_fns: self.deserialize_fns, + default_serialize: self.default_serialize, + default_deserialize: self.default_deserialize, }); - Ok(()) }) - .on_event(|_app_handle, event| { + .on_event(|app_handle, event| { if let RunEvent::Exit = event { - // let collection = app_handle.state::>(); - - // for store in collection.stores.lock().expect("mutex poisoned").values_mut() { - // if let Some(sender) = store.auto_save_debounce_sender.take() { - // let _ = sender.send(AutoSaveMessage::Cancel); - // } - // if let Err(err) = store.save() { - // eprintln!("failed to save store {:?} with error {:?}", store.path, err); - // } - // } + let collection = app_handle.state::(); + let stores = collection.stores.lock().unwrap(); + for (path, rid) in stores.iter() { + if let Ok(store) = app_handle.resources_table().get::>(*rid) { + if let Err(err) = store.save() { + tracing::error!("failed to save store {path:?} with error {err:?}"); + } + } + } } }) .build() diff --git a/plugins/store/src/store.rs b/plugins/store/src/store.rs index d610525d..1dc5e1d2 100644 --- a/plugins/store/src/store.rs +++ b/plugins/store/src/store.rs @@ -2,38 +2,32 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use crate::{ChangePayload, StoreCollection}; +use crate::{ChangePayload, StoreState}; use serde_json::Value as JsonValue; use std::{ collections::HashMap, - fs::{create_dir_all, read, File}, - io::Write, + fs, path::{Path, PathBuf}, sync::{Arc, Mutex}, time::Duration, }; -use tauri::{AppHandle, Emitter, Manager, Resource, Runtime}; +use tauri::{path::BaseDirectory, AppHandle, Emitter, Manager, Resource, ResourceId, Runtime}; use tokio::{ select, sync::mpsc::{unbounded_channel, UnboundedSender}, time::sleep, }; -type SerializeFn = +pub type SerializeFn = fn(&HashMap) -> Result, Box>; -pub(crate) type DeserializeFn = +pub type DeserializeFn = fn(&[u8]) -> Result, Box>; -fn default_serialize( - cache: &HashMap, -) -> Result, Box> { - Ok(serde_json::to_vec(&cache)?) -} - -fn default_deserialize( - bytes: &[u8], -) -> Result, Box> { - serde_json::from_slice(bytes).map_err(Into::into) +pub fn resolve_store_path( + app: &AppHandle, + path: impl AsRef, +) -> crate::Result { + Ok(dunce::simplified(&app.path().resolve(path, BaseDirectory::AppData)?).to_path_buf()) } /// Builds a [`Store`] @@ -41,10 +35,10 @@ pub struct StoreBuilder { app: AppHandle, path: PathBuf, defaults: Option>, - cache: HashMap, - serialize: SerializeFn, - deserialize: DeserializeFn, + serialize_fn: SerializeFn, + deserialize_fn: DeserializeFn, auto_save: Option, + create_new: bool, } impl StoreBuilder { @@ -60,15 +54,18 @@ impl StoreBuilder { /// }); /// ``` pub fn new, P: AsRef>(manager: &M, path: P) -> Self { + let app = manager.app_handle().clone(); + let state = app.state::(); + let serialize_fn = state.default_serialize; + let deserialize_fn = state.default_deserialize; Self { - app: manager.app_handle().clone(), - // Since Store.path is only exposed to the user in emit calls we may as well simplify it here already. - path: dunce::simplified(path.as_ref()).to_path_buf(), + app, + path: path.as_ref().to_path_buf(), defaults: None, - cache: Default::default(), - serialize: default_serialize, - deserialize: default_deserialize, - auto_save: None, + serialize_fn, + deserialize_fn, + auto_save: Some(Duration::from_millis(100)), + create_new: false, } } @@ -84,17 +81,16 @@ impl StoreBuilder { /// /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin") /// .defaults(defaults) - /// .build(); + /// .build()?; /// Ok(()) /// }); /// ``` pub fn defaults(mut self, defaults: HashMap) -> Self { - self.cache.clone_from(&defaults); self.defaults = Some(defaults); self } - /// Inserts multiple key-value pairs. + /// Inserts multiple default key-value pairs. /// /// # Examples /// ``` @@ -103,14 +99,13 @@ impl StoreBuilder { /// .setup(|app| { /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin") /// .default("foo".to_string(), "bar") - /// .build(); + /// .build()?; /// Ok(()) /// }); /// ``` pub fn default(mut self, key: impl Into, value: impl Into) -> Self { let key = key.into(); let value = value.into(); - self.cache.insert(key.clone(), value.clone()); self.defaults .get_or_insert(HashMap::new()) .insert(key, value); @@ -126,12 +121,12 @@ impl StoreBuilder { /// .setup(|app| { /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") /// .serialize(|cache| serde_json::to_vec(&cache).map_err(Into::into)) - /// .build(); + /// .build()?; /// Ok(()) /// }); /// ``` pub fn serialize(mut self, serialize: SerializeFn) -> Self { - self.serialize = serialize; + self.serialize_fn = serialize; self } @@ -144,28 +139,25 @@ impl StoreBuilder { /// .setup(|app| { /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") /// .deserialize(|bytes| serde_json::from_slice(&bytes).map_err(Into::into)) - /// .build(); + /// .build()?; /// Ok(()) /// }); /// ``` pub fn deserialize(mut self, deserialize: DeserializeFn) -> Self { - self.deserialize = deserialize; + self.deserialize_fn = deserialize; self } /// Auto save on modified with a debounce duration /// - /// Note: only works if this store is managed by the plugin (e.g. made using [`crate::with_store`] or inserted into [`crate::Builder`]) - /// /// # Examples /// ``` - /// /// tauri::Builder::default() /// .plugin(tauri_plugin_store::Builder::default().build()) /// .setup(|app| { /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") /// .auto_save(std::time::Duration::from_millis(100)) - /// .build(); + /// .build()?; /// Ok(()) /// }); /// ``` @@ -174,7 +166,64 @@ impl StoreBuilder { self } - /// Builds the [`Store`]. + /// Disable auto save on modified with a debounce duration. + pub fn disable_auto_save(mut self) -> Self { + self.auto_save = None; + self + } + + /// Force create a new store with default values even if it already exists. + pub fn create_new(mut self) -> Self { + self.create_new = true; + self + } + + pub(crate) fn build_inner(mut self) -> crate::Result<(Arc>, ResourceId)> { + let stores = self.app.state::().stores.clone(); + let mut stores = stores.lock().unwrap(); + + self.path = resolve_store_path(&self.app, self.path)?; + + if self.create_new { + if let Some(rid) = stores.remove(&self.path) { + let _ = self.app.resources_table().take::>(rid); + } + } else if let Some(rid) = stores.get(&self.path) { + return Ok((self.app.resources_table().get(*rid).unwrap(), *rid)); + } + + // if stores.contains_key(&self.path) { + // return Err(crate::Error::AlreadyExists(self.path)); + // } + + let mut store_inner = StoreInner::new( + self.app.clone(), + self.path.clone(), + self.defaults.take(), + self.serialize_fn, + self.deserialize_fn, + ); + + if !self.create_new { + let _ = store_inner.load(); + } + + let store = Store { + auto_save: self.auto_save, + auto_save_debounce_sender: Arc::new(Mutex::new(None)), + store: Arc::new(Mutex::new(store_inner)), + }; + + let store = Arc::new(store); + let rid = self.app.resources_table().add_arc(store.clone()); + stores.insert(self.path, rid); + + Ok((store, rid)) + } + + /// Load the existing store with the same path or creates a new [`Store`]. + /// + /// If a store with the same path has already been loaded its instance is returned. /// /// # Examples /// ``` @@ -185,131 +234,116 @@ impl StoreBuilder { /// Ok(()) /// }); /// ``` - pub fn build(self) -> Store { - let collection = self.app.state::>(); - let mut stores = collection.stores.lock().unwrap(); - let store = stores - .get(&self.path) - .and_then(|store| store.upgrade()) - .unwrap_or_else(|| { - let mut store = StoreInner::new(self.app.clone(), self.path.clone()); - let _ = store.load(self.deserialize); - let store = Arc::new(Mutex::new(store)); - stores.insert( - self.path.clone(), - Arc::>>::downgrade(&store), - ); - store - }); - drop(stores); - Store { - defaults: self.defaults, - serialize: self.serialize, - deserialize: self.deserialize, - auto_save: self.auto_save, - auto_save_debounce_sender: Arc::new(Mutex::new(None)), - store, - } + pub fn build(self) -> crate::Result>> { + let (store, _) = self.build_inner()?; + Ok(store) } } -pub(crate) enum AutoSaveMessage { +enum AutoSaveMessage { Reset, Cancel, } #[derive(Clone)] -pub struct StoreInner { - pub(crate) app: AppHandle, - pub(crate) path: PathBuf, - pub(crate) cache: HashMap, +struct StoreInner { + app: AppHandle, + path: PathBuf, + cache: HashMap, + defaults: Option>, + serialize_fn: SerializeFn, + deserialize_fn: DeserializeFn, } impl StoreInner { - pub fn new(app: AppHandle, path: PathBuf) -> Self { + fn new( + app: AppHandle, + path: PathBuf, + defaults: Option>, + serialize_fn: SerializeFn, + deserialize_fn: DeserializeFn, + ) -> Self { Self { app, path, - cache: HashMap::new(), + cache: defaults.clone().unwrap_or_default(), + defaults, + serialize_fn, + deserialize_fn, } } - pub fn save(&self, serialize_fn: SerializeFn) -> crate::Result<()> { - let app_dir = self - .app - .path() - .app_data_dir() - .expect("failed to resolve app dir"); - let store_path = app_dir.join(&self.path); - - create_dir_all(store_path.parent().expect("invalid store path"))?; + /// Saves the store to disk at the store's `path`. + pub fn save(&self) -> crate::Result<()> { + fs::create_dir_all(self.path.parent().expect("invalid store path"))?; - let bytes = serialize_fn(&self.cache).map_err(crate::Error::Serialize)?; - let mut f = File::create(&store_path)?; - f.write_all(&bytes)?; + let bytes = (self.serialize_fn)(&self.cache).map_err(crate::Error::Serialize)?; + fs::write(&self.path, bytes)?; Ok(()) } /// Update the store from the on-disk state - pub fn load(&mut self, deserialize_fn: DeserializeFn) -> crate::Result<()> { - let app_dir = self - .app - .path() - .app_data_dir() - .expect("failed to resolve app dir"); - let store_path = app_dir.join(&self.path); - - let bytes = read(store_path)?; + pub fn load(&mut self) -> crate::Result<()> { + let bytes = fs::read(&self.path)?; self.cache - .extend(deserialize_fn(&bytes).map_err(crate::Error::Deserialize)?); + .extend((self.deserialize_fn)(&bytes).map_err(crate::Error::Deserialize)?); Ok(()) } - pub fn insert(&mut self, key: impl Into, value: impl Into) { + /// Inserts a key-value pair into the store. + pub fn set(&mut self, key: impl Into, value: impl Into) { let key = key.into(); let value = value.into(); self.cache.insert(key.clone(), value.clone()); - let _ = self.emit_change_event(&key, &value); + let _ = self.emit_change_event(&key, Some(&value)); } + /// Returns a reference to the value corresponding to the key. pub fn get(&self, key: impl AsRef) -> Option<&JsonValue> { self.cache.get(key.as_ref()) } + /// Returns `true` if the given `key` exists in the store. pub fn has(&self, key: impl AsRef) -> bool { self.cache.contains_key(key.as_ref()) } + /// Removes a key-value pair from the store. pub fn delete(&mut self, key: impl AsRef) -> bool { let flag = self.cache.remove(key.as_ref()).is_some(); if flag { - let _ = self.emit_change_event(key.as_ref(), &JsonValue::Null); + let _ = self.emit_change_event(key.as_ref(), None); } flag } + /// Clears the store, removing all key-value pairs. + /// + /// Note: To clear the storage and reset it to its `default` value, use [`reset`](Self::reset) instead. pub fn clear(&mut self) { let keys: Vec = self.cache.keys().cloned().collect(); self.cache.clear(); for key in &keys { - let _ = self.emit_change_event(key, &JsonValue::Null); + let _ = self.emit_change_event(key, None); } } - pub fn reset(&mut self, defaults: &Option>) { - if let Some(defaults) = &defaults { + /// Resets the store to its `default` value. + /// + /// If no default value has been set, this method behaves identical to [`clear`](Self::clear). + pub fn reset(&mut self) { + if let Some(defaults) = &self.defaults { for (key, value) in &self.cache { if defaults.get(key) != Some(value) { - let _ = - self.emit_change_event(key, defaults.get(key).unwrap_or(&JsonValue::Null)); + let _ = self.emit_change_event(key, defaults.get(key)); } } for (key, value) in defaults { if !self.cache.contains_key(key) { - let _ = self.emit_change_event(key, value); + let _ = self.emit_change_event(key, Some(value)); } } self.cache.clone_from(defaults); @@ -318,33 +352,43 @@ impl StoreInner { } } + /// An iterator visiting all keys in arbitrary order. pub fn keys(&self) -> impl Iterator { self.cache.keys() } + /// An iterator visiting all values in arbitrary order. pub fn values(&self) -> impl Iterator { self.cache.values() } + /// An iterator visiting all key-value pairs in arbitrary order. pub fn entries(&self) -> impl Iterator { self.cache.iter() } + /// Returns the number of elements in the store. pub fn len(&self) -> usize { self.cache.len() } + /// Returns true if the store contains no elements. pub fn is_empty(&self) -> bool { self.cache.is_empty() } - fn emit_change_event(&self, key: &str, value: &JsonValue) -> crate::Result<()> { + fn emit_change_event(&self, key: &str, value: Option<&JsonValue>) -> crate::Result<()> { + let state = self.app.state::(); + let stores = state.stores.lock().unwrap(); + let exists = value.is_some(); self.app.emit( "store://change", ChangePayload { path: &self.path, + resource_id: stores.get(&self.path).copied(), key, value, + exists, }, )?; Ok(()) @@ -361,38 +405,45 @@ impl std::fmt::Debug for StoreInner { } pub struct Store { - defaults: Option>, - serialize: SerializeFn, - deserialize: DeserializeFn, auto_save: Option, auto_save_debounce_sender: Arc>>>, store: Arc>>, } -impl Resource for Store {} - -impl Store { - pub fn with_store( - &self, - f: impl FnOnce(&mut StoreInner) -> crate::Result, - ) -> crate::Result { - let mut store = self.store.lock().unwrap(); - f(&mut store) +impl Resource for Store { + fn close(self: Arc) { + let store = self.store.lock().unwrap(); + let state = store.app.state::(); + let mut stores = state.stores.lock().unwrap(); + stores.remove(&store.path); } +} +impl Store { + // /// Do something with the inner store, + // /// useful for batching some work if you need higher performance + // pub fn with_store(&self, f: impl FnOnce(&mut StoreInner) -> T) -> T { + // let mut store = self.store.lock().unwrap(); + // f(&mut store) + // } + + /// Inserts a key-value pair into the store. pub fn set(&self, key: impl Into, value: impl Into) { - self.store.lock().unwrap().insert(key.into(), value.into()); + self.store.lock().unwrap().set(key.into(), value.into()); let _ = self.trigger_auto_save(); } + /// Returns the value for the given `key` or `None` if the key does not exist. pub fn get(&self, key: impl AsRef) -> Option { self.store.lock().unwrap().get(key).cloned() } + /// Returns `true` if the given `key` exists in the store. pub fn has(&self, key: impl AsRef) -> bool { self.store.lock().unwrap().has(key) } + /// Removes a key-value pair from the store. pub fn delete(&self, key: impl AsRef) -> bool { let deleted = self.store.lock().unwrap().delete(key); if deleted { @@ -401,24 +452,33 @@ impl Store { deleted } + /// Clears the store, removing all key-value pairs. + /// + /// Note: To clear the storage and reset it to its `default` value, use [`reset`](Self::reset) instead. pub fn clear(&self) { self.store.lock().unwrap().clear(); let _ = self.trigger_auto_save(); } + /// Resets the store to its `default` value. + /// + /// If no default value has been set, this method behaves identical to [`clear`](Self::clear). pub fn reset(&self) { - self.store.lock().unwrap().reset(&self.defaults); + self.store.lock().unwrap().reset(); let _ = self.trigger_auto_save(); } + /// Returns a list of all keys in the store. pub fn keys(&self) -> Vec { self.store.lock().unwrap().keys().cloned().collect() } + /// Returns a list of all values in the store. pub fn values(&self) -> Vec { self.store.lock().unwrap().values().cloned().collect() } + /// Returns a list of all key-value pairs in the store. pub fn entries(&self) -> Vec<(String, JsonValue)> { self.store .lock() @@ -428,19 +488,40 @@ impl Store { .collect() } + /// Returns the number of elements in the store. pub fn length(&self) -> usize { self.store.lock().unwrap().len() } - pub fn load(&self) -> crate::Result<()> { - self.store.lock().unwrap().load(self.deserialize) + /// Returns true if the store contains no elements. + pub fn is_empty(&self) -> bool { + self.store.lock().unwrap().is_empty() + } + + /// Update the store from the on-disk state + pub fn reload(&self) -> crate::Result<()> { + self.store.lock().unwrap().load() } + /// Saves the store to disk at the store's `path`. pub fn save(&self) -> crate::Result<()> { if let Some(sender) = self.auto_save_debounce_sender.lock().unwrap().take() { let _ = sender.send(AutoSaveMessage::Cancel); } - self.store.lock().unwrap().save(self.serialize) + self.store.lock().unwrap().save() + } + + /// Removes the store from the resource table + pub fn close_resource(&self) { + let store = self.store.lock().unwrap(); + let app = store.app.clone(); + let state = app.state::(); + let stores = state.stores.lock().unwrap(); + if let Some(rid) = stores.get(&store.path).copied() { + drop(store); + drop(stores); + let _ = app.resources_table().close(rid); + } } fn trigger_auto_save(&self) -> crate::Result<()> { @@ -459,7 +540,6 @@ impl Store { auto_save_debounce_sender.replace(sender); drop(auto_save_debounce_sender); let store = self.store.clone(); - let serialize_fn = self.serialize; let auto_save_debounce_sender = self.auto_save_debounce_sender.clone(); tauri::async_runtime::spawn(async move { loop { @@ -471,7 +551,7 @@ impl Store { } _ = sleep(auto_save_delay) => { auto_save_debounce_sender.lock().unwrap().take(); - let _ = store.lock().unwrap().save(serialize_fn); + let _ = store.lock().unwrap().save(); return; } }; @@ -479,4 +559,18 @@ impl Store { }); Ok(()) } + + fn apply_pending_auto_save(&self) { + // Cancel and save if auto save is pending + if let Some(sender) = self.auto_save_debounce_sender.lock().unwrap().take() { + let _ = sender.send(AutoSaveMessage::Cancel); + let _ = self.save(); + }; + } +} + +impl Drop for Store { + fn drop(&mut self) { + self.apply_pending_auto_save(); + } } diff --git a/plugins/stronghold/CHANGELOG.md b/plugins/stronghold/CHANGELOG.md index 1b292461..5d7ea2d1 100644 --- a/plugins/stronghold/CHANGELOG.md +++ b/plugins/stronghold/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -89,7 +93,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - \`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/stronghold/Cargo.toml b/plugins/stronghold/Cargo.toml index fbfdf47e..7d40957a 100644 --- a/plugins/stronghold/Cargo.toml +++ b/plugins/stronghold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-stronghold" -version = "2.0.1" +version = "2.2.0" description = "Store secrets and keys using the IOTA Stronghold secret management engine." authors = { workspace = true } license = { workspace = true } diff --git a/plugins/stronghold/README.md b/plugins/stronghold/README.md index d885bf64..6dd16519 100644 --- a/plugins/stronghold/README.md +++ b/plugins/stronghold/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-stronghold#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/stronghold/package.json b/plugins/stronghold/package.json index cbefad53..87611e2a 100644 --- a/plugins/stronghold/package.json +++ b/plugins/stronghold/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-stronghold", - "version": "2.0.0", + "version": "2.2.0", "description": "Store secrets and keys using the IOTA Stronghold encrypted database.", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/stronghold/src/lib.rs b/plugins/stronghold/src/lib.rs index 29ad870f..23acc3a2 100644 --- a/plugins/stronghold/src/lib.rs +++ b/plugins/stronghold/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/stronghold/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/stronghold) -//! //! Store secrets and keys using the [IOTA Stronghold](https://github.com/iotaledger/stronghold.rs) encrypted database and secure runtime. #![doc( @@ -127,7 +125,7 @@ impl<'de> Deserialize<'de> for KeyType { { struct KeyTypeVisitor; - impl<'de> Visitor<'de> for KeyTypeVisitor { + impl Visitor<'_> for KeyTypeVisitor { type Value = KeyType; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/plugins/updater/CHANGELOG.md b/plugins/updater/CHANGELOG.md index 802b31c1..e8c2d587 100644 --- a/plugins/updater/CHANGELOG.md +++ b/plugins/updater/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## \[2.5.0] + +- [`5369898d`](https://github.com/tauri-apps/plugins-workspace/commit/5369898db7a6098e3e2f43436100ea556d405628) ([#2067](https://github.com/tauri-apps/plugins-workspace/pull/2067) by [@jLynx](https://github.com/tauri-apps/plugins-workspace/../../jLynx)) Fix update installation on macOS when using an user without admin privileges. +- [`5369898d`](https://github.com/tauri-apps/plugins-workspace/commit/5369898db7a6098e3e2f43436100ea556d405628) ([#2067](https://github.com/tauri-apps/plugins-workspace/pull/2067) by [@jLynx](https://github.com/tauri-apps/plugins-workspace/../../jLynx)) Remove the `UpdaterBuilder::new` function, use `UpdaterExt::updater_builder` instead. + +## \[2.4.0] + +- [`0afc9b6b`](https://github.com/tauri-apps/plugins-workspace/commit/0afc9b6be07bee1077f05a86285d977e57810ed9) ([#2325](https://github.com/tauri-apps/plugins-workspace/pull/2325) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The `Update` struct/object will now contain a `raw_json`/`rawJson` property to be able to read parts of server's json response that are not handled by the plugin. + +## \[2.3.1] + +- [`57efb47c`](https://github.com/tauri-apps/plugins-workspace/commit/57efb47c116f880477f72f02a8e4239e88007d44) ([#2235](https://github.com/tauri-apps/plugins-workspace/pull/2235) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add `Builder::header` and `Builder::headers` method to configure default headers for updater. + +## \[2.3.0] + +- [`829b6326`](https://github.com/tauri-apps/plugins-workspace/commit/829b63265030bc9c61d1738c4eaca0ffb3178677) ([#1919](https://github.com/tauri-apps/plugins-workspace/pull/1919) by [@n1ght-hunter](https://github.com/tauri-apps/plugins-workspace/../../n1ght-hunter)) Add `tauri_plugin_updater::Builder::default_version_comparator` method to set the default version comparator for the updater. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.1.0] + +- [`f8f2eefe`](https://github.com/tauri-apps/plugins-workspace/commit/f8f2eefe03ab231beafbd6a88d61b53d77f0400d) ([#1991](https://github.com/tauri-apps/plugins-workspace/pull/1991) by [@jLynx](https://github.com/tauri-apps/plugins-workspace/../../jLynx)) Added support for `.deb` package updates on Linux systems. + ## \[2.0.2] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -133,65 +158,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ater. -- [`1cb8311`](https://github.com/tauri-apps/plugins-workspace/commit/1cb831183c63ba5bd3f72d8a482992f6467d950d)([#405](https://github.com/tauri-apps/plugins-workspace/pull/405)) Implement passive mode on NSIS and automatically restart after NSIS update. -- [`4ab90f0`](https://github.com/tauri-apps/plugins-workspace/commit/4ab90f048eab2918344f97dc8e04413a404e392d)([#431](https://github.com/tauri-apps/plugins-workspace/pull/431)) The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 0f048eab2918344f97dc8e04413a404e392d)([#431](https://github.com/tauri-apps/plugins-workspace/pull/431)) The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 1]\(https://github.com/tauri-apps/plugins-workspace/pull/431)) The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 0f048eab2918344f97dc8e04413a404e392d)([#431](https://github.com/tauri-apps/plugins-workspace/pull/431)) The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 918344f97dc8e04413a404e392d)([#431](https://github.com/tauri-apps/plugins-workspace/pull/431)) The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 0f048eab2918344f97dc8e04413a404e392d)([#431](https://github.com/tauri-apps/plugins-workspace/pull/431)) The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 1]\(https://github.com/tauri-apps/plugins-workspace/pull/431)) The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 0f048eab2918344f97dc8e04413a404e392d)([#431](https://github.com/tauri-apps/plugins-workspace/pull/431)) The updater plugin is recieving a few changes to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 92fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - i-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 92fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - to improve consistency and ergonomics of the Rust and JS APIs - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 92fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - i-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 92fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/updater/Cargo.toml b/plugins/updater/Cargo.toml index 9a1944e8..b4a81b0a 100644 --- a/plugins/updater/Cargo.toml +++ b/plugins/updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-updater" -version = "2.0.2" +version = "2.5.0" description = "In-app updates for Tauri applications." edition = { workspace = true } authors = { workspace = true } @@ -55,13 +55,14 @@ windows-sys = { version = "0.59.0", features = [ ] } [target."cfg(target_os = \"linux\")".dependencies] -dirs = "5" +dirs = "6" tar = { version = "0.4", optional = true } flate2 = { version = "1", optional = true } [target."cfg(target_os = \"macos\")".dependencies] tar = "0.4" flate2 = "1" +osakit = { version = "0.3", features = ["full"] } [features] default = ["rustls-tls", "zip"] diff --git a/plugins/updater/README.md b/plugins/updater/README.md index f8dd5347..f1d91b1c 100644 --- a/plugins/updater/README.md +++ b/plugins/updater/README.md @@ -55,7 +55,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-updater#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { @@ -82,6 +82,8 @@ if (update?.available) { } ``` +Note that for these APIs to work you have to properly configure the updater first and generate updater artifacts. Please refer to the [guide on our website](https://v2.tauri.app/plugin/updater/) for this. + ## Contributing PRs accepted. Please make sure to read the Contributing Guide before making a pull request. diff --git a/plugins/updater/api-iife.js b/plugins/updater/api-iife.js index 2b10e2e7..1a2191c5 100644 --- a/plugins/updater/api-iife.js +++ b/plugins/updater/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e){"use strict";function t(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function s(e,t,s,n,i){if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var n,i,r,a;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),i.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:a})=>{if(a===t(this,i,"f")){s(this,i,a+1),t(this,n,"f").call(this,e);const o=Object.keys(t(this,r,"f"));if(o.length>0){let e=a+1;for(const s of o.sort()){if(parseInt(s)!==e)break;{const i=t(this,r,"f")[s];delete t(this,r,"f")[s],t(this,n,"f").call(this,i),e+=1}}s(this,i,e)}}else t(this,r,"f")[a.toString()]=e}))}set onmessage(e){s(this,n,e)}get onmessage(){return t(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function d(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}n=new WeakMap,i=new WeakMap,r=new WeakMap;class l{get rid(){return t(this,a,"f")}constructor(e){a.set(this,void 0),s(this,a,e)}async close(){return d("plugin:resources|close",{rid:this.rid})}}a=new WeakMap;class c extends l{constructor(e){super(e.rid),this.available=e.available,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async download(e,t){const s=new o;e&&(s.onmessage=e);const n=await d("plugin:updater|download",{onEvent:s,rid:this.rid,...t});this.downloadedBytes=new l(n)}async install(){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await d("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid}),this.downloadedBytes=void 0}async downloadAndInstall(e,t){const s=new o;e&&(s.onmessage=e),await d("plugin:updater|download_and_install",{onEvent:s,rid:this.rid,...t})}async close(){await(this.downloadedBytes?.close()),await super.close()}}return e.Update=c,e.check=async function(e){return e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries())),await d("plugin:updater|check",{...e}).then((e=>e.available?new c(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e){"use strict";function t(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)}function s(e,t,s,i,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var i,n,r,a;"function"==typeof SuppressedError&&SuppressedError;const o="__TAURI_TO_IPC_KEY__";class d{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),n.set(this,0),r.set(this,[]),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:a})=>{if(a==t(this,n,"f"))for(t(this,i,"f").call(this,e),s(this,n,t(this,n,"f")+1);t(this,n,"f")in t(this,r,"f");){const e=t(this,r,"f")[t(this,n,"f")];t(this,i,"f").call(this,e),delete t(this,r,"f")[t(this,n,"f")],s(this,n,t(this,n,"f")+1)}else t(this,r,"f")[a]=e}))}set onmessage(e){s(this,i,e)}get onmessage(){return t(this,i,"f")}[(i=new WeakMap,n=new WeakMap,r=new WeakMap,o)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[o]()}}async function l(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}class h{get rid(){return t(this,a,"f")}constructor(e){a.set(this,void 0),s(this,a,e)}async close(){return l("plugin:resources|close",{rid:this.rid})}}a=new WeakMap;class c extends h{constructor(e){super(e.rid),this.available=e.available,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body,this.rawJson=e.rawJson}async download(e,t){const s=new d;e&&(s.onmessage=e);const i=await l("plugin:updater|download",{onEvent:s,rid:this.rid,...t});this.downloadedBytes=new h(i)}async install(){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await l("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid}),this.downloadedBytes=void 0}async downloadAndInstall(e,t){const s=new d;e&&(s.onmessage=e),await l("plugin:updater|download_and_install",{onEvent:s,rid:this.rid,...t})}async close(){await(this.downloadedBytes?.close()),await super.close()}}return e.Update=c,e.check=async function(e){return e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries())),await l("plugin:updater|check",{...e}).then((e=>e.available?new c(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})} diff --git a/plugins/updater/build.rs b/plugins/updater/build.rs index 7c7774b9..30f70b98 100644 --- a/plugins/updater/build.rs +++ b/plugins/updater/build.rs @@ -18,6 +18,7 @@ fn main() { // creates a cfg alias if `has_feature` is true. // `alias` must be a snake case string. fn alias(alias: &str, has_feature: bool) { + println!("cargo:rustc-check-cfg=cfg({alias})"); if has_feature { println!("cargo:rustc-cfg={alias}"); } diff --git a/plugins/updater/guest-js/index.ts b/plugins/updater/guest-js/index.ts index 54d1d174..dfaaff24 100644 --- a/plugins/updater/guest-js/index.ts +++ b/plugins/updater/guest-js/index.ts @@ -43,6 +43,7 @@ interface UpdateMetadata { version: string date?: string body?: string + rawJson: Record } /** Updater download event */ @@ -57,6 +58,7 @@ class Update extends Resource { version: string date?: string body?: string + rawJson: Record private downloadedBytes?: Resource constructor(metadata: UpdateMetadata) { @@ -66,6 +68,7 @@ class Update extends Resource { this.version = metadata.version this.date = metadata.date this.body = metadata.body + this.rawJson = metadata.rawJson } /** Download the updater package */ diff --git a/plugins/updater/package.json b/plugins/updater/package.json index 3afb2f4e..a47faf25 100644 --- a/plugins/updater/package.json +++ b/plugins/updater/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-updater", - "version": "2.0.0", + "version": "2.5.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/updater/src/commands.rs b/plugins/updater/src/commands.rs index f36a591c..eed3cd77 100644 --- a/plugins/updater/src/commands.rs +++ b/plugins/updater/src/commands.rs @@ -34,6 +34,7 @@ pub(crate) struct Metadata { version: String, date: Option, body: Option, + raw_json: serde_json::Value, } struct DownloadedBytes(pub Vec); @@ -73,6 +74,7 @@ pub(crate) async fn check( metadata.version.clone_from(&update.version); metadata.date = update.date.map(|d| d.to_string()); metadata.body.clone_from(&update.body); + metadata.raw_json.clone_from(&update.raw_json); metadata.rid = Some(webview.resources_table().add(update)); } diff --git a/plugins/updater/src/error.rs b/plugins/updater/src/error.rs index 1f5d6a15..d6d9b0ce 100644 --- a/plugins/updater/src/error.rs +++ b/plugins/updater/src/error.rs @@ -63,6 +63,12 @@ pub enum Error { TempDirNotOnSameMountPoint, #[error("binary for the current target not found in the archive")] BinaryNotFoundInArchive, + #[error("failed to create temporary directory")] + TempDirNotFound, + #[error("Authentication failed or was cancelled")] + AuthenticationFailed, + #[error("Failed to install .deb package")] + DebInstallFailed, #[error("invalid updater binary format")] InvalidUpdaterFormat, #[error(transparent)] diff --git a/plugins/updater/src/lib.rs b/plugins/updater/src/lib.rs index b45f91a2..75b014bc 100644 --- a/plugins/updater/src/lib.rs +++ b/plugins/updater/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/updater/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/updater) -//! //! In-app updates for Tauri applications. //! //! - Supported platforms: Windows, Linux and macOS.crypted database and secure runtime. @@ -13,8 +11,10 @@ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" )] -use std::ffi::OsString; +use std::{ffi::OsString, sync::Arc}; +use http::{HeaderMap, HeaderName, HeaderValue}; +use semver::Version; use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, Manager, Runtime, @@ -70,14 +70,14 @@ pub trait UpdaterExt { impl> UpdaterExt for T { fn updater_builder(&self) -> UpdaterBuilder { let app = self.app_handle(); - let package_info = app.package_info(); - let UpdaterState { config, target } = self.state::().inner(); + let UpdaterState { + config, + target, + version_comparator, + headers, + } = self.state::().inner(); - let mut builder = UpdaterBuilder::new( - package_info.name.clone(), - package_info.version.clone(), - config.clone(), - ); + let mut builder = UpdaterBuilder::new(app, config.clone()).headers(headers.clone()); if let Some(target) = target { builder = builder.target(target); @@ -88,6 +88,8 @@ impl> UpdaterExt for T { builder = builder.current_exe_args(args); } + builder.version_comparator = version_comparator.clone(); + #[cfg(any( target_os = "linux", target_os = "dragonfly", @@ -118,6 +120,8 @@ impl> UpdaterExt for T { struct UpdaterState { target: Option, config: Config, + version_comparator: Option, + headers: HeaderMap, } #[derive(Default)] @@ -125,6 +129,8 @@ pub struct Builder { target: Option, pubkey: Option, installer_args: Vec, + headers: HeaderMap, + default_version_comparator: Option, } impl Builder { @@ -165,10 +171,42 @@ impl Builder { self } + pub fn header(mut self, key: K, value: V) -> Result + where + HeaderName: TryFrom, + >::Error: Into, + HeaderValue: TryFrom, + >::Error: Into, + { + let key: std::result::Result = key.try_into().map_err(Into::into); + let value: std::result::Result = + value.try_into().map_err(Into::into); + self.headers.insert(key?, value?); + + Ok(self) + } + + pub fn headers(mut self, headers: HeaderMap) -> Self { + self.headers = headers; + self + } + + pub fn default_version_comparator< + F: Fn(Version, RemoteRelease) -> bool + Send + Sync + 'static, + >( + mut self, + f: F, + ) -> Self { + self.default_version_comparator.replace(Arc::new(f)); + self + } + pub fn build(self) -> TauriPlugin { let pubkey = self.pubkey; let target = self.target; + let version_comparator = self.default_version_comparator; let installer_args = self.installer_args; + let headers = self.headers; PluginBuilder::::new("updater") .setup(move |app, api| { let mut config = api.config().clone(); @@ -178,7 +216,12 @@ impl Builder { if let Some(windows) = &mut config.windows { windows.installer_args.extend_from_slice(&installer_args); } - app.manage(UpdaterState { target, config }); + app.manage(UpdaterState { + target, + config, + version_comparator, + headers, + }); Ok(()) }) .invoke_handler(tauri::generate_handler![ diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index b1dadd6d..f9209a00 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -23,7 +23,7 @@ use reqwest::{ }; use semver::Version; use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize}; -use tauri::{utils::platform::current_exe, Resource}; +use tauri::{utils::platform::current_exe, AppHandle, Resource, Runtime}; use time::OffsetDateTime; use url::Url; @@ -93,12 +93,18 @@ impl RemoteRelease { } pub type OnBeforeExit = Arc; +pub type VersionComparator = Arc bool + Send + Sync>; +type MainThreadClosure = Box; +type RunOnMainThread = + Box std::result::Result<(), tauri::Error> + Send + Sync + 'static>; pub struct UpdaterBuilder { + #[allow(dead_code)] + run_on_main_thread: RunOnMainThread, app_name: String, current_version: Version, config: Config, - version_comparator: Option bool + Send + Sync>>, + pub(crate) version_comparator: Option, executable_path: Option, target: Option, endpoints: Option>, @@ -111,18 +117,20 @@ pub struct UpdaterBuilder { } impl UpdaterBuilder { - /// It's prefered to use [`crate::UpdaterExt::updater_builder`] instead of - /// constructing a [`UpdaterBuilder`] with this function yourself - pub fn new(app_name: String, current_version: Version, config: crate::Config) -> Self { + pub(crate) fn new(app: &AppHandle, config: crate::Config) -> Self { + let app_ = app.clone(); + let run_on_main_thread = + move |f: Box| app_.run_on_main_thread(f); Self { + run_on_main_thread: Box::new(run_on_main_thread), installer_args: config .windows .as_ref() .map(|w| w.installer_args.clone()) .unwrap_or_default(), current_exe_args: Vec::new(), - app_name, - current_version, + app_name: app.package_info().name.clone(), + current_version: app.package_info().version.clone(), config, version_comparator: None, executable_path: None, @@ -139,7 +147,7 @@ impl UpdaterBuilder { mut self, f: F, ) -> Self { - self.version_comparator = Some(Box::new(f)); + self.version_comparator = Some(Arc::new(f)); self } @@ -178,6 +186,16 @@ impl UpdaterBuilder { Ok(self) } + pub fn headers(mut self, headers: HeaderMap) -> Self { + self.headers = headers; + self + } + + pub fn clear_headers(mut self) -> Self { + self.headers.clear(); + self + } + pub fn timeout(mut self, timeout: Duration) -> Self { self.timeout = Some(timeout); self @@ -248,6 +266,7 @@ impl UpdaterBuilder { }; Ok(Updater { + run_on_main_thread: Arc::new(self.run_on_main_thread), config: self.config, app_name: self.app_name, current_version: self.current_version, @@ -280,10 +299,12 @@ impl UpdaterBuilder { } pub struct Updater { + #[allow(dead_code)] + run_on_main_thread: Arc, config: Config, app_name: String, current_version: Version, - version_comparator: Option bool + Send + Sync>>, + version_comparator: Option, timeout: Option, proxy: Option, endpoints: Vec, @@ -319,6 +340,7 @@ impl Updater { } let mut remote_release: Option = None; + let mut raw_json: Option = None; let mut last_error: Option = None; for url in &self.endpoints { // replace {{current_version}}, {{target}} and {{arch}} in the provided URL @@ -368,7 +390,8 @@ impl Updater { return Ok(None); }; - match serde_json::from_value::(res.json().await?) + raw_json = Some(res.json().await?); + match serde_json::from_value::(raw_json.clone().unwrap()) .map_err(Into::into) { Ok(release) => { @@ -399,6 +422,7 @@ impl Updater { let update = if should_update { Some(Update { + run_on_main_thread: self.run_on_main_thread.clone(), config: self.config.clone(), on_before_exit: self.on_before_exit.clone(), app_name: self.app_name.clone(), @@ -410,6 +434,7 @@ impl Updater { download_url: release.download_url(&self.json_target)?.to_owned(), body: release.notes.clone(), signature: release.signature(&self.json_target)?.to_owned(), + raw_json: raw_json.unwrap(), timeout: self.timeout, proxy: self.proxy.clone(), headers: self.headers.clone(), @@ -426,6 +451,8 @@ impl Updater { #[derive(Clone)] pub struct Update { + #[allow(dead_code)] + run_on_main_thread: Arc, config: Config, #[allow(unused)] on_before_exit: Option, @@ -443,6 +470,8 @@ pub struct Update { pub download_url: Url, /// Signature announced pub signature: String, + /// The raw version of server's JSON response. Useful if the response contains additional fields that the updater doesn't handle. + pub raw_json: serde_json::Value, /// Request timeout pub timeout: Option, /// Request proxy @@ -748,7 +777,7 @@ impl Update { } } -/// Linux (AppImage) +/// Linux (AppImage and Deb) #[cfg(any( target_os = "linux", target_os = "dragonfly", @@ -760,12 +789,19 @@ impl Update { /// ### Expected structure: /// ├── [AppName]_[version]_amd64.AppImage.tar.gz # GZ generated by tauri-bundler /// │ └──[AppName]_[version]_amd64.AppImage # Application AppImage + /// ├── [AppName]_[version]_amd64.deb # Debian package /// └── ... /// - /// We should have an AppImage already installed to be able to copy and install - /// the extract_path is the current AppImage path - /// tmp_dir is where our new AppImage is found fn install_inner(&self, bytes: &[u8]) -> Result<()> { + if self.is_deb_package() { + self.install_deb(bytes) + } else { + // Handle AppImage or other formats + self.install_appimage(bytes) + } + } + + fn install_appimage(&self, bytes: &[u8]) -> Result<()> { use std::os::unix::fs::{MetadataExt, PermissionsExt}; let extract_path_metadata = self.extract_path.metadata()?; @@ -835,6 +871,162 @@ impl Update { Err(Error::TempDirNotOnSameMountPoint) } + + fn is_deb_package(&self) -> bool { + // First check if we're in a typical Debian installation path + let in_system_path = self + .extract_path + .to_str() + .map(|p| p.starts_with("/usr")) + .unwrap_or(false); + + if !in_system_path { + return false; + } + + // Then verify it's actually a Debian-based system by checking for dpkg + let dpkg_exists = std::path::Path::new("/var/lib/dpkg").exists(); + let apt_exists = std::path::Path::new("/etc/apt").exists(); + + // Additional check for the package in dpkg database + let package_in_dpkg = if let Ok(output) = std::process::Command::new("dpkg") + .args(["-S", &self.extract_path.to_string_lossy()]) + .output() + { + output.status.success() + } else { + false + }; + + // Consider it a deb package only if: + // 1. We're in a system path AND + // 2. We have Debian package management tools AND + // 3. The binary is tracked by dpkg + dpkg_exists && apt_exists && package_in_dpkg + } + + fn install_deb(&self, bytes: &[u8]) -> Result<()> { + // First verify the bytes are actually a .deb package + if !infer::archive::is_deb(bytes) { + return Err(Error::InvalidUpdaterFormat); + } + + // Try different temp directories + let tmp_dir_locations = vec![ + Box::new(|| Some(std::env::temp_dir())) as Box Option>, + Box::new(dirs::cache_dir), + Box::new(|| Some(self.extract_path.parent().unwrap().to_path_buf())), + ]; + + // Try writing to multiple temp locations until one succeeds + for tmp_dir_location in tmp_dir_locations { + if let Some(path) = tmp_dir_location() { + if let Ok(tmp_dir) = tempfile::Builder::new() + .prefix("tauri_deb_update") + .tempdir_in(path) + { + let deb_path = tmp_dir.path().join("package.deb"); + + // Try writing the .deb file + if std::fs::write(&deb_path, bytes).is_ok() { + // If write succeeds, proceed with installation + return self.try_install_with_privileges(&deb_path); + } + // If write fails, continue to next temp location + } + } + } + + // If we get here, all temp locations failed + Err(Error::TempDirNotFound) + } + + fn try_install_with_privileges(&self, deb_path: &Path) -> Result<()> { + // 1. First try using pkexec (graphical sudo prompt) + if let Ok(status) = std::process::Command::new("pkexec") + .arg("dpkg") + .arg("-i") + .arg(deb_path) + .status() + { + if status.success() { + return Ok(()); + } + } + + // 2. Try zenity or kdialog for a graphical sudo experience + if let Ok(password) = self.get_password_graphically() { + if self.install_with_sudo(deb_path, &password)? { + return Ok(()); + } + } + + // 3. Final fallback: terminal sudo + let status = std::process::Command::new("sudo") + .arg("dpkg") + .arg("-i") + .arg(deb_path) + .status()?; + + if status.success() { + Ok(()) + } else { + Err(Error::DebInstallFailed) + } + } + + fn get_password_graphically(&self) -> Result { + // Try zenity first + let zenity_result = std::process::Command::new("zenity") + .args([ + "--password", + "--title=Authentication Required", + "--text=Enter your password to install the update:", + ]) + .output(); + + if let Ok(output) = zenity_result { + if output.status.success() { + return Ok(String::from_utf8_lossy(&output.stdout).trim().to_string()); + } + } + + // Fall back to kdialog if zenity fails or isn't available + let kdialog_result = std::process::Command::new("kdialog") + .args(["--password", "Enter your password to install the update:"]) + .output(); + + if let Ok(output) = kdialog_result { + if output.status.success() { + return Ok(String::from_utf8_lossy(&output.stdout).trim().to_string()); + } + } + + Err(Error::AuthenticationFailed) + } + + fn install_with_sudo(&self, deb_path: &Path, password: &str) -> Result { + use std::io::Write; + use std::process::{Command, Stdio}; + + let mut child = Command::new("sudo") + .arg("-S") // read password from stdin + .arg("dpkg") + .arg("-i") + .arg(deb_path) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn()?; + + if let Some(mut stdin) = child.stdin.take() { + // Write password to stdin + writeln!(stdin, "{}", password)?; + } + + let status = child.wait()?; + Ok(status.success()) + } } /// MacOS @@ -852,42 +1044,85 @@ impl Update { let cursor = Cursor::new(bytes); let mut extracted_files: Vec = Vec::new(); - // the first file in the tar.gz will always be - // /Contents - let tmp_dir = tempfile::Builder::new() + // Create temp directories for backup and extraction + let tmp_backup_dir = tempfile::Builder::new() .prefix("tauri_current_app") .tempdir()?; - // create backup of our current app - std::fs::rename(&self.extract_path, tmp_dir.path())?; + let tmp_extract_dir = tempfile::Builder::new() + .prefix("tauri_updated_app") + .tempdir()?; let decoder = GzDecoder::new(cursor); let mut archive = tar::Archive::new(decoder); - std::fs::create_dir(&self.extract_path)?; - + // Extract files to temporary directory for entry in archive.entries()? { let mut entry = entry?; - - // skip the first folder (should be the app name) let collected_path: PathBuf = entry.path()?.iter().skip(1).collect(); - let extraction_path = &self.extract_path.join(collected_path); - - // if something went wrong during the extraction, we should restore previous app - if let Err(err) = entry.unpack(extraction_path) { - for file in extracted_files.iter().rev() { - // delete all the files we extracted - if file.is_dir() { - std::fs::remove_dir(file)?; - } else { - std::fs::remove_file(file)?; - } - } - std::fs::rename(tmp_dir.path(), &self.extract_path)?; + let extraction_path = tmp_extract_dir.path().join(&collected_path); + + // Ensure parent directories exist + if let Some(parent) = extraction_path.parent() { + std::fs::create_dir_all(parent)?; + } + + if let Err(err) = entry.unpack(&extraction_path) { + // Cleanup on error + std::fs::remove_dir_all(tmp_extract_dir.path()).ok(); + return Err(err.into()); + } + extracted_files.push(extraction_path); + } + + // Try to move the current app to backup + let move_result = std::fs::rename( + &self.extract_path, + tmp_backup_dir.path().join("current_app"), + ); + let need_authorization = if let Err(err) = move_result { + if err.kind() == std::io::ErrorKind::PermissionDenied { + true + } else { + std::fs::remove_dir_all(tmp_extract_dir.path()).ok(); return Err(err.into()); } + } else { + false + }; - extracted_files.push(extraction_path.to_path_buf()); + if need_authorization { + // Use AppleScript to perform moves with admin privileges + let apple_script = format!( + "do shell script \"rm -rf '{src}' && mv -f '{new}' '{src}'\" with administrator privileges", + src = self.extract_path.display(), + new = tmp_extract_dir.path().display() + ); + + let (tx, rx) = std::sync::mpsc::channel(); + let res = (self.run_on_main_thread)(Box::new(move || { + let mut script = + osakit::Script::new_from_source(osakit::Language::AppleScript, &apple_script); + script.compile().expect("invalid AppleScript"); + let r = script.execute(); + tx.send(r).unwrap(); + })); + let result = rx.recv().unwrap(); + + if res.is_err() || result.is_err() { + std::fs::remove_dir_all(tmp_extract_dir.path()).ok(); + return Err(Error::Io(std::io::Error::new( + std::io::ErrorKind::PermissionDenied, + "Failed to move the new app into place", + ))); + } + } else { + // Remove existing directory if it exists + if self.extract_path.exists() { + std::fs::remove_dir_all(&self.extract_path)?; + } + // Move the new app to the target path + std::fs::rename(tmp_extract_dir.path(), &self.extract_path)?; } let _ = std::process::Command::new("touch") diff --git a/plugins/updater/tests/updater-migration/v1-app/Cargo.lock b/plugins/updater/tests/updater-migration/v1-app/Cargo.lock index 673454cd..a645c196 100644 --- a/plugins/updater/tests/updater-migration/v1-app/Cargo.lock +++ b/plugins/updater/tests/updater-migration/v1-app/Cargo.lock @@ -1822,9 +1822,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -1854,9 +1854,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc" dependencies = [ "cc", "libc", diff --git a/plugins/upload/CHANGELOG.md b/plugins/upload/CHANGELOG.md index 3c52be17..927256bc 100644 --- a/plugins/upload/CHANGELOG.md +++ b/plugins/upload/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## \[2.2.1] + +- [`ca7395a5`](https://github.com/tauri-apps/plugins-workspace/commit/ca7395a5ce971cbac25fb54285056edf3dd84e1f) ([#2378](https://github.com/tauri-apps/plugins-workspace/pull/2378) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) the `rustls-tls` feature is now enabled by default + +## \[2.2.1] + +- [`05c62d73`](https://github.com/tauri-apps/plugins-workspace/commit/05c62d731fa48fd06b8cb3694a962d8cb0db8619) ([#1523](https://github.com/tauri-apps/plugins-workspace/pull/1523) by [@enri90](https://github.com/tauri-apps/plugins-workspace/../../enri90)) Added post request on download function + +## \[2.2.0] + +- [`5dadd205`](https://github.com/tauri-apps/plugins-workspace/commit/5dadd205f5596c9607457dd015a2f9d7fc48a2db) ([#2033](https://github.com/tauri-apps/plugins-workspace/pull/2033) by [@514sid](https://github.com/tauri-apps/plugins-workspace/../../514sid)) Added a new field `progressTotal` to track the total amount of data transferred during the upload/download process. + +## \[2.1.0] + +- [`87cc5852`](https://github.com/tauri-apps/plugins-workspace/commit/87cc58527d769960427a2f46bb10532f5dcf7ace) ([#1797](https://github.com/tauri-apps/plugins-workspace/pull/1797) by [@VirtualPirate](https://github.com/tauri-apps/plugins-workspace/../../VirtualPirate)) Added feature for calculating `transfer_speed` during file uploads and downloads + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -94,15 +110,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 17ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - s-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/upload/Cargo.toml b/plugins/upload/Cargo.toml index 692c13e1..c95658b5 100644 --- a/plugins/upload/Cargo.toml +++ b/plugins/upload/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-upload" -version = "2.0.1" +version = "2.2.1" description = "Upload files from disk to a remote server over HTTP." authors = { workspace = true } license = { workspace = true } @@ -32,6 +32,7 @@ thiserror = { workspace = true } tokio = { version = "1", features = ["fs"] } tokio-util = { version = "0.7", features = ["codec"] } reqwest = { version = "0.12", default-features = false, features = [ + "macos-system-configuration", "json", "stream", ] } @@ -39,10 +40,11 @@ futures-util = "0.3" read-progress-stream = "1.0.0" [features] +default = ["rustls-tls"] native-tls = ["reqwest/native-tls"] native-tls-vendored = ["reqwest/native-tls-vendored"] rustls-tls = ["reqwest/rustls-tls"] [dev-dependencies] -mockito = "1.5.0" +mockito = "1.6.1" tokio = { version = "1", features = ["macros"] } diff --git a/plugins/upload/README.md b/plugins/upload/README.md index 15dd3ad6..d6169097 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -55,7 +55,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-upload#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/upload/api-iife.js b/plugins/upload/api-iife.js index 188b262a..eb635fa8 100644 --- a/plugins/upload/api-iife.js +++ b/plugins/upload/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_UPLOAD__=function(e){"use strict";function t(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function n(e,t,n,o,s){if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var o,s,r;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,o.set(this,(()=>{})),s.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:i})=>{if(i===t(this,s,"f")){n(this,s,i+1),t(this,o,"f").call(this,e);const a=Object.keys(t(this,r,"f"));if(a.length>0){let e=i+1;for(const n of a.sort()){if(parseInt(n)!==e)break;{const s=t(this,r,"f")[n];delete t(this,r,"f")[n],t(this,o,"f").call(this,s),e+=1}}n(this,s,e)}}else t(this,r,"f")[i.toString()]=e}))}set onmessage(e){n(this,o,e)}get onmessage(){return t(this,o,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}return o=new WeakMap,s=new WeakMap,r=new WeakMap,e.download=async function(e,t,n,o){const s=new Uint32Array(1);window.crypto.getRandomValues(s);const r=s[0],c=new i;n&&(c.onmessage=n),await a("plugin:upload|download",{id:r,url:e,filePath:t,headers:o??{},onProgress:c})},e.upload=async function(e,t,n,o){const s=new Uint32Array(1);window.crypto.getRandomValues(s);const r=s[0],c=new i;return n&&(c.onmessage=n),await a("plugin:upload|upload",{id:r,url:e,filePath:t,headers:o??{},onProgress:c})},e}({});Object.defineProperty(window.__TAURI__,"upload",{value:__TAURI_PLUGIN_UPLOAD__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_UPLOAD__=function(t){"use strict";function e(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)}function n(t,e,n,s,i){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var s,i,o;"function"==typeof SuppressedError&&SuppressedError;const r="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),i.set(this,0),o.set(this,[]),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:r})=>{if(r==e(this,i,"f"))for(e(this,s,"f").call(this,t),n(this,i,e(this,i,"f")+1);e(this,i,"f")in e(this,o,"f");){const t=e(this,o,"f")[e(this,i,"f")];e(this,s,"f").call(this,t),delete e(this,o,"f")[e(this,i,"f")],n(this,i,e(this,i,"f")+1)}else e(this,o,"f")[r]=t}))}set onmessage(t){n(this,s,t)}get onmessage(){return e(this,s,"f")}[(s=new WeakMap,i=new WeakMap,o=new WeakMap,r)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[r]()}}async function _(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}return t.download=async function(t,e,n,s,i){const o=new Uint32Array(1);window.crypto.getRandomValues(o);const r=o[0],c=new a;n&&(c.onmessage=n),await _("plugin:upload|download",{id:r,url:t,filePath:e,headers:s??{},onProgress:c,body:i})},t.upload=async function(t,e,n,s){const i=new Uint32Array(1);window.crypto.getRandomValues(i);const o=i[0],r=new a;return n&&(r.onmessage=n),await _("plugin:upload|upload",{id:o,url:t,filePath:e,headers:s??{},onProgress:r})},t}({});Object.defineProperty(window.__TAURI__,"upload",{value:__TAURI_PLUGIN_UPLOAD__})} diff --git a/plugins/upload/guest-js/index.ts b/plugins/upload/guest-js/index.ts index 9586a241..03129db4 100644 --- a/plugins/upload/guest-js/index.ts +++ b/plugins/upload/guest-js/index.ts @@ -6,7 +6,9 @@ import { invoke, Channel } from '@tauri-apps/api/core' interface ProgressPayload { progress: number + progressTotal: number total: number + transferSpeed: number } type ProgressHandler = (progress: ProgressPayload) => void @@ -43,7 +45,8 @@ async function download( url: string, filePath: string, progressHandler?: ProgressHandler, - headers?: Map + headers?: Map, + body?: string ): Promise { const ids = new Uint32Array(1) window.crypto.getRandomValues(ids) @@ -59,7 +62,8 @@ async function download( url, filePath, headers: headers ?? {}, - onProgress + onProgress, + body }) } diff --git a/plugins/upload/package.json b/plugins/upload/package.json index 03b1c9ea..60fe24d0 100644 --- a/plugins/upload/package.json +++ b/plugins/upload/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-upload", - "version": "2.0.0", + "version": "2.2.1", "description": "Upload files from disk to a remote server over HTTP.", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/upload/src/lib.rs b/plugins/upload/src/lib.rs index 9351b246..23c33b11 100644 --- a/plugins/upload/src/lib.rs +++ b/plugins/upload/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/upload/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/upload) -//! //! Upload files from disk to a remote server over HTTP. //! //! Download files from a remote HTTP server to disk. @@ -13,6 +11,9 @@ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" )] +mod transfer_stats; +use transfer_stats::TransferStats; + use futures_util::TryStreamExt; use serde::{ser::Serializer, Serialize}; use tauri::{ @@ -55,9 +56,12 @@ impl Serialize for Error { } #[derive(Clone, Serialize)] +#[serde(rename_all = "camelCase")] struct ProgressPayload { progress: u64, + progress_total: u64, total: u64, + transfer_speed: u64, } #[command] @@ -65,12 +69,16 @@ async fn download( url: &str, file_path: &str, headers: HashMap, + body: Option, on_progress: Channel, ) -> Result<()> { let client = reqwest::Client::new(); - - let mut request = client.get(url); - // Loop through the headers keys and values + let mut request = if let Some(body) = body { + client.post(url).body(body) + } else { + client.get(url) + }; + // Loop trought the headers keys and values // and add them to the request object. for (key, value) in headers { request = request.header(&key, value); @@ -88,11 +96,15 @@ async fn download( let mut file = BufWriter::new(File::create(file_path).await?); let mut stream = response.bytes_stream(); + let mut stats = TransferStats::default(); while let Some(chunk) = stream.try_next().await? { file.write_all(&chunk).await?; + stats.record_chunk_transfer(chunk.len()); let _ = on_progress.send(ProgressPayload { progress: chunk.len() as u64, + progress_total: stats.total_transferred, total, + transfer_speed: stats.transfer_speed, }); } file.flush().await?; @@ -138,10 +150,17 @@ async fn upload( fn file_to_body(channel: Channel, file: File) -> reqwest::Body { let stream = FramedRead::new(file, BytesCodec::new()).map_ok(|r| r.freeze()); + let mut stats = TransferStats::default(); reqwest::Body::wrap_stream(ReadProgressStream::new( stream, Box::new(move |progress, total| { - let _ = channel.send(ProgressPayload { progress, total }); + stats.record_chunk_transfer(progress as usize); + let _ = channel.send(ProgressPayload { + progress, + progress_total: stats.total_transferred, + total, + transfer_speed: stats.transfer_speed, + }); }), )) } @@ -191,7 +210,7 @@ mod tests { let _ = msg; Ok(()) }); - download(url, file_path, headers, sender).await + download(url, file_path, headers, None, sender).await } async fn spawn_server_mocked(return_status: usize) -> MockedServer { diff --git a/plugins/upload/src/transfer_stats.rs b/plugins/upload/src/transfer_stats.rs new file mode 100644 index 00000000..2f3a3946 --- /dev/null +++ b/plugins/upload/src/transfer_stats.rs @@ -0,0 +1,55 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::time::Instant; + +// The TransferStats struct tracks both transfer speed and cumulative transfer progress. +pub struct TransferStats { + accumulated_chunk_len: usize, // Total length of chunks transferred in the current period + accumulated_time: u128, // Total time taken for the transfers in the current period + pub transfer_speed: u64, // Calculated transfer speed in bytes per second + pub total_transferred: u64, // Cumulative total of all transferred data + start_time: Instant, // Time when the current period started + granularity: u32, // Time period (in milliseconds) over which the transfer speed is calculated +} + +impl TransferStats { + // Initializes a new TransferStats instance with the specified granularity. + pub fn start(granularity: u32) -> Self { + Self { + accumulated_chunk_len: 0, + accumulated_time: 0, + transfer_speed: 0, + total_transferred: 0, + start_time: Instant::now(), + granularity, + } + } + // Records the transfer of a data chunk and updates both transfer speed and total progress. + pub fn record_chunk_transfer(&mut self, chunk_len: usize) { + let now = Instant::now(); + let it_took = now.duration_since(self.start_time).as_millis(); + self.accumulated_chunk_len += chunk_len; + self.total_transferred += chunk_len as u64; + self.accumulated_time += it_took; + + // Calculate transfer speed if accumulated time exceeds granularity. + if self.accumulated_time >= self.granularity as u128 { + self.transfer_speed = + (self.accumulated_chunk_len as u128 / self.accumulated_time * 1024) as u64; + self.accumulated_chunk_len = 0; + self.accumulated_time = 0; + } + + // Reset the start time for the next period. + self.start_time = now; + } +} + +// Provides a default implementation for TransferStats with a granularity of 500 milliseconds. +impl Default for TransferStats { + fn default() -> Self { + Self::start(500) // Default granularity is 500 ms + } +} diff --git a/plugins/websocket/CHANGELOG.md b/plugins/websocket/CHANGELOG.md index 4268e32e..905fa644 100644 --- a/plugins/websocket/CHANGELOG.md +++ b/plugins/websocket/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## \[2.3.0] + +- [`78acfa45`](https://github.com/tauri-apps/plugins-workspace/commit/78acfa456f343c0af5fbf35660802d14ff7a5eca) ([#2027](https://github.com/tauri-apps/plugins-workspace/pull/2027) by [@twlite](https://github.com/tauri-apps/plugins-workspace/../../twlite)) `addListener` now returns a cleanup function instead of `void` to remove the listener. + +## \[2.2.1] + +- [`05cca602`](https://github.com/tauri-apps/plugins-workspace/commit/05cca602d927c30014d3892438ca28d99bc4e1d3) ([#2210](https://github.com/tauri-apps/plugins-workspace/pull/2210) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) **Breaking change:** Updated tokio_tungstenite to `0.26`. This may be a breaking change if you use the `tls_connector` Builder method in Rust. + **Breaking change:** Removed the accidental `ConnectionConfig` struct re-export (in rust). This should not affect anyone since the Config was not used in any public API. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -89,16 +102,3 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - te to alpha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ha.11. - -## \[2.0.0-alpha.0] - -- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! diff --git a/plugins/websocket/Cargo.toml b/plugins/websocket/Cargo.toml index e3d92026..34130573 100644 --- a/plugins/websocket/Cargo.toml +++ b/plugins/websocket/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-websocket" -version = "2.0.1" +version = "2.3.0" description = "Expose a WebSocket server to your Tauri frontend." authors = { workspace = true } license = { workspace = true } @@ -34,7 +34,7 @@ http = "1" rand = "0.8" futures-util = "0.3" tokio = { version = "1", features = ["net", "sync"] } -tokio-tungstenite = { version = "0.24" } +tokio-tungstenite = { version = "0.26" } [features] default = ["rustls-tls"] diff --git a/plugins/websocket/README.md b/plugins/websocket/README.md index a9c3a267..ec5fce9b 100644 --- a/plugins/websocket/README.md +++ b/plugins/websocket/README.md @@ -1,6 +1,6 @@ ![plugin-websocket](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/websocket/banner.png) -Expose a WebSocket server to your Tauri frontend. +Open a WebSocket connection using a Rust client in JS. | Platform | Supported | | -------- | --------- | @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-websocket#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/websocket/api-iife.js b/plugins/websocket/api-iife.js index ec81c68f..219d828b 100644 --- a/plugins/websocket/api-iife.js +++ b/plugins/websocket/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_WEBSOCKET__=function(){"use strict";function e(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function t(e,t,s,n,r){if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var s,n,r;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:i,id:a})=>{if(a===e(this,n,"f")){t(this,n,a+1),e(this,s,"f").call(this,i);const o=Object.keys(e(this,r,"f"));if(o.length>0){let i=a+1;for(const t of o.sort()){if(parseInt(t)!==i)break;{const n=e(this,r,"f")[t];delete e(this,r,"f")[t],e(this,s,"f").call(this,n),i+=1}}t(this,n,i)}}else e(this,r,"f")[a.toString()]=i}))}set onmessage(e){t(this,s,e)}get onmessage(){return e(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}s=new WeakMap,n=new WeakMap,r=new WeakMap;class o{constructor(e,t){this.id=e,this.listeners=t}static async connect(e,t){const s=[],n=new i;return n.onmessage=e=>{s.forEach((t=>{t(e)}))},t?.headers&&(t.headers=Array.from(new Headers(t.headers).entries())),await a("plugin:websocket|connect",{url:e,onMessage:n,config:t}).then((e=>new o(e,s)))}addListener(e){this.listeners.push(e)}async send(e){let t;if("string"==typeof e)t={type:"Text",data:e};else if("object"==typeof e&&"type"in e)t=e;else{if(!Array.isArray(e))throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");t={type:"Binary",data:e}}await a("plugin:websocket|send",{id:this.id,message:t})}async disconnect(){await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}return o}();Object.defineProperty(window.__TAURI__,"websocket",{value:__TAURI_PLUGIN_WEBSOCKET__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_WEBSOCKET__=function(){"use strict";function e(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function t(e,t,s,n,i){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var s,n,i;"function"==typeof SuppressedError&&SuppressedError;const r="__TAURI_TO_IPC_KEY__";class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),i.set(this,[]),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:r,id:a})=>{if(a==e(this,n,"f"))for(e(this,s,"f").call(this,r),t(this,n,e(this,n,"f")+1);e(this,n,"f")in e(this,i,"f");){const r=e(this,i,"f")[e(this,n,"f")];e(this,s,"f").call(this,r),delete e(this,i,"f")[e(this,n,"f")],t(this,n,e(this,n,"f")+1)}else e(this,i,"f")[a]=r}))}set onmessage(e){t(this,s,e)}get onmessage(){return e(this,s,"f")}[(s=new WeakMap,n=new WeakMap,i=new WeakMap,r)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[r]()}}async function o(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}class c{constructor(e,t){this.id=e,this.listeners=t}static async connect(e,t){const s=new Set,n=new a;return n.onmessage=e=>{s.forEach((t=>{t(e)}))},t?.headers&&(t.headers=Array.from(new Headers(t.headers).entries())),await o("plugin:websocket|connect",{url:e,onMessage:n,config:t}).then((e=>new c(e,s)))}addListener(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}async send(e){let t;if("string"==typeof e)t={type:"Text",data:e};else if("object"==typeof e&&"type"in e)t=e;else{if(!Array.isArray(e))throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");t={type:"Binary",data:e}}await o("plugin:websocket|send",{id:this.id,message:t})}async disconnect(){await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}return c}();Object.defineProperty(window.__TAURI__,"websocket",{value:__TAURI_PLUGIN_WEBSOCKET__})} diff --git a/plugins/websocket/examples/tauri-app/package.json b/plugins/websocket/examples/tauri-app/package.json index dc8f68bb..d58d9b6c 100644 --- a/plugins/websocket/examples/tauri-app/package.json +++ b/plugins/websocket/examples/tauri-app/package.json @@ -9,9 +9,9 @@ "preview": "vite preview" }, "devDependencies": { - "@tauri-apps/cli": "2.0.0", + "@tauri-apps/cli": "2.2.7", "typescript": "^5.3.3", - "vite": "^5.4.7" + "vite": "^6.0.0" }, "dependencies": { "tauri-plugin-websocket-api": "link:..\\.." diff --git a/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml b/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml index 3c789aba..3b56008f 100644 --- a/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml +++ b/plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml @@ -11,7 +11,7 @@ tauri = { workspace = true, features = ["wry", "compression"] } tokio = { version = "1", features = ["net"] } futures-util = "0.3" tauri-plugin-websocket = { path = "../../../" } -tokio-tungstenite = "0.24" +tokio-tungstenite = "0.26" [build-dependencies] tauri-build = { workspace = true } diff --git a/plugins/websocket/guest-js/index.ts b/plugins/websocket/guest-js/index.ts index 8d787742..7ea7b326 100644 --- a/plugins/websocket/guest-js/index.ts +++ b/plugins/websocket/guest-js/index.ts @@ -5,11 +5,37 @@ import { invoke, Channel } from '@tauri-apps/api/core' export interface ConnectionConfig { + /** + * Read buffer capacity. The default value is 128 KiB. + */ + readBufferSize?: number + /** The target minimum size of the write buffer to reach before writing the data to the underlying stream. The default value is 128 KiB. + * + * If set to 0 each message will be eagerly written to the underlying stream. It is often more optimal to allow them to buffer a little, hence the default value. + */ writeBufferSize?: number + /** The max size of the write buffer in bytes. Setting this can provide backpressure in the case the write buffer is filling up due to write errors. The default value is unlimited. + * + * Note: The write buffer only builds up past write_buffer_size when writes to the underlying stream are failing. So the write buffer can not fill up if you are not observing write errors. + * + * Note: Should always be at least write_buffer_size + 1 message and probably a little more depending on error handling strategy. + */ maxWriteBufferSize?: number - maxMessageSize?: number - maxFrameSize?: number + /** + * The maximum size of an incoming message. The string "none" means no size limit. The default value is 64 MiB which should be reasonably big for all normal use-cases but small enough to prevent memory eating by a malicious user. + */ + maxMessageSize?: number | 'none' + /** + * The maximum size of a single incoming message frame. The string "none" means no size limit. The limit is for frame payload NOT including the frame header. The default value is 16 MiB which should be reasonably big for all normal use-cases but small enough to prevent memory eating by a malicious user. + */ + maxFrameSize?: number | 'none' + /** + * When set to true, the server will accept and handle unmasked frames from the client. According to the RFC 6455, the server must close the connection to the client in such cases, however it seems like there are some popular libraries that are sending unmasked frames, ignoring the RFC. By default this option is set to false, i.e. according to RFC 6455. + */ acceptUnmaskedFrames?: boolean + /** + * Additional connect request headers. + */ headers?: HeadersInit } @@ -32,9 +58,9 @@ export type Message = export default class WebSocket { id: number - private readonly listeners: Array<(arg: Message) => void> + private readonly listeners: Set<(arg: Message) => void> - constructor(id: number, listeners: Array<(arg: Message) => void>) { + constructor(id: number, listeners: Set<(arg: Message) => void>) { this.id = id this.listeners = listeners } @@ -43,7 +69,7 @@ export default class WebSocket { url: string, config?: ConnectionConfig ): Promise { - const listeners: Array<(arg: Message) => void> = [] + const listeners: Set<(arg: Message) => void> = new Set() const onMessage = new Channel() onMessage.onmessage = (message: Message): void => { @@ -63,8 +89,12 @@ export default class WebSocket { }).then((id) => new WebSocket(id, listeners)) } - addListener(cb: (arg: Message) => void): void { - this.listeners.push(cb) + addListener(cb: (arg: Message) => void): () => void { + this.listeners.add(cb) + + return () => { + this.listeners.delete(cb) + } } async send(message: Message | string | number[]): Promise { diff --git a/plugins/websocket/package.json b/plugins/websocket/package.json index 2579eb42..e6496faa 100644 --- a/plugins/websocket/package.json +++ b/plugins/websocket/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-websocket", - "version": "2.0.0", + "version": "2.3.0", "license": "MIT OR Apache-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/websocket/src/lib.rs b/plugins/websocket/src/lib.rs index 2ce02e81..f75817b6 100644 --- a/plugins/websocket/src/lib.rs +++ b/plugins/websocket/src/lib.rs @@ -2,9 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/websocket/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/websocket) -//! -//! Expose a WebSocket server to your Tauri frontend. +//! Open a WebSocket connection using a Rust client in JS. #![doc( html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png", @@ -68,13 +66,21 @@ struct ConnectionManager(Mutex>); #[cfg(any(feature = "rustls-tls", feature = "native-tls"))] struct TlsConnector(Mutex>); +#[derive(Deserialize)] +#[serde(untagged, rename_all = "camelCase")] +enum Max { + None, + Number(usize), +} + #[derive(Deserialize)] #[serde(rename_all = "camelCase")] -pub struct ConnectionConfig { +pub(crate) struct ConnectionConfig { + pub read_buffer_size: Option, pub write_buffer_size: Option, pub max_write_buffer_size: Option, - pub max_message_size: Option, - pub max_frame_size: Option, + pub max_message_size: Option, + pub max_frame_size: Option, #[serde(default)] pub accept_unmasked_frames: bool, pub headers: Option>, @@ -82,18 +88,38 @@ pub struct ConnectionConfig { impl From for WebSocketConfig { fn from(config: ConnectionConfig) -> Self { - // Disabling the warning on max_send_queue which we don't use anymore since it was deprecated. - #[allow(deprecated)] - Self { - max_send_queue: None, - write_buffer_size: config.write_buffer_size.unwrap_or(128 * 1024), - max_write_buffer_size: config.max_write_buffer_size.unwrap_or(usize::MAX), - // This may be harmful since if it's not provided from js we're overwriting the default value with None, meaning no size limit. - max_message_size: config.max_message_size, - // This may be harmful since if it's not provided from js we're overwriting the default value with None, meaning no size limit. - max_frame_size: config.max_frame_size, - accept_unmasked_frames: config.accept_unmasked_frames, + let mut builder = + WebSocketConfig::default().accept_unmasked_frames(config.accept_unmasked_frames); + + if let Some(read_buffer_size) = config.read_buffer_size { + builder = builder.read_buffer_size(read_buffer_size) + } + + if let Some(write_buffer_size) = config.write_buffer_size { + builder = builder.write_buffer_size(write_buffer_size) } + + if let Some(max_write_buffer_size) = config.max_write_buffer_size { + builder = builder.max_write_buffer_size(max_write_buffer_size) + } + + if let Some(max_message_size) = config.max_message_size { + let max_size = match max_message_size { + Max::None => Option::None, + Max::Number(n) => Some(n), + }; + builder = builder.max_message_size(max_size); + } + + if let Some(max_frame_size) = config.max_frame_size { + let max_size = match max_frame_size { + Max::None => Option::None, + Max::Number(n) => Some(n), + }; + builder = builder.max_frame_size(max_size); + } + + builder } } @@ -159,21 +185,21 @@ async fn connect( let response = match message { Ok(Message::Text(t)) => { - serde_json::to_value(WebSocketMessage::Text(t)).unwrap() + serde_json::to_value(WebSocketMessage::Text(t.to_string())).unwrap() } Ok(Message::Binary(t)) => { - serde_json::to_value(WebSocketMessage::Binary(t)).unwrap() + serde_json::to_value(WebSocketMessage::Binary(t.to_vec())).unwrap() } Ok(Message::Ping(t)) => { - serde_json::to_value(WebSocketMessage::Ping(t)).unwrap() + serde_json::to_value(WebSocketMessage::Ping(t.to_vec())).unwrap() } Ok(Message::Pong(t)) => { - serde_json::to_value(WebSocketMessage::Pong(t)).unwrap() + serde_json::to_value(WebSocketMessage::Pong(t.to_vec())).unwrap() } Ok(Message::Close(t)) => { serde_json::to_value(WebSocketMessage::Close(t.map(|v| CloseFrame { code: v.code.into(), - reason: v.reason.into_owned(), + reason: v.reason.to_string(), }))) .unwrap() } @@ -199,13 +225,13 @@ async fn send( if let Some(write) = manager.0.lock().await.get_mut(&id) { write .send(match message { - WebSocketMessage::Text(t) => Message::Text(t), - WebSocketMessage::Binary(t) => Message::Binary(t), - WebSocketMessage::Ping(t) => Message::Ping(t), - WebSocketMessage::Pong(t) => Message::Pong(t), + WebSocketMessage::Text(t) => Message::Text(t.into()), + WebSocketMessage::Binary(t) => Message::Binary(t.into()), + WebSocketMessage::Ping(t) => Message::Ping(t.into()), + WebSocketMessage::Pong(t) => Message::Pong(t.into()), WebSocketMessage::Close(t) => Message::Close(t.map(|v| ProtocolCloseFrame { code: v.code.into(), - reason: std::borrow::Cow::Owned(v.reason), + reason: v.reason.into(), })), }) .await?; diff --git a/plugins/window-state/CHANGELOG.md b/plugins/window-state/CHANGELOG.md index 4f6eb45d..6f79c648 100644 --- a/plugins/window-state/CHANGELOG.md +++ b/plugins/window-state/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## \[2.2.1] + +- [`0ec895c3`](https://github.com/tauri-apps/plugins-workspace/commit/0ec895c378d4700cf8d7a002c6d9829f3c015b9f) ([#2330](https://github.com/tauri-apps/plugins-workspace/pull/2330) by [@thewh1teagle](https://github.com/tauri-apps/plugins-workspace/../../thewh1teagle)) Add `Builder::with_filter` callback to exclude specific windows from saving their state. This allows for more flexibility by enabling dynamic exclusion of windows based on custom logic. + +## \[2.2.0] + +- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other. + +## \[2.0.2] + +- [`cfb3ec0e`](https://github.com/tauri-apps/plugins-workspace/commit/cfb3ec0e21cab8010fbc1d7ef82aa65d86c3cfa9) ([#2007](https://github.com/tauri-apps/plugins-workspace/pull/2007) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On macOS the plugin now (temporarily) ignores the maximized state for undecorated windows on resize events to fix app freezes. + ## \[2.0.1] - [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7. @@ -123,10 +135,6 @@ ## \[2.0.0-alpha.0] - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - lugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - /pull/371)) First v2 alpha release! - lugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! - 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! ## \[0.1.1] @@ -135,16 +143,3 @@ - Fix restoring window positions correctly when the top-left corner of the window was outside of the monitor. - Fix restore maximization state only maximized on main monitor. - -- [70d9908](https://github.com/tauri-apps/plugins-workspace/commit/70d99086de3a58189d65c49954a3495972880725) fix(window-state): restore window position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 - sues with restoring positions: - -- Fix restoring window positions correctly when the top-left corner of the window was outside of the monitor. - -- Fix restore maximization state only maximized on main monitor. - -- [70d9908](https://github.com/tauri-apps/plugins-workspace/commit/70d99086de3a58189d65c49954a3495972880725) fix(window-state): restore window position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 - ://github.com/tauri-apps/plugins-workspace/commit/70d99086de3a58189d65c49954a3495972880725) fix(window-state): restore window position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 - indow position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 - ://github.com/tauri-apps/plugins-workspace/commit/70d99086de3a58189d65c49954a3495972880725) fix(window-state): restore window position if the one of the window corners intersects with monitor ([#898](https://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 - ://github.com/tauri-apps/plugins-workspace/pull/898)) on 2024-01-25 diff --git a/plugins/window-state/Cargo.toml b/plugins/window-state/Cargo.toml index d7a7a5f7..f1376178 100644 --- a/plugins/window-state/Cargo.toml +++ b/plugins/window-state/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-window-state" -version = "2.0.1" +version = "2.2.1" description = "Save window positions and sizes and restore them when the app is reopened." authors = { workspace = true } license = { workspace = true } diff --git a/plugins/window-state/README.md b/plugins/window-state/README.md index a4355fb5..4af93de2 100644 --- a/plugins/window-state/README.md +++ b/plugins/window-state/README.md @@ -54,7 +54,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-window-state#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() { diff --git a/plugins/window-state/api-iife.js b/plugins/window-state/api-iife.js index de6e9613..7dde6bd0 100644 --- a/plugins/window-state/api-iife.js +++ b/plugins/window-state/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOW_STATE__=function(e){"use strict";var t,i,n,a;function l(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function s(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i,n,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,i)}(this,t,e)}async close(){return s("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class o{constructor(e,t){this.type="Logical",this.width=e,this.height=t}toPhysical(e){return new u(this.width*e,this.height*e)}}class u{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new o(this.width/e,this.height/e)}}class c{constructor(e,t){this.type="Logical",this.x=e,this.y=t}toPhysical(e){return new d(this.x*e,this.x*e)}}class d{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new c(this.x/e,this.y/e)}}async function h(e,t){await s("plugin:event|unlisten",{event:e,eventId:t})}async function w(e,t,i){var n;const a="string"==typeof(null==i?void 0:i.target)?{kind:"AnyLabel",label:i.target}:null!==(n=null==i?void 0:i.target)&&void 0!==n?n:{kind:"Any"};return s("plugin:event|listen",{event:e,target:a,handler:l(t)}).then((t=>async()=>h(e,t)))}!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"}(i||(i={}));class b extends r{constructor(e){super(e)}static async new(e,t,i){return s("plugin:image|new",{rgba:y(e),width:t,height:i}).then((e=>new b(e)))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:y(e)}).then((e=>new b(e)))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then((e=>new b(e)))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return s("plugin:image|size",{rid:this.rid})}}function y(e){return null==e?null:"string"==typeof e?e:e instanceof b?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(n||(n={}));class p{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function g(){return new v(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function _(){return s("plugin:window|get_all_windows").then((e=>e.map((e=>new v(e,{skip:!0})))))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(a||(a={}));const m=["tauri://created","tauri://error"];class v{constructor(e,t={}){var i;this.label=e,this.listeners=Object.create(null),(null==t?void 0:t.skip)||s("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:null===(i=t.parent)||void 0===i?void 0:i.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static async getByLabel(e){var t;return null!==(t=(await _()).find((t=>t.label===e)))&&void 0!==t?t:null}static getCurrent(){return g()}static async getAll(){return _()}static async getFocusedWindow(){for(const e of await _())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:w(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:async function(e,t,i){return w(e,(i=>{h(e,i.id),t(i)}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(!m.includes(e))return async function(e,t){await s("plugin:event|emit",{event:e,payload:t})}(e,t);for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t})}async emitTo(e,t,i){if(!m.includes(t))return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await s("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i);for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i})}_handleTauriEvent(e,t){return!!m.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return s("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return s("plugin:window|inner_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async outerPosition(){return s("plugin:window|outer_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async innerSize(){return s("plugin:window|inner_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async outerSize(){return s("plugin:window|outer_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async isFullscreen(){return s("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return s("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return s("plugin:window|is_maximized",{label:this.label})}async isFocused(){return s("plugin:window|is_focused",{label:this.label})}async isDecorated(){return s("plugin:window|is_decorated",{label:this.label})}async isResizable(){return s("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return s("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return s("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return s("plugin:window|is_closable",{label:this.label})}async isVisible(){return s("plugin:window|is_visible",{label:this.label})}async title(){return s("plugin:window|title",{label:this.label})}async theme(){return s("plugin:window|theme",{label:this.label})}async center(){return s("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===n.Critical?{type:"Critical"}:{type:"Informational"}),s("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return s("plugin:window|set_resizable",{label:this.label,value:e})}async setEnabled(e){return s("plugin:window|set_enabled",{label:this.label,value:e})}async isEnabled(){return s("plugin:window|is_enabled",{label:this.label})}async setMaximizable(e){return s("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return s("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return s("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return s("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return s("plugin:window|maximize",{label:this.label})}async unmaximize(){return s("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return s("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return s("plugin:window|minimize",{label:this.label})}async unminimize(){return s("plugin:window|unminimize",{label:this.label})}async show(){return s("plugin:window|show",{label:this.label})}async hide(){return s("plugin:window|hide",{label:this.label})}async close(){return s("plugin:window|close",{label:this.label})}async destroy(){return s("plugin:window|destroy",{label:this.label})}async setDecorations(e){return s("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return s("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return s("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return s("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return s("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return s("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return s("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");const t={};return t[`${e.type}`]={width:e.width,height:e.height},s("plugin:window|set_size",{label:this.label,value:t})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");let t=null;return e&&(t={},t[`${e.type}`]={width:e.width,height:e.height}),s("plugin:window|set_min_size",{label:this.label,value:t})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");let t=null;return e&&(t={},t[`${e.type}`]={width:e.width,height:e.height}),s("plugin:window|set_max_size",{label:this.label,value:t})}async setSizeConstraints(e){function t(e){return e?{Logical:e}:null}return s("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:t(null==e?void 0:e.minWidth),minHeight:t(null==e?void 0:e.minHeight),maxWidth:t(null==e?void 0:e.maxWidth),maxHeight:t(null==e?void 0:e.maxHeight)}})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");const t={};return t[`${e.type}`]={x:e.x,y:e.y},s("plugin:window|set_position",{label:this.label,value:t})}async setFullscreen(e){return s("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return s("plugin:window|set_focus",{label:this.label})}async setIcon(e){return s("plugin:window|set_icon",{label:this.label,value:y(e)})}async setSkipTaskbar(e){return s("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return s("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return s("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return s("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");const t={};return t[`${e.type}`]={x:e.x,y:e.y},s("plugin:window|set_cursor_position",{label:this.label,value:t})}async setIgnoreCursorEvents(e){return s("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return s("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return s("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return s("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return s("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async setTitleBarStyle(e){return s("plugin:window|set_title_bar_style",{label:this.label,value:e})}async setTheme(e){return s("plugin:window|set_theme",{label:this.label,value:e})}async onResized(e){return this.listen(i.WINDOW_RESIZED,(t=>{var i;t.payload=(i=t.payload,new u(i.width,i.height)),e(t)}))}async onMoved(e){return this.listen(i.WINDOW_MOVED,(t=>{t.payload=I(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(i.WINDOW_CLOSE_REQUESTED,(async t=>{const i=new p(t);await e(i),i.isPreventDefault()||await this.destroy()}))}async onDragDropEvent(e){const t=await this.listen(i.DRAG_ENTER,(t=>{e({...t,payload:{type:"enter",paths:t.payload.paths,position:I(t.payload.position)}})})),n=await this.listen(i.DRAG_OVER,(t=>{e({...t,payload:{type:"over",position:I(t.payload.position)}})})),a=await this.listen(i.DRAG_DROP,(t=>{e({...t,payload:{type:"drop",paths:t.payload.paths,position:I(t.payload.position)}})})),l=await this.listen(i.DRAG_LEAVE,(t=>{e({...t,payload:{type:"leave"}})}));return()=>{t(),a(),n(),l()}}async onFocusChanged(e){const t=await this.listen(i.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),n=await this.listen(i.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),n()}}async onScaleChanged(e){return this.listen(i.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(i.WINDOW_THEME_CHANGED,e)}}var f,E,D;function I(e){return new d(e.x,e.y)}async function S(e,t){await s("plugin:window-state|restore_state",{label:e,flags:t})}return function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(f||(f={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(E||(E={})),e.StateFlags=void 0,(D=e.StateFlags||(e.StateFlags={}))[D.SIZE=1]="SIZE",D[D.POSITION=2]="POSITION",D[D.MAXIMIZED=4]="MAXIMIZED",D[D.VISIBLE=8]="VISIBLE",D[D.DECORATIONS=16]="DECORATIONS",D[D.FULLSCREEN=32]="FULLSCREEN",D[D.ALL=63]="ALL",e.filename=async function(){return await s("plugin:window-state|filename")},e.restoreState=S,e.restoreStateCurrent=async function(e){await S(g().label,e)},e.saveWindowState=async function(e){await s("plugin:window-state|save_window_state",{flags:e})},e}({});Object.defineProperty(window.__TAURI__,"windowState",{value:__TAURI_PLUGIN_WINDOW_STATE__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOW_STATE__=function(e){"use strict";var t;"function"==typeof SuppressedError&&SuppressedError;const i="__TAURI_TO_IPC_KEY__";function n(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function a(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}class s{get rid(){return function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,i)}(this,t,e)}async close(){return a("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class l{constructor(...e){this.type="Logical",1===e.length?"Logical"in e[0]?(this.width=e[0].Logical.width,this.height=e[0].Logical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toPhysical(e){return new r(this.width*e,this.height*e)}[i](){return{width:this.width,height:this.height}}toJSON(){return this[i]()}}class r{constructor(...e){this.type="Physical",1===e.length?"Physical"in e[0]?(this.width=e[0].Physical.width,this.height=e[0].Physical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toLogical(e){return new l(this.width/e,this.height/e)}[i](){return{width:this.width,height:this.height}}toJSON(){return this[i]()}}class o{constructor(e){this.size=e}toLogical(e){return this.size instanceof l?this.size:this.size.toLogical(e)}toPhysical(e){return this.size instanceof r?this.size:this.size.toPhysical(e)}[i](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[i]()}}class u{constructor(...e){this.type="Logical",1===e.length?"Logical"in e[0]?(this.x=e[0].Logical.x,this.y=e[0].Logical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toPhysical(e){return new c(this.x*e,this.y*e)}[i](){return{x:this.x,y:this.y}}toJSON(){return this[i]()}}class c{constructor(...e){this.type="Physical",1===e.length?"Physical"in e[0]?(this.x=e[0].Physical.x,this.y=e[0].Physical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toLogical(e){return new u(this.x/e,this.y/e)}[i](){return{x:this.x,y:this.y}}toJSON(){return this[i]()}}class h{constructor(e){this.position=e}toLogical(e){return this.position instanceof u?this.position:this.position.toLogical(e)}toPhysical(e){return this.position instanceof c?this.position:this.position.toPhysical(e)}[i](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[i]()}}var d,w,b;async function g(e,t){await a("plugin:event|unlisten",{event:e,eventId:t})}async function y(e,t,i){var s;const l="string"==typeof(null==i?void 0:i.target)?{kind:"AnyLabel",label:i.target}:null!==(s=null==i?void 0:i.target)&&void 0!==s?s:{kind:"Any"};return a("plugin:event|listen",{event:e,target:l,handler:n(t)}).then((t=>async()=>g(e,t)))}!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"}(d||(d={}));class p extends s{constructor(e){super(e)}static async new(e,t,i){return a("plugin:image|new",{rgba:_(e),width:t,height:i}).then((e=>new p(e)))}static async fromBytes(e){return a("plugin:image|from_bytes",{bytes:_(e)}).then((e=>new p(e)))}static async fromPath(e){return a("plugin:image|from_path",{path:e}).then((e=>new p(e)))}async rgba(){return a("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return a("plugin:image|size",{rid:this.rid})}}function _(e){return null==e?null:"string"==typeof e?e:e instanceof p?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(w||(w={}));class v{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function f(){return new D(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function m(){return a("plugin:window|get_all_windows").then((e=>e.map((e=>new D(e,{skip:!0})))))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(b||(b={}));const E=["tauri://created","tauri://error"];class D{constructor(e,t={}){var i;this.label=e,this.listeners=Object.create(null),(null==t?void 0:t.skip)||a("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:null===(i=t.parent)||void 0===i?void 0:i.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static async getByLabel(e){var t;return null!==(t=(await m()).find((t=>t.label===e)))&&void 0!==t?t:null}static getCurrent(){return f()}static async getAll(){return m()}static async getFocusedWindow(){for(const e of await m())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:y(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:async function(e,t,i){return y(e,(i=>{g(e,i.id),t(i)}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(!E.includes(e))return async function(e,t){await a("plugin:event|emit",{event:e,payload:t})}(e,t);for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t})}async emitTo(e,t,i){if(!E.includes(t))return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await a("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i);for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i})}_handleTauriEvent(e,t){return!!E.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return a("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return a("plugin:window|inner_position",{label:this.label}).then((e=>new c(e)))}async outerPosition(){return a("plugin:window|outer_position",{label:this.label}).then((e=>new c(e)))}async innerSize(){return a("plugin:window|inner_size",{label:this.label}).then((e=>new r(e)))}async outerSize(){return a("plugin:window|outer_size",{label:this.label}).then((e=>new r(e)))}async isFullscreen(){return a("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return a("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return a("plugin:window|is_maximized",{label:this.label})}async isFocused(){return a("plugin:window|is_focused",{label:this.label})}async isDecorated(){return a("plugin:window|is_decorated",{label:this.label})}async isResizable(){return a("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return a("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return a("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return a("plugin:window|is_closable",{label:this.label})}async isVisible(){return a("plugin:window|is_visible",{label:this.label})}async title(){return a("plugin:window|title",{label:this.label})}async theme(){return a("plugin:window|theme",{label:this.label})}async center(){return a("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===w.Critical?{type:"Critical"}:{type:"Informational"}),a("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return a("plugin:window|set_resizable",{label:this.label,value:e})}async setEnabled(e){return a("plugin:window|set_enabled",{label:this.label,value:e})}async isEnabled(){return a("plugin:window|is_enabled",{label:this.label})}async setMaximizable(e){return a("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return a("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return a("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return a("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return a("plugin:window|maximize",{label:this.label})}async unmaximize(){return a("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return a("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return a("plugin:window|minimize",{label:this.label})}async unminimize(){return a("plugin:window|unminimize",{label:this.label})}async show(){return a("plugin:window|show",{label:this.label})}async hide(){return a("plugin:window|hide",{label:this.label})}async close(){return a("plugin:window|close",{label:this.label})}async destroy(){return a("plugin:window|destroy",{label:this.label})}async setDecorations(e){return a("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return a("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return a("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return a("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return a("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return a("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return a("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){return a("plugin:window|set_size",{label:this.label,value:e instanceof o?e:new o(e)})}async setMinSize(e){return a("plugin:window|set_min_size",{label:this.label,value:e instanceof o?e:e?new o(e):null})}async setMaxSize(e){return a("plugin:window|set_max_size",{label:this.label,value:e instanceof o?e:e?new o(e):null})}async setSizeConstraints(e){function t(e){return e?{Logical:e}:null}return a("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:t(null==e?void 0:e.minWidth),minHeight:t(null==e?void 0:e.minHeight),maxWidth:t(null==e?void 0:e.maxWidth),maxHeight:t(null==e?void 0:e.maxHeight)}})}async setPosition(e){return a("plugin:window|set_position",{label:this.label,value:e instanceof h?e:new h(e)})}async setFullscreen(e){return a("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return a("plugin:window|set_focus",{label:this.label})}async setIcon(e){return a("plugin:window|set_icon",{label:this.label,value:_(e)})}async setSkipTaskbar(e){return a("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return a("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return a("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return a("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setBackgroundColor(e){return a("plugin:window|set_background_color",{color:e})}async setCursorPosition(e){return a("plugin:window|set_cursor_position",{label:this.label,value:e instanceof h?e:new h(e)})}async setIgnoreCursorEvents(e){return a("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return a("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return a("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setBadgeCount(e){return a("plugin:window|set_badge_count",{label:this.label,value:e})}async setBadgeLabel(e){return a("plugin:window|set_badge_label",{label:this.label,value:e})}async setOverlayIcon(e){return a("plugin:window|set_overlay_icon",{label:this.label,value:e?_(e):void 0})}async setProgressBar(e){return a("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return a("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async setTitleBarStyle(e){return a("plugin:window|set_title_bar_style",{label:this.label,value:e})}async setTheme(e){return a("plugin:window|set_theme",{label:this.label,value:e})}async onResized(e){return this.listen(d.WINDOW_RESIZED,(t=>{t.payload=new r(t.payload),e(t)}))}async onMoved(e){return this.listen(d.WINDOW_MOVED,(t=>{t.payload=new c(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(d.WINDOW_CLOSE_REQUESTED,(async t=>{const i=new v(t);await e(i),i.isPreventDefault()||await this.destroy()}))}async onDragDropEvent(e){const t=await this.listen(d.DRAG_ENTER,(t=>{e({...t,payload:{type:"enter",paths:t.payload.paths,position:new c(t.payload.position)}})})),i=await this.listen(d.DRAG_OVER,(t=>{e({...t,payload:{type:"over",position:new c(t.payload.position)}})})),n=await this.listen(d.DRAG_DROP,(t=>{e({...t,payload:{type:"drop",paths:t.payload.paths,position:new c(t.payload.position)}})})),a=await this.listen(d.DRAG_LEAVE,(t=>{e({...t,payload:{type:"leave"}})}));return()=>{t(),n(),i(),a()}}async onFocusChanged(e){const t=await this.listen(d.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),i=await this.listen(d.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),i()}}async onScaleChanged(e){return this.listen(d.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(d.WINDOW_THEME_CHANGED,e)}}var I,S,W;async function z(e,t){await a("plugin:window-state|restore_state",{label:e,flags:t})}return function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(I||(I={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(S||(S={})),e.StateFlags=void 0,(W=e.StateFlags||(e.StateFlags={}))[W.SIZE=1]="SIZE",W[W.POSITION=2]="POSITION",W[W.MAXIMIZED=4]="MAXIMIZED",W[W.VISIBLE=8]="VISIBLE",W[W.DECORATIONS=16]="DECORATIONS",W[W.FULLSCREEN=32]="FULLSCREEN",W[W.ALL=63]="ALL",e.filename=async function(){return await a("plugin:window-state|filename")},e.restoreState=z,e.restoreStateCurrent=async function(e){await z(f().label,e)},e.saveWindowState=async function(e){await a("plugin:window-state|save_window_state",{flags:e})},e}({});Object.defineProperty(window.__TAURI__,"windowState",{value:__TAURI_PLUGIN_WINDOW_STATE__})} diff --git a/plugins/window-state/package.json b/plugins/window-state/package.json index eea695bf..c065d959 100644 --- a/plugins/window-state/package.json +++ b/plugins/window-state/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/plugin-window-state", - "version": "2.0.0", + "version": "2.2.1", "description": "Save window positions and sizes and restore them when the app is reopened.", "license": "MIT OR Apache-2.0", "authors": [ diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index 15599da8..1f4abdd6 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/window-state/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/window-state) -//! //! Save window positions and sizes and restore them when the app is reopened. #![doc( @@ -29,6 +27,7 @@ use std::{ mod cmd; type LabelMapperFn = dyn Fn(&str) -> &str + Send + Sync; +type FilterCallbackFn = dyn Fn(&str) -> bool + Send + Sync; /// Default filename used to store window state. /// @@ -322,6 +321,7 @@ impl WindowExtInternal for Window { #[derive(Default)] pub struct Builder { denylist: HashSet, + filter_callback: Option>, skip_initial_state: HashSet, state_flags: StateFlags, map_label: Option>, @@ -346,12 +346,22 @@ impl Builder { } /// Sets a list of windows that shouldn't be tracked and managed by this plugin - /// for example splash screen windows. + /// For example, splash screen windows. pub fn with_denylist(mut self, denylist: &[&str]) -> Self { self.denylist = denylist.iter().map(|l| l.to_string()).collect(); self } + /// Sets a filter callback to exclude specific windows from being tracked. + /// Return `true` to save the state, or `false` to skip and not save it. + pub fn with_filter(mut self, filter_callback: F) -> Self + where + F: Fn(&str) -> bool + Send + Sync + 'static, + { + self.filter_callback = Some(Box::new(filter_callback)); + self + } + /// Adds the given window label to a list of windows to skip initial state restore. pub fn skip_initial_state(mut self, label: &str) -> Self { self.skip_initial_state.insert(label.into()); @@ -415,10 +425,19 @@ impl Builder { .map(|map| map(window.label())) .unwrap_or_else(|| window.label()); + // Check deny list names if self.denylist.contains(label) { return; } + // Check deny list callback + if let Some(filter_callback) = &self.filter_callback { + // Don't save the state if the callback returns false + if !filter_callback(label) { + return; + } + } + if !self.skip_initial_state.contains(label) { let _ = window.restore_state(self.state_flags); } @@ -471,13 +490,23 @@ impl Builder { .0 .try_lock() .is_ok() - && !window_clone.is_minimized().unwrap_or_default() - && !window_clone.is_maximized().unwrap_or_default() { - let mut c = cache.lock().unwrap(); - if let Some(state) = c.get_mut(&label) { - state.width = size.width; - state.height = size.height; + // TODO: Remove once https://github.com/tauri-apps/tauri/issues/5812 is resolved. + let is_maximized = if cfg!(target_os = "macos") + && (!window_clone.is_decorated().unwrap_or_default() + || !window_clone.is_resizable().unwrap_or_default()) + { + false + } else { + window_clone.is_maximized().unwrap_or_default() + }; + + if !window_clone.is_minimized().unwrap_or_default() && !is_maximized { + let mut c = cache.lock().unwrap(); + if let Some(state) = c.get_mut(&label) { + state.width = size.width; + state.height = size.height; + } } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 956ba8cb..6c4de703 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,319 +13,328 @@ importers: .: devDependencies: '@eslint/js': - specifier: 9.12.0 - version: 9.12.0 + specifier: 9.19.0 + version: 9.19.0 '@rollup/plugin-node-resolve': - specifier: 15.3.0 - version: 15.3.0(rollup@4.22.4) + specifier: 16.0.0 + version: 16.0.0(rollup@4.34.6) '@rollup/plugin-terser': specifier: 0.4.4 - version: 0.4.4(rollup@4.22.4) + version: 0.4.4(rollup@4.34.6) '@rollup/plugin-typescript': specifier: 11.1.6 - version: 11.1.6(rollup@4.22.4)(tslib@2.7.0)(typescript@5.6.2) + version: 11.1.6(rollup@4.34.6)(tslib@2.8.1)(typescript@5.7.3) '@types/eslint__js': specifier: 8.42.3 version: 8.42.3 covector: specifier: ^0.12.3 - version: 0.12.3(mocha@10.7.3) + version: 0.12.3(mocha@10.8.2) eslint: - specifier: 9.12.0 - version: 9.12.0(jiti@2.0.0) + specifier: 9.19.0 + version: 9.19.0(jiti@2.4.2) eslint-config-prettier: - specifier: 9.1.0 - version: 9.1.0(eslint@9.12.0(jiti@2.0.0)) + specifier: 10.0.1 + version: 10.0.1(eslint@9.19.0(jiti@2.4.2)) eslint-plugin-security: specifier: 3.0.1 version: 3.0.1 prettier: - specifier: 3.3.3 - version: 3.3.3 + specifier: 3.4.2 + version: 3.4.2 rollup: - specifier: 4.22.4 - version: 4.22.4 + specifier: 4.34.6 + version: 4.34.6 tslib: - specifier: 2.7.0 - version: 2.7.0 + specifier: 2.8.1 + version: 2.8.1 typescript: - specifier: 5.6.2 - version: 5.6.2 + specifier: 5.7.3 + version: 5.7.3 typescript-eslint: - specifier: 8.8.0 - version: 8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2) + specifier: 8.23.0 + version: 8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) examples/api: dependencies: '@tauri-apps/api': - specifier: 2.0.1 - version: 2.0.1 + specifier: 2.2.0 + version: 2.2.0 '@tauri-apps/plugin-barcode-scanner': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/barcode-scanner '@tauri-apps/plugin-biometric': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/biometric '@tauri-apps/plugin-cli': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/cli '@tauri-apps/plugin-clipboard-manager': - specifier: 2.0.0 + specifier: ^2.2.1 version: link:../../plugins/clipboard-manager '@tauri-apps/plugin-dialog': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/dialog '@tauri-apps/plugin-fs': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/fs '@tauri-apps/plugin-geolocation': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/geolocation '@tauri-apps/plugin-global-shortcut': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/global-shortcut '@tauri-apps/plugin-haptics': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/haptics '@tauri-apps/plugin-http': - specifier: 2.0.0 + specifier: ^2.3.0 version: link:../../plugins/http '@tauri-apps/plugin-nfc': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/nfc '@tauri-apps/plugin-notification': - specifier: 2.0.0 + specifier: ^2.2.1 version: link:../../plugins/notification + '@tauri-apps/plugin-opener': + specifier: ^2.2.5 + version: link:../../plugins/opener '@tauri-apps/plugin-os': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/os '@tauri-apps/plugin-process': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/process '@tauri-apps/plugin-shell': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/shell '@tauri-apps/plugin-store': - specifier: 2.0.0 + specifier: ^2.2.0 version: link:../../plugins/store '@tauri-apps/plugin-updater': - specifier: 2.0.0 + specifier: ^2.5.0 version: link:../../plugins/updater '@zerodevx/svelte-json-view': specifier: 1.0.11 - version: 1.0.11(svelte@4.2.19) + version: 1.0.11(svelte@5.10.0) devDependencies: '@iconify-json/codicon': - specifier: ^1.1.37 - version: 1.2.2 + specifier: ^1.2.6 + version: 1.2.6 '@iconify-json/ph': - specifier: ^1.1.8 - version: 1.2.0 + specifier: ^1.2.1 + version: 1.2.1 '@sveltejs/vite-plugin-svelte': - specifier: ^3.0.1 - version: 3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)) + specifier: ^5.0.1 + version: 5.0.1(svelte@5.10.0)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2)) '@tauri-apps/cli': - specifier: 2.0.0 - version: 2.0.0 + specifier: 2.2.7 + version: 2.2.7 '@unocss/extractor-svelte': - specifier: ^0.63.0 - version: 0.63.1 + specifier: ^65.0.0 + version: 65.4.0 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.10.0 + version: 5.10.0 unocss: - specifier: ^0.63.0 - version: 0.63.1(postcss@8.4.47)(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)) + specifier: ^65.0.0 + version: 65.4.0(postcss@8.5.1)(rollup@4.34.6)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.7.3)) vite: - specifier: ^5.4.7 - version: 5.4.8(terser@5.34.1) + specifier: ^6.0.3 + version: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) plugins/autostart: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/barcode-scanner: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/biometric: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/cli: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/clipboard-manager: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/deep-link: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/deep-link/examples/app: dependencies: '@tauri-apps/api': - specifier: 2.0.1 - version: 2.0.1 + specifier: 2.2.0 + version: 2.2.0 '@tauri-apps/plugin-deep-link': - specifier: 2.0.0 + specifier: 2.2.0 version: link:../.. devDependencies: '@tauri-apps/cli': - specifier: 2.0.0 - version: 2.0.0 + specifier: 2.2.7 + version: 2.2.7 typescript: specifier: ^5.2.2 - version: 5.6.2 + version: 5.7.3 vite: - specifier: ^5.4.7 - version: 5.4.8(terser@5.34.1) + specifier: ^6.0.0 + version: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) plugins/dialog: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/fs: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/geolocation: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/global-shortcut: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/haptics: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/http: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/log: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/nfc: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/notification: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 + + plugins/opener: + dependencies: + '@tauri-apps/api': + specifier: ^2.0.0 + version: 2.2.0 plugins/os: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/positioner: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/process: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/shell: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/single-instance/examples/vanilla: devDependencies: '@tauri-apps/cli': - specifier: 2.0.0 - version: 2.0.0 + specifier: 2.2.7 + version: 2.2.7 plugins/sql: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/store: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/store/examples/AppSettingsManager: devDependencies: '@tauri-apps/cli': - specifier: 2.0.0 - version: 2.0.0 + specifier: 2.2.7 + version: 2.2.7 typescript: specifier: ^5.4.7 - version: 5.6.2 + version: 5.7.3 vite: - specifier: ^5.0.12 - version: 5.4.8(terser@5.34.1) + specifier: ^6.0.0 + version: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) plugins/stronghold: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/updater: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/upload: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/websocket: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 plugins/websocket/examples/tauri-app: dependencies: @@ -334,20 +343,20 @@ importers: version: link:../.. devDependencies: '@tauri-apps/cli': - specifier: 2.0.0 - version: 2.0.0 + specifier: 2.2.7 + version: 2.2.7 typescript: specifier: ^5.3.3 - version: 5.6.2 + version: 5.7.3 vite: - specifier: ^5.4.7 - version: 5.4.8(terser@5.34.1) + specifier: ^6.0.0 + version: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) plugins/window-state: dependencies: '@tauri-apps/api': specifier: ^2.0.0 - version: 2.0.1 + version: 2.2.0 packages: @@ -361,12 +370,29 @@ packages: '@antfu/utils@0.7.10': resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + '@babel/helper-string-parser@7.25.9': + resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.25.9': + resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.26.5': + resolution: {integrity: sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/types@7.26.5': + resolution: {integrity: sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==} + engines: {node: '>=6.9.0'} + '@chainsafe/abort-controller@3.0.1': resolution: {integrity: sha512-oyq0qgFJDIIgLpyPwTv4j/sHX/MITatFzY3/b42VSldyZfnUC1lYBx5RwFvzBv1Sq4APOj2VCZO23pDRwy5kew==} engines: {node: '>=6.5'} - '@clack/core@0.3.4': - resolution: {integrity: sha512-H4hxZDXgHtWTwV3RAVenqcC4VbJZNegbBjlPvzOzCouXtS2y3sDvlO3IsbrPNWuLWPPlYVYPghQdSF64683Ldw==} + '@clack/core@0.3.5': + resolution: {integrity: sha512-5cfhQNH+1VQ2xLQlmzXMqUoiaH0lRBq9/CLW9lTyMbuKLC3+xEK01tHVvyut++mLOn5urSHmkm6I0Lg9MaJSTQ==} '@clack/prompts@0.7.0': resolution: {integrity: sha512-0MhX9/B4iL6Re04jPrttDm+BsP8y6mS7byuv0BvXgdXhbV5PdlsHt55dvNsuBCPZ7xq1oTAOOuotR9NFbQyMSA==} @@ -421,23 +447,17 @@ packages: '@effection/subscription@2.0.6': resolution: {integrity: sha512-znTi75JFyC1S0YjyTtFEWNRQbhk01UxOapWELlIkZOwjGIEjcx6+G8y6n9JpZ8OGKmJQ0GBlRMZozsR5gcQvBg==} - '@esbuild/aix-ppc64@0.21.5': - resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - '@esbuild/aix-ppc64@0.23.1': resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.21.5': - resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] + '@esbuild/aix-ppc64@0.24.2': + resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] '@esbuild/android-arm64@0.23.1': resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} @@ -445,10 +465,10 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm@0.21.5': - resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} - engines: {node: '>=12'} - cpu: [arm] + '@esbuild/android-arm64@0.24.2': + resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} + engines: {node: '>=18'} + cpu: [arm64] os: [android] '@esbuild/android-arm@0.23.1': @@ -457,10 +477,10 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-x64@0.21.5': - resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} - engines: {node: '>=12'} - cpu: [x64] + '@esbuild/android-arm@0.24.2': + resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} + engines: {node: '>=18'} + cpu: [arm] os: [android] '@esbuild/android-x64@0.23.1': @@ -469,11 +489,11 @@ packages: cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.21.5': - resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] + '@esbuild/android-x64@0.24.2': + resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] '@esbuild/darwin-arm64@0.23.1': resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} @@ -481,10 +501,10 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.21.5': - resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} - engines: {node: '>=12'} - cpu: [x64] + '@esbuild/darwin-arm64@0.24.2': + resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} + engines: {node: '>=18'} + cpu: [arm64] os: [darwin] '@esbuild/darwin-x64@0.23.1': @@ -493,11 +513,11 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.21.5': - resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] + '@esbuild/darwin-x64@0.24.2': + resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] '@esbuild/freebsd-arm64@0.23.1': resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} @@ -505,10 +525,10 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.21.5': - resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} - engines: {node: '>=12'} - cpu: [x64] + '@esbuild/freebsd-arm64@0.24.2': + resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} + engines: {node: '>=18'} + cpu: [arm64] os: [freebsd] '@esbuild/freebsd-x64@0.23.1': @@ -517,11 +537,11 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.21.5': - resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] + '@esbuild/freebsd-x64@0.24.2': + resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] '@esbuild/linux-arm64@0.23.1': resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} @@ -529,10 +549,10 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.21.5': - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} - engines: {node: '>=12'} - cpu: [arm] + '@esbuild/linux-arm64@0.24.2': + resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} + engines: {node: '>=18'} + cpu: [arm64] os: [linux] '@esbuild/linux-arm@0.23.1': @@ -541,10 +561,10 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.21.5': - resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} - engines: {node: '>=12'} - cpu: [ia32] + '@esbuild/linux-arm@0.24.2': + resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} + engines: {node: '>=18'} + cpu: [arm] os: [linux] '@esbuild/linux-ia32@0.23.1': @@ -553,10 +573,10 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.21.5': - resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} - engines: {node: '>=12'} - cpu: [loong64] + '@esbuild/linux-ia32@0.24.2': + resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} + engines: {node: '>=18'} + cpu: [ia32] os: [linux] '@esbuild/linux-loong64@0.23.1': @@ -565,10 +585,10 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.21.5': - resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} - engines: {node: '>=12'} - cpu: [mips64el] + '@esbuild/linux-loong64@0.24.2': + resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} + engines: {node: '>=18'} + cpu: [loong64] os: [linux] '@esbuild/linux-mips64el@0.23.1': @@ -577,10 +597,10 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.21.5': - resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} - engines: {node: '>=12'} - cpu: [ppc64] + '@esbuild/linux-mips64el@0.24.2': + resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} + engines: {node: '>=18'} + cpu: [mips64el] os: [linux] '@esbuild/linux-ppc64@0.23.1': @@ -589,10 +609,10 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.21.5': - resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} - engines: {node: '>=12'} - cpu: [riscv64] + '@esbuild/linux-ppc64@0.24.2': + resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} + engines: {node: '>=18'} + cpu: [ppc64] os: [linux] '@esbuild/linux-riscv64@0.23.1': @@ -601,10 +621,10 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.21.5': - resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} - engines: {node: '>=12'} - cpu: [s390x] + '@esbuild/linux-riscv64@0.24.2': + resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} + engines: {node: '>=18'} + cpu: [riscv64] os: [linux] '@esbuild/linux-s390x@0.23.1': @@ -613,10 +633,10 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.21.5': - resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} - engines: {node: '>=12'} - cpu: [x64] + '@esbuild/linux-s390x@0.24.2': + resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} + engines: {node: '>=18'} + cpu: [s390x] os: [linux] '@esbuild/linux-x64@0.23.1': @@ -625,10 +645,16 @@ packages: cpu: [x64] os: [linux] - '@esbuild/netbsd-x64@0.21.5': - resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} - engines: {node: '>=12'} + '@esbuild/linux-x64@0.24.2': + resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} + engines: {node: '>=18'} cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.24.2': + resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} + engines: {node: '>=18'} + cpu: [arm64] os: [netbsd] '@esbuild/netbsd-x64@0.23.1': @@ -637,16 +663,22 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.24.2': + resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/openbsd-arm64@0.23.1': resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.21.5': - resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} - engines: {node: '>=12'} - cpu: [x64] + '@esbuild/openbsd-arm64@0.24.2': + resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} + engines: {node: '>=18'} + cpu: [arm64] os: [openbsd] '@esbuild/openbsd-x64@0.23.1': @@ -655,11 +687,11 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.21.5': - resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} - engines: {node: '>=12'} + '@esbuild/openbsd-x64@0.24.2': + resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} + engines: {node: '>=18'} cpu: [x64] - os: [sunos] + os: [openbsd] '@esbuild/sunos-x64@0.23.1': resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} @@ -667,11 +699,11 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.21.5': - resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] + '@esbuild/sunos-x64@0.24.2': + resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] '@esbuild/win32-arm64@0.23.1': resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} @@ -679,10 +711,10 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.21.5': - resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} - engines: {node: '>=12'} - cpu: [ia32] + '@esbuild/win32-arm64@0.24.2': + resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} + engines: {node: '>=18'} + cpu: [arm64] os: [win32] '@esbuild/win32-ia32@0.23.1': @@ -691,10 +723,10 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.21.5': - resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} - engines: {node: '>=12'} - cpu: [x64] + '@esbuild/win32-ia32@0.24.2': + resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} + engines: {node: '>=18'} + cpu: [ia32] os: [win32] '@esbuild/win32-x64@0.23.1': @@ -703,46 +735,52 @@ packages: cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + '@esbuild/win32-x64@0.24.2': + resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@eslint-community/eslint-utils@4.4.1': + resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.1': - resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.18.0': - resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} + '@eslint/config-array@0.19.0': + resolution: {integrity: sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.6.0': - resolution: {integrity: sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==} + '@eslint/core@0.10.0': + resolution: {integrity: sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.1.0': - resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + '@eslint/eslintrc@3.2.0': + resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.12.0': - resolution: {integrity: sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==} + '@eslint/js@9.19.0': + resolution: {integrity: sha512-rbq9/g38qjfqFLOVPvwjIvFFdNziEC5S65jmjPw5r6A//QH+W91akh9irMwjDN8zKUTak6W9EsAv4m/7Wnw0UQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.0': - resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} + '@eslint/plugin-kit@0.2.5': + resolution: {integrity: sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@humanfs/core@0.19.0': - resolution: {integrity: sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==} + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} - '@humanfs/node@0.16.5': - resolution: {integrity: sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==} + '@humanfs/node@0.16.6': + resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} engines: {node: '>=18.18.0'} '@humanwhocodes/module-importer@1.0.1': @@ -753,17 +791,21 @@ packages: resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} - '@iconify-json/codicon@1.2.2': - resolution: {integrity: sha512-ZO63Qy0e+/VBESGHE3CZEE2EFpzlBOTPSiMtIDQc1qIGvh6HpYVRNpEGuawF91oEws7PLuUifCIZL5NpYpKloA==} + '@humanwhocodes/retry@0.4.1': + resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} + engines: {node: '>=18.18'} + + '@iconify-json/codicon@1.2.6': + resolution: {integrity: sha512-F5lBgKRFLHfOVNM8I3ld+JCdmFPxf3V1p/PV7lNHgtvoblaQLLxGKs3AepIcnbkPcACafPbQ0OMorskSk41Ziw==} - '@iconify-json/ph@1.2.0': - resolution: {integrity: sha512-013eLpgTmX1lACOuDnkuhC7gRHyYj9w/j8SyDmlyUYvsKQrwdRsv1otcXtwH3DevuDAzSkreeeRsCeez+gTyVA==} + '@iconify-json/ph@1.2.1': + resolution: {integrity: sha512-x0DNfwWrS18dbsBYOq3XGiZnGz4CgRyC+YSl/TZvMQiKhIUl1woWqUbMYqqfMNUBzjyk7ulvaRovpRsIlqIf8g==} '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} - '@iconify/utils@2.1.33': - resolution: {integrity: sha512-jP9h6v/g0BIZx0p7XGJJVtkVnydtbgTgt9mVNcGDYwaa7UhdHdI9dvoq+gKj9sijMSJKxUPEG2JyjsgXjxL7Kw==} + '@iconify/utils@2.2.1': + resolution: {integrity: sha512-0/7J7hk4PqXmxo5PDBDxmnecw5PxklZJfNjIVG9FM0mEfVrvfudS22rYWsqVk6gR3UJ/mSYS90X4R3znXnqfNA==} '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} @@ -801,8 +843,8 @@ packages: '@polka/url@1.0.0-next.28': resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} - '@rollup/plugin-node-resolve@15.3.0': - resolution: {integrity: sha512-9eO5McEICxMzJpDW9OnMYSv4Sta3hmt7VtBFz5zR9273suNOydOyq/FrGeGy+KsTRFm8w0SLVhzig2ILFT63Ag==} + '@rollup/plugin-node-resolve@16.0.0': + resolution: {integrity: sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.78.0||^3.0.0||^4.0.0 @@ -832,8 +874,8 @@ packages: tslib: optional: true - '@rollup/pluginutils@5.1.2': - resolution: {integrity: sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==} + '@rollup/pluginutils@5.1.4': + resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 @@ -841,166 +883,181 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.22.4': - resolution: {integrity: sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==} + '@rollup/rollup-android-arm-eabi@4.34.6': + resolution: {integrity: sha512-+GcCXtOQoWuC7hhX1P00LqjjIiS/iOouHXhMdiDSnq/1DGTox4SpUvO52Xm+div6+106r+TcvOeo/cxvyEyTgg==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.22.4': - resolution: {integrity: sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==} + '@rollup/rollup-android-arm64@4.34.6': + resolution: {integrity: sha512-E8+2qCIjciYUnCa1AiVF1BkRgqIGW9KzJeesQqVfyRITGQN+dFuoivO0hnro1DjT74wXLRZ7QF8MIbz+luGaJA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.22.4': - resolution: {integrity: sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==} + '@rollup/rollup-darwin-arm64@4.34.6': + resolution: {integrity: sha512-z9Ib+OzqN3DZEjX7PDQMHEhtF+t6Mi2z/ueChQPLS/qUMKY7Ybn5A2ggFoKRNRh1q1T03YTQfBTQCJZiepESAg==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.22.4': - resolution: {integrity: sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==} + '@rollup/rollup-darwin-x64@4.34.6': + resolution: {integrity: sha512-PShKVY4u0FDAR7jskyFIYVyHEPCPnIQY8s5OcXkdU8mz3Y7eXDJPdyM/ZWjkYdR2m0izD9HHWA8sGcXn+Qrsyg==} cpu: [x64] os: [darwin] - '@rollup/rollup-linux-arm-gnueabihf@4.22.4': - resolution: {integrity: sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==} + '@rollup/rollup-freebsd-arm64@4.34.6': + resolution: {integrity: sha512-YSwyOqlDAdKqs0iKuqvRHLN4SrD2TiswfoLfvYXseKbL47ht1grQpq46MSiQAx6rQEN8o8URtpXARCpqabqxGQ==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.34.6': + resolution: {integrity: sha512-HEP4CgPAY1RxXwwL5sPFv6BBM3tVeLnshF03HMhJYCNc6kvSqBgTMmsEjb72RkZBAWIqiPUyF1JpEBv5XT9wKQ==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.34.6': + resolution: {integrity: sha512-88fSzjC5xeH9S2Vg3rPgXJULkHcLYMkh8faix8DX4h4TIAL65ekwuQMA/g2CXq8W+NJC43V6fUpYZNjaX3+IIg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.22.4': - resolution: {integrity: sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==} + '@rollup/rollup-linux-arm-musleabihf@4.34.6': + resolution: {integrity: sha512-wM4ztnutBqYFyvNeR7Av+reWI/enK9tDOTKNF+6Kk2Q96k9bwhDDOlnCUNRPvromlVXo04riSliMBs/Z7RteEg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.22.4': - resolution: {integrity: sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==} + '@rollup/rollup-linux-arm64-gnu@4.34.6': + resolution: {integrity: sha512-9RyprECbRa9zEjXLtvvshhw4CMrRa3K+0wcp3KME0zmBe1ILmvcVHnypZ/aIDXpRyfhSYSuN4EPdCCj5Du8FIA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.22.4': - resolution: {integrity: sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==} + '@rollup/rollup-linux-arm64-musl@4.34.6': + resolution: {integrity: sha512-qTmklhCTyaJSB05S+iSovfo++EwnIEZxHkzv5dep4qoszUMX5Ca4WM4zAVUMbfdviLgCSQOu5oU8YoGk1s6M9Q==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': - resolution: {integrity: sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==} + '@rollup/rollup-linux-loongarch64-gnu@4.34.6': + resolution: {integrity: sha512-4Qmkaps9yqmpjY5pvpkfOerYgKNUGzQpFxV6rnS7c/JfYbDSU0y6WpbbredB5cCpLFGJEqYX40WUmxMkwhWCjw==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.34.6': + resolution: {integrity: sha512-Zsrtux3PuaxuBTX/zHdLaFmcofWGzaWW1scwLU3ZbW/X+hSsFbz9wDIp6XvnT7pzYRl9MezWqEqKy7ssmDEnuQ==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.22.4': - resolution: {integrity: sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==} + '@rollup/rollup-linux-riscv64-gnu@4.34.6': + resolution: {integrity: sha512-aK+Zp+CRM55iPrlyKiU3/zyhgzWBxLVrw2mwiQSYJRobCURb781+XstzvA8Gkjg/hbdQFuDw44aUOxVQFycrAg==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.22.4': - resolution: {integrity: sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==} + '@rollup/rollup-linux-s390x-gnu@4.34.6': + resolution: {integrity: sha512-WoKLVrY9ogmaYPXwTH326+ErlCIgMmsoRSx6bO+l68YgJnlOXhygDYSZe/qbUJCSiCiZAQ+tKm88NcWuUXqOzw==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.22.4': - resolution: {integrity: sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==} + '@rollup/rollup-linux-x64-gnu@4.34.6': + resolution: {integrity: sha512-Sht4aFvmA4ToHd2vFzwMFaQCiYm2lDFho5rPcvPBT5pCdC+GwHG6CMch4GQfmWTQ1SwRKS0dhDYb54khSrjDWw==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.22.4': - resolution: {integrity: sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==} + '@rollup/rollup-linux-x64-musl@4.34.6': + resolution: {integrity: sha512-zmmpOQh8vXc2QITsnCiODCDGXFC8LMi64+/oPpPx5qz3pqv0s6x46ps4xoycfUiVZps5PFn1gksZzo4RGTKT+A==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.22.4': - resolution: {integrity: sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==} + '@rollup/rollup-win32-arm64-msvc@4.34.6': + resolution: {integrity: sha512-3/q1qUsO/tLqGBaD4uXsB6coVGB3usxw3qyeVb59aArCgedSF66MPdgRStUd7vbZOsko/CgVaY5fo2vkvPLWiA==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.22.4': - resolution: {integrity: sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==} + '@rollup/rollup-win32-ia32-msvc@4.34.6': + resolution: {integrity: sha512-oLHxuyywc6efdKVTxvc0135zPrRdtYVjtVD5GUm55I3ODxhU/PwkQFD97z16Xzxa1Fz0AEe4W/2hzRtd+IfpOA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.22.4': - resolution: {integrity: sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==} + '@rollup/rollup-win32-x64-msvc@4.34.6': + resolution: {integrity: sha512-0PVwmgzZ8+TZ9oGBmdZoQVXflbvuwzN/HRclujpl4N/q3i+y0lqLw8n1bXA8ru3sApDjlmONaNAuYr38y1Kr9w==} cpu: [x64] os: [win32] - '@sveltejs/vite-plugin-svelte-inspector@2.1.0': - resolution: {integrity: sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==} - engines: {node: ^18.0.0 || >=20} + '@sveltejs/vite-plugin-svelte-inspector@4.0.1': + resolution: {integrity: sha512-J/Nmb2Q2y7mck2hyCX4ckVHcR5tu2J+MtBEQqpDrrgELZ2uvraQcK/ioCV61AqkdXFgriksOKIceDcQmqnGhVw==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22} peerDependencies: - '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: ^4.0.0 || ^5.0.0-next.0 - vite: ^5.0.0 + '@sveltejs/vite-plugin-svelte': ^5.0.0 + svelte: ^5.0.0 + vite: ^6.0.0 - '@sveltejs/vite-plugin-svelte@3.1.2': - resolution: {integrity: sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==} - engines: {node: ^18.0.0 || >=20} + '@sveltejs/vite-plugin-svelte@5.0.1': + resolution: {integrity: sha512-D5l5+STmywGoLST07T9mrqqFFU+xgv5fqyTWM+VbxTvQ6jujNn4h3lQNCvlwVYs4Erov8i0K5Rwr3LQtmBYmBw==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22} peerDependencies: - svelte: ^4.0.0 || ^5.0.0-next.0 - vite: ^5.0.0 + svelte: ^5.0.0 + vite: ^6.0.0 - '@tauri-apps/api@2.0.1': - resolution: {integrity: sha512-eoQWT+Tq1qSwQpHV+nw1eNYe5B/nm1PoRjQCRiEOS12I1b+X4PUcREfXVX8dPcBT6GrzWGDtaecY0+1p0Rfqlw==} + '@tauri-apps/api@2.2.0': + resolution: {integrity: sha512-R8epOeZl1eJEl603aUMIGb4RXlhPjpgxbGVEaqY+0G5JG9vzV/clNlzTeqc+NLYXVqXcn8mb4c5b9pJIUDEyAg==} - '@tauri-apps/cli-darwin-arm64@2.0.0': - resolution: {integrity: sha512-+agYqg2c77imaMfKw7mzqecVIDGcwr6bZMdglJ808O2UjTFzMwnAam1sU26YBYU+IyIjwOu00fm9Azpal+N/Ew==} + '@tauri-apps/cli-darwin-arm64@2.2.7': + resolution: {integrity: sha512-54kcpxZ3X1Rq+pPTzk3iIcjEVY4yv493uRx/80rLoAA95vAC0c//31Whz75UVddDjJfZvXlXZ3uSZ+bnCOnt0A==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@tauri-apps/cli-darwin-x64@2.0.0': - resolution: {integrity: sha512-keN2PLTTcZmbWwFMup/NGcshmvyLnhRPChO8lbm9C5a0IY7zUNQUD7/o/zIulQdLJqDxkdpWJ1j2jTycAtvtKQ==} + '@tauri-apps/cli-darwin-x64@2.2.7': + resolution: {integrity: sha512-Vgu2XtBWemLnarB+6LqQeLanDlRj7CeFN//H8bVVdjbNzxcSxsvbLYMBP8+3boa7eBnjDrqMImRySSgL6IrwTw==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@tauri-apps/cli-linux-arm-gnueabihf@2.0.0': - resolution: {integrity: sha512-FQJNrlCUBb9E7Fhp5ARy+Or8lSvorG41aVrfi0cGNvv1QlIGSj77TN7SKK+L1jAGzKj1Bl2kCZIESF6Zi8N/+Q==} + '@tauri-apps/cli-linux-arm-gnueabihf@2.2.7': + resolution: {integrity: sha512-+Clha2iQAiK9zoY/KKW0KLHkR0k36O78YLx5Sl98tWkwI3OBZFg5H5WT1plH/4sbZIS2aLFN6dw58/JlY9Bu/g==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - '@tauri-apps/cli-linux-arm64-gnu@2.0.0': - resolution: {integrity: sha512-TK3VrZG5LK1NGueKwnZA1/3gj/qkwry001MNCHXjT6394dwrDv+digCc9Qc569h+xeH/FF71jyoiRIu3gRE6iA==} + '@tauri-apps/cli-linux-arm64-gnu@2.2.7': + resolution: {integrity: sha512-Z/Lp4SQe6BUEOays9BQAEum2pvZF4w9igyXijP+WbkOejZx4cDvarFJ5qXrqSLmBh7vxrdZcLwoLk9U//+yQrg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@tauri-apps/cli-linux-arm64-musl@2.0.0': - resolution: {integrity: sha512-E3hRmS/0m8YUYMTKZtBExpk/284CTi2nymks0dK0L1j+3KjffL7DiilnIfNFmTvWBgMrs0cVCtoaN/ba/A9mNA==} + '@tauri-apps/cli-linux-arm64-musl@2.2.7': + resolution: {integrity: sha512-+8HZ+txff/Y3YjAh80XcLXcX8kpGXVdr1P8AfjLHxHdS6QD4Md+acSxGTTNbplmHuBaSHJvuTvZf9tU1eDCTDg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@tauri-apps/cli-linux-x64-gnu@2.0.0': - resolution: {integrity: sha512-veX4BJp5xnW8KmxVjchWt4oZEIvKGhuSR7qU1WpqTR21e/eTe/ksGsdXPsqOKQvv/w1X6jhqmlPvhnFmDwUJ/w==} + '@tauri-apps/cli-linux-x64-gnu@2.2.7': + resolution: {integrity: sha512-ahlSnuCnUntblp9dG7/w5ZWZOdzRFi3zl0oScgt7GF4KNAOEa7duADsxPA4/FT2hLRa0SvpqtD4IYFvCxoVv3Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@tauri-apps/cli-linux-x64-musl@2.0.0': - resolution: {integrity: sha512-9Eso/8wbsWbOyd9PZEIzN/48ZQJrUGQqGZtglcjUku0lO76mnX0fOnit4nQ57Oj0wezJPhv4mgSseG1OsTIVzw==} + '@tauri-apps/cli-linux-x64-musl@2.2.7': + resolution: {integrity: sha512-+qKAWnJRSX+pjjRbKAQgTdFY8ecdcu8UdJ69i7wn3ZcRn2nMMzOO2LOMOTQV42B7/Q64D1pIpmZj9yblTMvadA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@tauri-apps/cli-win32-arm64-msvc@2.0.0': - resolution: {integrity: sha512-ky8vWAuDUf8WGt9+a0G/EbU0OhdIkogelh9qjIYGHbyEYAJqXfN5P40aHUEg3y8ngQ0YGwRX5ePsQsSZiiR5PQ==} + '@tauri-apps/cli-win32-arm64-msvc@2.2.7': + resolution: {integrity: sha512-aa86nRnrwT04u9D9fhf5JVssuAZlUCCc8AjqQjqODQjMd4BMA2+d4K9qBMpEG/1kVh95vZaNsLogjEaqSTTw4A==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@tauri-apps/cli-win32-ia32-msvc@2.0.0': - resolution: {integrity: sha512-uD45cLZ/EBaT8o4a27tHW7t5UKFplnvDLt/uSUaCpJ3NyOTV6nMXOUrJBe+hH9hSBohqNAF7LEyYo1p932DWFg==} + '@tauri-apps/cli-win32-ia32-msvc@2.2.7': + resolution: {integrity: sha512-EiJ5/25tLSQOSGvv+t6o3ZBfOTKB5S3vb+hHQuKbfmKdRF0XQu2YPdIi1CQw1DU97ZAE0Dq4frvnyYEKWgMzVQ==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] - '@tauri-apps/cli-win32-x64-msvc@2.0.0': - resolution: {integrity: sha512-oFlo14YMsvyhJHmmHgRuOpJ1L9w15193c1Nfj1DksS2LHj6tLzirI7YrAF9inY/XjHFjNHzYPmBpABibkf/9wQ==} + '@tauri-apps/cli-win32-x64-msvc@2.2.7': + resolution: {integrity: sha512-ZB8Kw90j8Ld+9tCWyD2fWCYfIrzbQohJ4DJSidNwbnehlZzP7wAz6Z3xjsvUdKtQ3ibtfoeTqVInzCCEpI+pWg==} engines: {node: '>= 10'} cpu: [x64] os: [win32] - '@tauri-apps/cli@2.0.0': - resolution: {integrity: sha512-xxmPllRa6w/LRRcPczST3yHrYoi8l6ZZmzwabEmM0cgDdhVDmX+Y4oDJkiKD+8cVdxwwEzIuIKuaCwsX8iNsgA==} + '@tauri-apps/cli@2.2.7': + resolution: {integrity: sha512-ZnsS2B4BplwXP37celanNANiIy8TCYhvg5RT09n72uR/o+navFZtGpFSqljV8fy1Y4ixIPds8FrGSXJCN2BerA==} engines: {node: '>= 10'} hasBin: true @@ -1010,9 +1067,6 @@ packages: '@types/eslint__js@8.42.3': resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} - '@types/estree@1.0.5': - resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} @@ -1028,145 +1082,164 @@ packages: '@types/unist@2.0.11': resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} - '@typescript-eslint/eslint-plugin@8.8.0': - resolution: {integrity: sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==} + '@typescript-eslint/eslint-plugin@8.23.0': + resolution: {integrity: sha512-vBz65tJgRrA1Q5gWlRfvoH+w943dq9K1p1yDBY2pc+a1nbBLZp7fB9+Hk8DaALUbzjqlMfgaqlVPT1REJdkt/w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/parser@8.8.0': - resolution: {integrity: sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==} + '@typescript-eslint/parser@8.23.0': + resolution: {integrity: sha512-h2lUByouOXFAlMec2mILeELUbME5SZRN/7R9Cw2RD2lRQQY08MWMM+PmVVKKJNK1aIwqTo9t/0CvOxwPbRIE2Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/scope-manager@8.8.0': - resolution: {integrity: sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==} + '@typescript-eslint/scope-manager@8.23.0': + resolution: {integrity: sha512-OGqo7+dXHqI7Hfm+WqkZjKjsiRtFUQHPdGMXzk5mYXhJUedO7e/Y7i8AK3MyLMgZR93TX4bIzYrfyVjLC+0VSw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.8.0': - resolution: {integrity: sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==} + '@typescript-eslint/type-utils@8.23.0': + resolution: {integrity: sha512-iIuLdYpQWZKbiH+RkCGc6iu+VwscP5rCtQ1lyQ7TYuKLrcZoeJVpcLiG8DliXVkUxirW/PWlmS+d6yD51L9jvA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/types@8.8.0': - resolution: {integrity: sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==} + '@typescript-eslint/types@8.23.0': + resolution: {integrity: sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.8.0': - resolution: {integrity: sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==} + '@typescript-eslint/typescript-estree@8.23.0': + resolution: {integrity: sha512-LcqzfipsB8RTvH8FX24W4UUFk1bl+0yTOf9ZA08XngFwMg4Kj8A+9hwz8Cr/ZS4KwHrmo9PJiLZkOt49vPnuvQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@8.8.0': - resolution: {integrity: sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==} + '@typescript-eslint/utils@8.23.0': + resolution: {integrity: sha512-uB/+PSo6Exu02b5ZEiVtmY6RVYO7YU5xqgzTIVZwTHvvK3HsL8tZZHFaTLFtRG3CsV4A5mhOv+NZx5BlhXPyIA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/visitor-keys@8.8.0': - resolution: {integrity: sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==} + '@typescript-eslint/visitor-keys@8.23.0': + resolution: {integrity: sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@unocss/astro@0.63.1': - resolution: {integrity: sha512-TJISaUIMNPQH0MY0R7f14DO3HF4Z5H3seZazojhbLCOA7gDFV0WpSP84sdx9PsP1fpyYuNsxW9xrwA13bDaJYw==} + '@unocss/astro@65.4.0': + resolution: {integrity: sha512-bLi+H181PJ17E0Br06VwK7yeZffv9X46JCA7pnBlA/g8sDBxB+CwPOFaHlUeqVvis0CEt8HOr/e9418pxqQJTQ==} peerDependencies: - vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 + vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0 peerDependenciesMeta: vite: optional: true - '@unocss/cli@0.63.1': - resolution: {integrity: sha512-DH9JZBL/CecAr7HWXinUSXEnDIVcOkHn4GYuaL4Zn33ZIV9ni20/lHhxJwbnEgv1eCIa3XTAMLCOU9uhpdTKCQ==} + '@unocss/cli@65.4.0': + resolution: {integrity: sha512-g1k24tKs233V2F6EWDCGimke5SjSM59HacCUnc411NSUBqNmPojxPtRWn9vp6XRovQ9X6FdKsuMHmpMotWlTiQ==} engines: {node: '>=14'} hasBin: true - '@unocss/config@0.63.1': - resolution: {integrity: sha512-9n1VDQ3xMpRIdzqvyUhWHA2ur5CWH0Oezw6Rbg/75bk86pD3yMrD8JkP4wK9wgq1pNNEpygmE7jFbDe29r8vVw==} + '@unocss/config@65.4.0': + resolution: {integrity: sha512-7V3zuf+qWVxpy+1EkmyEBiU49fNiFfEUkh0n95IoLAhk9xyfz9a1dRBv20CQLte/OZ/NkD+fB+6J/w8ARn+tow==} engines: {node: '>=14'} - '@unocss/core@0.63.1': - resolution: {integrity: sha512-scg53c6vw8cRsX4DbUO+MlTXicA9GWztm6PW0lsisJxXrdbQQCd+J+PIhrxLUExxeNqxTKsL3Msy9bwJU5uUsQ==} + '@unocss/core@65.4.0': + resolution: {integrity: sha512-UZPvyqS7jj5gRzFeozXG9gOEsGwdbOrQnWjeKLFbfE1upZlG3cwrwIuEl9bqTWNVAtqbpQLyaRiC09YBre52oA==} - '@unocss/extractor-arbitrary-variants@0.63.1': - resolution: {integrity: sha512-yqHDUgFCR4R2HMuD2k4dVkkdT2uOa/gUDIY6xoseOx1r98Fxlyvdr0UnLOaWsSSzpSGm7SS7XtafGa24IgJRUQ==} + '@unocss/extractor-arbitrary-variants@65.4.0': + resolution: {integrity: sha512-uR9zqpu0dqtISuaKxFXgMgcJdPL5XqFsKQbttqkLRnWWv5soaP2Hh/THojZqiHPMctgrDP/2S113QvJkFY4j5w==} - '@unocss/extractor-svelte@0.63.1': - resolution: {integrity: sha512-kqf+3ghZIc/hBT3W6nrvWEBMbAleJIGI4A1GW+K+dovP68T4gFxp7D077VtuC69dZp1foV4HM17QHmphZq1Oiw==} + '@unocss/extractor-svelte@65.4.0': + resolution: {integrity: sha512-hAFFP94dc17Ra6SGUeqVxYuyipLM7Y+1M9cNx+KYe1wO0aa6NSBXNOMiq5iUaMAGWhNqHwLWcNGRNTSxzVD5uQ==} - '@unocss/inspector@0.63.1': - resolution: {integrity: sha512-RO5DWZcnQ964ppaWskECSsx2b6I+dAH6A4YQIZEavG0ykHWwa//TquaY2HJH6OJoI7hKEnrFIFtlwzV5nWoYMw==} + '@unocss/inspector@65.4.0': + resolution: {integrity: sha512-ug72DHjfcerkn/RXeB9GC9GwTi/Dj1R/BlRqy4dJ61ij8OnOl4N/ghAMQCqri59YEYG8CPeL9aQuq66eYcjpPg==} - '@unocss/postcss@0.63.1': - resolution: {integrity: sha512-ZHBy2swGg2zifQ6YEfctagIi+jZrLW/uBHqIkRIQYZyBQjw1GSqx+OSrq81LYIREBSQG7G90Nn1CXu8muttgzg==} + '@unocss/postcss@65.4.0': + resolution: {integrity: sha512-sg2k7B3T8B55QHNqNeOm61RmKE4m2355jxbMCAY1rx/CZCFUTUTI4pd+XY9ekbZjLe84YUlBs4bt62MOlJ58hg==} engines: {node: '>=14'} peerDependencies: postcss: ^8.4.21 - '@unocss/preset-attributify@0.63.1': - resolution: {integrity: sha512-K6IaQ6cUQNWDp6JmAJ8dh17c/iPc9Ssgz6C9qayWwIJCZA3023EXfoXI0a0csnJyRHJALIw2sSZAvlmRudln1A==} + '@unocss/preset-attributify@65.4.0': + resolution: {integrity: sha512-k7UMkCSgjq4yDHMMUxV2C6uj1i63L6iNyRUaYwLrwcRZArVRuamJFaSCWOkpxlYnmYtOdpf9I3WYRFJwDT1Yjw==} - '@unocss/preset-icons@0.63.1': - resolution: {integrity: sha512-ucCLrlQ6DsFzqSu/Cmqo3q/F/ybV+2P/TQflHS9Oo8wtOETxTT0aPEEEd/sj1SPTU9uUbLEeS6TaRD6MrwLcrw==} + '@unocss/preset-icons@65.4.0': + resolution: {integrity: sha512-F50biWPeLw2LtN17y/n75qaZAtpuOotyQPbK7PeihI5lr6Xg9eGWBuLc+AFIPNZZD0JDVMKEjDVOLqXHBnp0zA==} - '@unocss/preset-mini@0.63.1': - resolution: {integrity: sha512-8NW3hK5fp+glBI2v1/3utp+Gv0yXoVTX66531BDDXxivsCJBNRTh40TP8hXSbtDne615UGrykIjyadsUHCRK5Q==} + '@unocss/preset-mini@65.4.0': + resolution: {integrity: sha512-HKwok9pp+gI54RDX4/o6PWNVdCEDfVzT4MsNZO3WvGXhtMLInGrVl42IzkBp22ttkapIkIgXsqcYhBrZbmQrQA==} - '@unocss/preset-tagify@0.63.1': - resolution: {integrity: sha512-GlhWsdD3pYvtMePVNWMOjkQGSp4XKJcfS65spUOZv03h6xrKuCCnJNsawYqbnpTzUOAL29pG/X8Quse00weRjQ==} + '@unocss/preset-tagify@65.4.0': + resolution: {integrity: sha512-spiEh+piBJOmnU7n/P9GLL0Bl4Ttfuew+ahRSJuUK5hgPVTadhSujSrzKvM6S7aonnBuJSscw3cJIybBXoxogQ==} - '@unocss/preset-typography@0.63.1': - resolution: {integrity: sha512-NfC0qQmCeA68F0JeVMKNpCqZhh0X3+1ouEjlRrFGzmIZt5lxWuTFgGroyp5rXv++iubm3CMoW1bMnp8CsyUUYw==} + '@unocss/preset-typography@65.4.0': + resolution: {integrity: sha512-4WR1ht0TAkuOQwkxmPdP0DBXNAs6O2o8e13K5WHseKy5qoanFXO/0EzQ9w8OMlxvsCF2Bpl1KKlicJWAyiSFgA==} - '@unocss/preset-uno@0.63.1': - resolution: {integrity: sha512-L7ptI/kI48+miTv5y7vNE1igw8/ThkWPFICMuhQksQS4QuuysuzO/IjfD5QwPy8Awr9HgSYZLqf5Jaax63HJ5w==} + '@unocss/preset-uno@65.4.0': + resolution: {integrity: sha512-M2VQ7Qt67f5Re2h5FeAbMgS91jk/YBKDZh2T3zNh6OiigQl5L3GKoEvLNq2JtzvCVCxSksQATAspTmbw2Vzi1w==} - '@unocss/preset-web-fonts@0.63.1': - resolution: {integrity: sha512-55DkFZ2/hLYp5cDvxQWElnPgnKj9AjoC/hTgC6JlKjzaafaqKh5Bt45rDKOPiXe2cPMN7A9gURgBgFyARX4nBw==} + '@unocss/preset-web-fonts@65.4.0': + resolution: {integrity: sha512-6WA5lFmgYtZJqyYPVWsKZ7VmorbCLdTJV3JkgwCXLnXXVOs7xrbzYnNyoCTPP8p1rKyR1p/tynNP9Jvn1uYW7g==} - '@unocss/preset-wind@0.63.1': - resolution: {integrity: sha512-L/Pyz55NC55K2+zJX9b3cC23tMZzh/a2jUUfoiJAHudsSPjAvP/PJ31Nc+27FFMbqZXhGQ50CBq8geq51O4PKQ==} + '@unocss/preset-wind@65.4.0': + resolution: {integrity: sha512-LnjEdxqffSoKg8nYJl8vwB1q8666afpYI1M33gExpSV85gyHssfrSEbqq6bYXufHGz5yMkIco+jDeYcXWv18ZA==} - '@unocss/reset@0.63.1': - resolution: {integrity: sha512-gjSF0LeWwkNCYZ4Z/AnQXGCIOPUGL5Ll1IIDfwnKZeFGCj9QmcV1hki4xf/7N8mNHhfP0nYdJpdAfiznhKdkwQ==} + '@unocss/reset@65.4.0': + resolution: {integrity: sha512-SHT5IKWbr1iZm1gswWJy+G0a/tnzIODZxjZGr64JStZn/uy7N9AVs5+Kmnlx2NyhW8VNApxTnAkl035jRejZPw==} - '@unocss/rule-utils@0.63.1': - resolution: {integrity: sha512-z7WQ8lKq7p6sS/6Yl1pStcA2WyxxD7H1i86iXa2orWayW8KtrIJbdCXFYEsj3sOkMKLqpG5w65P+103dO2jUhQ==} + '@unocss/rule-utils@65.4.0': + resolution: {integrity: sha512-Fb2IKg/wQlIBDY3rzVpDxwZ3Ho1ihcbFGEzr17ZM/N5MTrdzAA3GiXA3yzOjOboc/UnqRr2Q5JG8aACLn0lAAw==} engines: {node: '>=14'} - '@unocss/transformer-attributify-jsx@0.63.1': - resolution: {integrity: sha512-c92pv9x6AZ3Zfw5ledP6rzTudWUvVY5HrVSaG3GxO2ofyCFEdHyJ1qLTK7omwnTJZ3rMJ3QplIrPJka1Ftasuw==} + '@unocss/transformer-attributify-jsx@65.4.0': + resolution: {integrity: sha512-c65TpsbxlsByxpX64wmJsybLQTdZaVSGUEW7sGC8I7w60vaJXpdOibvquNTvpEXfIWl3efgA1N6XDPaFtxO7KQ==} - '@unocss/transformer-compile-class@0.63.1': - resolution: {integrity: sha512-OV8nQJf+OEIoqHSsFQPjP/ocOxQc2nnMirB+J7D5e32SqU4Zg4GPWag3E+Pcb4InwZ/OUTPPdecKSPNHgT3CTQ==} + '@unocss/transformer-compile-class@65.4.0': + resolution: {integrity: sha512-0AygkbQI0kCquwB6CNNKvr2NOK8eOhArzKrO0imPcCqJNT2GdaHqVqajrM530ZM56KXjUV70hW3pskX6bkdhzg==} - '@unocss/transformer-directives@0.63.1': - resolution: {integrity: sha512-mWVcQqVXj5OtUzfwc9B2/CRPYVHqkoj+AFfhU8RZ6e1nPgDKtR9JLt0jypTvv/PMo56vPJUTbpBBvXU+vvQwQA==} + '@unocss/transformer-directives@65.4.0': + resolution: {integrity: sha512-vRhuGVCsByWSp6ok7a8dPGFwsFn+gyXKSVmLGWyMY4p+rKaRdYiDHOnWWXbHFEKwHuhTv+mxq7q1wZB3OUkR1A==} - '@unocss/transformer-variant-group@0.63.1': - resolution: {integrity: sha512-Awk9FDpvZM8m9YY46MThYYZ81fY6HVs4pOX22xcbw06J2l8z3WyG5iHIzx0f8vCTNwTekDuxD6vV3UlQKoI+0w==} + '@unocss/transformer-variant-group@65.4.0': + resolution: {integrity: sha512-VsQeMP1J/AU3Dp+qUhv9ATR54jLRGPHiNRXe/byFOU7VhJT/pn9qdtwFJQjpvkcc0ezkRoQSpuhuMCBsHRB/bg==} - '@unocss/vite@0.63.1': - resolution: {integrity: sha512-MUi4gtGYPahDeabXfxq25J9YRUksJPLB+xsU2zn7Rb4ai0wBdi6SsZsjjeHhx7RZEXjse9UG3FGZP6Xhe6erUQ==} + '@unocss/vite@65.4.0': + resolution: {integrity: sha512-9k4dUDvEK9PwttmVXhNWkEO7mH0Gp9hSUJY2CX3q+u40xqT3jx7hG765yfWWI9d/VSvzuv6/SurUul3ORJYA3w==} peerDependencies: - vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 + vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0 + + '@vue/compiler-core@3.5.13': + resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==} + + '@vue/compiler-dom@3.5.13': + resolution: {integrity: sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==} + + '@vue/compiler-sfc@3.5.13': + resolution: {integrity: sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==} + + '@vue/compiler-ssr@3.5.13': + resolution: {integrity: sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==} + + '@vue/reactivity@3.5.13': + resolution: {integrity: sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==} + + '@vue/runtime-core@3.5.13': + resolution: {integrity: sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==} + + '@vue/runtime-dom@3.5.13': + resolution: {integrity: sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==} + + '@vue/server-renderer@3.5.13': + resolution: {integrity: sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==} + peerDependencies: + vue: 3.5.13 + + '@vue/shared@3.5.13': + resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} '@zerodevx/svelte-json-view@1.0.11': resolution: {integrity: sha512-mIjj0H1al/P4FPlbeDoiey93lNEUqBEAe5LIdD5GttZfEYt3awexD2lHwKNfUeY4jHizOJkoWTPN/2iO0GBqpw==} @@ -1182,8 +1255,13 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn-typescript@1.4.13: + resolution: {integrity: sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==} + peerDependencies: + acorn: '>=8.9.0' + + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} hasBin: true @@ -1299,9 +1377,6 @@ packages: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} - code-red@1.0.4: - resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} - color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -1318,11 +1393,11 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - confbox@0.1.7: - resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} - consola@3.2.3: - resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} + consola@3.3.3: + resolution: {integrity: sha512-Qil5KwghMzlqd51UXM0b6fyaGHtOC22scxrwrz4A2882LyUMwQjnvaedN1HAeXzphspQ6CpHkzMAWxBTUruDLg==} engines: {node: ^14.18.0 || >=16.10.0} covector@0.12.3: @@ -1333,23 +1408,22 @@ packages: cross-fetch@3.1.5: resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} - css-tree@2.3.1: - resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} + css-tree@3.1.0: + resolution: {integrity: sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - css-tree@3.0.0: - resolution: {integrity: sha512-o88DVQ6GzsABn1+6+zo2ct801dBO5OASVyxbbvA2W20ue2puSh/VOuqUj90eUeMSX/xqGqBmOKiRQN7tJOuBXw==} - engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} ctrlc-windows@2.1.0: resolution: {integrity: sha512-OrX5KI+K+2NMN91QIhYZdW7VDO2YsSdTZW494pA7Nvw/wBdU2hz+MGP006bR978zOTrG6Q8EIeJvLJmLqc6MsQ==} - debug@4.3.7: - resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} + debug@4.4.0: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -1391,16 +1465,20 @@ packages: emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - esbuild@0.21.5: - resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} - engines: {node: '>=12'} - hasBin: true + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} esbuild@0.23.1: resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} engines: {node: '>=18'} hasBin: true + esbuild@0.24.2: + resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -1409,8 +1487,8 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - eslint-config-prettier@9.1.0: - resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} + eslint-config-prettier@10.0.1: + resolution: {integrity: sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==} hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -1419,20 +1497,20 @@ packages: resolution: {integrity: sha512-XjVGBhtDZJfyuhIxnQ/WMm385RbX3DBu7H1J7HNNhmB2tnGxMeqVSnYv79oAj992ayvIBZghsymwkYFS6cGH4Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint-scope@8.1.0: - resolution: {integrity: sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==} + eslint-scope@8.2.0: + resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.1.0: - resolution: {integrity: sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==} + eslint-visitor-keys@4.2.0: + resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.12.0: - resolution: {integrity: sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==} + eslint@9.19.0: + resolution: {integrity: sha512-ug92j0LepKlbbEv6hD911THhoRHmbdXt2gX+VDABAW/Ir7D3nqKdv5Pf5vtlyY6HQMTEP2skXY43ueqTCWssEA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -1441,14 +1519,20 @@ packages: jiti: optional: true - espree@10.2.0: - resolution: {integrity: sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==} + esm-env@1.2.1: + resolution: {integrity: sha512-U9JedYYjCnadUlXk7e1Kr+aENQhtUaoaV9+gZm1T8LC/YBAPJx3NSPIAurFOC0U5vrdSevnUJS2/wUVxGwPhng==} + + espree@10.3.0: + resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esquery@1.6.0: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} + esrap@1.2.3: + resolution: {integrity: sha512-ZlQmCCK+n7SGoqo7DnfKaP1sJZa49P01/dXzmjCASSo04p72w8EksT2NMK8CEX8DhKsfJXANioIw8VyHNsBfvQ==} + esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} @@ -1460,9 +1544,6 @@ packages: estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - estree-walker@3.0.3: - resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -1501,8 +1582,8 @@ packages: fault@1.0.4: resolution: {integrity: sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==} - fdir@6.3.0: - resolution: {integrity: sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==} + fdir@6.4.2: + resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: @@ -1529,8 +1610,8 @@ packages: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true - flatted@3.3.1: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + flatted@3.3.2: + resolution: {integrity: sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==} format@0.2.2: resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} @@ -1571,6 +1652,10 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} + globals@15.14.0: + resolution: {integrity: sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==} + engines: {node: '>=18'} + globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -1605,8 +1690,8 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} - importx@0.5.0: - resolution: {integrity: sha512-qROz3rSOjQYclmEQAajH9RhBuqpAGHM+5CNd9fk+TsF4JKmQsAI1egafW8XZZv8vARCo4nAmmt5d0eI2B8GUsA==} + importx@0.5.1: + resolution: {integrity: sha512-YrRaigAec1sC2CdIJjf/hCH1Wp9Ii8Cq5ROw4k5nJ19FVl2FcJUHZ5gGIb1vs8+JNYIyOJpc2fcufS2330bxDw==} imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} @@ -1666,8 +1751,8 @@ packages: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} - is-reference@3.0.2: - resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} + is-reference@3.0.3: + resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} is-unicode-supported@0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} @@ -1676,8 +1761,8 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - jiti@2.0.0: - resolution: {integrity: sha512-CJ7e7Abb779OTRv3lomfp7Mns/Sy1+U4pcAx5VbjxCZD5ZM/VJaXPpPjNKjtSvWQy/H86E49REXR34dl1JEz9w==} + jiti@2.4.2: + resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==} hasBin: true js-yaml@4.1.0: @@ -1711,8 +1796,8 @@ packages: resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - local-pkg@0.5.0: - resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} + local-pkg@0.5.1: + resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==} engines: {node: '>=14'} locate-character@3.0.0: @@ -1735,8 +1820,8 @@ packages: longest-streak@2.0.4: resolution: {integrity: sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==} - magic-string@0.30.11: - resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} + magic-string@0.30.17: + resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} mdast-util-from-markdown@0.8.5: resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} @@ -1750,11 +1835,8 @@ packages: mdast-util-to-string@2.0.0: resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} - mdn-data@2.0.30: - resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - - mdn-data@2.10.0: - resolution: {integrity: sha512-qq7C3EtK3yJXMwz1zAab65pjl+UhohqMOctTgcqjLOWABqmwj+me02LSsCuEUxnst9X1lCBpoE0WArGKgdGDzw==} + mdn-data@2.12.2: + resolution: {integrity: sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==} merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -1781,11 +1863,11 @@ packages: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} - mlly@1.7.1: - resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} + mlly@1.7.3: + resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==} - mocha@10.7.3: - resolution: {integrity: sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==} + mocha@10.8.2: + resolution: {integrity: sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==} engines: {node: '>= 14.0.0'} hasBin: true @@ -1796,8 +1878,8 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + nanoid@3.3.8: + resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -1820,8 +1902,8 @@ packages: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - ofetch@1.4.0: - resolution: {integrity: sha512-MuHgsEhU6zGeX+EMh+8mSMrYTnsqJQQrpM00Q6QHMKNqQ0bKy0B43tk8tL1wg+CnsSTy1kg4Ir2T5Ig6rD+dfQ==} + ofetch@1.4.1: + resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==} on-exit-leak-free@2.1.2: resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} @@ -1842,8 +1924,8 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - package-manager-detector@0.2.0: - resolution: {integrity: sha512-E385OSk9qDcXhcM9LNSe4sdhx8a9mAPrZ4sMLW+tmxl5ZuGtPUcdFu+MPP2jbgiWAZ6Pfe5soGFMd+0Db5Vrog==} + package-manager-detector@0.2.6: + resolution: {integrity: sha512-9vPH3qooBlYRJdmdYP00nvjZOulm40r5dhtal8st18ctf+6S1k7pi5yIHLvI4w5D70x0Y+xdVD9qITH0QO/A8A==} parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} @@ -1873,11 +1955,8 @@ packages: perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - periscopic@3.1.0: - resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} - - picocolors@1.1.0: - resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -1890,26 +1969,29 @@ packages: pino-abstract-transport@1.2.0: resolution: {integrity: sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==} + pino-abstract-transport@2.0.0: + resolution: {integrity: sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==} + pino-std-serializers@7.0.0: resolution: {integrity: sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==} - pino@9.4.0: - resolution: {integrity: sha512-nbkQb5+9YPhQRz/BeQmrWpEknAaqjpAqRK8NwJpmrX/JHu7JuZC5G1CeAwJDJfGes4h+YihC6in3Q2nGb+Y09w==} + pino@9.5.0: + resolution: {integrity: sha512-xSEmD4pLnV54t0NOUN16yCl7RIB1c5UUOse5HSyEXtBp+FgFQyPeDutc+Q2ZO7/22vImV7VfEjH/1zV2QuqvYw==} hasBin: true - pkg-types@1.2.0: - resolution: {integrity: sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==} + pkg-types@1.2.1: + resolution: {integrity: sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==} - postcss@8.4.47: - resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} + postcss@8.5.1: + resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.3.3: - resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + prettier@3.4.2: + resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} engines: {node: '>=14'} hasBin: true @@ -1981,8 +2063,8 @@ packages: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rollup@4.22.4: - resolution: {integrity: sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==} + rollup@4.34.6: + resolution: {integrity: sha512-wc2cBWqJgkU3Iz5oztRkQbfVkbxoz5EhnCGOrnJvnLnQ7O0WhQUYyv18qQI79O8L7DdHrrlJNeCHd4VGpnaXKQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -2018,9 +2100,9 @@ packages: shellwords@0.1.1: resolution: {integrity: sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==} - sirv@2.0.4: - resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} - engines: {node: '>= 10'} + sirv@3.0.0: + resolution: {integrity: sha512-BPwJGUeDaDCHihkORDchNyyTvWFhcusy1XMmhEVTQTwGeybFbp8YEmB+njbPnth1FibULBSBVwCQni25XlCUDg==} + engines: {node: '>=18'} sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -2032,8 +2114,8 @@ packages: smob@1.5.0: resolution: {integrity: sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==} - sonic-boom@4.1.0: - resolution: {integrity: sha512-NGipjjRicyJJ03rPiZCJYjwlsuP2d1/5QUviozRXC7S3WdVWNK5e3Ojieb9CCyfhq2UC+3+SRd9nG3I2lPRvUw==} + sonic-boom@4.2.0: + resolution: {integrity: sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==} source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} @@ -2081,32 +2163,23 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - svelte-hmr@0.16.0: - resolution: {integrity: sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==} - engines: {node: ^12.20 || ^14.13.1 || >= 16} - peerDependencies: - svelte: ^3.19.0 || ^4.0.0 - - svelte@4.2.19: - resolution: {integrity: sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==} - engines: {node: '>=16'} + svelte@5.10.0: + resolution: {integrity: sha512-jGJFpB9amHLLQZBbAuQ6csH7WlTvGx4cO4wSSNcgGcx9vDGMTCZzTREf6/wKhVUQDoK+GapgvLQPZHa3e9MOAA==} + engines: {node: '>=18'} - terser@5.34.1: - resolution: {integrity: sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==} + terser@5.36.0: + resolution: {integrity: sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==} engines: {node: '>=10'} hasBin: true - text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - thread-stream@3.1.0: resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==} - tinyexec@0.3.0: - resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} + tinyexec@0.3.1: + resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==} - tinyglobby@0.2.6: - resolution: {integrity: sha512-NbBoFBpqfcgd1tCiO8Lkfdk+xrA7mlLR9zgvZcZWQQwU63XAfUePyd6wZBaU93Hqw347lHnwFzttAkemHzzz4g==} + tinyglobby@0.2.10: + resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} engines: {node: '>=12.0.0'} to-regex-range@5.0.1: @@ -2123,17 +2196,17 @@ packages: trough@1.0.5: resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==} - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} - engines: {node: '>=16'} + ts-api-utils@2.0.1: + resolution: {integrity: sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==} + engines: {node: '>=18.12'} peerDependencies: - typescript: '>=4.2.0' + typescript: '>=4.8.4' - tslib@2.7.0: - resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - tsx@4.19.1: - resolution: {integrity: sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==} + tsx@4.19.2: + resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} engines: {node: '>=18.0.0'} hasBin: true @@ -2145,17 +2218,15 @@ packages: resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} engines: {node: '>=8'} - typescript-eslint@8.8.0: - resolution: {integrity: sha512-BjIT/VwJ8+0rVO01ZQ2ZVnjE1svFBiRczcpr1t1Yxt7sT25VSbPfrJtDsQ8uQTy2pilX5nI9gwxhUyLULNentw==} + typescript-eslint@8.23.0: + resolution: {integrity: sha512-/LBRo3HrXr5LxmrdYSOCvoAMm7p2jNizNfbIpCgvG4HMsnoprRUOce/+8VJ9BDYWW68rqIENE/haVLWPeFZBVQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - typescript@5.6.2: - resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} + typescript@5.7.3: + resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} engines: {node: '>=14.17'} hasBin: true @@ -2171,12 +2242,12 @@ packages: unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} - unocss@0.63.1: - resolution: {integrity: sha512-fVZOT+RCL43yK9enRVVClgh5RT9av8mE6P665cZH+F17hVqDO56q7J7HUqGh9/+zO+omkhYJwUQX4hTPE8J/9g==} + unocss@65.4.0: + resolution: {integrity: sha512-1JO+9YHJ1n0xedOUWfgjJfQXentoxtMuXqR9+kB8I8A9N+PC73KX2YOMjvTia+NSrnSgnCmmnnsUWQqnJZR9fA==} engines: {node: '>=14'} peerDependencies: - '@unocss/webpack': 0.63.1 - vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 + '@unocss/webpack': 65.4.0 + vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0 peerDependenciesMeta: '@unocss/webpack': optional: true @@ -2192,22 +2263,27 @@ packages: vfile@4.2.1: resolution: {integrity: sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==} - vite@5.4.8: - resolution: {integrity: sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==} - engines: {node: ^18.0.0 || >=20.0.0} + vite@6.0.9: + resolution: {integrity: sha512-MSgUxHcaXLtnBPktkbUSoQUANApKYuxZ6DrbVENlIorbhL2dZydTLaZ01tjUoE3szeFzlFk9ANOKk0xurh4MKA==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' less: '*' lightningcss: ^1.21.0 sass: '*' sass-embedded: '*' stylus: '*' sugarss: '*' - terser: ^5.4.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 peerDependenciesMeta: '@types/node': optional: true + jiti: + optional: true less: optional: true lightningcss: @@ -2222,15 +2298,32 @@ packages: optional: true terser: optional: true + tsx: + optional: true + yaml: + optional: true - vitefu@0.2.5: - resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} + vitefu@1.0.4: + resolution: {integrity: sha512-y6zEE3PQf6uu/Mt6DTJ9ih+kyJLr4XcSgHR2zUkM8SWDhuixEJxfJ6CZGMHh1Ec3vPLoEA0IHU5oWzVqw8ulow==} peerDependencies: - vite: ^3.0.0 || ^4.0.0 || ^5.0.0 + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 peerDependenciesMeta: vite: optional: true + vue-flow-layout@0.1.1: + resolution: {integrity: sha512-JdgRRUVrN0Y2GosA0M68DEbKlXMqJ7FQgsK8CjQD2vxvNSqAU6PZEpi4cfcTVtfM2GVOMjHo7GKKLbXxOBqDqA==} + peerDependencies: + vue: ^3.4.37 + + vue@3.5.13: + resolution: {integrity: sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -2284,6 +2377,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zimmerframe@1.1.2: + resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} + zod-validation-error@1.5.0: resolution: {integrity: sha512-/7eFkAI4qV0tcxMBB/3+d2c1P6jzzZYdYSlBuAklzMuCrJu5bzJfHS0yVAS87dRHVlhftd6RFJDIvv03JgkSbw==} engines: {node: '>=16.0.0'} @@ -2305,30 +2401,43 @@ snapshots: '@antfu/install-pkg@0.4.1': dependencies: - package-manager-detector: 0.2.0 - tinyexec: 0.3.0 + package-manager-detector: 0.2.6 + tinyexec: 0.3.1 '@antfu/utils@0.7.10': {} + '@babel/helper-string-parser@7.25.9': {} + + '@babel/helper-validator-identifier@7.25.9': {} + + '@babel/parser@7.26.5': + dependencies: + '@babel/types': 7.26.5 + + '@babel/types@7.26.5': + dependencies: + '@babel/helper-string-parser': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@chainsafe/abort-controller@3.0.1': dependencies: event-target-shim: 5.0.1 - '@clack/core@0.3.4': + '@clack/core@0.3.5': dependencies: - picocolors: 1.1.0 + picocolors: 1.1.1 sisteransi: 1.0.5 '@clack/prompts@0.7.0': dependencies: - '@clack/core': 0.3.4 - picocolors: 1.1.0 + '@clack/core': 0.3.5 + picocolors: 1.1.1 sisteransi: 1.0.5 - '@covector/apply@0.10.0(mocha@10.7.3)': + '@covector/apply@0.10.0(mocha@10.8.2)': dependencies: '@covector/files': 0.8.0 - effection: 2.0.8(mocha@10.7.3) + effection: 2.0.8(mocha@10.8.2) semver: 7.6.3 transitivePeerDependencies: - encoding @@ -2338,7 +2447,7 @@ snapshots: dependencies: '@covector/command': 0.8.0 '@covector/files': 0.8.0 - effection: 2.0.8(mocha@10.7.3) + effection: 2.0.8(mocha@10.8.2) js-yaml: 4.1.0 lodash: 4.17.21 remark-frontmatter: 3.0.0 @@ -2352,7 +2461,7 @@ snapshots: '@covector/changelog@0.12.0': dependencies: '@covector/files': 0.8.0 - effection: 2.0.8(mocha@10.7.3) + effection: 2.0.8(mocha@10.8.2) lodash: 4.17.21 remark-parse: 9.0.0 remark-stringify: 9.0.1 @@ -2364,7 +2473,7 @@ snapshots: '@covector/command@0.8.0': dependencies: '@effection/process': 2.1.4 - effection: 2.0.8(mocha@10.7.3) + effection: 2.0.8(mocha@10.8.2) transitivePeerDependencies: - encoding @@ -2394,10 +2503,10 @@ snapshots: '@effection/core': 2.2.3 '@effection/stream': 2.0.6 - '@effection/fetch@2.0.7(mocha@10.7.3)': + '@effection/fetch@2.0.7(mocha@10.8.2)': dependencies: '@effection/core': 2.2.3 - '@effection/mocha': 2.0.8(mocha@10.7.3) + '@effection/mocha': 2.0.8(mocha@10.8.2) cross-fetch: 3.1.5 transitivePeerDependencies: - encoding @@ -2409,18 +2518,18 @@ snapshots: chalk: 4.1.2 stacktrace-parser: 0.1.10 - '@effection/mocha@2.0.8(mocha@10.7.3)': + '@effection/mocha@2.0.8(mocha@10.8.2)': dependencies: - effection: 2.0.8(mocha@10.7.3) - mocha: 10.7.3 + effection: 2.0.8(mocha@10.8.2) + mocha: 10.8.2 transitivePeerDependencies: - encoding '@effection/process@2.1.4': dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 ctrlc-windows: 2.1.0 - effection: 2.0.8(mocha@10.7.3) + effection: 2.0.8(mocha@10.8.2) shellwords: 0.1.1 transitivePeerDependencies: - encoding @@ -2434,169 +2543,177 @@ snapshots: dependencies: '@effection/core': 2.2.3 - '@esbuild/aix-ppc64@0.21.5': - optional: true - '@esbuild/aix-ppc64@0.23.1': optional: true - '@esbuild/android-arm64@0.21.5': + '@esbuild/aix-ppc64@0.24.2': optional: true '@esbuild/android-arm64@0.23.1': optional: true - '@esbuild/android-arm@0.21.5': + '@esbuild/android-arm64@0.24.2': optional: true '@esbuild/android-arm@0.23.1': optional: true - '@esbuild/android-x64@0.21.5': + '@esbuild/android-arm@0.24.2': optional: true '@esbuild/android-x64@0.23.1': optional: true - '@esbuild/darwin-arm64@0.21.5': + '@esbuild/android-x64@0.24.2': optional: true '@esbuild/darwin-arm64@0.23.1': optional: true - '@esbuild/darwin-x64@0.21.5': + '@esbuild/darwin-arm64@0.24.2': optional: true '@esbuild/darwin-x64@0.23.1': optional: true - '@esbuild/freebsd-arm64@0.21.5': + '@esbuild/darwin-x64@0.24.2': optional: true '@esbuild/freebsd-arm64@0.23.1': optional: true - '@esbuild/freebsd-x64@0.21.5': + '@esbuild/freebsd-arm64@0.24.2': optional: true '@esbuild/freebsd-x64@0.23.1': optional: true - '@esbuild/linux-arm64@0.21.5': + '@esbuild/freebsd-x64@0.24.2': optional: true '@esbuild/linux-arm64@0.23.1': optional: true - '@esbuild/linux-arm@0.21.5': + '@esbuild/linux-arm64@0.24.2': optional: true '@esbuild/linux-arm@0.23.1': optional: true - '@esbuild/linux-ia32@0.21.5': + '@esbuild/linux-arm@0.24.2': optional: true '@esbuild/linux-ia32@0.23.1': optional: true - '@esbuild/linux-loong64@0.21.5': + '@esbuild/linux-ia32@0.24.2': optional: true '@esbuild/linux-loong64@0.23.1': optional: true - '@esbuild/linux-mips64el@0.21.5': + '@esbuild/linux-loong64@0.24.2': optional: true '@esbuild/linux-mips64el@0.23.1': optional: true - '@esbuild/linux-ppc64@0.21.5': + '@esbuild/linux-mips64el@0.24.2': optional: true '@esbuild/linux-ppc64@0.23.1': optional: true - '@esbuild/linux-riscv64@0.21.5': + '@esbuild/linux-ppc64@0.24.2': optional: true '@esbuild/linux-riscv64@0.23.1': optional: true - '@esbuild/linux-s390x@0.21.5': + '@esbuild/linux-riscv64@0.24.2': optional: true '@esbuild/linux-s390x@0.23.1': optional: true - '@esbuild/linux-x64@0.21.5': + '@esbuild/linux-s390x@0.24.2': optional: true '@esbuild/linux-x64@0.23.1': optional: true - '@esbuild/netbsd-x64@0.21.5': + '@esbuild/linux-x64@0.24.2': + optional: true + + '@esbuild/netbsd-arm64@0.24.2': optional: true '@esbuild/netbsd-x64@0.23.1': optional: true + '@esbuild/netbsd-x64@0.24.2': + optional: true + '@esbuild/openbsd-arm64@0.23.1': optional: true - '@esbuild/openbsd-x64@0.21.5': + '@esbuild/openbsd-arm64@0.24.2': optional: true '@esbuild/openbsd-x64@0.23.1': optional: true - '@esbuild/sunos-x64@0.21.5': + '@esbuild/openbsd-x64@0.24.2': optional: true '@esbuild/sunos-x64@0.23.1': optional: true - '@esbuild/win32-arm64@0.21.5': + '@esbuild/sunos-x64@0.24.2': optional: true '@esbuild/win32-arm64@0.23.1': optional: true - '@esbuild/win32-ia32@0.21.5': + '@esbuild/win32-arm64@0.24.2': optional: true '@esbuild/win32-ia32@0.23.1': optional: true - '@esbuild/win32-x64@0.21.5': + '@esbuild/win32-ia32@0.24.2': optional: true '@esbuild/win32-x64@0.23.1': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.12.0(jiti@2.0.0))': + '@esbuild/win32-x64@0.24.2': + optional: true + + '@eslint-community/eslint-utils@4.4.1(eslint@9.19.0(jiti@2.4.2))': dependencies: - eslint: 9.12.0(jiti@2.0.0) + eslint: 9.19.0(jiti@2.4.2) eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.1': {} + '@eslint-community/regexpp@4.12.1': {} - '@eslint/config-array@0.18.0': + '@eslint/config-array@0.19.0': dependencies: '@eslint/object-schema': 2.1.4 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color - '@eslint/core@0.6.0': {} + '@eslint/core@0.10.0': + dependencies: + '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.1.0': + '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.3.7(supports-color@8.1.1) - espree: 10.2.0 + debug: 4.4.0(supports-color@8.1.1) + espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 import-fresh: 3.3.0 @@ -2606,44 +2723,48 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.12.0': {} + '@eslint/js@9.19.0': {} '@eslint/object-schema@2.1.4': {} - '@eslint/plugin-kit@0.2.0': + '@eslint/plugin-kit@0.2.5': dependencies: + '@eslint/core': 0.10.0 levn: 0.4.1 - '@humanfs/core@0.19.0': {} + '@humanfs/core@0.19.1': {} - '@humanfs/node@0.16.5': + '@humanfs/node@0.16.6': dependencies: - '@humanfs/core': 0.19.0 + '@humanfs/core': 0.19.1 '@humanwhocodes/retry': 0.3.1 '@humanwhocodes/module-importer@1.0.1': {} '@humanwhocodes/retry@0.3.1': {} - '@iconify-json/codicon@1.2.2': + '@humanwhocodes/retry@0.4.1': {} + + '@iconify-json/codicon@1.2.6': dependencies: '@iconify/types': 2.0.0 - '@iconify-json/ph@1.2.0': + '@iconify-json/ph@1.2.1': dependencies: '@iconify/types': 2.0.0 '@iconify/types@2.0.0': {} - '@iconify/utils@2.1.33': + '@iconify/utils@2.2.1': dependencies: '@antfu/install-pkg': 0.4.1 '@antfu/utils': 0.7.10 '@iconify/types': 2.0.0 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) + globals: 15.14.0 kolorist: 1.8.0 - local-pkg: 0.5.0 - mlly: 1.7.1 + local-pkg: 0.5.1 + mlly: 1.7.3 transitivePeerDependencies: - supports-color @@ -2683,156 +2804,164 @@ snapshots: '@polka/url@1.0.0-next.28': {} - '@rollup/plugin-node-resolve@15.3.0(rollup@4.22.4)': + '@rollup/plugin-node-resolve@16.0.0(rollup@4.34.6)': dependencies: - '@rollup/pluginutils': 5.1.2(rollup@4.22.4) + '@rollup/pluginutils': 5.1.4(rollup@4.34.6) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: - rollup: 4.22.4 + rollup: 4.34.6 - '@rollup/plugin-terser@0.4.4(rollup@4.22.4)': + '@rollup/plugin-terser@0.4.4(rollup@4.34.6)': dependencies: serialize-javascript: 6.0.2 smob: 1.5.0 - terser: 5.34.1 + terser: 5.36.0 optionalDependencies: - rollup: 4.22.4 + rollup: 4.34.6 - '@rollup/plugin-typescript@11.1.6(rollup@4.22.4)(tslib@2.7.0)(typescript@5.6.2)': + '@rollup/plugin-typescript@11.1.6(rollup@4.34.6)(tslib@2.8.1)(typescript@5.7.3)': dependencies: - '@rollup/pluginutils': 5.1.2(rollup@4.22.4) + '@rollup/pluginutils': 5.1.4(rollup@4.34.6) resolve: 1.22.8 - typescript: 5.6.2 + typescript: 5.7.3 optionalDependencies: - rollup: 4.22.4 - tslib: 2.7.0 + rollup: 4.34.6 + tslib: 2.8.1 - '@rollup/pluginutils@5.1.2(rollup@4.22.4)': + '@rollup/pluginutils@5.1.4(rollup@4.34.6)': dependencies: '@types/estree': 1.0.6 estree-walker: 2.0.2 - picomatch: 2.3.1 + picomatch: 4.0.2 optionalDependencies: - rollup: 4.22.4 + rollup: 4.34.6 + + '@rollup/rollup-android-arm-eabi@4.34.6': + optional: true - '@rollup/rollup-android-arm-eabi@4.22.4': + '@rollup/rollup-android-arm64@4.34.6': optional: true - '@rollup/rollup-android-arm64@4.22.4': + '@rollup/rollup-darwin-arm64@4.34.6': optional: true - '@rollup/rollup-darwin-arm64@4.22.4': + '@rollup/rollup-darwin-x64@4.34.6': optional: true - '@rollup/rollup-darwin-x64@4.22.4': + '@rollup/rollup-freebsd-arm64@4.34.6': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.22.4': + '@rollup/rollup-freebsd-x64@4.34.6': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.22.4': + '@rollup/rollup-linux-arm-gnueabihf@4.34.6': optional: true - '@rollup/rollup-linux-arm64-gnu@4.22.4': + '@rollup/rollup-linux-arm-musleabihf@4.34.6': optional: true - '@rollup/rollup-linux-arm64-musl@4.22.4': + '@rollup/rollup-linux-arm64-gnu@4.34.6': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': + '@rollup/rollup-linux-arm64-musl@4.34.6': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.22.4': + '@rollup/rollup-linux-loongarch64-gnu@4.34.6': optional: true - '@rollup/rollup-linux-s390x-gnu@4.22.4': + '@rollup/rollup-linux-powerpc64le-gnu@4.34.6': optional: true - '@rollup/rollup-linux-x64-gnu@4.22.4': + '@rollup/rollup-linux-riscv64-gnu@4.34.6': optional: true - '@rollup/rollup-linux-x64-musl@4.22.4': + '@rollup/rollup-linux-s390x-gnu@4.34.6': optional: true - '@rollup/rollup-win32-arm64-msvc@4.22.4': + '@rollup/rollup-linux-x64-gnu@4.34.6': optional: true - '@rollup/rollup-win32-ia32-msvc@4.22.4': + '@rollup/rollup-linux-x64-musl@4.34.6': optional: true - '@rollup/rollup-win32-x64-msvc@4.22.4': + '@rollup/rollup-win32-arm64-msvc@4.34.6': optional: true - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)))(svelte@4.2.19)(vite@5.4.8(terser@5.34.1))': + '@rollup/rollup-win32-ia32-msvc@4.34.6': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.34.6': + optional: true + + '@sveltejs/vite-plugin-svelte-inspector@4.0.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2)))(svelte@5.10.0)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)) - debug: 4.3.7(supports-color@8.1.1) - svelte: 4.2.19 - vite: 5.4.8(terser@5.34.1) + '@sveltejs/vite-plugin-svelte': 5.0.1(svelte@5.10.0)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2)) + debug: 4.4.0(supports-color@8.1.1) + svelte: 5.10.0 + vite: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1))': + '@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)))(svelte@4.2.19)(vite@5.4.8(terser@5.34.1)) - debug: 4.3.7(supports-color@8.1.1) + '@sveltejs/vite-plugin-svelte-inspector': 4.0.1(@sveltejs/vite-plugin-svelte@5.0.1(svelte@5.10.0)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2)))(svelte@5.10.0)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2)) + debug: 4.4.0(supports-color@8.1.1) deepmerge: 4.3.1 kleur: 4.1.5 - magic-string: 0.30.11 - svelte: 4.2.19 - svelte-hmr: 0.16.0(svelte@4.2.19) - vite: 5.4.8(terser@5.34.1) - vitefu: 0.2.5(vite@5.4.8(terser@5.34.1)) + magic-string: 0.30.17 + svelte: 5.10.0 + vite: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) + vitefu: 1.0.4(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2)) transitivePeerDependencies: - supports-color - '@tauri-apps/api@2.0.1': {} + '@tauri-apps/api@2.2.0': {} - '@tauri-apps/cli-darwin-arm64@2.0.0': + '@tauri-apps/cli-darwin-arm64@2.2.7': optional: true - '@tauri-apps/cli-darwin-x64@2.0.0': + '@tauri-apps/cli-darwin-x64@2.2.7': optional: true - '@tauri-apps/cli-linux-arm-gnueabihf@2.0.0': + '@tauri-apps/cli-linux-arm-gnueabihf@2.2.7': optional: true - '@tauri-apps/cli-linux-arm64-gnu@2.0.0': + '@tauri-apps/cli-linux-arm64-gnu@2.2.7': optional: true - '@tauri-apps/cli-linux-arm64-musl@2.0.0': + '@tauri-apps/cli-linux-arm64-musl@2.2.7': optional: true - '@tauri-apps/cli-linux-x64-gnu@2.0.0': + '@tauri-apps/cli-linux-x64-gnu@2.2.7': optional: true - '@tauri-apps/cli-linux-x64-musl@2.0.0': + '@tauri-apps/cli-linux-x64-musl@2.2.7': optional: true - '@tauri-apps/cli-win32-arm64-msvc@2.0.0': + '@tauri-apps/cli-win32-arm64-msvc@2.2.7': optional: true - '@tauri-apps/cli-win32-ia32-msvc@2.0.0': + '@tauri-apps/cli-win32-ia32-msvc@2.2.7': optional: true - '@tauri-apps/cli-win32-x64-msvc@2.0.0': + '@tauri-apps/cli-win32-x64-msvc@2.2.7': optional: true - '@tauri-apps/cli@2.0.0': + '@tauri-apps/cli@2.2.7': optionalDependencies: - '@tauri-apps/cli-darwin-arm64': 2.0.0 - '@tauri-apps/cli-darwin-x64': 2.0.0 - '@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0 - '@tauri-apps/cli-linux-arm64-gnu': 2.0.0 - '@tauri-apps/cli-linux-arm64-musl': 2.0.0 - '@tauri-apps/cli-linux-x64-gnu': 2.0.0 - '@tauri-apps/cli-linux-x64-musl': 2.0.0 - '@tauri-apps/cli-win32-arm64-msvc': 2.0.0 - '@tauri-apps/cli-win32-ia32-msvc': 2.0.0 - '@tauri-apps/cli-win32-x64-msvc': 2.0.0 + '@tauri-apps/cli-darwin-arm64': 2.2.7 + '@tauri-apps/cli-darwin-x64': 2.2.7 + '@tauri-apps/cli-linux-arm-gnueabihf': 2.2.7 + '@tauri-apps/cli-linux-arm64-gnu': 2.2.7 + '@tauri-apps/cli-linux-arm64-musl': 2.2.7 + '@tauri-apps/cli-linux-x64-gnu': 2.2.7 + '@tauri-apps/cli-linux-x64-musl': 2.2.7 + '@tauri-apps/cli-win32-arm64-msvc': 2.2.7 + '@tauri-apps/cli-win32-ia32-msvc': 2.2.7 + '@tauri-apps/cli-win32-x64-msvc': 2.2.7 '@types/eslint@9.6.1': dependencies: @@ -2843,8 +2972,6 @@ snapshots: dependencies: '@types/eslint': 9.6.1 - '@types/estree@1.0.5': {} - '@types/estree@1.0.6': {} '@types/json-schema@7.0.15': {} @@ -2857,248 +2984,308 @@ snapshots: '@types/unist@2.0.11': {} - '@typescript-eslint/eslint-plugin@8.8.0(@typescript-eslint/parser@8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2))(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2)': + '@typescript-eslint/eslint-plugin@8.23.0(@typescript-eslint/parser@8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2) - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/type-utils': 8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2) - '@typescript-eslint/utils': 8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.8.0 - eslint: 9.12.0(jiti@2.0.0) + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/scope-manager': 8.23.0 + '@typescript-eslint/type-utils': 8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/utils': 8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.23.0 + eslint: 9.19.0(jiti@2.4.2) graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 + ts-api-utils: 2.0.1(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2)': + '@typescript-eslint/parser@8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.8.0 - debug: 4.3.7(supports-color@8.1.1) - eslint: 9.12.0(jiti@2.0.0) - optionalDependencies: - typescript: 5.6.2 + '@typescript-eslint/scope-manager': 8.23.0 + '@typescript-eslint/types': 8.23.0 + '@typescript-eslint/typescript-estree': 8.23.0(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.23.0 + debug: 4.4.0(supports-color@8.1.1) + eslint: 9.19.0(jiti@2.4.2) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.8.0': + '@typescript-eslint/scope-manager@8.23.0': dependencies: - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/visitor-keys': 8.8.0 + '@typescript-eslint/types': 8.23.0 + '@typescript-eslint/visitor-keys': 8.23.0 - '@typescript-eslint/type-utils@8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2)': + '@typescript-eslint/type-utils@8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) - '@typescript-eslint/utils': 8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2) - debug: 4.3.7(supports-color@8.1.1) - ts-api-utils: 1.3.0(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 + '@typescript-eslint/typescript-estree': 8.23.0(typescript@5.7.3) + '@typescript-eslint/utils': 8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + debug: 4.4.0(supports-color@8.1.1) + eslint: 9.19.0(jiti@2.4.2) + ts-api-utils: 2.0.1(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - - eslint - supports-color - '@typescript-eslint/types@8.8.0': {} + '@typescript-eslint/types@8.23.0': {} - '@typescript-eslint/typescript-estree@8.8.0(typescript@5.6.2)': + '@typescript-eslint/typescript-estree@8.23.0(typescript@5.7.3)': dependencies: - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/visitor-keys': 8.8.0 - debug: 4.3.7(supports-color@8.1.1) + '@typescript-eslint/types': 8.23.0 + '@typescript-eslint/visitor-keys': 8.23.0 + debug: 4.4.0(supports-color@8.1.1) fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 + ts-api-utils: 2.0.1(typescript@5.7.3) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2)': + '@typescript-eslint/utils@8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0(jiti@2.0.0)) - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) - eslint: 9.12.0(jiti@2.0.0) + '@eslint-community/eslint-utils': 4.4.1(eslint@9.19.0(jiti@2.4.2)) + '@typescript-eslint/scope-manager': 8.23.0 + '@typescript-eslint/types': 8.23.0 + '@typescript-eslint/typescript-estree': 8.23.0(typescript@5.7.3) + eslint: 9.19.0(jiti@2.4.2) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - - typescript - '@typescript-eslint/visitor-keys@8.8.0': + '@typescript-eslint/visitor-keys@8.23.0': dependencies: - '@typescript-eslint/types': 8.8.0 - eslint-visitor-keys: 3.4.3 + '@typescript-eslint/types': 8.23.0 + eslint-visitor-keys: 4.2.0 - '@unocss/astro@0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1))': + '@unocss/astro@65.4.0(rollup@4.34.6)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.7.3))': dependencies: - '@unocss/core': 0.63.1 - '@unocss/reset': 0.63.1 - '@unocss/vite': 0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)) + '@unocss/core': 65.4.0 + '@unocss/reset': 65.4.0 + '@unocss/vite': 65.4.0(rollup@4.34.6)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.7.3)) optionalDependencies: - vite: 5.4.8(terser@5.34.1) + vite: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) transitivePeerDependencies: - rollup - supports-color + - vue - '@unocss/cli@0.63.1(rollup@4.22.4)': + '@unocss/cli@65.4.0(rollup@4.34.6)': dependencies: '@ampproject/remapping': 2.3.0 - '@rollup/pluginutils': 5.1.2(rollup@4.22.4) - '@unocss/config': 0.63.1 - '@unocss/core': 0.63.1 - '@unocss/preset-uno': 0.63.1 + '@rollup/pluginutils': 5.1.4(rollup@4.34.6) + '@unocss/config': 65.4.0 + '@unocss/core': 65.4.0 + '@unocss/preset-uno': 65.4.0 cac: 6.7.14 chokidar: 3.6.0 colorette: 2.0.20 - consola: 3.2.3 - magic-string: 0.30.11 + consola: 3.3.3 + magic-string: 0.30.17 pathe: 1.1.2 perfect-debounce: 1.0.0 - tinyglobby: 0.2.6 + tinyglobby: 0.2.10 transitivePeerDependencies: - rollup - supports-color - '@unocss/config@0.63.1': + '@unocss/config@65.4.0': dependencies: - '@unocss/core': 0.63.1 + '@unocss/core': 65.4.0 unconfig: 0.6.0 transitivePeerDependencies: - supports-color - '@unocss/core@0.63.1': {} + '@unocss/core@65.4.0': {} - '@unocss/extractor-arbitrary-variants@0.63.1': + '@unocss/extractor-arbitrary-variants@65.4.0': dependencies: - '@unocss/core': 0.63.1 + '@unocss/core': 65.4.0 - '@unocss/extractor-svelte@0.63.1': {} + '@unocss/extractor-svelte@65.4.0': {} - '@unocss/inspector@0.63.1': + '@unocss/inspector@65.4.0(vue@3.5.13(typescript@5.7.3))': dependencies: - '@unocss/core': 0.63.1 - '@unocss/rule-utils': 0.63.1 + '@unocss/core': 65.4.0 + '@unocss/rule-utils': 65.4.0 + colorette: 2.0.20 gzip-size: 6.0.0 - sirv: 2.0.4 + sirv: 3.0.0 + vue-flow-layout: 0.1.1(vue@3.5.13(typescript@5.7.3)) + transitivePeerDependencies: + - vue - '@unocss/postcss@0.63.1(postcss@8.4.47)': + '@unocss/postcss@65.4.0(postcss@8.5.1)': dependencies: - '@unocss/config': 0.63.1 - '@unocss/core': 0.63.1 - '@unocss/rule-utils': 0.63.1 - css-tree: 3.0.0 - postcss: 8.4.47 - tinyglobby: 0.2.6 + '@unocss/config': 65.4.0 + '@unocss/core': 65.4.0 + '@unocss/rule-utils': 65.4.0 + css-tree: 3.1.0 + postcss: 8.5.1 + tinyglobby: 0.2.10 transitivePeerDependencies: - supports-color - '@unocss/preset-attributify@0.63.1': + '@unocss/preset-attributify@65.4.0': dependencies: - '@unocss/core': 0.63.1 + '@unocss/core': 65.4.0 - '@unocss/preset-icons@0.63.1': + '@unocss/preset-icons@65.4.0': dependencies: - '@iconify/utils': 2.1.33 - '@unocss/core': 0.63.1 - ofetch: 1.4.0 + '@iconify/utils': 2.2.1 + '@unocss/core': 65.4.0 + ofetch: 1.4.1 transitivePeerDependencies: - supports-color - '@unocss/preset-mini@0.63.1': + '@unocss/preset-mini@65.4.0': dependencies: - '@unocss/core': 0.63.1 - '@unocss/extractor-arbitrary-variants': 0.63.1 - '@unocss/rule-utils': 0.63.1 + '@unocss/core': 65.4.0 + '@unocss/extractor-arbitrary-variants': 65.4.0 + '@unocss/rule-utils': 65.4.0 - '@unocss/preset-tagify@0.63.1': + '@unocss/preset-tagify@65.4.0': dependencies: - '@unocss/core': 0.63.1 + '@unocss/core': 65.4.0 - '@unocss/preset-typography@0.63.1': + '@unocss/preset-typography@65.4.0': dependencies: - '@unocss/core': 0.63.1 - '@unocss/preset-mini': 0.63.1 + '@unocss/core': 65.4.0 + '@unocss/preset-mini': 65.4.0 - '@unocss/preset-uno@0.63.1': + '@unocss/preset-uno@65.4.0': dependencies: - '@unocss/core': 0.63.1 - '@unocss/preset-mini': 0.63.1 - '@unocss/preset-wind': 0.63.1 - '@unocss/rule-utils': 0.63.1 + '@unocss/core': 65.4.0 + '@unocss/preset-mini': 65.4.0 + '@unocss/preset-wind': 65.4.0 + '@unocss/rule-utils': 65.4.0 - '@unocss/preset-web-fonts@0.63.1': + '@unocss/preset-web-fonts@65.4.0': dependencies: - '@unocss/core': 0.63.1 - ofetch: 1.4.0 + '@unocss/core': 65.4.0 + ofetch: 1.4.1 - '@unocss/preset-wind@0.63.1': + '@unocss/preset-wind@65.4.0': dependencies: - '@unocss/core': 0.63.1 - '@unocss/preset-mini': 0.63.1 - '@unocss/rule-utils': 0.63.1 + '@unocss/core': 65.4.0 + '@unocss/preset-mini': 65.4.0 + '@unocss/rule-utils': 65.4.0 - '@unocss/reset@0.63.1': {} + '@unocss/reset@65.4.0': {} - '@unocss/rule-utils@0.63.1': + '@unocss/rule-utils@65.4.0': dependencies: - '@unocss/core': 0.63.1 - magic-string: 0.30.11 + '@unocss/core': 65.4.0 + magic-string: 0.30.17 - '@unocss/transformer-attributify-jsx@0.63.1': + '@unocss/transformer-attributify-jsx@65.4.0': dependencies: - '@unocss/core': 0.63.1 + '@unocss/core': 65.4.0 - '@unocss/transformer-compile-class@0.63.1': + '@unocss/transformer-compile-class@65.4.0': dependencies: - '@unocss/core': 0.63.1 + '@unocss/core': 65.4.0 - '@unocss/transformer-directives@0.63.1': + '@unocss/transformer-directives@65.4.0': dependencies: - '@unocss/core': 0.63.1 - '@unocss/rule-utils': 0.63.1 - css-tree: 3.0.0 + '@unocss/core': 65.4.0 + '@unocss/rule-utils': 65.4.0 + css-tree: 3.1.0 - '@unocss/transformer-variant-group@0.63.1': + '@unocss/transformer-variant-group@65.4.0': dependencies: - '@unocss/core': 0.63.1 + '@unocss/core': 65.4.0 - '@unocss/vite@0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1))': + '@unocss/vite@65.4.0(rollup@4.34.6)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.7.3))': dependencies: '@ampproject/remapping': 2.3.0 - '@rollup/pluginutils': 5.1.2(rollup@4.22.4) - '@unocss/config': 0.63.1 - '@unocss/core': 0.63.1 - '@unocss/inspector': 0.63.1 + '@rollup/pluginutils': 5.1.4(rollup@4.34.6) + '@unocss/config': 65.4.0 + '@unocss/core': 65.4.0 + '@unocss/inspector': 65.4.0(vue@3.5.13(typescript@5.7.3)) chokidar: 3.6.0 - magic-string: 0.30.11 - tinyglobby: 0.2.6 - vite: 5.4.8(terser@5.34.1) + magic-string: 0.30.17 + tinyglobby: 0.2.10 + vite: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) transitivePeerDependencies: - rollup - supports-color + - vue + + '@vue/compiler-core@3.5.13': + dependencies: + '@babel/parser': 7.26.5 + '@vue/shared': 3.5.13 + entities: 4.5.0 + estree-walker: 2.0.2 + source-map-js: 1.2.1 + + '@vue/compiler-dom@3.5.13': + dependencies: + '@vue/compiler-core': 3.5.13 + '@vue/shared': 3.5.13 + + '@vue/compiler-sfc@3.5.13': + dependencies: + '@babel/parser': 7.26.5 + '@vue/compiler-core': 3.5.13 + '@vue/compiler-dom': 3.5.13 + '@vue/compiler-ssr': 3.5.13 + '@vue/shared': 3.5.13 + estree-walker: 2.0.2 + magic-string: 0.30.17 + postcss: 8.5.1 + source-map-js: 1.2.1 + + '@vue/compiler-ssr@3.5.13': + dependencies: + '@vue/compiler-dom': 3.5.13 + '@vue/shared': 3.5.13 - '@zerodevx/svelte-json-view@1.0.11(svelte@4.2.19)': + '@vue/reactivity@3.5.13': dependencies: - svelte: 4.2.19 + '@vue/shared': 3.5.13 + + '@vue/runtime-core@3.5.13': + dependencies: + '@vue/reactivity': 3.5.13 + '@vue/shared': 3.5.13 + + '@vue/runtime-dom@3.5.13': + dependencies: + '@vue/reactivity': 3.5.13 + '@vue/runtime-core': 3.5.13 + '@vue/shared': 3.5.13 + csstype: 3.1.3 + + '@vue/server-renderer@3.5.13(vue@3.5.13(typescript@5.7.3))': + dependencies: + '@vue/compiler-ssr': 3.5.13 + '@vue/shared': 3.5.13 + vue: 3.5.13(typescript@5.7.3) + + '@vue/shared@3.5.13': {} + + '@zerodevx/svelte-json-view@1.0.11(svelte@5.10.0)': + dependencies: + svelte: 5.10.0 abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 - acorn-jsx@5.3.2(acorn@8.12.1): + acorn-jsx@5.3.2(acorn@8.14.0): dependencies: - acorn: 8.12.1 + acorn: 8.14.0 - acorn@8.12.1: {} + acorn-typescript@1.4.13(acorn@8.14.0): + dependencies: + acorn: 8.14.0 + + acorn@8.14.0: {} ajv@6.12.6: dependencies: @@ -3160,9 +3347,9 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - bundle-require@5.0.0(esbuild@0.23.1): + bundle-require@5.0.0(esbuild@0.24.2): dependencies: - esbuild: 0.23.1 + esbuild: 0.24.2 load-tsconfig: 0.2.5 cac@6.7.14: {} @@ -3206,14 +3393,6 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - code-red@1.0.4: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - '@types/estree': 1.0.6 - acorn: 8.12.1 - estree-walker: 3.0.3 - periscopic: 3.1.0 - color-convert@2.0.1: dependencies: color-name: 1.1.4 @@ -3226,23 +3405,23 @@ snapshots: concat-map@0.0.1: {} - confbox@0.1.7: {} + confbox@0.1.8: {} - consola@3.2.3: {} + consola@3.3.3: {} - covector@0.12.3(mocha@10.7.3): + covector@0.12.3(mocha@10.8.2): dependencies: '@clack/prompts': 0.7.0 - '@covector/apply': 0.10.0(mocha@10.7.3) + '@covector/apply': 0.10.0(mocha@10.8.2) '@covector/assemble': 0.12.0 '@covector/changelog': 0.12.0 '@covector/command': 0.8.0 '@covector/files': 0.8.0 - effection: 2.0.8(mocha@10.7.3) + effection: 2.0.8(mocha@10.8.2) globby: 11.1.0 js-yaml: 4.1.0 lodash: 4.17.21 - pino: 9.4.0 + pino: 9.5.0 pino-abstract-transport: 1.2.0 strip-ansi: 6.0.1 yargs: 17.7.2 @@ -3257,25 +3436,22 @@ snapshots: transitivePeerDependencies: - encoding - cross-spawn@7.0.3: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - css-tree@2.3.1: + css-tree@3.1.0: dependencies: - mdn-data: 2.0.30 + mdn-data: 2.12.2 source-map-js: 1.2.1 - css-tree@3.0.0: - dependencies: - mdn-data: 2.10.0 - source-map-js: 1.2.1 + csstype@3.1.3: {} ctrlc-windows@2.1.0: {} - debug@4.3.7(supports-color@8.1.1): + debug@4.4.0(supports-color@8.1.1): dependencies: ms: 2.1.3 optionalDependencies: @@ -3299,12 +3475,12 @@ snapshots: duplexer@0.1.2: {} - effection@2.0.8(mocha@10.7.3): + effection@2.0.8(mocha@10.8.2): dependencies: '@effection/channel': 2.0.6 '@effection/core': 2.2.3 '@effection/events': 2.0.6 - '@effection/fetch': 2.0.7(mocha@10.7.3) + '@effection/fetch': 2.0.7(mocha@10.8.2) '@effection/main': 2.1.2 '@effection/stream': 2.0.6 '@effection/subscription': 2.0.6 @@ -3314,31 +3490,7 @@ snapshots: emoji-regex@8.0.0: {} - esbuild@0.21.5: - optionalDependencies: - '@esbuild/aix-ppc64': 0.21.5 - '@esbuild/android-arm': 0.21.5 - '@esbuild/android-arm64': 0.21.5 - '@esbuild/android-x64': 0.21.5 - '@esbuild/darwin-arm64': 0.21.5 - '@esbuild/darwin-x64': 0.21.5 - '@esbuild/freebsd-arm64': 0.21.5 - '@esbuild/freebsd-x64': 0.21.5 - '@esbuild/linux-arm': 0.21.5 - '@esbuild/linux-arm64': 0.21.5 - '@esbuild/linux-ia32': 0.21.5 - '@esbuild/linux-loong64': 0.21.5 - '@esbuild/linux-mips64el': 0.21.5 - '@esbuild/linux-ppc64': 0.21.5 - '@esbuild/linux-riscv64': 0.21.5 - '@esbuild/linux-s390x': 0.21.5 - '@esbuild/linux-x64': 0.21.5 - '@esbuild/netbsd-x64': 0.21.5 - '@esbuild/openbsd-x64': 0.21.5 - '@esbuild/sunos-x64': 0.21.5 - '@esbuild/win32-arm64': 0.21.5 - '@esbuild/win32-ia32': 0.21.5 - '@esbuild/win32-x64': 0.21.5 + entities@4.5.0: {} esbuild@0.23.1: optionalDependencies: @@ -3367,49 +3519,77 @@ snapshots: '@esbuild/win32-ia32': 0.23.1 '@esbuild/win32-x64': 0.23.1 + esbuild@0.24.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.24.2 + '@esbuild/android-arm': 0.24.2 + '@esbuild/android-arm64': 0.24.2 + '@esbuild/android-x64': 0.24.2 + '@esbuild/darwin-arm64': 0.24.2 + '@esbuild/darwin-x64': 0.24.2 + '@esbuild/freebsd-arm64': 0.24.2 + '@esbuild/freebsd-x64': 0.24.2 + '@esbuild/linux-arm': 0.24.2 + '@esbuild/linux-arm64': 0.24.2 + '@esbuild/linux-ia32': 0.24.2 + '@esbuild/linux-loong64': 0.24.2 + '@esbuild/linux-mips64el': 0.24.2 + '@esbuild/linux-ppc64': 0.24.2 + '@esbuild/linux-riscv64': 0.24.2 + '@esbuild/linux-s390x': 0.24.2 + '@esbuild/linux-x64': 0.24.2 + '@esbuild/netbsd-arm64': 0.24.2 + '@esbuild/netbsd-x64': 0.24.2 + '@esbuild/openbsd-arm64': 0.24.2 + '@esbuild/openbsd-x64': 0.24.2 + '@esbuild/sunos-x64': 0.24.2 + '@esbuild/win32-arm64': 0.24.2 + '@esbuild/win32-ia32': 0.24.2 + '@esbuild/win32-x64': 0.24.2 + escalade@3.2.0: {} escape-string-regexp@4.0.0: {} - eslint-config-prettier@9.1.0(eslint@9.12.0(jiti@2.0.0)): + eslint-config-prettier@10.0.1(eslint@9.19.0(jiti@2.4.2)): dependencies: - eslint: 9.12.0(jiti@2.0.0) + eslint: 9.19.0(jiti@2.4.2) eslint-plugin-security@3.0.1: dependencies: safe-regex: 2.1.1 - eslint-scope@8.1.0: + eslint-scope@8.2.0: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.1.0: {} + eslint-visitor-keys@4.2.0: {} - eslint@9.12.0(jiti@2.0.0): + eslint@9.19.0(jiti@2.4.2): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0(jiti@2.0.0)) - '@eslint-community/regexpp': 4.11.1 - '@eslint/config-array': 0.18.0 - '@eslint/core': 0.6.0 - '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.12.0 - '@eslint/plugin-kit': 0.2.0 - '@humanfs/node': 0.16.5 + '@eslint-community/eslint-utils': 4.4.1(eslint@9.19.0(jiti@2.4.2)) + '@eslint-community/regexpp': 4.12.1 + '@eslint/config-array': 0.19.0 + '@eslint/core': 0.10.0 + '@eslint/eslintrc': 3.2.0 + '@eslint/js': 9.19.0 + '@eslint/plugin-kit': 0.2.5 + '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/retry': 0.4.1 '@types/estree': 1.0.6 '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.7(supports-color@8.1.1) + cross-spawn: 7.0.6 + debug: 4.4.0(supports-color@8.1.1) escape-string-regexp: 4.0.0 - eslint-scope: 8.1.0 - eslint-visitor-keys: 4.1.0 - espree: 10.2.0 + eslint-scope: 8.2.0 + eslint-visitor-keys: 4.2.0 + espree: 10.3.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -3424,22 +3604,28 @@ snapshots: minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.4 - text-table: 0.2.0 optionalDependencies: - jiti: 2.0.0 + jiti: 2.4.2 transitivePeerDependencies: - supports-color - espree@10.2.0: + esm-env@1.2.1: {} + + espree@10.3.0: dependencies: - acorn: 8.12.1 - acorn-jsx: 5.3.2(acorn@8.12.1) - eslint-visitor-keys: 4.1.0 + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) + eslint-visitor-keys: 4.2.0 esquery@1.6.0: dependencies: estraverse: 5.3.0 + esrap@1.2.3: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + '@types/estree': 1.0.6 + esrecurse@4.3.0: dependencies: estraverse: 5.3.0 @@ -3448,10 +3634,6 @@ snapshots: estree-walker@2.0.2: {} - estree-walker@3.0.3: - dependencies: - '@types/estree': 1.0.6 - esutils@2.0.3: {} event-target-shim@5.0.1: {} @@ -3484,7 +3666,7 @@ snapshots: dependencies: format: 0.2.2 - fdir@6.3.0(picomatch@4.0.2): + fdir@6.4.2(picomatch@4.0.2): optionalDependencies: picomatch: 4.0.2 @@ -3503,12 +3685,12 @@ snapshots: flat-cache@4.0.1: dependencies: - flatted: 3.3.1 + flatted: 3.3.2 keyv: 4.5.4 flat@5.0.2: {} - flatted@3.3.1: {} + flatted@3.3.2: {} format@0.2.2: {} @@ -3543,6 +3725,8 @@ snapshots: globals@14.0.0: {} + globals@15.14.0: {} + globby@11.1.0: dependencies: array-union: 2.1.0 @@ -3575,14 +3759,14 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 - importx@0.5.0: + importx@0.5.1: dependencies: - bundle-require: 5.0.0(esbuild@0.23.1) - debug: 4.3.7(supports-color@8.1.1) - esbuild: 0.23.1 - jiti: 2.0.0 + bundle-require: 5.0.0(esbuild@0.24.2) + debug: 4.4.0(supports-color@8.1.1) + esbuild: 0.24.2 + jiti: 2.4.2 pathe: 1.1.2 - tsx: 4.19.1 + tsx: 4.19.2 transitivePeerDependencies: - supports-color @@ -3630,7 +3814,7 @@ snapshots: is-plain-obj@2.1.0: {} - is-reference@3.0.2: + is-reference@3.0.3: dependencies: '@types/estree': 1.0.6 @@ -3638,7 +3822,7 @@ snapshots: isexe@2.0.0: {} - jiti@2.0.0: {} + jiti@2.4.2: {} js-yaml@4.1.0: dependencies: @@ -3665,10 +3849,10 @@ snapshots: load-tsconfig@0.2.5: {} - local-pkg@0.5.0: + local-pkg@0.5.1: dependencies: - mlly: 1.7.1 - pkg-types: 1.2.0 + mlly: 1.7.3 + pkg-types: 1.2.1 locate-character@3.0.0: {} @@ -3687,7 +3871,7 @@ snapshots: longest-streak@2.0.4: {} - magic-string@0.30.11: + magic-string@0.30.17: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -3716,9 +3900,7 @@ snapshots: mdast-util-to-string@2.0.0: {} - mdn-data@2.0.30: {} - - mdn-data@2.10.0: {} + mdn-data@2.12.2: {} merge2@1.4.1: {} @@ -3728,7 +3910,7 @@ snapshots: micromark@2.11.4: dependencies: - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) parse-entities: 2.0.0 transitivePeerDependencies: - supports-color @@ -3750,19 +3932,19 @@ snapshots: dependencies: brace-expansion: 2.0.1 - mlly@1.7.1: + mlly@1.7.3: dependencies: - acorn: 8.12.1 + acorn: 8.14.0 pathe: 1.1.2 - pkg-types: 1.2.0 + pkg-types: 1.2.1 ufo: 1.5.4 - mocha@10.7.3: + mocha@10.8.2: dependencies: ansi-colors: 4.1.3 browser-stdout: 1.3.1 chokidar: 3.6.0 - debug: 4.3.7(supports-color@8.1.1) + debug: 4.4.0(supports-color@8.1.1) diff: 5.2.0 escape-string-regexp: 4.0.0 find-up: 5.0.0 @@ -3784,7 +3966,7 @@ snapshots: ms@2.1.3: {} - nanoid@3.3.7: {} + nanoid@3.3.8: {} natural-compare@1.4.0: {} @@ -3796,7 +3978,7 @@ snapshots: normalize-path@3.0.0: {} - ofetch@1.4.0: + ofetch@1.4.1: dependencies: destr: 2.0.3 node-fetch-native: 1.6.4 @@ -3825,7 +4007,7 @@ snapshots: dependencies: p-limit: 3.1.0 - package-manager-detector@0.2.0: {} + package-manager-detector@0.2.6: {} parent-module@1.0.1: dependencies: @@ -3852,13 +4034,7 @@ snapshots: perfect-debounce@1.0.0: {} - periscopic@3.1.0: - dependencies: - '@types/estree': 1.0.6 - estree-walker: 3.0.3 - is-reference: 3.0.2 - - picocolors@1.1.0: {} + picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -3869,37 +4045,41 @@ snapshots: readable-stream: 4.5.2 split2: 4.2.0 + pino-abstract-transport@2.0.0: + dependencies: + split2: 4.2.0 + pino-std-serializers@7.0.0: {} - pino@9.4.0: + pino@9.5.0: dependencies: atomic-sleep: 1.0.0 fast-redact: 3.5.0 on-exit-leak-free: 2.1.2 - pino-abstract-transport: 1.2.0 + pino-abstract-transport: 2.0.0 pino-std-serializers: 7.0.0 process-warning: 4.0.0 quick-format-unescaped: 4.0.4 real-require: 0.2.0 safe-stable-stringify: 2.5.0 - sonic-boom: 4.1.0 + sonic-boom: 4.2.0 thread-stream: 3.1.0 - pkg-types@1.2.0: + pkg-types@1.2.1: dependencies: - confbox: 0.1.7 - mlly: 1.7.1 + confbox: 0.1.8 + mlly: 1.7.3 pathe: 1.1.2 - postcss@8.4.47: + postcss@8.5.1: dependencies: - nanoid: 3.3.7 - picocolors: 1.1.0 + nanoid: 3.3.8 + picocolors: 1.1.1 source-map-js: 1.2.1 prelude-ls@1.2.1: {} - prettier@3.3.3: {} + prettier@3.4.2: {} process-warning@4.0.0: {} @@ -3962,26 +4142,29 @@ snapshots: reusify@1.0.4: {} - rollup@4.22.4: + rollup@4.34.6: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.22.4 - '@rollup/rollup-android-arm64': 4.22.4 - '@rollup/rollup-darwin-arm64': 4.22.4 - '@rollup/rollup-darwin-x64': 4.22.4 - '@rollup/rollup-linux-arm-gnueabihf': 4.22.4 - '@rollup/rollup-linux-arm-musleabihf': 4.22.4 - '@rollup/rollup-linux-arm64-gnu': 4.22.4 - '@rollup/rollup-linux-arm64-musl': 4.22.4 - '@rollup/rollup-linux-powerpc64le-gnu': 4.22.4 - '@rollup/rollup-linux-riscv64-gnu': 4.22.4 - '@rollup/rollup-linux-s390x-gnu': 4.22.4 - '@rollup/rollup-linux-x64-gnu': 4.22.4 - '@rollup/rollup-linux-x64-musl': 4.22.4 - '@rollup/rollup-win32-arm64-msvc': 4.22.4 - '@rollup/rollup-win32-ia32-msvc': 4.22.4 - '@rollup/rollup-win32-x64-msvc': 4.22.4 + '@rollup/rollup-android-arm-eabi': 4.34.6 + '@rollup/rollup-android-arm64': 4.34.6 + '@rollup/rollup-darwin-arm64': 4.34.6 + '@rollup/rollup-darwin-x64': 4.34.6 + '@rollup/rollup-freebsd-arm64': 4.34.6 + '@rollup/rollup-freebsd-x64': 4.34.6 + '@rollup/rollup-linux-arm-gnueabihf': 4.34.6 + '@rollup/rollup-linux-arm-musleabihf': 4.34.6 + '@rollup/rollup-linux-arm64-gnu': 4.34.6 + '@rollup/rollup-linux-arm64-musl': 4.34.6 + '@rollup/rollup-linux-loongarch64-gnu': 4.34.6 + '@rollup/rollup-linux-powerpc64le-gnu': 4.34.6 + '@rollup/rollup-linux-riscv64-gnu': 4.34.6 + '@rollup/rollup-linux-s390x-gnu': 4.34.6 + '@rollup/rollup-linux-x64-gnu': 4.34.6 + '@rollup/rollup-linux-x64-musl': 4.34.6 + '@rollup/rollup-win32-arm64-msvc': 4.34.6 + '@rollup/rollup-win32-ia32-msvc': 4.34.6 + '@rollup/rollup-win32-x64-msvc': 4.34.6 fsevents: 2.3.3 run-parallel@1.2.0: @@ -4010,7 +4193,7 @@ snapshots: shellwords@0.1.1: {} - sirv@2.0.4: + sirv@3.0.0: dependencies: '@polka/url': 1.0.0-next.28 mrmime: 2.0.0 @@ -4022,7 +4205,7 @@ snapshots: smob@1.5.0: {} - sonic-boom@4.1.0: + sonic-boom@4.2.0: dependencies: atomic-sleep: 1.0.0 @@ -4067,45 +4250,38 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-hmr@0.16.0(svelte@4.2.19): - dependencies: - svelte: 4.2.19 - - svelte@4.2.19: + svelte@5.10.0: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping': 0.3.25 '@types/estree': 1.0.6 - acorn: 8.12.1 + acorn: 8.14.0 + acorn-typescript: 1.4.13(acorn@8.14.0) aria-query: 5.3.2 axobject-query: 4.1.0 - code-red: 1.0.4 - css-tree: 2.3.1 - estree-walker: 3.0.3 - is-reference: 3.0.2 + esm-env: 1.2.1 + esrap: 1.2.3 + is-reference: 3.0.3 locate-character: 3.0.0 - magic-string: 0.30.11 - periscopic: 3.1.0 + magic-string: 0.30.17 + zimmerframe: 1.1.2 - terser@5.34.1: + terser@5.36.0: dependencies: '@jridgewell/source-map': 0.3.6 - acorn: 8.12.1 + acorn: 8.14.0 commander: 2.20.3 source-map-support: 0.5.21 - text-table@0.2.0: {} - thread-stream@3.1.0: dependencies: real-require: 0.2.0 - tinyexec@0.3.0: {} + tinyexec@0.3.1: {} - tinyglobby@0.2.6: + tinyglobby@0.2.10: dependencies: - fdir: 6.3.0(picomatch@4.0.2) + fdir: 6.4.2(picomatch@4.0.2) picomatch: 4.0.2 to-regex-range@5.0.1: @@ -4118,13 +4294,13 @@ snapshots: trough@1.0.5: {} - ts-api-utils@1.3.0(typescript@5.6.2): + ts-api-utils@2.0.1(typescript@5.7.3): dependencies: - typescript: 5.6.2 + typescript: 5.7.3 - tslib@2.7.0: {} + tslib@2.8.1: {} - tsx@4.19.1: + tsx@4.19.2: dependencies: esbuild: 0.23.1 get-tsconfig: 4.8.1 @@ -4137,18 +4313,17 @@ snapshots: type-fest@0.7.1: {} - typescript-eslint@8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2): + typescript-eslint@8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.8.0(@typescript-eslint/parser@8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2))(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2) - '@typescript-eslint/parser': 8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2) - '@typescript-eslint/utils': 8.8.0(eslint@9.12.0(jiti@2.0.0))(typescript@5.6.2) - optionalDependencies: - typescript: 5.6.2 + '@typescript-eslint/eslint-plugin': 8.23.0(@typescript-eslint/parser@8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/parser': 8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/utils': 8.23.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + eslint: 9.19.0(jiti@2.4.2) + typescript: 5.7.3 transitivePeerDependencies: - - eslint - supports-color - typescript@5.6.2: {} + typescript@5.7.3: {} ufo@1.5.4: {} @@ -4156,7 +4331,7 @@ snapshots: dependencies: '@antfu/utils': 0.7.10 defu: 6.1.4 - importx: 0.5.0 + importx: 0.5.1 transitivePeerDependencies: - supports-color @@ -4174,31 +4349,32 @@ snapshots: dependencies: '@types/unist': 2.0.11 - unocss@0.63.1(postcss@8.4.47)(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)): - dependencies: - '@unocss/astro': 0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)) - '@unocss/cli': 0.63.1(rollup@4.22.4) - '@unocss/core': 0.63.1 - '@unocss/postcss': 0.63.1(postcss@8.4.47) - '@unocss/preset-attributify': 0.63.1 - '@unocss/preset-icons': 0.63.1 - '@unocss/preset-mini': 0.63.1 - '@unocss/preset-tagify': 0.63.1 - '@unocss/preset-typography': 0.63.1 - '@unocss/preset-uno': 0.63.1 - '@unocss/preset-web-fonts': 0.63.1 - '@unocss/preset-wind': 0.63.1 - '@unocss/transformer-attributify-jsx': 0.63.1 - '@unocss/transformer-compile-class': 0.63.1 - '@unocss/transformer-directives': 0.63.1 - '@unocss/transformer-variant-group': 0.63.1 - '@unocss/vite': 0.63.1(rollup@4.22.4)(vite@5.4.8(terser@5.34.1)) + unocss@65.4.0(postcss@8.5.1)(rollup@4.34.6)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.7.3)): + dependencies: + '@unocss/astro': 65.4.0(rollup@4.34.6)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.7.3)) + '@unocss/cli': 65.4.0(rollup@4.34.6) + '@unocss/core': 65.4.0 + '@unocss/postcss': 65.4.0(postcss@8.5.1) + '@unocss/preset-attributify': 65.4.0 + '@unocss/preset-icons': 65.4.0 + '@unocss/preset-mini': 65.4.0 + '@unocss/preset-tagify': 65.4.0 + '@unocss/preset-typography': 65.4.0 + '@unocss/preset-uno': 65.4.0 + '@unocss/preset-web-fonts': 65.4.0 + '@unocss/preset-wind': 65.4.0 + '@unocss/transformer-attributify-jsx': 65.4.0 + '@unocss/transformer-compile-class': 65.4.0 + '@unocss/transformer-directives': 65.4.0 + '@unocss/transformer-variant-group': 65.4.0 + '@unocss/vite': 65.4.0(rollup@4.34.6)(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.7.3)) optionalDependencies: - vite: 5.4.8(terser@5.34.1) + vite: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) transitivePeerDependencies: - postcss - rollup - supports-color + - vue uri-js@4.4.1: dependencies: @@ -4216,18 +4392,34 @@ snapshots: unist-util-stringify-position: 2.0.3 vfile-message: 2.0.4 - vite@5.4.8(terser@5.34.1): + vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2): dependencies: - esbuild: 0.21.5 - postcss: 8.4.47 - rollup: 4.22.4 + esbuild: 0.24.2 + postcss: 8.5.1 + rollup: 4.34.6 optionalDependencies: fsevents: 2.3.3 - terser: 5.34.1 + jiti: 2.4.2 + terser: 5.36.0 + tsx: 4.19.2 - vitefu@0.2.5(vite@5.4.8(terser@5.34.1)): + vitefu@1.0.4(vite@6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2)): optionalDependencies: - vite: 5.4.8(terser@5.34.1) + vite: 6.0.9(jiti@2.4.2)(terser@5.36.0)(tsx@4.19.2) + + vue-flow-layout@0.1.1(vue@3.5.13(typescript@5.7.3)): + dependencies: + vue: 3.5.13(typescript@5.7.3) + + vue@3.5.13(typescript@5.7.3): + dependencies: + '@vue/compiler-dom': 3.5.13 + '@vue/compiler-sfc': 3.5.13 + '@vue/runtime-dom': 3.5.13 + '@vue/server-renderer': 3.5.13(vue@3.5.13(typescript@5.7.3)) + '@vue/shared': 3.5.13 + optionalDependencies: + typescript: 5.7.3 webidl-conversions@3.0.1: {} @@ -4287,6 +4479,8 @@ snapshots: yocto-queue@0.1.0: {} + zimmerframe@1.1.2: {} + zod-validation-error@1.5.0(zod@3.23.8): dependencies: zod: 3.23.8 diff --git a/renovate.json b/renovate.json index 87300f19..f0c3d6ea 100644 --- a/renovate.json +++ b/renovate.json @@ -1,8 +1,7 @@ { - "extends": ["config:base"], + "extends": ["config:recommended"], "baseBranches": ["v2", "v1"], "enabledManagers": ["cargo", "npm"], - "semanticCommitType": "chore", "labels": ["dependencies"], "ignorePaths": [ "**/node_modules/**", @@ -14,29 +13,17 @@ "**/__fixtures__/**", "shared/**" ], - "lockFileMaintenance": { - "enabled": true - }, "rangeStrategy": "replace", "packageRules": [ + { + "semanticCommitType": "chore", + "matchPackageNames": ["*"] + }, { "description": "Disable node/pnpm version updates", "matchPackageNames": ["node", "pnpm"], "matchDepTypes": ["engines", "packageManager"], "enabled": false - }, - { - "description": "Disable lock file maintenance for v1", - "matchBaseBranches": ["v1"], - "matchUpdateTypes": ["lockFileMaintenance"], - "enabled": false - }, - { - "description": "Prevent Renovate from replacing 2.0.0-beta.10 with 2.0.0-beta - REMOVE ONCE TAURI IS STABLE", - "matchManagers": ["cargo"], - "matchPackagePatterns": ["^tauri"], - "matchCurrentValue": "2.*", - "rangeStrategy": "bump" } ], "postUpdateOptions": ["pnpmDedupe"] diff --git a/shared/template/README.md b/shared/template/README.md index d22a2ba6..5d153499 100644 --- a/shared/template/README.md +++ b/shared/template/README.md @@ -56,7 +56,7 @@ yarn add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 First you need to register the core plugin with Tauri: -`src-tauri/src/main.rs` +`src-tauri/src/lib.rs` ```rust fn main() {