@codemirror/autocomplete 6.3.2 → 6.3.4

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.3.4 (2022-11-24)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix an issue where completion lists could end up being higher than the tooltip they were in.
6
+
7
+ ## 6.3.3 (2022-11-18)
8
+
9
+ ### Bug fixes
10
+
11
+ Set an explicit `box-sizing` style on completion icons so CSS resets don't mess them up.
12
+
13
+ Allow closing braces in templates to be escaped with a backslash.
14
+
1
15
  ## 6.3.2 (2022-11-15)
2
16
 
3
17
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -1070,6 +1070,7 @@ const baseTheme = view.EditorView.baseTheme({
1070
1070
  maxWidth: "min(700px, 95vw)",
1071
1071
  minWidth: "250px",
1072
1072
  maxHeight: "10em",
1073
+ height: "100%",
1073
1074
  listStyle: "none",
1074
1075
  margin: 0,
1075
1076
  padding: 0,
@@ -1136,7 +1137,8 @@ const baseTheme = view.EditorView.baseTheme({
1136
1137
  display: "inline-block",
1137
1138
  textAlign: "center",
1138
1139
  paddingRight: ".6em",
1139
- opacity: "0.6"
1140
+ opacity: "0.6",
1141
+ boxSizing: "content-box"
1140
1142
  },
1141
1143
  ".cm-completionIcon-function, .cm-completionIcon-method": {
1142
1144
  "&:after": { content: "'ƒ'" }
@@ -1238,8 +1240,8 @@ class Snippet {
1238
1240
  positions.push(new FieldPos(found, lines.length, m.index, m.index + name.length));
1239
1241
  line = line.slice(0, m.index) + name + line.slice(m.index + m[0].length);
1240
1242
  }
1241
- for (let esc; esc = /([$#])\\{/.exec(line);) {
1242
- line = line.slice(0, esc.index) + esc[1] + "{" + line.slice(esc.index + esc[0].length);
1243
+ for (let esc; esc = /\\([{}])/.exec(line);) {
1244
+ line = line.slice(0, esc.index) + esc[1] + line.slice(esc.index + esc[0].length);
1243
1245
  for (let pos of positions)
1244
1246
  if (pos.line == lines.length && pos.from > esc.index) {
1245
1247
  pos.from--;
@@ -1330,10 +1332,9 @@ The order of fields defaults to textual order, but you can add
1330
1332
  numbers to placeholders (`${1}` or `${1:defaultText}`) to provide
1331
1333
  a custom order.
1332
1334
 
1333
- To include a literal `${` or `#{` in your template, put a
1334
- backslash after the dollar or hash and before the brace (`$\\{`).
1335
- This will be removed and the sequence will not be interpreted as a
1336
- placeholder.
1335
+ To include a literal `{` or `}` in your template, put a backslash
1336
+ in front of it. This will be removed and the brace will not be
1337
+ interpreted as indicating a placeholder.
1337
1338
  */
1338
1339
  function snippet(template) {
1339
1340
  let snippet = Snippet.parse(template);
package/dist/index.d.ts CHANGED
@@ -326,10 +326,9 @@ The order of fields defaults to textual order, but you can add
326
326
  numbers to placeholders (`${1}` or `${1:defaultText}`) to provide
327
327
  a custom order.
328
328
 
329
- To include a literal `${` or `#{` in your template, put a
330
- backslash after the dollar or hash and before the brace (`$\\{`).
331
- This will be removed and the sequence will not be interpreted as a
332
- placeholder.
329
+ To include a literal `{` or `}` in your template, put a backslash
330
+ in front of it. This will be removed and the brace will not be
331
+ interpreted as indicating a placeholder.
333
332
  */
334
333
  declare function snippet(template: string): (editor: {
335
334
  state: EditorState;
package/dist/index.js CHANGED
@@ -1066,6 +1066,7 @@ const baseTheme = /*@__PURE__*/EditorView.baseTheme({
1066
1066
  maxWidth: "min(700px, 95vw)",
1067
1067
  minWidth: "250px",
1068
1068
  maxHeight: "10em",
1069
+ height: "100%",
1069
1070
  listStyle: "none",
1070
1071
  margin: 0,
1071
1072
  padding: 0,
@@ -1132,7 +1133,8 @@ const baseTheme = /*@__PURE__*/EditorView.baseTheme({
1132
1133
  display: "inline-block",
1133
1134
  textAlign: "center",
1134
1135
  paddingRight: ".6em",
1135
- opacity: "0.6"
1136
+ opacity: "0.6",
1137
+ boxSizing: "content-box"
1136
1138
  },
1137
1139
  ".cm-completionIcon-function, .cm-completionIcon-method": {
1138
1140
  "&:after": { content: "'ƒ'" }
@@ -1234,8 +1236,8 @@ class Snippet {
1234
1236
  positions.push(new FieldPos(found, lines.length, m.index, m.index + name.length));
1235
1237
  line = line.slice(0, m.index) + name + line.slice(m.index + m[0].length);
1236
1238
  }
1237
- for (let esc; esc = /([$#])\\{/.exec(line);) {
1238
- line = line.slice(0, esc.index) + esc[1] + "{" + line.slice(esc.index + esc[0].length);
1239
+ for (let esc; esc = /\\([{}])/.exec(line);) {
1240
+ line = line.slice(0, esc.index) + esc[1] + line.slice(esc.index + esc[0].length);
1239
1241
  for (let pos of positions)
1240
1242
  if (pos.line == lines.length && pos.from > esc.index) {
1241
1243
  pos.from--;
@@ -1326,10 +1328,9 @@ The order of fields defaults to textual order, but you can add
1326
1328
  numbers to placeholders (`${1}` or `${1:defaultText}`) to provide
1327
1329
  a custom order.
1328
1330
 
1329
- To include a literal `${` or `#{` in your template, put a
1330
- backslash after the dollar or hash and before the brace (`$\\{`).
1331
- This will be removed and the sequence will not be interpreted as a
1332
- placeholder.
1331
+ To include a literal `{` or `}` in your template, put a backslash
1332
+ in front of it. This will be removed and the brace will not be
1333
+ interpreted as indicating a placeholder.
1333
1334
  */
1334
1335
  function snippet(template) {
1335
1336
  let snippet = Snippet.parse(template);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/autocomplete",
3
- "version": "6.3.2",
3
+ "version": "6.3.4",
4
4
  "description": "Autocompletion for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@codemirror/language": "^6.0.0",
30
30
  "@codemirror/state": "^6.0.0",
31
- "@codemirror/view": "^6.5.0",
31
+ "@codemirror/view": "^6.6.0",
32
32
  "@lezer/common": "^1.0.0"
33
33
  },
34
34
  "peerDependencies": {