Skip to content

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

:rotating_light:

Vanessa3925d5d1c453
diff --git a/app/src/block/popover.ts b/app/src/block/popover.ts
index 9c55c3ca7f..bff6c9b756 100644
--- a/app/src/block/popover.ts
+++ b/app/src/block/popover.ts
@@ -45,7 +45,7 @@ export const initBlockPopover = (app: App) => {
return;
}
} else if (!aElement) {
- const tipElement = hasClosestByAttribute(event.target, "id", "tooltip", true)
+ const tipElement = hasClosestByAttribute(event.target, "id", "tooltip", true);
if (!tipElement || (
tipElement && (tipElement.clientHeight >= tipElement.scrollHeight && tipElement.clientWidth >= tipElement.scrollWidth)
)) {
diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts
index 24105e4552..45afb2b536 100644
--- a/app/src/boot/globalEvent/keydown.ts
+++ b/app/src/boot/globalEvent/keydown.ts
@@ -165,7 +165,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
protyle = item.editor.protyle;
return true;
}
- })
+ });
}
if (!protyle && activeTabElement) {
const tab = getInstanceById(activeTabElement.getAttribute("data-id")) as Tab;
@@ -187,11 +187,11 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
protyle = editorItem.protyle;
return true;
}
- })
+ });
if (protyle) {
- return true
+ return true;
}
- })
+ });
}
if (!protyle) {
models.backlink.find(item => {
@@ -209,7 +209,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
}
return true;
}
- })
+ });
}
if (!protyle) {
models.editor.find(item => {
diff --git a/app/src/dialog/index.ts b/app/src/dialog/index.ts
index 6135fee52f..3807ea9d23 100644
--- a/app/src/dialog/index.ts
+++ b/app/src/dialog/index.ts
@@ -11,7 +11,7 @@ export class Dialog {
public element: HTMLElement;
private id: string;
private disableClose: boolean;
- public editor: Protyle
+ public editor: Protyle;
constructor(options: {
title?: string,
diff --git a/app/src/dialog/tooltip.ts b/app/src/dialog/tooltip.ts
index 203e015bd6..ef6ccf27db 100644
--- a/app/src/dialog/tooltip.ts
+++ b/app/src/dialog/tooltip.ts
@@ -1,4 +1,3 @@
-import {setPosition} from "../util/setPosition";
import {isMobile} from "../util/functions";
export const showTooltip = (message: string, target: Element, error = false) => {
@@ -29,7 +28,7 @@ export const showTooltip = (message: string, target: Element, error = false) =>
}
let left = targetRect.left;
let top = targetRect.bottom;
- const position = target.getAttribute("data-position")
+ const position = target.getAttribute("data-position");
const parentRect = target.parentElement.getBoundingClientRect();
if (position === "right") {
// block icon
diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts
index 77dd610fa6..621ae32f95 100644
--- a/app/src/layout/util.ts
+++ b/app/src/layout/util.ts
@@ -667,7 +667,7 @@ export const resizeTabs = () => {
});
models.search.forEach(item => {
item.edit.resize();
- })
+ });
models.custom.forEach(item => {
if (item.resize) {
item.resize();
diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts
index c2064557bb..1cae6721ee 100644
--- a/app/src/protyle/breadcrumb/index.ts
+++ b/app/src/protyle/breadcrumb/index.ts
@@ -3,7 +3,7 @@ import {fetchPost} from "../../util/fetch";
import {Constants} from "../../constants";
import {MenuItem} from "../../menus/Menu";
import {fullscreen, netImg2LocalAssets} from "./action";
-import {exportMd, openFileAttr} from "../../menus/commonMenuItem";
+import {openFileAttr} from "../../menus/commonMenuItem";
import {setEditMode} from "../util/setEditMode";
import {RecordMedia} from "../util/RecordMedia";
import {hideMessage, showMessage} from "../../dialog/message";
@@ -24,7 +24,6 @@ import {onGet} from "../util/onGet";
import {hideElements} from "../ui/hideElements";
import {confirmDialog} from "../../dialog/confirmDialog";
import {reloadProtyle} from "../util/reload";
-import {deleteFile} from "../../editor/deleteFile";
import {Menu} from "../../plugin/Menu";
import {getNoContainerElement} from "../wysiwyg/getBlock";
import {openTitleMenu} from "../header/openTitleMenu";
diff --git a/app/src/protyle/undo/index.ts b/app/src/protyle/undo/index.ts
index 7208a3b95a..e3c39689b9 100644
--- a/app/src/protyle/undo/index.ts
+++ b/app/src/protyle/undo/index.ts
@@ -70,7 +70,7 @@ export class Undo {
public replace(doOperations: IOperation[]) {
// undo 引发 replace 导致 stack 错误 https://github.com/siyuan-note/siyuan/issues/9178
if (this.hasUndo && this.redoStack.length > 0) {
- this.undoStack.push(this.redoStack.pop())
+ this.undoStack.push(this.redoStack.pop());
this.redoStack = [];
this.hasUndo = false;
}
diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts
index 39e08f6d63..b162a4d106 100644
--- a/app/src/protyle/util/selection.ts
+++ b/app/src/protyle/util/selection.ts
@@ -560,18 +560,18 @@ export const focusBlock = (element: Element, parentElement?: HTMLElement, toStar
range = setFirstNodeRange(cursorElement, getEditorRange(cursorElement));
range.collapse(true);
} else {
- let focusHljs = false
+ let focusHljs = false;
// 定位到末尾 https://github.com/siyuan-note/siyuan/issues/5982
if (cursorElement.classList.contains("hljs")) {
// 代码块末尾定位需在 /n 之前 https://github.com/siyuan-note/siyuan/issues/9141,https://github.com/siyuan-note/siyuan/issues/9189
- let lastNode = cursorElement.lastChild
+ let lastNode = cursorElement.lastChild;
if (lastNode.textContent === "" && lastNode.nodeType === 3) {
- lastNode = hasPreviousSibling(cursorElement.lastChild) as HTMLElement
+ lastNode = hasPreviousSibling(cursorElement.lastChild) as HTMLElement;
}
if (lastNode && lastNode.textContent.endsWith("\n")) {
range = getEditorRange(cursorElement);
- range.setStart(lastNode, lastNode.textContent.length - 1)
- focusHljs = true
+ range.setStart(lastNode, lastNode.textContent.length - 1);
+ focusHljs = true;
}
}
if (!focusHljs) {
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index bd28154250..a12366dd43 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1488,7 +1488,7 @@ export class WYSIWYG {
}
});
- let timeout: number
+ let timeout: number;
this.element.addEventListener("input", (event: InputEvent) => {
const target = event.target as HTMLElement;
if (target.tagName === "VIDEO" || target.tagName === "AUDIO" || event.inputType === "historyRedo") {
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index b0b3cbfd8e..8d3287c625 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -736,11 +736,11 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
newFileByName(app, searchInputElement.value);
} else if (type === "search-item") {
const isAsset = target.dataset.id;
- let isClick = event.detail === 1
- let isDblClick = event.detail === 2
+ let isClick = event.detail === 1;
+ let isDblClick = event.detail === 2;
/// #if BROWSER
- const newDate = new Date().getTime()
- isClick = newDate - lastClickTime > Constants.TIMEOUT_DBLCLICK
+ const newDate = new Date().getTime();
+ isClick = newDate - lastClickTime > Constants.TIMEOUT_DBLCLICK;
isDblClick = !isClick;
lastClickTime = newDate;
/// #endif
diff --git a/app/src/window/closeWin.ts b/app/src/window/closeWin.ts
index 09e2fe7998..19b4ee00ef 100644
--- a/app/src/window/closeWin.ts
+++ b/app/src/window/closeWin.ts
@@ -6,4 +6,4 @@ export const closeWindow = async (app: App) => {
await app.plugins[i].onunload();
}
getCurrentWindow().destroy();
-}
+};