feat(math): support multi-line formula editing

This commit is contained in:
SiriusXT
2025-05-23 17:03:07 +08:00
parent ac1d56b1d6
commit 262ec45fe0
4 changed files with 25 additions and 48 deletions

View File

@@ -1,16 +1,16 @@
import { ButtonView, createLabeledInputText, FocusCycler, LabelView, LabeledFieldView, submitHandler, SwitchButtonView, View, ViewCollection, type InputTextView, type FocusableView, Locale, FocusTracker, KeystrokeHandler } from 'ckeditor5';
import { ButtonView, createLabeledTextarea, FocusCycler, LabelView, LabeledFieldView, submitHandler, SwitchButtonView, View, ViewCollection, type TextareaView, type FocusableView, Locale, FocusTracker, KeystrokeHandler } from 'ckeditor5';
import { IconCheck, IconCancel } from "@ckeditor/ckeditor5-icons";
import { extractDelimiters, hasDelimiters } from '../utils.js';
import MathView from './mathview.js';
import '../../theme/mathform.css';
import type { KatexOptions } from '../typings-external.js';
class MathInputView extends LabeledFieldView<InputTextView> {
class MathInputView extends LabeledFieldView<TextareaView> {
public value: null | string = null;
public isReadOnly = false;
constructor( locale: Locale ) {
super( locale, createLabeledInputText );
super( locale, createLabeledTextarea );
}
}

View File

@@ -49,7 +49,7 @@ export default class MathView extends View {
this.setTemplate( {
tag: 'div',
attributes: {
class: [ 'ck', 'ck-math-preview' ]
class: [ 'ck', 'ck-math-preview', 'ck-reset_all-excluded' ]
}
} );
}