Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:rotating_light:

Vanessa820a51e5c2cc
diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts
index aa9bb9a846..064dc38b43 100644
--- a/app/src/dialog/processSystem.ts
+++ b/app/src/dialog/processSystem.ts
@@ -50,7 +50,7 @@ export const kernelError = () => {
</div>
</div>`
});
- dialog.element.id = 'errorLog'
+ dialog.element.id = "errorLog";
const restartElement = dialog.element.querySelector(".b3-button");
if (restartElement) {
restartElement.addEventListener("click", () => {
diff --git a/app/src/history/diff.ts b/app/src/history/diff.ts
index 1f43f31164..06fd529f32 100644
--- a/app/src/history/diff.ts
+++ b/app/src/history/diff.ts
@@ -75,7 +75,7 @@ const renderCompare = (element: HTMLElement) => {
leftElement.lastElementChild.classList.remove("fn__none");
onGet(response, leftEditor.protyle, [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML]);
}
- textElement.previousElementSibling.textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm")
+ textElement.previousElementSibling.textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm");
});
const id2 = element.getAttribute("data-id2");
if (id2) {
@@ -91,7 +91,7 @@ const renderCompare = (element: HTMLElement) => {
rightElement.lastElementChild.classList.remove("fn__none");
onGet(response, rightEditor.protyle, [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML]);
}
- textElement.previousElementSibling.textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm")
+ textElement.previousElementSibling.textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm");
});
} else {
rightElement.classList.add("fn__none");
@@ -143,10 +143,10 @@ export const showDiff = (data: { id: string, time: string }[]) => {
break;
} else if (target.classList.contains("block__icon")) {
if (target.getAttribute("data-direct") === "left") {
- target.setAttribute("data-direct", "right")
+ target.setAttribute("data-direct", "right");
genHTML(right, left, dialog, "right");
} else {
- target.setAttribute("data-direct", "left")
+ target.setAttribute("data-direct", "left");
genHTML(left, right, dialog, "left");
}
event.preventDefault();
@@ -167,17 +167,17 @@ const genHTML = (left: string, right: string, dialog: Dialog, direct:string) =>
const headElement = dialog.element.querySelector(".b3-dialog__header");
headElement.innerHTML = `<div style="padding: 0;min-height: auto;" class="block__icons">
<span class="fn__flex-1"></span>
- <code class="fn__code${isPhone ? " fn__none" : ''}">${left.substring(0, 7)}</code>
+ <code class="fn__code${isPhone ? " fn__none" : ""}">${left.substring(0, 7)}</code>
${isPhone ? "" : '<span class="fn__space"></span>'}
${dayjs(response.data.left.created).format("YYYY-MM-DD HH:mm")}
<span class="fn__space"></span>
<span class="block__icon block__icon--show" data-direct="${direct}"><svg><use xlink:href="#iconForward"></use></svg></span>
<span class="fn__space"></span>
- <code class="fn__code${isPhone ? " fn__none" : ''}">${right.substring(0, 7)}</code>
+ <code class="fn__code${isPhone ? " fn__none" : ""}">${right.substring(0, 7)}</code>
${isPhone ? "" : '<span class="fn__space"></span>'}
${dayjs(response.data.right.created).format("YYYY-MM-DD HH:mm")}
<span class="fn__flex-1"></span>
-</div>`
+</div>`;
headElement.nextElementSibling.innerHTML = `<div class="fn__flex" style="height: 100%;${isMobile() ? "flex-direction: column;" : ""}">
<div class="history__diff"${isMobile() ? 'style="flex:1;width:auto"' : ""}>
<ul class="b3-list b3-list--background">
@@ -222,4 +222,4 @@ const genHTML = (left: string, right: string, dialog: Dialog, direct:string) =>
</div>
</div>`;
});
-}
+};
diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts
index b74985354d..bd1174cb09 100644
--- a/app/src/protyle/util/insertHTML.ts
+++ b/app/src/protyle/util/insertHTML.ts
@@ -34,7 +34,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
let id = blockElement.getAttribute("data-node-id");
range.insertNode(document.createElement("wbr"));
let oldHTML = blockElement.outerHTML;
- const isNodeCodeBlock = blockElement.getAttribute("data-type") === "NodeCodeBlock"
+ const isNodeCodeBlock = blockElement.getAttribute("data-type") === "NodeCodeBlock";
if (!isBlock &&
(isNodeCodeBlock || protyle.toolbar.getCurrentType(range).includes("code"))) {
range.deleteContents();
diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts
index 84bda1c33e..46031fb1e0 100644
--- a/app/src/protyle/util/paste.ts
+++ b/app/src/protyle/util/paste.ts
@@ -6,16 +6,14 @@ import {writeText} from "./compatibility";
import {clipboard} from "electron";
/// #endif
import {hasClosestBlock} from "./hasClosest";
-import {focusByWbr, getEditorRange} from "./selection";
+import {getEditorRange} from "./selection";
import {blockRender} from "../markdown/blockRender";
import {highlightRender} from "../markdown/highlightRender";
-import {updateTransaction} from "../wysiwyg/transaction";
import {fetchPost, fetchSyncPost} from "../../util/fetch";
import {isDynamicRef, isFileAnnotation} from "../../util/functions";
import {insertHTML} from "./insertHTML";
import {scrollCenter} from "../../util/highlightById";
import {hideElements} from "../ui/hideElements";
-import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
const filterClipboardHint = (protyle: IProtyle, textPlain: string) => {
let needRender = true;