@codemirror/autocomplete
Advanced tools
Comparing version 0.18.2 to 0.18.3
@@ -0,1 +1,7 @@ | ||
## 0.18.3 (2021-03-15) | ||
### Bug fixes | ||
Adjust to updated @codemirror/tooltip interface. | ||
## 0.18.2 (2021-03-14) | ||
@@ -2,0 +8,0 @@ |
@@ -1,4 +0,4 @@ | ||
import { showTooltip, tooltips } from '@codemirror/tooltip'; | ||
import { Facet, combineConfig, StateEffect, StateField, Transaction, Text, EditorSelection, Prec, CharCategory } from '@codemirror/state'; | ||
import { EditorView, Direction, logException, ViewPlugin, Decoration, WidgetType, keymap } from '@codemirror/view'; | ||
import { showTooltip } from '@codemirror/tooltip'; | ||
import { syntaxTree, indentUnit } from '@codemirror/language'; | ||
@@ -475,2 +475,3 @@ import { codePointAt, codePointSize, fromCodePoint } from '@codemirror/text'; | ||
this.dom = document.createElement("div"); | ||
this.dom.className = "cm-tooltip-autocomplete"; | ||
this.dom.addEventListener("mousedown", (e) => { | ||
@@ -635,10 +636,9 @@ for (let dom = e.target, match; dom && dom != this.dom; dom = dom.parentNode) { | ||
} | ||
return new CompletionDialog(options, makeAttrs(id, selected), [{ | ||
pos: active.reduce((a, b) => b.hasResult() ? Math.min(a, b.from) : a, 1e8), | ||
class: "cm-tooltip-autocomplete", | ||
create: completionTooltip(completionState) | ||
}], prev ? prev.timestamp : Date.now(), selected); | ||
return new CompletionDialog(options, makeAttrs(id, selected), { | ||
pos: active.reduce((a, b) => b.hasResult() ? Math.min(a, b.from) : a, 1e8), | ||
create: completionTooltip(completionState) | ||
}, prev ? prev.timestamp : Date.now(), selected); | ||
} | ||
map(changes) { | ||
return new CompletionDialog(this.options, this.attrs, [Object.assign(Object.assign({}, this.tooltip[0]), { pos: changes.mapPos(this.tooltip[0].pos) })], this.timestamp, this.selected); | ||
return new CompletionDialog(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: changes.mapPos(this.tooltip.pos) }), this.timestamp, this.selected); | ||
} | ||
@@ -675,3 +675,3 @@ } | ||
} | ||
get tooltip() { return this.open ? this.open.tooltip : none; } | ||
get tooltip() { return this.open ? this.open.tooltip : null; } | ||
get attrs() { return this.open ? this.open.attrs : baseAttrs; } | ||
@@ -780,3 +780,3 @@ } | ||
provide: f => [ | ||
showTooltip.computeN([f], state => state.field(f).tooltip), | ||
showTooltip.from(f, val => val.tooltip), | ||
EditorView.contentAttributes.from(f, state => state.attrs) | ||
@@ -1255,4 +1255,3 @@ ] | ||
completionKeymapExt, | ||
baseTheme, | ||
tooltips() | ||
baseTheme | ||
]; | ||
@@ -1259,0 +1258,0 @@ } |
{ | ||
"name": "@codemirror/autocomplete", | ||
"version": "0.18.2", | ||
"version": "0.18.3", | ||
"description": "Autocompletion for the CodeMirror code editor", | ||
@@ -32,3 +32,3 @@ "scripts": { | ||
"@codemirror/text": "^0.18.0", | ||
"@codemirror/tooltip": "^0.18.0", | ||
"@codemirror/tooltip": "^0.18.4", | ||
"@codemirror/view": "^0.18.0", | ||
@@ -35,0 +35,0 @@ "lezer-tree": "^0.13.0" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122390
2873
Updated@codemirror/tooltip@^0.18.4