Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/17552

Vanessa0e1071f4f4ae
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts
index 70a8f01000..67c5264f7a 100644
--- a/app/src/protyle/index.ts
+++ b/app/src/protyle/index.ts
@@ -48,6 +48,7 @@ import {getAllModels} from "../layout/getAll";
import {isSupportCSSHL} from "./render/searchMarkRender";
import {renderAVAttribute} from "./render/av/blockAttr";
import {setFoldById, zoomOut} from "../menus/protyle";
+import {setEditMode} from "./util/setEditMode";
export class Protyle {
@@ -534,4 +535,8 @@ export class Protyle {
public renderAVAttribute(element: HTMLElement, id: string, cb?: (element: HTMLElement) => void) {
renderAVAttribute(element, id, this.protyle, cb);
}
+
+ public switchMode(mode: TEditorMode) {
+ setEditMode(this.protyle, mode);
+ }
}