Skip to content

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

:rotating_light:

Vanessa6c75197dbc20
diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts
index 2f8c0fb52e..e30c51f730 100644
--- a/app/src/asset/anno.ts
+++ b/app/src/asset/anno.ts
@@ -167,7 +167,7 @@ export const initAnno = (element: HTMLElement, pdf: any) => {
item.style.backgroundColor = "transparent";
}
});
- })
+ });
fetchPost("/api/asset/setFileAnnotation", {
path: pdf.appConfig.file.replace(location.origin, "").substr(1) + ".sya",
data: JSON.stringify(config),
@@ -723,7 +723,7 @@ export const hlPDFRect = (element: HTMLElement, id: string) => {
item.classList.remove("pdf__rect--hl");
}, 1500);
}
- })
+ });
};
const copyAnno = (idPath: string, fileName: string, pdf: any) => {
diff --git a/app/src/boot/globalEvent/command/protyle.ts b/app/src/boot/globalEvent/command/protyle.ts
index 08f1adc2b9..adbdc36ee7 100644
--- a/app/src/boot/globalEvent/command/protyle.ts
+++ b/app/src/boot/globalEvent/command/protyle.ts
@@ -20,7 +20,7 @@ export const onlyProtyleCommand = (options: {
}
if (options.command === "switchAdjust") {
let fullWidth;
- const adjustWidth = options.protyle.wysiwyg.element.getAttribute(Constants.CUSTOM_SY_FULLWIDTH)
+ const adjustWidth = options.protyle.wysiwyg.element.getAttribute(Constants.CUSTOM_SY_FULLWIDTH);
if (!adjustWidth) {
fullWidth = window.siyuan.config.editor.fullWidth ? "false" : "true";
} else {
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 422aaf9111..571e6cc673 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -229,7 +229,7 @@ export class Wnd {
if (headerDragCounter === 0) {
document.querySelectorAll(".layout-tab-bars--drag").forEach(item => {
item.classList.remove("layout-tab-bars--drag");
- })
+ });
clearTimeout(dragleaveTimeout);
// 窗口拖拽到新窗口时,不 drop 无法移除 clone 的元素
dragleaveTimeout = window.setTimeout(() => {
@@ -255,7 +255,7 @@ export class Wnd {
}) {
document.querySelectorAll(".layout-tab-bars--drag").forEach(item => {
item.classList.remove("layout-tab-bars--drag");
- })
+ });
headerDragCounter = 0;
const it = this as HTMLElement;
if (event.dataTransfer.types.includes(Constants.SIYUAN_DROP_FILE)) {
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index c18e881b07..dc00550467 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -927,8 +927,8 @@ export const zoomOut = (options: {
if (options.focusId) {
let focusElement = options.protyle.wysiwyg.element.querySelector(`[data-node-id="${options.focusId}"]`);
if (!focusElement) {
- const unfoldResponse = await fetchSyncPost("/api/block/getUnfoldedParentID", {id: options.focusId})
- options.focusId = unfoldResponse.data.parentID
+ const unfoldResponse = await fetchSyncPost("/api/block/getUnfoldedParentID", {id: options.focusId});
+ options.focusId = unfoldResponse.data.parentID;
focusElement = options.protyle.wysiwyg.element.querySelector(`[data-node-id="${unfoldResponse.data.parentID}"]`);
}
if (focusElement) {
diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts
index cc1ea8b049..1b40c9b3b6 100644
--- a/app/src/protyle/header/Title.ts
+++ b/app/src/protyle/header/Title.ts
@@ -46,13 +46,13 @@ export class Title {
this.editElement.addEventListener("paste", (event: ClipboardEvent) => {
event.stopPropagation();
event.preventDefault();
- const range = getSelection().getRangeAt(0)
- let text = event.clipboardData.getData("text/siyuan")
+ const range = getSelection().getRangeAt(0);
+ let text = event.clipboardData.getData("text/siyuan");
range.deleteContents();
if (text) {
- text = protyle.lute.BlockDOM2Content(text)
+ text = protyle.lute.BlockDOM2Content(text);
} else {
- text = event.clipboardData.getData("text/plain")
+ text = event.clipboardData.getData("text/plain");
}
range.insertNode(document.createTextNode(replaceFileName(text)));
range.collapse(false);
diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts
index e0bdee444d..df201a2987 100644
--- a/app/src/protyle/render/av/openMenuPanel.ts
+++ b/app/src/protyle/render/av/openMenuPanel.ts
@@ -1291,7 +1291,7 @@ export const openMenuPanel = (options: {
} else if (type === "av-view-switch") {
if (!target.parentElement.classList.contains("b3-menu__item--current")) {
avPanelElement.querySelector(".b3-menu__item--current")?.classList.remove("b3-menu__item--current");
- target.parentElement.classList.add("b3-menu__item--current")
+ target.parentElement.classList.add("b3-menu__item--current");
options.blockElement.removeAttribute("data-render");
avRender(options.blockElement, options.protyle, undefined, target.parentElement.dataset.id);
}
@@ -1307,7 +1307,7 @@ export const openMenuPanel = (options: {
});
} else {
avPanelElement.querySelector(".b3-menu__item--current")?.classList.remove("b3-menu__item--current");
- target.parentElement.classList.add("b3-menu__item--current")
+ target.parentElement.classList.add("b3-menu__item--current");
options.blockElement.removeAttribute("data-render");
avRender(options.blockElement, options.protyle, () => {
openViewMenu({
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index 73f1c7d455..cd1336c83d 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -227,7 +227,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
</div>
</div>
<div class="av__row--footer${hasCalc ? " av__readonly--show" : ""}">${calcHTML}</div>
-</div>`
+</div>`;
if (renderAll) {
e.firstElementChild.outerHTML = `<div class="av__container">
<div class="av__header">
diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts
index 9875789aeb..e03515e250 100644
--- a/app/src/protyle/util/selection.ts
+++ b/app/src/protyle/util/selection.ts
@@ -455,14 +455,14 @@ export const focusByOffset = (container: Element, start: number, end: number, is
};
export const setInsertWbrHTML = (nodeElement: HTMLElement, range: Range, protyle: IProtyle) => {
- const offset = getSelectionOffset(nodeElement, nodeElement, range)
+ const offset = getSelectionOffset(nodeElement, nodeElement, range);
const cloneNode = nodeElement.cloneNode(true) as HTMLElement;
const cloneRange = focusByOffset(cloneNode, offset.end, offset.end, false);
if (cloneRange) {
cloneRange.insertNode(document.createElement("wbr"));
}
protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] = cloneNode.outerHTML;
-}
+};
export const focusByWbr = (element: Element, range: Range) => {
const wbrElements = element.querySelectorAll("wbr");
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 3f455f51fa..7731052324 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -103,7 +103,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.code !== "") { // 悬浮工具会触发但 code 为空 https://github.com/siyuan-note/siyuan/issues/6573
hideElements(["toolbar"], protyle);
}
- let range = getEditorRange(protyle.wysiwyg.element);
+ const range = getEditorRange(protyle.wysiwyg.element);
const nodeElement = hasClosestBlock(range.startContainer);
if (!nodeElement) {
return;