@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/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
- const container = getScrollContainer$1(editor.rootContainer);
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 scale = getElementScale(container);
26484
- const windowWidth = window.innerWidth;
26485
- const windowHeight = window.innerHeight;
26486
- const x1 = rect.left < 0 ? 0 : rect.left;
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 = (y1 + y2) / 2;
26492
+ const centerY = y1 + (y2 - y1) / 4;
26492
26493
  const input2 = editor.input.inputElement;
26493
26494
  const inputHeight = input2.getBoundingClientRect().height;
26494
- const x = 0 - rect.left + centerX;
26495
- const y = 0 - rect.top + centerY + container.scrollTop - inputHeight / 2;
26496
- input2.style.left = `${x / scale}px`;
26497
- input2.style.top = `${y / scale}px`;
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-beta.4";
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-beta.4";
96183
+ editor.version = "3.0.2";
96183
96184
  return editor;
96184
96185
  }
96185
96186
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "3.0.2-beta.4",
3
+ "version": "3.0.2",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {