CodeMirror 5.56 + csslint update (#1014)

* CodeMirror 5.56

* csslint: Overscroll Behavior L1 (ED 2020-01-16)

* don't list rare/obsolete/future/existing css props
This commit is contained in:
tophf 2020-08-13 20:58:09 +03:00 committed by GitHub
parent 96c87fc55d
commit 3d94c641b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 29 additions and 92 deletions

View File

@ -105,92 +105,19 @@
} }
Object.assign(CodeMirror.mimeModes['text/css'].propertyKeywords, { Object.assign(CodeMirror.mimeModes['text/css'].propertyKeywords, {
// CSS Backgrounds and Borders Module L4
'background-position-x': true, 'background-position-x': true,
'background-position-y': true, 'background-position-y': true,
// CSS Logical Properties and Values L1
'block-size': true,
'border-block-color': true,
'border-block-end': true,
'border-block-end-color': true,
'border-block-end-style': true,
'border-block-end-width': true,
'border-block-start': true,
'border-block-start-color': true,
'border-block-start-style': true,
'border-block-start-width': true,
'border-block-style': true,
'border-block-width': true,
'border-inline-color': true,
'border-inline-end': true,
'border-inline-end-color': true,
'border-inline-end-style': true,
'border-inline-end-width': true,
'border-inline-start': true,
'border-inline-start-color': true,
'border-inline-start-style': true,
'border-inline-start-width': true,
'border-inline-style': true,
'border-inline-width': true,
'inline-size': true,
'inset': true,
'inset-block': true,
'inset-block-end': true,
'inset-block-start': true,
'inset-inline': true,
'inset-inline-end': true,
'inset-inline-start': true,
'margin-block': true,
'margin-block-end': true,
'margin-block-start': true,
'margin-inline': true,
'margin-inline-end': true,
'margin-inline-start': true,
'max-block-size': true,
'max-inline-size': true,
'min-block-size': true,
'min-inline-size': true,
'padding-block': true,
'padding-block-end': true,
'padding-block-start': true,
'padding-inline': true,
'padding-inline-end': true,
'padding-inline-start': true,
'text-align-all': true,
'contain': true, 'contain': true,
'mask-image': true, 'mask-image': true,
'mix-blend-mode': true, 'mix-blend-mode': true,
'overscroll-behavior': true,
'rotate': true, 'rotate': true,
'isolation': true, 'isolation': true,
'zoom': true,
// https://www.w3.org/TR/css-round-display-1/
'border-boundary': true,
'shape': true,
'shape-inside': true,
'viewport-fit': true,
// nonstandard https://compat.spec.whatwg.org/
'box-reflect': true,
'text-fill-color': true,
'text-stroke': true,
'text-stroke-color': true,
'text-stroke-width': true,
// end
});
Object.assign(CodeMirror.mimeModes['text/css'].valueKeywords, {
'isolate': true,
'rect': true,
'recto': true,
'verso': true,
}); });
Object.assign(CodeMirror.mimeModes['text/css'].colorKeywords, { Object.assign(CodeMirror.mimeModes['text/css'].colorKeywords, {
'darkgrey': true, 'darkgrey': true,
'darkslategrey': true, 'darkslategrey': true,
'dimgrey': true, 'dimgrey': true,
'grey': true,
'lightgrey': true, 'lightgrey': true,
'lightslategrey': true, 'lightslategrey': true,
'slategrey': true, 'slategrey': true,

6
package-lock.json generated
View File

@ -1917,9 +1917,9 @@
"dev": true "dev": true
}, },
"codemirror": { "codemirror": {
"version": "5.54.0", "version": "5.56.0",
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.54.0.tgz", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.56.0.tgz",
"integrity": "sha512-Pgf3surv4zvw+KaW3doUU7pGjF0BPU8/sj7eglWJjzni46U/DDW8pu3nZY0QgQKUcICDXRkq8jZmq0y6KhxM3Q==" "integrity": "sha512-MfKVmYgifXjQpLSgpETuih7A7WTTIsxvKfSLGseTY5+qt0E1UD1wblZGM6WLenORo8sgmf+3X+WTe2WF7mufyw=="
}, },
"collection-visit": { "collection-visit": {
"version": "1.0.0", "version": "1.0.0",

View File

@ -6,7 +6,7 @@
"repository": "openstyles/stylus", "repository": "openstyles/stylus",
"author": "Stylus Team", "author": "Stylus Team",
"dependencies": { "dependencies": {
"codemirror": "^5.54.0", "codemirror": "^5.56.0",
"db-to-cloud": "^0.4.5", "db-to-cloud": "^0.4.5",
"jsonlint": "^1.6.3", "jsonlint": "^1.6.3",
"less-bundle": "github:openstyles/less-bundle#v0.1.0", "less-bundle": "github:openstyles/less-bundle#v0.1.0",

View File

@ -514,6 +514,11 @@ self.parserlib = (() => {
'overflow-wrap': 'normal | break-word | anywhere', 'overflow-wrap': 'normal | break-word | anywhere',
'overflow-x': '<overflow>', 'overflow-x': '<overflow>',
'overflow-y': '<overflow>', 'overflow-y': '<overflow>',
'overscroll-behavior': '<overscroll>{1,2}',
'overscroll-behavior-block': '<overscroll>',
'overscroll-behavior-inline': '<overscroll>',
'overscroll-behavior-x': '<overscroll>',
'overscroll-behavior-y': '<overscroll>',
// P // P
'padding': '<padding-width>{1,4}', 'padding': '<padding-width>{1,4}',
@ -1062,6 +1067,8 @@ self.parserlib = (() => {
'<hsl-color>': '[ <number> | <angle> ] <percentage>{2} [ / <nonnegative-number-or-percentage> ]? | ' + '<hsl-color>': '[ <number> | <angle> ] <percentage>{2} [ / <nonnegative-number-or-percentage> ]? | ' +
'[ <number> | <angle> ] , <percentage>#{2} [ , <nonnegative-number-or-percentage> ]?', '[ <number> | <angle> ] , <percentage>#{2} [ , <nonnegative-number-or-percentage> ]?',
'<overscroll>': 'contain | none | auto',
'<shadow>': 'inset? && [ <length>{2,4} && <color>? ]', '<shadow>': 'inset? && [ <length>{2,4} && <color>? ]',
'<single-timing-function>': 'linear | <cubic-bezier-timing-function> | <step-timing-function> | frames()', '<single-timing-function>': 'linear | <cubic-bezier-timing-function> | <step-timing-function> | frames()',

View File

@ -1,4 +1,4 @@
## codemirror v5.54.0 ## codemirror v5.56.0
Following files are copied from npm (node_modules): Following files are copied from npm (node_modules):

View File

@ -379,12 +379,14 @@
}, },
scrollToActive: function() { scrollToActive: function() {
var node = this.hints.childNodes[this.selectedHint] var margin = this.completion.options.scrollMargin || 0;
var node1 = this.hints.childNodes[Math.max(0, this.selectedHint - margin)];
var node2 = this.hints.childNodes[Math.min(this.data.list.length - 1, this.selectedHint + margin)];
var firstNode = this.hints.firstChild; var firstNode = this.hints.firstChild;
if (node.offsetTop < this.hints.scrollTop) if (node1.offsetTop < this.hints.scrollTop)
this.hints.scrollTop = node.offsetTop - firstNode.offsetTop; this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;
else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + firstNode.offsetTop; this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop;
}, },
screenAmount: function() { screenAmount: function() {

View File

@ -3203,7 +3203,7 @@
vim.visualMode = false; vim.visualMode = false;
vim.visualLine = false; vim.visualLine = false;
vim.visualBlock = false; vim.visualBlock = false;
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); if (!vim.insertMode) CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
clearFakeCursor(vim); clearFakeCursor(vim);
} }

View File

@ -2960,7 +2960,7 @@
var x, y, space = display.lineSpace.getBoundingClientRect(); var x, y, space = display.lineSpace.getBoundingClientRect();
// Fails unpredictably on IE[67] when mouse is dragged around quickly. // Fails unpredictably on IE[67] when mouse is dragged around quickly.
try { x = e.clientX - space.left; y = e.clientY - space.top; } try { x = e.clientX - space.left; y = e.clientY - space.top; }
catch (e) { return null } catch (e$1) { return null }
var coords = coordsChar(cm, x, y), line; var coords = coordsChar(cm, x, y), line;
if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;
@ -6545,7 +6545,7 @@
cm.display.input.focus(); cm.display.input.focus();
} }
} }
catch(e){} catch(e$1){}
} }
} }
@ -7597,7 +7597,7 @@
mY = e.touches[0].clientY; mY = e.touches[0].clientY;
} else { } else {
try { mX = e.clientX; mY = e.clientY; } try { mX = e.clientX; mY = e.clientY; }
catch(e) { return false } catch(e$1) { return false }
} }
if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
if (prevent) { e_preventDefault(e); } if (prevent) { e_preventDefault(e); }
@ -7697,7 +7697,7 @@
for (var i = newBreaks.length - 1; i >= 0; i--) for (var i = newBreaks.length - 1; i >= 0; i--)
{ replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); } { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }
}); });
option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
if (old != Init) { cm.refresh(); } if (old != Init) { cm.refresh(); }
}); });
@ -8117,7 +8117,7 @@
{ from = Pos(from.line, from.ch - deleted); } { from = Pos(from.line, from.ch - deleted); }
else if (cm.state.overwrite && !paste) // Handle overwrite else if (cm.state.overwrite && !paste) // Handle overwrite
{ to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); } { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }
else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n"))
{ from = to = Pos(from.line, 0); } { from = to = Pos(from.line, 0); }
} }
var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,
@ -9771,7 +9771,7 @@
addLegacyProps(CodeMirror); addLegacyProps(CodeMirror);
CodeMirror.version = "5.54.0"; CodeMirror.version = "5.56.0";
return CodeMirror; return CodeMirror;

View File

@ -103,7 +103,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return ret("meta", "meta"); return ret("meta", "meta");
} else if (ch == "#" && stream.eatWhile(wordRE)) { } else if (ch == "#" && stream.eatWhile(wordRE)) {
return ret("variable", "property") return ret("variable", "property")
} else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->")) { } else if (ch == "<" && stream.match("!--") ||
(ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start)))) {
stream.skipToEnd() stream.skipToEnd()
return ret("comment", "comment") return ret("comment", "comment")
} else if (isOperatorChar.test(ch)) { } else if (isOperatorChar.test(ch)) {