chore: upgrade lexical & make linting/formatting consistent with web codebase (#2144)

This commit is contained in:
Aman Harwara
2023-01-11 14:34:14 +05:30
committed by GitHub
parent 573538031e
commit c24be606ad
76 changed files with 2404 additions and 3203 deletions

View File

@@ -5,23 +5,20 @@
* LICENSE file in the root directory of this source tree.
*
*/
export function getDOMRangeRect(
nativeSelection: Selection,
rootElement: HTMLElement,
): DOMRect {
const domRange = nativeSelection.getRangeAt(0);
export function getDOMRangeRect(nativeSelection: Selection, rootElement: HTMLElement): DOMRect {
const domRange = nativeSelection.getRangeAt(0)
let rect;
let rect
if (nativeSelection.anchorNode === rootElement) {
let inner = rootElement;
let inner = rootElement
while (inner.firstElementChild != null) {
inner = inner.firstElementChild as HTMLElement;
inner = inner.firstElementChild as HTMLElement
}
rect = inner.getBoundingClientRect();
rect = inner.getBoundingClientRect()
} else {
rect = domRange.getBoundingClientRect();
rect = domRange.getBoundingClientRect()
}
return rect;
return rect
}