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/16051
Vanessaefd2adb4fdf8
diff --git a/app/src/constants.ts b/app/src/constants.tsindex b4c072fc9d..c8c3cfc11e 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -275,6 +275,7 @@ export abstract class Constants {public static readonly MENU_SEARCH_REPLACE_HISTORY = "search-replace-history"; // 替换历史菜单public static readonly MENU_SEARCH_ASSET_HISTORY = "search-asset-history"; // 资源文件搜索历史菜单public static readonly MENU_MOVE_PATH_HISTORY = "move-path-history"; // 移动文档窗口搜索历史菜单+ public static readonly MENU_CALLOUT_SELECT = "callout-select"; // 提示选择菜单public static readonly MENU_BACKGROUND_ASSET = "background-asset"; // 资源文件选择器菜单public static readonly MENU_AI = "ai"; // 块 AI 菜单diff --git a/app/src/protyle/wysiwyg/callout.ts b/app/src/protyle/wysiwyg/callout.tsindex 6f4f2af414..ce171d4281 100644--- a/app/src/protyle/wysiwyg/callout.ts+++ b/app/src/protyle/wysiwyg/callout.ts@@ -5,6 +5,7 @@ import {Dialog} from "../../dialog";import {escapeHtml} from "../../util/escape";import {Menu} from "../../plugin/Menu";import {isMobile} from "../../util/functions";+import {Constants} from "../../constants";export const updateCalloutType = (titleElement: HTMLElement, protyle: IProtyle) => {const blockElement = hasClosestBlock(titleElement);@@ -74,7 +75,11 @@ export const updateCalloutType = (titleElement: HTMLElement, protyle: IProtyle)textElements[0].select();let updateIcon = "";dialog.element.querySelector(".b3-form__icona-icon").addEventListener("click", (event) => {- const menu = new Menu();+ const menu = new Menu(Constants.MENU_CALLOUT_SELECT, () => {+ if (document.activeElement.tagName === "BODY") {+ textElements[0].focus();+ }+ });if (menu.isOpen) {menu.close();return;@@ -89,7 +94,7 @@ export const updateCalloutType = (titleElement: HTMLElement, protyle: IProtyle)icon: "⚠️", type: "Warning", color: "var(--b3-callout-warning)"}, {icon: "🚨", type: "Caution", color: "var(--b3-theme-error)"- }].forEach(item => {+ }].forEach((item) => {menu.addItem({iconHTML: `<span class="b3-menu__icon">${item.icon.toUpperCase()}</span>`,label: `<span style="color: ${item.color}">${item.type}</span>`,