plugin-audio
Version:
wangEditor 上传音频
26 lines (25 loc) • 2.04 kB
TypeScript
/**
* @description insert audio menu
* @author wulijie
*/
import { Node } from 'slate';
import { IModalMenu, IDomEditor } from '@wangeditor/editor';
import { DOMElement } from '../../utils/dom';
declare class InsertAudioMenu implements IModalMenu {
readonly title: string;
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M512 624c-70.016 0-128-57.984-128-128s57.984-128 128-128 128 57.984 128 128-57.984 128-128 128z m0-192c-35.296 0-64 28.704-64 64s28.704 64 64 64 64-28.704 64-64-28.704-64-64-64z m384 32c0-211.744-172.256-384-384-384S128 252.256 128 464c0 149.984 88.224 290.016 225.984 351.744 11.984 5.504 26.016 0 31.52-11.744 5.504-11.984 0-26.016-11.744-31.52C256 715.008 179.968 595.744 179.968 464c0-182.496 148.48-331.008 331.008-331.008 182.496 0 331.008 148.48 331.008 331.008 0 131.744-76 251.008-193.76 308.48-11.744 5.504-17.248 19.52-11.744 31.52 4 8.736 12.736 13.76 21.76 13.76 3.264 0 6.496-0.736 9.76-2.016C805.76 754.016 896 613.984 896 464z m-128 0c0-141.248-114.752-256-256-256S256 322.752 256 464c0 103.264 62.496 196.992 158.72 237.248 11.744 4.992 25.76 0 31.008-11.744 4.992-11.744 0-25.76-11.744-31.008C358.24 625.248 307.968 548.48 307.968 464c0-112 91.008-203.008 203.008-203.008 112 0 203.008 91.008 203.008 203.008 0 84.48-50.24 161.248-127.968 194.496-11.744 4.992-17.248 19.264-11.744 31.008 3.744 8.736 12.256 14.016 21.248 14.016 3.008 0 6.24-0.736 9.248-1.76C701.504 660.992 768 567.264 768 464z\"></path></svg>";
readonly tag = "button";
readonly showModal = true;
readonly modalWidth = 320;
private $content;
private readonly srcInputId;
private readonly posterInputId;
private readonly buttonId;
getValue(editor: IDomEditor): string | boolean;
isActive(editor: IDomEditor): boolean;
exec(editor: IDomEditor, value: string | boolean): void;
isDisabled(editor: IDomEditor): boolean;
getModalPositionNode(editor: IDomEditor): Node | null;
getModalContentElem(editor: IDomEditor): DOMElement;
}
export default InsertAudioMenu;