@codemirror/autocomplete 0.20.3 → 6.0.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,9 @@
1
+ ## 6.0.0 (2022-06-08)
2
+
3
+ ### Bug fixes
4
+
5
+ Scroll the cursor into view when inserting a snippet.
6
+
1
7
  ## 0.20.3 (2022-05-30)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -1269,7 +1269,10 @@ function snippet(template) {
1269
1269
  let snippet = Snippet.parse(template);
1270
1270
  return (editor, _completion, from, to) => {
1271
1271
  let { text, ranges } = snippet.instantiate(editor.state, from);
1272
- let spec = { changes: { from, to, insert: state.Text.of(text) } };
1272
+ let spec = {
1273
+ changes: { from, to, insert: state.Text.of(text) },
1274
+ scrollIntoView: true
1275
+ };
1273
1276
  if (ranges.length)
1274
1277
  spec.selection = fieldSelection(ranges, 0);
1275
1278
  if (ranges.length > 1) {
package/dist/index.js CHANGED
@@ -1265,7 +1265,10 @@ function snippet(template) {
1265
1265
  let snippet = Snippet.parse(template);
1266
1266
  return (editor, _completion, from, to) => {
1267
1267
  let { text, ranges } = snippet.instantiate(editor.state, from);
1268
- let spec = { changes: { from, to, insert: Text.of(text) } };
1268
+ let spec = {
1269
+ changes: { from, to, insert: Text.of(text) },
1270
+ scrollIntoView: true
1271
+ };
1269
1272
  if (ranges.length)
1270
1273
  spec.selection = fieldSelection(ranges, 0);
1271
1274
  if (ranges.length > 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/autocomplete",
3
- "version": "0.20.3",
3
+ "version": "6.0.0",
4
4
  "description": "Autocompletion for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",
@@ -26,10 +26,10 @@
26
26
  "sideEffects": false,
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@codemirror/language": "^0.20.0",
30
- "@codemirror/state": "^0.20.0",
31
- "@codemirror/view": "^0.20.0",
32
- "@lezer/common": "^0.16.0"
29
+ "@codemirror/language": "^6.0.0",
30
+ "@codemirror/state": "^6.0.0",
31
+ "@codemirror/view": "^6.0.0",
32
+ "@lezer/common": "^1.0.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@codemirror/buildhelper": "^0.1.5"