@hailin-zheng/editor-core 2.2.4 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index-cjs.js CHANGED
@@ -16696,11 +16696,6 @@ class DocumentInput {
16696
16696
  if (evt.defaultPrevented) {
16697
16697
  return;
16698
16698
  }
16699
- const keyEvent = new KeyboradElementEvent(this.docCtx);
16700
- keyEvent.sourceEvent = evt;
16701
- if (DocumentEvent.invokeEvent('ElementKeyDown', this.docCtx.selectionState.startControl, keyEvent, 'All')) {
16702
- return;
16703
- }
16704
16699
  // if (!this.docCtx.selectionState.editable) {
16705
16700
  // return;
16706
16701
  // }
@@ -17075,6 +17070,8 @@ class DocumentChange {
17075
17070
  if (text.props.fontSize !== this.viewOptions.currentFontSize || text.props.fontName !== this.viewOptions.currentFontName) {
17076
17071
  //创建新输入项
17077
17072
  const newInput = this.createNewInputText();
17073
+ this.viewOptions.currentFontName = newInput.props.fontName;
17074
+ this.viewOptions.currentFontSize = newInput.props.fontSize;
17078
17075
  //插入到文档
17079
17076
  this.insertElement(element, offset, [newInput]);
17080
17077
  this.correctInputEle(newInput, '', 0, data);
@@ -21925,7 +21922,7 @@ class DocEditor {
21925
21922
  rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
21926
21923
  }
21927
21924
  version() {
21928
- return "2.2.4";
21925
+ return "2.2.6";
21929
21926
  }
21930
21927
  switchPageHeaderEditor() {
21931
21928
  this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
@@ -22092,6 +22089,12 @@ class DocEditor {
22092
22089
  }
22093
22090
  }
22094
22091
  processKeyDownEvent(evt) {
22092
+ const keyEvent = new KeyboradElementEvent(this.docCtx);
22093
+ keyEvent.sourceEvent = evt;
22094
+ if (DocumentEvent.invokeEvent('ElementKeyDown', this.docCtx.selectionState.startControl, keyEvent, 'All')) {
22095
+ evt.preventDefault();
22096
+ return;
22097
+ }
22095
22098
  if (evt.keyCode === 38 || evt.keyCode === 40) {
22096
22099
  if (this.docCtx.suggestions.prepareSuggestions.length) {
22097
22100
  this.onSuggestionsKeydown(evt);