@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 +14 -5
- package/index-cjs.js.map +1 -1
- package/index.js +14 -5
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +4 -0
- package/package.json +1 -1
package/index.js
CHANGED
@@ -21682,8 +21682,12 @@ class DocEditor {
|
|
21682
21682
|
// }
|
21683
21683
|
this.flushTask = () => {
|
21684
21684
|
//读取变更记录,可能会同步影响文档内容
|
21685
|
-
this.readDocChangeLog();
|
21685
|
+
const isChanged = this.readDocChangeLog();
|
21686
21686
|
this.refreshDocument();
|
21687
|
+
//触发文档改变
|
21688
|
+
if (isChanged) {
|
21689
|
+
this.triggerDocChange();
|
21690
|
+
}
|
21687
21691
|
this.flushTask = null;
|
21688
21692
|
//回调
|
21689
21693
|
// let cbs = [...this.docCtx.nextViewFns];
|
@@ -23014,7 +23018,7 @@ class DocEditor {
|
|
23014
23018
|
rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
|
23015
23019
|
}
|
23016
23020
|
version() {
|
23017
|
-
return "2.2.
|
23021
|
+
return "2.2.24";
|
23018
23022
|
}
|
23019
23023
|
switchPageHeaderEditor() {
|
23020
23024
|
this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
|
@@ -23094,6 +23098,10 @@ class DocEditor {
|
|
23094
23098
|
])
|
23095
23099
|
]);
|
23096
23100
|
}
|
23101
|
+
/**
|
23102
|
+
* 读取操作日志,并返回是否修改的标志
|
23103
|
+
* @returns
|
23104
|
+
*/
|
23097
23105
|
readDocChangeLog() {
|
23098
23106
|
//获取文档的变更日志
|
23099
23107
|
const ops = generatePatch(this.docCtx.document, false);
|
@@ -23132,9 +23140,10 @@ class DocEditor {
|
|
23132
23140
|
else {
|
23133
23141
|
this.docCtx.suggestions.clear();
|
23134
23142
|
}
|
23135
|
-
|
23136
|
-
|
23137
|
-
|
23143
|
+
return ops.length;
|
23144
|
+
// if (ops.length) {
|
23145
|
+
// this.triggerDocChange();
|
23146
|
+
// }
|
23138
23147
|
}
|
23139
23148
|
/**
|
23140
23149
|
* 处理候选词
|