An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/15641
Vanessa3bd7c9271089
diff --git a/app/src/plugin/API.ts b/app/src/plugin/API.tsindex 26976c04ec..630bf5950c 100644--- a/app/src/plugin/API.ts+++ b/app/src/plugin/API.ts@@ -213,24 +213,32 @@ const saveLayout = (cb: () => void) => {/// #endif};-const getActiveEditor = () => {+const getActiveEditor = (wndActive = true) => {let editor;/// #if !MOBILEconst range = getSelection().rangeCount > 0 ? getSelection().getRangeAt(0) : null;+ const allEditor = getAllEditor();if (range) {- editor = getAllEditor().find(item => {+ editor = allEditor.find(item => {if (item.protyle.element.contains(range.startContainer)) {return true;}});}if (!editor) {- editor = getAllEditor().find(item => {+ editor = allEditor.find(item => {if (hasClosestByClassName(item.protyle.element, "layout__wnd--active", true)) {return true;}});}+ if (!editor && !wndActive) {+ editor = allEditor.find(item => {+ if (item.protyle?.model.parent.headElement?.classList.contains("item--focus")) {+ return true;+ }+ });+ }/// #elseeditor = window.siyuan.mobile.popEditor || window.siyuan.mobile.editor;/// #endif