@codemirror/view 6.39.0-beta.5 → 6.39.0

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,17 @@
1
+ ## 6.39.0 (2025-12-08)
2
+
3
+ ### Bug fixes
4
+
5
+ Properly handle bidirectional text in `posAtCoords`.
6
+
7
+ Avoid computing a zero character width (leading to divisions by zero) when the editor is hidden and the browser doesn't have a layout for it.
8
+
9
+ ### New features
10
+
11
+ The `posAndSideAtCoords` method is an extended version of `posAtCoords` that also tells you which side of the position the coordinates are associated with.
12
+
13
+ Add support for block wrappers, decoration-like things that allow extension code to create DOM nodes around groups of lines.
14
+
1
15
  ## 6.38.8 (2025-11-17)
2
16
 
3
17
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -3303,8 +3303,8 @@ class DocView {
3303
3303
  this.tile.dom.appendChild(dummy);
3304
3304
  let rect = clientRectsFor(dummy.firstChild)[0];
3305
3305
  lineHeight = dummy.getBoundingClientRect().height;
3306
- charWidth = rect ? rect.width / 27 : 7;
3307
- textHeight = rect ? rect.height : lineHeight;
3306
+ charWidth = rect && rect.width ? rect.width / 27 : 7;
3307
+ textHeight = rect && rect.height ? rect.height : lineHeight;
3308
3308
  dummy.remove();
3309
3309
  });
3310
3310
  return { lineHeight, charWidth, textHeight };
package/dist/index.js CHANGED
@@ -3299,8 +3299,8 @@ class DocView {
3299
3299
  this.tile.dom.appendChild(dummy);
3300
3300
  let rect = clientRectsFor(dummy.firstChild)[0];
3301
3301
  lineHeight = dummy.getBoundingClientRect().height;
3302
- charWidth = rect ? rect.width / 27 : 7;
3303
- textHeight = rect ? rect.height : lineHeight;
3302
+ charWidth = rect && rect.width ? rect.width / 27 : 7;
3303
+ textHeight = rect && rect.height ? rect.height : lineHeight;
3304
3304
  dummy.remove();
3305
3305
  });
3306
3306
  return { lineHeight, charWidth, textHeight };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.39.0-beta.5",
3
+ "version": "6.39.0",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",