Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 5, 2023
1 parent 684e7c3 commit dca6add
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 0.8.5 2023-09

* [Add plugin event bus `open-menu-doctree`](https://github.com/siyuan-note/siyuan/issues/9351)

## 0.8.4 2023-09-19

* [Improve `Menu`](https://github.com/siyuan-note/petal/pull/16)
Expand Down
20 changes: 18 additions & 2 deletions siyuan.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,19 @@ interface IEventBusMap {
"input-search": types.events.IInputSearchDetail;
"loaded-protyle-dynamic": types.events.ILoadedProtyleDynamicDetail;
"loaded-protyle": types.events.ILoadedProtyleDetail;
"open-menu-av": any;
"open-menu-av": {
menu: EventMenu,
protyle: IProtyle,
element: HTMLElement
};
"open-menu-blockref": types.events.IOpenMenuBlockRefDetail;
"open-menu-breadcrumbmore": types.events.IOpenMenuBreadcrumbMoreDetail;
"open-menu-content": types.events.IOpenMenuContentDetail;
"open-menu-fileannotationref": types.events.IOpenMenuFileAnnotationRefDetail;
"open-menu-image": types.events.IOpenMenuImageDetail;
"open-menu-link": types.events.IOpenMenuLinkDetail;
"open-menu-tag": types.events.IOpenMenuTagDetail;
"open-menu-doctree": { menu: EventMenu, elements: NodeListOf<Element>, type: "doc" | "docs" | "notebook" };
"open-noneditableblock": types.events.IOpenNonEditableBlockDetail;
"open-siyuan-url-block": types.events.IOpenSiyuanUrlBlockDetail;
"open-siyuan-url-plugin": types.events.IOpenSiyuanUrlPluginDetail;
Expand Down Expand Up @@ -207,8 +212,9 @@ interface IPluginDockTab {
}

interface IMenuItemOption {
iconClass?: string,
label?: string,
click?: (element: HTMLElement) => void,
click?: (element: HTMLElement, event: MouseEvent) => boolean | void | Promise<boolean | void>
type?: "separator" | "submenu" | "readonly",
accelerator?: string,
action?: string,
Expand Down Expand Up @@ -564,6 +570,16 @@ export class Menu {
close(): void;
}

export class EventMenu {
public menus: IMenuItemOption[];

constructor()

public addSeparator(index?: number): void

public addItem(menu: IMenuItemOption): void
}

export class Lute {
public static WalkStop: number;
public static WalkSkipChildren: number;
Expand Down

0 comments on commit dca6add

Please sign in to comment.