Skip to content

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

:rotating_light:

Vanessa2a8f8abc8dfc
diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts
index d0bf02ed9e..f968cac41a 100644
--- a/app/src/config/bazaar.ts
+++ b/app/src/config/bazaar.ts
@@ -634,7 +634,7 @@ export const bazaar = {
} catch (e) {
console.error("destroyTheme error: " + e);
}
- window.siyuan.config.appearance = response.data.appearance
+ window.siyuan.config.appearance = response.data.appearance;
loadAssets(window.siyuan.config.appearance);
} else {
exportLayout({
@@ -796,7 +796,7 @@ export const bazaar = {
} catch (e) {
console.error("destroyTheme error: " + e);
}
- window.siyuan.config.appearance = appearanceResponse.data
+ window.siyuan.config.appearance = appearanceResponse.data;
loadAssets(window.siyuan.config.appearance);
} else {
exportLayout({
diff --git a/app/src/protyle/export/util.ts b/app/src/protyle/export/util.ts
index 3697c4544c..d9a963b9f2 100644
--- a/app/src/protyle/export/util.ts
+++ b/app/src/protyle/export/util.ts
@@ -188,7 +188,7 @@ export const exportImage = (id: string) => {
item.innerHTML = symbolElements[symbolElements.length - 1].innerHTML;
});
previewElement.querySelectorAll(".img img").forEach((item: HTMLImageElement) => {
- const imgSrc = item.getAttribute("src")
+ const imgSrc = item.getAttribute("src");
if (imgSrc.endsWith(".svg")) {
fetchGet(item.src, (response: string) => {
item.src = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(response)))}`;
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index 06f4505961..44fd266beb 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -791,7 +791,7 @@ export class Gutter {
icon: "iconDatabase",
click: () => {
openSearchAV("", this.element, (listItemElement) => {
- const sourceIds: string[] = []
+ const sourceIds: string[] = [];
selectsElement.forEach(item => {
sourceIds.push(item.getAttribute("data-node-id"));
});
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index ff81ae6c3e..212ae968eb 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -549,7 +549,7 @@ export const renderCellAttr = (cellElement: Element, value: IAVCellValue) => {
cellElement.setAttribute("data-detached", "true");
}
}
-}
+};
export const renderCell = (cellValue: IAVCellValue) => {
let text = "";
diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.ts
index a9accd7221..95f7719df1 100644
--- a/app/src/protyle/render/av/relation.ts
+++ b/app/src/protyle/render/av/relation.ts
@@ -235,11 +235,11 @@ const filterItem = (listElement: Element, key: string) => {
if (item.textContent.includes(key)) {
item.classList.remove("fn__none");
} else {
- item.classList.add("fn__none")
+ item.classList.add("fn__none");
}
}
- })
-}
+ });
+};
export const bindRelationEvent = (options: {
menuElement: HTMLElement,
@@ -290,9 +290,9 @@ export const bindRelationEvent = (options: {
const cellRect = options.cellElements[options.cellElements.length - 1].getBoundingClientRect();
setPosition(options.menuElement, cellRect.left, cellRect.bottom, cellRect.height);
options.menuElement.querySelector(".b3-menu__items .b3-menu__item").classList.add("b3-menu__item--current");
- const inputElement = options.menuElement.querySelector("input")
+ const inputElement = options.menuElement.querySelector("input");
inputElement.focus();
- const listElement = options.menuElement.querySelector(".b3-menu__items")
+ const listElement = options.menuElement.querySelector(".b3-menu__items");
inputElement.addEventListener("keydown", (event) => {
event.stopPropagation();
if (event.isComposing) {
@@ -309,18 +309,18 @@ export const bindRelationEvent = (options: {
event.preventDefault();
event.stopPropagation();
}
- })
+ });
inputElement.addEventListener("input", (event: InputEvent) => {
if (event.isComposing) {
return;
}
filterItem(listElement, inputElement.value);
event.stopPropagation();
- })
+ });
inputElement.addEventListener("compositionend", (event) => {
event.stopPropagation();
filterItem(listElement, inputElement.value);
- })
+ });
});
};
@@ -397,7 +397,7 @@ export const setRelationCell = (protyle: IProtyle, nodeElement: HTMLElement, tar
separatorElement.insertAdjacentHTML("afterend", genSelectItemHTML("empty"));
}
}
- menuElement.firstElementChild.classList.add("b3-menu__item--current")
+ menuElement.firstElementChild.classList.add("b3-menu__item--current");
}
updateCellsValue(protyle, nodeElement, newValue, cellElements);
};
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index f934febe86..9e6ca1f147 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -131,7 +131,7 @@ style="width: ${index === 0 ? ((parseInt(column.width || "200") + 24) + "px") :
return;
}
// https://github.com/siyuan-note/siyuan/issues/10262
- let checkClass = ""
+ let checkClass = "";
if (cell.valueType === "checkbox") {
checkClass = cell.value?.checkbox?.checked ? " av__cell-check" : " av__cell-uncheck";
}
diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts
index f8fc576fe4..4f879bb0d4 100644
--- a/app/src/protyle/util/insertHTML.ts
+++ b/app/src/protyle/util/insertHTML.ts
@@ -34,7 +34,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
const avID = blockElement.dataset.avId;
const id = blockElement.dataset.nodeId;
cellElements.forEach((item: HTMLElement, elementIndex) => {
- let cellValue: IAVCellValue = values[elementIndex]
+ let cellValue: IAVCellValue = values[elementIndex];
if (!cellValue) {
return;
}
@@ -60,7 +60,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
// 类型不能转换时就不进行替换
return;
}
- const content = cellValue[cellValue.type as "text"].content
+ const content = cellValue[cellValue.type as "text"].content;
if (!content) {
return;
}
@@ -110,7 +110,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
}
return;
} catch (e) {
- console.warn("insert cell: JSON.parse error")
+ console.warn("insert cell: JSON.parse error");
}
}
const text = protyle.lute.BlockDOM2EscapeMarkerContent(html);
diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts
index ec352afc62..c7678238bb 100644
--- a/app/src/protyle/util/resize.ts
+++ b/app/src/protyle/util/resize.ts
@@ -6,7 +6,7 @@ import {lineNumberRender} from "../render/highlightRender";
import {stickyRow} from "../render/av/row";
export const resize = (protyle: IProtyle) => {
- hideElements(["gutterOnly"], protyle)
+ hideElements(["gutterOnly"], protyle);
const abs = setPadding(protyle);
const MIN_ABS = 4;
// 不能 clearTimeout,否则 split 时左侧无法 resize
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 926ce2dd3a..0531dca701 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1301,7 +1301,7 @@ export class WYSIWYG {
}
} else if (selectAVElement) {
const cellsValue = updateCellsValue(protyle, nodeElement);
- html = JSON.stringify(cellsValue.json)
+ html = JSON.stringify(cellsValue.json);
textPlain = cellsValue.text;
} else {
const id = nodeElement.getAttribute("data-node-id");
diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts
index 61befc1dbc..563e32794e 100644
--- a/app/src/util/assets.ts
+++ b/app/src/util/assets.ts
@@ -315,7 +315,7 @@ export const setMode = (modeElementValue: number) => {
const updateMobileTheme = (OSTheme: string) => {
if (isInIOS() || isInAndroid()) {
setTimeout(() => {
- const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background").trim();
+ const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background").trim().replace(" ", "");
let mode = window.siyuan.config.appearance.mode;
if (window.siyuan.config.appearance.modeOS) {
if (OSTheme === "dark") {
diff --git a/app/src/util/upDownHint.ts b/app/src/util/upDownHint.ts
index 2e2d364fe5..83e6133760 100644
--- a/app/src/util/upDownHint.ts
+++ b/app/src/util/upDownHint.ts
@@ -1,6 +1,6 @@
const isNormalItem = (currentHintElement: HTMLElement, className: string) => {
- return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className)
-}
+ return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className);
+};
export const upDownHint = (listElement: Element, event: KeyboardEvent, classActiveName = "b3-list-item--focus") => {
let currentHintElement: HTMLElement = listElement.querySelector("." + classActiveName);