From 26f296a87a2ec8155fab2ac73e5ea3a86436899e Mon Sep 17 00:00:00 2001 From: Alexander Pape <300609+Macavity@users.noreply.github.com> Date: Fri, 20 Dec 2024 02:51:05 +0100 Subject: [PATCH] extend Plugin API with renderAVAttribute function (#13547) --- app/src/plugin/API.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/plugin/API.ts b/app/src/plugin/API.ts index ea73d5718..856a0b65f 100644 --- a/app/src/plugin/API.ts +++ b/app/src/plugin/API.ts @@ -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 };