@hailin-zheng/editor-core 1.1.10 → 1.1.11

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
@@ -9741,6 +9741,7 @@ class SelectionState {
9741
9741
  selectedRange;
9742
9742
  editable = true;
9743
9743
  renderContainer;
9744
+ //光标所在的位置,当前位置时相对文档的位置,而非DOM页面中的位置
9744
9745
  cursorPos;
9745
9746
  //当前选区的上下文是否支持留痕修改
9746
9747
  enableTrackChanges = false;
@@ -14737,7 +14738,7 @@ class DocumentEvent {
14737
14738
  return;
14738
14739
  }
14739
14740
  let { x, y } = this.selectionState.cursorPos;
14740
- y -= this.viewOptions.pageOffset.y;
14741
+ //y -= this.viewOptions.pageOffset.y;
14741
14742
  for (let i = 0; i < 50; i++) {
14742
14743
  const docEvent = new MouseElementEvent(this.docCtx);
14743
14744
  docEvent.globalX = x;
@@ -14922,7 +14923,6 @@ class DocumentInput {
14922
14923
  * @param visibility
14923
14924
  */
14924
14925
  setCursorVisibility(visibility) {
14925
- //this.cursorWrapper.style.display = visibility ? 'block' : 'none';
14926
14926
  if (visibility) {
14927
14927
  this.setInputFocus(true);
14928
14928
  }
@@ -20416,8 +20416,6 @@ class CanvasTextEditor extends AbsolutePanel {
20416
20416
  const { startRegion, hitDocIndex } = this.documentEvent.startHitInfo;
20417
20417
  const cursorPos = DocumentCursor.getElementCursorPos(startControl, startOffset, startRegion, hitDocIndex);
20418
20418
  this.docCtx.cursorRect = ElementUtil.cloneRect(cursorPos.rect);
20419
- this.transToAbsolutePos(ElementUtil.cloneRect(cursorPos.rect));
20420
- //this.documentInput.setCursorPosition(abPos);
20421
20419
  const focusEvent = {
20422
20420
  target: this,
20423
20421
  source: this,
@@ -21174,11 +21172,12 @@ class CanvasTextEditor extends AbsolutePanel {
21174
21172
  drawCaret(e) {
21175
21173
  const appCtx = getCurrentActiveAppContext();
21176
21174
  if (appCtx) {
21177
- const caretPos = this.selectionState.cursorPos;
21175
+ let caretPos = this.selectionState.cursorPos;
21178
21176
  if (!caretPos) {
21179
21177
  appCtx.root.hiddenInput();
21180
21178
  return;
21181
21179
  }
21180
+ caretPos = ElementUtil.cloneRect(caretPos);
21182
21181
  caretPos.x += this.border + this.padding + e.renderPos.x;
21183
21182
  caretPos.y += this.border + this.padding + e.renderPos.y;
21184
21183
  appCtx.root.setInputPosition(caretPos);