@hailin-zheng/editor-core 2.0.34 → 2.0.36

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
@@ -1722,8 +1722,8 @@ class TextProps extends INotifyPropertyChanged {
1722
1722
  super();
1723
1723
  }
1724
1724
  color;
1725
- fontName;
1726
- fontSize;
1725
+ fontName = '宋体';
1726
+ fontSize = 12;
1727
1727
  fontWeight = 'normal';
1728
1728
  fontStyle = 'normal';
1729
1729
  //textDecoration: 'none' | 'underline' | 'overline' | 'line-through' = 'none';
@@ -14677,6 +14677,9 @@ class DocumentArrange {
14677
14677
  blockLine = children[++j];
14678
14678
  }
14679
14679
  }
14680
+ // if (cloneRender.length === 0 && sumHeight === 0) {
14681
+ // return null;
14682
+ // }
14680
14683
  ElementUtil.remeasure(cloneRender);
14681
14684
  ElementUtil.remeasure(render);
14682
14685
  if (cloneRender.length === 0) {
@@ -27225,13 +27228,16 @@ class DocEditor {
27225
27228
  * 设置光标
27226
27229
  */
27227
27230
  setCursor() {
27231
+ if (this.documentEvent.ismousedown) {
27232
+ return;
27233
+ }
27228
27234
  this.selectionState;
27229
27235
  if (!this.canSetCursor() || !this.selectionState.startHitInfo) {
27230
27236
  this.selectionState.editable = false;
27231
27237
  this.docCtx.selectionState.cursorPos = null;
27232
27238
  const cursorRect = this.getCursorRect();
27233
27239
  this.hiddenInput(false, cursorRect);
27234
- return false;
27240
+ return;
27235
27241
  }
27236
27242
  const cursorRect = this.getCursorRect();
27237
27243
  this.docCtx.cursorRect = ElementUtil.cloneRect(cursorRect);
@@ -27239,12 +27245,20 @@ class DocEditor {
27239
27245
  const abPos = ElementUtil.cloneRect(cursorRect);
27240
27246
  this.setCursorPosition(abPos);
27241
27247
  //this.documentEvent.invokeCursor(startControl);
27242
- return true;
27248
+ return;
27243
27249
  }
27244
27250
  getCursorRect() {
27245
27251
  try {
27246
27252
  const { startControl, startOffset } = this.selectionState;
27247
- if (!this.documentEvent.startHitInfo || (startControl && !startControl.parent)) {
27253
+ if (!this.documentEvent.startHitInfo || !startControl || (startControl && !startControl.parent)) {
27254
+ if (this.documentEvent.mousedownPos) {
27255
+ return {
27256
+ x: this.documentEvent.mousedownPos.x,
27257
+ y: this.documentEvent.mousedownPos.y,
27258
+ width: 0,
27259
+ height: 0
27260
+ };
27261
+ }
27248
27262
  return { x: 0, y: 0, width: 0, height: 0 };
27249
27263
  }
27250
27264
  const { startRegion, hitDocIndex } = this.documentEvent.startHitInfo;
@@ -28277,7 +28291,7 @@ class DocEditor {
28277
28291
  rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
28278
28292
  }
28279
28293
  version() {
28280
- return "2.0.34";
28294
+ return "2.0.36";
28281
28295
  }
28282
28296
  }
28283
28297