🚀 update to v0.3.2

This commit is contained in:
frostime 2024-01-13 21:40:22 +08:00
parent 74d62ac1aa
commit 1735ec4bce
6 changed files with 79 additions and 8 deletions

View file

@ -9,7 +9,7 @@
import { fetchSyncPost, IWebSocketData } from "siyuan";
async function request(url: string, data: any) {
export async function request(url: string, data: any) {
let response: IWebSocketData = await fetchSyncPost(url, data);
let res = response.code === 0 ? response.data : null;
return res;

View file

@ -13,7 +13,10 @@ import {
openWindow,
IOperation,
Constants,
openMobileFileById
openMobileFileById,
lockScreen,
ICard,
ICardData
} from "siyuan";
import "@/index.scss";
@ -227,6 +230,38 @@ export default class PluginSample extends Plugin {
}
}];
this.protyleOptions = {
toolbar: ["block-ref",
"a",
"|",
"text",
"strong",
"em",
"u",
"s",
"mark",
"sup",
"sub",
"clear",
"|",
"code",
"kbd",
"tag",
"inline-math",
"inline-memo",
"|",
{
name: "insert-smail-emoji",
icon: "iconEmoji",
hotkey: "⇧⌘I",
tipPosition: "n",
tip: this.i18n.insertEmoji,
click(protyle: Protyle) {
protyle.insert("😊");
}
}],
};
console.log(this.i18n.helloPlugin);
}
@ -263,6 +298,23 @@ export default class PluginSample extends Plugin {
console.log("onunload");
}
uninstall() {
console.log("uninstall");
}
async updateCards(options: ICardData) {
options.cards.sort((a: ICard, b: ICard) => {
if (a.blockID < b.blockID) {
return -1;
}
if (a.blockID > b.blockID) {
return 1;
}
return 0;
});
return options;
}
/**
* A custom setting pannel provided by svelte
*/
@ -447,6 +499,13 @@ export default class PluginSample extends Plugin {
}
});
}
menu.addItem({
icon: "iconLock",
label: "Lockscreen",
click: () => {
lockScreen(this.app);
}
});
menu.addItem({
icon: "iconScrollHoriz",
label: "Event Bus",
@ -679,6 +738,18 @@ export default class PluginSample extends Plugin {
click: () => {
this.eventBus.off("open-menu-breadcrumbmore", this.eventBusLog);
}
}, {
icon: "iconSelect",
label: "On open-menu-inbox",
click: () => {
this.eventBus.on("open-menu-inbox", this.eventBusLog);
}
}, {
icon: "iconClose",
label: "Off open-menu-inbox",
click: () => {
this.eventBus.off("open-menu-inbox", this.eventBusLog);
}
}, {
icon: "iconSelect",
label: "On input-search",