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/17814
Vanessac80222f01a1d
diff --git a/app/src/constants.ts b/app/src/constants.tsindex f18432ff80..1b7008119c 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -67,6 +67,9 @@ export abstract class Constants {public static readonly CUSTOM_SY_AV_VIEW: string = "custom-sy-av-view";public static readonly CUSTOM_SY_TITLE_EMPTY: string = "custom-sy-title-empty";+ // 临时标记 DOM 属性以辅助完成其功能+ public static readonly ATTRIBUTE_EDITING = "data-editing";+// sizepublic static readonly SIZE_DATABASE_MAZ_SIZE: number = 102400;public static readonly SIZE_UPLOAD_TIP_SIZE: number = 268435456; // 256 Mdiff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.tsindex ccf0da562a..11ff857d49 100644--- a/app/src/protyle/toolbar/index.ts+++ b/app/src/protyle/toolbar/index.ts@@ -862,6 +862,8 @@ export class Toolbar {if (!nodeElement) {return;}+ // https://github.com/siyuan-note/siyuan/issues/17814+ nodeElement.setAttribute(Constants.ATTRIBUTE_EDITING, "true");hideElements(["hint", "select"], protyle);window.siyuan.menus.menu.remove();const id = nodeElement.getAttribute("data-node-id");diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.tsindex f2cf4473c6..5cba37a63e 100644--- a/app/src/protyle/wysiwyg/transaction.ts+++ b/app/src/protyle/wysiwyg/transaction.ts@@ -110,6 +110,10 @@ const promiseTransaction = () => {let updatedEmbed = false;const updateHTML = (item: Element, html: string) => {+ if (item.getAttribute(Constants.ATTRIBUTE_EDITING) === "true") {+ item.removeAttribute(Constants.ATTRIBUTE_EDITING);+ return;+ }const tempElement = document.createElement("template");tempElement.innerHTML = protyle.lute.SpinBlockDOM(html);tempElement.content.querySelectorAll(".protyle-wysiwyg--select").forEach(selectItem => {