@adecore/editor 0.63.0 → 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 +2 -1
- package/package.json +3 -3
- package/src/view.ts +7 -5
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
|
-
|
|
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.
|
|
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.
|
|
58
|
-
"@adecore/utils": "0.63.
|
|
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
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
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
|
|