update deps + split devdeps/deps (#953)

This commit is contained in:
tophf 2020-06-02 11:08:02 +03:00 committed by GitHub
parent 60d314b165
commit 015bda764a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 1559 additions and 1694 deletions

2779
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,26 +5,28 @@
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"repository": "openstyles/stylus", "repository": "openstyles/stylus",
"author": "Stylus Team", "author": "Stylus Team",
"devDependencies": { "dependencies": {
"archiver": "^3.1.1", "codemirror": "^5.54.0",
"codemirror": "^5.51.0",
"db-to-cloud": "^0.4.5", "db-to-cloud": "^0.4.5",
"endent": "^1.4.0",
"eslint": "^6.8.0",
"fs-extra": "^8.1.0",
"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",
"lz-string-unsafe": "^1.4.4-fork-1", "lz-string-unsafe": "^1.4.4-fork-1",
"make-fetch-happen": "^7.1.1",
"semver-bundle": "^0.1.1", "semver-bundle": "^0.1.1",
"shx": "^0.3.2",
"stylelint-bundle": "^8.0.0", "stylelint-bundle": "^8.0.0",
"stylus-lang-bundle": "^0.54.5", "stylus-lang-bundle": "^0.54.5",
"usercss-meta": "^0.9.0",
"uuid": "^8.1.0"
},
"devDependencies": {
"archiver": "^4.0.1",
"endent": "^1.4.0",
"eslint": "^7.1.0",
"fs-extra": "^9.0.0",
"make-fetch-happen": "^8.0.7",
"shx": "^0.3.2",
"sync-version": "^1.0.1", "sync-version": "^1.0.1",
"tiny-glob": "^0.2.6", "tiny-glob": "^0.2.6",
"usercss-meta": "^0.9.0", "web-ext": "^4.2.0",
"uuid": "^7.0.0-beta.0",
"web-ext": "^4.1.0",
"webext-tx-fix": "^0.3.3" "webext-tx-fix": "^0.3.3"
}, },
"scripts": { "scripts": {

View File

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

View File

@ -82,7 +82,9 @@
if (e.keyCode == 13) callback(inp.value, e); if (e.keyCode == 13) callback(inp.value, e);
}); });
if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close); if (options.closeOnBlur !== false) CodeMirror.on(dialog, "focusout", function (evt) {
if (evt.relatedTarget !== null) close();
});
} else if (button = dialog.getElementsByTagName("button")[0]) { } else if (button = dialog.getElementsByTagName("button")[0]) {
CodeMirror.on(button, "click", function() { CodeMirror.on(button, "click", function() {
close(); close();

View File

@ -118,16 +118,24 @@
} }
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) { CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) { function clear(cm) {
cm.off("cursorActivity", doMatchBrackets);
if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) { if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
cm.state.matchBrackets.currentlyHighlighted(); cm.state.matchBrackets.currentlyHighlighted();
cm.state.matchBrackets.currentlyHighlighted = null; cm.state.matchBrackets.currentlyHighlighted = null;
} }
} }
if (old && old != CodeMirror.Init) {
cm.off("cursorActivity", doMatchBrackets);
cm.off("focus", doMatchBrackets)
cm.off("blur", clear)
clear(cm);
}
if (val) { if (val) {
cm.state.matchBrackets = typeof val == "object" ? val : {}; cm.state.matchBrackets = typeof val == "object" ? val : {};
cm.on("cursorActivity", doMatchBrackets); cm.on("cursorActivity", doMatchBrackets);
cm.on("focus", doMatchBrackets)
cm.on("blur", clear)
} }
}); });

View File

@ -85,11 +85,16 @@
}, },
pick: function(data, i) { pick: function(data, i) {
var completion = data.list[i]; var completion = data.list[i], self = this;
if (completion.hint) completion.hint(this.cm, data, completion); this.cm.operation(function() {
else this.cm.replaceRange(getText(completion), completion.from || data.from, if (completion.hint)
completion.hint(self.cm, data, completion);
else
self.cm.replaceRange(getText(completion), completion.from || data.from,
completion.to || data.to, "complete"); completion.to || data.to, "complete");
CodeMirror.signal(data, "pick", completion); CodeMirror.signal(data, "pick", completion);
self.cm.scrollIntoView();
})
this.close(); this.close();
}, },
@ -99,9 +104,14 @@
this.debounce = 0; this.debounce = 0;
} }
var identStart = this.startPos;
if(this.data) {
identStart = this.data.from;
}
var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line); var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);
if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||
pos.ch < this.startPos.ch || this.cm.somethingSelected() || pos.ch < identStart.ch || this.cm.somethingSelected() ||
(!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
this.close(); this.close();
} else { } else {
@ -370,10 +380,11 @@
scrollToActive: function() { scrollToActive: function() {
var node = this.hints.childNodes[this.selectedHint] var node = this.hints.childNodes[this.selectedHint]
var firstNode = this.hints.firstChild;
if (node.offsetTop < this.hints.scrollTop) if (node.offsetTop < this.hints.scrollTop)
this.hints.scrollTop = node.offsetTop - 3; this.hints.scrollTop = node.offsetTop - firstNode.offsetTop;
else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3; this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + firstNode.offsetTop;
}, },
screenAmount: function() { screenAmount: function() {

View File

@ -12,10 +12,13 @@
"use strict"; "use strict";
var GUTTER_ID = "CodeMirror-lint-markers"; var GUTTER_ID = "CodeMirror-lint-markers";
function showTooltip(e, content) { function showTooltip(cm, e, content) {
var tt = document.createElement("div"); var tt = document.createElement("div");
tt.className = "CodeMirror-lint-tooltip"; tt.className = "CodeMirror-lint-tooltip cm-s-" + cm.options.theme;
tt.appendChild(content.cloneNode(true)); tt.appendChild(content.cloneNode(true));
if (cm.state.lint.options.selfContain)
cm.getWrapperElement().appendChild(tt);
else
document.body.appendChild(tt); document.body.appendChild(tt);
function position(e) { function position(e) {
@ -38,8 +41,8 @@
setTimeout(function() { rm(tt); }, 600); setTimeout(function() { rm(tt); }, 600);
} }
function showTooltipFor(e, content, node) { function showTooltipFor(cm, e, content, node) {
var tooltip = showTooltip(e, content); var tooltip = showTooltip(cm, e, content);
function hide() { function hide() {
CodeMirror.off(node, "mouseout", hide); CodeMirror.off(node, "mouseout", hide);
if (tooltip) { hideTooltip(tooltip); tooltip = null; } if (tooltip) { hideTooltip(tooltip); tooltip = null; }
@ -78,7 +81,7 @@
state.marked.length = 0; state.marked.length = 0;
} }
function makeMarker(labels, severity, multiple, tooltips) { function makeMarker(cm, labels, severity, multiple, tooltips) {
var marker = document.createElement("div"), inner = marker; var marker = document.createElement("div"), inner = marker;
marker.className = "CodeMirror-lint-marker-" + severity; marker.className = "CodeMirror-lint-marker-" + severity;
if (multiple) { if (multiple) {
@ -87,7 +90,7 @@
} }
if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) { if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
showTooltipFor(e, labels, inner); showTooltipFor(cm, e, labels, inner);
}); });
return marker; return marker;
@ -186,7 +189,7 @@
} }
if (state.hasGutter) if (state.hasGutter)
cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1, cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, anns.length > 1,
state.options.tooltips)); state.options.tooltips));
} }
if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm); if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
@ -199,14 +202,14 @@
state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500); state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
} }
function popupTooltips(annotations, e) { function popupTooltips(cm, annotations, e) {
var target = e.target || e.srcElement; var target = e.target || e.srcElement;
var tooltip = document.createDocumentFragment(); var tooltip = document.createDocumentFragment();
for (var i = 0; i < annotations.length; i++) { for (var i = 0; i < annotations.length; i++) {
var ann = annotations[i]; var ann = annotations[i];
tooltip.appendChild(annotationTooltip(ann)); tooltip.appendChild(annotationTooltip(ann));
} }
showTooltipFor(e, tooltip, target); showTooltipFor(cm, e, tooltip, target);
} }
function onMouseOver(cm, e) { function onMouseOver(cm, e) {
@ -220,7 +223,7 @@
var ann = spans[i].__annotation; var ann = spans[i].__annotation;
if (ann) annotations.push(ann); if (ann) annotations.push(ann);
} }
if (annotations.length) popupTooltips(annotations, e); if (annotations.length) popupTooltips(cm, annotations, e);
} }
CodeMirror.defineOption("lint", false, function(cm, val, old) { CodeMirror.defineOption("lint", false, function(cm, val, old) {

View File

@ -240,7 +240,7 @@
var result = this.matches(reverse, this.doc.clipPos(reverse ? this.pos.from : this.pos.to)) var result = this.matches(reverse, this.doc.clipPos(reverse ? this.pos.from : this.pos.to))
// Implements weird auto-growing behavior on null-matches for // Implements weird auto-growing behavior on null-matches for
// backwards-compatiblity with the vim code (unfortunately) // backwards-compatibility with the vim code (unfortunately)
while (result && CodeMirror.cmpPos(result.from, result.to) == 0) { while (result && CodeMirror.cmpPos(result.from, result.to) == 0) {
if (reverse) { if (reverse) {
if (result.from.ch) result.from = Pos(result.from.line, result.from.ch - 1) if (result.from.ch) result.from = Pos(result.from.line, result.from.ch - 1)

View File

@ -404,7 +404,8 @@
"Ctrl-X H": "selectAll", "Ctrl-X H": "selectAll",
"Ctrl-Q Tab": repeated("insertTab"), "Ctrl-Q Tab": repeated("insertTab"),
"Ctrl-U": addPrefixMap "Ctrl-U": addPrefixMap,
"fallthrough": "default"
}); });
var prefixMap = {"Ctrl-G": clearPrefix}; var prefixMap = {"Ctrl-G": clearPrefix};

View File

@ -628,6 +628,7 @@
"Cmd-K Cmd-C": "showInCenter", "Cmd-K Cmd-C": "showInCenter",
"Cmd-K Cmd-G": "clearBookmarks", "Cmd-K Cmd-G": "clearBookmarks",
"Cmd-K Cmd-Backspace": "delLineLeft", "Cmd-K Cmd-Backspace": "delLineLeft",
"Cmd-K Cmd-1": "foldAll",
"Cmd-K Cmd-0": "unfoldAll", "Cmd-K Cmd-0": "unfoldAll",
"Cmd-K Cmd-J": "unfoldAll", "Cmd-K Cmd-J": "unfoldAll",
"Ctrl-Shift-Up": "addCursorToPrevLine", "Ctrl-Shift-Up": "addCursorToPrevLine",
@ -689,6 +690,7 @@
"Ctrl-K Ctrl-C": "showInCenter", "Ctrl-K Ctrl-C": "showInCenter",
"Ctrl-K Ctrl-G": "clearBookmarks", "Ctrl-K Ctrl-G": "clearBookmarks",
"Ctrl-K Ctrl-Backspace": "delLineLeft", "Ctrl-K Ctrl-Backspace": "delLineLeft",
"Ctrl-K Ctrl-1": "foldAll",
"Ctrl-K Ctrl-0": "unfoldAll", "Ctrl-K Ctrl-0": "unfoldAll",
"Ctrl-K Ctrl-J": "unfoldAll", "Ctrl-K Ctrl-J": "unfoldAll",
"Ctrl-Alt-Up": "addCursorToPrevLine", "Ctrl-Alt-Up": "addCursorToPrevLine",

View File

@ -234,7 +234,6 @@
{ name: 'undo', shortName: 'u' }, { name: 'undo', shortName: 'u' },
{ name: 'redo', shortName: 'red' }, { name: 'redo', shortName: 'red' },
{ name: 'set', shortName: 'se' }, { name: 'set', shortName: 'se' },
{ name: 'set', shortName: 'se' },
{ name: 'setlocal', shortName: 'setl' }, { name: 'setlocal', shortName: 'setl' },
{ name: 'setglobal', shortName: 'setg' }, { name: 'setglobal', shortName: 'setg' },
{ name: 'sort', shortName: 'sor' }, { name: 'sort', shortName: 'sor' },
@ -295,16 +294,16 @@
clearFatCursorMark(cm); clearFatCursorMark(cm);
var ranges = cm.listSelections(), result = [] var ranges = cm.listSelections(), result = []
for (var i = 0; i < ranges.length; i++) { for (var i = 0; i < ranges.length; i++) {
var range = ranges[i] var range = ranges[i];
if (range.empty()) { if (range.empty()) {
if (range.anchor.ch < cm.getLine(range.anchor.line).length) { var lineLength = cm.getLine(range.anchor.line).length;
if (range.anchor.ch < lineLength) {
result.push(cm.markText(range.anchor, Pos(range.anchor.line, range.anchor.ch + 1), result.push(cm.markText(range.anchor, Pos(range.anchor.line, range.anchor.ch + 1),
{className: "cm-fat-cursor-mark"})) {className: "cm-fat-cursor-mark"}));
} else { } else {
var widget = document.createElement("span") result.push(cm.markText(Pos(range.anchor.line, lineLength - 1),
widget.textContent = "\u00a0" Pos(range.anchor.line, lineLength),
widget.className = "cm-fat-cursor-mark" {className: "cm-fat-cursor-mark"}));
result.push(cm.setBookmark(range.anchor, {widget: widget}))
} }
} }
} }
@ -1603,10 +1602,10 @@
} }
if (vim.visualMode) { if (vim.visualMode) {
if (!(vim.visualBlock && newHead.ch === Infinity)) { if (!(vim.visualBlock && newHead.ch === Infinity)) {
newHead = clipCursorToContent(cm, newHead, vim.visualBlock); newHead = clipCursorToContent(cm, newHead);
} }
if (newAnchor) { if (newAnchor) {
newAnchor = clipCursorToContent(cm, newAnchor, true); newAnchor = clipCursorToContent(cm, newAnchor);
} }
newAnchor = newAnchor || oldAnchor; newAnchor = newAnchor || oldAnchor;
sel.anchor = newAnchor; sel.anchor = newAnchor;
@ -2200,8 +2199,7 @@
vimGlobalState.registerController.pushText( vimGlobalState.registerController.pushText(
args.registerName, 'delete', text, args.registerName, 'delete', text,
args.linewise, vim.visualBlock); args.linewise, vim.visualBlock);
var includeLineBreak = vim.insertMode return clipCursorToContent(cm, finalHead);
return clipCursorToContent(cm, finalHead, includeLineBreak);
}, },
indent: function(cm, args, ranges) { indent: function(cm, args, ranges) {
var vim = cm.state.vim; var vim = cm.state.vim;
@ -2460,8 +2458,7 @@
vim.visualLine = !!actionArgs.linewise; vim.visualLine = !!actionArgs.linewise;
vim.visualBlock = !!actionArgs.blockwise; vim.visualBlock = !!actionArgs.blockwise;
head = clipCursorToContent( head = clipCursorToContent(
cm, Pos(anchor.line, anchor.ch + repeat - 1), cm, Pos(anchor.line, anchor.ch + repeat - 1));
true /** includeLineBreak */);
vim.sel = { vim.sel = {
anchor: anchor, anchor: anchor,
head: head head: head
@ -2837,10 +2834,11 @@
* Clips cursor to ensure that line is within the buffer's range * Clips cursor to ensure that line is within the buffer's range
* If includeLineBreak is true, then allow cur.ch == lineLength. * If includeLineBreak is true, then allow cur.ch == lineLength.
*/ */
function clipCursorToContent(cm, cur, includeLineBreak) { function clipCursorToContent(cm, cur) {
var vim = cm.state.vim;
var includeLineBreak = vim.insertMode || vim.visualMode;
var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() ); var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );
var maxCh = lineLength(cm, line) - 1; var maxCh = lineLength(cm, line) - 1 + !!includeLineBreak;
maxCh = (includeLineBreak) ? maxCh + 1 : maxCh;
var ch = Math.min(Math.max(0, cur.ch), maxCh); var ch = Math.min(Math.max(0, cur.ch), maxCh);
return Pos(line, ch); return Pos(line, ch);
} }
@ -3206,9 +3204,7 @@
vim.visualLine = false; vim.visualLine = false;
vim.visualBlock = false; vim.visualBlock = false;
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
if (vim.fakeCursor) { clearFakeCursor(vim);
vim.fakeCursor.clear();
}
} }
// Remove any trailing newlines from the selection. For // Remove any trailing newlines from the selection. For
@ -4186,7 +4182,8 @@
} }
function makePrompt(prefix, desc) { function makePrompt(prefix, desc) {
var raw = '<span style="font-family: monospace; white-space: pre">' + var raw = '<span style="font-family: monospace; white-space: pre">' +
(prefix || "") + '<input type="text"></span>'; (prefix || "") + '<input type="text" autocorrect="off" ' +
'autocapitalize="off" spellcheck="false"></span>';
if (desc) if (desc)
raw += ' <span style="color: #888">' + desc + '</span>'; raw += ' <span style="color: #888">' + desc + '</span>';
return raw; return raw;
@ -4459,7 +4456,7 @@
} }
// Parse command name. // Parse command name.
var commandMatch = inputStream.match(/^(\w+)/); var commandMatch = inputStream.match(/^(\w+|!!|@@|[!#&*<=>@~])/);
if (commandMatch) { if (commandMatch) {
result.commandName = commandMatch[1]; result.commandName = commandMatch[1];
} else { } else {
@ -5357,14 +5354,34 @@
updateFakeCursor(cm); updateFakeCursor(cm);
} }
} }
/**
* Keeps track of a fake cursor to support visual mode cursor behavior.
*/
function updateFakeCursor(cm) { function updateFakeCursor(cm) {
var className = 'cm-animate-fat-cursor';
var vim = cm.state.vim; var vim = cm.state.vim;
var from = clipCursorToContent(cm, copyCursor(vim.sel.head)); var from = clipCursorToContent(cm, copyCursor(vim.sel.head));
var to = offsetCursor(from, 0, 1); var to = offsetCursor(from, 0, 1);
clearFakeCursor(vim);
// In visual mode, the cursor may be positioned over EOL.
if (from.ch == cm.getLine(from.line).length) {
var widget = document.createElement("span");
widget.textContent = "\u00a0";
widget.className = className;
vim.fakeCursorBookmark = cm.setBookmark(from, {widget: widget});
} else {
vim.fakeCursor = cm.markText(from, to, {className: className});
}
}
function clearFakeCursor(vim) {
if (vim.fakeCursor) { if (vim.fakeCursor) {
vim.fakeCursor.clear(); vim.fakeCursor.clear();
vim.fakeCursor = null;
}
if (vim.fakeCursorBookmark) {
vim.fakeCursorBookmark.clear();
vim.fakeCursorBookmark = null;
} }
vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'});
} }
function handleExternalSelection(cm, vim) { function handleExternalSelection(cm, vim) {
var anchor = cm.getCursor('anchor'); var anchor = cm.getCursor('anchor');

View File

@ -164,17 +164,17 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
.CodeMirror-scroll { .CodeMirror-scroll {
overflow: scroll !important; /* Things will break if this is overridden */ overflow: scroll !important; /* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */ /* 50px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */ /* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-right: -30px; margin-bottom: -50px; margin-right: -50px;
padding-bottom: 30px; padding-bottom: 50px;
height: 100%; height: 100%;
outline: none; /* Prevent dragging from highlighting the element */ outline: none; /* Prevent dragging from highlighting the element */
position: relative; position: relative;
} }
.CodeMirror-sizer { .CodeMirror-sizer {
position: relative; position: relative;
border-right: 30px solid transparent; border-right: 50px solid transparent;
} }
/* The fake, visible scrollbars. Used to force redraw during scrolling /* The fake, visible scrollbars. Used to force redraw during scrolling
@ -212,7 +212,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
height: 100%; height: 100%;
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
margin-bottom: -30px; margin-bottom: -50px;
} }
.CodeMirror-gutter-wrapper { .CodeMirror-gutter-wrapper {
position: absolute; position: absolute;

View File

@ -204,7 +204,7 @@
} }
// Number of pixels added to scroller and sizer to hide scrollbar // Number of pixels added to scroller and sizer to hide scrollbar
var scrollerGap = 30; var scrollerGap = 50;
// Returned or thrown by various protocols to signal 'I'm not // Returned or thrown by various protocols to signal 'I'm not
// handling this'. // handling this'.
@ -485,14 +485,15 @@
for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
order.push(new BidiSpan(0, start, i$7)); order.push(new BidiSpan(0, start, i$7));
} else { } else {
var pos = i$7, at = order.length; var pos = i$7, at = order.length, isRTL = direction == "rtl" ? 1 : 0;
for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
for (var j$2 = pos; j$2 < i$7;) { for (var j$2 = pos; j$2 < i$7;) {
if (countsAsNum.test(types[j$2])) { if (countsAsNum.test(types[j$2])) {
if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); } if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }
var nstart = j$2; var nstart = j$2;
for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
order.splice(at, 0, new BidiSpan(2, nstart, j$2)); order.splice(at, 0, new BidiSpan(2, nstart, j$2));
at += isRTL;
pos = j$2; pos = j$2;
} else { ++j$2; } } else { ++j$2; }
} }
@ -1200,7 +1201,7 @@
var prop = lineClass[1] ? "bgClass" : "textClass"; var prop = lineClass[1] ? "bgClass" : "textClass";
if (output[prop] == null) if (output[prop] == null)
{ output[prop] = lineClass[2]; } { output[prop] = lineClass[2]; }
else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) else if (!(new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)")).test(output[prop]))
{ output[prop] += " " + lineClass[2]; } { output[prop] += " " + lineClass[2]; }
} } } }
return type return type
@ -3550,7 +3551,7 @@
} }
function setScrollTop(cm, val, forceScroll) { function setScrollTop(cm, val, forceScroll) {
val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val); val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));
if (cm.display.scroller.scrollTop == val && !forceScroll) { return } if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
cm.doc.scrollTop = val; cm.doc.scrollTop = val;
cm.display.scrollbars.setScrollTop(val); cm.display.scrollbars.setScrollTop(val);
@ -3560,7 +3561,7 @@
// Sync scroller and scrollbar, ensure the gutter elements are // Sync scroller and scrollbar, ensure the gutter elements are
// aligned. // aligned.
function setScrollLeft(cm, val, isScroller, forceScroll) { function setScrollLeft(cm, val, isScroller, forceScroll) {
val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));
if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
cm.doc.scrollLeft = val; cm.doc.scrollLeft = val;
alignHorizontally(cm); alignHorizontally(cm);
@ -4049,7 +4050,8 @@
function restoreSelection(snapshot) { function restoreSelection(snapshot) {
if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return } if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
snapshot.activeElt.focus(); snapshot.activeElt.focus();
if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&
snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
var sel = window.getSelection(), range = document.createRange(); var sel = window.getSelection(), range = document.createRange();
range.setEnd(snapshot.anchorNode, snapshot.anchorOffset); range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);
range.collapse(false); range.collapse(false);
@ -4147,6 +4149,8 @@
update.visible = visibleLines(cm.display, cm.doc, viewport); update.visible = visibleLines(cm.display, cm.doc, viewport);
if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
{ break } { break }
} else if (first) {
update.visible = visibleLines(cm.display, cm.doc, viewport);
} }
if (!updateDisplayIfNeeded(cm, update)) { break } if (!updateDisplayIfNeeded(cm, update)) { break }
updateHeightsInViewport(cm); updateHeightsInViewport(cm);
@ -6496,7 +6500,7 @@
text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())), text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),
origin: "paste"}; origin: "paste"};
makeChange(cm.doc, change); makeChange(cm.doc, change);
setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));
})(); })();
} }
}; };
@ -6829,7 +6833,7 @@
function endOfLine(visually, cm, lineObj, lineNo, dir) { function endOfLine(visually, cm, lineObj, lineNo, dir) {
if (visually) { if (visually) {
if (cm.getOption("direction") == "rtl") { dir = -dir; } if (cm.doc.direction == "rtl") { dir = -dir; }
var order = getOrder(lineObj, cm.doc.direction); var order = getOrder(lineObj, cm.doc.direction);
if (order) { if (order) {
var part = dir < 0 ? lst(order) : order[0]; var part = dir < 0 ? lst(order) : order[0];
@ -7084,7 +7088,7 @@
var line = getLine(cm.doc, start.line); var line = getLine(cm.doc, start.line);
var order = getOrder(line, cm.doc.direction); var order = getOrder(line, cm.doc.direction);
if (!order || order[0].level == 0) { if (!order || order[0].level == 0) {
var firstNonWS = Math.max(0, line.text.search(/\S/)); var firstNonWS = Math.max(start.ch, line.text.search(/\S/));
var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;
return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
} }
@ -7187,6 +7191,7 @@
var lastStoppedKey = null; var lastStoppedKey = null;
function onKeyDown(e) { function onKeyDown(e) {
var cm = this; var cm = this;
if (e.target && e.target != cm.display.input.getField()) { return }
cm.curOp.focus = activeElt(); cm.curOp.focus = activeElt();
if (signalDOMEvent(cm, e)) { return } if (signalDOMEvent(cm, e)) { return }
// IE does strange things with escape. // IE does strange things with escape.
@ -7230,6 +7235,7 @@
function onKeyPress(e) { function onKeyPress(e) {
var cm = this; var cm = this;
if (e.target && e.target != cm.display.input.getField()) { return }
if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
var keyCode = e.keyCode, charCode = e.charCode; var keyCode = e.keyCode, charCode = e.charCode;
if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
@ -7378,8 +7384,8 @@
if (!behavior.addNew) if (!behavior.addNew)
{ extendSelection(cm.doc, pos, null, null, behavior.extend); } { extendSelection(cm.doc, pos, null, null, behavior.extend); }
// Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
if (webkit || ie && ie_version == 9) if ((webkit && !safari) || ie && ie_version == 9)
{ setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); } { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }
else else
{ display.input.focus(); } { display.input.focus(); }
} }
@ -7755,6 +7761,12 @@
} }
cm.display.input.readOnlyChanged(val); cm.display.input.readOnlyChanged(val);
}); });
option("screenReaderLabel", null, function (cm, val) {
val = (val === '') ? null : val;
cm.display.input.screenReaderLabelChanged(val);
});
option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true); option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);
option("dragDrop", true, dragDropChanged); option("dragDrop", true, dragDropChanged);
option("allowDropFileTypes", null); option("allowDropFileTypes", null);
@ -8586,7 +8598,7 @@
clearCaches(this); clearCaches(this);
scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);
updateGutterSpace(this.display); updateGutterSpace(this.display);
if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)
{ estimateLineHeights(this); } { estimateLineHeights(this); }
signal(this, "refresh", this); signal(this, "refresh", this);
}), }),
@ -8640,7 +8652,7 @@
var oldPos = pos; var oldPos = pos;
var origDir = dir; var origDir = dir;
var lineObj = getLine(doc, pos.line); var lineObj = getLine(doc, pos.line);
var lineDir = visually && doc.cm && doc.cm.getOption("direction") == "rtl" ? -dir : dir; var lineDir = visually && doc.direction == "rtl" ? -dir : dir;
function findNextLine() { function findNextLine() {
var l = pos.line + lineDir; var l = pos.line + lineDir;
if (l < doc.first || l >= doc.first + doc.size) { return false } if (l < doc.first || l >= doc.first + doc.size) { return false }
@ -8735,8 +8747,16 @@
var div = input.div = display.lineDiv; var div = input.div = display.lineDiv;
disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize); disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);
function belongsToInput(e) {
for (var t = e.target; t; t = t.parentNode) {
if (t == div) { return true }
if (/\bCodeMirror-(?:line)?widget\b/.test(t.className)) { break }
}
return false
}
on(div, "paste", function (e) { on(div, "paste", function (e) {
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
// IE doesn't fire input events, so we schedule a read for the pasted content in this way // IE doesn't fire input events, so we schedule a read for the pasted content in this way
if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); } if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }
}); });
@ -8761,7 +8781,7 @@
}); });
function onCopyCut(e) { function onCopyCut(e) {
if (signalDOMEvent(cm, e)) { return } if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }
if (cm.somethingSelected()) { if (cm.somethingSelected()) {
setLastCopied({lineWise: false, text: cm.getSelections()}); setLastCopied({lineWise: false, text: cm.getSelections()});
if (e.type == "cut") { cm.replaceSelection("", null, "cut"); } if (e.type == "cut") { cm.replaceSelection("", null, "cut"); }
@ -8803,9 +8823,18 @@
on(div, "cut", onCopyCut); on(div, "cut", onCopyCut);
}; };
ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {
// Label for screenreaders, accessibility
if(label) {
this.div.setAttribute('aria-label', label);
} else {
this.div.removeAttribute('aria-label');
}
};
ContentEditableInput.prototype.prepareSelection = function () { ContentEditableInput.prototype.prepareSelection = function () {
var result = prepareSelection(this.cm, false); var result = prepareSelection(this.cm, false);
result.focus = this.cm.state.focused; result.focus = document.activeElement == this.div;
return result return result
}; };
@ -8901,7 +8930,7 @@
ContentEditableInput.prototype.focus = function () { ContentEditableInput.prototype.focus = function () {
if (this.cm.options.readOnly != "nocursor") { if (this.cm.options.readOnly != "nocursor") {
if (!this.selectionInEditor()) if (!this.selectionInEditor() || document.activeElement != this.div)
{ this.showSelection(this.prepareSelection(), true); } { this.showSelection(this.prepareSelection(), true); }
this.div.focus(); this.div.focus();
} }
@ -9343,6 +9372,15 @@
this.textarea = this.wrapper.firstChild; this.textarea = this.wrapper.firstChild;
}; };
TextareaInput.prototype.screenReaderLabelChanged = function (label) {
// Label for screenreaders, accessibility
if(label) {
this.textarea.setAttribute('aria-label', label);
} else {
this.textarea.removeAttribute('aria-label');
}
};
TextareaInput.prototype.prepareSelection = function () { TextareaInput.prototype.prepareSelection = function () {
// Redraw the selection and/or cursor // Redraw the selection and/or cursor
var cm = this.cm, display = cm.display, doc = cm.doc; var cm = this.cm, display = cm.display, doc = cm.doc;
@ -9733,7 +9771,7 @@
addLegacyProps(CodeMirror); addLegacyProps(CodeMirror);
CodeMirror.version = "5.51.0"; CodeMirror.version = "5.54.0";
return CodeMirror; return CodeMirror;

View File

@ -455,81 +455,98 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"alignment-baseline", "anchor-point", "animation", "animation-delay", "alignment-baseline", "anchor-point", "animation", "animation-delay",
"animation-direction", "animation-duration", "animation-fill-mode", "animation-direction", "animation-duration", "animation-fill-mode",
"animation-iteration-count", "animation-name", "animation-play-state", "animation-iteration-count", "animation-name", "animation-play-state",
"animation-timing-function", "appearance", "azimuth", "backface-visibility", "animation-timing-function", "appearance", "azimuth", "backdrop-filter",
"background", "background-attachment", "background-blend-mode", "background-clip", "backface-visibility", "background", "background-attachment",
"background-color", "background-image", "background-origin", "background-position", "background-blend-mode", "background-clip", "background-color",
"background-repeat", "background-size", "baseline-shift", "binding", "background-image", "background-origin", "background-position",
"bleed", "bookmark-label", "bookmark-level", "bookmark-state", "background-position-x", "background-position-y", "background-repeat",
"bookmark-target", "border", "border-bottom", "border-bottom-color", "background-size", "baseline-shift", "binding", "bleed", "block-size",
"border-bottom-left-radius", "border-bottom-right-radius", "bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target",
"border-bottom-style", "border-bottom-width", "border-collapse", "border", "border-bottom", "border-bottom-color", "border-bottom-left-radius",
"border-color", "border-image", "border-image-outset", "border-bottom-right-radius", "border-bottom-style", "border-bottom-width",
"border-collapse", "border-color", "border-image", "border-image-outset",
"border-image-repeat", "border-image-slice", "border-image-source", "border-image-repeat", "border-image-slice", "border-image-source",
"border-image-width", "border-left", "border-left-color", "border-image-width", "border-left", "border-left-color", "border-left-style",
"border-left-style", "border-left-width", "border-radius", "border-right", "border-left-width", "border-radius", "border-right", "border-right-color",
"border-right-color", "border-right-style", "border-right-width", "border-right-style", "border-right-width", "border-spacing", "border-style",
"border-spacing", "border-style", "border-top", "border-top-color", "border-top", "border-top-color", "border-top-left-radius",
"border-top-left-radius", "border-top-right-radius", "border-top-style", "border-top-right-radius", "border-top-style", "border-top-width",
"border-top-width", "border-width", "bottom", "box-decoration-break", "border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing",
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "break-after", "break-before", "break-inside", "caption-side", "caret-color",
"caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count", "clear", "clip", "color", "color-profile", "column-count", "column-fill",
"column-fill", "column-gap", "column-rule", "column-rule-color", "column-gap", "column-rule", "column-rule-color", "column-rule-style",
"column-rule-style", "column-rule-width", "column-span", "column-width", "column-rule-width", "column-span", "column-width", "columns", "contain",
"columns", "content", "counter-increment", "counter-reset", "crop", "cue", "content", "counter-increment", "counter-reset", "crop", "cue", "cue-after",
"cue-after", "cue-before", "cursor", "direction", "display", "cue-before", "cursor", "direction", "display", "dominant-baseline",
"dominant-baseline", "drop-initial-after-adjust", "drop-initial-after-adjust", "drop-initial-after-align",
"drop-initial-after-align", "drop-initial-before-adjust", "drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size",
"drop-initial-before-align", "drop-initial-size", "drop-initial-value", "drop-initial-value", "elevation", "empty-cells", "fit", "fit-position",
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", "flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow",
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", "flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into",
"float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", "font", "font-family", "font-feature-settings", "font-kerning",
"font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", "font-language-override", "font-optical-sizing", "font-size",
"font-stretch", "font-style", "font-synthesis", "font-variant", "font-size-adjust", "font-stretch", "font-style", "font-synthesis",
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant", "font-variant-alternates", "font-variant-caps",
"font-variant-ligatures", "font-variant-numeric", "font-variant-position", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric",
"font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "font-variant-position", "font-variation-settings", "font-weight", "gap",
"grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows",
"grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", "grid-column", "grid-column-end", "grid-column-gap", "grid-column-start",
"grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", "grid-row-start",
"grid-template-rows", "hanging-punctuation", "height", "hyphens", "grid-template", "grid-template-areas", "grid-template-columns",
"icon", "image-orientation", "image-rendering", "image-resolution", "grid-template-rows", "hanging-punctuation", "height", "hyphens", "icon",
"inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing", "image-orientation", "image-rendering", "image-resolution", "inline-box-align",
"line-break", "line-height", "line-stacking", "line-stacking-ruby", "inset", "inset-block", "inset-block-end", "inset-block-start", "inset-inline",
"inset-inline-end", "inset-inline-start", "isolation", "justify-content",
"justify-items", "justify-self", "left", "letter-spacing", "line-break",
"line-height", "line-height-step", "line-stacking", "line-stacking-ruby",
"line-stacking-shift", "line-stacking-strategy", "list-style", "line-stacking-shift", "line-stacking-strategy", "list-style",
"list-style-image", "list-style-position", "list-style-type", "margin", "list-style-image", "list-style-position", "list-style-type", "margin",
"margin-bottom", "margin-left", "margin-right", "margin-top", "margin-bottom", "margin-left", "margin-right", "margin-top", "marks",
"marks", "marquee-direction", "marquee-loop", "marquee-direction", "marquee-loop", "marquee-play-count", "marquee-speed",
"marquee-play-count", "marquee-speed", "marquee-style", "max-height", "marquee-style", "max-block-size", "max-height", "max-inline-size",
"max-width", "min-height", "min-width", "mix-blend-mode", "move-to", "nav-down", "nav-index", "max-width", "min-block-size", "min-height", "min-inline-size", "min-width",
"nav-left", "nav-right", "nav-up", "object-fit", "object-position", "mix-blend-mode", "move-to", "nav-down", "nav-index", "nav-left", "nav-right",
"opacity", "order", "orphans", "outline", "nav-up", "object-fit", "object-position", "offset", "offset-anchor",
"outline-color", "outline-offset", "outline-style", "outline-width", "offset-distance", "offset-path", "offset-position", "offset-rotate",
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", "opacity", "order", "orphans", "outline", "outline-color", "outline-offset",
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top", "outline-style", "outline-width", "overflow", "overflow-style",
"page", "page-break-after", "page-break-before", "page-break-inside", "overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom",
"page-policy", "pause", "pause-after", "pause-before", "perspective", "padding-left", "padding-right", "padding-top", "page", "page-break-after",
"perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position", "page-break-before", "page-break-inside", "page-policy", "pause",
"presentation-level", "punctuation-trim", "quotes", "region-break-after", "pause-after", "pause-before", "perspective", "perspective-origin", "pitch",
"region-break-before", "region-break-inside", "region-fragment", "pitch-range", "place-content", "place-items", "place-self", "play-during",
"rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", "position", "presentation-level", "punctuation-trim", "quotes",
"right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", "region-break-after", "region-break-before", "region-break-inside",
"ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin", "region-fragment", "rendering-intent", "resize", "rest", "rest-after",
"shape-outside", "size", "speak", "speak-as", "speak-header", "rest-before", "richness", "right", "rotate", "rotation", "rotation-point",
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", "row-gap", "ruby-align", "ruby-overhang", "ruby-position", "ruby-span",
"tab-size", "table-layout", "target", "target-name", "target-new", "scale", "scroll-behavior", "scroll-margin", "scroll-margin-block",
"target-position", "text-align", "text-align-last", "text-decoration", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-bottom",
"scroll-margin-inline", "scroll-margin-inline-end",
"scroll-margin-inline-start", "scroll-margin-left", "scroll-margin-right",
"scroll-margin-top", "scroll-padding", "scroll-padding-block",
"scroll-padding-block-end", "scroll-padding-block-start",
"scroll-padding-bottom", "scroll-padding-inline", "scroll-padding-inline-end",
"scroll-padding-inline-start", "scroll-padding-left", "scroll-padding-right",
"scroll-padding-top", "scroll-snap-align", "scroll-snap-type",
"shape-image-threshold", "shape-inside", "shape-margin", "shape-outside",
"size", "speak", "speak-as", "speak-header", "speak-numeral",
"speak-punctuation", "speech-rate", "stress", "string-set", "tab-size",
"table-layout", "target", "target-name", "target-new", "target-position",
"text-align", "text-align-last", "text-combine-upright", "text-decoration",
"text-decoration-color", "text-decoration-line", "text-decoration-skip", "text-decoration-color", "text-decoration-line", "text-decoration-skip",
"text-decoration-style", "text-emphasis", "text-emphasis-color", "text-decoration-skip-ink", "text-decoration-style", "text-emphasis",
"text-emphasis-position", "text-emphasis-style", "text-height", "text-emphasis-color", "text-emphasis-position", "text-emphasis-style",
"text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", "text-height", "text-indent", "text-justify", "text-orientation",
"text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", "text-outline", "text-overflow", "text-rendering", "text-shadow",
"text-wrap", "top", "transform", "transform-origin", "transform-style", "text-size-adjust", "text-space-collapse", "text-transform",
"transition", "transition-delay", "transition-duration", "text-underline-position", "text-wrap", "top", "transform", "transform-origin",
"transition-property", "transition-timing-function", "unicode-bidi", "transform-style", "transition", "transition-delay", "transition-duration",
"user-select", "vertical-align", "visibility", "voice-balance", "voice-duration", "transition-property", "transition-timing-function", "translate",
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", "unicode-bidi", "user-select", "vertical-align", "visibility", "voice-balance",
"voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break", "voice-duration", "voice-family", "voice-pitch", "voice-range", "voice-rate",
"word-spacing", "word-wrap", "z-index", "voice-stress", "voice-volume", "volume", "white-space", "widows", "width",
"will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index",
// SVG-specific // SVG-specific
"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
"flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
@ -543,16 +560,28 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
], propertyKeywords = keySet(propertyKeywords_); ], propertyKeywords = keySet(propertyKeywords_);
var nonStandardPropertyKeywords_ = [ var nonStandardPropertyKeywords_ = [
"border-block", "border-block-color", "border-block-end",
"border-block-end-color", "border-block-end-style", "border-block-end-width",
"border-block-start", "border-block-start-color", "border-block-start-style",
"border-block-start-width", "border-block-style", "border-block-width",
"border-inline", "border-inline-color", "border-inline-end",
"border-inline-end-color", "border-inline-end-style",
"border-inline-end-width", "border-inline-start", "border-inline-start-color",
"border-inline-start-style", "border-inline-start-width",
"border-inline-style", "border-inline-width", "margin-block",
"margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end",
"margin-inline-start", "padding-block", "padding-block-end",
"padding-block-start", "padding-inline", "padding-inline-end",
"padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color",
"scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
"scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
"scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside", "scrollbar-track-color", "searchfield-cancel-button", "searchfield-decoration",
"searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-button", "searchfield-results-decoration", "shape-inside", "zoom"
"searchfield-results-decoration", "zoom"
], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
var fontProperties_ = [ var fontProperties_ = [
"font-family", "src", "unicode-range", "font-variant", "font-feature-settings", "font-display", "font-family", "src", "unicode-range", "font-variant",
"font-stretch", "font-weight", "font-style" "font-feature-settings", "font-stretch", "font-weight", "font-style"
], fontProperties = keySet(fontProperties_); ], fontProperties = keySet(fontProperties_);
var counterDescriptors_ = [ var counterDescriptors_ = [

View File

@ -98,9 +98,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (ch == "`") { } else if (ch == "`") {
state.tokenize = tokenQuasi; state.tokenize = tokenQuasi;
return tokenQuasi(stream, state); return tokenQuasi(stream, state);
} else if (ch == "#") { } else if (ch == "#" && stream.peek() == "!") {
stream.skipToEnd(); stream.skipToEnd();
return ret("error", "error"); return ret("meta", "meta");
} else if (ch == "#" && stream.eatWhile(wordRE)) {
return ret("variable", "property")
} else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->")) { } else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->")) {
stream.skipToEnd() stream.skipToEnd()
return ret("comment", "comment") return ret("comment", "comment")
@ -113,6 +115,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (ch == ">") stream.eat(ch) if (ch == ">") stream.eat(ch)
} }
} }
if (ch == "?" && stream.eat(".")) return ret(".")
return ret("operator", "operator", stream.current()); return ret("operator", "operator", stream.current());
} else if (wordRE.test(ch)) { } else if (wordRE.test(ch)) {
stream.eatWhile(wordRE); stream.eatWhile(wordRE);
@ -417,7 +420,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} }
function parenExpr(type) { function parenExpr(type) {
if (type != "(") return pass() if (type != "(") return pass()
return cont(pushlex(")"), expression, expect(")"), poplex) return cont(pushlex(")"), maybeexpression, expect(")"), poplex)
} }
function expressionInner(type, value, noComma) { function expressionInner(type, value, noComma) {
if (cx.state.fatArrowAt == cx.stream.start) { if (cx.state.fatArrowAt == cx.stream.start) {
@ -446,7 +449,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} }
function maybeoperatorComma(type, value) { function maybeoperatorComma(type, value) {
if (type == ",") return cont(expression); if (type == ",") return cont(maybeexpression);
return maybeoperatorNoComma(type, value, false); return maybeoperatorNoComma(type, value, false);
} }
function maybeoperatorNoComma(type, value, noComma) { function maybeoperatorNoComma(type, value, noComma) {
@ -455,7 +458,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
if (type == "operator") { if (type == "operator") {
if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false)) if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
if (value == "?") return cont(expression, expect(":"), expr); if (value == "?") return cont(expression, expect(":"), expr);
return cont(expr); return cont(expr);
@ -757,11 +760,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} }
if (type == "variable" || cx.style == "keyword") { if (type == "variable" || cx.style == "keyword") {
cx.marked = "property"; cx.marked = "property";
return cont(isTS ? classfield : functiondef, classBody); return cont(classfield, classBody);
} }
if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody); if (type == "number" || type == "string") return cont(classfield, classBody);
if (type == "[") if (type == "[")
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody) return cont(expression, maybetype, expect("]"), classfield, classBody)
if (value == "*") { if (value == "*") {
cx.marked = "keyword"; cx.marked = "keyword";
return cont(classBody); return cont(classBody);

View File

@ -76,7 +76,7 @@
if (ch == "#") { if (ch == "#") {
stream.next(); stream.next();
// Hex color // Hex color
if (stream.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b/i)) { if (stream.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b(?!-)/i)) {
return ["atom", "atom"]; return ["atom", "atom"];
} }
// ID selector // ID selector

View File

@ -11,7 +11,7 @@
.cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; } .cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; }
.cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; } .cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; }
.cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white; } .cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; } .cm-s-zenburn.CodeMirror { background-color: #3f3f3f; color: #dcdccc; }
.cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; } .cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; }
.cm-s-zenburn span.cm-comment { color: #7f9f7f; } .cm-s-zenburn span.cm-comment { color: #7f9f7f; }
.cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; } .cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; }

2
vendor/uuid/LICENSE vendored
View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2010-2016 Robert Kieffer and other contributors Copyright (c) 2010-2020 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,4 +1,4 @@
## uuid v7.0.0-beta.0 ## uuid v8.1.0
Following files are copied from npm (node_modules): Following files are copied from npm (node_modules):

View File

@ -1 +1 @@
!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(o=o||self).uuidv4=e()}(this,(function(){"use strict";var o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),e=new Uint8Array(16);function r(){if(!o)throw new Error("uuid: This browser does not seem to support crypto.getRandomValues(). If you need to support this browser, please provide a custom random number generator through options.rng.");return o(e)}for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);return function(o,e,t){var u=e&&t||0;"string"==typeof o&&(e="binary"===o?new Array(16):null,o=null);var i=(o=o||{}).random||(o.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var s=0;s<16;++s)e[u+s]=i[s];return e||function(o,e){var r=e||0,t=n;return[t[o[r++]],t[o[r++]],t[o[r++]],t[o[r++]],"-",t[o[r++]],t[o[r++]],"-",t[o[r++]],t[o[r++]],"-",t[o[r++]],t[o[r++]],"-",t[o[r++]],t[o[r++]],t[o[r++]],t[o[r++]],t[o[r++]],t[o[r++]]].join("")}(i)}})); !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).uuidv4=e()}(this,(function(){"use strict";var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),e=new Uint8Array(16);function n(){if(!t)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(e)}for(var o=[],r=0;r<256;++r)o.push((r+256).toString(16).substr(1));return function(t,e,r){"string"==typeof t&&(e="binary"===t?new Uint8Array(16):null,t=null);var u=(t=t||{}).random||(t.rng||n)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e){for(var i=r||0,d=0;d<16;++d)e[i+d]=u[d];return e}return function(t,e){var n=e||0,r=o;return(r[t[n+0]]+r[t[n+1]]+r[t[n+2]]+r[t[n+3]]+"-"+r[t[n+4]]+r[t[n+5]]+"-"+r[t[n+6]]+r[t[n+7]]+"-"+r[t[n+8]]+r[t[n+9]]+"-"+r[t[n+10]]+r[t[n+11]]+r[t[n+12]]+r[t[n+13]]+r[t[n+14]]+r[t[n+15]]).toLowerCase()}(u)}}));