From 3de8bc61344ec06257d10c5b2c435ca2df831b52 Mon Sep 17 00:00:00 2001 From: frostime Date: Sun, 19 Nov 2023 11:49:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=B3=20chore(update):=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=A8=A1=E6=9D=BF=E7=9A=84=E4=BE=9D=E8=B5=96=E3=80=81?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=AD=89=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++-- README_zh_CN.md | 8 ++++++-- package.json | 2 +- plugin.json | 4 ++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4a2b21b..4f79c10 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [中文版](./README_zh_CN.md) -> Consistent with [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.2.6](https://github.com/siyuan-note/plugin-sample/tree/v0.2.6) +> Consistent with [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.2.8](https://github.com/siyuan-note/plugin-sample/tree/v0.2.8) @@ -98,7 +98,10 @@ conveniently. "custom": [ "https://ld246.com/sponsor" ] - } + }, + "keywords": [ + "sample", "示例" + ] } ``` @@ -137,6 +140,7 @@ conveniently. * `patreon`: Patreon name * `github`: GitHub login name * `custom`: Custom sponsorship link list +* `keywords`: Search keyword list, used for marketplace search function ## Package diff --git a/README_zh_CN.md b/README_zh_CN.md index bf72da3..5b3e6e8 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -4,7 +4,7 @@ [English](./README.md) -> 本例和 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.2.6](https://github.com/siyuan-note/plugin-sample/tree/v0.2.6) +> 本例同 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.2.8](https://github.com/siyuan-note/plugin-sample/tree/v0.2.8) 1. 使用 vite 打包 2. 使用符号链接、而不是把项目放到插件目录下的模式进行开发 @@ -95,7 +95,10 @@ "custom": [ "https://ld246.com/sponsor" ] - } + }, + "keywords": [ + "sample", "示例" + ] } ``` @@ -133,6 +136,7 @@ * `patreon`:Patreon 名称 * `github`:GitHub 登录名 * `custom`:自定义赞助链接列表 +* `keywords`:搜索关键字列表,用于集市搜索功能 ## 打包 diff --git a/package.json b/package.json index bfe4eb0..e4c06a2 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "minimist": "^1.2.8", "rollup-plugin-livereload": "^2.0.5", "sass": "^1.62.1", - "siyuan": "0.8.7", + "siyuan": "0.8.8", "svelte": "^3.57.0", "ts-node": "^10.9.1", "typescript": "^5.0.4", diff --git a/plugin.json b/plugin.json index f3e2682..7bb3bea 100644 --- a/plugin.json +++ b/plugin.json @@ -2,8 +2,8 @@ "name": "plugin-sample-vite-svelte", "author": "frostime", "url": "https://github.com/siyuan-note/plugin-sample-vite-svelte", - "version": "0.2.6", - "minAppVersion": "2.10.12", + "version": "0.2.8", + "minAppVersion": "2.10.14", "backends": [ "windows", "linux", From 8e841a4a905f16c9accf2150e1e89b905fab0e5d Mon Sep 17 00:00:00 2001 From: frostime Date: Sun, 19 Nov 2023 12:17:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=A8=20feat(update):=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=8F=92=E4=BB=B6=E6=A8=A1=E6=9D=BF=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 +++++++++- src/api.ts | 1 - src/hello.svelte | 5 +++++ src/index.ts | 24 ++++++++++++++++++++---- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aadd6ee..4411dd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Changelog -## 0.2.7 2023-10 +## 0.2.8 2023-11-15 + +* [`resize` cannot be triggered after dragging to unpin the dock](https://github.com/siyuan-note/siyuan/issues/9640) + +## 0.2.7 2023-10-31 + +* [Export `Constants` to plugin](https://github.com/siyuan-note/siyuan/issues/9555) +* [Add plugin `app.appId`](https://github.com/siyuan-note/siyuan/issues/9538) +* [Add plugin event bus `switch-protyle`](https://github.com/siyuan-note/siyuan/issues/9454) ## 0.2.6 2023-10-24 diff --git a/src/api.ts b/src/api.ts index 4b12999..7202000 100644 --- a/src/api.ts +++ b/src/api.ts @@ -6,7 +6,6 @@ * API 文档见 [API_zh_CN.md](https://github.com/siyuan-note/siyuan/blob/master/API_zh_CN.md) */ -import { time } from "console"; import { fetchSyncPost, IWebSocketData } from "siyuan"; diff --git a/src/hello.svelte b/src/hello.svelte index 63a54a2..cc9f0dd 100644 --- a/src/hello.svelte +++ b/src/hello.svelte @@ -36,6 +36,11 @@
+
appId:
+
+
${app?.appId}
+
+
API demo:
diff --git a/src/index.ts b/src/index.ts index aa7bd75..6fb4f0a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,9 +9,10 @@ import { getFrontend, getBackend, IModel, - Setting, - fetchPost, - Protyle, openWindow, IOperation + Protyle, + openWindow, + IOperation, + Constants } from "siyuan"; import "@/index.scss"; @@ -120,6 +121,9 @@ export default class PluginSample extends Plugin { text: "This is my custom dock" }, type: DOCK_TYPE, + resize() { + console.log(DOCK_TYPE + " resize"); + }, init() { this.element.innerHTML = `
@@ -308,7 +312,7 @@ export default class PluginSample extends Plugin { private showDialog() { let dialog = new Dialog({ - title: "Hello World", + title: `SiYuan ${Constants.SIYUAN_VERSION}`, content: `
`, width: this.isMobile ? "92vw" : "720px", destroyCallback(options) { @@ -528,6 +532,18 @@ export default class PluginSample extends Plugin { click: () => { this.eventBus.off("loaded-protyle-dynamic", this.eventBusLog); } + }, { + icon: "iconSelect", + label: "On switch-protyle", + click: () => { + this.eventBus.on("switch-protyle", this.eventBusLog); + } + }, { + icon: "iconClose", + label: "Off switch-protyle", + click: () => { + this.eventBus.off("switch-protyle", this.eventBusLog); + } }, { icon: "iconSelect", label: "On destroy-protyle", From 962f879fa25d0e682f6da3d78f91467109846b49 Mon Sep 17 00:00:00 2001 From: frostime Date: Sun, 19 Nov 2023 12:30:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=A8=20feat(api):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E7=AB=AFAPI=20`getIDsByHPath`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api.ts b/src/api.ts index 7202000..9a4ff3f 100644 --- a/src/api.ts +++ b/src/api.ts @@ -131,6 +131,16 @@ export async function getHPathByID(id: BlockId): Promise { return request(url, data); } + +export async function getIDsByHPath(notebook: NotebookId, path: string): Promise { + let data = { + notebook: notebook, + path: path + }; + let url = '/api/filetree/getIDsByHPath'; + return request(url, data); +} + // **************************************** Asset Files **************************************** export async function upload(assetsDirPath: string, files: any[]): Promise {