Compare commits

..

1 Commits

Author SHA1 Message Date
FabianLars 14381190e7 chore: Apply clippy suggestions 2025-07-23 12:44:36 +02:00
79 changed files with 802 additions and 1685 deletions
-6
View File
@@ -1,6 +0,0 @@
---
fs: patch
fs-js: patch
---
Fixed calling `writeFile` with `data: ReadableStream` throws `Invalid argument`
-6
View File
@@ -1,6 +0,0 @@
---
nfc: patch
nfc-js: patch
---
On iOS, the reader session will now get closed properly on errors, preventing dangling invalid sessions that could prevent subsequent write attempts.
-6
View File
@@ -1,6 +0,0 @@
---
"opener": 'minor:enhance'
"opener-js": 'minor:enhance'
---
Allow reveal multiple items in the file explorer.
-6
View File
@@ -1,6 +0,0 @@
---
store: minor
store-js: minor
---
Allow setting defaults from the JavaScript API
-6
View File
@@ -1,6 +0,0 @@
---
store: minor
store-js: minor
---
Add an new option `overrideDefaults` for creating/loading and reloading the store that overrides the store with the on-disk state, ignoring defaults
Generated
+18 -17
View File
@@ -207,7 +207,7 @@ checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
[[package]]
name = "api"
version = "2.0.32"
version = "2.0.31"
dependencies = [
"log",
"serde",
@@ -1910,11 +1910,11 @@ dependencies = [
[[package]]
name = "file-id"
version = "0.2.3"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1fc6a637b6dc58414714eddd9170ff187ecb0933d4c7024d1abbd23a3cc26e9"
checksum = "6bc904b9bbefcadbd8e3a9fb0d464a9b979de6324c03b3c663e8994f46a5be36"
dependencies = [
"windows-sys 0.60.2",
"windows-sys 0.52.0",
]
[[package]]
@@ -3243,9 +3243,9 @@ dependencies = [
[[package]]
name = "kqueue"
version = "1.1.1"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a"
checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c"
dependencies = [
"kqueue-sys",
"libc",
@@ -3720,11 +3720,12 @@ dependencies = [
[[package]]
name = "notify"
version = "8.2.0"
version = "8.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3"
checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943"
dependencies = [
"bitflags 2.9.0",
"filetime",
"fsevent-sys",
"inotify",
"kqueue",
@@ -3733,14 +3734,14 @@ dependencies = [
"mio",
"notify-types",
"walkdir",
"windows-sys 0.60.2",
"windows-sys 0.59.0",
]
[[package]]
name = "notify-debouncer-full"
version = "0.6.0"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "375bd3a138be7bfeff3480e4a623df4cbfb55b79df617c055cd810ba466fa078"
checksum = "d2d88b1a7538054351c8258338df7c931a590513fb3745e8c15eb9ff4199b8d1"
dependencies = [
"file-id",
"log",
@@ -6553,7 +6554,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.3.2"
version = "2.3.1"
dependencies = [
"log",
"raw-window-handle",
@@ -6707,7 +6708,7 @@ dependencies = [
"log",
"maplit",
"notify-rust",
"rand 0.9.0",
"rand 0.8.5",
"serde",
"serde_json",
"serde_repr",
@@ -6864,9 +6865,9 @@ dependencies = [
"iota-crypto",
"iota_stronghold",
"log",
"rand 0.9.0",
"rand_chacha 0.9.0",
"rand_core 0.9.3",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rand_core 0.6.4",
"rust-argon2 2.1.0",
"rusty-fork",
"serde",
@@ -6932,7 +6933,7 @@ dependencies = [
"futures-util",
"http",
"log",
"rand 0.9.0",
"rand 0.8.5",
"serde",
"serde_json",
"tauri",
-6
View File
@@ -1,11 +1,5 @@
# Changelog
## \[2.0.28]
### Dependencies
- Upgraded to `dialog-js@2.3.2`
## \[2.0.27]
### Dependencies
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "api",
"private": true,
"version": "2.0.28",
"version": "2.0.27",
"type": "module",
"scripts": {
"dev": "vite --clearScreen false",
@@ -15,7 +15,7 @@
"@tauri-apps/plugin-biometric": "^2.3.0",
"@tauri-apps/plugin-cli": "^2.4.0",
"@tauri-apps/plugin-clipboard-manager": "^2.3.0",
"@tauri-apps/plugin-dialog": "^2.3.2",
"@tauri-apps/plugin-dialog": "^2.3.1",
"@tauri-apps/plugin-fs": "^2.4.1",
"@tauri-apps/plugin-geolocation": "^2.2.0",
"@tauri-apps/plugin-global-shortcut": "^2.3.0",
-6
View File
@@ -1,11 +1,5 @@
# Changelog
## \[2.0.32]
### Dependencies
- Upgraded to `dialog@2.3.2`
## \[2.0.31]
### Dependencies
+2 -2
View File
@@ -1,7 +1,7 @@
[package]
name = "api"
publish = false
version = "2.0.32"
version = "2.0.31"
description = "An example Tauri Application showcasing the api"
edition = "2021"
rust-version = { workspace = true }
@@ -25,7 +25,7 @@ tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.4.1", features =
"watch",
] }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.0" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.3.2" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.3.1" }
tauri-plugin-http = { path = "../../../plugins/http", features = [
"multipart",
"cookies",
+2 -2
View File
@@ -14,11 +14,11 @@ pub struct RequestBody {
#[command]
pub fn log_operation(event: String, payload: Option<String>) {
log::info!("{} {:?}", event, payload);
log::info!("{event} {payload:?}");
}
#[command]
pub fn perform_request(endpoint: String, body: RequestBody) -> String {
println!("{} {:?}", endpoint, body);
println!("{endpoint} {body:?}");
"message response".into()
}
+1 -1
View File
@@ -95,7 +95,7 @@ pub fn run() {
let server = match tiny_http::Server::http("localhost:3003") {
Ok(s) => s,
Err(e) => {
eprintln!("{}", e);
eprintln!("{e}");
std::process::exit(1);
}
};
+94 -90
View File
@@ -1,190 +1,194 @@
<script>
import * as fs from '@tauri-apps/plugin-fs'
import { convertFileSrc } from '@tauri-apps/api/core'
import { arrayBufferToBase64 } from '../lib/utils'
import { onDestroy } from 'svelte'
import * as fs from "@tauri-apps/plugin-fs";
import { convertFileSrc } from "@tauri-apps/api/core";
import { arrayBufferToBase64 } from "../lib/utils";
import { onDestroy } from "svelte";
const { onMessage, insecureRenderHtml } = $props()
export let onMessage;
export let insecureRenderHtml;
let path = $state('')
let img
let path = "";
let img;
/** @type {fs.FileHandle} */
let file = $state()
let renameTo = $state()
let watchPath = $state('')
let watchDebounceDelay = $state(0)
let watchRecursive = $state(false)
/** @type {fs.BaseDirectory | undefined} */
let baseDir = $state()
let unwatchFn
let unwatchPath = ''
let file;
let renameTo;
let watchPath = "";
let watchDebounceDelay = "0";
let watchRecursive = false;
let unwatchFn;
let unwatchPath = "";
const dirOptions = Object.keys(fs.BaseDirectory).filter((key) =>
isNaN(parseInt(key))
)
function getDir() {
const dirSelect = document.getElementById("dir");
return dirSelect.value ? parseInt(dir.value) : null;
}
const DirOptions = Object.keys(fs.BaseDirectory)
.filter((key) => isNaN(parseInt(key)))
.map((dir) => [dir, fs.BaseDirectory[dir]]);
function open() {
fs.open(path, {
baseDir,
baseDir: getDir(),
read: true,
write: true,
create: true
create: true,
})
.then((f) => {
file = f
onMessage(`Opened ${path}`)
file = f;
onMessage(`Opened ${path}`);
})
.catch(onMessage)
.catch(onMessage);
}
function mkdir() {
fs.mkdir(path, { baseDir })
fs.mkdir(path, { baseDir: getDir() })
.then(() => {
onMessage(`Created dir ${path}`)
onMessage(`Created dir ${path}`);
})
.catch(onMessage)
.catch(onMessage);
}
function remove() {
fs.remove(path, { baseDir })
fs.remove(path, { baseDir: getDir() })
.then(() => {
onMessage(`Removed ${path}`)
onMessage(`Removed ${path}`);
})
.catch(onMessage)
.catch(onMessage);
}
function rename() {
fs.rename(path, renameTo, {
oldPathBaseDir,
newPathBaseDir
oldPathBaseDir: getDir(),
newPathBaseDir: getDir(),
})
.then(() => {
onMessage(`Renamed ${path} to ${renameTo}`)
onMessage(`Renamed ${path} to ${renameTo}`);
})
.catch(onMessage)
.catch(onMessage);
}
function truncate() {
file
.truncate(0)
.then(() => {
onMessage(`Truncated file`)
onMessage(`Truncated file`);
})
.catch(onMessage)
.catch(onMessage);
}
function stat() {
file
.stat()
.then((stat) => {
onMessage(`File stat ${JSON.stringify(stat)}`)
onMessage(`File stat ${JSON.stringify(stat)}`);
})
.catch(onMessage)
.catch(onMessage);
}
function read() {
const opts = {
baseDir
}
baseDir: getDir(),
};
fs.stat(path, opts)
.then((stat) => {
const isFile = stat.isFile
const isFile = stat.isFile;
const promise = isFile
? fs.readFile(path, opts)
: fs.readDir(path, opts)
: fs.readDir(path, opts);
promise
.then(function (response) {
if (isFile) {
if (path.includes('.png') || path.includes('.jpg')) {
if (path.includes(".png") || path.includes(".jpg")) {
arrayBufferToBase64(
new Uint8Array(response),
function (base64) {
const src = 'data:image/png;base64,' + base64
insecureRenderHtml('<img src="' + src + '"></img>')
const src = "data:image/png;base64," + base64;
insecureRenderHtml('<img src="' + src + '"></img>');
}
)
);
} else {
const value = String.fromCharCode.apply(null, response)
const value = String.fromCharCode.apply(null, response);
insecureRenderHtml(
'<textarea id="file-response"></textarea><button id="file-save">Save</button>'
)
);
setTimeout(() => {
const fileInput = document.getElementById('file-response')
fileInput.value = value
const fileInput = document.getElementById("file-response");
fileInput.value = value;
document
.getElementById('file-save')
.addEventListener('click', function () {
.getElementById("file-save")
.addEventListener("click", function () {
fs.writeTextFile(path, fileInput.value, {
baseDir
}).catch(onMessage)
})
})
baseDir: getDir(),
}).catch(onMessage);
});
});
}
} else {
onMessage(response)
onMessage(response);
}
})
.catch(onMessage)
.catch(onMessage);
})
.catch(onMessage)
.catch(onMessage);
}
function setSrc() {
img.src = convertFileSrc(path)
img.src = convertFileSrc(path);
}
function watch() {
unwatch()
unwatch();
if (watchPath) {
onMessage(`Watching ${watchPath} for changes`)
onMessage(`Watching ${watchPath} for changes`);
let options = {
recursive: watchRecursive,
delayMs: watchDebounceDelay
}
delayMs: parseInt(watchDebounceDelay),
};
if (options.delayMs === 0) {
fs.watchImmediate(watchPath, onMessage, options)
.then((fn) => {
unwatchFn = fn
unwatchPath = watchPath
unwatchFn = fn;
unwatchPath = watchPath;
})
.catch(onMessage)
.catch(onMessage);
} else {
fs.watch(watchPath, onMessage, options)
.then((fn) => {
unwatchFn = fn
unwatchPath = watchPath
unwatchFn = fn;
unwatchPath = watchPath;
})
.catch(onMessage)
.catch(onMessage);
}
}
}
function unwatch() {
if (unwatchFn) {
onMessage(`Stopped watching ${unwatchPath} for changes`)
unwatchFn()
onMessage(`Stopped watching ${unwatchPath} for changes`);
unwatchFn();
}
unwatchFn = undefined
unwatchPath = undefined
unwatchFn = undefined;
unwatchPath = undefined;
}
onDestroy(() => {
if (file) {
file.close()
file.close();
}
if (unwatchFn) {
unwatchFn()
unwatchFn();
}
})
</script>
<div class="flex flex-col">
<div class="flex gap-1">
<select class="input" bind:value={baseDir}>
<option value={undefined} selected>None</option>
{#each dirOptions as dir}
<option value={fs.BaseDirectory[dir]}>{dir}</option>
<select class="input" id="dir">
<option value="">None</option>
{#each DirOptions as dir}
<option value={dir[1]}>{dir[0]}</option>
{/each}
</select>
<input
@@ -195,20 +199,20 @@
</div>
<br />
<div>
<button class="btn" onclick={open}>Open</button>
<button class="btn" onclick={read}>Read</button>
<button class="btn" onclick={mkdir}>Mkdir</button>
<button class="btn" onclick={remove}>Remove</button>
<button class="btn" on:click={open}>Open</button>
<button class="btn" on:click={read}>Read</button>
<button class="btn" on:click={mkdir}>Mkdir</button>
<button class="btn" on:click={remove}>Remove</button>
<div class="flex flex-row">
<button class="btn" onclick={rename}>Rename</button>
<button class="btn" on:click={rename}>Rename</button>
<input class="input" bind:value={renameTo} placeholder="To" />
</div>
<button class="btn" type="button" onclick={setSrc}>Use as img src</button>
<button class="btn" type="button" on:click={setSrc}>Use as img src</button>
</div>
{#if file}
<div>
<button class="btn" onclick={truncate}>Truncate</button>
<button class="btn" onclick={stat}>Stat</button>
<button class="btn" on:click={truncate}>Truncate</button>
<button class="btn" on:click={stat}>Stat</button>
</div>
{/if}
@@ -237,8 +241,8 @@
</div>
<br />
<div>
<button class="btn" onclick={watch}>Watch</button>
<button class="btn" onclick={unwatch}>Unwatch</button>
<button class="btn" on:click={watch}>Watch</button>
<button class="btn" on:click={unwatch}>Unwatch</button>
</div>
</div>
+32 -49
View File
@@ -1,85 +1,71 @@
<script>
import { appDataDir, resolve } from '@tauri-apps/api/path'
import { LazyStore } from '@tauri-apps/plugin-store'
import { onMount } from 'svelte'
import { LazyStore } from "@tauri-apps/plugin-store";
import { onMount } from "svelte";
let { onMessage } = $props()
export let onMessage;
let key = $state()
let value = $state()
let key;
let value;
const storeName = 'cache.json'
let store = new LazyStore(storeName)
let path = $state('')
let cache = $state({})
let store = new LazyStore("cache.json");
let cache = {};
async function refreshEntries() {
try {
const values = await store.entries()
cache = {}
const values = await store.entries();
cache = {};
for (const [key, value] of values) {
cache[key] = value
cache[key] = value;
}
} catch (error) {
onMessage(error)
onMessage(error);
}
}
onMount(async () => {
path = await resolve(await appDataDir(), storeName)
await refreshEntries()
})
await refreshEntries();
});
async function write(key, value) {
try {
if (value) {
await store.set(key, value)
await store.set(key, value);
} else {
await store.delete(key)
await store.delete(key);
}
const v = await store.get(key)
const v = await store.get(key);
if (v === undefined) {
delete cache[key]
cache = cache
delete cache[key];
cache = cache;
} else {
cache[key] = v
cache[key] = v;
}
} catch (error) {
onMessage(error)
onMessage(error);
}
}
async function reset() {
try {
await store.reset()
await store.reset();
} catch (error) {
onMessage(error)
onMessage(error);
}
await refreshEntries()
}
async function reload() {
try {
await store.reload({ overrideDefaults: true })
} catch (error) {
onMessage(error)
}
await refreshEntries()
await refreshEntries();
}
async function close() {
try {
await store.close()
onMessage('Store is now closed, any new operations will error out')
await store.close();
onMessage("Store is now closed, any new operations will error out");
} catch (error) {
onMessage(error)
onMessage(error);
}
}
function reopen() {
store = new LazyStore(storeName)
onMessage('We made a new `LazyStore` instance, operations will now work')
store = new LazyStore("cache.json");
onMessage("We made a new `LazyStore` instance, operations will now work");
}
</script>
@@ -96,17 +82,14 @@
</div>
<div>
<button class="btn" onclick={() => write(key, value)}>Write</button>
<button class="btn" onclick={() => reset()}>Reset</button>
<button class="btn" onclick={() => reload()}>Reload</button>
<button class="btn" onclick={() => close()}>Close</button>
<button class="btn" onclick={() => reopen()}>Re-open</button>
<button class="btn" on:click={() => write(key, value)}>Write</button>
<button class="btn" on:click={() => reset()}>Reset</button>
<button class="btn" on:click={() => close()}>Close</button>
<button class="btn" on:click={() => reopen()}>Re-open</button>
</div>
<div>Store at <code>{path}</code> on disk</div>
</div>
<div>
<h2>Store Values</h2>
{#each Object.entries(cache) as [k, v]}
<div>{k} = {v}</div>
{/each}
+5 -5
View File
@@ -11,19 +11,19 @@
"example:api:dev": "pnpm run --filter \"api\" tauri dev"
},
"devDependencies": {
"@eslint/js": "9.32.0",
"@eslint/js": "9.31.0",
"@rollup/plugin-node-resolve": "16.0.1",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.4",
"covector": "^0.12.4",
"eslint": "9.32.0",
"eslint": "9.31.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-security": "3.0.1",
"prettier": "3.6.2",
"rollup": "4.46.2",
"rollup": "4.45.1",
"tslib": "2.8.1",
"typescript": "5.9.2",
"typescript-eslint": "8.39.0"
"typescript": "5.8.3",
"typescript-eslint": "8.38.0"
},
"pnpm": {
"overrides": {
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspac
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-autostart
# or
npm add @tauri-apps/plugin-autostart
# or
yarn add @tauri-apps/plugin-autostart
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-autostart#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-autostart#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-autostart#v2
```
## Usage
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-barcode-scanner = { git = "https://github.com/tauri-apps/plugins-wo
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-barcode-scanner
# or
npm add @tauri-apps/plugin-barcode-scanner
# or
yarn add @tauri-apps/plugin-barcode-scanner
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
```
## Usage
+9
View File
@@ -33,6 +33,8 @@ tauri-plugin-biometric = { git = "https://github.com/tauri-apps/plugins-workspac
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.
<!-- Add the branch for installations using git! -->
```sh
@@ -41,6 +43,13 @@ pnpm add @tauri-apps/plugin-biometric
npm add @tauri-apps/plugin-biometric
# or
yarn add @tauri-apps/plugin-biometric
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-biometric#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-biometric#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-biometric#v2
```
## Usage
+9
View File
@@ -34,12 +34,21 @@ tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", br
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-cli
# or
npm add @tauri-apps/plugin-cli
# or
yarn add @tauri-apps/plugin-cli
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-cli#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-cli#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-cli#v2
```
## Usage
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-
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-clipboard-manager
# or
npm add @tauri-apps/plugin-clipboard-manager
# or
yarn add @tauri-apps/plugin-clipboard-manager
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
```
## Usage
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-deep-link = { git = "https://github.com/tauri-apps/plugins-workspac
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-deep-link
# or
npm add @tauri-apps/plugin-deep-link
# or
yarn add @tauri-apps/plugin-deep-link
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-deep-link#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-deep-link#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-deep-link#v2
```
## Setting up
-4
View File
@@ -1,9 +1,5 @@
# Changelog
## \[2.3.2]
- [`af08c66f`](https://github.com/tauri-apps/plugins-workspace/commit/af08c66faafe0dffc4b0a80aef030cd3f0f89a9c) ([#2871](https://github.com/tauri-apps/plugins-workspace/pull/2871) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused the file picker not to open on Android when extension filters were set.
## \[2.3.1]
### Dependencies
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "tauri-plugin-dialog"
version = "2.3.2"
version = "2.3.1"
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
edition = { workspace = true }
authors = { workspace = true }
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace",
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-dialog
# or
npm add @tauri-apps/plugin-dialog
# or
yarn add @tauri-apps/plugin-dialog
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-dialog#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-dialog#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-dialog#v2
```
## Usage
@@ -56,18 +56,20 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
try {
val args = invoke.parseArgs(FilePickerOptions::class.java)
val parsedTypes = parseFiltersOption(args.filters)
// TODO: ACTION_OPEN_DOCUMENT ??
val intent = Intent(Intent.ACTION_GET_CONTENT)
intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.type = "*/*"
if (parsedTypes.isNotEmpty()) {
intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes)
val intent = if (parsedTypes.isNotEmpty()) {
val intent = Intent(Intent.ACTION_PICK)
setIntentMimeTypes(intent, parsedTypes)
intent
} else {
val intent = Intent(Intent.ACTION_GET_CONTENT)
intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.type = "*/*"
intent
}
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, args.multiple ?: false)
startActivityForResult(invoke, intent, "filePickerResult")
} catch (ex: Exception) {
val message = ex.message ?: "Failed to pick file"
@@ -113,7 +115,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
callResult.put("files", JSArray.from(uris.toTypedArray()))
return callResult
}
private fun parseFiltersOption(filters: Array<Filter>): Array<String> {
val mimeTypes = mutableListOf<String>()
for (filter in filters) {
@@ -130,10 +132,38 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
return mimeTypes.toTypedArray()
}
private fun setIntentMimeTypes(intent: Intent, mimeTypes: Array<String>) {
if (mimeTypes.isNotEmpty()) {
var uniqueMimeKind = true
var mimeKind: String? = null
for (mime in mimeTypes) {
val kind = mime.split("/")[0]
if (mimeKind == null) {
mimeKind = kind
} else if (mimeKind != kind) {
uniqueMimeKind = false
}
}
if (uniqueMimeKind) {
if (mimeTypes.size > 1) {
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes)
intent.type = Intent.normalizeMimeType("$mimeKind/*")
} else {
intent.type = mimeTypes[0]
}
} else {
intent.type = "*/*"
}
} else {
intent.type = "*/*"
}
}
@Command
fun showMessageDialog(invoke: Invoke) {
val args = invoke.parseArgs(MessageOptions::class.java)
if (activity.isFinishing) {
invoke.reject("App is finishing")
return
@@ -149,7 +179,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
Handler(Looper.getMainLooper())
.post {
val builder = AlertDialog.Builder(activity)
if (args.title != null) {
builder.setTitle(args.title)
}
@@ -183,14 +213,10 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
val parsedTypes = parseFiltersOption(args.filters)
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT)
setIntentMimeTypes(intent, parsedTypes)
intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.putExtra(Intent.EXTRA_TITLE, args.fileName ?: "")
intent.type = "*/*"
if (parsedTypes.isNotEmpty()) {
intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes)
}
startActivityForResult(invoke, intent, "saveFileDialogResult")
} catch (ex: Exception) {
val message = ex.message ?: "Failed to pick save file"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tauri-apps/plugin-dialog",
"version": "2.3.2",
"version": "2.3.1",
"license": "MIT OR Apache-2.0",
"authors": [
"Tauri Programme within The Commons Conservancy"
+1 -1
View File
@@ -41,7 +41,7 @@ notify = { version = "8", optional = true, features = [
"serde",
"serialization-compat-6",
] }
notify-debouncer-full = { version = "0.6", optional = true }
notify-debouncer-full = { version = "0.5", optional = true }
dunce = { workspace = true }
percent-encoding = "2"
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-fs = { git = "https://github.com/tauri-apps/plugins-workspace", bra
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-fs
# or
npm add @tauri-apps/plugin-fs
# or
yarn add @tauri-apps/plugin-fs
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-fs#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-fs#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-fs#v2
```
## Usage
File diff suppressed because one or more lines are too long
+1 -6
View File
@@ -1074,12 +1074,7 @@ async function writeFile(
}
if (data instanceof ReadableStream) {
const file = await open(path, {
read: false,
create: true,
write: true,
...options
})
const file = await open(path, { create: true, ...options })
const reader = data.getReader()
try {
+9
View File
@@ -33,6 +33,8 @@ tauri-plugin-geolocation = { git = "https://github.com/tauri-apps/plugins-worksp
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.
<!-- Add the branch for installations using git! -->
```sh
@@ -41,6 +43,13 @@ pnpm add @tauri-apps/plugin-geolocation
npm add @tauri-apps/plugin-geolocation
# or
yarn add @tauri-apps/plugin-geolocation
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-geolocation#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-geolocation#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-geolocation#v2
```
## Setting up
+9
View File
@@ -34,12 +34,21 @@ tauri-plugin-global-shortcut = { git = "https://github.com/tauri-apps/plugins-wo
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-global-shortcut
# or
npm add @tauri-apps/plugin-global-shortcut
# or
yarn add @tauri-apps/plugin-global-shortcut
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-global-shortcut#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-global-shortcut#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-global-shortcut#v2
```
## Usage
+9
View File
@@ -35,6 +35,8 @@ tauri-plugin-haptics = { git = "https://github.com/tauri-apps/plugins-workspace"
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.
<!-- Add the branch for installations using git! -->
```sh
@@ -43,6 +45,13 @@ pnpm add @tauri-apps/plugin-haptics
npm add @tauri-apps/plugin-haptics
# or
yarn add @tauri-apps/plugin-haptics
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-haptics#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-haptics#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-haptics#v2
```
## Usage
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-http = { git = "https://github.com/tauri-apps/plugins-workspace", b
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-http
# or
npm add @tauri-apps/plugin-http
# or
yarn add @tauri-apps/plugin-http
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-http#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-http#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-http#v2
```
## Usage
+9
View File
@@ -35,12 +35,21 @@ If you want the single instance mechanism to only trigger for semver compatible
Then you can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh
pnpm add @tauri-apps/plugin-log
# or
npm add @tauri-apps/plugin-log
# or
yarn add @tauri-apps/plugin-log
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-log#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-log#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-log#v2
```
## Usage
+9
View File
@@ -33,6 +33,8 @@ tauri-plugin-nfc = { git = "https://github.com/tauri-apps/plugins-workspace", br
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.
<!-- Add the branch for installations using git! -->
```sh
@@ -41,6 +43,13 @@ pnpm add @tauri-apps/plugin-nfc
npm add @tauri-apps/plugin-nfc
# or
yarn add @tauri-apps/plugin-nfc
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-nfc#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-nfc#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-nfc#v2
```
## Usage
@@ -149,7 +149,6 @@ class NfcPlugin: Plugin, NFCTagReaderSessionDelegate, NFCNDEFReaderSessionDelega
func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) {
Logger.error("Tag reader session error \(error)")
self.session?.invoke.reject("session invalidated with error: \(error)")
self.session = nil
}
func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) {
@@ -201,7 +200,6 @@ class NfcPlugin: Plugin, NFCTagReaderSessionDelegate, NFCNDEFReaderSessionDelega
} else {
Logger.error("NDEF reader session error \(error)")
self.session?.invoke.reject("session invalidated with error: \(error)")
self.session = nil
}
}
@@ -1,331 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 60;
objects = {
/* Begin PBXBuildFile section */
8E12E6982E4A879F0019CC26 /* CoreNFC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E12E6962E4A862B0019CC26 /* CoreNFC.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
A0E2115A2BF552D2003BCF4D /* ExamplePlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E211592BF552D2003BCF4D /* ExamplePlugin.swift */; };
A0E211622BF55305003BCF4D /* Tauri in Frameworks */ = {isa = PBXBuildFile; productRef = A0E211612BF55305003BCF4D /* Tauri */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
A0E211542BF552D2003BCF4D /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
8E12E6962E4A862B0019CC26 /* CoreNFC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreNFC.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/iOSSupport/System/Library/Frameworks/CoreNFC.framework; sourceTree = DEVELOPER_DIR; };
A0E211562BF552D2003BCF4D /* libtauri-plugin-nfc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libtauri-plugin-nfc.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A0E211592BF552D2003BCF4D /* ExamplePlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExamplePlugin.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
A0E211532BF552D2003BCF4D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8E12E6982E4A879F0019CC26 /* CoreNFC.framework in Frameworks */,
A0E211622BF55305003BCF4D /* Tauri in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8E12E6952E4A862B0019CC26 /* Frameworks */ = {
isa = PBXGroup;
children = (
8E12E6962E4A862B0019CC26 /* CoreNFC.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
A0E2114D2BF552D2003BCF4D = {
isa = PBXGroup;
children = (
A0E211582BF552D2003BCF4D /* tauri-plugin-nfc */,
8E12E6952E4A862B0019CC26 /* Frameworks */,
A0E211572BF552D2003BCF4D /* Products */,
);
sourceTree = "<group>";
};
A0E211572BF552D2003BCF4D /* Products */ = {
isa = PBXGroup;
children = (
A0E211562BF552D2003BCF4D /* libtauri-plugin-nfc.a */,
);
name = Products;
sourceTree = "<group>";
};
A0E211582BF552D2003BCF4D /* tauri-plugin-nfc */ = {
isa = PBXGroup;
children = (
A0E211592BF552D2003BCF4D /* ExamplePlugin.swift */,
);
path = "tauri-plugin-nfc";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
A0E211552BF552D2003BCF4D /* tauri-plugin-nfc */ = {
isa = PBXNativeTarget;
buildConfigurationList = A0E2115D2BF552D2003BCF4D /* Build configuration list for PBXNativeTarget "tauri-plugin-nfc" */;
buildPhases = (
A0E211522BF552D2003BCF4D /* Sources */,
A0E211532BF552D2003BCF4D /* Frameworks */,
A0E211542BF552D2003BCF4D /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = "tauri-plugin-nfc";
packageProductDependencies = (
A0E211612BF55305003BCF4D /* Tauri */,
);
productName = "tauri-plugin-nfc";
productReference = A0E211562BF552D2003BCF4D /* libtauri-plugin-nfc.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
A0E2114E2BF552D2003BCF4D /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1540;
LastUpgradeCheck = 1540;
TargetAttributes = {
A0E211552BF552D2003BCF4D = {
CreatedOnToolsVersion = 15.4;
};
};
};
buildConfigurationList = A0E211512BF552D2003BCF4D /* Build configuration list for PBXProject "tauri-plugin-nfc" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = A0E2114D2BF552D2003BCF4D;
packageReferences = (
A0E211602BF55305003BCF4D /* XCLocalSwiftPackageReference "../.tauri/tauri-api" */,
);
productRefGroup = A0E211572BF552D2003BCF4D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
A0E211552BF552D2003BCF4D /* tauri-plugin-nfc */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
A0E211522BF552D2003BCF4D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A0E2115A2BF552D2003BCF4D /* ExamplePlugin.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
A0E2115B2BF552D2003BCF4D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
A0E2115C2BF552D2003BCF4D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
A0E2115E2BF552D2003BCF4D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
A0E2115F2BF552D2003BCF4D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
A0E211512BF552D2003BCF4D /* Build configuration list for PBXProject "tauri-plugin-nfc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A0E2115B2BF552D2003BCF4D /* Debug */,
A0E2115C2BF552D2003BCF4D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A0E2115D2BF552D2003BCF4D /* Build configuration list for PBXNativeTarget "tauri-plugin-nfc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A0E2115E2BF552D2003BCF4D /* Debug */,
A0E2115F2BF552D2003BCF4D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */
A0E211602BF55305003BCF4D /* XCLocalSwiftPackageReference "../.tauri/tauri-api" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "../.tauri/tauri-api";
};
/* End XCLocalSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
A0E211612BF55305003BCF4D /* Tauri */ = {
isa = XCSwiftPackageProductDependency;
productName = Tauri;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = A0E2114E2BF552D2003BCF4D /* Project object */;
}
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -1,15 +0,0 @@
{
"originHash" : "cd669d6eb9e52a836461d0d6168afc46839b3c2631131b83d6c1996da63315ec",
"pins" : [
{
"identity" : "swift-rs",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Brendonovich/swift-rs",
"state" : {
"revision" : "f64a4514de07f450ec5b6aa297624cd3479d9579",
"version" : "1.0.7"
}
}
],
"version" : 3
}
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>tauri-plugin-nfc.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
@@ -1,523 +0,0 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
// https://developer.apple.com/documentation/corenfc/building_an_nfc_tag-reader_app
import CoreNFC
import SwiftRs
import Tauri
import UIKit
import WebKit
enum ScanKind: Decodable {
case ndef, tag
}
struct ScanOptions: Decodable {
let kind: ScanKind
var keepSessionAlive: Bool?
var message: String?
var successMessage: String?
}
struct NDEFRecord: Decodable {
var format: UInt8?
var kind: [UInt8]?
var identifier: [UInt8]?
var payload: [UInt8]?
}
struct WriteOptions: Decodable {
var kind: ScanKind?
let records: [NDEFRecord]
var message: String?
var successMessage: String?
var successfulReadMessage: String?
}
enum TagProcessMode {
case write(message: NFCNDEFMessage)
case read
}
class Session {
let nfcSession: NFCReaderSession?
let invoke: Invoke
var keepAlive: Bool
let tagProcessMode: TagProcessMode
var tagStatus: NFCNDEFStatus?
var tag: NFCNDEFTag?
let successfulReadMessage: String?
let successfulWriteAlertMessage: String?
init(
nfcSession: NFCReaderSession?,
invoke: Invoke,
keepAlive: Bool,
tagProcessMode: TagProcessMode,
successfulReadMessage: String?,
successfulWriteAlertMessage: String?
) {
self.nfcSession = nfcSession
self.invoke = invoke
self.keepAlive = keepAlive
self.tagProcessMode = tagProcessMode
self.successfulReadMessage = successfulReadMessage
self.successfulWriteAlertMessage = successfulWriteAlertMessage
}
}
class NfcStatus {
let available: Bool
let errorReason: String?
init(available: Bool, errorReason: String?) {
self.available = available
self.errorReason = errorReason
}
}
class NfcPlugin: Plugin, NFCTagReaderSessionDelegate, NFCNDEFReaderSessionDelegate {
var session: Session?
var status: NfcStatus!
public override func load(webview: WKWebView) {
var available = false
var errorReason: String?
let entry = Bundle.main.infoDictionary?["NFCReaderUsageDescription"] as? String
if entry == nil || entry?.count == 0 {
errorReason = "missing NFCReaderUsageDescription configuration on the Info.plist file"
} else if !NFCNDEFReaderSession.readingAvailable {
errorReason =
"NFC tag reading unavailable, make sure the Near-Field Communication capability on Xcode is enabled and the device supports NFC tag reading"
} else {
available = true
}
if let error = errorReason {
Logger.error("\(error)")
}
self.status = NfcStatus(available: available, errorReason: errorReason)
}
func tagReaderSessionDidBecomeActive(
_ session: NFCTagReaderSession
) {
Logger.info("tagReaderSessionDidBecomeActive")
}
func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) {
let tag = tags.first!
session.connect(
to: tag,
completionHandler: { [self] (error) in
if let error = error {
self.closeSession(session, error: "cannot connect to tag: \(error)")
} else {
let ndefTag: NFCNDEFTag
switch tag {
case let .feliCa(tag):
ndefTag = tag as NFCNDEFTag
break
case let .miFare(tag):
ndefTag = tag as NFCNDEFTag
break
case let .iso15693(tag):
ndefTag = tag as NFCNDEFTag
break
case let .iso7816(tag):
ndefTag = tag as NFCNDEFTag
break
default:
return
}
self.processTag(
session: session, tag: ndefTag, metadata: tagMetadata(tag),
mode: self.session!.tagProcessMode)
}
}
)
}
func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) {
Logger.error("Tag reader session error \(error)")
self.session?.invoke.reject("session invalidated with error: \(error)")
self.session = nil
}
func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) {
let message = messages.first!
// TODO: do we really need this hook?
self.session?.invoke.resolve(["records": ndefMessageRecords(message)])
}
func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) {
let tag = tags.first!
session.connect(
to: tag,
completionHandler: { [self] (error) in
if let error = error {
self.closeSession(session, error: "cannot connect to tag: \(error)")
} else {
var metadata: JsonObject = [:]
if tag.isKind(of: NFCFeliCaTag.self) {
metadata["kind"] = ["FeliCa"]
metadata["id"] = nil
} else if let t = tag as? NFCMiFareTag {
metadata["kind"] = ["MiFare"]
metadata["id"] = byteArrayFromData(t.identifier)
} else if let t = tag as? NFCISO15693Tag {
metadata["kind"] = ["ISO15693"]
metadata["id"] = byteArrayFromData(t.identifier)
} else if let t = tag as? NFCISO7816Tag {
metadata["kind"] = ["ISO7816Compatible"]
metadata["id"] = byteArrayFromData(t.identifier)
}
self.processTag(
session: session, tag: tag, metadata: metadata,
mode: self.session!.tagProcessMode)
}
}
)
}
func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) {
if (error as NSError).code
== NFCReaderError.Code.readerSessionInvalidationErrorFirstNDEFTagRead.rawValue
{
// not an error because we're using invalidateAfterFirstRead: true
Logger.debug("readerSessionInvalidationErrorFirstNDEFTagRead")
} else {
Logger.error("NDEF reader session error \(error)")
self.session?.invoke.reject("session invalidated with error: \(error)")
self.session = nil
}
}
private func tagMetadata(_ tag: NFCTag) -> JsonObject {
var metadata: JsonObject = [:]
switch tag {
case .feliCa:
metadata["kind"] = ["FeliCa"]
metadata["id"] = []
break
case let .miFare(tag):
metadata["kind"] = ["MiFare"]
metadata["id"] = byteArrayFromData(tag.identifier)
break
case let .iso15693(tag):
metadata["kind"] = ["ISO15693"]
metadata["id"] = byteArrayFromData(tag.identifier)
break
case let .iso7816(tag):
metadata["kind"] = ["ISO7816Compatible"]
metadata["id"] = byteArrayFromData(tag.identifier)
break
default:
metadata["kind"] = ["Unknown"]
metadata["id"] = []
break
}
return metadata
}
private func closeSession(_ session: NFCReaderSession) {
session.invalidate()
self.session = nil
}
private func closeSession(_ session: NFCReaderSession, error: String) {
session.invalidate(errorMessage: error)
self.session = nil
}
private func processTag<T: NFCNDEFTag>(
session: NFCReaderSession, tag: T, metadata: JsonObject, mode: TagProcessMode
) {
tag.queryNDEFStatus(completionHandler: {
[self] (status, capacity, error) in
if let error = error {
self.closeSession(session, error: "cannot connect to tag: \(error)")
} else {
switch mode {
case .write(let message):
self.writeNDEFTag(
session: session, status: status, tag: tag, message: message,
alertMessage: self.session?.successfulWriteAlertMessage)
break
case .read:
if self.session?.keepAlive == true {
self.session!.tagStatus = status
self.session!.tag = tag
}
self.readNDEFTag(
session: session, status: status, tag: tag, metadata: metadata,
alertMessage: self.session?.successfulReadMessage)
break
}
}
})
}
private func writeNDEFTag<T: NFCNDEFTag>(
session: NFCReaderSession, status: NFCNDEFStatus, tag: T, message: NFCNDEFMessage,
alertMessage: String?
) {
switch status {
case .notSupported:
self.closeSession(session, error: "Tag is not an NDEF-formatted tag")
break
case .readOnly:
self.closeSession(session, error: "Read only tag")
break
case .readWrite:
if let currentSession = self.session {
tag.writeNDEF(
message,
completionHandler: { (error) in
if let error = error {
self.closeSession(session, error: "cannot write to tag: \(error)")
} else {
if let message = alertMessage {
session.alertMessage = message
}
currentSession.invoke.resolve()
self.closeSession(session)
}
})
}
break
default:
return
}
}
private func readNDEFTag<T: NFCNDEFTag>(
session: NFCReaderSession, status: NFCNDEFStatus, tag: T, metadata m: JsonObject,
alertMessage: String?
) {
var metadata: JsonObject = [:]
metadata.merge(m) { (_, new) in new }
switch status {
case .notSupported:
self.resolveInvoke(message: nil, metadata: metadata)
self.closeSession(session)
return
case .readOnly:
metadata["readOnly"] = true
break
case .readWrite:
metadata["readOnly"] = false
break
default:
break
}
tag.readNDEF(completionHandler: {
[self] (message, error) in
if let error = error {
let code = (error as NSError).code
if code != 403 {
self.closeSession(session, error: "Failed to read: \(error)")
return
}
}
if let message = alertMessage {
session.alertMessage = message
}
self.resolveInvoke(message: message, metadata: metadata)
if self.session?.keepAlive != true {
self.closeSession(session)
}
})
}
private func resolveInvoke(message: NFCNDEFMessage?, metadata: JsonObject) {
var data: JsonObject = [:]
data.merge(metadata) { (_, new) in new }
if let message = message {
data["records"] = ndefMessageRecords(message)
} else {
data["records"] = []
}
self.session?.invoke.resolve(data)
}
private func ndefMessageRecords(_ message: NFCNDEFMessage) -> [JsonObject] {
var records: [JsonObject] = []
for record in message.records {
var recordJson: JsonObject = [:]
recordJson["tnf"] = record.typeNameFormat.rawValue
recordJson["kind"] = byteArrayFromData(record.type)
recordJson["id"] = byteArrayFromData(record.identifier)
recordJson["payload"] = byteArrayFromData(record.payload)
records.append(recordJson)
}
return records
}
private func byteArrayFromData(_ data: Data) -> [UInt8] {
var arr: [UInt8] = []
for b in data {
arr.append(b)
}
return arr
}
private func dataFromByteArray(_ array: [UInt8]) -> Data {
var data = Data(capacity: array.count)
data.append(contentsOf: array)
return data
}
@objc func isAvailable(_ invoke: Invoke) {
invoke.resolve([
"available": self.status.available
])
}
@objc public func write(_ invoke: Invoke) throws {
if !self.status.available {
invoke.reject("NFC reading unavailable: \(self.status.errorReason ?? "")")
return
}
let args = try invoke.parseArgs(WriteOptions.self)
var ndefPayloads = [NFCNDEFPayload]()
for record in args.records {
ndefPayloads.append(
NFCNDEFPayload(
format: NFCTypeNameFormat(rawValue: record.format ?? 0) ?? .unknown,
type: dataFromByteArray(record.kind ?? []),
identifier: dataFromByteArray(record.identifier ?? []),
payload: dataFromByteArray(record.payload ?? [])
)
)
}
if let session = self.session {
if let nfcSession = session.nfcSession, let tagStatus = session.tagStatus,
let tag = session.tag
{
session.keepAlive = false
self.writeNDEFTag(
session: nfcSession, status: tagStatus, tag: tag,
message: NFCNDEFMessage(records: ndefPayloads),
alertMessage: args.successMessage
)
} else {
invoke.reject(
"connected tag not found, please wait for it to be available and then call write()")
}
} else {
self.startScanSession(
invoke: invoke,
kind: args.kind ?? .ndef,
keepAlive: true,
invalidateAfterFirstRead: false,
tagProcessMode: .write(
message: NFCNDEFMessage(records: ndefPayloads)
),
alertMessage: args.message,
successfulReadMessage: args.successfulReadMessage,
successfulWriteAlertMessage: args.successMessage
)
}
}
@objc public func scan(_ invoke: Invoke) throws {
if !self.status.available {
invoke.reject("NFC reading unavailable: \(self.status.errorReason ?? "")")
return
}
let args = try invoke.parseArgs(ScanOptions.self)
self.startScanSession(
invoke: invoke,
kind: args.kind,
keepAlive: args.keepSessionAlive ?? false,
invalidateAfterFirstRead: true,
tagProcessMode: .read,
alertMessage: args.message,
successfulReadMessage: args.successMessage,
successfulWriteAlertMessage: nil
)
}
private func startScanSession(
invoke: Invoke,
kind: ScanKind,
keepAlive: Bool,
invalidateAfterFirstRead: Bool,
tagProcessMode: TagProcessMode,
alertMessage: String?,
successfulReadMessage: String?,
successfulWriteAlertMessage: String?
) {
let nfcSession: NFCReaderSession?
switch kind {
case .tag:
nfcSession = NFCTagReaderSession(
pollingOption: [.iso14443, .iso15693],
delegate: self,
queue: DispatchQueue.main
)
break
case .ndef:
nfcSession = NFCNDEFReaderSession(
delegate: self,
queue: DispatchQueue.main,
invalidateAfterFirstRead: invalidateAfterFirstRead
)
break
}
if let message = alertMessage {
nfcSession?.alertMessage = message
}
nfcSession?.begin()
self.session = Session(
nfcSession: nfcSession,
invoke: invoke,
keepAlive: keepAlive,
tagProcessMode: tagProcessMode,
successfulReadMessage: successfulReadMessage,
successfulWriteAlertMessage: successfulWriteAlertMessage
)
}
}
@_cdecl("init_plugin_nfc")
func initPlugin() -> Plugin {
return NfcPlugin()
}
+1 -1
View File
@@ -30,7 +30,7 @@ serde_json = { workspace = true }
tauri = { workspace = true }
log = { workspace = true }
thiserror = { workspace = true }
rand = "0.9"
rand = "0.8"
time = { version = "0.3", features = ["serde", "parsing", "formatting"] }
url = { version = "2", features = ["serde"] }
serde_repr = "0.1"
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-notification = { git = "https://github.com/tauri-apps/plugins-works
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-notification
# or
npm add @tauri-apps/plugin-notification
# or
yarn add @tauri-apps/plugin-notification
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-notification#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-notification#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-notification#v2
```
## Usage
+2
View File
@@ -35,6 +35,8 @@ 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]
+9 -7
View File
@@ -33,6 +33,8 @@ tauri-plugin-opener = { git = "https://github.com/tauri-apps/plugins-workspace",
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.
<!-- Add the branch for installations using git! -->
```sh
@@ -41,6 +43,13 @@ pnpm add @tauri-apps/plugin-opener
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
@@ -75,10 +84,6 @@ await openPath('/path/to/file', 'firefox')
// Reveal a path with the system's default explorer
await revealItemInDir('/path/to/file')
// Reveal multiple paths with the system's default explorer
// Note: will be renamed to `revealItemsInDir` in the next major version
await revealItemInDir(['/path/to/file', '/path/to/another/file'])
```
### Usage from Rust
@@ -106,9 +111,6 @@ fn main() {
// Reveal a path with the system's default explorer
opener.reveal_item_in_dir("/path/to/file")?;
// Reveal multiple paths with the system's default explorer
opener.reveal_items_in_dir(["/path/to/file"])?;
Ok(())
})
.run(tauri::generate_context!())
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_OPENER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}return"function"==typeof SuppressedError&&SuppressedError,n.openPath=async function(n,r){await e("plugin:opener|open_path",{path:n,with:r})},n.openUrl=async function(n,r){await e("plugin:opener|open_url",{url:n,with:r})},n.revealItemInDir=async function(n){return e("plugin:opener|reveal_item_in_dir",{paths:"string"==typeof n?[n]:n})},n}({});Object.defineProperty(window.__TAURI__,"opener",{value:__TAURI_PLUGIN_OPENER__})}
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__})}
+2 -4
View File
@@ -86,14 +86,12 @@ export async function openPath(path: string, openWith?: string): Promise<void> {
* ```typescript
* import { revealItemInDir } from '@tauri-apps/plugin-opener';
* await revealItemInDir('/path/to/file');
* await revealItemInDir([ '/path/to/file', '/path/to/another/file' ]);
* ```
*
* @param path The path to reveal.
*
* @since 2.0.0
*/
export async function revealItemInDir(path: string | string[]): Promise<void> {
const paths = typeof path === 'string' ? [path] : path
return invoke('plugin:opener|reveal_item_in_dir', { paths })
export async function revealItemInDir(path: string) {
return invoke('plugin:opener|reveal_item_in_dir', { path })
}
+2 -3
View File
@@ -69,8 +69,7 @@ pub async fn open_path<R: Runtime>(
}
}
/// TODO: in the next major version, rename to `reveal_items_in_dir`
#[tauri::command]
pub async fn reveal_item_in_dir(paths: Vec<PathBuf>) -> crate::Result<()> {
crate::reveal_items_in_dir(&paths)
pub async fn reveal_item_in_dir(path: PathBuf) -> crate::Result<()> {
crate::reveal_item_in_dir(path)
}
-3
View File
@@ -31,9 +31,6 @@ pub enum Error {
Win32Error(#[from] windows::core::Error),
#[error("Path doesn't have a parent: {0}")]
NoParent(PathBuf),
#[cfg(windows)]
#[error("Failed to convert path '{0}' to ITEMIDLIST")]
FailedToConvertPathToItemIdList(PathBuf),
#[error("Failed to convert path to file:// url")]
FailedToConvertPathToFileUrl,
#[error(transparent)]
+3 -11
View File
@@ -25,7 +25,7 @@ pub use error::Error;
type Result<T> = std::result::Result<T, Error>;
pub use open::{open_path, open_url};
pub use reveal_item_in_dir::{reveal_item_in_dir, reveal_items_in_dir};
pub use reveal_item_in_dir::reveal_item_in_dir;
pub struct Opener<R: Runtime> {
// we use `fn() -> R` to silence the unused generic error
@@ -146,15 +146,7 @@ impl<R: Runtime> Opener<R> {
}
pub fn reveal_item_in_dir<P: AsRef<Path>>(&self, p: P) -> Result<()> {
reveal_item_in_dir(p)
}
pub fn reveal_items_in_dir<I, P>(&self, paths: I) -> Result<()>
where
I: IntoIterator<Item = P>,
P: AsRef<Path>,
{
reveal_items_in_dir(paths)
crate::reveal_item_in_dir::reveal_item_in_dir(p)
}
}
@@ -221,7 +213,7 @@ impl Builder {
.invoke_handler(tauri::generate_handler![
commands::open_url,
commands::open_path,
commands::reveal_item_in_dir,
commands::reveal_item_in_dir
]);
if self.open_js_links_on_click {
+45 -148
View File
@@ -10,7 +10,7 @@ use std::path::Path;
///
/// - **Android / iOS:** Unsupported.
pub fn reveal_item_in_dir<P: AsRef<Path>>(path: P) -> crate::Result<()> {
let path = dunce::canonicalize(path.as_ref())?;
let path = path.as_ref().canonicalize()?;
#[cfg(any(
windows,
@@ -21,47 +21,7 @@ pub fn reveal_item_in_dir<P: AsRef<Path>>(path: P) -> crate::Result<()> {
target_os = "netbsd",
target_os = "openbsd"
))]
return imp::reveal_items_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)
}
/// Reveal the paths the system's default explorer.
///
/// ## Platform-specific:
///
/// - **Android / iOS:** Unsupported.
pub fn reveal_items_in_dir<I, P>(paths: I) -> crate::Result<()>
where
I: IntoIterator<Item = P>,
P: AsRef<Path>,
{
let mut canonicalized = vec![];
for path in paths {
let path = dunce::canonicalize(path.as_ref())?;
canonicalized.push(path);
}
#[cfg(any(
windows,
target_os = "macos",
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
return imp::reveal_items_in_dir(&canonicalized);
return imp::reveal_item_in_dir(&path);
#[cfg(not(any(
windows,
@@ -77,10 +37,8 @@ where
#[cfg(windows)]
mod imp {
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use super::*;
use windows::Win32::UI::Shell::Common::ITEMIDLIST;
use windows::{
core::{w, HSTRING, PCWSTR},
Win32::{
@@ -96,98 +54,57 @@ mod imp {
},
};
pub fn reveal_items_in_dir(paths: &[PathBuf]) -> crate::Result<()> {
if paths.is_empty() {
return Ok(());
}
let mut grouped_paths: HashMap<&Path, Vec<&Path>> = HashMap::new();
for path in paths {
let parent = path
.parent()
.ok_or_else(|| crate::Error::NoParent(path.to_path_buf()))?;
grouped_paths.entry(parent).or_default().push(path);
}
pub fn reveal_item_in_dir(path: &Path) -> crate::Result<()> {
let file = dunce::simplified(path);
let _ = unsafe { CoInitialize(None) };
for (parent, to_reveals) in grouped_paths {
let parent_item_id_list = OwnedItemIdList::new(parent)?;
let to_reveals_item_id_list = to_reveals
.iter()
.map(|to_reveal| OwnedItemIdList::new(*to_reveal))
.collect::<crate::Result<Vec<_>>>()?;
if let Err(e) = unsafe {
SHOpenFolderAndSelectItems(
parent_item_id_list.item,
Some(
&to_reveals_item_id_list
.iter()
.map(|item| item.item)
.collect::<Vec<_>>(),
),
0,
)
} {
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).
//
// Note: we only handle the first file here if multiple of are present
if e.code().0 == ERROR_FILE_NOT_FOUND.0 as i32 {
let first_path = to_reveals[0];
let is_dir = first_path.is_dir();
let is_dir = file.is_dir();
let mut info = SHELLEXECUTEINFOW {
cbSize: std::mem::size_of::<SHELLEXECUTEINFOW>() as _,
nShow: SW_SHOWNORMAL.0,
lpFile: PCWSTR(parent_item_id_list.hstring.as_ptr()),
lpFile: PCWSTR(dir.as_ptr()),
lpClass: if is_dir { w!("folder") } else { PCWSTR::null() },
lpVerb: if is_dir {
w!("explore")
} else {
PCWSTR::null()
},
..Default::default()
..std::mem::zeroed()
};
unsafe { ShellExecuteExW(&mut info) }?;
ShellExecuteExW(&mut info).inspect_err(|_| {
ILFree(Some(dir_item));
ILFree(Some(file_item));
})?;
}
}
}
unsafe {
ILFree(Some(dir_item));
ILFree(Some(file_item));
}
Ok(())
}
struct OwnedItemIdList {
hstring: HSTRING,
item: *const ITEMIDLIST,
}
impl OwnedItemIdList {
fn new(path: &Path) -> crate::Result<Self> {
let path_hstring = HSTRING::from(path);
let item_id_list = unsafe { ILCreateFromPathW(&path_hstring) };
if item_id_list.is_null() {
Err(crate::Error::FailedToConvertPathToItemIdList(
path.to_owned(),
))
} else {
Ok(Self {
hstring: path_hstring,
item: item_id_list,
})
}
}
}
impl Drop for OwnedItemIdList {
fn drop(&mut self) {
if !self.item.is_null() {
unsafe { ILFree(Some(self.item)) };
}
}
}
}
#[cfg(any(
@@ -198,36 +115,24 @@ mod imp {
target_os = "openbsd"
))]
mod imp {
use super::*;
use std::collections::HashMap;
use std::path::PathBuf;
pub fn reveal_items_in_dir(paths: &[PathBuf]) -> crate::Result<()> {
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(paths, &connection).or_else(|e| {
// Fallback to opening the directory of the first item if revealing multiple items fails.
if let Some(first_path) = paths.first() {
reveal_with_open_uri_portal(first_path, &connection)
} else {
Err(e)
}
})
reveal_with_filemanager1(path, &connection)
.or_else(|_| reveal_with_open_uri_portal(path, &connection))
}
fn reveal_with_filemanager1(
paths: &[PathBuf],
path: &Path,
connection: &zbus::blocking::Connection,
) -> crate::Result<()> {
let uris: Result<Vec<_>, _> = paths
.iter()
.map(|path| {
url::Url::from_file_path(path)
.map_err(|_| crate::Error::FailedToConvertPathToFileUrl)
})
.collect();
let uris = uris?;
let uri_strs: Vec<&str> = uris.iter().map(|uri| uri.as_str()).collect();
let uri = url::Url::from_file_path(path)
.map_err(|_| crate::Error::FailedToConvertPathToFileUrl)?;
#[zbus::proxy(
interface = "org.freedesktop.FileManager1",
@@ -240,7 +145,7 @@ mod imp {
let proxy = FileManager1ProxyBlocking::new(connection)?;
proxy.ShowItems(uri_strs, "")
proxy.ShowItems(vec![uri.as_str()], "")
}
fn reveal_with_open_uri_portal(
@@ -272,22 +177,14 @@ mod imp {
#[cfg(target_os = "macos")]
mod imp {
use super::*;
use objc2_app_kit::NSWorkspace;
use objc2_foundation::{NSArray, NSString, NSURL};
use std::path::PathBuf;
pub fn reveal_items_in_dir(paths: &[PathBuf]) -> crate::Result<()> {
pub fn reveal_item_in_dir(path: &Path) -> crate::Result<()> {
unsafe {
let mut urls = Vec::new();
for path in paths {
let path = path.to_string_lossy();
let path = NSString::from_str(&path);
let url = NSURL::fileURLWithPath(&path);
urls.push(url);
}
let path = path.to_string_lossy();
let path = NSString::from_str(&path);
let urls = vec![NSURL::fileURLWithPath(&path)];
let urls = NSArray::from_retained_slice(&urls);
let workspace = NSWorkspace::new();
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-os = { git = "https://github.com/tauri-apps/plugins-workspace", bra
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-os
# or
npm add @tauri-apps/plugin-os
# or
yarn add @tauri-apps/plugin-os
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-os#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-os#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-os#v2
```
## Usage
+9
View File
@@ -35,12 +35,21 @@ tauri-plugin-positioner = { git = "https://github.com/tauri-apps/plugins-workspa
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-positioner
# or
npm add @tauri-apps/plugin-positioner
# or
yarn add @tauri-apps/plugin-positioner
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-positioner#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-positioner#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-positioner#v2
```
## Usage
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-process = { git = "https://github.com/tauri-apps/plugins-workspace"
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-process
# or
npm add @tauri-apps/plugin-process
# or
yarn add @tauri-apps/plugin-process
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-process#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-process#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-process#v2
```
## Usage
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-shell = { git = "https://github.com/tauri-apps/plugins-workspace",
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-shell
# or
npm add @tauri-apps/plugin-shell
# or
yarn add @tauri-apps/plugin-shell
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-shell#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-shell#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-shell#v2
```
## Usage
+9
View File
@@ -35,12 +35,21 @@ 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-sql
# or
npm add @tauri-apps/plugin-sql
# or
yarn add @tauri-apps/plugin-sql
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-sql#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-sql#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-sql#v2
```
## Usage
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace",
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-store
# or
npm add @tauri-apps/plugin-store
# or
yarn add @tauri-apps/plugin-store
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-store#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-store#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-store#v2
```
## Usage
+1 -1
View File
@@ -1 +1 @@
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("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){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(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,options: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(t){await s("plugin:store|reload",{rid:this.rid,...t})}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(t){await(await this.store).reload(t)}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__})}
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("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){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(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__})}
+7 -30
View File
@@ -18,10 +18,6 @@ interface ChangePayload<T> {
* Options to create a store
*/
export type StoreOptions = {
/**
* Default value of the store
*/
defaults: { [key: string]: unknown }
/**
* Auto save on modification with debounce duration in milliseconds, it's 100ms by default, pass in `false` to disable it
*/
@@ -38,10 +34,6 @@ export type StoreOptions = {
* Force create a new store with default values even if it already exists.
*/
createNew?: boolean
/**
* When creating the store, override the store with the on-disk state if it exists, ignoring defaults
*/
overrideDefaults?: boolean
}
/**
@@ -153,8 +145,8 @@ export class LazyStore implements IStore {
return (await this.store).length()
}
async reload(options?: ReloadOptions): Promise<void> {
await (await this.store).reload(options)
async reload(): Promise<void> {
await (await this.store).reload()
}
async save(): Promise<void> {
@@ -204,7 +196,7 @@ export class Store extends Resource implements IStore {
static async load(path: string, options?: StoreOptions): Promise<Store> {
const rid = await invoke<number>('plugin:store|load', {
path,
options
...options
})
return new Store(rid)
}
@@ -288,8 +280,8 @@ export class Store extends Resource implements IStore {
return await invoke('plugin:store|length', { rid: this.rid })
}
async reload(options?: ReloadOptions): Promise<void> {
await invoke('plugin:store|reload', { rid: this.rid, ...options })
async reload(): Promise<void> {
await invoke('plugin:store|reload', { rid: this.rid })
}
async save(): Promise<void> {
@@ -404,15 +396,10 @@ interface IStore {
*
* This method is useful if the on-disk state was edited by the user and you want to synchronize the changes.
*
* Note:
* - This method loads the data and merges it with the current store,
* this behavior will be changed to resetting to default first and then merging with the on-disk state in v3,
* to fully match the store with the on-disk state, set {@linkcode ReloadOptions.ignoreDefaults} to `true`
* - This method does not emit change events.
*
* Note: This method does not emit change events.
* @returns
*/
reload(options?: ReloadOptions): Promise<void>
reload(): Promise<void>
/**
* Saves the store to disk at the store's `path`.
@@ -450,13 +437,3 @@ interface IStore {
*/
close(): Promise<void>
}
/**
* Options to {@linkcode IStore.reload} a {@linkcode IStore}
*/
export type ReloadOptions = {
/**
* To fully match the store with the on-disk state, ignoring defaults
*/
ignoreDefaults?: boolean
}
+23 -43
View File
@@ -53,36 +53,17 @@ enum AutoSave {
Bool(bool),
}
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct LoadStoreOptions {
defaults: Option<HashMap<String, JsonValue>>,
auto_save: Option<AutoSave>,
serialize_fn_name: Option<String>,
deserialize_fn_name: Option<String>,
#[serde(default)]
create_new: bool,
#[serde(default)]
override_defaults: bool,
}
fn builder<R: Runtime>(
app: AppHandle<R>,
store_state: State<'_, StoreState>,
path: PathBuf,
options: Option<LoadStoreOptions>,
auto_save: Option<AutoSave>,
serialize_fn_name: Option<String>,
deserialize_fn_name: Option<String>,
create_new: bool,
) -> Result<StoreBuilder<R>> {
let mut builder = app.store_builder(path);
let Some(options) = options else {
return Ok(builder);
};
if let Some(defaults) = options.defaults {
builder = builder.defaults(defaults);
}
if let Some(auto_save) = options.auto_save {
if let Some(auto_save) = auto_save {
match auto_save {
AutoSave::DebounceDuration(duration) => {
builder = builder.auto_save(Duration::from_millis(duration));
@@ -94,7 +75,7 @@ fn builder<R: Runtime>(
}
}
if let Some(serialize_fn_name) = options.serialize_fn_name {
if let Some(serialize_fn_name) = serialize_fn_name {
let serialize_fn = store_state
.serialize_fns
.get(&serialize_fn_name)
@@ -102,7 +83,7 @@ fn builder<R: Runtime>(
builder = builder.serialize(*serialize_fn);
}
if let Some(deserialize_fn_name) = options.deserialize_fn_name {
if let Some(deserialize_fn_name) = deserialize_fn_name {
let deserialize_fn = store_state
.deserialize_fns
.get(&deserialize_fn_name)
@@ -110,14 +91,10 @@ fn builder<R: Runtime>(
builder = builder.deserialize(*deserialize_fn);
}
if options.create_new {
if create_new {
builder = builder.create_new();
}
if options.override_defaults {
builder = builder.override_defaults();
}
Ok(builder)
}
@@ -126,9 +103,20 @@ async fn load<R: Runtime>(
app: AppHandle<R>,
store_state: State<'_, StoreState>,
path: PathBuf,
options: Option<LoadStoreOptions>,
auto_save: Option<AutoSave>,
serialize_fn_name: Option<String>,
deserialize_fn_name: Option<String>,
create_new: Option<bool>,
) -> Result<ResourceId> {
let builder = builder(app, store_state, path, options)?;
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)
}
@@ -221,17 +209,9 @@ async fn length<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> Result<usize>
}
#[tauri::command]
async fn reload<R: Runtime>(
app: AppHandle<R>,
rid: ResourceId,
ignore_defaults: Option<bool>,
) -> Result<()> {
async fn reload<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> Result<()> {
let store = app.resources_table().get::<Store<R>>(rid)?;
if ignore_defaults.unwrap_or_default() {
store.reload_ignore_defaults()
} else {
store.reload()
}
store.reload()
}
#[tauri::command]
+1 -36
View File
@@ -39,7 +39,6 @@ pub struct StoreBuilder<R: Runtime> {
deserialize_fn: DeserializeFn,
auto_save: Option<Duration>,
create_new: bool,
override_defaults: bool,
}
impl<R: Runtime> StoreBuilder<R> {
@@ -67,7 +66,6 @@ impl<R: Runtime> StoreBuilder<R> {
deserialize_fn,
auto_save: Some(Duration::from_millis(100)),
create_new: false,
override_defaults: false,
}
}
@@ -180,12 +178,6 @@ impl<R: Runtime> StoreBuilder<R> {
self
}
/// Override the store values when creating the store, ignoring defaults.
pub fn override_defaults(mut self) -> Self {
self.override_defaults = true;
self
}
pub(crate) fn build_inner(mut self) -> crate::Result<(Arc<Store<R>>, ResourceId)> {
let stores = self.app.state::<StoreState>().stores.clone();
let mut stores = stores.lock().unwrap();
@@ -213,11 +205,7 @@ impl<R: Runtime> StoreBuilder<R> {
);
if !self.create_new {
if self.override_defaults {
let _ = store_inner.load_ignore_defaults();
} else {
let _ = store_inner.load();
}
let _ = store_inner.load();
}
let store = Store {
@@ -296,8 +284,6 @@ impl<R: Runtime> StoreInner<R> {
}
/// Update the store from the on-disk state
///
/// Note: This method loads the data and merges it with the current store
pub fn load(&mut self) -> crate::Result<()> {
let bytes = fs::read(&self.path)?;
@@ -307,13 +293,6 @@ impl<R: Runtime> StoreInner<R> {
Ok(())
}
/// Load the store from the on-disk state, ignoring defaults
pub fn load_ignore_defaults(&mut self) -> crate::Result<()> {
let bytes = fs::read(&self.path)?;
self.cache = (self.deserialize_fn)(&bytes).map_err(crate::Error::Deserialize)?;
Ok(())
}
/// Inserts a key-value pair into the store.
pub fn set(&mut self, key: impl Into<String>, value: impl Into<JsonValue>) {
let key = key.into();
@@ -520,24 +499,10 @@ impl<R: Runtime> Store<R> {
}
/// Update the store from the on-disk state
///
/// Note:
/// - This method loads the data and merges it with the current store,
/// this behavior will be changed to resetting to default first and then merging with the on-disk state in v3,
/// to fully match the store with the on-disk state,
/// use [`reload_override_defaults`](Self::reload_override_defaults) instead
/// - This method does not emit change events
pub fn reload(&self) -> crate::Result<()> {
self.store.lock().unwrap().load()
}
/// Load the store from the on-disk state, ignoring defaults
///
/// Note: This method does not emit change events
pub fn reload_ignore_defaults(&self) -> crate::Result<()> {
self.store.lock().unwrap().load_ignore_defaults()
}
/// 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() {
+3 -3
View File
@@ -34,11 +34,11 @@ iota-crypto = "0.23"
hex = "0.4"
zeroize = { version = "1", features = ["zeroize_derive"] }
rust-argon2 = { version = "2", optional = true }
rand_chacha = { version = "0.9", optional = true }
rand_core = { version = "0.9", features = ["os_rng"], optional = true }
rand_chacha = { version = "0.3.1", optional = true }
rand_core = { version = "0.6.4", features = ["getrandom"], optional = true }
[dev-dependencies]
rand = "0.9"
rand = "0.8"
rusty-fork = "0.3"
[features]
+7
View File
@@ -41,6 +41,13 @@ pnpm add @tauri-apps/plugin-stronghold
npm add @tauri-apps/plugin-stronghold
# or
yarn add @tauri-apps/plugin-stronghold
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-stronghold#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-stronghold#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-stronghold#v2
```
## Usage
+1 -1
View File
@@ -32,7 +32,7 @@ fn create_or_get_salt(salt: &mut [u8], salt_path: &Path) {
salt.clone_from_slice(&tmp);
} else {
// Generate new salt
let mut gen = ChaCha20Rng::from_os_rng();
let mut gen = ChaCha20Rng::from_entropy();
gen.fill_bytes(salt);
std::fs::write(salt_path, salt).expect("Failed to write salt for Stronghold")
}
+9
View File
@@ -34,12 +34,21 @@ tauri-plugin-updater = { git = "https://github.com/tauri-apps/plugins-workspace"
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-updater
# or
npm add @tauri-apps/plugin-updater
# or
yarn add @tauri-apps/plugin-updater
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-updater#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-updater#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-updater#v2
```
## Usage
+9
View File
@@ -34,12 +34,21 @@ tauri-plugin-upload = { git = "https://github.com/tauri-apps/plugins-workspace",
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-upload
# or
npm add @tauri-apps/plugin-upload
# or
yarn add @tauri-apps/plugin-upload
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-upload#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-upload#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-upload#v2
```
## Usage
+1 -1
View File
@@ -31,7 +31,7 @@ tauri = { workspace = true }
log = { workspace = true }
thiserror = { workspace = true }
http = "1"
rand = "0.9"
rand = "0.8"
futures-util = "0.3"
tokio = { version = "1", features = ["net", "sync"] }
tokio-tungstenite = { version = "0.27" }
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-websocket = { git = "https://github.com/tauri-apps/plugins-workspac
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-websocket
# or
npm add @tauri-apps/plugin-websocket
# or
yarn add @tauri-apps/plugin-websocket
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-websocket#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-websocket#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-websocket#v2
```
## Usage
@@ -29,7 +29,7 @@ async fn accept_connection(stream: TcpStream) {
let (write, read) = ws_stream.split();
if let Err(e) = read.forward(write).await {
eprintln!("Error: {}", e);
eprintln!("Error: {e}");
}
}
+9
View File
@@ -33,12 +33,21 @@ tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-works
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-window-state
# or
npm add @tauri-apps/plugin-window-state
# or
yarn add @tauri-apps/plugin-window-state
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-window-state#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-window-state#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-window-state#v2
```
## Usage
+251 -249
View File
@@ -12,26 +12,26 @@ importers:
.:
devDependencies:
'@eslint/js':
specifier: 9.32.0
version: 9.32.0
specifier: 9.31.0
version: 9.31.0
'@rollup/plugin-node-resolve':
specifier: 16.0.1
version: 16.0.1(rollup@4.46.2)
version: 16.0.1(rollup@4.45.1)
'@rollup/plugin-terser':
specifier: 0.4.4
version: 0.4.4(rollup@4.46.2)
version: 0.4.4(rollup@4.45.1)
'@rollup/plugin-typescript':
specifier: 12.1.4
version: 12.1.4(rollup@4.46.2)(tslib@2.8.1)(typescript@5.9.2)
version: 12.1.4(rollup@4.45.1)(tslib@2.8.1)(typescript@5.8.3)
covector:
specifier: ^0.12.4
version: 0.12.4(mocha@10.8.2)
eslint:
specifier: 9.32.0
version: 9.32.0(jiti@2.4.2)
specifier: 9.31.0
version: 9.31.0(jiti@2.4.2)
eslint-config-prettier:
specifier: 10.1.8
version: 10.1.8(eslint@9.32.0(jiti@2.4.2))
version: 10.1.8(eslint@9.31.0(jiti@2.4.2))
eslint-plugin-security:
specifier: 3.0.1
version: 3.0.1
@@ -39,17 +39,17 @@ importers:
specifier: 3.6.2
version: 3.6.2
rollup:
specifier: 4.46.2
version: 4.46.2
specifier: 4.45.1
version: 4.45.1
tslib:
specifier: 2.8.1
version: 2.8.1
typescript:
specifier: 5.9.2
version: 5.9.2
specifier: 5.8.3
version: 5.8.3
typescript-eslint:
specifier: 8.39.0
version: 8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)
specifier: 8.38.0
version: 8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)
examples/api:
dependencies:
@@ -69,7 +69,7 @@ importers:
specifier: ^2.3.0
version: link:../../plugins/clipboard-manager
'@tauri-apps/plugin-dialog':
specifier: ^2.3.2
specifier: ^2.3.1
version: link:../../plugins/dialog
'@tauri-apps/plugin-fs':
specifier: ^2.4.1
@@ -137,7 +137,7 @@ importers:
version: 5.28.2
unocss:
specifier: ^66.3.3
version: 66.3.3(postcss@8.5.6)(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.9.2))
version: 66.3.3(postcss@8.5.6)(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.8.3))
vite:
specifier: ^7.0.4
version: 7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2)
@@ -192,7 +192,7 @@ importers:
version: 2.7.1
typescript:
specifier: ^5.7.3
version: 5.9.2
version: 5.8.3
vite:
specifier: ^7.0.4
version: 7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2)
@@ -306,7 +306,7 @@ importers:
version: 2.7.1
typescript:
specifier: ^5.7.3
version: 5.9.2
version: 5.8.3
vite:
specifier: ^7.0.4
version: 7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2)
@@ -346,7 +346,7 @@ importers:
version: 2.7.1
typescript:
specifier: ^5.7.3
version: 5.9.2
version: 5.8.3
vite:
specifier: ^7.0.4
version: 7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2)
@@ -628,16 +628,16 @@ packages:
resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/js@9.32.0':
resolution: {integrity: sha512-BBpRFZK3eX6uMLKz8WxFOBIFFcGFJ/g8XuwjTHCqHROSIsopI+ddn/d5Cfh36+7+e5edVS8dbSHnBNhrLEX0zg==}
'@eslint/js@9.31.0':
resolution: {integrity: sha512-LOm5OVt7D4qiKCqoiPbA7LWmI+tbw1VbTUowBcUMgQSuM6poJufkFkYDcQpo5KfgD39TnNySV26QjOh7VFpSyw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/object-schema@2.1.6':
resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/plugin-kit@0.3.4':
resolution: {integrity: sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==}
'@eslint/plugin-kit@0.3.3':
resolution: {integrity: sha512-1+WqvgNMhmlAambTvT3KPtCl/Ibr68VldY2XY40SL1CE0ZXiakFR/cbTspaF5HsnpDMvcYYoJHfl4980NBjGag==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@humanfs/core@0.19.1':
@@ -752,103 +752,103 @@ packages:
rollup:
optional: true
'@rollup/rollup-android-arm-eabi@4.46.2':
resolution: {integrity: sha512-Zj3Hl6sN34xJtMv7Anwb5Gu01yujyE/cLBDB2gnHTAHaWS1Z38L7kuSG+oAh0giZMqG060f/YBStXtMH6FvPMA==}
'@rollup/rollup-android-arm-eabi@4.45.1':
resolution: {integrity: sha512-NEySIFvMY0ZQO+utJkgoMiCAjMrGvnbDLHvcmlA33UXJpYBCvlBEbMMtV837uCkS+plG2umfhn0T5mMAxGrlRA==}
cpu: [arm]
os: [android]
'@rollup/rollup-android-arm64@4.46.2':
resolution: {integrity: sha512-nTeCWY83kN64oQ5MGz3CgtPx8NSOhC5lWtsjTs+8JAJNLcP3QbLCtDDgUKQc/Ro/frpMq4SHUaHN6AMltcEoLQ==}
'@rollup/rollup-android-arm64@4.45.1':
resolution: {integrity: sha512-ujQ+sMXJkg4LRJaYreaVx7Z/VMgBBd89wGS4qMrdtfUFZ+TSY5Rs9asgjitLwzeIbhwdEhyj29zhst3L1lKsRQ==}
cpu: [arm64]
os: [android]
'@rollup/rollup-darwin-arm64@4.46.2':
resolution: {integrity: sha512-HV7bW2Fb/F5KPdM/9bApunQh68YVDU8sO8BvcW9OngQVN3HHHkw99wFupuUJfGR9pYLLAjcAOA6iO+evsbBaPQ==}
'@rollup/rollup-darwin-arm64@4.45.1':
resolution: {integrity: sha512-FSncqHvqTm3lC6Y13xncsdOYfxGSLnP+73k815EfNmpewPs+EyM49haPS105Rh4aF5mJKywk9X0ogzLXZzN9lA==}
cpu: [arm64]
os: [darwin]
'@rollup/rollup-darwin-x64@4.46.2':
resolution: {integrity: sha512-SSj8TlYV5nJixSsm/y3QXfhspSiLYP11zpfwp6G/YDXctf3Xkdnk4woJIF5VQe0of2OjzTt8EsxnJDCdHd2xMA==}
'@rollup/rollup-darwin-x64@4.45.1':
resolution: {integrity: sha512-2/vVn/husP5XI7Fsf/RlhDaQJ7x9zjvC81anIVbr4b/f0xtSmXQTFcGIQ/B1cXIYM6h2nAhJkdMHTnD7OtQ9Og==}
cpu: [x64]
os: [darwin]
'@rollup/rollup-freebsd-arm64@4.46.2':
resolution: {integrity: sha512-ZyrsG4TIT9xnOlLsSSi9w/X29tCbK1yegE49RYm3tu3wF1L/B6LVMqnEWyDB26d9Ecx9zrmXCiPmIabVuLmNSg==}
'@rollup/rollup-freebsd-arm64@4.45.1':
resolution: {integrity: sha512-4g1kaDxQItZsrkVTdYQ0bxu4ZIQ32cotoQbmsAnW1jAE4XCMbcBPDirX5fyUzdhVCKgPcrwWuucI8yrVRBw2+g==}
cpu: [arm64]
os: [freebsd]
'@rollup/rollup-freebsd-x64@4.46.2':
resolution: {integrity: sha512-pCgHFoOECwVCJ5GFq8+gR8SBKnMO+xe5UEqbemxBpCKYQddRQMgomv1104RnLSg7nNvgKy05sLsY51+OVRyiVw==}
'@rollup/rollup-freebsd-x64@4.45.1':
resolution: {integrity: sha512-L/6JsfiL74i3uK1Ti2ZFSNsp5NMiM4/kbbGEcOCps99aZx3g8SJMO1/9Y0n/qKlWZfn6sScf98lEOUe2mBvW9A==}
cpu: [x64]
os: [freebsd]
'@rollup/rollup-linux-arm-gnueabihf@4.46.2':
resolution: {integrity: sha512-EtP8aquZ0xQg0ETFcxUbU71MZlHaw9MChwrQzatiE8U/bvi5uv/oChExXC4mWhjiqK7azGJBqU0tt5H123SzVA==}
'@rollup/rollup-linux-arm-gnueabihf@4.45.1':
resolution: {integrity: sha512-RkdOTu2jK7brlu+ZwjMIZfdV2sSYHK2qR08FUWcIoqJC2eywHbXr0L8T/pONFwkGukQqERDheaGTeedG+rra6Q==}
cpu: [arm]
os: [linux]
'@rollup/rollup-linux-arm-musleabihf@4.46.2':
resolution: {integrity: sha512-qO7F7U3u1nfxYRPM8HqFtLd+raev2K137dsV08q/LRKRLEc7RsiDWihUnrINdsWQxPR9jqZ8DIIZ1zJJAm5PjQ==}
'@rollup/rollup-linux-arm-musleabihf@4.45.1':
resolution: {integrity: sha512-3kJ8pgfBt6CIIr1o+HQA7OZ9mp/zDk3ctekGl9qn/pRBgrRgfwiffaUmqioUGN9hv0OHv2gxmvdKOkARCtRb8Q==}
cpu: [arm]
os: [linux]
'@rollup/rollup-linux-arm64-gnu@4.46.2':
resolution: {integrity: sha512-3dRaqLfcOXYsfvw5xMrxAk9Lb1f395gkoBYzSFcc/scgRFptRXL9DOaDpMiehf9CO8ZDRJW2z45b6fpU5nwjng==}
'@rollup/rollup-linux-arm64-gnu@4.45.1':
resolution: {integrity: sha512-k3dOKCfIVixWjG7OXTCOmDfJj3vbdhN0QYEqB+OuGArOChek22hn7Uy5A/gTDNAcCy5v2YcXRJ/Qcnm4/ma1xw==}
cpu: [arm64]
os: [linux]
'@rollup/rollup-linux-arm64-musl@4.46.2':
resolution: {integrity: sha512-fhHFTutA7SM+IrR6lIfiHskxmpmPTJUXpWIsBXpeEwNgZzZZSg/q4i6FU4J8qOGyJ0TR+wXBwx/L7Ho9z0+uDg==}
'@rollup/rollup-linux-arm64-musl@4.45.1':
resolution: {integrity: sha512-PmI1vxQetnM58ZmDFl9/Uk2lpBBby6B6rF4muJc65uZbxCs0EA7hhKCk2PKlmZKuyVSHAyIw3+/SiuMLxKxWog==}
cpu: [arm64]
os: [linux]
'@rollup/rollup-linux-loongarch64-gnu@4.46.2':
resolution: {integrity: sha512-i7wfGFXu8x4+FRqPymzjD+Hyav8l95UIZ773j7J7zRYc3Xsxy2wIn4x+llpunexXe6laaO72iEjeeGyUFmjKeA==}
'@rollup/rollup-linux-loongarch64-gnu@4.45.1':
resolution: {integrity: sha512-9UmI0VzGmNJ28ibHW2GpE2nF0PBQqsyiS4kcJ5vK+wuwGnV5RlqdczVocDSUfGX/Na7/XINRVoUgJyFIgipoRg==}
cpu: [loong64]
os: [linux]
'@rollup/rollup-linux-ppc64-gnu@4.46.2':
resolution: {integrity: sha512-B/l0dFcHVUnqcGZWKcWBSV2PF01YUt0Rvlurci5P+neqY/yMKchGU8ullZvIv5e8Y1C6wOn+U03mrDylP5q9Yw==}
'@rollup/rollup-linux-powerpc64le-gnu@4.45.1':
resolution: {integrity: sha512-7nR2KY8oEOUTD3pBAxIBBbZr0U7U+R9HDTPNy+5nVVHDXI4ikYniH1oxQz9VoB5PbBU1CZuDGHkLJkd3zLMWsg==}
cpu: [ppc64]
os: [linux]
'@rollup/rollup-linux-riscv64-gnu@4.46.2':
resolution: {integrity: sha512-32k4ENb5ygtkMwPMucAb8MtV8olkPT03oiTxJbgkJa7lJ7dZMr0GCFJlyvy+K8iq7F/iuOr41ZdUHaOiqyR3iQ==}
'@rollup/rollup-linux-riscv64-gnu@4.45.1':
resolution: {integrity: sha512-nlcl3jgUultKROfZijKjRQLUu9Ma0PeNv/VFHkZiKbXTBQXhpytS8CIj5/NfBeECZtY2FJQubm6ltIxm/ftxpw==}
cpu: [riscv64]
os: [linux]
'@rollup/rollup-linux-riscv64-musl@4.46.2':
resolution: {integrity: sha512-t5B2loThlFEauloaQkZg9gxV05BYeITLvLkWOkRXogP4qHXLkWSbSHKM9S6H1schf/0YGP/qNKtiISlxvfmmZw==}
'@rollup/rollup-linux-riscv64-musl@4.45.1':
resolution: {integrity: sha512-HJV65KLS51rW0VY6rvZkiieiBnurSzpzore1bMKAhunQiECPuxsROvyeaot/tcK3A3aGnI+qTHqisrpSgQrpgA==}
cpu: [riscv64]
os: [linux]
'@rollup/rollup-linux-s390x-gnu@4.46.2':
resolution: {integrity: sha512-YKjekwTEKgbB7n17gmODSmJVUIvj8CX7q5442/CK80L8nqOUbMtf8b01QkG3jOqyr1rotrAnW6B/qiHwfcuWQA==}
'@rollup/rollup-linux-s390x-gnu@4.45.1':
resolution: {integrity: sha512-NITBOCv3Qqc6hhwFt7jLV78VEO/il4YcBzoMGGNxznLgRQf43VQDae0aAzKiBeEPIxnDrACiMgbqjuihx08OOw==}
cpu: [s390x]
os: [linux]
'@rollup/rollup-linux-x64-gnu@4.46.2':
resolution: {integrity: sha512-Jj5a9RUoe5ra+MEyERkDKLwTXVu6s3aACP51nkfnK9wJTraCC8IMe3snOfALkrjTYd2G1ViE1hICj0fZ7ALBPA==}
'@rollup/rollup-linux-x64-gnu@4.45.1':
resolution: {integrity: sha512-+E/lYl6qu1zqgPEnTrs4WysQtvc/Sh4fC2nByfFExqgYrqkKWp1tWIbe+ELhixnenSpBbLXNi6vbEEJ8M7fiHw==}
cpu: [x64]
os: [linux]
'@rollup/rollup-linux-x64-musl@4.46.2':
resolution: {integrity: sha512-7kX69DIrBeD7yNp4A5b81izs8BqoZkCIaxQaOpumcJ1S/kmqNFjPhDu1LHeVXv0SexfHQv5cqHsxLOjETuqDuA==}
'@rollup/rollup-linux-x64-musl@4.45.1':
resolution: {integrity: sha512-a6WIAp89p3kpNoYStITT9RbTbTnqarU7D8N8F2CV+4Cl9fwCOZraLVuVFvlpsW0SbIiYtEnhCZBPLoNdRkjQFw==}
cpu: [x64]
os: [linux]
'@rollup/rollup-win32-arm64-msvc@4.46.2':
resolution: {integrity: sha512-wiJWMIpeaak/jsbaq2HMh/rzZxHVW1rU6coyeNNpMwk5isiPjSTx0a4YLSlYDwBH/WBvLz+EtsNqQScZTLJy3g==}
'@rollup/rollup-win32-arm64-msvc@4.45.1':
resolution: {integrity: sha512-T5Bi/NS3fQiJeYdGvRpTAP5P02kqSOpqiopwhj0uaXB6nzs5JVi2XMJb18JUSKhCOX8+UE1UKQufyD6Or48dJg==}
cpu: [arm64]
os: [win32]
'@rollup/rollup-win32-ia32-msvc@4.46.2':
resolution: {integrity: sha512-gBgaUDESVzMgWZhcyjfs9QFK16D8K6QZpwAaVNJxYDLHWayOta4ZMjGm/vsAEy3hvlS2GosVFlBlP9/Wb85DqQ==}
'@rollup/rollup-win32-ia32-msvc@4.45.1':
resolution: {integrity: sha512-lxV2Pako3ujjuUe9jiU3/s7KSrDfH6IgTSQOnDWr9aJ92YsFd7EurmClK0ly/t8dzMkDtd04g60WX6yl0sGfdw==}
cpu: [ia32]
os: [win32]
'@rollup/rollup-win32-x64-msvc@4.46.2':
resolution: {integrity: sha512-CvUo2ixeIQGtF6WvuB87XWqPQkoFAFqW+HUo/WzHwuHDvIwZCtjdWXoYCcr06iKGydiqTclC4jU/TNObC/xKZg==}
'@rollup/rollup-win32-x64-msvc@4.45.1':
resolution: {integrity: sha512-M/fKi4sasCdM8i0aWJjCSFm2qEnYRR8AMLG2kxp6wD13+tMGA4Z1tVAuHkNRjud5SW2EM3naLuK35w9twvf6aA==}
cpu: [x64]
os: [win32]
@@ -961,63 +961,63 @@ packages:
'@types/unist@2.0.11':
resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==}
'@typescript-eslint/eslint-plugin@8.39.0':
resolution: {integrity: sha512-bhEz6OZeUR+O/6yx9Jk6ohX6H9JSFTaiY0v9/PuKT3oGK0rn0jNplLmyFUGV+a9gfYnVNwGDwS/UkLIuXNb2Rw==}
'@typescript-eslint/eslint-plugin@8.38.0':
resolution: {integrity: sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
'@typescript-eslint/parser': ^8.39.0
'@typescript-eslint/parser': ^8.38.0
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <6.0.0'
typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/parser@8.39.0':
resolution: {integrity: sha512-g3WpVQHngx0aLXn6kfIYCZxM6rRJlWzEkVpqEFLT3SgEDsp9cpCbxxgwnE504q4H+ruSDh/VGS6nqZIDynP+vg==}
'@typescript-eslint/parser@8.38.0':
resolution: {integrity: sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <6.0.0'
typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/project-service@8.39.0':
resolution: {integrity: sha512-CTzJqaSq30V/Z2Og9jogzZt8lJRR5TKlAdXmWgdu4hgcC9Kww5flQ+xFvMxIBWVNdxJO7OifgdOK4PokMIWPew==}
'@typescript-eslint/project-service@8.38.0':
resolution: {integrity: sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '>=4.8.4 <6.0.0'
typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/scope-manager@8.39.0':
resolution: {integrity: sha512-8QOzff9UKxOh6npZQ/4FQu4mjdOCGSdO3p44ww0hk8Vu+IGbg0tB/H1LcTARRDzGCC8pDGbh2rissBuuoPgH8A==}
'@typescript-eslint/scope-manager@8.38.0':
resolution: {integrity: sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/tsconfig-utils@8.39.0':
resolution: {integrity: sha512-Fd3/QjmFV2sKmvv3Mrj8r6N8CryYiCS8Wdb/6/rgOXAWGcFuc+VkQuG28uk/4kVNVZBQuuDHEDUpo/pQ32zsIQ==}
'@typescript-eslint/tsconfig-utils@8.38.0':
resolution: {integrity: sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '>=4.8.4 <6.0.0'
typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/type-utils@8.39.0':
resolution: {integrity: sha512-6B3z0c1DXVT2vYA9+z9axjtc09rqKUPRmijD5m9iv8iQpHBRYRMBcgxSiKTZKm6FwWw1/cI4v6em35OsKCiN5Q==}
'@typescript-eslint/type-utils@8.38.0':
resolution: {integrity: sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <6.0.0'
typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/types@8.39.0':
resolution: {integrity: sha512-ArDdaOllnCj3yn/lzKn9s0pBQYmmyme/v1HbGIGB0GB/knFI3fWMHloC+oYTJW46tVbYnGKTMDK4ah1sC2v0Kg==}
'@typescript-eslint/types@8.38.0':
resolution: {integrity: sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/typescript-estree@8.39.0':
resolution: {integrity: sha512-ndWdiflRMvfIgQRpckQQLiB5qAKQ7w++V4LlCHwp62eym1HLB/kw7D9f2e8ytONls/jt89TEasgvb+VwnRprsw==}
'@typescript-eslint/typescript-estree@8.38.0':
resolution: {integrity: sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '>=4.8.4 <6.0.0'
typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/utils@8.39.0':
resolution: {integrity: sha512-4GVSvNA0Vx1Ktwvf4sFE+exxJ3QGUorQG1/A5mRfRNZtkBT2xrA/BCO2H0eALx/PnvCS6/vmYwRdDA41EoffkQ==}
'@typescript-eslint/utils@8.38.0':
resolution: {integrity: sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <6.0.0'
typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/visitor-keys@8.39.0':
resolution: {integrity: sha512-ldgiJ+VAhQCfIjeOgu8Kj5nSxds0ktPOSO9p4+0VDH2R2pLvQraaM5Oen2d7NxzMCm+Sn/vJT+mv2H5u6b/3fA==}
'@typescript-eslint/visitor-keys@8.38.0':
resolution: {integrity: sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@unocss/astro@66.3.3':
@@ -1397,8 +1397,8 @@ packages:
resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint@9.32.0:
resolution: {integrity: sha512-LSehfdpgMeWcTZkWZVIJl+tkZ2nuSkyyB9C27MZqFWXuph7DvaowgcTvKqxvpLW1JZIk8PN7hFY3Rj9LQ7m7lg==}
eslint@9.31.0:
resolution: {integrity: sha512-QldCVh/ztyKJJZLr4jXNUByx3gR+TDYZCRXEktiZoUR3PGy4qCmSbkxcIle8GEwGpb5JBZazlaJ/CxLidXdEbQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
hasBin: true
peerDependencies:
@@ -1958,8 +1958,8 @@ packages:
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
rollup@4.46.2:
resolution: {integrity: sha512-WMmLFI+Boh6xbop+OAGo9cQ3OgX9MIg7xOQjn+pTCwOkk+FNDAeAemXkJ3HzDJrVXleLOFVa1ipuc1AmEx1Dwg==}
rollup@4.45.1:
resolution: {integrity: sha512-4iya7Jb76fVpQyLoiVpzUrsjQ12r3dM7fIVz+4NwoYvZOShknRmiv+iu9CClZml5ZLGb0XMcYLutK6w9tgxHDw==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
@@ -2113,15 +2113,15 @@ packages:
resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==}
engines: {node: '>=8'}
typescript-eslint@8.39.0:
resolution: {integrity: sha512-lH8FvtdtzcHJCkMOKnN73LIn6SLTpoojgJqDAxPm1jCR14eWSGPX8ul/gggBdPMk/d5+u9V854vTYQ8T5jF/1Q==}
typescript-eslint@8.38.0:
resolution: {integrity: sha512-FsZlrYK6bPDGoLeZRuvx2v6qrM03I0U0SnfCLPs/XCCPCFD80xU9Pg09H/K+XFa68uJuZo7l/Xhs+eDRg2l3hg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <6.0.0'
typescript: '>=4.8.4 <5.9.0'
typescript@5.9.2:
resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==}
typescript@5.8.3:
resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==}
engines: {node: '>=14.17'}
hasBin: true
@@ -2342,9 +2342,9 @@ snapshots:
- encoding
- mocha
'@covector/assemble@0.12.0':
'@covector/assemble@0.12.0(mocha@10.8.2)':
dependencies:
'@covector/command': 0.8.0
'@covector/command': 0.8.0(mocha@10.8.2)
'@covector/files': 0.8.0
effection: 2.0.8(mocha@10.8.2)
js-yaml: 4.1.0
@@ -2355,9 +2355,10 @@ snapshots:
unified: 9.2.2
transitivePeerDependencies:
- encoding
- mocha
- supports-color
'@covector/changelog@0.12.0':
'@covector/changelog@0.12.0(mocha@10.8.2)':
dependencies:
'@covector/files': 0.8.0
effection: 2.0.8(mocha@10.8.2)
@@ -2367,14 +2368,16 @@ snapshots:
unified: 9.2.2
transitivePeerDependencies:
- encoding
- mocha
- supports-color
'@covector/command@0.8.0':
'@covector/command@0.8.0(mocha@10.8.2)':
dependencies:
'@effection/process': 2.1.4
'@effection/process': 2.1.4(mocha@10.8.2)
effection: 2.0.8(mocha@10.8.2)
transitivePeerDependencies:
- encoding
- mocha
'@covector/files@0.8.0':
dependencies:
@@ -2421,10 +2424,8 @@ snapshots:
dependencies:
effection: 2.0.8(mocha@10.8.2)
mocha: 10.8.2
transitivePeerDependencies:
- encoding
'@effection/process@2.1.4':
'@effection/process@2.1.4(mocha@10.8.2)':
dependencies:
cross-spawn: 7.0.6
ctrlc-windows: 2.2.0
@@ -2432,6 +2433,7 @@ snapshots:
shellwords: 0.1.1
transitivePeerDependencies:
- encoding
- mocha
'@effection/stream@2.0.6':
dependencies:
@@ -2520,9 +2522,9 @@ snapshots:
'@esbuild/win32-x64@0.25.6':
optional: true
'@eslint-community/eslint-utils@4.7.0(eslint@9.32.0(jiti@2.4.2))':
'@eslint-community/eslint-utils@4.7.0(eslint@9.31.0(jiti@2.4.2))':
dependencies:
eslint: 9.32.0(jiti@2.4.2)
eslint: 9.31.0(jiti@2.4.2)
eslint-visitor-keys: 3.4.3
'@eslint-community/regexpp@4.12.1': {}
@@ -2555,11 +2557,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@eslint/js@9.32.0': {}
'@eslint/js@9.31.0': {}
'@eslint/object-schema@2.1.6': {}
'@eslint/plugin-kit@0.3.4':
'@eslint/plugin-kit@0.3.3':
dependencies:
'@eslint/core': 0.15.1
levn: 0.4.1
@@ -2640,99 +2642,99 @@ snapshots:
dependencies:
quansync: 0.2.10
'@rollup/plugin-node-resolve@16.0.1(rollup@4.46.2)':
'@rollup/plugin-node-resolve@16.0.1(rollup@4.45.1)':
dependencies:
'@rollup/pluginutils': 5.1.4(rollup@4.46.2)
'@rollup/pluginutils': 5.1.4(rollup@4.45.1)
'@types/resolve': 1.20.2
deepmerge: 4.3.1
is-module: 1.0.0
resolve: 1.22.10
optionalDependencies:
rollup: 4.46.2
rollup: 4.45.1
'@rollup/plugin-terser@0.4.4(rollup@4.46.2)':
'@rollup/plugin-terser@0.4.4(rollup@4.45.1)':
dependencies:
serialize-javascript: 6.0.2
smob: 1.5.0
terser: 5.39.0
optionalDependencies:
rollup: 4.46.2
rollup: 4.45.1
'@rollup/plugin-typescript@12.1.4(rollup@4.46.2)(tslib@2.8.1)(typescript@5.9.2)':
'@rollup/plugin-typescript@12.1.4(rollup@4.45.1)(tslib@2.8.1)(typescript@5.8.3)':
dependencies:
'@rollup/pluginutils': 5.1.4(rollup@4.46.2)
'@rollup/pluginutils': 5.1.4(rollup@4.45.1)
resolve: 1.22.10
typescript: 5.9.2
typescript: 5.8.3
optionalDependencies:
rollup: 4.46.2
rollup: 4.45.1
tslib: 2.8.1
'@rollup/pluginutils@5.1.4(rollup@4.46.2)':
'@rollup/pluginutils@5.1.4(rollup@4.45.1)':
dependencies:
'@types/estree': 1.0.8
estree-walker: 2.0.2
picomatch: 4.0.2
optionalDependencies:
rollup: 4.46.2
rollup: 4.45.1
'@rollup/rollup-android-arm-eabi@4.46.2':
'@rollup/rollup-android-arm-eabi@4.45.1':
optional: true
'@rollup/rollup-android-arm64@4.46.2':
'@rollup/rollup-android-arm64@4.45.1':
optional: true
'@rollup/rollup-darwin-arm64@4.46.2':
'@rollup/rollup-darwin-arm64@4.45.1':
optional: true
'@rollup/rollup-darwin-x64@4.46.2':
'@rollup/rollup-darwin-x64@4.45.1':
optional: true
'@rollup/rollup-freebsd-arm64@4.46.2':
'@rollup/rollup-freebsd-arm64@4.45.1':
optional: true
'@rollup/rollup-freebsd-x64@4.46.2':
'@rollup/rollup-freebsd-x64@4.45.1':
optional: true
'@rollup/rollup-linux-arm-gnueabihf@4.46.2':
'@rollup/rollup-linux-arm-gnueabihf@4.45.1':
optional: true
'@rollup/rollup-linux-arm-musleabihf@4.46.2':
'@rollup/rollup-linux-arm-musleabihf@4.45.1':
optional: true
'@rollup/rollup-linux-arm64-gnu@4.46.2':
'@rollup/rollup-linux-arm64-gnu@4.45.1':
optional: true
'@rollup/rollup-linux-arm64-musl@4.46.2':
'@rollup/rollup-linux-arm64-musl@4.45.1':
optional: true
'@rollup/rollup-linux-loongarch64-gnu@4.46.2':
'@rollup/rollup-linux-loongarch64-gnu@4.45.1':
optional: true
'@rollup/rollup-linux-ppc64-gnu@4.46.2':
'@rollup/rollup-linux-powerpc64le-gnu@4.45.1':
optional: true
'@rollup/rollup-linux-riscv64-gnu@4.46.2':
'@rollup/rollup-linux-riscv64-gnu@4.45.1':
optional: true
'@rollup/rollup-linux-riscv64-musl@4.46.2':
'@rollup/rollup-linux-riscv64-musl@4.45.1':
optional: true
'@rollup/rollup-linux-s390x-gnu@4.46.2':
'@rollup/rollup-linux-s390x-gnu@4.45.1':
optional: true
'@rollup/rollup-linux-x64-gnu@4.46.2':
'@rollup/rollup-linux-x64-gnu@4.45.1':
optional: true
'@rollup/rollup-linux-x64-musl@4.46.2':
'@rollup/rollup-linux-x64-musl@4.45.1':
optional: true
'@rollup/rollup-win32-arm64-msvc@4.46.2':
'@rollup/rollup-win32-arm64-msvc@4.45.1':
optional: true
'@rollup/rollup-win32-ia32-msvc@4.46.2':
'@rollup/rollup-win32-ia32-msvc@4.45.1':
optional: true
'@rollup/rollup-win32-x64-msvc@4.46.2':
'@rollup/rollup-win32-x64-msvc@4.45.1':
optional: true
'@sveltejs/acorn-typescript@1.0.5(acorn@8.15.0)':
@@ -2822,104 +2824,104 @@ snapshots:
'@types/unist@2.0.11': {}
'@typescript-eslint/eslint-plugin@8.39.0(@typescript-eslint/parser@8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2))(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)':
'@typescript-eslint/eslint-plugin@8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
'@eslint-community/regexpp': 4.12.1
'@typescript-eslint/parser': 8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)
'@typescript-eslint/scope-manager': 8.39.0
'@typescript-eslint/type-utils': 8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)
'@typescript-eslint/utils': 8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)
'@typescript-eslint/visitor-keys': 8.39.0
eslint: 9.32.0(jiti@2.4.2)
'@typescript-eslint/parser': 8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/scope-manager': 8.38.0
'@typescript-eslint/type-utils': 8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/utils': 8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/visitor-keys': 8.38.0
eslint: 9.31.0(jiti@2.4.2)
graphemer: 1.4.0
ignore: 7.0.4
natural-compare: 1.4.0
ts-api-utils: 2.1.0(typescript@5.9.2)
typescript: 5.9.2
ts-api-utils: 2.1.0(typescript@5.8.3)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/parser@8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)':
'@typescript-eslint/parser@8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
'@typescript-eslint/scope-manager': 8.39.0
'@typescript-eslint/types': 8.39.0
'@typescript-eslint/typescript-estree': 8.39.0(typescript@5.9.2)
'@typescript-eslint/visitor-keys': 8.39.0
'@typescript-eslint/scope-manager': 8.38.0
'@typescript-eslint/types': 8.38.0
'@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3)
'@typescript-eslint/visitor-keys': 8.38.0
debug: 4.4.1(supports-color@8.1.1)
eslint: 9.32.0(jiti@2.4.2)
typescript: 5.9.2
eslint: 9.31.0(jiti@2.4.2)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/project-service@8.39.0(typescript@5.9.2)':
'@typescript-eslint/project-service@8.38.0(typescript@5.8.3)':
dependencies:
'@typescript-eslint/tsconfig-utils': 8.39.0(typescript@5.9.2)
'@typescript-eslint/types': 8.39.0
'@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.8.3)
'@typescript-eslint/types': 8.38.0
debug: 4.4.1(supports-color@8.1.1)
typescript: 5.9.2
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/scope-manager@8.39.0':
'@typescript-eslint/scope-manager@8.38.0':
dependencies:
'@typescript-eslint/types': 8.39.0
'@typescript-eslint/visitor-keys': 8.39.0
'@typescript-eslint/types': 8.38.0
'@typescript-eslint/visitor-keys': 8.38.0
'@typescript-eslint/tsconfig-utils@8.39.0(typescript@5.9.2)':
'@typescript-eslint/tsconfig-utils@8.38.0(typescript@5.8.3)':
dependencies:
typescript: 5.9.2
typescript: 5.8.3
'@typescript-eslint/type-utils@8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)':
'@typescript-eslint/type-utils@8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
'@typescript-eslint/types': 8.39.0
'@typescript-eslint/typescript-estree': 8.39.0(typescript@5.9.2)
'@typescript-eslint/utils': 8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)
'@typescript-eslint/types': 8.38.0
'@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3)
'@typescript-eslint/utils': 8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)
debug: 4.4.1(supports-color@8.1.1)
eslint: 9.32.0(jiti@2.4.2)
ts-api-utils: 2.1.0(typescript@5.9.2)
typescript: 5.9.2
eslint: 9.31.0(jiti@2.4.2)
ts-api-utils: 2.1.0(typescript@5.8.3)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/types@8.39.0': {}
'@typescript-eslint/types@8.38.0': {}
'@typescript-eslint/typescript-estree@8.39.0(typescript@5.9.2)':
'@typescript-eslint/typescript-estree@8.38.0(typescript@5.8.3)':
dependencies:
'@typescript-eslint/project-service': 8.39.0(typescript@5.9.2)
'@typescript-eslint/tsconfig-utils': 8.39.0(typescript@5.9.2)
'@typescript-eslint/types': 8.39.0
'@typescript-eslint/visitor-keys': 8.39.0
'@typescript-eslint/project-service': 8.38.0(typescript@5.8.3)
'@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.8.3)
'@typescript-eslint/types': 8.38.0
'@typescript-eslint/visitor-keys': 8.38.0
debug: 4.4.1(supports-color@8.1.1)
fast-glob: 3.3.3
is-glob: 4.0.3
minimatch: 9.0.5
semver: 7.7.1
ts-api-utils: 2.1.0(typescript@5.9.2)
typescript: 5.9.2
ts-api-utils: 2.1.0(typescript@5.8.3)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)':
'@typescript-eslint/utils@8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0(jiti@2.4.2))
'@typescript-eslint/scope-manager': 8.39.0
'@typescript-eslint/types': 8.39.0
'@typescript-eslint/typescript-estree': 8.39.0(typescript@5.9.2)
eslint: 9.32.0(jiti@2.4.2)
typescript: 5.9.2
'@eslint-community/eslint-utils': 4.7.0(eslint@9.31.0(jiti@2.4.2))
'@typescript-eslint/scope-manager': 8.38.0
'@typescript-eslint/types': 8.38.0
'@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3)
eslint: 9.31.0(jiti@2.4.2)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/visitor-keys@8.39.0':
'@typescript-eslint/visitor-keys@8.38.0':
dependencies:
'@typescript-eslint/types': 8.39.0
'@typescript-eslint/types': 8.38.0
eslint-visitor-keys: 4.2.1
'@unocss/astro@66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.9.2))':
'@unocss/astro@66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.8.3))':
dependencies:
'@unocss/core': 66.3.3
'@unocss/reset': 66.3.3
'@unocss/vite': 66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.9.2))
'@unocss/vite': 66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.8.3))
optionalDependencies:
vite: 7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2)
transitivePeerDependencies:
@@ -2954,14 +2956,14 @@ snapshots:
'@unocss/extractor-svelte@66.3.3': {}
'@unocss/inspector@66.3.3(vue@3.5.13(typescript@5.9.2))':
'@unocss/inspector@66.3.3(vue@3.5.13(typescript@5.8.3))':
dependencies:
'@unocss/core': 66.3.3
'@unocss/rule-utils': 66.3.3
colorette: 2.0.20
gzip-size: 6.0.0
sirv: 3.0.1
vue-flow-layout: 0.1.1(vue@3.5.13(typescript@5.9.2))
vue-flow-layout: 0.1.1(vue@3.5.13(typescript@5.8.3))
transitivePeerDependencies:
- vue
@@ -3054,12 +3056,12 @@ snapshots:
dependencies:
'@unocss/core': 66.3.3
'@unocss/vite@66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.9.2))':
'@unocss/vite@66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.8.3))':
dependencies:
'@ampproject/remapping': 2.3.0
'@unocss/config': 66.3.3
'@unocss/core': 66.3.3
'@unocss/inspector': 66.3.3(vue@3.5.13(typescript@5.9.2))
'@unocss/inspector': 66.3.3(vue@3.5.13(typescript@5.8.3))
chokidar: 3.6.0
magic-string: 0.30.17
pathe: 2.0.3
@@ -3115,11 +3117,11 @@ snapshots:
'@vue/shared': 3.5.13
csstype: 3.1.3
'@vue/server-renderer@3.5.13(vue@3.5.13(typescript@5.9.2))':
'@vue/server-renderer@3.5.13(vue@3.5.13(typescript@5.8.3))':
dependencies:
'@vue/compiler-ssr': 3.5.13
'@vue/shared': 3.5.13
vue: 3.5.13(typescript@5.9.2)
vue: 3.5.13(typescript@5.8.3)
'@vue/shared@3.5.13': {}
@@ -3262,9 +3264,9 @@ snapshots:
dependencies:
'@clack/prompts': 0.7.0
'@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/assemble': 0.12.0(mocha@10.8.2)
'@covector/changelog': 0.12.0(mocha@10.8.2)
'@covector/command': 0.8.0(mocha@10.8.2)
'@covector/files': 0.8.0
effection: 2.0.8(mocha@10.8.2)
globby: 11.1.0
@@ -3374,9 +3376,9 @@ snapshots:
escape-string-regexp@4.0.0: {}
eslint-config-prettier@10.1.8(eslint@9.32.0(jiti@2.4.2)):
eslint-config-prettier@10.1.8(eslint@9.31.0(jiti@2.4.2)):
dependencies:
eslint: 9.32.0(jiti@2.4.2)
eslint: 9.31.0(jiti@2.4.2)
eslint-plugin-security@3.0.1:
dependencies:
@@ -3391,16 +3393,16 @@ snapshots:
eslint-visitor-keys@4.2.1: {}
eslint@9.32.0(jiti@2.4.2):
eslint@9.31.0(jiti@2.4.2):
dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0(jiti@2.4.2))
'@eslint-community/eslint-utils': 4.7.0(eslint@9.31.0(jiti@2.4.2))
'@eslint-community/regexpp': 4.12.1
'@eslint/config-array': 0.21.0
'@eslint/config-helpers': 0.3.0
'@eslint/core': 0.15.1
'@eslint/eslintrc': 3.3.1
'@eslint/js': 9.32.0
'@eslint/plugin-kit': 0.3.4
'@eslint/js': 9.31.0
'@eslint/plugin-kit': 0.3.3
'@humanfs/node': 0.16.6
'@humanwhocodes/module-importer': 1.0.1
'@humanwhocodes/retry': 0.4.2
@@ -3967,30 +3969,30 @@ snapshots:
reusify@1.1.0: {}
rollup@4.46.2:
rollup@4.45.1:
dependencies:
'@types/estree': 1.0.8
optionalDependencies:
'@rollup/rollup-android-arm-eabi': 4.46.2
'@rollup/rollup-android-arm64': 4.46.2
'@rollup/rollup-darwin-arm64': 4.46.2
'@rollup/rollup-darwin-x64': 4.46.2
'@rollup/rollup-freebsd-arm64': 4.46.2
'@rollup/rollup-freebsd-x64': 4.46.2
'@rollup/rollup-linux-arm-gnueabihf': 4.46.2
'@rollup/rollup-linux-arm-musleabihf': 4.46.2
'@rollup/rollup-linux-arm64-gnu': 4.46.2
'@rollup/rollup-linux-arm64-musl': 4.46.2
'@rollup/rollup-linux-loongarch64-gnu': 4.46.2
'@rollup/rollup-linux-ppc64-gnu': 4.46.2
'@rollup/rollup-linux-riscv64-gnu': 4.46.2
'@rollup/rollup-linux-riscv64-musl': 4.46.2
'@rollup/rollup-linux-s390x-gnu': 4.46.2
'@rollup/rollup-linux-x64-gnu': 4.46.2
'@rollup/rollup-linux-x64-musl': 4.46.2
'@rollup/rollup-win32-arm64-msvc': 4.46.2
'@rollup/rollup-win32-ia32-msvc': 4.46.2
'@rollup/rollup-win32-x64-msvc': 4.46.2
'@rollup/rollup-android-arm-eabi': 4.45.1
'@rollup/rollup-android-arm64': 4.45.1
'@rollup/rollup-darwin-arm64': 4.45.1
'@rollup/rollup-darwin-x64': 4.45.1
'@rollup/rollup-freebsd-arm64': 4.45.1
'@rollup/rollup-freebsd-x64': 4.45.1
'@rollup/rollup-linux-arm-gnueabihf': 4.45.1
'@rollup/rollup-linux-arm-musleabihf': 4.45.1
'@rollup/rollup-linux-arm64-gnu': 4.45.1
'@rollup/rollup-linux-arm64-musl': 4.45.1
'@rollup/rollup-linux-loongarch64-gnu': 4.45.1
'@rollup/rollup-linux-powerpc64le-gnu': 4.45.1
'@rollup/rollup-linux-riscv64-gnu': 4.45.1
'@rollup/rollup-linux-riscv64-musl': 4.45.1
'@rollup/rollup-linux-s390x-gnu': 4.45.1
'@rollup/rollup-linux-x64-gnu': 4.45.1
'@rollup/rollup-linux-x64-musl': 4.45.1
'@rollup/rollup-win32-arm64-msvc': 4.45.1
'@rollup/rollup-win32-ia32-msvc': 4.45.1
'@rollup/rollup-win32-x64-msvc': 4.45.1
fsevents: 2.3.3
run-parallel@1.2.0:
@@ -4121,9 +4123,9 @@ snapshots:
trough@1.0.5: {}
ts-api-utils@2.1.0(typescript@5.9.2):
ts-api-utils@2.1.0(typescript@5.8.3):
dependencies:
typescript: 5.9.2
typescript: 5.8.3
tslib@2.8.1: {}
@@ -4141,18 +4143,18 @@ snapshots:
type-fest@0.7.1: {}
typescript-eslint@8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2):
typescript-eslint@8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3):
dependencies:
'@typescript-eslint/eslint-plugin': 8.39.0(@typescript-eslint/parser@8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2))(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)
'@typescript-eslint/parser': 8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)
'@typescript-eslint/typescript-estree': 8.39.0(typescript@5.9.2)
'@typescript-eslint/utils': 8.39.0(eslint@9.32.0(jiti@2.4.2))(typescript@5.9.2)
eslint: 9.32.0(jiti@2.4.2)
typescript: 5.9.2
'@typescript-eslint/eslint-plugin': 8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/parser': 8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3)
'@typescript-eslint/utils': 8.38.0(eslint@9.31.0(jiti@2.4.2))(typescript@5.8.3)
eslint: 9.31.0(jiti@2.4.2)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
typescript@5.9.2: {}
typescript@5.8.3: {}
ufo@1.6.1: {}
@@ -4177,9 +4179,9 @@ snapshots:
dependencies:
'@types/unist': 2.0.11
unocss@66.3.3(postcss@8.5.6)(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.9.2)):
unocss@66.3.3(postcss@8.5.6)(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.8.3)):
dependencies:
'@unocss/astro': 66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.9.2))
'@unocss/astro': 66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.8.3))
'@unocss/cli': 66.3.3
'@unocss/core': 66.3.3
'@unocss/postcss': 66.3.3(postcss@8.5.6)
@@ -4197,7 +4199,7 @@ snapshots:
'@unocss/transformer-compile-class': 66.3.3
'@unocss/transformer-directives': 66.3.3
'@unocss/transformer-variant-group': 66.3.3
'@unocss/vite': 66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.9.2))
'@unocss/vite': 66.3.3(vite@7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2))(vue@3.5.13(typescript@5.8.3))
optionalDependencies:
vite: 7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2)
transitivePeerDependencies:
@@ -4232,7 +4234,7 @@ snapshots:
fdir: 6.4.6(picomatch@4.0.2)
picomatch: 4.0.2
postcss: 8.5.6
rollup: 4.46.2
rollup: 4.45.1
tinyglobby: 0.2.14
optionalDependencies:
fsevents: 2.3.3
@@ -4244,19 +4246,19 @@ snapshots:
optionalDependencies:
vite: 7.0.4(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.2)
vue-flow-layout@0.1.1(vue@3.5.13(typescript@5.9.2)):
vue-flow-layout@0.1.1(vue@3.5.13(typescript@5.8.3)):
dependencies:
vue: 3.5.13(typescript@5.9.2)
vue: 3.5.13(typescript@5.8.3)
vue@3.5.13(typescript@5.9.2):
vue@3.5.13(typescript@5.8.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.9.2))
'@vue/server-renderer': 3.5.13(vue@3.5.13(typescript@5.8.3))
'@vue/shared': 3.5.13
optionalDependencies:
typescript: 5.9.2
typescript: 5.8.3
webidl-conversions@3.0.1: {}
+11
View File
@@ -33,12 +33,23 @@ tauri-plugin-PLUGIN_NAME = { git = "https://github.com/tauri-apps/plugins-worksp
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.
<!-- Add the branch for installations using git! -->
```sh
pnpm add @tauri-apps/plugin-PLUGIN_NAME
# or
npm add @tauri-apps/plugin-PLUGIN_NAME
# or
yarn add @tauri-apps/plugin-PLUGIN_NAME
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2
```
## Usage