@hailin-zheng/editor-core 1.1.25 → 1.1.27

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
@@ -1331,10 +1331,10 @@ class BranchElement extends Element {
1331
1331
  }
1332
1332
  else {
1333
1333
  this.modifyFlag = exports.ModifyFlag.Modify;
1334
- clearChildrenRenderCache(this);
1335
- // for (let i = 0; i < this.length; i++) {
1336
- // this.getChild(i).pubOnChange('to-child')
1337
- // }
1334
+ //clearChildrenRenderCache(this);
1335
+ for (let i = 0; i < this.length; i++) {
1336
+ this.getChild(i).pubOnChange('to-child');
1337
+ }
1338
1338
  }
1339
1339
  this._onChangeEvent.next();
1340
1340
  }
@@ -3693,7 +3693,7 @@ class DocumentFooterRenderObject extends BlockContainerRenderObject {
3693
3693
  const { render, position } = e;
3694
3694
  render.tran(() => {
3695
3695
  //判断页眉是否为输入内容
3696
- const isFooterEmpty = ElementUtil.checkEmptyContent(this);
3696
+ const isFooterEmpty = ElementUtil.checkEmptyRenderContent(this);
3697
3697
  if (this.element.disableClick && render.drawMode === 'view') {
3698
3698
  if (isFooterEmpty) {
3699
3699
  render.contentContext.setGlobalAlpha(0);
@@ -3770,7 +3770,7 @@ class DocumentHeaderRenderObject extends BlockContainerRenderObject {
3770
3770
  const { render, position } = e;
3771
3771
  render.tran(() => {
3772
3772
  //判断页眉是否为输入内容
3773
- const isHeaderEmpty = ElementUtil.checkEmptyContent(this);
3773
+ const isHeaderEmpty = ElementUtil.checkEmptyRenderContent(this);
3774
3774
  //存在输入内容时,绘制页眉-页体分割线
3775
3775
  if (!isHeaderEmpty || !this.element.disableClick) {
3776
3776
  const headerLineY = this.rect.height;
@@ -4007,14 +4007,14 @@ class TableRowElement extends BlockContainerElement {
4007
4007
  constructor() {
4008
4008
  super('tr');
4009
4009
  this.props = new TableRowProps();
4010
+ }
4011
+ beginMeasure(data) {
4012
+ super.beginMeasure(data);
4010
4013
  //在差异更新中,由于行内单元格存在合并行的情况,需要将当前行内存在合并的单元格,将其修改标志改为修改
4011
- const changeSub = this.onChangeSubject.subscribe(() => {
4012
- if (this.modifyFlag === exports.ModifyFlag.Track) {
4013
- this.checkRowModifyState();
4014
- this.pubOnChange('to-child');
4015
- }
4016
- });
4017
- this.addsubscribe(this, changeSub);
4014
+ if (this.modifyFlag === exports.ModifyFlag.Track) {
4015
+ this.checkRowModifyState();
4016
+ this.pubOnChange('to-child');
4017
+ }
4018
4018
  }
4019
4019
  /**
4020
4020
  * 解决纵向合并行的行缓存高度bug
@@ -7472,7 +7472,7 @@ class ElementUtil {
7472
7472
  * 校验是否为空内容
7473
7473
  * @param ele
7474
7474
  */
7475
- static checkEmptyContent(ele) {
7475
+ static checkEmptyRenderContent(ele) {
7476
7476
  if (ele.length === 1) {
7477
7477
  const firstRender = ele.getChild(0);
7478
7478
  if (firstRender instanceof ParagraphRenderObject) {
@@ -16540,7 +16540,7 @@ class DocumentChange {
16540
16540
  }
16541
16541
  getCursorElementByDeleteAction(control) {
16542
16542
  const prevLeafElementInPara = ElementUtil.getRecursionPrevSiblingElement(control, false, true, this.viewOptions);
16543
- //判断是否为同一段落
16543
+ //是否为同一段落
16544
16544
  if (prevLeafElementInPara && ElementUtil.isInSameParagraph(prevLeafElementInPara, control)) {
16545
16545
  return {
16546
16546
  ele: prevLeafElementInPara,
@@ -17314,6 +17314,9 @@ class ElementTrackManage {
17314
17314
  //ele获取的为父容器
17315
17315
  if (index === parentIndex + 1) {
17316
17316
  if (ele instanceof BranchElement) {
17317
+ if (ele.type === 'tbc' && ele.getChildLength() === 2) {
17318
+ ele.clearItems();
17319
+ }
17317
17320
  ele.addChild(target, 0);
17318
17321
  return;
17319
17322
  }