siyuan 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ ## v0.7.4 2023-06-13
4
+ 1. [Add `beforeDestroy`](https://github.com/siyuan-note/siyuan/issues/8467)
5
+
6
+ ## v0.7.2
7
+ 1. 更换为 SiYuan 官方 API
8
+
9
+ ## v0.7.0
10
+ 1. 添加版本自动判断
11
+ 2. 添加插件系统内置配置页面支持插件注入
12
+ 3. 修复export classes
13
+
14
+ ## v0.5.0
15
+ 1. 插件系统国际化
16
+ 2. 插件支持卸载
17
+ 3. 插件商店预览功能
18
+
19
+ ## v0.4.0
20
+ 1. 插件系统已支持浏览器使用,需思源2.8.1及以上版本。 **注意:大量插件目前对web的支持并不好,需要等待插件开发者进行适配。建议还是在桌面端使用。**
21
+ 2. 升级过程中将原版代码挂件loader迁移到挂件版路径,但不会下载挂件。
22
+ 3. 挂件版用户记得更新到最新版本挂件
23
+
24
+ ## v0.3.21
25
+ + 挂件版本不进行自动升级,即使勾选了自动升级功能
26
+
27
+ ## v0.3.20
28
+ + 新增功能:命令面板
29
+ + 重构:修改vite构建脚本,移除dist
30
+
31
+ ## v0.3.19
32
+ + 修改图标
33
+ + eslint重构代码
34
+
35
+ ## v0.3.13
36
+ + 增加插件商店,并可配置插件商店地址
37
+ + 暴露PluginSystem及Ioc容器到window对象
38
+
39
+ ## v0.3.12
40
+ + 重构API接口,支持自动化导出api类型声明
41
+
42
+ ## v0.3.11
43
+ + 增加通过Plugin继承调用registerCommand,实现插件快捷键注册。未来将通过此方式开发命令面板。
44
+
45
+ ## v0.3.10
46
+ + 修复没有plugins时初次安装遇到的问题
47
+
48
+ ## v0.3.9
49
+ + 适配思源2.7.7,调整配置界面布局
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Siyuan Plugin API
1
+ # SiYuan Plugin API
2
2
 
3
- This is Siyuan Plugin System API. Only types declaration here.
3
+ Here is the API declaration of SiYuan Plugin System, usages please refer to [SiYuan plugin sample](https://github.com/siyuan-note/plugin-sample).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "siyuan",
3
- "author": ["zuoez02", "Vanessa"],
3
+ "contributors": ["zuoez02", "Vanessa"],
4
4
  "types": "siyuan.d.ts",
5
- "version": "0.7.2",
6
- "repository": "https://github.com/siyuan-note/petal/type"
5
+ "version": "0.7.4",
6
+ "repository": "https://github.com/siyuan-note/petal"
7
7
  }
package/siyuan.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  type TEventBus = "ws-main" | "click-blockicon" | "click-editorcontent" | "click-pdf" |
2
- "click-editortitleicon" | "open-noneditableblock"
2
+ "click-editortitleicon" | "open-noneditableblock" | "loaded-protyle"
3
3
 
4
4
  type TCardType = "doc" | "notebook" | "all"
5
5
 
@@ -79,7 +79,7 @@ interface IWebSocketData {
79
79
  sid: string
80
80
  }
81
81
 
82
- declare interface IPluginDockTab {
82
+ interface IPluginDockTab {
83
83
  position: "LeftTop" | "LeftBottom" | "RightTop" | "RightBottom" | "BottomLeft" | "BottomRight",
84
84
  size: { width: number, height: number },
85
85
  icon: string,
@@ -190,6 +190,7 @@ export abstract class Plugin {
190
190
  name: string;
191
191
  app: App;
192
192
  commands: ICommandOption[];
193
+ setting: Setting;
193
194
 
194
195
  constructor(options: {
195
196
  app: App,
@@ -206,6 +207,7 @@ export abstract class Plugin {
206
207
  /**
207
208
  * Must be executed before the synchronous function.
208
209
  * @param {string} [options.position=right]
210
+ * @param {string} options.icon - Support svg id or svg tag.
209
211
  */
210
212
  addTopBar(options: {
211
213
  icon: string,
@@ -238,6 +240,7 @@ export abstract class Plugin {
238
240
  */
239
241
  addTab(options: {
240
242
  type: string,
243
+ beforeDestroy?: () => void,
241
244
  destroy?: () => void,
242
245
  resize?: () => void,
243
246
  update?: () => void,
@@ -268,6 +271,24 @@ export abstract class Plugin {
268
271
  }): void
269
272
  }
270
273
 
274
+ export class Setting {
275
+ constructor(options: {
276
+ height?: string,
277
+ width?: string,
278
+ destroyCallback?: () => void
279
+ confirmCallback?: () => void
280
+ })
281
+
282
+ addItem(options: {
283
+ title: string
284
+ description?: string
285
+ actionElement?: HTMLElement
286
+ createActionElement?(): HTMLElement
287
+ }): void;
288
+
289
+ open(name: string): void;
290
+ }
291
+
271
292
  export class EventBus {
272
293
  on(type: TEventBus, listener: (event: CustomEvent<any>) => void): void;
273
294
 
@@ -317,7 +338,7 @@ export class Menu {
317
338
  close(): void;
318
339
  }
319
340
 
320
- declare class Lute {
341
+ export class Lute {
321
342
  public static WalkStop: number;
322
343
  public static WalkSkipChildren: number;
323
344
  public static WalkContinue: number;