update
This commit is contained in:
parent
4fc8ef7afc
commit
811519bfd8
4 changed files with 41 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
## 0.2.0
|
||||||
|
|
||||||
|
* [Add plugin event bus `open-siyuan-url-plugin` and `open-siyuan-url-block`](https://github.com/siyuan-note/siyuan/pull/8927)
|
||||||
|
|
||||||
|
|
||||||
## 0.1.12 2023-08-01
|
## 0.1.12 2023-08-01
|
||||||
|
|
||||||
* Upgrade siyuan to 0.7.9
|
* Upgrade siyuan to 0.7.9
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
[中文版](./README_zh_CN.md)
|
[中文版](./README_zh_CN.md)
|
||||||
|
|
||||||
> Consistent with [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.1.10](https://github.com/siyuan-note/plugin-sample/tree/v0.1.10)
|
> Consistent with [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.1.12](https://github.com/siyuan-note/plugin-sample/tree/v0.1.12)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
[English](./README.md)
|
[English](./README.md)
|
||||||
|
|
||||||
|
|
||||||
> 本例和 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.1.10](https://github.com/siyuan-note/plugin-sample/tree/v0.1.10)
|
> 本例和 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.1.12](https://github.com/siyuan-note/plugin-sample/tree/v0.1.12)
|
||||||
|
|
||||||
1. 使用 vite 打包
|
1. 使用 vite 打包
|
||||||
2. 使用符号链接、而不是把项目放到插件目录下的模式进行开发
|
2. 使用符号链接、而不是把项目放到插件目录下的模式进行开发
|
||||||
|
|
35
src/index.ts
35
src/index.ts
|
@ -108,7 +108,16 @@ export default class PluginSample extends Plugin {
|
||||||
hotkey: "⇧⌘M",
|
hotkey: "⇧⌘M",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
this.showDialog();
|
this.showDialog();
|
||||||
}
|
},
|
||||||
|
fileTreeCallback: (file: any) => {
|
||||||
|
console.log(file, "fileTreeCallback");
|
||||||
|
},
|
||||||
|
editorCallback: (protyle: any) => {
|
||||||
|
console.log(protyle, "editorCallback");
|
||||||
|
},
|
||||||
|
dockCallback: (element: HTMLElement) => {
|
||||||
|
console.log(element, "dockCallback");
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addDock({
|
this.addDock({
|
||||||
|
@ -536,6 +545,30 @@ export default class PluginSample extends Plugin {
|
||||||
click: () => {
|
click: () => {
|
||||||
this.eventBus.off("input-search", this.eventBusLog);
|
this.eventBus.off("input-search", this.eventBusLog);
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
icon: "iconSelect",
|
||||||
|
label: "On open-siyuan-url-plugin",
|
||||||
|
click: () => {
|
||||||
|
this.eventBus.on("open-siyuan-url-plugin", this.eventBusLog);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
icon: "iconClose",
|
||||||
|
label: "Off open-siyuan-url-plugin",
|
||||||
|
click: () => {
|
||||||
|
this.eventBus.off("open-siyuan-url-plugin", this.eventBusLog);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
icon: "iconSelect",
|
||||||
|
label: "On open-siyuan-url-block",
|
||||||
|
click: () => {
|
||||||
|
this.eventBus.on("open-siyuan-url-block", this.eventBusLog);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
icon: "iconClose",
|
||||||
|
label: "Off open-siyuan-url-block",
|
||||||
|
click: () => {
|
||||||
|
this.eventBus.off("open-siyuan-url-block", this.eventBusLog);
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue