@hailin-zheng/editor-core 2.2.23 → 2.2.25

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.js CHANGED
@@ -1898,6 +1898,10 @@ class ViewOptions {
1898
1898
  printMode = 'normal';
1899
1899
  //是否开启候选词输入联想
1900
1900
  enableSuggestions = false;
1901
+ //病程录上边距
1902
+ bodyPartMarginTop = 10;
1903
+ //病程录下边距
1904
+ bodyPartMarginBottom = 10;
1901
1905
  constructor() {
1902
1906
  }
1903
1907
  }
@@ -9636,10 +9640,10 @@ class DocumentBodyPartElement extends BlockContainerElement {
9636
9640
  });
9637
9641
  this.props = new BodyPartProps();
9638
9642
  }
9639
- createRenderObject() {
9643
+ createRenderObject(data) {
9640
9644
  const render = new DocumentBodyPartRenderObject(this);
9641
- render.margin.top = 10;
9642
- render.margin.bottom = 10;
9645
+ render.margin.top = data.options.bodyPartMarginTop;
9646
+ render.margin.bottom = data.options.bodyPartMarginBottom;
9643
9647
  return render;
9644
9648
  }
9645
9649
  serialize() {
@@ -21682,8 +21686,12 @@ class DocEditor {
21682
21686
  // }
21683
21687
  this.flushTask = () => {
21684
21688
  //读取变更记录,可能会同步影响文档内容
21685
- this.readDocChangeLog();
21689
+ const isChanged = this.readDocChangeLog();
21686
21690
  this.refreshDocument();
21691
+ //触发文档改变
21692
+ if (isChanged) {
21693
+ this.triggerDocChange();
21694
+ }
21687
21695
  this.flushTask = null;
21688
21696
  //回调
21689
21697
  // let cbs = [...this.docCtx.nextViewFns];
@@ -23014,7 +23022,7 @@ class DocEditor {
23014
23022
  rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
23015
23023
  }
23016
23024
  version() {
23017
- return "2.2.23";
23025
+ return "2.2.25";
23018
23026
  }
23019
23027
  switchPageHeaderEditor() {
23020
23028
  this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
@@ -23094,6 +23102,10 @@ class DocEditor {
23094
23102
  ])
23095
23103
  ]);
23096
23104
  }
23105
+ /**
23106
+ * 读取操作日志,并返回是否修改的标志
23107
+ * @returns
23108
+ */
23097
23109
  readDocChangeLog() {
23098
23110
  //获取文档的变更日志
23099
23111
  const ops = generatePatch(this.docCtx.document, false);
@@ -23132,9 +23144,10 @@ class DocEditor {
23132
23144
  else {
23133
23145
  this.docCtx.suggestions.clear();
23134
23146
  }
23135
- if (ops.length) {
23136
- this.triggerDocChange();
23137
- }
23147
+ return ops.length;
23148
+ // if (ops.length) {
23149
+ // this.triggerDocChange();
23150
+ // }
23138
23151
  }
23139
23152
  /**
23140
23153
  * 处理候选词