mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 16:04:19 +01:00
This commit is contained in:
parent
3de93cd107
commit
a9b17850ef
2 changed files with 4 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ export const readClipboard = async () => {
|
|||
const text: {
|
||||
textHTML?: string,
|
||||
textPlain?: string,
|
||||
files?: File,
|
||||
files?: File[],
|
||||
} = {textPlain: "", textHTML: ""};
|
||||
if (isInAndroid()) {
|
||||
text.textPlain = window.JSAndroid.readClipboard();
|
||||
|
|
@ -62,7 +62,7 @@ export const readClipboard = async () => {
|
|||
}
|
||||
if (item.types.includes("image/png")) {
|
||||
const blob = await item.getType("image/png");
|
||||
text.files = new File([blob], "image.png", {type: "image/png", lastModified: Date.now()});
|
||||
text.files = [new File([blob], "image.png", {type: "image/png", lastModified: Date.now()})];
|
||||
}
|
||||
}
|
||||
return text;
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ const readLocalFile = async (protyle: IProtyle, localFiles: string[]) => {
|
|||
export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEvent | {
|
||||
textHTML?: string,
|
||||
textPlain?: string,
|
||||
files?: FileList,
|
||||
files?: File[],
|
||||
}) & {
|
||||
target: HTMLElement
|
||||
}) => {
|
||||
|
|
@ -266,7 +266,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
|
|||
let textHTML: string;
|
||||
let textPlain: string;
|
||||
let siyuanHTML: string;
|
||||
let files: FileList | DataTransferItemList;
|
||||
let files: FileList | DataTransferItemList | File[];
|
||||
if ("clipboardData" in event) {
|
||||
textHTML = event.clipboardData.getData("text/html");
|
||||
textPlain = event.clipboardData.getData("text/plain");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue