Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/9351

Vanessacd3642f0f930
diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts
index 79eb9da928..98217be73d 100644
--- a/app/src/menus/navigation.ts
+++ b/app/src/menus/navigation.ts
@@ -28,6 +28,7 @@ import {openDocHistory} from "../history/doc";
import {openEditorTab} from "./util";
import {makeCard} from "../card/makeCard";
import {transaction} from "../protyle/wysiwyg/transaction";
+import {emitOpenMenu} from "../plugin/EventBus";
const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
const fileItemElement = Array.from(selectItemElements).find(item => {
@@ -105,6 +106,17 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
icon: "iconRiffCard",
submenu: riffCardMenu,
}).element);
+ if (app.plugins) {
+ emitOpenMenu({
+ plugins: app.plugins,
+ type: "open-menu-doctree",
+ detail: {
+ elements: selectItemElements,
+ type: "docs"
+ },
+ separatorPosition: "top",
+ });
+ }
return window.siyuan.menus.menu;
};
@@ -325,6 +337,17 @@ export const initNavigationMenu = (app: App, liElement: HTMLElement) => {
}
}]
}).element);
+ if (app.plugins) {
+ emitOpenMenu({
+ plugins: app.plugins,
+ type: "open-menu-doctree",
+ detail: {
+ elements: selectItemElements,
+ type: "notebook"
+ },
+ separatorPosition: "top",
+ });
+ }
return window.siyuan.menus.menu;
};
@@ -594,6 +617,17 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
}
genImportMenu(notebookId, pathString);
window.siyuan.menus.menu.append(exportMd(id));
+ if (app.plugins) {
+ emitOpenMenu({
+ plugins: app.plugins,
+ type: "open-menu-doctree",
+ detail: {
+ elements: selectItemElements,
+ type: "doc"
+ },
+ separatorPosition: "top",
+ });
+ }
return window.siyuan.menus.menu;
};
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 7a3df4d74a..d8d76c616a 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -46,7 +46,7 @@ type TEventBus = "ws-main" |
"click-blockicon" | "click-editorcontent" | "click-pdf" | "click-editortitleicon" |
"open-noneditableblock" |
"open-menu-blockref" | "open-menu-fileannotationref" | "open-menu-tag" | "open-menu-link" | "open-menu-image" |
- "open-menu-av" | "open-menu-content" | "open-menu-breadcrumbmore" |
+ "open-menu-av" | "open-menu-content" | "open-menu-breadcrumbmore" | "open-menu-doctree" |
"open-siyuan-url-plugin" | "open-siyuan-url-block" |
"input-search" |
"loaded-protyle" | "loaded-protyle-dynamic" |