import {fetchPost} from "../../../util/fetch"; import {getColIconByType} from "./col"; import {Constants} from "../../../constants"; import {getCalcValue, popTextCell} from "./cell"; import * as dayjs from "dayjs"; import {unicode2Emoji} from "../../../emoji"; import {focusBlock} from "../../util/selection"; import {isMac} from "../../util/compatibility"; import {hasClosestByClassName} from "../../util/hasClosest"; import {stickyRow} from "./row"; export const avRender = (element: Element, protyle: IProtyle, cb?: () => void) => { let avElements: Element[] = []; if (element.getAttribute("data-type") === "NodeAttributeView") { // 编辑器内代码块编辑渲染 avElements = [element]; } else { avElements = Array.from(element.querySelectorAll('[data-type="NodeAttributeView"]')); } if (avElements.length === 0) { return; } if (avElements.length > 0) { avElements.forEach((e: HTMLElement) => { if (e.getAttribute("data-render") === "true") { return; } let time: number; if (e.firstElementChild.innerHTML === "") { e.style.alignSelf = ""; time = new Date().getTime(); let html = ""; [1, 2, 3].forEach(() => { html += `