@ones-editor/editor 2.2.10-beta.4 → 2.2.10-beta.5

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/dist/index.js CHANGED
@@ -5179,6 +5179,7 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5179
5179
  background-color: var(--op-selected-color);
5180
5180
  border-radius: 3px;
5181
5181
  pointer-events: none;
5182
+ z-index: 1;
5182
5183
  }
5183
5184
  .editor-root.history .table-block.history-inserted-block table .child {
5184
5185
  pointer-events: none;
@@ -13088,7 +13089,7 @@ var __publicField = (obj, key, value) => {
13088
13089
  return createEditorSelectionRange(editor, { anchor: anchor2, focus });
13089
13090
  }
13090
13091
  const logger$49 = getLogger("range-from-point");
13091
- function getBlockRangeFromPoint(editor, pointX, pointY) {
13092
+ function getBlockRangeFromPoint(editor, pointX, pointY, dragging) {
13092
13093
  const yOffsets = [0, -12, 12];
13093
13094
  let x = pointX;
13094
13095
  const y = pointY;
@@ -13136,7 +13137,7 @@ var __publicField = (obj, key, value) => {
13136
13137
  if (!editor.contains(block)) {
13137
13138
  continue;
13138
13139
  }
13139
- const range = getBlockClass(editor, block).getRangeFromPoint(editor, block, x, y + yOffsets[i]);
13140
+ const range = getBlockClass(editor, block).getRangeFromPoint(editor, block, x, y + yOffsets[i], dragging);
13140
13141
  if (range) {
13141
13142
  return range;
13142
13143
  }
@@ -23732,7 +23733,7 @@ var __publicField = (obj, key, value) => {
23732
23733
  });
23733
23734
  return ret;
23734
23735
  }
23735
- function getTextBlockRangeFromPoint(editor, block, xOrign, yOrign) {
23736
+ function getTextBlockRangeFromPoint(editor, block, xOrign, yOrign, dragging) {
23736
23737
  const elem = getElementFromPoint(xOrign, yOrign);
23737
23738
  if (!elem)
23738
23739
  return null;
@@ -23787,7 +23788,12 @@ var __publicField = (obj, key, value) => {
23787
23788
  offset = start;
23788
23789
  length = 0;
23789
23790
  } else if (isTextBlockContentBoxChild(child)) {
23790
- offset = start + 1;
23791
+ const blockRect2 = child.getBoundingClientRect();
23792
+ if (!dragging) {
23793
+ offset = start + (blockRect2.x + 10 > x ? 0 : 1);
23794
+ } else {
23795
+ offset = start + (blockRect2.x + blockRect2.width / 2 > x ? 0 : 1);
23796
+ }
23791
23797
  length = 0;
23792
23798
  } else {
23793
23799
  assert(logger$3W, child.firstChild instanceof Text, "child is not text");
@@ -28136,7 +28142,7 @@ var __publicField = (obj, key, value) => {
28136
28142
  if (Math.abs(this.mouseDownEvent.x - event.x) < 3 && Math.abs(this.mouseDownEvent.y - event.y) < 3) {
28137
28143
  return;
28138
28144
  }
28139
- const range = getBlockRangeFromPoint(this.editor, event.x, event.y);
28145
+ const range = getBlockRangeFromPoint(this.editor, event.x, event.y, true);
28140
28146
  if (!range) {
28141
28147
  return;
28142
28148
  }
@@ -88344,7 +88350,7 @@ ${data2.flowchartText}
88344
88350
  }
88345
88351
  }
88346
88352
  });
88347
- editor.version = "2.2.10-beta.4";
88353
+ editor.version = "2.2.10-beta.5";
88348
88354
  return editor;
88349
88355
  }
88350
88356
  function isDoc(doc2) {
@@ -88439,7 +88445,7 @@ ${data2.flowchartText}
88439
88445
  });
88440
88446
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
88441
88447
  OnesEditorToolbar.register(editor);
88442
- editor.version = "2.2.10-beta.4";
88448
+ editor.version = "2.2.10-beta.5";
88443
88449
  return editor;
88444
88450
  }
88445
88451
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.2.10-beta.4",
3
+ "version": "2.2.10-beta.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",