@hailin-zheng/editor-core 2.2.23 → 2.2.24

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
@@ -21711,8 +21711,12 @@ class DocEditor {
21711
21711
  // }
21712
21712
  this.flushTask = () => {
21713
21713
  //读取变更记录,可能会同步影响文档内容
21714
- this.readDocChangeLog();
21714
+ const isChanged = this.readDocChangeLog();
21715
21715
  this.refreshDocument();
21716
+ //触发文档改变
21717
+ if (isChanged) {
21718
+ this.triggerDocChange();
21719
+ }
21716
21720
  this.flushTask = null;
21717
21721
  //回调
21718
21722
  // let cbs = [...this.docCtx.nextViewFns];
@@ -23043,7 +23047,7 @@ class DocEditor {
23043
23047
  rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
23044
23048
  }
23045
23049
  version() {
23046
- return "2.2.23";
23050
+ return "2.2.24";
23047
23051
  }
23048
23052
  switchPageHeaderEditor() {
23049
23053
  this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
@@ -23123,6 +23127,10 @@ class DocEditor {
23123
23127
  ])
23124
23128
  ]);
23125
23129
  }
23130
+ /**
23131
+ * 读取操作日志,并返回是否修改的标志
23132
+ * @returns
23133
+ */
23126
23134
  readDocChangeLog() {
23127
23135
  //获取文档的变更日志
23128
23136
  const ops = generatePatch(this.docCtx.document, false);
@@ -23161,9 +23169,10 @@ class DocEditor {
23161
23169
  else {
23162
23170
  this.docCtx.suggestions.clear();
23163
23171
  }
23164
- if (ops.length) {
23165
- this.triggerDocChange();
23166
- }
23172
+ return ops.length;
23173
+ // if (ops.length) {
23174
+ // this.triggerDocChange();
23175
+ // }
23167
23176
  }
23168
23177
  /**
23169
23178
  * 处理候选词