Skip to content

Commit b31102d

Browse files
committed
Merge branch 'dev'
2 parents 5f59ffe + 962f879 commit b31102d

File tree

8 files changed

+59
-13
lines changed

8 files changed

+59
-13
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Changelog
22

3-
## 0.2.7 2023-10
3+
## 0.2.8 2023-11-15
4+
5+
* [`resize` cannot be triggered after dragging to unpin the dock](https://github.com/siyuan-note/siyuan/issues/9640)
6+
7+
## 0.2.7 2023-10-31
8+
9+
* [Export `Constants` to plugin](https://github.com/siyuan-note/siyuan/issues/9555)
10+
* [Add plugin `app.appId`](https://github.com/siyuan-note/siyuan/issues/9538)
11+
* [Add plugin event bus `switch-protyle`](https://github.com/siyuan-note/siyuan/issues/9454)
412

513
## 0.2.6 2023-10-24
614

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[中文版](./README_zh_CN.md)
55

6-
> 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)
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)
77
88

99

@@ -98,7 +98,10 @@ conveniently.
9898
"custom": [
9999
"https://ld246.com/sponsor"
100100
]
101-
}
101+
},
102+
"keywords": [
103+
"sample", "示例"
104+
]
102105
}
103106
```
104107
@@ -137,6 +140,7 @@ conveniently.
137140
* `patreon`: Patreon name
138141
* `github`: GitHub login name
139142
* `custom`: Custom sponsorship link list
143+
* `keywords`: Search keyword list, used for marketplace search function
140144
141145
## Package
142146

README_zh_CN.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[English](./README.md)
55

66

7-
> 本例和 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.2.6](https://github.com/siyuan-note/plugin-sample/tree/v0.2.6)
7+
> 本例同 [siyuan/plugin-sample](https://github.com/siyuan-note/plugin-sample) [v0.2.8](https://github.com/siyuan-note/plugin-sample/tree/v0.2.8)
88
99
1. 使用 vite 打包
1010
2. 使用符号链接、而不是把项目放到插件目录下的模式进行开发
@@ -95,7 +95,10 @@
9595
"custom": [
9696
"https://ld246.com/sponsor"
9797
]
98-
}
98+
},
99+
"keywords": [
100+
"sample", "示例"
101+
]
99102
}
100103
```
101104
@@ -133,6 +136,7 @@
133136
* `patreon`:Patreon 名称
134137
* `github`:GitHub 登录名
135138
* `custom`:自定义赞助链接列表
139+
* `keywords`:搜索关键字列表,用于集市搜索功能
136140
137141
## 打包
138142

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"minimist": "^1.2.8",
2323
"rollup-plugin-livereload": "^2.0.5",
2424
"sass": "^1.62.1",
25-
"siyuan": "0.8.7",
25+
"siyuan": "0.8.8",
2626
"svelte": "^3.57.0",
2727
"ts-node": "^10.9.1",
2828
"typescript": "^5.0.4",

plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "plugin-sample-vite-svelte",
33
"author": "frostime",
44
"url": "https://github.com/siyuan-note/plugin-sample-vite-svelte",
5-
"version": "0.2.6",
6-
"minAppVersion": "2.10.12",
5+
"version": "0.2.8",
6+
"minAppVersion": "2.10.14",
77
"backends": [
88
"windows",
99
"linux",

src/api.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* API 文档见 [API_zh_CN.md](https://github.com/siyuan-note/siyuan/blob/master/API_zh_CN.md)
77
*/
88

9-
import { time } from "console";
109
import { fetchSyncPost, IWebSocketData } from "siyuan";
1110

1211

@@ -132,6 +131,16 @@ export async function getHPathByID(id: BlockId): Promise<string> {
132131
return request(url, data);
133132
}
134133

134+
135+
export async function getIDsByHPath(notebook: NotebookId, path: string): Promise<BlockId[]> {
136+
let data = {
137+
notebook: notebook,
138+
path: path
139+
};
140+
let url = '/api/filetree/getIDsByHPath';
141+
return request(url, data);
142+
}
143+
135144
// **************************************** Asset Files ****************************************
136145

137146
export async function upload(assetsDirPath: string, files: any[]): Promise<IResUpload> {

src/hello.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
</script>
3737

3838
<div class="b3-dialog__content">
39+
<div>appId:</div>
40+
<div class="fn__hr"></div>
41+
<div class="plugin-sample__time">${app?.appId}</div>
42+
<div class="fn__hr"></div>
43+
<div class="fn__hr"></div>
3944
<div>API demo:</div>
4045
<div class="fn__hr" />
4146
<div class="plugin-sample__time">

src/index.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import {
99
getFrontend,
1010
getBackend,
1111
IModel,
12-
Setting,
13-
fetchPost,
14-
Protyle, openWindow, IOperation
12+
Protyle,
13+
openWindow,
14+
IOperation,
15+
Constants
1516
} from "siyuan";
1617
import "@/index.scss";
1718

@@ -120,6 +121,9 @@ export default class PluginSample extends Plugin {
120121
text: "This is my custom dock"
121122
},
122123
type: DOCK_TYPE,
124+
resize() {
125+
console.log(DOCK_TYPE + " resize");
126+
},
123127
init() {
124128
this.element.innerHTML = `<div class="fn__flex-1 fn__flex-column">
125129
<div class="block__icons">
@@ -308,7 +312,7 @@ export default class PluginSample extends Plugin {
308312

309313
private showDialog() {
310314
let dialog = new Dialog({
311-
title: "Hello World",
315+
title: `SiYuan ${Constants.SIYUAN_VERSION}`,
312316
content: `<div id="helloPanel" class="b3-dialog__content"></div>`,
313317
width: this.isMobile ? "92vw" : "720px",
314318
destroyCallback(options) {
@@ -528,6 +532,18 @@ export default class PluginSample extends Plugin {
528532
click: () => {
529533
this.eventBus.off("loaded-protyle-dynamic", this.eventBusLog);
530534
}
535+
}, {
536+
icon: "iconSelect",
537+
label: "On switch-protyle",
538+
click: () => {
539+
this.eventBus.on("switch-protyle", this.eventBusLog);
540+
}
541+
}, {
542+
icon: "iconClose",
543+
label: "Off switch-protyle",
544+
click: () => {
545+
this.eventBus.off("switch-protyle", this.eventBusLog);
546+
}
531547
}, {
532548
icon: "iconSelect",
533549
label: "On destroy-protyle",

0 commit comments

Comments
 (0)