添加插入数学公式菜单

This commit is contained in:
wux_labs
2025-02-18 21:25:48 +08:00
parent 501e6e33eb
commit 8d513d1191
5 changed files with 94 additions and 0 deletions
+6
View File
@@ -55,6 +55,7 @@ import { Audio } from "./insert/Audio.ts";
import { HardBreak } from "./insert/HardBreak.ts";
import { Emoji } from "./insert/Emoji.ts";
import { Symbol } from "./insert/Symbol.ts";
import { Math } from "./insert/Math.ts";
/**
* 经典菜单栏
@@ -120,6 +121,7 @@ export class Ribbon extends HTMLElement implements UAIEditorEventListener {
insertMenuHardBreak!: HardBreak;
insertMenuEmoji!: Emoji;
insertMenuSymbol!: Symbol;
insertMenuMath!: Math;
constructor(defaultToolbarMenus: Record<string, any>[]) {
super();
@@ -330,6 +332,9 @@ export class Ribbon extends HTMLElement implements UAIEditorEventListener {
this.insertMenuSymbol = new Symbol({ menuType: "popup", enable: true, huge: true, hideText: false });
this.eventComponents.push(this.insertMenuSymbol);
this.insertMenuMath = new Math({ menuType: "button", enable: true, huge: true });
this.eventComponents.push(this.insertMenuMath);
}
/**
@@ -492,5 +497,6 @@ export class Ribbon extends HTMLElement implements UAIEditorEventListener {
group2.appendChild(this.insertMenuHardBreak);
group2.appendChild(this.insertMenuEmoji);
group2.appendChild(this.insertMenuSymbol);
group2.appendChild(this.insertMenuMath);
}
}