@codemirror/view 6.28.1 → 6.28.3
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/CHANGELOG.md +16 -0
- package/dist/index.cjs +8 -3
- package/dist/index.js +8 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 6.28.3 (2024-07-01)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix an issue causing the IME interface to appear in the wrong spot on Chrome Windows.
|
|
6
|
+
|
|
7
|
+
## 6.28.2 (2024-06-21)
|
|
8
|
+
|
|
9
|
+
### Bug fixes
|
|
10
|
+
|
|
11
|
+
Only use `EditContext` on Chrome versions that support passing it an inverted selection range.
|
|
12
|
+
|
|
13
|
+
Fix an issue that prevented non-inclusive block widgets from having their `updateDOM` method called when changed.
|
|
14
|
+
|
|
15
|
+
Re-enable `EditContext` use on Chrome 126 and up.
|
|
16
|
+
|
|
1
17
|
## 6.28.1 (2024-06-12)
|
|
2
18
|
|
|
3
19
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -1297,7 +1297,10 @@ class LineView extends ContentView {
|
|
|
1297
1297
|
}
|
|
1298
1298
|
return rect;
|
|
1299
1299
|
}
|
|
1300
|
-
become(
|
|
1300
|
+
become(other) {
|
|
1301
|
+
return other instanceof LineView && this.children.length == 0 && other.children.length == 0 &&
|
|
1302
|
+
attrsEq(this.attrs, other.attrs) && this.breakAfter == other.breakAfter;
|
|
1303
|
+
}
|
|
1301
1304
|
covers() { return true; }
|
|
1302
1305
|
static find(docView, pos) {
|
|
1303
1306
|
for (let i = 0, off = 0; i < docView.children.length; i++) {
|
|
@@ -6639,7 +6642,9 @@ class DOMObserver {
|
|
|
6639
6642
|
else
|
|
6640
6643
|
this.flush();
|
|
6641
6644
|
});
|
|
6642
|
-
if (window.EditContext && view.constructor.EDIT_CONTEXT
|
|
6645
|
+
if (window.EditContext && view.constructor.EDIT_CONTEXT !== false &&
|
|
6646
|
+
// Chrome <126 doesn't support inverted selections in edit context (#1392)
|
|
6647
|
+
!(browser.chrome && browser.chrome_version < 126)) {
|
|
6643
6648
|
this.editContext = new EditContextManager(view);
|
|
6644
6649
|
if (view.state.facet(editable))
|
|
6645
6650
|
view.contentDOM.editContext = this.editContext.editContext;
|
|
@@ -7115,7 +7120,7 @@ class EditContextManager {
|
|
|
7115
7120
|
let rects = [], prev = null;
|
|
7116
7121
|
for (let i = this.toEditorPos(e.rangeStart), end = this.toEditorPos(e.rangeEnd); i < end; i++) {
|
|
7117
7122
|
let rect = view.coordsForChar(i);
|
|
7118
|
-
prev = (rect && new DOMRect(rect.left, rect.
|
|
7123
|
+
prev = (rect && new DOMRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top))
|
|
7119
7124
|
|| prev || new DOMRect;
|
|
7120
7125
|
rects.push(prev);
|
|
7121
7126
|
}
|
package/dist/index.js
CHANGED
|
@@ -1295,7 +1295,10 @@ class LineView extends ContentView {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
return rect;
|
|
1297
1297
|
}
|
|
1298
|
-
become(
|
|
1298
|
+
become(other) {
|
|
1299
|
+
return other instanceof LineView && this.children.length == 0 && other.children.length == 0 &&
|
|
1300
|
+
attrsEq(this.attrs, other.attrs) && this.breakAfter == other.breakAfter;
|
|
1301
|
+
}
|
|
1299
1302
|
covers() { return true; }
|
|
1300
1303
|
static find(docView, pos) {
|
|
1301
1304
|
for (let i = 0, off = 0; i < docView.children.length; i++) {
|
|
@@ -6634,7 +6637,9 @@ class DOMObserver {
|
|
|
6634
6637
|
else
|
|
6635
6638
|
this.flush();
|
|
6636
6639
|
});
|
|
6637
|
-
if (window.EditContext && view.constructor.EDIT_CONTEXT
|
|
6640
|
+
if (window.EditContext && view.constructor.EDIT_CONTEXT !== false &&
|
|
6641
|
+
// Chrome <126 doesn't support inverted selections in edit context (#1392)
|
|
6642
|
+
!(browser.chrome && browser.chrome_version < 126)) {
|
|
6638
6643
|
this.editContext = new EditContextManager(view);
|
|
6639
6644
|
if (view.state.facet(editable))
|
|
6640
6645
|
view.contentDOM.editContext = this.editContext.editContext;
|
|
@@ -7110,7 +7115,7 @@ class EditContextManager {
|
|
|
7110
7115
|
let rects = [], prev = null;
|
|
7111
7116
|
for (let i = this.toEditorPos(e.rangeStart), end = this.toEditorPos(e.rangeEnd); i < end; i++) {
|
|
7112
7117
|
let rect = view.coordsForChar(i);
|
|
7113
|
-
prev = (rect && new DOMRect(rect.left, rect.
|
|
7118
|
+
prev = (rect && new DOMRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top))
|
|
7114
7119
|
|| prev || new DOMRect;
|
|
7115
7120
|
rects.push(prev);
|
|
7116
7121
|
}
|