Skip to content

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

:rotating_light:

Vanessa36c69ef9fc32
diff --git a/app/src/config/appearance.ts b/app/src/config/appearance.ts
index 54d3b437d8..1f2a465f00 100644
--- a/app/src/config/appearance.ts
+++ b/app/src/config/appearance.ts
@@ -214,7 +214,7 @@ export const appearance = {
_send: () => {
const themeLight = (appearance.element.querySelector("#themeLight") as HTMLSelectElement).value;
const themeDark = (appearance.element.querySelector("#themeDark") as HTMLSelectElement).value;
- const modeElementValue = parseInt((appearance.element.querySelector("#mode") as HTMLSelectElement).value)
+ const modeElementValue = parseInt((appearance.element.querySelector("#mode") as HTMLSelectElement).value);
fetchPost("/api/setting/setAppearance", {
icon: (appearance.element.querySelector("#icon") as HTMLSelectElement).value,
mode: modeElementValue === 2 ? window.siyuan.config.appearance.mode : modeElementValue,
@@ -320,15 +320,15 @@ export const appearance = {
}
const themeLightElement = appearance.element.querySelector("#themeLight") as HTMLSelectElement;
if (themeLightElement) {
- themeLightElement.innerHTML = genOptions(window.siyuan.config.appearance.lightThemes, window.siyuan.config.appearance.themeLight)
+ themeLightElement.innerHTML = genOptions(window.siyuan.config.appearance.lightThemes, window.siyuan.config.appearance.themeLight);
}
const themeDarkElement = appearance.element.querySelector("#themeDark") as HTMLSelectElement;
if (themeDarkElement) {
- themeDarkElement.innerHTML = genOptions(window.siyuan.config.appearance.darkThemes, window.siyuan.config.appearance.themeDark)
+ themeDarkElement.innerHTML = genOptions(window.siyuan.config.appearance.darkThemes, window.siyuan.config.appearance.themeDark);
}
const iconElement = appearance.element.querySelector("#icon") as HTMLSelectElement;
if (iconElement) {
- iconElement.innerHTML = genOptions(window.siyuan.config.appearance.icons, window.siyuan.config.appearance.icon)
+ iconElement.innerHTML = genOptions(window.siyuan.config.appearance.icons, window.siyuan.config.appearance.icon);
}
if (data.customCSS) {
fetchPost("/api/setting/getCustomCSS", {
diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts
index cc1721f3cb..1c56ff8b90 100644
--- a/app/src/config/bazaar.ts
+++ b/app/src/config/bazaar.ts
@@ -337,9 +337,9 @@ export const bazaar = {
const type = target.getAttribute("data-type");
if (type === "open") {
/// #if !BROWSER
- const dirName = target.parentElement.parentElement.getAttribute("data-bazaar")
+ const dirName = target.parentElement.parentElement.getAttribute("data-bazaar");
if (dirName === "icons" || dirName === "themes") {
- shell.openPath(path.join(window.siyuan.config.system.confDir, "appearance", dirName, target.parentElement.getAttribute("data-name")))
+ shell.openPath(path.join(window.siyuan.config.system.confDir, "appearance", dirName, target.parentElement.getAttribute("data-name")));
} else {
shell.openPath(path.join(window.siyuan.config.system.dataDir, dirName, target.parentElement.getAttribute("data-name")));
}
diff --git a/app/src/config/search.ts b/app/src/config/search.ts
index 927fd1f5c5..2c516e217e 100644
--- a/app/src/config/search.ts
+++ b/app/src/config/search.ts
@@ -82,7 +82,7 @@ export const initConfigSearch = (element: HTMLElement) => {
configIndex.map((item, index) => {
item.map((subItem) => {
if (!subItem) {
- console.warn("Search config miss language: ", item, index)
+ console.warn("Search config miss language: ", item, index);
}
if (subItem && (inputValue.toLowerCase().indexOf(subItem) > -1 || subItem.toLowerCase().indexOf(inputValue) > -1)) {
indexList.push(index);
diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts
index bf94b9417b..d3a9b15424 100644
--- a/app/src/protyle/export/index.ts
+++ b/app/src/protyle/export/index.ts
@@ -383,7 +383,7 @@ const renderPDF = (id: string) => {
});
fetchPost("/api/export/exportTempContent", {content: html}, (response) => {
window.siyuan.printWin.loadURL(response.data.url);
- })
+ });
};
const getExportPath = (option: { type: string, id: string }, removeAssets?: boolean) => {
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index d6780be608..4da0d4df21 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -379,7 +379,7 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
if (nodeElement) {
id = nodeElement.getAttribute("data-node-id");
}
- let html = nodeElement.outerHTML;
+ const html = nodeElement.outerHTML;
// 自顶向下法新建文档后光标定位问题 https://github.com/siyuan-note/siyuan/issues/299
// QQ 拼音输入法自动补全需移除补全内容 https://github.com/siyuan-note/siyuan/issues/320
// 前后有标记符的情况 https://github.com/siyuan-note/siyuan/issues/2511
diff --git a/app/src/protyle/toolbar/Font.ts b/app/src/protyle/toolbar/Font.ts
index 10e4ef9088..2d8e117487 100644
--- a/app/src/protyle/toolbar/Font.ts
+++ b/app/src/protyle/toolbar/Font.ts
@@ -156,7 +156,7 @@ export const setFontStyle = (textElement: HTMLElement, textOption: ITextOption)
textElement.setAttribute("data-id", blockRefData[0]);
textElement.setAttribute("data-subtype", blockRefData[1]);
textElement.innerText = blockRefData[2];
- }
+ };
if (textOption) {
switch (textOption.type) {
@@ -214,7 +214,7 @@ export const hasSameTextStyle = (currentElement: HTMLElement, sideElement: HTMLE
currentElement.getAttribute("data-subtype") === sideElement.getAttribute("data-subtype") &&
currentElement.textContent === sideElement.textContent;
}
- const blockRefData = textObj.color.split(Constants.ZWSP)
+ const blockRefData = textObj.color.split(Constants.ZWSP);
return blockRefData[0] === sideElement.getAttribute("data-id") &&
blockRefData[1] === sideElement.getAttribute("data-subtype") &&
blockRefData[2] === sideElement.textContent;
diff --git a/app/src/protyle/toolbar/InlineMath.ts b/app/src/protyle/toolbar/InlineMath.ts
index c25bb8f456..dc834c2b2b 100644
--- a/app/src/protyle/toolbar/InlineMath.ts
+++ b/app/src/protyle/toolbar/InlineMath.ts
@@ -1,10 +1,6 @@
import {ToolbarItem} from "./ToolbarItem";
-import * as dayjs from "dayjs";
-import {updateTransaction} from "../wysiwyg/transaction";
import {hasClosestBlock, hasClosestByAttribute} from "../util/hasClosest";
import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
-import {mathRender} from "../markdown/mathRender";
-import {fixTableRange, focusByRange} from "../util/selection";
export class InlineMath extends ToolbarItem {
public element: HTMLElement;
@@ -24,7 +20,7 @@ export class InlineMath extends ToolbarItem {
if (!mathElement && range.startContainer.nodeType !== 3) {
const previousSibling = hasPreviousSibling(range.startContainer.childNodes[range.startOffset]) as HTMLElement;
if (previousSibling && previousSibling.getAttribute("data-type").indexOf("inline-math") > -1) {
- mathElement = previousSibling
+ mathElement = previousSibling;
}
}
if (!mathElement && range.startOffset === range.startContainer.textContent.length && range.startContainer.nodeType === 3) {
@@ -34,9 +30,9 @@ export class InlineMath extends ToolbarItem {
(item.nodeType == 3 && item.textContent === "")) {
// 是否仅选中数学公式
} else {
- isMath = false
+ isMath = false;
}
- })
+ });
if (isMath) {
const nextSibling = hasNextSibling(range.startContainer) as HTMLElement;
if (nextSibling && nextSibling.nodeType !== 3 && nextSibling.getAttribute("data-type").indexOf("inline-math") > -1) {
diff --git a/app/src/protyle/toolbar/InlineMemo.ts b/app/src/protyle/toolbar/InlineMemo.ts
index 78cdc163df..676448345b 100644
--- a/app/src/protyle/toolbar/InlineMemo.ts
+++ b/app/src/protyle/toolbar/InlineMemo.ts
@@ -1,8 +1,5 @@
import {ToolbarItem} from "./ToolbarItem";
import {hasClosestBlock, hasClosestByAttribute} from "../util/hasClosest";
-import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
-import {fixTableRange} from "../util/selection";
-import {isArrayEqual} from "../../util/functions";
export class InlineMemo extends ToolbarItem {
public element: HTMLElement;
diff --git a/app/src/protyle/toolbar/Link.ts b/app/src/protyle/toolbar/Link.ts
index cd94e931b0..0754beeb85 100644
--- a/app/src/protyle/toolbar/Link.ts
+++ b/app/src/protyle/toolbar/Link.ts
@@ -1,11 +1,7 @@
import {ToolbarItem} from "./ToolbarItem";
import {linkMenu} from "../../menus/protyle";
-import {Constants} from "../../constants";
-import * as dayjs from "dayjs";
-import {updateTransaction} from "../wysiwyg/transaction";
import {hasClosestBlock, hasClosestByAttribute} from "../util/hasClosest";
-import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
-import {fixTableRange, focusByRange, focusByWbr} from "../util/selection";
+import {focusByRange, focusByWbr} from "../util/selection";
export class Link extends ToolbarItem {
public element: HTMLElement;
@@ -28,7 +24,7 @@ export class Link extends ToolbarItem {
return;
}
- const rangeString = range.toString().trim()
+ const rangeString = range.toString().trim();
let dataHref = "";
try {
const clipText = await navigator.clipboard.readText();
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 7b260012ea..1a0c9327a5 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -486,7 +486,7 @@ export class Toolbar {
} else if (item.tagName !== "BR") {
item.setAttribute("data-type", types.join(" "));
item.querySelectorAll("span").forEach(backslashItem => {
- backslashItem.remove()
+ backslashItem.remove();
});
setFontStyle(item, textObj);
newNodes.push(item);
@@ -598,7 +598,7 @@ export class Toolbar {
} else if (type === "block-ref") {
this.range.collapse(false);
} else if (type === "a") {
- const aElement = newNodes[0] as HTMLElement
+ const aElement = newNodes[0] as HTMLElement;
if (aElement.textContent.replace(Constants.ZWSP, "") === "" || !aElement.getAttribute("data-href")) {
linkMenu(protyle, aElement, aElement.getAttribute("data-href") ? true : false);
} else {
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 31a8e9b60d..3f86889f15 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -688,7 +688,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
previousSibling.classList.add("img--select");
} else if (previousSibling.getAttribute("data-type")?.indexOf("inline-math") > -1) {
// 数学公式相邻中有 zwsp,无法删除
- previousSibling.after(document.createElement("wbr"))
+ previousSibling.after(document.createElement("wbr"));
const oldHTML = nodeElement.outerHTML;
range.startContainer.textContent = "";
previousSibling.remove();