@codemirror/state 6.0.0 → 6.0.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.
@@ -11,6 +11,6 @@ jobs:
11
11
  with:
12
12
  # You should create a personal access token and store it in your repository
13
13
  token: ${{ secrets.DISPATCH_AUTH }}
14
- repo: codemirror.next
14
+ repo: dev
15
15
  owner: codemirror
16
16
  event_type: push
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 6.0.1 (2022-06-17)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a problem that caused effects' `map` methods to be called with an incorrect change set when filtering changes.
6
+
1
7
  ## 6.0.0 (2022-06-08)
2
8
 
3
9
  ### Breaking changes
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # @codemirror/state [![NPM version](https://img.shields.io/npm/v/@codemirror/state.svg)](https://www.npmjs.org/package/@codemirror/state)
2
2
 
3
- [ [**WEBSITE**](https://codemirror.net/6/) | [**DOCS**](https://codemirror.net/6/docs/ref/#state) | [**ISSUES**](https://github.com/codemirror/codemirror.next/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/state/blob/main/CHANGELOG.md) ]
3
+ [ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#state) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/state/blob/main/CHANGELOG.md) ]
4
4
 
5
5
  This package implements the editor state data structures for the
6
- [CodeMirror](https://codemirror.net/6/) code editor.
6
+ [CodeMirror](https://codemirror.net/) code editor.
7
7
 
8
- The [project page](https://codemirror.net/6/) has more information, a
9
- number of [examples](https://codemirror.net/6/examples/) and the
10
- [documentation](https://codemirror.net/6/docs/).
8
+ The [project page](https://codemirror.net/) has more information, a
9
+ number of [examples](https://codemirror.net/examples/) and the
10
+ [documentation](https://codemirror.net/docs/).
11
11
 
12
12
  This code is released under an
13
13
  [MIT license](https://github.com/codemirror/state/tree/main/LICENSE).
package/dist/index.cjs CHANGED
@@ -2439,7 +2439,7 @@ function filterTransaction(tr) {
2439
2439
  else {
2440
2440
  let filtered = tr.changes.filter(result);
2441
2441
  changes = filtered.changes;
2442
- back = filtered.filtered.invertedDesc;
2442
+ back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
2443
2443
  }
2444
2444
  tr = Transaction.create(state, changes, tr.selection && tr.selection.map(back), StateEffect.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView);
2445
2445
  }
@@ -2791,7 +2791,7 @@ class EditorState {
2791
2791
  if (i == "$")
2792
2792
  return "$";
2793
2793
  let n = +(i || 1);
2794
- return n > insert.length ? m : insert[n - 1];
2794
+ return !n || n > insert.length ? m : insert[n - 1];
2795
2795
  });
2796
2796
  return phrase;
2797
2797
  }
package/dist/index.js CHANGED
@@ -2434,7 +2434,7 @@ function filterTransaction(tr) {
2434
2434
  else {
2435
2435
  let filtered = tr.changes.filter(result);
2436
2436
  changes = filtered.changes;
2437
- back = filtered.filtered.invertedDesc;
2437
+ back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
2438
2438
  }
2439
2439
  tr = Transaction.create(state, changes, tr.selection && tr.selection.map(back), StateEffect.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView);
2440
2440
  }
@@ -2785,7 +2785,7 @@ class EditorState {
2785
2785
  if (i == "$")
2786
2786
  return "$";
2787
2787
  let n = +(i || 1);
2788
- return n > insert.length ? m : insert[n - 1];
2788
+ return !n || n > insert.length ? m : insert[n - 1];
2789
2789
  });
2790
2790
  return phrase;
2791
2791
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/state",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Editor state data structures for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",