@ones-editor/editor 0.0.8 → 0.0.9
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/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +1 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10288,24 +10288,6 @@ var __publicField = (obj, key, value) => {
|
|
|
10288
10288
|
return createEditorSelectionRange(editor, { anchor: anchor2, focus });
|
|
10289
10289
|
}
|
|
10290
10290
|
const logger$3H = getLogger("range-from-point");
|
|
10291
|
-
function getRangeFromExternal(editor, x, y) {
|
|
10292
|
-
const container = editor.rootContainer;
|
|
10293
|
-
const rect = container.getBoundingClientRect();
|
|
10294
|
-
if (x < rect.left || x > rect.right) {
|
|
10295
|
-
const elem = document.elementsFromPoint((rect.left + rect.right) / 2, y)[0];
|
|
10296
|
-
if (elem) {
|
|
10297
|
-
let block = getParentBlock(elem);
|
|
10298
|
-
while (block && !isRootContainer(getParentContainer(block))) {
|
|
10299
|
-
block = getParentBlockExcludeSelf(block);
|
|
10300
|
-
}
|
|
10301
|
-
if (block) {
|
|
10302
|
-
const range = createBlockSimpleRange(editor, block, rect.left > x ? 0 : getBlockTextLength$4(editor, block));
|
|
10303
|
-
return range;
|
|
10304
|
-
}
|
|
10305
|
-
}
|
|
10306
|
-
}
|
|
10307
|
-
return null;
|
|
10308
|
-
}
|
|
10309
10291
|
function getBlockRangeFromPoint(editor, pointX, pointY) {
|
|
10310
10292
|
const yOffsets = [0, -8, 8];
|
|
10311
10293
|
let x = pointX;
|
|
@@ -10334,10 +10316,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10334
10316
|
}
|
|
10335
10317
|
}
|
|
10336
10318
|
if (i === 0 && !editor.rootContainer.contains(elem)) {
|
|
10337
|
-
|
|
10338
|
-
if (externalRange) {
|
|
10339
|
-
return externalRange;
|
|
10340
|
-
}
|
|
10319
|
+
x = editor.rootContainer.getBoundingClientRect().left;
|
|
10341
10320
|
}
|
|
10342
10321
|
if (!editor.rootContainer.contains(elem)) {
|
|
10343
10322
|
continue;
|