siyuan 1.1.1 → 1.1.2
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 +7 -1
- package/package.json +1 -1
- package/siyuan.d.ts +54 -15
- package/types/config.d.ts +69 -13
- package/types/index.d.ts +19 -0
- package/types/protyle.d.ts +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## v1.1.2 2025-
|
|
3
|
+
## v1.1.2 2025-07-22
|
|
4
|
+
|
|
5
|
+
* [Add plugin option `IProtyleOptions.click.preventInsetEmptyBlock`](https://github.com/siyuan-note/siyuan/issues/15303)
|
|
6
|
+
* [Add plugin function `saveLayout`](https://github.com/siyuan-note/siyuan/issues/15308)
|
|
7
|
+
* [Add config.query to `input-search` event bus](https://github.com/siyuan-note/siyuan/issues/15285)
|
|
8
|
+
* [Update plugin `addDock` callback parameter scope](https://github.com/siyuan-note/siyuan/issues/14752)
|
|
9
|
+
* [Add `cb-get-outline` to `TProtyleAction`](https://github.com/siyuan-note/siyuan/issues/14725)
|
|
4
10
|
|
|
5
11
|
## v1.1.1 2025-04-08
|
|
6
12
|
|
package/package.json
CHANGED
package/siyuan.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
App,
|
|
21
21
|
Files,
|
|
22
22
|
Tab, Model,
|
|
23
|
-
IMenuItem, IRefDefs,
|
|
23
|
+
IMenuItem, IRefDefs, MobileCustom,
|
|
24
24
|
} from "./types";
|
|
25
25
|
|
|
26
26
|
export * from "./types";
|
|
@@ -56,8 +56,11 @@ export type TOperation =
|
|
|
56
56
|
| "removeFlashcards"
|
|
57
57
|
| "updateAttrViewCell"
|
|
58
58
|
| "updateAttrViewCol"
|
|
59
|
+
| "updateAttrViewColTemplate"
|
|
59
60
|
| "sortAttrViewRow"
|
|
60
61
|
| "sortAttrViewCol"
|
|
62
|
+
| "sortAttrViewKey"
|
|
63
|
+
| "setAttrViewColPin"
|
|
61
64
|
| "setAttrViewColHidden"
|
|
62
65
|
| "setAttrViewColWrap"
|
|
63
66
|
| "setAttrViewColWidth"
|
|
@@ -65,10 +68,39 @@ export type TOperation =
|
|
|
65
68
|
| "removeAttrViewColOption"
|
|
66
69
|
| "updateAttrViewColOption"
|
|
67
70
|
| "setAttrViewName"
|
|
71
|
+
| "doUpdateUpdated"
|
|
72
|
+
| "duplicateAttrViewKey"
|
|
73
|
+
| "setAttrViewColIcon"
|
|
68
74
|
| "setAttrViewFilters"
|
|
69
75
|
| "setAttrViewSorts"
|
|
70
76
|
| "setAttrViewColCalc"
|
|
71
77
|
| "updateAttrViewColNumberFormat"
|
|
78
|
+
| "replaceAttrViewBlock"
|
|
79
|
+
| "addAttrViewView"
|
|
80
|
+
| "setAttrViewViewName"
|
|
81
|
+
| "removeAttrViewView"
|
|
82
|
+
| "setAttrViewViewIcon"
|
|
83
|
+
| "duplicateAttrViewView"
|
|
84
|
+
| "sortAttrViewView"
|
|
85
|
+
| "setAttrViewPageSize"
|
|
86
|
+
| "updateAttrViewColRelation"
|
|
87
|
+
| "moveOutlineHeading"
|
|
88
|
+
| "updateAttrViewColRollup"
|
|
89
|
+
| "hideAttrViewName"
|
|
90
|
+
| "setAttrViewCardSize"
|
|
91
|
+
| "setAttrViewCardAspectRatio"
|
|
92
|
+
| "setAttrViewCoverFrom"
|
|
93
|
+
| "setAttrViewCoverFromAssetKeyID"
|
|
94
|
+
| "setAttrViewFitImage"
|
|
95
|
+
| "setAttrViewShowIcon"
|
|
96
|
+
| "setAttrViewWrapField"
|
|
97
|
+
| "setAttrViewColDate"
|
|
98
|
+
| "unbindAttrViewBlock"
|
|
99
|
+
| "setAttrViewViewDesc"
|
|
100
|
+
| "setAttrViewColDesc"
|
|
101
|
+
| "setAttrViewBlockView"
|
|
102
|
+
| "setAttrViewGroup"
|
|
103
|
+
| "syncAttrViewTableColWidth"
|
|
72
104
|
|
|
73
105
|
export interface Global {
|
|
74
106
|
Lute: typeof Lute;
|
|
@@ -162,7 +194,7 @@ export interface IEventBusMap {
|
|
|
162
194
|
textPlain: string,
|
|
163
195
|
siyuanHTML: string,
|
|
164
196
|
files: FileList | DataTransferItemList | string[]; // 读取本地文件时为 string[]
|
|
165
|
-
}
|
|
197
|
+
};
|
|
166
198
|
"ws-main": IWebSocketData;
|
|
167
199
|
"sync-start": IWebSocketData;
|
|
168
200
|
"sync-end": IWebSocketData;
|
|
@@ -204,14 +236,14 @@ export interface ICommand {
|
|
|
204
236
|
}
|
|
205
237
|
|
|
206
238
|
export interface ICard {
|
|
207
|
-
deckID: string
|
|
208
|
-
cardID: string
|
|
209
|
-
blockID: string
|
|
210
|
-
nextDues: IObject
|
|
211
|
-
lapses: number // 遗忘次数
|
|
212
|
-
lastReview: number // 最后复习时间
|
|
213
|
-
reps: number // 复习次数
|
|
214
|
-
state: number // 卡片状态 0:新卡
|
|
239
|
+
deckID: string;
|
|
240
|
+
cardID: string;
|
|
241
|
+
blockID: string;
|
|
242
|
+
nextDues: IObject;
|
|
243
|
+
lapses: number; // 遗忘次数
|
|
244
|
+
lastReview: number; // 最后复习时间
|
|
245
|
+
reps: number; // 复习次数
|
|
246
|
+
state: number; // 卡片状态 0:新卡
|
|
215
247
|
}
|
|
216
248
|
|
|
217
249
|
export interface ICardData {
|
|
@@ -321,6 +353,12 @@ export function openAttributePanel(options: {
|
|
|
321
353
|
protyle?: IProtyle,
|
|
322
354
|
}): void;
|
|
323
355
|
|
|
356
|
+
/**
|
|
357
|
+
* 保存布局
|
|
358
|
+
* @param {function} [cb] - 保存后的回调函数
|
|
359
|
+
*/
|
|
360
|
+
export function saveLayout(cb: () => void): void;
|
|
361
|
+
|
|
324
362
|
/**
|
|
325
363
|
* 全局命令
|
|
326
364
|
* @param {string} command - 命令名称 https://github.com/siyuan-note/siyuan/blob/master/app/src/boot/globalEvent/command/global.ts#L71
|
|
@@ -411,17 +449,18 @@ export abstract class Plugin {
|
|
|
411
449
|
}): () => Custom;
|
|
412
450
|
|
|
413
451
|
/**
|
|
452
|
+
* Add Custom to Dock.
|
|
414
453
|
* Must be executed before the synchronous function.
|
|
415
454
|
*/
|
|
416
455
|
addDock(options: {
|
|
417
456
|
config: IPluginDockTab,
|
|
418
457
|
data: any,
|
|
419
458
|
type: string,
|
|
420
|
-
destroy?: (this:
|
|
421
|
-
resize?: (this:
|
|
422
|
-
update?: (this:
|
|
423
|
-
init: (this:
|
|
424
|
-
}): { config: IPluginDockTab, model:
|
|
459
|
+
destroy?: (this: Custom | MobileCustom) => void,
|
|
460
|
+
resize?: (this: Custom | MobileCustom) => void,
|
|
461
|
+
update?: (this: Custom | MobileCustom) => void,
|
|
462
|
+
init: (this: Custom | MobileCustom, dock: Custom | MobileCustom) => void,
|
|
463
|
+
}): { config: IPluginDockTab, model: Custom | MobileCustom };
|
|
425
464
|
|
|
426
465
|
addCommand(options: ICommand): void;
|
|
427
466
|
|
package/types/config.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ export namespace Config {
|
|
|
35
35
|
bazaar: IBazaar;
|
|
36
36
|
/**
|
|
37
37
|
* Cloud Service Provider Region
|
|
38
|
-
* - `0`: Chinese mainland
|
|
39
|
-
* - `1`: North America
|
|
38
|
+
* - `0`: Chinese mainland (LianDi)
|
|
39
|
+
* - `1`: North America (LiuYun)
|
|
40
40
|
*/
|
|
41
41
|
cloudRegion: number;
|
|
42
42
|
editor: IEditor;
|
|
@@ -273,16 +273,18 @@ export namespace Config {
|
|
|
273
273
|
*/
|
|
274
274
|
export type TLang =
|
|
275
275
|
"en_US"
|
|
276
|
+
| "ar_SA"
|
|
277
|
+
| "de_DE"
|
|
276
278
|
| "es_ES"
|
|
277
279
|
| "fr_FR"
|
|
278
|
-
| "zh_CHT"
|
|
279
|
-
| "zh_CN"
|
|
280
|
-
| "ja_JP"
|
|
281
|
-
| "it_IT"
|
|
282
|
-
| "de_DE"
|
|
283
280
|
| "he_IL"
|
|
281
|
+
| "it_IT"
|
|
282
|
+
| "ja_JP"
|
|
283
|
+
| "pl_PL"
|
|
284
|
+
| "pt_BR"
|
|
284
285
|
| "ru_RU"
|
|
285
|
-
| "
|
|
286
|
+
| "zh_CN"
|
|
287
|
+
| "zh_CHT";
|
|
286
288
|
|
|
287
289
|
/**
|
|
288
290
|
* SiYuan bazaar related configuration
|
|
@@ -330,6 +332,10 @@ export namespace Config {
|
|
|
330
332
|
* Whether to enable the inline strikethrough
|
|
331
333
|
*/
|
|
332
334
|
inlineStrikethrough: boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Whether to enable the inline mark
|
|
337
|
+
*/
|
|
338
|
+
inlineMark: boolean;
|
|
333
339
|
}
|
|
334
340
|
|
|
335
341
|
/**
|
|
@@ -537,6 +543,10 @@ export namespace Config {
|
|
|
537
543
|
* Whether to add YAML Front Matter when exporting to Markdown
|
|
538
544
|
*/
|
|
539
545
|
markdownYFM: boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Whether to export the inline memo
|
|
548
|
+
*/
|
|
549
|
+
inlineMemo: boolean;
|
|
540
550
|
/**
|
|
541
551
|
* Pandoc executable file path
|
|
542
552
|
*/
|
|
@@ -887,6 +897,7 @@ export namespace Config {
|
|
|
887
897
|
showInFolder: IKey;
|
|
888
898
|
spaceRepetition: IKey;
|
|
889
899
|
switchReadonly: IKey;
|
|
900
|
+
switchAdjust: IKey;
|
|
890
901
|
undo: IKey;
|
|
891
902
|
vLayout: IKey;
|
|
892
903
|
wysiwyg: IKey;
|
|
@@ -1124,10 +1135,18 @@ export namespace Config {
|
|
|
1124
1135
|
*/
|
|
1125
1136
|
key: string;
|
|
1126
1137
|
/**
|
|
1127
|
-
*
|
|
1138
|
+
* Sync index timing, if it exceeds this time, the user is prompted that the index
|
|
1128
1139
|
* performance is degraded (unit: milliseconds)
|
|
1129
1140
|
*/
|
|
1130
1141
|
syncIndexTiming: number;
|
|
1142
|
+
/**
|
|
1143
|
+
* Automatic purge for local data repo index retention days
|
|
1144
|
+
*/
|
|
1145
|
+
indexRetentionDays: number;
|
|
1146
|
+
/**
|
|
1147
|
+
* Automatic purge for local data repo indexes retention daily
|
|
1148
|
+
*/
|
|
1149
|
+
retentionIndexesDaily: number;
|
|
1131
1150
|
}
|
|
1132
1151
|
|
|
1133
1152
|
/**
|
|
@@ -1344,6 +1363,10 @@ export namespace Config {
|
|
|
1344
1363
|
* - `3`: Completely manual synchronization
|
|
1345
1364
|
*/
|
|
1346
1365
|
mode: number;
|
|
1366
|
+
/**
|
|
1367
|
+
* Synchronization interval (unit: seconds)
|
|
1368
|
+
*/
|
|
1369
|
+
interval: number;
|
|
1347
1370
|
/**
|
|
1348
1371
|
* Whether to enable synchronization perception
|
|
1349
1372
|
*/
|
|
@@ -1353,6 +1376,7 @@ export namespace Config {
|
|
|
1353
1376
|
* - `0`: SiYuan official cloud storage service
|
|
1354
1377
|
* - `2`: Object storage service compatible with S3 protocol
|
|
1355
1378
|
* - `3`: Network storage service using WebDAV protocol
|
|
1379
|
+
* - `4`: Local file system
|
|
1356
1380
|
*/
|
|
1357
1381
|
provider: number;
|
|
1358
1382
|
s3: ISyncS3;
|
|
@@ -1365,6 +1389,7 @@ export namespace Config {
|
|
|
1365
1389
|
*/
|
|
1366
1390
|
synced: number;
|
|
1367
1391
|
webdav: ISyncWebDAV;
|
|
1392
|
+
local: ISyncLocal;
|
|
1368
1393
|
}
|
|
1369
1394
|
|
|
1370
1395
|
/**
|
|
@@ -1439,6 +1464,28 @@ export namespace Config {
|
|
|
1439
1464
|
username: string;
|
|
1440
1465
|
}
|
|
1441
1466
|
|
|
1467
|
+
/**
|
|
1468
|
+
* Local file system related configuration
|
|
1469
|
+
*/
|
|
1470
|
+
export interface ISyncLocal {
|
|
1471
|
+
/**
|
|
1472
|
+
* The full path of local directory
|
|
1473
|
+
*
|
|
1474
|
+
* Examples:
|
|
1475
|
+
* - Windows: `"D:/path/to/repos/directory"`
|
|
1476
|
+
* - Unix: `"/path/to/repos/directory"`
|
|
1477
|
+
*/
|
|
1478
|
+
endpoint: string;
|
|
1479
|
+
/**
|
|
1480
|
+
* Timeout (unit: seconds)
|
|
1481
|
+
*/
|
|
1482
|
+
timeout: number;
|
|
1483
|
+
/**
|
|
1484
|
+
* Concurrent requests.
|
|
1485
|
+
*/
|
|
1486
|
+
concurrentReqs: number;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1442
1489
|
/**
|
|
1443
1490
|
* System related information
|
|
1444
1491
|
*/
|
|
@@ -1463,6 +1510,7 @@ export namespace Config {
|
|
|
1463
1510
|
* - `docker`: Docker container
|
|
1464
1511
|
* - `android`: Android device
|
|
1465
1512
|
* - `ios`: iOS device
|
|
1513
|
+
* - `harmony`: HarmonyOS device
|
|
1466
1514
|
* - `std`: Desktop Electron environment
|
|
1467
1515
|
*/
|
|
1468
1516
|
container: TSystemContainer;
|
|
@@ -1470,10 +1518,6 @@ export namespace Config {
|
|
|
1470
1518
|
* The absolute path of the `data` directory of the current workspace
|
|
1471
1519
|
*/
|
|
1472
1520
|
dataDir: string;
|
|
1473
|
-
/**
|
|
1474
|
-
* Whether to disable Google Analytics
|
|
1475
|
-
*/
|
|
1476
|
-
disableGoogleAnalytics: boolean;
|
|
1477
1521
|
/**
|
|
1478
1522
|
* Whether to automatically download the installation package for the new version
|
|
1479
1523
|
*/
|
|
@@ -1531,6 +1575,10 @@ export namespace Config {
|
|
|
1531
1575
|
* The absolute path of the workspace directory
|
|
1532
1576
|
*/
|
|
1533
1577
|
workspaceDir: string;
|
|
1578
|
+
/**
|
|
1579
|
+
* Disabled features.
|
|
1580
|
+
*/
|
|
1581
|
+
disabledFeatures: string[];
|
|
1534
1582
|
}
|
|
1535
1583
|
|
|
1536
1584
|
/**
|
|
@@ -2013,6 +2061,10 @@ export namespace Config {
|
|
|
2013
2061
|
* SiYuan search tab configuration
|
|
2014
2062
|
*/
|
|
2015
2063
|
export interface IUILayoutTabSearchConfig {
|
|
2064
|
+
/**
|
|
2065
|
+
* 搜索传入的查询内容
|
|
2066
|
+
*/
|
|
2067
|
+
query?: string;
|
|
2016
2068
|
/**
|
|
2017
2069
|
* Grouping strategy
|
|
2018
2070
|
* - `0`: No grouping
|
|
@@ -2149,6 +2201,10 @@ export namespace Config {
|
|
|
2149
2201
|
* @default false
|
|
2150
2202
|
*/
|
|
2151
2203
|
blockRef?: boolean;
|
|
2204
|
+
/**
|
|
2205
|
+
* Replace file annotation refs
|
|
2206
|
+
*/
|
|
2207
|
+
fileAnnotationRef?: boolean;
|
|
2152
2208
|
/**
|
|
2153
2209
|
* Replace kdb elements
|
|
2154
2210
|
* @default true
|
package/types/index.d.ts
CHANGED
|
@@ -390,6 +390,25 @@ export declare class Dock {
|
|
|
390
390
|
genButton(data: Config.IUILayoutDockTab[], index: number, tabIndex?: number): void;
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
+
export declare class MobileCustom {
|
|
394
|
+
public element: Element;
|
|
395
|
+
public data: any;
|
|
396
|
+
public type: string;
|
|
397
|
+
public init: (custom: MobileCustom) => void;
|
|
398
|
+
public destroy: () => void;
|
|
399
|
+
public update: () => void;
|
|
400
|
+
|
|
401
|
+
constructor(options: {
|
|
402
|
+
element: Element,
|
|
403
|
+
type: string,
|
|
404
|
+
data: any,
|
|
405
|
+
destroy?: () => void,
|
|
406
|
+
update?: () => void,
|
|
407
|
+
init: (custom: MobileCustom) => void
|
|
408
|
+
})
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
|
|
393
412
|
export declare class Custom extends Model {
|
|
394
413
|
element: Element;
|
|
395
414
|
tab: Tab;
|
package/types/protyle.d.ts
CHANGED
|
@@ -19,7 +19,8 @@ export type TProtyleAction = "cb-get-append" | // 向下滚动加载
|
|
|
19
19
|
"cb-get-hl" | // 高亮
|
|
20
20
|
"cb-get-focus" | // 光标定位
|
|
21
21
|
"cb-get-focusfirst" | // 动态定位到第一个块
|
|
22
|
-
"cb-get-setid" | // 重置 blockid
|
|
22
|
+
"cb-get-setid" | // 无折叠大纲点击 重置 blockid
|
|
23
|
+
"cb-get-outline" | // 大纲点击
|
|
23
24
|
"cb-get-all" | // 获取所有块
|
|
24
25
|
"cb-get-backlink" | // 悬浮窗为传递型需展示上下文
|
|
25
26
|
"cb-get-unundo" | // 不需要记录历史
|
|
@@ -77,8 +78,8 @@ interface IHintData {
|
|
|
77
78
|
id?: string;
|
|
78
79
|
html: string;
|
|
79
80
|
value: string;
|
|
80
|
-
filter?: string[]
|
|
81
|
-
focus?: boolean
|
|
81
|
+
filter?: string[];
|
|
82
|
+
focus?: boolean;
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
export interface IProtyleOptions {
|
|
@@ -120,6 +121,10 @@ export interface IProtyleOptions {
|
|
|
120
121
|
classes?: {
|
|
121
122
|
preview?: string;
|
|
122
123
|
};
|
|
124
|
+
click?: {
|
|
125
|
+
/** 点击末尾是否阻止插入新块 */
|
|
126
|
+
preventInsetEmptyBlock?: boolean
|
|
127
|
+
}
|
|
123
128
|
|
|
124
129
|
/** 编辑器异步渲染完成后的回调方法 */
|
|
125
130
|
after?(protyle: Protyle): void;
|