@codemirror/view 6.28.1 → 6.28.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/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 6.28.2 (2024-06-21)
2
+
3
+ ### Bug fixes
4
+
5
+ Only use `EditContext` on Chrome versions that support passing it an inverted selection range.
6
+
7
+ Fix an issue that prevented non-inclusive block widgets from having their `updateDOM` method called when changed.
8
+
9
+ Re-enable `EditContext` use on Chrome 126 and up.
10
+
1
11
  ## 6.28.1 (2024-06-12)
2
12
 
3
13
  ### 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(_other) { return false; }
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 === true) {
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;
package/dist/index.js CHANGED
@@ -1295,7 +1295,10 @@ class LineView extends ContentView {
1295
1295
  }
1296
1296
  return rect;
1297
1297
  }
1298
- become(_other) { return false; }
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 === true) {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.28.1",
3
+ "version": "6.28.2",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",