@codemirror/view 6.39.7 → 6.39.8

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,11 @@
1
+ ## 6.39.8 (2025-12-30)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug that cause `coordsAtPos` to use the dimensions of widget buffers when there were more meaningful elements to use nearby.
6
+
7
+ Fix a data structure corruption that could cause crashes during viewport changes.
8
+
1
9
  ## 6.39.7 (2025-12-24)
2
10
 
3
11
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -2149,7 +2149,7 @@ class WidgetBufferTile extends Tile {
2149
2149
  img.setAttribute("aria-hidden", "true");
2150
2150
  super(img, 0, flags);
2151
2151
  }
2152
- get isHidden() { return false; }
2152
+ get isHidden() { return true; }
2153
2153
  get overrideDOMText() { return state.Text.empty; }
2154
2154
  coordsIn(pos) { return this.dom.getBoundingClientRect(); }
2155
2155
  }
@@ -2541,10 +2541,14 @@ class TileCache {
2541
2541
  widgets.splice(i, 1);
2542
2542
  if (i < this.index[0])
2543
2543
  this.index[0]--;
2544
- this.reused.set(tile, 1 /* Reused.Full */);
2545
- tile.length = length;
2546
- tile.flags = (tile.flags & ~(496 /* TileFlag.Widget */ | 1 /* TileFlag.BreakAfter */)) | flags;
2547
- return tile;
2544
+ if (tile.length == length && (tile.flags & (496 /* TileFlag.Widget */ | 1 /* TileFlag.BreakAfter */)) == flags) {
2545
+ this.reused.set(tile, 1 /* Reused.Full */);
2546
+ return tile;
2547
+ }
2548
+ else {
2549
+ this.reused.set(tile, 2 /* Reused.DOM */);
2550
+ return new WidgetTile(tile.dom, length, widget, (tile.flags & ~(496 /* TileFlag.Widget */ | 1 /* TileFlag.BreakAfter */)) | flags);
2551
+ }
2548
2552
  }
2549
2553
  }
2550
2554
  }
package/dist/index.js CHANGED
@@ -2145,7 +2145,7 @@ class WidgetBufferTile extends Tile {
2145
2145
  img.setAttribute("aria-hidden", "true");
2146
2146
  super(img, 0, flags);
2147
2147
  }
2148
- get isHidden() { return false; }
2148
+ get isHidden() { return true; }
2149
2149
  get overrideDOMText() { return Text.empty; }
2150
2150
  coordsIn(pos) { return this.dom.getBoundingClientRect(); }
2151
2151
  }
@@ -2537,10 +2537,14 @@ class TileCache {
2537
2537
  widgets.splice(i, 1);
2538
2538
  if (i < this.index[0])
2539
2539
  this.index[0]--;
2540
- this.reused.set(tile, 1 /* Reused.Full */);
2541
- tile.length = length;
2542
- tile.flags = (tile.flags & ~(496 /* TileFlag.Widget */ | 1 /* TileFlag.BreakAfter */)) | flags;
2543
- return tile;
2540
+ if (tile.length == length && (tile.flags & (496 /* TileFlag.Widget */ | 1 /* TileFlag.BreakAfter */)) == flags) {
2541
+ this.reused.set(tile, 1 /* Reused.Full */);
2542
+ return tile;
2543
+ }
2544
+ else {
2545
+ this.reused.set(tile, 2 /* Reused.DOM */);
2546
+ return new WidgetTile(tile.dom, length, widget, (tile.flags & ~(496 /* TileFlag.Widget */ | 1 /* TileFlag.BreakAfter */)) | flags);
2547
+ }
2544
2548
  }
2545
2549
  }
2546
2550
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.39.7",
3
+ "version": "6.39.8",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",