Socket
Socket
Sign inDemoInstall

@codemirror/autocomplete

Package Overview
Dependencies
Maintainers
2
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/autocomplete - npm Package Compare versions

Comparing version 0.17.3 to 0.17.4

10

CHANGELOG.md

@@ -0,1 +1,11 @@

## 0.17.4 (2021-01-18)
### Bug fixes
Fix a styling issue where the selection had become invisible inside snippet fields (when using `drawSelection`).
### New features
Snippet fields can now be selected with the pointing device (so that they are usable on touch devices).
## 0.17.3 (2021-01-18)

@@ -2,0 +12,0 @@

21

dist/index.js

@@ -308,4 +308,4 @@ import { showTooltip, tooltips } from '@codemirror/tooltip';

"$tooltip.completionInfo.right": { left: "100%" },
"$$light $snippetField": { backgroundColor: "#ddd" },
"$$dark $snippetField": { backgroundColor: "#333" },
"$$light $snippetField": { backgroundColor: "#00000022" },
"$$dark $snippetField": { backgroundColor: "#ffffff22" },
"$snippetFieldPosition": {

@@ -1084,3 +1084,3 @@ verticalAlign: "text-top",

if (editor.state.field(snippetState, false) === undefined)
spec.reconfigure = { append: [snippetState, addSnippetKeymap, baseTheme] };
spec.reconfigure = { append: [snippetState, addSnippetKeymap, snippetPointerHandler, baseTheme] };
}

@@ -1134,2 +1134,17 @@ editor.dispatch(editor.state.update(spec));

}
const snippetPointerHandler = EditorView.domEventHandlers({
mousedown(event, view) {
let active = view.state.field(snippetState, false), pos;
if (!active || (pos = view.posAtCoords({ x: event.clientX, y: event.clientY })) == null)
return false;
let match = active.ranges.find(r => r.from <= pos && r.to >= pos);
if (!match || match.field == active.active)
return false;
view.dispatch({
selection: fieldSelection(active.ranges, match.field),
effects: setActive.of(active.ranges.some(r => r.field > match.field) ? new ActiveSnippet(active.ranges, match.field) : null)
});
return true;
}
});

@@ -1136,0 +1151,0 @@ /// A completion source that will scan the document for words (using a

2

package.json
{
"name": "@codemirror/autocomplete",
"version": "0.17.3",
"version": "0.17.4",
"description": "Autocompletion for the CodeMirror code editor",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc