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:
Vanessab8444f7aca03
diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.tsindex 829f7c408c..207bbfafd7 100644--- a/app/src/asset/anno.ts+++ b/app/src/asset/anno.ts@@ -372,7 +372,7 @@ const getHightlightCoordsByRect = (pdf: any, color: string, rectResizeElement: Hconst mergeRects = (range: Range) => {const rects = range.getClientRects();const mergedRects: { left: number, top: number, right: number, bottom: number }[] = [];- let lastTop: number = undefined+ let lastTop: number = undefined;Array.from(rects).forEach(item => {if (item.height === 0 || item.width === 0) {return;@@ -381,11 +381,11 @@ const mergeRects = (range: Range) => {mergedRects.push({left: item.left, top: item.top, right: item.right, bottom: item.bottom});lastTop = item.top;} else {- mergedRects[mergedRects.length - 1].right = item.right+ mergedRects[mergedRects.length - 1].right = item.right;}- })- return mergedRects-}+ });+ return mergedRects;+};const getHightlightCoordsByRange = (pdf: any, color: string) => {const range = window.getSelection().getRangeAt(0);diff --git a/app/src/config/repos.ts b/app/src/config/repos.tsindex 8bb14818a0..136fb40a42 100644--- a/app/src/config/repos.ts+++ b/app/src/config/repos.ts@@ -524,7 +524,7 @@ ${passwordHTML}window.siyuan.config.sync.cloudName = name;getCloudList(true);});- return+ return;}confirmDialog(window.siyuan.languages.confirm, response.msg, () => {diff --git a/app/src/editor/util.ts b/app/src/editor/util.tsindex f0da17945d..833800b4cf 100644--- a/app/src/editor/util.ts+++ b/app/src/editor/util.ts@@ -149,7 +149,7 @@ const openFile = (options: IOpenFileOptions) => {wnd.split(direction).addTab(newTab(options));}} else if (options.keepCursor && wnd.children[0].model) {- const tab = newTab(options)+ const tab = newTab(options);tab.headElement.setAttribute("keep-cursor", options.id);wnd.addTab(tab, options.keepCursor);} else if (window.siyuan.config.fileTree.openFilesUseCurrentTab) {@@ -239,7 +239,7 @@ const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IModif (options.mode) {setEditMode(editor.editor.protyle, options.mode);}-}+};const newTab = (options: IOpenFileOptions) => {let tab: Tab;@@ -293,7 +293,7 @@ const newTab = (options: IOpenFileOptions) => {});}return tab;-}+};export const updatePanelByEditor = (protyle?: IProtyle, focus = true, pushBackStack = false, reload = false) => {let title = window.siyuan.languages.siyuanNote;diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.tsindex 15ba5eb816..d666d33d94 100644--- a/app/src/protyle/util/paste.ts+++ b/app/src/protyle/util/paste.ts@@ -21,11 +21,11 @@ const filterClipboardHint = (protyle: IProtyle, textPlain: string) => {needRender = false;return true;}- })+ });if (needRender) {protyle.hint.render(protyle);}-}+};export const pasteText = (protyle: IProtyle, textPlain: string, nodeElement: Element) => {const range = getEditorRange(protyle.wysiwyg.element);@@ -59,7 +59,7 @@ export const pasteText = (protyle: IProtyle, textPlain: string, nodeElement: EleblockRender(protyle, protyle.wysiwyg.element);processRender(protyle.wysiwyg.element);highlightRender(protyle.wysiwyg.element);- filterClipboardHint(protyle, textPlain)+ filterClipboardHint(protyle, textPlain);scrollCenter(protyle);};@@ -199,7 +199,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven// 转换为 md,避免再次粘贴 ID 重复const tempMd = protyle.lute.BlockDOM2StdMd(tempElement.innerHTML);writeText(tempMd);- filterClipboardHint(protyle, tempMd)+ filterClipboardHint(protyle, tempMd);} else if (textHTML.endsWith(Constants.ZWSP)) {// 编辑器内部粘贴tempElement.innerHTML = textHTML.substr(0, textHTML.length - 1);@@ -213,7 +213,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven});const tempInnerHTML = tempElement.innerHTML;insertHTML(tempInnerHTML, protyle);- filterClipboardHint(protyle, tempInnerHTML)+ filterClipboardHint(protyle, tempInnerHTML);} else {tempElement.innerHTML = textHTML;tempElement.querySelectorAll("[style]").forEach((e) => {@@ -239,7 +239,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEvenblockRender(protyle, protyle.wysiwyg.element);processRender(protyle.wysiwyg.element);highlightRender(protyle.wysiwyg.element);- filterClipboardHint(protyle, response.data)+ filterClipboardHint(protyle, response.data);scrollCenter(protyle);});return;@@ -258,7 +258,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven}const textPlainDom = protyle.lute.Md2BlockDOM(textPlain);insertHTML(textPlainDom, protyle);- filterClipboardHint(protyle, textPlainDom)+ filterClipboardHint(protyle, textPlainDom);}blockRender(protyle, protyle.wysiwyg.element);processRender(protyle.wysiwyg.element);diff --git a/app/src/util/history.ts b/app/src/util/history.tsindex 37137cbd54..825cf21c1f 100644--- a/app/src/util/history.ts+++ b/app/src/util/history.ts@@ -109,7 +109,7 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: stringelement.lastElementChild.innerHTML = `<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>`;return;}- let actionHTML = ''+ let actionHTML = "";if (type === "cloudTag") {actionHTML = `<span class="b3-list-item__action b3-tooltips b3-tooltips__w" data-type="downloadSnapshot" aria-label="${window.siyuan.languages.download}"><svg><use xlink:href="#iconDownload"></use></svg></span><span class="b3-list-item__action b3-tooltips b3-tooltips__w" data-type="removeCloudRepoTagSnapshot" aria-label="${window.siyuan.languages.remove}"><svg><use xlink:href="#iconTrashcan"></use></svg></span>`;@@ -450,7 +450,7 @@ export const openHistory = () => {confirmDialog(window.siyuan.languages.delete, `${window.siyuan.languages.confirmDelete} <i>${tag}</i>?`, () => {fetchPost("/api/repo/" + type, {tag}, () => {if (target.parentElement.parentElement.childElementCount === 1) {- target.parentElement.parentElement.innerHTML = `<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>`+ target.parentElement.parentElement.innerHTML = `<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>`;} else {target.parentElement.remove();}