From 6f403972a90f8dc3f7a2c5f595e68e71a42ea3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A2=96=E9=80=B8?= <49649786+Zuoqiu-Yingyi@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:03:13 +0800 Subject: [PATCH] :art: Add plugin event bus `open-menu-inbox` --- app/src/layout/dock/Inbox.ts | 12 ++++++++++++ app/src/types/index.d.ts | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/layout/dock/Inbox.ts b/app/src/layout/dock/Inbox.ts index 03a602884d3..646035a1340 100644 --- a/app/src/layout/dock/Inbox.ts +++ b/app/src/layout/dock/Inbox.ts @@ -15,6 +15,7 @@ import {App} from "../../index"; import {getCloudURL} from "../../config/util/about"; import {hasClosestByClassName} from "../../protyle/util/hasClosest"; import {escapeHtml} from "../../util/escape"; +import {emitOpenMenu} from "../../plugin/EventBus"; export class Inbox extends Model { private element: Element; @@ -294,6 +295,17 @@ ${data.shorthandContent} } }).element); } + if (this.app.plugins) { + emitOpenMenu({ + plugins: this.app.plugins, + type: "open-menu-inbox", + detail: { + ids, + element: itemElement || detailsElement, + }, + separatorPosition: "top", + }); + } window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16}); } diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index e9dd3f4dc92..843c12a8ceb 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -56,7 +56,7 @@ type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" | "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-doctree" | + "open-menu-av" | "open-menu-content" | "open-menu-breadcrumbmore" | "open-menu-doctree" | "open-menu-inbox" | "open-siyuan-url-plugin" | "open-siyuan-url-block" | "paste" | "input-search" |