@adecore/editor 0.63.1 → 0.63.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/view.js CHANGED
@@ -2042,7 +2042,8 @@ export class EditorView {
2042
2042
  { className: 'se-link', rects: this.link === null ? [] : this.paintRectangles(this.link.from, this.link.to, rows) }
2043
2043
  ]);
2044
2044
  const top = this.scrollTop;
2045
- const caretRects = focused
2045
+ // Only where typing would land: a read-only text, or a window that is not in front, takes no caret.
2046
+ const caretRects = focused && !this.settings.readOnly && this.document.hasFocus?.() !== false
2046
2047
  ? selections
2047
2048
  .map((selection) => ({ ...this.caretOf(selection.head), primary: selection === selections.at(-1) }))
2048
2049
  .filter((rect) => rect.y + rect.height >= top - rect.height && rect.y <= top + this.viewportHeight)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/editor",
3
- "version": "0.63.1",
3
+ "version": "0.63.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -54,8 +54,8 @@
54
54
  "test": "bun test --conditions=source"
55
55
  },
56
56
  "dependencies": {
57
- "@adecore/editor-core": "0.63.1",
58
- "@adecore/utils": "0.63.1",
57
+ "@adecore/editor-core": "0.63.2",
58
+ "@adecore/utils": "0.63.2",
59
59
  "linkedom": "^0.18.14",
60
60
  "shiki": "^4.5.0"
61
61
  },
package/src/view.ts CHANGED
@@ -2719,11 +2719,13 @@ export class EditorView {
2719
2719
 
2720
2720
  const top = this.scrollTop;
2721
2721
 
2722
- const caretRects = focused
2723
- ? selections
2724
- .map((selection) => ({ ...this.caretOf(selection.head), primary: selection === selections.at(-1) }))
2725
- .filter((rect) => rect.y + rect.height >= top - rect.height && rect.y <= top + this.viewportHeight)
2726
- : [];
2722
+ // Only where typing would land: a read-only text, or a window that is not in front, takes no caret.
2723
+ const caretRects =
2724
+ focused && !this.settings.readOnly && this.document.hasFocus?.() !== false
2725
+ ? selections
2726
+ .map((selection) => ({ ...this.caretOf(selection.head), primary: selection === selections.at(-1) }))
2727
+ .filter((rect) => rect.y + rect.height >= top - rect.height && rect.y <= top + this.viewportHeight)
2728
+ : [];
2727
2729
 
2728
2730
  const caretKey = caretRects.map((rect) => `${rect.x},${rect.y}`).join(' ');
2729
2731