extend Plugin API with renderAVAttribute function (#13547)

This commit is contained in:
Alexander Pape 2024-12-20 02:51:05 +01:00 committed by GitHub
parent 2f4c7ffbb5
commit 26f296a87a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,6 +16,7 @@ import {Constants} from "../constants";
import {Setting} from "./Setting";
import {Menu} from "./Menu";
import {Protyle} from "../protyle";
import {renderAVAttribute as blockAttrRenderAVAttribute} from "../protyle/render/av/blockAttr";
import {openMobileFileById} from "../mobile/editor";
import {lockScreen, exitSiYuan} from "../dialog/processSystem";
import {Model} from "../layout/Model";
@ -24,6 +25,7 @@ import {getAllEditor} from "../layout/getAll";
let openTab;
let openWindow;
let renderAVAttribute;
/// #if MOBILE
openTab = () => {
// TODO: Mobile
@ -31,6 +33,9 @@ openTab = () => {
openWindow = () => {
// TODO: Mobile
};
renderAVAttribute = (element: HTMLElement, id: string, protyle: IProtyle, cb?: (element: HTMLElement) => void) => {
// TODO: Mobile
};
/// #else
openWindow = (options: {
position?: IPosition,
@ -166,6 +171,11 @@ openTab = (options: {
}
};
renderAVAttribute = (element: HTMLElement, id: string, protyle: IProtyle, cb?: (element: HTMLElement) => void) => {
blockAttrRenderAVAttribute(element, id, protyle, cb);
};
/// #endif
const getModelByDockType = (type: TDock | string) => {
@ -198,5 +208,6 @@ export const API = {
Menu,
Setting,
getAllEditor,
renderAVAttribute,
platformUtils
};