feat(clipboard): support readImage & writeImage (#845)

* feat(clipboard): support `read_image` & `write_image`

* fix plugin name

* platform specific bahavior

* remove unnecessary BufWriter

* improvement

* update example

* update example

* format

* header, fix change file

* use image from tauri

* fix ci

* update tauri, fix read

* image crate only on desktop [skip ci]

* Update plugins/authenticator/src/u2f_crate/protocol.rs [skip ci]

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* Update plugins/authenticator/src/u2f_crate/protocol.rs [skip ci]

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* update deps, address code review

* fix mobile [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
阿良仔
2024-03-19 20:35:37 +08:00
committed by GitHub
parent 7b9fa6607b
commit 9dec9605ed
91 changed files with 1331 additions and 795 deletions
+5 -14
View File
@@ -1,6 +1,7 @@
<script>
import * as fs from "@tauri-apps/plugin-fs";
import { convertFileSrc } from "@tauri-apps/api/core";
import { arrayBufferToBase64 } from "../lib/utils";
export let onMessage;
export let insecureRenderHtml;
@@ -20,18 +21,6 @@
return dirSelect.value ? parseInt(dir.value) : null;
}
function arrayBufferToBase64(buffer, callback) {
const blob = new Blob([buffer], {
type: "application/octet-binary",
});
const reader = new FileReader();
reader.onload = function (evt) {
const dataurl = evt.target.result;
callback(dataurl.substr(dataurl.indexOf(",") + 1));
};
reader.readAsDataURL(blob);
}
const DirOptions = Object.keys(fs.BaseDirectory)
.filter((key) => isNaN(parseInt(key)))
.map((dir) => [dir, fs.BaseDirectory[dir]]);
@@ -215,7 +204,7 @@
<button class="btn" on:click={stat}>Stat</button>
</div>
{/if}
<h3>Watch</h3>
<input
@@ -225,7 +214,9 @@
/>
<br />
<div>
<label for="watch-debounce-delay">Debounce delay in milliseconds (`0` disables the debouncer)</label>
<label for="watch-debounce-delay"
>Debounce delay in milliseconds (`0` disables the debouncer)</label
>
<input
class="input"
id="watch-debounce-delay"