Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codemirror

Package Overview
Dependencies
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codemirror - npm Package Compare versions

Comparing version 4.2.0 to 4.3.0

12

addon/dialog/dialog.js

@@ -41,6 +41,10 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

var closed = false, me = this;
function close() {
if (closed) return;
closed = true;
dialog.parentNode.removeChild(dialog);
function close(newVal) {
if (typeof newVal == 'string') {
inp.value = newVal;
} else {
if (closed) return;
closed = true;
dialog.parentNode.removeChild(dialog);
}
}

@@ -47,0 +51,0 @@ var inp = dialog.getElementsByTagName("input")[0], button;

@@ -46,3 +46,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

col = conf.column;
if (conf.className) elt.className = " " + conf.className;
if (conf.className) elt.className += " " + conf.className;
if (conf.color) elt.style.borderColor = conf.color;

@@ -49,0 +49,0 @@ if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle;

@@ -14,3 +14,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

var listRE = /^(\s*)([*+-]|(\d+)\.)(\s*)/,
var listRE = /^(\s*)([*+-]|(\d+)\.)(\s+)/,
unorderedBullets = "*+-";

@@ -17,0 +17,0 @@

@@ -61,3 +61,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

var elt = document.createElement("div");
elt.className = spec;
elt.className = spec + " CodeMirror-guttermarker-subtle";
return elt;

@@ -64,0 +64,0 @@ } else {

@@ -71,6 +71,13 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

prefix = token.string;
var n = 0;
if (/['"]/.test(token.string.charAt(0))) {
quote = token.string.charAt(0);
prefix = token.string.slice(1);
n++;
}
var len = token.string.length;
if (/['"]/.test(token.string.charAt(len - 1))) {
quote = token.string.charAt(len - 1);
prefix = token.string.substr(n, len - 2);
}
replaceToken = true;

@@ -77,0 +84,0 @@ }

@@ -52,3 +52,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

for (var i = 0; i < ranges.length; i++) {
var line = cm.getLineHandleVisualStart(ranges[i].head.line);
var range = ranges[i];
if (!range.empty()) continue;
var line = cm.getLineHandleVisualStart(range.head.line);
if (active[active.length - 1] != line) active.push(line);

@@ -55,0 +57,0 @@ }

@@ -109,3 +109,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

showType: function(cm, pos) { showType(this, cm, pos); },
showType: function(cm, pos, c) { showType(this, cm, pos, c); },

@@ -243,3 +243,3 @@ updateArgHints: function(cm) { updateArgHints(this, cm); },

function showType(ts, cm, pos) {
function showType(ts, cm, pos, c) {
ts.request(cm, "type", function(error, data) {

@@ -259,2 +259,3 @@ if (error) return showError(ts, cm, error);

tempTooltip(cm, tip);
if (c) c();
}, pos);

@@ -261,0 +262,0 @@ }

{
"name": "CodeMirror",
"version":"4.3.0",
"main": ["lib/codemirror.js", "lib/codemirror.css"],

@@ -4,0 +5,0 @@ "ignore": [

@@ -210,3 +210,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

if (stream.match(/(R|u8R|uR|UR|LR)/)) {
var match = stream.match(/"(.{0,16})\(/);
var match = stream.match(/"([^\s\\()]{0,16})\(/);
if (!match) {

@@ -246,9 +246,9 @@ return false;

function tokenRawString(stream, state) {
var closingSequence = new RegExp(".*?\\)" + state.cpp11RawStringDelim + '"');
var match = stream.match(closingSequence);
if (match) {
// Escape characters that have special regex meanings.
var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
if (match)
state.tokenize = null;
} else {
else
stream.skipToEnd();
}
return "string";

@@ -255,0 +255,0 @@ }

@@ -494,4 +494,4 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

"papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
"purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon",
"sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
"purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
"salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
"slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",

@@ -663,3 +663,3 @@ "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",

":": function(stream) {
if (stream.match(/\s*{/))
if (stream.match(/\s*\{/))
return [null, "{"];

@@ -666,0 +666,0 @@ return false;

@@ -65,3 +65,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor"]);
var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "false", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
var operatorChars = /[*+\-<>=&|~%^]/;

@@ -68,0 +68,0 @@

@@ -241,3 +241,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

// (Less wasteful than consing up a hundred closures on every call.)
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;

@@ -347,3 +347,3 @@ if (!state.lexical.hasOwnProperty("align"))

if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex);
if (type == "class") return cont(pushlex("form"), className, objlit, poplex);
if (type == "class") return cont(pushlex("form"), className, poplex);
if (type == "export") return cont(pushlex("form"), afterExport, poplex);

@@ -435,11 +435,14 @@ if (type == "import") return cont(pushlex("form"), afterImport, poplex);

function objprop(type, value) {
if (type == "variable") {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
if (value == "get" || value == "set") return cont(getterSetter);
return cont(afterprop);
} else if (type == "number" || type == "string") {
cx.marked = jsonldMode ? "property" : (type + " property");
cx.marked = jsonldMode ? "property" : (cx.style + " property");
return cont(afterprop);
} else if (type == "jsonld-keyword") {
return cont(afterprop);
} else if (type == "[") {
return cont(expression, expect("]"), afterprop);
}
if (atomicTypes.hasOwnProperty(type)) return cont(afterprop);
}

@@ -543,8 +546,24 @@ function getterSetter(type) {

}
function classNameAfter(_type, value) {
if (value == "extends") return cont(expression);
function classNameAfter(type, value) {
if (value == "extends") return cont(expression, classNameAfter);
if (type == "{") return cont(pushlex("}"), classBody, poplex);
}
function objlit(type) {
if (type == "{") return contCommasep(objprop, "}");
function classBody(type, value) {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody);
return cont(functiondef, classBody);
}
if (value == "*") {
cx.marked = "keyword";
return cont(classBody);
}
if (type == ";") return cont(classBody);
if (type == "}") return cont();
}
function classGetterSetter(type) {
if (type != "variable") return pass();
cx.marked = "property";
return cont();
}
function afterModule(type, value) {

@@ -660,2 +679,3 @@ if (type == "string") return cont(statement);

CodeMirror.defineMIME("application/javascript", "javascript");
CodeMirror.defineMIME("application/x-javascript", "javascript");
CodeMirror.defineMIME("application/ecmascript", "javascript");

@@ -662,0 +682,0 @@ CodeMirror.defineMIME("application/json", {name: "javascript", json: true});

@@ -20,5 +20,13 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

MT("class_body",
"[keyword class] [variable Foo] {",
" [property constructor]() {}",
" [property sayName]() {",
" [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];",
" }",
"}");
MT("class",
"[keyword class] [variable Point] [keyword extends] [variable SuperThing] {",
" [[ [string-2 /expr/] ]]: [number 24],",
" [property get] [property prop]() { [keyword return] [number 24]; }",
" [property constructor]([def x], [def y]) {",

@@ -25,0 +33,0 @@ " [keyword super]([string 'something']);",

@@ -323,4 +323,6 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

return scope.align - (closing ? 1 : 0);
else if (closing && state.scopes.length > 1)
return state.scopes[state.scopes.length - 2].offset;
else
return scope.offset - (closing ? conf.indentUnit : 0);
return scope.offset;
},

@@ -327,0 +329,0 @@

{
"name": "codemirror",
"version":"4.2.0",
"version":"4.3.0",
"main": "lib/codemirror.js",

@@ -5,0 +5,0 @@ "description": "In-browser code editing made bearable",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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