An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:rotating_light:
Vanessa2ae388d2bbc8
diff --git a/app/src/config/appearance.ts b/app/src/config/appearance.tsindex b9964f8af6..5720ef0bd5 100644--- a/app/src/config/appearance.ts+++ b/app/src/config/appearance.ts@@ -344,14 +344,14 @@ export const appearance = {ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSE, data.closeButtonBehavior);/// #endifloadAssets(data);- const modeElement = document.getElementById("barThemeMode")+ const modeElement = document.getElementById("barThemeMode");if (modeElement) {if (data.mode === 1) {modeElement.classList.add("toolbar__item--active");- modeElement.setAttribute("aria-label", window.siyuan.languages.themeLight)+ modeElement.setAttribute("aria-label", window.siyuan.languages.themeLight);} else {modeElement.classList.remove("toolbar__item--active");- modeElement.setAttribute("aria-label", window.siyuan.languages.themeDark)+ modeElement.setAttribute("aria-label", window.siyuan.languages.themeDark);}}}diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.tsindex c187c647be..4be42750e6 100644--- a/app/src/layout/dock/Files.ts+++ b/app/src/layout/dock/Files.ts@@ -552,7 +552,7 @@ export class Files extends Model {targetElement.querySelector(".b3-list-item__toggle").classList.remove("fn__hidden");const emojiElement = targetElement.querySelector(".b3-list-item__icon");if (emojiElement.innerHTML === unicode2Emoji(Constants.SIYUAN_IMAGE_FILE)) {- emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER)+ emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER);}if (targetElement.nextElementSibling && targetElement.nextElementSibling.tagName === "UL") {targetElement.nextElementSibling.remove();diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex 03fe68dc35..7957808790 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -400,7 +400,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme} else if (window.siyuan.config.editor.displayNetImgMark) {assetElement.querySelector(".protyle-action__drag").insertAdjacentHTML("afterend", '<span class="img__net"><svg><use xlink:href="#iconLanguage"></use></svg></span>');}- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));updateTransaction(protyle, id, nodeElement.outerHTML, html);html = nodeElement.outerHTML;});@@ -419,7 +419,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemeassetElement.style.maxWidth = (imgElement.clientWidth + 10) + "px";});inputElement.addEventListener("change", () => {- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));updateTransaction(protyle, id, nodeElement.outerHTML, html);html = nodeElement.outerHTML;});@@ -432,7 +432,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemeinputElement.value = imgElement.getAttribute("alt") || "";inputElement.addEventListener("change", (event) => {imgElement.setAttribute("alt", (event.target as HTMLInputElement).value);- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));updateTransaction(protyle, id, nodeElement.outerHTML, html);html = nodeElement.outerHTML;});@@ -476,7 +476,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemeclick() {writeText(protyle.lute.BlockDOM2Md(assetElement.outerHTML));(assetElement as HTMLElement).outerHTML = "<wbr>";- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));updateTransaction(protyle, id, nodeElement.outerHTML, html);focusByWbr(protyle.wysiwyg.element, range);}@@ -487,7 +487,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemelabel: window.siyuan.languages.delete,click: function () {(assetElement as HTMLElement).outerHTML = "<wbr>";- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));updateTransaction(protyle, id, nodeElement.outerHTML, html);focusByWbr(protyle.wysiwyg.element, range);}@@ -498,7 +498,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemelabel: window.siyuan.languages.alignCenter,accelerator: window.siyuan.config.keymap.editor.general.alignCenter.custom,click() {- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));assetElement.style.display = "block";updateTransaction(protyle, id, nodeElement.outerHTML, html);}@@ -508,7 +508,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemelabel: window.siyuan.languages.alignLeft,accelerator: window.siyuan.config.keymap.editor.general.alignLeft.custom,click() {- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));assetElement.style.display = "";updateTransaction(protyle, id, nodeElement.outerHTML, html);}@@ -536,7 +536,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLElemerangeElement.parentElement.setAttribute("aria-label", `${rangeElement.value}%`);});rangeElement.addEventListener("change", () => {- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));updateTransaction(protyle, id, nodeElement.outerHTML, html);window.siyuan.menus.menu.remove();focusBlock(nodeElement);@@ -685,7 +685,7 @@ const genImageWidthMenu = (label: string, assetElement: HTMLElement, imgElement:return {label,click() {- nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))+ nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));assetElement.style.width = label === window.siyuan.languages.default ? "" : label;imgElement.style.width = label === window.siyuan.languages.default ? "" : "10000px";assetElement.style.maxWidth = label === window.siyuan.languages.default ? (imgElement.clientWidth + 10) + "px" : "";diff --git a/app/src/mobile/util/MobileFiles.ts b/app/src/mobile/util/MobileFiles.tsindex e1cf297a49..5d523576cd 100644--- a/app/src/mobile/util/MobileFiles.ts+++ b/app/src/mobile/util/MobileFiles.ts@@ -438,7 +438,7 @@ export class MobileFiles extends Model {targetElement.querySelector(".b3-list-item__toggle").classList.remove("fn__hidden");const emojiElement = targetElement.querySelector(".b3-list-item__icon");if (emojiElement.innerHTML === unicode2Emoji(Constants.SIYUAN_IMAGE_FILE)) {- emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER)+ emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER);}if (targetElement.nextElementSibling && targetElement.nextElementSibling.tagName === "UL") {targetElement.nextElementSibling.remove();diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.tsindex c28819bb9b..d2193f480c 100644--- a/app/src/protyle/header/Title.ts+++ b/app/src/protyle/header/Title.ts@@ -1,9 +1,7 @@import {focusBlock,- focusByOffset,focusByRange,getEditorRange,- getSelectionOffset,} from "../util/selection";import {fetchPost} from "../../util/fetch";import {replaceFileName, validateName} from "../../editor/rename";diff --git a/app/src/protyle/wysiwyg/commonHotkey.ts b/app/src/protyle/wysiwyg/commonHotkey.tsindex 300750a5bd..e1c268d5bf 100644--- a/app/src/protyle/wysiwyg/commonHotkey.ts+++ b/app/src/protyle/wysiwyg/commonHotkey.ts@@ -9,7 +9,7 @@ import {Constants} from "../../constants";import {onGet} from "../util/onGet";export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent) => {- const target = event.target as HTMLElement+ const target = event.target as HTMLElement;if (matchHotKey(window.siyuan.config.keymap.editor.general.copyHPath.custom, event)) {fetchPost("/api/filetree/getHPathByID", {id: protyle.block.rootID@@ -65,4 +65,4 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent) => {return true;}}-}+};diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex 7dd8852c4e..4144a6cb49 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -21,7 +21,6 @@ import {isNotEditBlock,} from "./getBlock";import {matchHotKey} from "../util/hotKey";-import {fullscreen} from "../breadcrumb/action";import {enter} from "./enter";import {fixTable} from "../util/table";import {phTransaction, transaction, turnsIntoTransaction, updateTransaction} from "./transaction";@@ -39,7 +38,6 @@ import {setPosition} from "../../util/setPosition";import {removeEmbed} from "./removeEmbed";import {openAttr} from "../../menus/commonMenuItem";import {Constants} from "../../constants";-import {addLoading, setPadding} from "../ui/initUI";import {preventScroll} from "../scroll/preventScroll";import {bindMenuKeydown} from "../../menus/Menu";import {fetchPost} from "../../util/fetch";diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.tsindex e1455a1aa9..633404b06a 100644--- a/app/src/util/newFile.ts+++ b/app/src/util/newFile.ts@@ -8,7 +8,6 @@ import {getDisplayName, getOpenNotebookCount, pathPosix} from "./pathName";import {openFileById} from "../editor/util";import {Constants} from "../constants";import {isMobile} from "./functions";-import {openMobileFileById} from "../mobile/editor";export const newFile = (notebookId?: string, currentPath?: string, open?: boolean) => {if (getOpenNotebookCount() === 0) {diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.tsindex 5a67ebaaef..f1b2b50353 100644--- a/app/src/util/onGetConfig.ts+++ b/app/src/util/onGetConfig.ts@@ -224,10 +224,10 @@ const initBar = () => {}if (barThemeModeElement.classList.contains("toolbar__item--active")) {barThemeModeElement.classList.remove("toolbar__item--active");- barThemeModeElement.setAttribute("aria-label", window.siyuan.languages.themeDark)+ barThemeModeElement.setAttribute("aria-label", window.siyuan.languages.themeDark);} else {barThemeModeElement.classList.add("toolbar__item--active");- barThemeModeElement.setAttribute("aria-label", window.siyuan.languages.themeLight)+ barThemeModeElement.setAttribute("aria-label", window.siyuan.languages.themeLight);}barThemeModeElement.setAttribute("disabled", "disabled");fetchPost("/api/system/setAppearanceMode", {