@codemirror/view 6.24.0 → 6.24.1

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,9 @@
1
+ ## 6.24.1 (2024-02-19)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a crash that happens when hover tooltips are active during changes, introduced in 6.24.0.
6
+
1
7
  ## 6.24.0 (2024-02-09)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -9811,6 +9811,7 @@ function hoverTooltip(source, options = {}) {
9811
9811
  else if (options.hideOn)
9812
9812
  value = value.filter(v => !options.hideOn(tr, v));
9813
9813
  if (tr.docChanged) {
9814
+ let mapped = [];
9814
9815
  for (let tooltip of value) {
9815
9816
  let newPos = tr.changes.mapPos(tooltip.pos, -1, state.MapMode.TrackDel);
9816
9817
  if (newPos != null) {
@@ -9818,8 +9819,10 @@ function hoverTooltip(source, options = {}) {
9818
9819
  copy.pos = newPos;
9819
9820
  if (copy.end != null)
9820
9821
  copy.end = tr.changes.mapPos(copy.end);
9822
+ mapped.push(copy);
9821
9823
  }
9822
9824
  }
9825
+ value = mapped;
9823
9826
  }
9824
9827
  }
9825
9828
  for (let effect of tr.effects) {
package/dist/index.js CHANGED
@@ -9806,6 +9806,7 @@ function hoverTooltip(source, options = {}) {
9806
9806
  else if (options.hideOn)
9807
9807
  value = value.filter(v => !options.hideOn(tr, v));
9808
9808
  if (tr.docChanged) {
9809
+ let mapped = [];
9809
9810
  for (let tooltip of value) {
9810
9811
  let newPos = tr.changes.mapPos(tooltip.pos, -1, MapMode.TrackDel);
9811
9812
  if (newPos != null) {
@@ -9813,8 +9814,10 @@ function hoverTooltip(source, options = {}) {
9813
9814
  copy.pos = newPos;
9814
9815
  if (copy.end != null)
9815
9816
  copy.end = tr.changes.mapPos(copy.end);
9817
+ mapped.push(copy);
9816
9818
  }
9817
9819
  }
9820
+ value = mapped;
9818
9821
  }
9819
9822
  }
9820
9823
  for (let effect of tr.effects) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.24.0",
3
+ "version": "6.24.1",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",