import {Menu} from "../../../plugin/Menu"; import {transaction} from "../../wysiwyg/transaction"; import {fetchPost} from "../../../util/fetch"; import {hideElements} from "../../ui/hideElements"; export const openMenuPanel = (protyle: IProtyle, blockElement: HTMLElement, type: "properties" | "config" = "config") => { let avMenuPanel = document.querySelector(".av__panel"); if (avMenuPanel) { avMenuPanel.remove(); return; } window.siyuan.menus.menu.remove(); fetchPost("/api/av/renderAttributeView", {id: blockElement.getAttribute("data-av-id")}, (response) => { const data = response.data.av; const tabRect = blockElement.querySelector(".layout-tab-bar").getBoundingClientRect() let html if (type === "config") { html = `