siyuan 0.8.2 → 0.8.3

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 CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## 0.8.3 2023-09
3
+ ## 0.8.4 2023-09
4
+
5
+ ## 0.8.3 2023-09-05
6
+
7
+ * [Plugin API add openWindow and command.globalCallback](https://github.com/siyuan-note/siyuan/issues/9032)
4
8
 
5
9
  ## 0.8.2 2023-08-29
6
10
 
package/package.json CHANGED
@@ -2,6 +2,6 @@
2
2
  "name": "siyuan",
3
3
  "contributors": ["zuoez02", "Vanessa"],
4
4
  "types": "siyuan.d.ts",
5
- "version": "0.8.2",
5
+ "version": "0.8.3",
6
6
  "repository": "https://github.com/siyuan-note/petal"
7
7
  }
package/siyuan.d.ts CHANGED
@@ -51,6 +51,7 @@ interface IModel {
51
51
  app: App;
52
52
  reqId: number;
53
53
  parent: ITab | any;
54
+
54
55
  send(cmd: string, param: Record<string, unknown>, process?: boolean): void;
55
56
  }
56
57
 
@@ -59,10 +60,15 @@ interface ICustomModel extends IModel {
59
60
  data: any;
60
61
  type: string;
61
62
  element: HTMLElement;
63
+
62
64
  init(): void;
65
+
63
66
  update?(): void;
67
+
64
68
  resize?(): void;
69
+
65
70
  beforeDestroy?(): void;
71
+
66
72
  destroy?(): void;
67
73
  }
68
74
 
@@ -166,10 +172,11 @@ interface ICommandOption {
166
172
  */
167
173
  hotkey: string,
168
174
  customHotkey?: string,
169
- callback?: () => void
170
- fileTreeCallback?: (file: any) => void
171
- editorCallback?: (protyle: any) => void
172
- dockCallback?: (element: HTMLElement) => void
175
+ callback?: () => void // 其余回调存在时将不会触
176
+ globalCallback?: () => void // 焦点不在应用内时执行的回调
177
+ fileTreeCallback?: (file: any) => void // 焦点在文档树上时执行的回调
178
+ editorCallback?: (protyle: any) => void // 焦点在编辑器上时执行的回调
179
+ dockCallback?: (element: HTMLElement) => void // 焦点在 dock 上时执行的回调
173
180
  }
174
181
 
175
182
  interface IProtyleOption {
@@ -207,6 +214,19 @@ export function fetchSyncPost(url: string, data?: any): Promise<IWebSocketData>;
207
214
 
208
215
  export function fetchGet(url: string, callback: (response: IWebSocketData) => void): void;
209
216
 
217
+ export function openWindow(options: {
218
+ position?: {
219
+ x: number,
220
+ y: number,
221
+ },
222
+ height?: number,
223
+ width?: number,
224
+ tab?: ITab,
225
+ doc?: {
226
+ id: string, // 块 id
227
+ },
228
+ }): void;
229
+
210
230
  export function openTab(options: {
211
231
  app: App,
212
232
  doc?: {