@worktile/theia 2.3.0-next.3 → 2.3.2

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.
@@ -2644,8 +2644,10 @@
2644
2644
  var editableElement = i1.EDITOR_TO_ELEMENT.get(editor);
2645
2645
  var rectEditable = editableElement.getBoundingClientRect();
2646
2646
  if (x > rectEditable.x && x < rectEditable.x + rectEditable.width) {
2647
- var centerX = rectEditable.x + rectEditable.width / 2;
2648
- var relativeElement = document.elementFromPoint(mode === 'highest' ? centerX : x, y);
2647
+ var paddingLeft = window.getComputedStyle(editableElement, null).paddingLeft;
2648
+ var paddingLeftPixels = coercePixelsFromCssValue(paddingLeft);
2649
+ var startX = rectEditable.left + paddingLeftPixels;
2650
+ var relativeElement = document.elementFromPoint(mode === 'highest' ? startX : x, y);
2649
2651
  return relativeElement;
2650
2652
  }
2651
2653
  return null;
@@ -13292,10 +13294,12 @@
13292
13294
  var _a;
13293
13295
  var editor = this.editor;
13294
13296
  if (editor === null || editor === void 0 ? void 0 : editor.selection) {
13297
+ var editableElement = i1.EDITOR_TO_ELEMENT.get(editor);
13298
+ var paddingLeft = window.getComputedStyle(editableElement, null).paddingLeft;
13299
+ var paddingLeftPixels = coercePixelsFromCssValue(paddingLeft);
13295
13300
  var block = slate.Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
13296
13301
  var rootNode = i1.AngularEditor.toDOMNode(editor, block);
13297
- var firstElementChild = rootNode.firstElementChild;
13298
- return (firstElementChild === null || firstElementChild === void 0 ? void 0 : firstElementChild.offsetLeft) > 0;
13302
+ return rootNode.offsetLeft > paddingLeftPixels;
13299
13303
  }
13300
13304
  return false;
13301
13305
  };