siyuan 0.8.9 → 0.9.0
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 +20 -1
- package/package.json +1 -1
- package/siyuan.d.ts +12 -1
- package/types/protyle.d.ts +37 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.9.
|
|
3
|
+
## 0.9.1 2023-12
|
|
4
|
+
|
|
5
|
+
## 0.9.0 2023-12-05
|
|
6
|
+
|
|
7
|
+
* [Add plugin eventbus `sync-start`, `sync-end`, and `sync-fail`](https://github.com/siyuan-note/siyuan/issues/9798)
|
|
8
|
+
* [Add plugin event bus `mobile-keyboard-show` and `mobile-keyboard-hide`](https://github.com/siyuan-note/siyuan/issues/9773)
|
|
9
|
+
* [Add some `Protyle` methods to the plugin API](https://github.com/siyuan-note/petal/issues/21)
|
|
4
10
|
|
|
5
11
|
## 0.8.9 2023-11-28
|
|
6
12
|
|
|
@@ -78,49 +84,62 @@
|
|
|
78
84
|
* [Add ICommand.langText and change the type of i18n](https://github.com/siyuan-note/petal/pull/11)
|
|
79
85
|
|
|
80
86
|
## v0.7.4 2023-06-13
|
|
87
|
+
|
|
81
88
|
1. [Add `beforeDestroy`](https://github.com/siyuan-note/siyuan/issues/8467)
|
|
82
89
|
|
|
83
90
|
## v0.7.2
|
|
91
|
+
|
|
84
92
|
1. 更换为 SiYuan 官方 API
|
|
85
93
|
|
|
86
94
|
## v0.7.0
|
|
95
|
+
|
|
87
96
|
1. 添加版本自动判断
|
|
88
97
|
2. 添加插件系统内置配置页面支持插件注入
|
|
89
98
|
3. 修复export classes
|
|
90
99
|
|
|
91
100
|
## v0.5.0
|
|
101
|
+
|
|
92
102
|
1. 插件系统国际化
|
|
93
103
|
2. 插件支持卸载
|
|
94
104
|
3. 插件商店预览功能
|
|
95
105
|
|
|
96
106
|
## v0.4.0
|
|
107
|
+
|
|
97
108
|
1. 插件系统已支持浏览器使用,需思源2.8.1及以上版本。 **注意:大量插件目前对web的支持并不好,需要等待插件开发者进行适配。建议还是在桌面端使用。**
|
|
98
109
|
2. 升级过程中将原版代码挂件loader迁移到挂件版路径,但不会下载挂件。
|
|
99
110
|
3. 挂件版用户记得更新到最新版本挂件
|
|
100
111
|
|
|
101
112
|
## v0.3.21
|
|
113
|
+
|
|
102
114
|
+ 挂件版本不进行自动升级,即使勾选了自动升级功能
|
|
103
115
|
|
|
104
116
|
## v0.3.20
|
|
117
|
+
|
|
105
118
|
+ 新增功能:命令面板
|
|
106
119
|
+ 重构:修改vite构建脚本,移除dist
|
|
107
120
|
|
|
108
121
|
## v0.3.19
|
|
122
|
+
|
|
109
123
|
+ 修改图标
|
|
110
124
|
+ eslint重构代码
|
|
111
125
|
|
|
112
126
|
## v0.3.13
|
|
127
|
+
|
|
113
128
|
+ 增加插件商店,并可配置插件商店地址
|
|
114
129
|
+ 暴露PluginSystem及Ioc容器到window对象
|
|
115
130
|
|
|
116
131
|
## v0.3.12
|
|
132
|
+
|
|
117
133
|
+ 重构API接口,支持自动化导出api类型声明
|
|
118
134
|
|
|
119
135
|
## v0.3.11
|
|
136
|
+
|
|
120
137
|
+ 增加通过Plugin继承调用registerCommand,实现插件快捷键注册。未来将通过此方式开发命令面板。
|
|
121
138
|
|
|
122
139
|
## v0.3.10
|
|
140
|
+
|
|
123
141
|
+ 修复没有plugins时初次安装遇到的问题
|
|
124
142
|
|
|
125
143
|
## v0.3.9
|
|
144
|
+
|
|
126
145
|
+ 适配思源2.7.7,调整配置界面布局
|
package/package.json
CHANGED
package/siyuan.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ declare global {
|
|
|
11
11
|
|
|
12
12
|
export type TEventBus = keyof IEventBusMap
|
|
13
13
|
|
|
14
|
+
export type TTurnIntoOne = "BlocksMergeSuperBlock" | "Blocks2ULs" | "Blocks2OLs" | "Blocks2TLs" | "Blocks2Blockquote"
|
|
15
|
+
|
|
16
|
+
export type TTurnIntoOneSub = "row" | "col"
|
|
17
|
+
|
|
18
|
+
export type TTurnInto = "Blocks2Ps" | "Blocks2Hs"
|
|
19
|
+
|
|
14
20
|
export type TCardType = "doc" | "notebook" | "all"
|
|
15
21
|
|
|
16
22
|
export type TProtyleAction = "cb-get-append" | // 向下滚动加载
|
|
@@ -185,6 +191,11 @@ export interface IEventBusMap {
|
|
|
185
191
|
files: FileList | DataTransferItemList;
|
|
186
192
|
}
|
|
187
193
|
"ws-main": IWebSocketData;
|
|
194
|
+
"sync-start": IWebSocketData;
|
|
195
|
+
"sync-end": IWebSocketData;
|
|
196
|
+
"sync-fail": IWebSocketData;
|
|
197
|
+
"mobile-keyboard-show": void;
|
|
198
|
+
"mobile-keyboard-hide": void;
|
|
188
199
|
}
|
|
189
200
|
|
|
190
201
|
export interface IPosition {
|
|
@@ -418,7 +429,7 @@ export function openWindow(options: {
|
|
|
418
429
|
},
|
|
419
430
|
}): void;
|
|
420
431
|
|
|
421
|
-
export function openMobileFileById(app: App, id: string, action
|
|
432
|
+
export function openMobileFileById(app: App, id: string, action?: string[]): void;
|
|
422
433
|
|
|
423
434
|
export function openTab(options: {
|
|
424
435
|
app: App,
|
package/types/protyle.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
App,
|
|
3
|
+
ILuteNode,
|
|
4
|
+
IObject,
|
|
5
|
+
IOperation,
|
|
6
|
+
IPosition,
|
|
7
|
+
IProtyleOption, TTurnInto,
|
|
8
|
+
TTurnIntoOne,
|
|
9
|
+
TTurnIntoOneSub
|
|
10
|
+
} from "./../siyuan";
|
|
2
11
|
|
|
3
12
|
// REF: https://github.com/siyuan-note/siyuan/blob/dev/app/src/types/protyle.d.ts
|
|
4
13
|
export interface IProtyle {
|
|
@@ -74,6 +83,33 @@ export class Protyle {
|
|
|
74
83
|
insert(html: string, isBlock?: boolean, useProtyleRange?: boolean): void
|
|
75
84
|
|
|
76
85
|
transaction(doOperations: IOperation[], undoOperations?: IOperation[]): void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 多个块转换为一个块
|
|
89
|
+
* @param {TTurnIntoOneSub} [subType] type 为 "BlocksMergeSuperBlock" 时必传
|
|
90
|
+
*/
|
|
91
|
+
public turnIntoOneTransaction(selectsElement: Element[], type: TTurnIntoOne, subType?: TTurnIntoOneSub): void
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 多个块转换
|
|
95
|
+
* @param {Element} [nodeElement] 优先使用包含 protyle-wysiwyg--select 的块,否则使用 nodeElement 单块
|
|
96
|
+
* @param type
|
|
97
|
+
* @param {number} [subType] type 为 "Blocks2Hs" 时必传
|
|
98
|
+
*/
|
|
99
|
+
public turnIntoTransaction(nodeElement: Element, type: TTurnInto, subType?: number): void
|
|
100
|
+
|
|
101
|
+
public updateTransaction(id: string, newHTML: string, html: string): void
|
|
102
|
+
|
|
103
|
+
public updateBatchTransaction(nodeElements: Element[], cb: (e: HTMLElement) => void): void
|
|
104
|
+
|
|
105
|
+
public getRange(element: Element): Range
|
|
106
|
+
|
|
107
|
+
public hasClosestBlock(element: Node): false | HTMLElement
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @param {boolean} [toStart=true]
|
|
111
|
+
*/
|
|
112
|
+
public focusBlock(element: Element, toStart?: boolean): false | Range
|
|
77
113
|
}
|
|
78
114
|
|
|
79
115
|
export class Toolbar {
|