siyuan 1.1.1 → 1.1.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,21 @@
1
1
  # Changelog
2
2
 
3
- ## v1.1.2 2025-05
3
+ ## v1.1.3 2025-08-26
4
+
5
+ * [Add plugin function `getActiveEditor`](https://github.com/siyuan-note/siyuan/issues/15641)
6
+ * [Add plugin function `getActiveTab`](https://github.com/siyuan-note/siyuan/issues/15415)
7
+ * [Add plugin event bus `switch-protyle-mode`](https://github.com/siyuan-note/siyuan/issues/15516)
8
+ * [Add plugin function `hideMessage`](https://github.com/siyuan-note/siyuan/issues/15485)
9
+ * [Update Constants](https://github.com/siyuan-note/petal/pull/39)
10
+ * [Add plugin function `IProtyleOptions.handleEmptyContent`](https://github.com/siyuan-note/siyuan/issues/15398)
11
+
12
+ ## v1.1.2 2025-07-22
13
+
14
+ * [Add plugin option `IProtyleOptions.click.preventInsetEmptyBlock`](https://github.com/siyuan-note/siyuan/issues/15303)
15
+ * [Add plugin function `saveLayout`](https://github.com/siyuan-note/siyuan/issues/15308)
16
+ * [Add config.query to `input-search` event bus](https://github.com/siyuan-note/siyuan/issues/15285)
17
+ * [Update plugin `addDock` callback parameter scope](https://github.com/siyuan-note/siyuan/issues/14752)
18
+ * [Add `cb-get-outline` to `TProtyleAction`](https://github.com/siyuan-note/siyuan/issues/14725)
4
19
 
5
20
  ## v1.1.1 2025-04-08
6
21
 
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "README.md",
13
13
  "siyuan.d.ts"
14
14
  ],
15
- "version": "1.1.1",
15
+ "version": "1.1.3",
16
16
  "repository": {
17
17
  "type": "git",
18
18
  "url": "git+https://github.com/siyuan-note/petal.git"
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;
@@ -117,6 +149,9 @@ export interface IEventBusMap {
117
149
  "switch-protyle": {
118
150
  protyle: IProtyle,
119
151
  };
152
+ "switch-protyle-mode": {
153
+ protyle: IProtyle,
154
+ };
120
155
  "open-menu-av": IMenuBaseDetail & { selectRowElements: HTMLElement[] };
121
156
  "open-menu-blockref": IMenuBaseDetail;
122
157
  "open-menu-breadcrumbmore": {
@@ -162,7 +197,7 @@ export interface IEventBusMap {
162
197
  textPlain: string,
163
198
  siyuanHTML: string,
164
199
  files: FileList | DataTransferItemList | string[]; // 读取本地文件时为 string[]
165
- }
200
+ };
166
201
  "ws-main": IWebSocketData;
167
202
  "sync-start": IWebSocketData;
168
203
  "sync-end": IWebSocketData;
@@ -204,14 +239,14 @@ export interface ICommand {
204
239
  }
205
240
 
206
241
  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:新卡
242
+ deckID: string;
243
+ cardID: string;
244
+ blockID: string;
245
+ nextDues: IObject;
246
+ lapses: number; // 遗忘次数
247
+ lastReview: number; // 最后复习时间
248
+ reps: number; // 复习次数
249
+ state: number; // 卡片状态 0:新卡
215
250
  }
216
251
 
217
252
  export interface ICardData {
@@ -244,6 +279,17 @@ export function openWindow(options: {
244
279
  },
245
280
  }): void;
246
281
 
282
+ /**
283
+ * 不支持移动端
284
+ * @param {boolean} [wndActive=true] - 当前活动窗口是否为激活状态
285
+ */
286
+ export function getActiveTab(wndActive?: boolean): Tab;
287
+
288
+ /**
289
+ * @param {boolean} [wndActive=true] - 当前活动窗口是否为激活状态
290
+ */
291
+ export function getActiveEditor(wndActive?: boolean): Protyle;
292
+
247
293
  export function openMobileFileById(app: App, id: string, action?: TProtyleAction[]): void;
248
294
 
249
295
  export function openTab(options: {
@@ -321,6 +367,12 @@ export function openAttributePanel(options: {
321
367
  protyle?: IProtyle,
322
368
  }): void;
323
369
 
370
+ /**
371
+ * 保存布局
372
+ * @param {function} [cb] - 保存后的回调函数
373
+ */
374
+ export function saveLayout(cb: () => void): void;
375
+
324
376
  /**
325
377
  * 全局命令
326
378
  * @param {string} command - 命令名称 https://github.com/siyuan-note/siyuan/blob/master/app/src/boot/globalEvent/command/global.ts#L71
@@ -334,6 +386,8 @@ export function globalCommand(command: string, app: App): void;
334
386
  */
335
387
  export function showMessage(text: string, timeout?: number, type?: "info" | "error", id?: string): void;
336
388
 
389
+ export function hideMessage(id?: string): void;
390
+
337
391
  export abstract class Plugin {
338
392
  eventBus: EventBus;
339
393
  i18n: IObject;
@@ -411,17 +465,18 @@ export abstract class Plugin {
411
465
  }): () => Custom;
412
466
 
413
467
  /**
468
+ * Add Custom to Dock.
414
469
  * Must be executed before the synchronous function.
415
470
  */
416
471
  addDock(options: {
417
472
  config: IPluginDockTab,
418
473
  data: any,
419
474
  type: string,
420
- destroy?: (this: Dock) => void,
421
- resize?: (this: Dock) => void,
422
- update?: (this: Dock) => void,
423
- init: (this: Dock, dock: Dock) => void,
424
- }): { config: IPluginDockTab, model: Dock };
475
+ destroy?: (this: Custom | MobileCustom) => void,
476
+ resize?: (this: Custom | MobileCustom) => void,
477
+ update?: (this: Custom | MobileCustom) => void,
478
+ init: (this: Custom | MobileCustom, dock: Custom | MobileCustom) => void,
479
+ }): { config: IPluginDockTab, model: Custom | MobileCustom };
425
480
 
426
481
  addCommand(options: ICommand): void;
427
482
 
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
- | "pl_PL";
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
- * Synchronous index timing, if it exceeds this time, the user is prompted that the index
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
@@ -35,7 +35,6 @@ export abstract class Constants {
35
35
  public static readonly SIYUAN_OPEN_WORKSPACE: string = "siyuan-open-workspace";
36
36
  public static readonly SIYUAN_OPEN_URL: string = "siyuan-open-url";
37
37
  public static readonly SIYUAN_OPEN_WINDOW: string = "siyuan-open-window";
38
- public static readonly SIYUAN_OPEN_FOLDER: string = "siyuan-open-folder";
39
38
  public static readonly SIYUAN_OPEN_FILE: string = "siyuan-open-file";
40
39
 
41
40
  public static readonly SIYUAN_EXPORT_PDF: string = "siyuan-export-pdf";
@@ -43,6 +42,8 @@ export abstract class Constants {
43
42
 
44
43
  public static readonly SIYUAN_CONTEXT_MENU: string = "siyuan-context-menu";
45
44
 
45
+ public static readonly SIYUAN_SHOW_WINDOW: string = "siyuan-show-window";
46
+
46
47
  // custom
47
48
  public static readonly CUSTOM_SY_READONLY: string = "custom-sy-readonly";
48
49
  public static readonly CUSTOM_SY_FULLWIDTH: string = "custom-sy-fullwidth";
@@ -55,12 +56,49 @@ export abstract class Constants {
55
56
  public static readonly SIZE_SCROLL_TB: number = 24;
56
57
  public static readonly SIZE_SCROLL_STEP: number = 256;
57
58
  public static readonly SIZE_LINK_TEXT_MAX: number = 64;
58
- public static readonly SIZE_TOOLBAR_HEIGHT: number = 32;
59
59
  public static readonly SIZE_GET_MAX = 102400;
60
60
  public static readonly SIZE_UNDO = 64;
61
61
  public static readonly SIZE_TITLE = 512;
62
62
  public static readonly SIZE_EDITOR_WIDTH = 760;
63
- public static readonly SIZE_ZOOM = [0.25, 0.33, 0.5, 0.67, 0.75, 0.8, 0.9, 1, 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3];
63
+ public static readonly SIZE_ZOOM = [
64
+ {
65
+ zoom: 0.67,
66
+ position: {x: 0, y: 2}
67
+ },
68
+ {
69
+ zoom: 0.75,
70
+ position: {x: 1, y: 4}
71
+ }, {
72
+ zoom: 0.8,
73
+ position: {x: 2, y: 4}
74
+ }, {
75
+ zoom: 0.9,
76
+ position: {x: 5, y: 6}
77
+ }, {
78
+ zoom: 1,
79
+ position: {x: 8, y: 8}
80
+ }, {
81
+ zoom: 1.1,
82
+ position: {x: 12, y: 9}
83
+ }, {
84
+ zoom: 1.25,
85
+ position: {x: 18, y: 12}
86
+ }, {
87
+ zoom: 1.5,
88
+ position: {x: 27, y: 16}
89
+ }, {
90
+ zoom: 1.75,
91
+ position: {x: 36, y: 20}
92
+ }, {
93
+ zoom: 2,
94
+ position: {x: 45, y: 23}
95
+ }, {
96
+ zoom: 2.5,
97
+ position: {x: 63, y: 31}
98
+ }, {
99
+ zoom: 3,
100
+ position: {x: 80, y: 39}
101
+ }];
64
102
 
65
103
  // ws callback
66
104
  public static readonly CB_MOVE_NOLIST = "cb-move-nolist";
@@ -71,7 +109,8 @@ export abstract class Constants {
71
109
  public static readonly CB_GET_HL = "cb-get-hl"; // 高亮
72
110
  public static readonly CB_GET_FOCUS = "cb-get-focus"; // 光标定位
73
111
  public static readonly CB_GET_FOCUSFIRST = "cb-get-focusfirst"; // 动态定位到第一个块
74
- public static readonly CB_GET_SETID = "cb-get-setid"; // 重置 blockid
112
+ public static readonly CB_GET_SETID = "cb-get-setid"; // 无折叠大纲点击 重置 blockid
113
+ public static readonly CB_GET_OUTLINE = "cb-get-outline"; // 大纲点击
75
114
  public static readonly CB_GET_ALL = "cb-get-all"; // 获取所有块
76
115
  public static readonly CB_GET_BACKLINK = "cb-get-backlink"; // 悬浮窗为传递型需展示上下文
77
116
  public static readonly CB_GET_UNUNDO = "cb-get-unundo"; // 不需要记录历史
@@ -108,8 +147,12 @@ export abstract class Constants {
108
147
  public static readonly LOCAL_SESSION_FIRSTLOAD = "local-session-firstload";
109
148
  public static readonly LOCAL_OUTLINE = "local-outline";
110
149
  public static readonly LOCAL_PLUGIN_DOCKS = "local-plugin-docks";
150
+ public static readonly LOCAL_IMAGES = "local-images";
151
+ public static readonly LOCAL_EMOJIS = "local-emojis";
152
+ public static readonly LOCAL_MOVE_PATH = "local-move-path";
111
153
 
112
154
  // dialog
155
+ public static readonly DIALOG_CONFIRM = "dialog-confirm";
113
156
  public static readonly DIALOG_OPENCARD = "dialog-opencard";
114
157
  public static readonly DIALOG_MAKECARD = "dialog-makecard";
115
158
  public static readonly DIALOG_VIEWCARDS = "dialog-viewcards";
@@ -167,6 +210,7 @@ export abstract class Constants {
167
210
  public static readonly DIALOG_SAVEWORKSPACE = "dialog-saveworkspace"; // 保存工作空间
168
211
 
169
212
  // timeout
213
+ public static readonly TIMEOUT_OPENDIALOG = 50;
170
214
  public static readonly TIMEOUT_DBLCLICK = 190;
171
215
  public static readonly TIMEOUT_INPUT = 256;
172
216
  public static readonly TIMEOUT_LOAD = 300;
@@ -174,18 +218,20 @@ export abstract class Constants {
174
218
  public static readonly TIMEOUT_COUNT = 1000;
175
219
 
176
220
  // id
177
- public static readonly HELP_PATH = {
178
- zh_CN: "20210808180117-czj9bvb",
179
- zh_CHT: "20211226090932-5lcq56f",
221
+ public static readonly HELP_PATH: { [key: string]: string } = {
222
+ ar_SA: "20210808180117-6v0mkxr",
223
+ de_DE: "20210808180117-6v0mkxr",
180
224
  en_US: "20210808180117-6v0mkxr",
181
- fr_FR: "20210808180117-6v0mkxr",
182
225
  es_ES: "20210808180117-6v0mkxr",
183
- ja_JP: "20240530133126-axarxgx",
184
- it_IT: "20210808180117-6v0mkxr",
185
- de_DE: "20210808180117-6v0mkxr",
226
+ fr_FR: "20210808180117-6v0mkxr",
186
227
  he_IL: "20210808180117-6v0mkxr",
187
- ru_RU: "20210808180117-6v0mkxr",
228
+ it_IT: "20210808180117-6v0mkxr",
229
+ ja_JP: "20240530133126-axarxgx",
188
230
  pl_PL: "20210808180117-6v0mkxr",
231
+ pt_BR: "20210808180117-6v0mkxr",
232
+ ru_RU: "20210808180117-6v0mkxr",
233
+ zh_CHT: "20211226090932-5lcq56f",
234
+ zh_CN: "20210808180117-czj9bvb",
189
235
  };
190
236
  public static readonly QUICK_DECK_ID = "20230218211946-2kw8jgx";
191
237
 
@@ -435,6 +481,11 @@ export abstract class Constants {
435
481
  exitFocus: {default: "", custom: ""},
436
482
  ai: {default: "", custom: ""},
437
483
  switchReadonly: {default: "", custom: ""},
484
+ switchAdjust: {default: "", custom: ""},
485
+ rtl: {default: "", custom: ""},
486
+ ltr: {default: "", custom: ""},
487
+ aiWriting: {default: "", custom: ""},
488
+ openInNewTab: {default: "", custom: ""},
438
489
  },
439
490
  insert: {
440
491
  appearance: {default: "⌥⌘X", custom: "⌥⌘X"},
@@ -630,16 +681,17 @@ export abstract class Constants {
630
681
  "text": true,
631
682
  "imgText": true,
632
683
  "imgTitle": true,
633
- "imgSrc": false,
684
+ "imgSrc": true,
634
685
  "aText": true,
635
686
  "aTitle": true,
636
- "aHref": false,
637
- "code": false,
687
+ "aHref": true,
688
+ "code": true,
638
689
  "em": true,
639
690
  "strong": true,
640
- "inlineMath": false,
691
+ "inlineMath": true,
641
692
  "inlineMemo": true,
642
- "blockRef": false,
693
+ "blockRef": true,
694
+ "fileAnnotationRef": true,
643
695
  "kbd": true,
644
696
  "mark": true,
645
697
  "s": true,
@@ -648,9 +700,9 @@ export abstract class Constants {
648
700
  "tag": true,
649
701
  "u": true,
650
702
  "docTitle": true,
651
- "codeBlock": false,
652
- "mathBlock": false,
653
- "htmlBlock": false
703
+ "codeBlock": true,
704
+ "mathBlock": true,
705
+ "htmlBlock": true
654
706
  };
655
707
 
656
708
  // image
@@ -661,51 +713,63 @@ export abstract class Constants {
661
713
  <path fill="#ffdd4e" d="M15.396 8.403l11.659 15.921c0.401 0.579 0.432 1.317 0.081 1.924-0.361 0.594-1.005 0.985-1.741 0.985-0.008 0-0.017-0-0.025-0h-9.344l-0.63-18.83z"></path>
662
714
  <path fill="#ffd00f" d="M13.868 6.478c0 0.946 0.767 1.712 1.712 1.712s1.712-0.767 1.712-1.712v0c0-0.945-0.766-1.712-1.712-1.712s-1.712 0.766-1.712 1.712v0zM28.577 10.818c0 0.945 0.766 1.712 1.712 1.712s1.712-0.766 1.712-1.712v0c0-0.945-0.766-1.712-1.712-1.712s-1.712 0.766-1.712 1.712v0zM0 10.822c0 0.945 0.766 1.712 1.712 1.712s1.712-0.766 1.712-1.712v0c0-0.945-0.766-1.712-1.712-1.712s-1.712 0.766-1.712 1.712v0z"></path>
663
715
  </svg>`;
664
- public static readonly SIYUAN_IMAGE_FILE: string = "1f4c4";
665
- public static readonly SIYUAN_IMAGE_NOTE: string = "1f5c3";
666
- public static readonly SIYUAN_IMAGE_FOLDER: string = "1f4d1";
667
716
 
668
717
  // assets
669
718
  public static readonly SIYUAN_ASSETS_IMAGE: string[] = [".apng", ".ico", ".cur", ".jpg", ".jpe", ".jpeg", ".jfif", ".pjp", ".pjpeg", ".png", ".gif", ".webp", ".bmp", ".svg", ".avif"];
670
- public static readonly SIYUAN_ASSETS_AUDIO: string[] = [".mp3", ".wav", ".ogg", ".m4a", ".aac"];
719
+ public static readonly SIYUAN_ASSETS_AUDIO: string[] = [".mp3", ".wav", ".ogg", ".m4a", ".aac", ".flac"];
671
720
  public static readonly SIYUAN_ASSETS_VIDEO: string[] = [".mov", ".weba", ".mkv", ".mp4", ".webm"];
672
721
  public static readonly SIYUAN_ASSETS_EXTS: string[] = [".pdf"].concat(Constants.SIYUAN_ASSETS_IMAGE).concat(Constants.SIYUAN_ASSETS_AUDIO).concat(Constants.SIYUAN_ASSETS_VIDEO);
673
722
  public static readonly SIYUAN_ASSETS_SEARCH: string[] = [".txt", ".md", ".markdown", ".docx", ".xlsx", ".pptx", ".pdf", ".json", ".log", ".sql", ".html", ".xml", ".java", ".h", ".c",
674
723
  ".cpp", ".go", ".rs", ".swift", ".kt", ".py", ".php", ".js", ".css", ".ts", ".sh", ".bat", ".cmd", ".ini", ".yaml",
675
- ".rst", ".adoc", ".textile", ".opml", ".org", ".wiki", ".epub"];
724
+ ".rst", ".adoc", ".textile", ".opml", ".org", ".wiki", ".epub", ".cs"];
676
725
 
677
726
  // protyle
678
727
  public static readonly SIYUAN_CONFIG_APPEARANCE_DARK_CODE: string[] = ["a11y-dark", "agate", "an-old-hope", "androidstudio",
679
- "arta", "atom-one-dark", "atom-one-dark-reasonable", "base16/3024", "base16/apathy", "base16/apprentice", "base16/ashes", "base16/atelier-cave", "base16/atelier-dune",
680
- "base16/atelier-estuary", "base16/atelier-forest", "base16/atelier-heath", "base16/atelier-lakeside", "base16/atelier-plateau", "base16/atelier-savanna", "base16/atelier-seaside", "base16/atelier-sulphurpool",
681
- "base16/atlas", "base16/bespin", "base16/black-metal", "base16/black-metal-bathory", "base16/black-metal-burzum", "base16/black-metal-dark-funeral", "base16/black-metal-gorgoroth", "base16/black-metal-immortal", "base16/black-metal-khold", "base16/black-metal-marduk", "base16/black-metal-mayhem", "base16/black-metal-nile", "base16/black-metal-venom", "base16/brewer", "base16/bright", "base16/brogrammer",
682
- "base16/brush-trees-dark", "base16/chalk", "base16/circus", "base16/classic-dark", "base16/codeschool", "base16/colors", "base16/danqing", "base16/darcula", "base16/dark-violet",
683
- "base16/darkmoss", "base16/darktooth", "base16/decaf", "base16/default-dark", "base16/dracula", "base16/edge-dark", "base16/eighties", "base16/embers", "base16/equilibrium-dark",
684
- "base16/equilibrium-gray-dark", "base16/espresso", "base16/eva", "base16/eva-dim", "base16/flat", "base16/framer", "base16/gigavolt", "base16/google-dark", "base16/grayscale-dark", "base16/green-screen", "base16/gruvbox-dark-hard", "base16/gruvbox-dark-medium",
685
- "base16/gruvbox-dark-pale", "base16/gruvbox-dark-soft", "base16/hardcore", "base16/harmonic16-dark", "base16/heetch-dark", "base16/helios", "base16/hopscotch", "base16/horizon-dark", "base16/humanoid-dark", "base16/ia-dark", "base16/icy-dark", "base16/ir-black", "base16/isotope",
686
- "base16/kimber", "base16/london-tube", "base16/macintosh", "base16/marrakesh", "base16/materia", "base16/material", "base16/material-darker", "base16/material-palenight", "base16/material-vivid",
687
- "base16/mellow-purple", "base16/mocha", "base16/monokai", "base16/nebula", "base16/nord", "base16/nova", "base16/ocean", "base16/oceanicnext", "base16/onedark", "base16/outrun-dark",
688
- "base16/papercolor-dark", "base16/paraiso", "base16/pasque", "base16/phd", "base16/pico", "base16/pop", "base16/porple", "base16/qualia", "base16/railscasts", "base16/rebecca",
689
- "base16/ros-pine", "base16/ros-pine-moon", "base16/sandcastle", "base16/seti-ui", "base16/silk-dark", "base16/snazzy", "base16/solar-flare", "base16/solarized-dark", "base16/spacemacs", "base16/summercamp", "base16/summerfruit-dark",
690
- "base16/synth-midnight-terminal-dark", "base16/tango", "base16/tender", "base16/tomorrow-night", "base16/twilight", "base16/unikitty-dark", "base16/vulcan",
691
- "base16/windows-10", "base16/windows-95", "base16/windows-high-contrast", "base16/windows-nt", "base16/woodland", "base16/xcode-dusk", "base16/zenburn", "codepen-embed", "dark",
692
- "devibeans", "far", "felipec", "github-dark", "github-dark-dimmed", "gml", "gradient-dark", "hybrid", "ir-black", "isbl-editor-dark", "kimbie-dark", "lioshi",
693
- "monokai", "monokai-sublime", "night-owl", "nnfx-dark", "nord", "obsidian", "panda-syntax-dark", "paraiso-dark", "pojoaque", "qtcreator-dark", "rainbow", "shades-of-purple", "srcery", "stackoverflow-dark",
694
- "sunburst", "tomorrow-night-blue", "tomorrow-night-bright", "tokyo-night-dark", "vs2015", "xt256"
728
+ "arta", "atom-one-dark", "atom-one-dark-reasonable", "base16/3024", "base16/apathy", "base16/apprentice", "base16/ashes",
729
+ "base16/atelier-cave", "base16/atelier-dune", "base16/atelier-estuary", "base16/atelier-forest", "base16/atelier-heath",
730
+ "base16/atelier-lakeside", "base16/atelier-plateau", "base16/atelier-savanna", "base16/atelier-seaside", "base16/atelier-sulphurpool",
731
+ "base16/atlas", "base16/bespin", "base16/black-metal", "base16/black-metal-bathory", "base16/black-metal-burzum",
732
+ "base16/black-metal-dark-funeral", "base16/black-metal-gorgoroth", "base16/black-metal-immortal", "base16/black-metal-khold",
733
+ "base16/black-metal-marduk", "base16/black-metal-mayhem", "base16/black-metal-nile", "base16/black-metal-venom",
734
+ "base16/brewer", "base16/bright", "base16/brogrammer", "base16/brush-trees-dark", "base16/chalk", "base16/circus",
735
+ "base16/classic-dark", "base16/codeschool", "base16/colors", "base16/danqing", "base16/darcula", "base16/dark-violet",
736
+ "base16/darkmoss", "base16/darktooth", "base16/decaf", "base16/default-dark", "base16/dracula", "base16/edge-dark",
737
+ "base16/eighties", "base16/embers", "base16/equilibrium-dark", "base16/equilibrium-gray-dark", "base16/espresso",
738
+ "base16/eva", "base16/eva-dim", "base16/flat", "base16/framer", "base16/gigavolt", "base16/google-dark", "base16/grayscale-dark",
739
+ "base16/green-screen", "base16/gruvbox-dark-hard", "base16/gruvbox-dark-medium", "base16/gruvbox-dark-pale", "base16/gruvbox-dark-soft",
740
+ "base16/hardcore", "base16/harmonic16-dark", "base16/heetch-dark", "base16/helios", "base16/hopscotch", "base16/horizon-dark",
741
+ "base16/humanoid-dark", "base16/ia-dark", "base16/icy-dark", "base16/ir-black", "base16/isotope", "base16/kimber",
742
+ "base16/london-tube", "base16/macintosh", "base16/marrakesh", "base16/materia", "base16/material", "base16/material-darker",
743
+ "base16/material-palenight", "base16/material-vivid", "base16/mellow-purple", "base16/mocha", "base16/monokai",
744
+ "base16/nebula", "base16/nord", "base16/nova", "base16/ocean", "base16/oceanicnext", "base16/onedark", "base16/outrun-dark",
745
+ "base16/papercolor-dark", "base16/paraiso", "base16/pasque", "base16/phd", "base16/pico", "base16/pop", "base16/porple",
746
+ "base16/qualia", "base16/railscasts", "base16/rebecca", "base16/ros-pine", "base16/ros-pine-moon", "base16/sandcastle",
747
+ "base16/seti-ui", "base16/silk-dark", "base16/snazzy", "base16/solar-flare", "base16/solarized-dark", "base16/spacemacs",
748
+ "base16/summercamp", "base16/summerfruit-dark", "base16/synth-midnight-terminal-dark", "base16/tango", "base16/tender",
749
+ "base16/tomorrow-night", "base16/twilight", "base16/unikitty-dark", "base16/vulcan", "base16/windows-10", "base16/windows-95",
750
+ "base16/windows-high-contrast", "base16/windows-nt", "base16/woodland", "base16/xcode-dusk", "base16/zenburn", "codepen-embed",
751
+ "cybertopia-cherry", "cybertopia-dimmer", "cybertopia-icecap", "cybertopia-saturated", "dark", "devibeans", "far",
752
+ "felipec", "github-dark", "github-dark-dimmed", "gml", "gradient-dark", "hybrid", "ir-black", "isbl-editor-dark",
753
+ "kimbie-dark", "lioshi", "monokai", "monokai-sublime", "night-owl", "nnfx-dark", "nord", "obsidian", "panda-syntax-dark",
754
+ "paraiso-dark", "pojoaque", "qtcreator-dark", "rainbow", "rose-pine", "rose-pine-moon", "shades-of-purple", "srcery",
755
+ "stackoverflow-dark", "sunburst", "tomorrow-night-blue", "tomorrow-night-bright", "tokyo-night-dark", "vs2015", "xt256"
695
756
  ];
696
757
  public static readonly SIYUAN_CONFIG_APPEARANCE_LIGHT_CODE: string[] = ["ant-design",
697
- "a11y-light", "arduino-light", "ascetic", "atom-one-light", "base16/atelier-cave-light",
698
- "base16/atelier-dune-light", "base16/atelier-estuary-light", "base16/atelier-forest-light", "base16/atelier-heath-light",
699
- "base16/atelier-lakeside-light", "base16/atelier-plateau-light", "base16/atelier-savanna-light", "base16/atelier-seaside-light", "base16/atelier-sulphurpool-light", "base16/brush-trees",
700
- "base16/classic-light", "base16/cupcake", "base16/cupertino", "base16/default-light", "base16/dirtysea", "base16/edge-light", "base16/equilibrium-gray-light", "base16/equilibrium-light",
701
- "base16/fruit-soda", "base16/github", "base16/google-light", "base16/grayscale-light", "base16/gruvbox-light-hard", "base16/gruvbox-light-medium", "base16/gruvbox-light-soft",
702
- "base16/harmonic16-light", "base16/heetch-light", "base16/humanoid-light", "base16/horizon-light", "base16/ia-light", "base16/material-lighter", "base16/mexico-light",
703
- "base16/one-light", "base16/papercolor-light", "base16/ros-pine-dawn", "base16/sagelight", "base16/shapeshifter",
704
- "base16/silk-light", "base16/solar-flare-light", "base16/solarized-light", "base16/summerfruit-light", "base16/synth-midnight-terminal-light", "base16/tomorrow",
705
- "base16/unikitty-light", "base16/windows-10-light", "base16/windows-95-light", "base16/windows-high-contrast-light", "brown-paper", "base16/windows-nt-light",
706
- "color-brewer", "docco", "foundation", "github", "googlecode", "gradient-light", "grayscale", "idea", "intellij-light", "isbl-editor-light", "kimbie-light",
707
- "lightfair", "magula", "mono-blue", "nnfx-light", "panda-syntax-light", "paraiso-light", "purebasic", "qtcreator-light", "routeros", "school-book",
708
- "stackoverflow-light", "tokyo-night-light", "vs", "xcode", "default"];
758
+ "1c-light", "a11y-light", "arduino-light", "ascetic", "atom-one-light", "base16/atelier-cave-light", "base16/atelier-dune-light",
759
+ "base16/atelier-estuary-light", "base16/atelier-forest-light", "base16/atelier-heath-light", "base16/atelier-lakeside-light",
760
+ "base16/atelier-plateau-light", "base16/atelier-savanna-light", "base16/atelier-seaside-light", "base16/atelier-sulphurpool-light",
761
+ "base16/brush-trees", "base16/classic-light", "base16/cupcake", "base16/cupertino", "base16/default-light", "base16/dirtysea",
762
+ "base16/edge-light", "base16/equilibrium-gray-light", "base16/equilibrium-light", "base16/fruit-soda", "base16/github",
763
+ "base16/google-light", "base16/grayscale-light", "base16/gruvbox-light-hard", "base16/gruvbox-light-medium",
764
+ "base16/gruvbox-light-soft", "base16/harmonic16-light", "base16/heetch-light", "base16/humanoid-light", "base16/horizon-light",
765
+ "base16/ia-light", "base16/material-lighter", "base16/mexico-light", "base16/one-light", "base16/papercolor-light",
766
+ "base16/ros-pine-dawn", "base16/sagelight", "base16/shapeshifter", "base16/silk-light", "base16/solar-flare-light",
767
+ "base16/solarized-light", "base16/summerfruit-light", "base16/synth-midnight-terminal-light", "base16/tomorrow",
768
+ "base16/unikitty-light", "base16/windows-10-light", "base16/windows-95-light", "base16/windows-high-contrast-light",
769
+ "brown-paper", "base16/windows-nt-light", "color-brewer", "docco", "foundation", "github", "googlecode", "gradient-light",
770
+ "grayscale", "idea", "intellij-light", "isbl-editor-light", "kimbie-light", "lightfair", "magula", "mono-blue",
771
+ "nnfx-light", "panda-syntax-light", "paraiso-light", "purebasic", "qtcreator-light", "rose-pine-dawn", "routeros",
772
+ "school-book", "stackoverflow-light", "tokyo-night-light", "vs", "xcode", "default"];
709
773
  public static readonly ZWSP: string = "\u200b";
710
774
  public static readonly INLINE_TYPE: string[] = ["block-ref", "kbd", "text", "file-annotation-ref", "a", "strong", "em", "u", "s", "mark", "sup", "sub", "tag", "code", "inline-math", "inline-memo", "clear"];
711
775
  public static readonly BLOCK_HINT_KEYS: string[] = ["((", "[[", "((", "【【"];
@@ -713,12 +777,9 @@ export abstract class Constants {
713
777
  // common: "bash", "c", "csharp", "cpp", "css", "diff", "go", "xml", "json", "java", "javascript", "kotlin", "less", "lua", "makefile", "markdown", "objectivec", "php", "php-template", "perl", "plaintext", "python", "python-repl", "r", "ruby", "rust", "scss", "sql", "shell", "swift", "ini", "typescript", "vbnet", "yaml", "properties", "1c", "armasm", "avrasm", "actionscript", "ada", "angelscript", "accesslog", "apache", "applescript", "arcade", "arduino", "asciidoc", "aspectj", "abnf", "autohotkey", "autoit", "awk", "basic", "bnf", "dos", "brainfuck", "cal", "cmake", "csp", "cos", "capnproto", "ceylon", "clean", "clojure", "clojure-repl", "coffeescript", "coq", "crystal", "d", "dns", "dart", "delphi", "dts", "django", "dockerfile", "dust", "erb", "elixir", "elm", "erlang", "erlang-repl", "excel", "ebnf", "fsharp", "fix", "flix", "fortran", "gcode", "gams", "gauss", "glsl", "gml", "gherkin", "golo", "gradle", "groovy", "haml", "hsp", "http", "handlebars", "haskell", "haxe", "hy", "irpf90", "isbl", "inform7", "x86asm", "jboss-cli", "julia", "julia-repl", "ldif", "llvm", "lsl", "latex", "lasso", "leaf", "lisp", "livecodeserver", "livescript", "mel", "mipsasm", "matlab", "maxima", "mercury", "axapta", "routeros", "mizar", "mojolicious", "monkey", "moonscript", "n1ql", "nsis", "nestedtext", "nginx", "nim", "nix", "node-repl", "ocaml", "openscad", "ruleslanguage", "oxygene", "pf", "parser3", "pony", "pgsql", "powershell", "processing", "prolog", "protobuf", "puppet", "purebasic", "profile", "q", "qml", "reasonml", "rib", "rsl", "roboconf", "sas", "sml", "sqf", "step21", "scala", "scheme", "scilab", "smali", "smalltalk", "stan", "stata", "stylus", "subunit", "tp", "taggerscript", "tcl", "tap", "thrift", "twig", "vbscript", "vbscript-html", "vhdl", "vala", "verilog", "vim", "wasm", "mathematica", "wren", "xl", "xquery", "zephir", "crmsh", "dsconfig", "graphql",
714
778
  // third: "yul", "solidity", "abap", "hlsl", "gdscript"
715
779
  public static readonly ALIAS_CODE_LANGUAGES: string[] = [
716
- "js", "ts", "html", "toml", "c#", "bat",
780
+ "js", "ts", "html", "toml", "c#", "bat"
717
781
  ];
718
782
  public static readonly SIYUAN_RENDER_CODE_LANGUAGES: string[] = [
719
783
  "abc", "plantuml", "mermaid", "flowchart", "echarts", "mindmap", "graphviz", "math"
720
784
  ];
721
-
722
- // Google Analytics 事件
723
- public static readonly ANALYTICS_EVT_ON_GET_CONFIG: string = "siyuan.onGetConfig";
724
785
  }
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;
@@ -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,12 @@ export interface IProtyleOptions {
120
121
  classes?: {
121
122
  preview?: string;
122
123
  };
124
+ click?: {
125
+ /** 点击末尾是否阻止插入新块 */
126
+ preventInsetEmptyBlock?: boolean
127
+ }
128
+
129
+ handleEmptyContent?(): void
123
130
 
124
131
  /** 编辑器异步渲染完成后的回调方法 */
125
132
  after?(protyle: Protyle): void;