This commit is contained in:
Michael Yang 2024-06-21 18:21:27 +08:00
parent f23296ad12
commit 5bcb001e09
1 changed files with 7 additions and 6 deletions

View File

@ -60,16 +60,18 @@ export type AiEditorOptions = {
theme?: "light" | "dark",
onMentionQuery?: (query: string) => any[] | Promise<any[]>,
onCreateBefore?: (editor: AiEditor, extensions: Extensions) => void | Extensions,
onDestroy?: (editor: AiEditor) => void,
onCreated?: (editor: AiEditor) => void,
onChange?: (editor: AiEditor) => void,
onFocus?: (editor: AiEditor) => void,
onBlur?: (editor: AiEditor) => void,
onDestroy?: (editor: AiEditor) => void,
onSave?: (editor: AiEditor) => boolean,
toolbarKeys?: (string | CustomMenu)[],
draggable?: boolean,
textSelectionBubbleMenu?: {
enable?: boolean,
elementTagName?: string,
items?:(string)[],
items?: (string)[],
},
link?: {
autolink?: boolean,
@ -246,7 +248,9 @@ export class AiEditor {
extensions: extensions,
onCreate: (props) => this.onCreate(props),
onTransaction: (props) => this.onTransaction(props),
onDestroy: () => this.onDestroy,
onFocus: () => this.options?.onFocus?.(this),
onBlur: () => this.options?.onBlur?.(this),
onDestroy: () => this.options?.onDestroy?.(this),
editorProps: {
attributes: {
class: "aie-content"
@ -302,9 +306,6 @@ export class AiEditor {
}
}
private onDestroy() {
}
getHtml() {
return this.innerEditor.getHTML();
}