siyuan 1.2.0 → 1.2.1
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 +4 -1
- package/package.json +1 -1
- package/siyuan.d.ts +5 -0
- package/types/protyle.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## v1.2.1
|
|
3
|
+
## v1.2.1 2026-04-21
|
|
4
|
+
|
|
5
|
+
* [Add `switchMode` method to Protyle instance](https://github.com/siyuan-note/siyuan/issues/17552)
|
|
6
|
+
* [Add doc.mode to openTab for opening in document mode](https://github.com/siyuan-note/siyuan/issues/17523)
|
|
4
7
|
|
|
5
8
|
## v1.2.0 2026-04-14
|
|
6
9
|
|
package/package.json
CHANGED
package/siyuan.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
TProtyleAction,
|
|
13
13
|
IMenuItem,
|
|
14
14
|
IRefDefs,
|
|
15
|
+
TEditorMode,
|
|
15
16
|
} from "./types";
|
|
16
17
|
import {
|
|
17
18
|
Config,
|
|
@@ -329,12 +330,16 @@ export function expandDocTree(options: {
|
|
|
329
330
|
|
|
330
331
|
export function openMobileFileById(app: App, id: string, action?: TProtyleAction[]): void;
|
|
331
332
|
|
|
333
|
+
/**
|
|
334
|
+
* @param {string} [options.doc.mode="wysiwyg"] - 只在首次打开时生效,切换可调用 switchMode 方法
|
|
335
|
+
*/
|
|
332
336
|
export function openTab(options: {
|
|
333
337
|
app: App,
|
|
334
338
|
doc?: {
|
|
335
339
|
id: string, // 块 id
|
|
336
340
|
action?: TProtyleAction[],
|
|
337
341
|
zoomIn?: boolean, // 是否缩放
|
|
342
|
+
mode?: TEditorMode
|
|
338
343
|
};
|
|
339
344
|
pdf?: {
|
|
340
345
|
path: string,
|
package/types/protyle.d.ts
CHANGED
|
@@ -294,6 +294,8 @@ export class Protyle {
|
|
|
294
294
|
public enable(): void
|
|
295
295
|
|
|
296
296
|
public renderAVAttribute(element: HTMLElement, id: string, cb?: (element: HTMLElement) => void): void
|
|
297
|
+
|
|
298
|
+
public switchMode(mode: TEditorMode): void
|
|
297
299
|
}
|
|
298
300
|
|
|
299
301
|
export class ProtyleMethod {
|