@ones-editor/editor 3.0.2-beta.4 → 3.0.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.
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +16 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12484,6 +12484,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12484
12484
|
event.stopPropagation();
|
|
12485
12485
|
return;
|
|
12486
12486
|
}
|
|
12487
|
+
this.editor.selection.caret.update();
|
|
12487
12488
|
if (target instanceof HTMLElement && target.draggable) {
|
|
12488
12489
|
this.editor.selectionHandler.handleMouseDown(event);
|
|
12489
12490
|
this.editor.selectionHandler.stopSelection();
|
|
@@ -26478,23 +26479,23 @@ var __publicField = (obj, key, value) => {
|
|
|
26478
26479
|
}
|
|
26479
26480
|
}
|
|
26480
26481
|
function moveInputToScreenCenter(editor) {
|
|
26481
|
-
|
|
26482
|
+
let container = getScrollContainer$1(editor.rootContainer);
|
|
26483
|
+
if (!editor.rootElement.contains(container)) {
|
|
26484
|
+
container = editor.rootElement;
|
|
26485
|
+
}
|
|
26482
26486
|
const rect = container.getBoundingClientRect();
|
|
26483
|
-
const
|
|
26484
|
-
const
|
|
26485
|
-
const
|
|
26486
|
-
const
|
|
26487
|
-
const y1 = rect.top < 0 ? 0 : rect.top;
|
|
26488
|
-
const x2 = rect.right > windowWidth ? windowWidth : rect.right;
|
|
26489
|
-
const y2 = rect.bottom > windowHeight ? windowHeight : rect.bottom;
|
|
26487
|
+
const x1 = Math.max(rect.left, 0);
|
|
26488
|
+
const y1 = Math.max(rect.top, 0);
|
|
26489
|
+
const x2 = Math.min(rect.right, window.innerWidth);
|
|
26490
|
+
const y2 = Math.min(rect.bottom, window.innerHeight);
|
|
26490
26491
|
const centerX = (x1 + x2) / 2;
|
|
26491
|
-
const centerY =
|
|
26492
|
+
const centerY = y1 + (y2 - y1) / 4;
|
|
26492
26493
|
const input2 = editor.input.inputElement;
|
|
26493
26494
|
const inputHeight = input2.getBoundingClientRect().height;
|
|
26494
|
-
const x =
|
|
26495
|
-
const y =
|
|
26496
|
-
input2.style.left = `${x
|
|
26497
|
-
input2.style.top = `${y
|
|
26495
|
+
const x = centerX - rect.left;
|
|
26496
|
+
const y = centerY - rect.top - inputHeight / 2;
|
|
26497
|
+
input2.style.left = `${x}px`;
|
|
26498
|
+
input2.style.top = `${y}px`;
|
|
26498
26499
|
}
|
|
26499
26500
|
const logger$3T = getLogger("editor-caret");
|
|
26500
26501
|
function getFirefoxVersion() {
|
|
@@ -96045,7 +96046,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
96045
96046
|
}
|
|
96046
96047
|
}
|
|
96047
96048
|
});
|
|
96048
|
-
editor.version = "3.0.2
|
|
96049
|
+
editor.version = "3.0.2";
|
|
96049
96050
|
return editor;
|
|
96050
96051
|
}
|
|
96051
96052
|
function isDoc(doc2) {
|
|
@@ -96179,7 +96180,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
96179
96180
|
OnesEditorDropTarget.register(editor);
|
|
96180
96181
|
OnesEditorTocProvider.register(editor);
|
|
96181
96182
|
OnesEditorExclusiveBlock.register(editor);
|
|
96182
|
-
editor.version = "3.0.2
|
|
96183
|
+
editor.version = "3.0.2";
|
|
96183
96184
|
return editor;
|
|
96184
96185
|
}
|
|
96185
96186
|
async function showDocVersions(editor, options, serverUrl) {
|