Update vendor libraries

Codemirror & Dropbox sdk
This commit is contained in:
Rob Garrison 2019-07-08 04:59:04 -05:00
parent b32bafd149
commit b7b6ed2ff5
22 changed files with 1328 additions and 1059 deletions

View File

@ -37,6 +37,7 @@ const CODEMIRROR_THEMES = [
'neat', 'neat',
'neo', 'neo',
'night', 'night',
'nord',
'oceanic-next', 'oceanic-next',
'panda-syntax', 'panda-syntax',
'paraiso-dark', 'paraiso-dark',
@ -57,5 +58,6 @@ const CODEMIRROR_THEMES = [
'xq-dark', 'xq-dark',
'xq-light', 'xq-light',
'yeti', 'yeti',
'yonce',
'zenburn' 'zenburn'
]; ];

View File

@ -1,6 +1,6 @@
{ {
"name": "Stylus", "name": "Stylus",
"version": "1.5.2", "version": "1.5.3",
"minimum_chrome_version": "49", "minimum_chrome_version": "49",
"description": "__MSG_description__", "description": "__MSG_description__",
"homepage_url": "https://add0n.com/stylus.html", "homepage_url": "https://add0n.com/stylus.html",

View File

@ -1,3 +1,3 @@
## CodeMirror v5.42.0 ## CodeMirror v5.48.0
Only files & folders that exist in the `vendor/codemirror` folder are copied from the `node_modules/codemirror` folder. Except all theme files are copied, in case new themes have been added. Only files & folders that exist in the `vendor/codemirror` folder are copied from the `node_modules/codemirror` folder. Except all theme files are copied, in case new themes have been added.

View File

@ -11,6 +11,7 @@
})(function(CodeMirror) { })(function(CodeMirror) {
var defaults = { var defaults = {
pairs: "()[]{}''\"\"", pairs: "()[]{}''\"\"",
closeBefore: ")]}'\":;>",
triples: "", triples: "",
explode: "[]{}" explode: "[]{}"
}; };
@ -109,6 +110,9 @@
var pairs = getOption(conf, "pairs"); var pairs = getOption(conf, "pairs");
var pos = pairs.indexOf(ch); var pos = pairs.indexOf(ch);
if (pos == -1) return CodeMirror.Pass; if (pos == -1) return CodeMirror.Pass;
var closeBefore = getOption(conf,"closeBefore");
var triples = getOption(conf, "triples"); var triples = getOption(conf, "triples");
var identical = pairs.charAt(pos + 1) == ch; var identical = pairs.charAt(pos + 1) == ch;
@ -136,7 +140,7 @@
var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur) var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both"; if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";
else return CodeMirror.Pass; else return CodeMirror.Pass;
} else if (opening) { } else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) {
curType = "both"; curType = "both";
} else { } else {
return CodeMirror.Pass; return CodeMirror.Pass;

View File

@ -14,20 +14,25 @@
var Pos = CodeMirror.Pos; var Pos = CodeMirror.Pos;
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<", "<": ">>", ">": "<<"};
function bracketRegex(config) {
return config && config.bracketRegex || /[(){}[\]]/
}
function findMatchingBracket(cm, where, config) { function findMatchingBracket(cm, where, config) {
var line = cm.getLineHandle(where.line), pos = where.ch - 1; var line = cm.getLineHandle(where.line), pos = where.ch - 1;
var afterCursor = config && config.afterCursor var afterCursor = config && config.afterCursor
if (afterCursor == null) if (afterCursor == null)
afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className) afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
var re = bracketRegex(config)
// A cursor is defined as between two characters, but in in vim command mode // A cursor is defined as between two characters, but in in vim command mode
// (i.e. not insert mode), the cursor is visually represented as a // (i.e. not insert mode), the cursor is visually represented as a
// highlighted box on top of the 2nd character. Otherwise, we allow matches // highlighted box on top of the 2nd character. Otherwise, we allow matches
// from before or after the cursor. // from before or after the cursor.
var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) || var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||
matching[line.text.charAt(++pos)]; re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];
if (!match) return null; if (!match) return null;
var dir = match.charAt(1) == ">" ? 1 : -1; var dir = match.charAt(1) == ">" ? 1 : -1;
if (config && config.strict && (dir > 0) != (pos == where.ch)) return null; if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
@ -51,7 +56,7 @@
var maxScanLines = (config && config.maxScanLines) || 1000; var maxScanLines = (config && config.maxScanLines) || 1000;
var stack = []; var stack = [];
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/; var re = bracketRegex(config)
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
: Math.max(cm.firstLine() - 1, where.line - maxScanLines); : Math.max(cm.firstLine() - 1, where.line - maxScanLines);
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
@ -64,7 +69,7 @@
var ch = line.charAt(pos); var ch = line.charAt(pos);
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
var match = matching[ch]; var match = matching[ch];
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch); if (match && (match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
else stack.pop(); else stack.pop();
} }

View File

@ -46,6 +46,10 @@
completion.update(true); completion.update(true);
}); });
CodeMirror.defineExtension("closeHint", function() {
if (this.state.completionActive) this.state.completionActive.close()
})
function Completion(cm, options) { function Completion(cm, options) {
this.cm = cm; this.cm = cm;
this.options = options; this.options = options;
@ -163,6 +167,14 @@
Tab: handle.pick, Tab: handle.pick,
Esc: handle.close Esc: handle.close
}; };
var mac = /Mac/.test(navigator.platform);
if (mac) {
baseMap["Ctrl-P"] = function() {handle.moveFocus(-1);};
baseMap["Ctrl-N"] = function() {handle.moveFocus(1);};
}
var custom = completion.options.customKeys; var custom = completion.options.customKeys;
var ourMap = custom ? {} : baseMap; var ourMap = custom ? {} : baseMap;
function addBinding(key, val) { function addBinding(key, val) {
@ -217,14 +229,26 @@
elt.hintId = i; elt.hintId = i;
} }
var container = completion.options.container || ownerDocument.body;
var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
var left = pos.left, top = pos.bottom, below = true; var left = pos.left, top = pos.bottom, below = true;
hints.style.left = left + "px"; var offsetLeft = 0, offsetTop = 0;
hints.style.top = top + "px"; if (container !== ownerDocument.body) {
// We offset the cursor position because left and top are relative to the offsetParent's top left corner.
var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1;
var offsetParent = isContainerPositioned ? container : container.offsetParent;
var offsetParentPosition = offsetParent.getBoundingClientRect();
var bodyPosition = ownerDocument.body.getBoundingClientRect();
offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);
offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);
}
hints.style.left = (left - offsetLeft) + "px";
hints.style.top = (top - offsetTop) + "px";
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth); var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);
var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight); var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);
(completion.options.container || ownerDocument.body).appendChild(hints); container.appendChild(hints);
var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
var scrolls = hints.scrollHeight > hints.clientHeight + 1 var scrolls = hints.scrollHeight > hints.clientHeight + 1
var startScroll = cm.getScrollInfo(); var startScroll = cm.getScrollInfo();
@ -232,15 +256,15 @@
if (overlapY > 0) { if (overlapY > 0) {
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
if (curTop - height > 0) { // Fits above cursor if (curTop - height > 0) { // Fits above cursor
hints.style.top = (top = pos.top - height) + "px"; hints.style.top = (top = pos.top - height - offsetTop) + "px";
below = false; below = false;
} else if (height > winH) { } else if (height > winH) {
hints.style.height = (winH - 5) + "px"; hints.style.height = (winH - 5) + "px";
hints.style.top = (top = pos.bottom - box.top) + "px"; hints.style.top = (top = pos.bottom - box.top - offsetTop) + "px";
var cursor = cm.getCursor(); var cursor = cm.getCursor();
if (data.from.ch != cursor.ch) { if (data.from.ch != cursor.ch) {
pos = cm.cursorCoords(cursor); pos = cm.cursorCoords(cursor);
hints.style.left = (left = pos.left) + "px"; hints.style.left = (left = pos.left - offsetLeft) + "px";
box = hints.getBoundingClientRect(); box = hints.getBoundingClientRect();
} }
} }
@ -251,7 +275,7 @@
hints.style.width = (winW - 5) + "px"; hints.style.width = (winW - 5) + "px";
overlapX -= (box.right - box.left) - winW; overlapX -= (box.right - box.left) - winW;
} }
hints.style.left = (left = pos.left - overlapX) + "px"; hints.style.left = (left = pos.left - overlapX - offsetLeft) + "px";
} }
if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling) if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)
node.style.paddingRight = cm.display.nativeBarWidth + "px" node.style.paddingRight = cm.display.nativeBarWidth + "px"

View File

@ -46,7 +46,7 @@
if (match.from.line >= this.gap.to) break; if (match.from.line >= this.gap.to) break;
if (match.to.line >= this.gap.from) this.matches.splice(i--, 1); if (match.to.line >= this.gap.from) this.matches.splice(i--, 1);
} }
var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), this.caseFold); var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), {caseFold: this.caseFold, multiline: this.options.multiline});
var maxMatches = this.options && this.options.maxMatches || MAX_MATCHES; var maxMatches = this.options && this.options.maxMatches || MAX_MATCHES;
while (cursor.findNext()) { while (cursor.findNext()) {
var match = {from: cursor.from(), to: cursor.to()}; var match = {from: cursor.from(), to: cursor.to()};

View File

@ -369,6 +369,7 @@
"Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"), "Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"),
"Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"), "Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"),
"Shift-Ctrl-Z": "redo",
"Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd", "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
"Ctrl-S": "findPersistentNext", "Ctrl-R": "findPersistentPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace", "Ctrl-S": "findPersistentNext", "Ctrl-R": "findPersistentPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace",
"Alt-/": "autocomplete", "Alt-/": "autocomplete",

View File

@ -589,8 +589,8 @@
"Cmd-/": "toggleCommentIndented", "Cmd-/": "toggleCommentIndented",
"Cmd-J": "joinLines", "Cmd-J": "joinLines",
"Shift-Cmd-D": "duplicateLine", "Shift-Cmd-D": "duplicateLine",
"F9": "sortLines", "F5": "sortLines",
"Cmd-F9": "sortLinesInsensitive", "Cmd-F5": "sortLinesInsensitive",
"F2": "nextBookmark", "F2": "nextBookmark",
"Shift-F2": "prevBookmark", "Shift-F2": "prevBookmark",
"Cmd-F2": "toggleBookmark", "Cmd-F2": "toggleBookmark",

View File

@ -53,6 +53,7 @@
{ keys: '<Down>', type: 'keyToKey', toKeys: 'j' }, { keys: '<Down>', type: 'keyToKey', toKeys: 'j' },
{ keys: '<Space>', type: 'keyToKey', toKeys: 'l' }, { keys: '<Space>', type: 'keyToKey', toKeys: 'l' },
{ keys: '<BS>', type: 'keyToKey', toKeys: 'h', context: 'normal'}, { keys: '<BS>', type: 'keyToKey', toKeys: 'h', context: 'normal'},
{ keys: '<Del>', type: 'keyToKey', toKeys: 'x', context: 'normal'},
{ keys: '<C-Space>', type: 'keyToKey', toKeys: 'W' }, { keys: '<C-Space>', type: 'keyToKey', toKeys: 'W' },
{ keys: '<C-BS>', type: 'keyToKey', toKeys: 'B', context: 'normal' }, { keys: '<C-BS>', type: 'keyToKey', toKeys: 'B', context: 'normal' },
{ keys: '<S-Space>', type: 'keyToKey', toKeys: 'w' }, { keys: '<S-Space>', type: 'keyToKey', toKeys: 'w' },
@ -152,6 +153,8 @@
{ keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'}, { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'},
{ keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'}, { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'},
{ keys: '<C-w>', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' }, { keys: '<C-w>', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' },
//ignore C-w in normal mode
{ keys: '<C-w>', type: 'idle', context: 'normal' },
// Actions // Actions
{ keys: '<C-i>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }}, { keys: '<C-i>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }},
{ keys: '<C-o>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }}, { keys: '<C-o>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }},
@ -283,7 +286,9 @@
enterVimMode(cm); enterVimMode(cm);
} }
function fatCursorMarks(cm) { function updateFatCursorMark(cm) {
if (!cm.state.fatCursorMarks) return;
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]
@ -299,25 +304,26 @@
} }
} }
} }
return result cm.state.fatCursorMarks = result;
} }
function updateFatCursorMark(cm) { function clearFatCursorMark(cm) {
var marks = cm.state.fatCursorMarks var marks = cm.state.fatCursorMarks;
if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear() if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();
cm.state.fatCursorMarks = fatCursorMarks(cm)
} }
function enableFatCursorMark(cm) { function enableFatCursorMark(cm) {
cm.state.fatCursorMarks = fatCursorMarks(cm) cm.state.fatCursorMarks = [];
updateFatCursorMark(cm)
cm.on("cursorActivity", updateFatCursorMark) cm.on("cursorActivity", updateFatCursorMark)
} }
function disableFatCursorMark(cm) { function disableFatCursorMark(cm) {
var marks = cm.state.fatCursorMarks clearFatCursorMark(cm);
if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear() cm.off("cursorActivity", updateFatCursorMark);
cm.state.fatCursorMarks = null // explicitly set fatCursorMarks to null because event listener above
cm.off("cursorActivity", updateFatCursorMark) // can be invoke after removing it, if off is called from operation
cm.state.fatCursorMarks = null;
} }
// Deprecated, simply setting the keymap works again. // Deprecated, simply setting the keymap works again.
@ -1711,6 +1717,7 @@
vim.lastEditActionCommand = actionCommand; vim.lastEditActionCommand = actionCommand;
macroModeState.lastInsertModeChanges.changes = []; macroModeState.lastInsertModeChanges.changes = [];
macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false; macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;
macroModeState.lastInsertModeChanges.visualBlock = vim.visualBlock ? vim.sel.head.line - vim.sel.anchor.line : 0;
} }
}; };
@ -1841,7 +1848,7 @@
if (line < first && cur.line == first){ if (line < first && cur.line == first){
return this.moveToStartOfLine(cm, head, motionArgs, vim); return this.moveToStartOfLine(cm, head, motionArgs, vim);
}else if (line > last && cur.line == last){ }else if (line > last && cur.line == last){
return this.moveToEol(cm, head, motionArgs, vim); return this.moveToEol(cm, head, motionArgs, vim, true);
} }
if (motionArgs.toFirstChar){ if (motionArgs.toFirstChar){
endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line));
@ -1943,13 +1950,15 @@
vim.lastHSPos = cm.charCoords(head,'div').left; vim.lastHSPos = cm.charCoords(head,'div').left;
return moveToColumn(cm, repeat); return moveToColumn(cm, repeat);
}, },
moveToEol: function(cm, head, motionArgs, vim) { moveToEol: function(cm, head, motionArgs, vim, keepHPos) {
var cur = head; var cur = head;
vim.lastHPos = Infinity;
var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity); var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);
var end=cm.clipPos(retval); var end=cm.clipPos(retval);
end.ch--; end.ch--;
if (!keepHPos) {
vim.lastHPos = Infinity;
vim.lastHSPos = cm.charCoords(end,'div').left; vim.lastHSPos = cm.charCoords(end,'div').left;
}
return retval; return retval;
}, },
moveToFirstNonWhiteSpaceCharacter: function(cm, head) { moveToFirstNonWhiteSpaceCharacter: function(cm, head) {
@ -1975,7 +1984,9 @@
} }
} }
if (ch < lineText.length) { if (ch < lineText.length) {
var matched = cm.findMatchingBracket(Pos(line, ch)); // Only include angle brackets in analysis if they are being matched.
var re = (ch === '<' || ch === '>') ? /[(){}[\]<>]/ : /[(){}[\]]/;
var matched = cm.findMatchingBracket(Pos(line, ch), {bracketRegex: re});
return matched.to; return matched.to;
} else { } else {
return cursor; return cursor;
@ -1995,13 +2006,11 @@
textObjectManipulation: function(cm, head, motionArgs, vim) { textObjectManipulation: function(cm, head, motionArgs, vim) {
// TODO: lots of possible exceptions that can be thrown here. Try da( // TODO: lots of possible exceptions that can be thrown here. Try da(
// outside of a () block. // outside of a () block.
// TODO: adding <> >< to this map doesn't work, presumably because
// they're operators
var mirroredPairs = {'(': ')', ')': '(', var mirroredPairs = {'(': ')', ')': '(',
'{': '}', '}': '{', '{': '}', '}': '{',
'[': ']', ']': '['}; '[': ']', ']': '[',
var selfPaired = {'\'': true, '"': true}; '<': '>', '>': '<'};
var selfPaired = {'\'': true, '"': true, '`': true};
var character = motionArgs.selectedCharacter; var character = motionArgs.selectedCharacter;
// 'b' refers to '()' block. // 'b' refers to '()' block.
@ -2089,7 +2098,6 @@
change: function(cm, args, ranges) { change: function(cm, args, ranges) {
var finalHead, text; var finalHead, text;
var vim = cm.state.vim; var vim = cm.state.vim;
vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock;
if (!vim.visualMode) { if (!vim.visualMode) {
var anchor = ranges[0].anchor, var anchor = ranges[0].anchor,
head = ranges[0].head; head = ranges[0].head;
@ -2312,6 +2320,8 @@
var macroModeState = vimGlobalState.macroModeState; var macroModeState = vimGlobalState.macroModeState;
if (registerName == '@') { if (registerName == '@') {
registerName = macroModeState.latestRegister; registerName = macroModeState.latestRegister;
} else {
macroModeState.latestRegister = registerName;
} }
while(repeat--){ while(repeat--){
executeMacroRegister(cm, vim, macroModeState, registerName); executeMacroRegister(cm, vim, macroModeState, registerName);
@ -2350,6 +2360,8 @@
} else if (insertAt == 'firstNonBlank') { } else if (insertAt == 'firstNonBlank') {
head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head); head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head);
} else if (insertAt == 'startOfSelectedArea') { } else if (insertAt == 'startOfSelectedArea') {
if (!vim.visualMode)
return;
if (!vim.visualBlock) { if (!vim.visualBlock) {
if (sel.head.line < sel.anchor.line) { if (sel.head.line < sel.anchor.line) {
head = sel.head; head = sel.head;
@ -2363,6 +2375,8 @@
height = Math.abs(sel.head.line - sel.anchor.line) + 1; height = Math.abs(sel.head.line - sel.anchor.line) + 1;
} }
} else if (insertAt == 'endOfSelectedArea') { } else if (insertAt == 'endOfSelectedArea') {
if (!vim.visualMode)
return;
if (!vim.visualBlock) { if (!vim.visualBlock) {
if (sel.head.line >= sel.anchor.line) { if (sel.head.line >= sel.anchor.line) {
head = offsetCursor(sel.head, 0, 1); head = offsetCursor(sel.head, 0, 1);
@ -2556,7 +2570,17 @@
} }
var linewise = register.linewise; var linewise = register.linewise;
var blockwise = register.blockwise; var blockwise = register.blockwise;
if (blockwise) {
text = text.split('\n');
if (linewise) { if (linewise) {
text.pop();
}
for (var i = 0; i < text.length; i++) {
text[i] = (text[i] == '') ? ' ' : text[i];
}
cur.ch += actionArgs.after ? 1 : 0;
cur.ch = Math.min(lineLength(cm, cur.line), cur.ch);
} else if (linewise) {
if(vim.visualMode) { if(vim.visualMode) {
text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n'; text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n';
} else if (actionArgs.after) { } else if (actionArgs.after) {
@ -2568,12 +2592,6 @@
cur.ch = 0; cur.ch = 0;
} }
} else { } else {
if (blockwise) {
text = text.split('\n');
for (var i = 0; i < text.length; i++) {
text[i] = (text[i] == '') ? ' ' : text[i];
}
}
cur.ch += actionArgs.after ? 1 : 0; cur.ch += actionArgs.after ? 1 : 0;
} }
var curPosFinal; var curPosFinal;
@ -2808,12 +2826,6 @@
} }
return Pos(cur.line + offsetLine, cur.ch + offsetCh); return Pos(cur.line + offsetLine, cur.ch + offsetCh);
} }
function getOffset(anchor, head) {
return {
line: head.line - anchor.line,
ch: head.line - anchor.line
};
}
function commandMatches(keys, keyMap, context, inputState) { function commandMatches(keys, keyMap, context, inputState) {
// Partial matches are not applied. They inform the key handler // Partial matches are not applied. They inform the key handler
// that the current key sequence is a subsequence of a valid key // that the current key sequence is a subsequence of a valid key
@ -3802,11 +3814,13 @@
var bracketRegexp = ({ var bracketRegexp = ({
'(': /[()]/, ')': /[()]/, '(': /[()]/, ')': /[()]/,
'[': /[[\]]/, ']': /[[\]]/, '[': /[[\]]/, ']': /[[\]]/,
'{': /[{}]/, '}': /[{}]/})[symb]; '{': /[{}]/, '}': /[{}]/,
'<': /[<>]/, '>': /[<>]/})[symb];
var openSym = ({ var openSym = ({
'(': '(', ')': '(', '(': '(', ')': '(',
'[': '[', ']': '[', '[': '[', ']': '[',
'{': '{', '}': '{'})[symb]; '{': '{', '}': '{',
'<': '<', '>': '<'})[symb];
var curChar = cm.getLine(cur.line).charAt(cur.ch); var curChar = cm.getLine(cur.line).charAt(cur.ch);
// Due to the behavior of scanForBracket, we need to add an offset if the // Due to the behavior of scanForBracket, we need to add an offset if the
// cursor is on a matching open bracket. // cursor is on a matching open bracket.
@ -4215,7 +4229,10 @@
query: query query: query
}; };
} }
var highlightTimeout = 0;
function highlightSearchMatches(cm, query) { function highlightSearchMatches(cm, query) {
clearTimeout(highlightTimeout);
highlightTimeout = setTimeout(function() {
var searchState = getSearchState(cm); var searchState = getSearchState(cm);
var overlay = searchState.getOverlay(); var overlay = searchState.getOverlay();
if (!overlay || query != overlay.query) { if (!overlay || query != overlay.query) {
@ -4232,6 +4249,7 @@
} }
searchState.setOverlay(overlay); searchState.setOverlay(overlay);
} }
}, 50);
} }
function findNext(cm, prev, query, repeat) { function findNext(cm, prev, query, repeat) {
if (repeat === undefined) { repeat = 1; } if (repeat === undefined) { repeat = 1; }
@ -5431,18 +5449,15 @@
return true; return true;
} }
var head = cm.getCursor('head'); var head = cm.getCursor('head');
var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock; var visualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.visualBlock;
if (inVisualBlock) { if (visualBlock) {
// Set up block selection again for repeating the changes. // Set up block selection again for repeating the changes.
var vim = cm.state.vim; selectForInsert(cm, head, visualBlock + 1);
var lastSel = vim.lastSelection;
var offset = getOffset(lastSel.anchor, lastSel.head);
selectForInsert(cm, head, offset.line + 1);
repeat = cm.listSelections().length; repeat = cm.listSelections().length;
cm.setCursor(head); cm.setCursor(head);
} }
for (var i = 0; i < repeat; i++) { for (var i = 0; i < repeat; i++) {
if (inVisualBlock) { if (visualBlock) {
cm.setCursor(offsetCursor(head, i, 0)); cm.setCursor(offsetCursor(head, i, 0));
} }
for (var j = 0; j < changes.length; j++) { for (var j = 0; j < changes.length; j++) {
@ -5459,7 +5474,7 @@
} }
} }
} }
if (inVisualBlock) { if (visualBlock) {
cm.setCursor(offsetCursor(head, 0, 1)); cm.setCursor(offsetCursor(head, 0, 1));
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
if (/[\d.]/.test(stream.peek())) { if (/[\d.]/.test(stream.peek())) {
stream.eatWhile(/[\w.%]/); stream.eatWhile(/[\w.%]/);
return ret("number", "unit"); return ret("number", "unit");
} else if (stream.match(/^-[\w\\\-]+/)) { } else if (stream.match(/^-[\w\\\-]*/)) {
stream.eatWhile(/[\w\\\-]/); stream.eatWhile(/[\w\\\-]/);
if (stream.match(/^\s*:/, false)) if (stream.match(/^\s*:/, false))
return ret("variable-2", "variable-definition"); return ret("variable-2", "variable-definition");
@ -77,12 +77,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return ret("qualifier", "qualifier"); return ret("qualifier", "qualifier");
} else if (/[:;{}\[\]\(\)]/.test(ch)) { } else if (/[:;{}\[\]\(\)]/.test(ch)) {
return ret(null, ch); return ret(null, ch);
} else if (((ch == "u" || ch == "U") && stream.match(/rl(-prefix)?\(/i)) || } else if (stream.match(/[\w-.]+(?=\()/)) {
((ch == "d" || ch == "D") && stream.match("omain(", true, true)) || if (/^(url(-prefix)?|domain|regexp)$/.test(stream.current().toLowerCase())) {
((ch == "r" || ch == "R") && stream.match("egexp(", true, true))) {
stream.backUp(1);
state.tokenize = tokenParenthesized; state.tokenize = tokenParenthesized;
return ret("property", "word"); }
return ret("variable callee", "variable");
} else if (/[\w\\\-]/.test(ch)) { } else if (/[\w\\\-]/.test(ch)) {
stream.eatWhile(/[\w\\\-]/); stream.eatWhile(/[\w\\\-]/);
return ret("property", "word"); return ret("property", "word");

View File

@ -365,7 +365,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} }
if (type == "function") return cont(functiondef); if (type == "function") return cont(functiondef);
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), className, poplex); } if (type == "class" || (isTS && value == "interface")) {
cx.marked = "keyword"
return cont(pushlex("form", type == "class" ? type : value), className, poplex)
}
if (type == "variable") { if (type == "variable") {
if (isTS && value == "declare") { if (isTS && value == "declare") {
cx.marked = "keyword" cx.marked = "keyword"
@ -373,11 +376,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) { } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
cx.marked = "keyword" cx.marked = "keyword"
if (value == "enum") return cont(enumdef); if (value == "enum") return cont(enumdef);
else if (value == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";")); else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";"));
else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex) else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
} else if (isTS && value == "namespace") { } else if (isTS && value == "namespace") {
cx.marked = "keyword" cx.marked = "keyword"
return cont(pushlex("form"), expression, block, poplex) return cont(pushlex("form"), expression, statement, poplex)
} else if (isTS && value == "abstract") { } else if (isTS && value == "abstract") {
cx.marked = "keyword" cx.marked = "keyword"
return cont(statement) return cont(statement)
@ -522,7 +525,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.marked = "keyword" cx.marked = "keyword"
return cont(objprop) return cont(objprop)
} else if (type == "[") { } else if (type == "[") {
return cont(expression, maybetype, expect("]"), afterprop); return cont(expression, maybetypeOrIn, expect("]"), afterprop);
} else if (type == "spread") { } else if (type == "spread") {
return cont(expressionNoComma, afterprop); return cont(expressionNoComma, afterprop);
} else if (value == "*") { } else if (value == "*") {
@ -552,6 +555,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}, proceed); }, proceed);
} }
if (type == end || value == end) return cont(); if (type == end || value == end) return cont();
if (sep && sep.indexOf(";") > -1) return pass(what)
return cont(expect(end)); return cont(expect(end));
} }
return function(type, value) { return function(type, value) {
@ -574,6 +578,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "?") return cont(maybetype); if (value == "?") return cont(maybetype);
} }
} }
function maybetypeOrIn(type, value) {
if (isTS && (type == ":" || value == "in")) return cont(typeexpr)
}
function mayberettype(type) { function mayberettype(type) {
if (isTS && type == ":") { if (isTS && type == ":") {
if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr) if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr)
@ -587,18 +594,19 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} }
} }
function typeexpr(type, value) { function typeexpr(type, value) {
if (value == "keyof" || value == "typeof") { if (value == "keyof" || value == "typeof" || value == "infer") {
cx.marked = "keyword" cx.marked = "keyword"
return cont(value == "keyof" ? typeexpr : expressionNoComma) return cont(value == "typeof" ? expressionNoComma : typeexpr)
} }
if (type == "variable" || value == "void") { if (type == "variable" || value == "void") {
cx.marked = "type" cx.marked = "type"
return cont(afterType) return cont(afterType)
} }
if (value == "|" || value == "&") return cont(typeexpr)
if (type == "string" || type == "number" || type == "atom") return cont(afterType); if (type == "string" || type == "number" || type == "atom") return cont(afterType);
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType) if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType) if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType)
if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr) if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
} }
function maybeReturnType(type) { function maybeReturnType(type) {
@ -608,24 +616,28 @@ 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(typeprop) return cont(typeprop)
} else if (value == "?") { } else if (value == "?" || type == "number" || type == "string") {
return cont(typeprop) return cont(typeprop)
} else if (type == ":") { } else if (type == ":") {
return cont(typeexpr) return cont(typeexpr)
} else if (type == "[") { } else if (type == "[") {
return cont(expression, maybetype, expect("]"), typeprop) return cont(expect("variable"), maybetype, expect("]"), typeprop)
} else if (type == "(") {
return pass(functiondecl, typeprop)
} }
} }
function typearg(type, value) { function typearg(type, value) {
if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg) if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
if (type == ":") return cont(typeexpr) if (type == ":") return cont(typeexpr)
if (type == "spread") return cont(typearg)
return pass(typeexpr) return pass(typeexpr)
} }
function afterType(type, value) { function afterType(type, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
if (value == "|" || type == "." || value == "&") return cont(typeexpr) if (value == "|" || type == "." || value == "&") return cont(typeexpr)
if (type == "[") return cont(expect("]"), afterType) if (type == "[") return cont(typeexpr, expect("]"), afterType)
if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) } if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
if (value == "?") return cont(typeexpr, expect(":"), typeexpr)
} }
function maybeTypeArgs(_, value) { function maybeTypeArgs(_, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
@ -672,25 +684,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} }
function forspec(type, value) { function forspec(type, value) {
if (value == "await") return cont(forspec); if (value == "await") return cont(forspec);
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); if (type == "(") return cont(pushlex(")"), forspec1, poplex);
} }
function forspec1(type) { function forspec1(type) {
if (type == "var") return cont(vardef, expect(";"), forspec2); if (type == "var") return cont(vardef, forspec2);
if (type == ";") return cont(forspec2); if (type == "variable") return cont(forspec2);
if (type == "variable") return cont(formaybeinof); return pass(forspec2)
return pass(expression, expect(";"), forspec2);
}
function formaybeinof(_type, value) {
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
return cont(maybeoperatorComma, forspec2);
} }
function forspec2(type, value) { function forspec2(type, value) {
if (type == ";") return cont(forspec3); if (type == ")") return cont()
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } if (type == ";") return cont(forspec2)
return pass(expression, expect(";"), forspec3); if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) }
} return pass(expression, forspec2)
function forspec3(type) {
if (type != ")") cont(expression);
} }
function functiondef(type, value) { function functiondef(type, value) {
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
@ -698,10 +703,25 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef) if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
} }
function functiondecl(type, value) {
if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);}
if (type == "variable") {register(value); return cont(functiondecl);}
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext);
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl)
}
function typename(type, value) {
if (type == "keyword" || type == "variable") {
cx.marked = "type"
return cont(typename)
} else if (value == "<") {
return cont(pushlex(">"), commasep(typeparam, ">"), poplex)
}
}
function funarg(type, value) { function funarg(type, value) {
if (value == "@") cont(expression, funarg) if (value == "@") cont(expression, funarg)
if (type == "spread") return cont(funarg); if (type == "spread") return cont(funarg);
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); } if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
if (isTS && type == "this") return cont(maybetype, maybeAssign)
return pass(pattern, maybetype, maybeAssign); return pass(pattern, maybetype, maybeAssign);
} }
function classExpression(type, value) { function classExpression(type, value) {
@ -732,13 +752,15 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.marked = "property"; cx.marked = "property";
return cont(isTS ? classfield : functiondef, classBody); return cont(isTS ? classfield : functiondef, classBody);
} }
if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody);
if (type == "[") if (type == "[")
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody) return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
if (value == "*") { if (value == "*") {
cx.marked = "keyword"; cx.marked = "keyword";
return cont(classBody); return cont(classBody);
} }
if (type == ";") return cont(classBody); if (isTS && type == "(") return pass(functiondecl, classBody)
if (type == ";" || type == ",") return cont(classBody);
if (type == "}") return cont(); if (type == "}") return cont();
if (value == "@") return cont(expression, classBody) if (value == "@") return cont(expression, classBody)
} }
@ -746,7 +768,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "?") return cont(classfield) if (value == "?") return cont(classfield)
if (type == ":") return cont(typeexpr, maybeAssign) if (type == ":") return cont(typeexpr, maybeAssign)
if (value == "=") return cont(expressionNoComma) if (value == "=") return cont(expressionNoComma)
return pass(functiondef) var context = cx.state.lexical.prev, isInterface = context && context.info == "interface"
return pass(isInterface ? functiondecl : functiondef)
} }
function afterExport(type, value) { function afterExport(type, value) {
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }

View File

@ -35,4 +35,4 @@
.cm-s-base16-light span.cm-error { background: #ac4142; color: #505050; } .cm-s-base16-light span.cm-error { background: #ac4142; color: #505050; }
.cm-s-base16-light .CodeMirror-activeline-background { background: #DDDCDC; } .cm-s-base16-light .CodeMirror-activeline-background { background: #DDDCDC; }
.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } .cm-s-base16-light .CodeMirror-matchingbracket { color: #f5f5f5 !important; background-color: #6A9FB5 !important}

View File

@ -40,7 +40,7 @@ Ported to CodeMirror by Peter Kroon
.cm-s-lesser-dark span.cm-tag { color: #669199; } .cm-s-lesser-dark span.cm-tag { color: #669199; }
.cm-s-lesser-dark span.cm-attribute { color: #81a4d5; } .cm-s-lesser-dark span.cm-attribute { color: #81a4d5; }
.cm-s-lesser-dark span.cm-hr { color: #999; } .cm-s-lesser-dark span.cm-hr { color: #999; }
.cm-s-lesser-dark span.cm-link { color: #00c; } .cm-s-lesser-dark span.cm-link { color: #7070E6; }
.cm-s-lesser-dark span.cm-error { color: #9d1e15; } .cm-s-lesser-dark span.cm-error { color: #9d1e15; }
.cm-s-lesser-dark .CodeMirror-activeline-background { background: #3C3A3A; } .cm-s-lesser-dark .CodeMirror-activeline-background { background: #3C3A3A; }

View File

@ -1,9 +1,5 @@
/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ /* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */
/*<!--match-->*/
.cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; }
.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; }
/*<!--activeline-->*/ /*<!--activeline-->*/
.cm-s-midnight .CodeMirror-activeline-background { background: #253540; } .cm-s-midnight .CodeMirror-activeline-background { background: #253540; }

42
vendor/codemirror/theme/nord.css vendored Normal file
View File

@ -0,0 +1,42 @@
/* Based on arcticicestudio's Nord theme */
/* https://github.com/arcticicestudio/nord */
.cm-s-nord.CodeMirror { background: #2e3440; color: #d8dee9; }
.cm-s-nord div.CodeMirror-selected { background: #434c5e; }
.cm-s-nord .CodeMirror-line::selection, .cm-s-nord .CodeMirror-line > span::selection, .cm-s-nord .CodeMirror-line > span > span::selection { background: #3b4252; }
.cm-s-nord .CodeMirror-line::-moz-selection, .cm-s-nord .CodeMirror-line > span::-moz-selection, .cm-s-nord .CodeMirror-line > span > span::-moz-selection { background: #3b4252; }
.cm-s-nord .CodeMirror-gutters { background: #2e3440; border-right: 0px; }
.cm-s-nord .CodeMirror-guttermarker { color: #4c566a; }
.cm-s-nord .CodeMirror-guttermarker-subtle { color: #4c566a; }
.cm-s-nord .CodeMirror-linenumber { color: #4c566a; }
.cm-s-nord .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
.cm-s-nord span.cm-comment { color: #4c566a; }
.cm-s-nord span.cm-atom { color: #b48ead; }
.cm-s-nord span.cm-number { color: #b48ead; }
.cm-s-nord span.cm-comment.cm-attribute { color: #97b757; }
.cm-s-nord span.cm-comment.cm-def { color: #bc9262; }
.cm-s-nord span.cm-comment.cm-tag { color: #bc6283; }
.cm-s-nord span.cm-comment.cm-type { color: #5998a6; }
.cm-s-nord span.cm-property, .cm-s-nord span.cm-attribute { color: #8FBCBB; }
.cm-s-nord span.cm-keyword { color: #81A1C1; }
.cm-s-nord span.cm-builtin { color: #81A1C1; }
.cm-s-nord span.cm-string { color: #A3BE8C; }
.cm-s-nord span.cm-variable { color: #d8dee9; }
.cm-s-nord span.cm-variable-2 { color: #d8dee9; }
.cm-s-nord span.cm-variable-3, .cm-s-nord span.cm-type { color: #d8dee9; }
.cm-s-nord span.cm-def { color: #8FBCBB; }
.cm-s-nord span.cm-bracket { color: #81A1C1; }
.cm-s-nord span.cm-tag { color: #bf616a; }
.cm-s-nord span.cm-header { color: #b48ead; }
.cm-s-nord span.cm-link { color: #b48ead; }
.cm-s-nord span.cm-error { background: #bf616a; color: #f8f8f0; }
.cm-s-nord .CodeMirror-activeline-background { background: #3b4252; }
.cm-s-nord .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}

View File

@ -7,7 +7,7 @@
background: #292A2B; background: #292A2B;
color: #E6E6E6; color: #E6E6E6;
line-height: 1.5; line-height: 1.5;
font-family: 'Operator Mono', 'Source Sans Pro', Menlo, Monaco, Consolas, Courier New, monospace; font-family: 'Operator Mono', 'Source Code Pro', Menlo, Monaco, Consolas, Courier New, monospace;
} }
.cm-s-panda-syntax .CodeMirror-cursor { border-color: #ff2c6d; } .cm-s-panda-syntax .CodeMirror-cursor { border-color: #ff2c6d; }
.cm-s-panda-syntax .CodeMirror-activeline-background { .cm-s-panda-syntax .CodeMirror-activeline-background {

View File

@ -27,7 +27,7 @@
.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } .cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; }
.cm-s-vibrant-ink .cm-header { color: #FF6400; } .cm-s-vibrant-ink .cm-header { color: #FF6400; }
.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } .cm-s-vibrant-ink .cm-hr { color: #AEAEAE; }
.cm-s-vibrant-ink .cm-link { color: blue; } .cm-s-vibrant-ink .cm-link { color: #5656F3; }
.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } .cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; }
.cm-s-vibrant-ink .CodeMirror-activeline-background { background: #27282E; } .cm-s-vibrant-ink .CodeMirror-activeline-background { background: #27282E; }

59
vendor/codemirror/theme/yonce.css vendored Normal file
View File

@ -0,0 +1,59 @@
/*
Name: yoncé
Author: Thomas MacLean (http://github.com/thomasmaclean)
Original yoncé color scheme by Mina Markham (https://github.com/minamarkham)
*/
.cm-s-yonce.CodeMirror { background: #1C1C1C; color: #d4d4d4; } /**/
.cm-s-yonce div.CodeMirror-selected { background: rgba(252, 69, 133, 0.478); } /**/
.cm-s-yonce .CodeMirror-selectedtext,
.cm-s-yonce .CodeMirror-selected,
.cm-s-yonce .CodeMirror-line::selection,
.cm-s-yonce .CodeMirror-line > span::selection,
.cm-s-yonce .CodeMirror-line > span > span::selection,
.cm-s-yonce .CodeMirror-line::-moz-selection,
.cm-s-yonce .CodeMirror-line > span::-moz-selection,
.cm-s-yonce .CodeMirror-line > span > span::-moz-selection { background: rgba(252, 67, 132, 0.47); }
.cm-s-yonce.CodeMirror pre { padding-left: 0px; }
.cm-s-yonce .CodeMirror-gutters {background: #1C1C1C; border-right: 0px;}
.cm-s-yonce .CodeMirror-linenumber {color: #777777; padding-right: 10px; }
.cm-s-yonce .CodeMirror-activeline .CodeMirror-linenumber.CodeMirror-gutter-elt { background: #1C1C1C; color: #fc4384; }
.cm-s-yonce .CodeMirror-linenumber { color: #777; }
.cm-s-yonce .CodeMirror-cursor { border-left: 2px solid #FC4384; }
.cm-s-yonce .cm-searching { background: rgb(243, 155, 53, .3) !important; outline: 1px solid #F39B35; }
.cm-s-yonce .cm-searching.CodeMirror-selectedtext { background: rgb(243, 155, 53, .7) !important; color: white; }
.cm-s-yonce .cm-keyword { color: #00A7AA; } /**/
.cm-s-yonce .cm-atom { color: #F39B35; }
.cm-s-yonce .cm-number, .cm-s-yonce span.cm-type { color: #A06FCA; } /**/
.cm-s-yonce .cm-def { color: #98E342; }
.cm-s-yonce .cm-property,
.cm-s-yonce span.cm-variable { color: #D4D4D4; font-style: italic; }
.cm-s-yonce span.cm-variable-2 { color: #da7dae; font-style: italic; }
.cm-s-yonce span.cm-variable-3 { color: #A06FCA; }
.cm-s-yonce .cm-type.cm-def { color: #FC4384; font-style: normal; text-decoration: underline; }
.cm-s-yonce .cm-property.cm-def { color: #FC4384; font-style: normal; }
.cm-s-yonce .cm-callee { color: #FC4384; font-style: normal; }
.cm-s-yonce .cm-operator { color: #FC4384; } /**/
.cm-s-yonce .cm-qualifier,
.cm-s-yonce .cm-tag { color: #FC4384; }
.cm-s-yonce .cm-tag.cm-bracket { color: #D4D4D4; }
.cm-s-yonce .cm-attribute { color: #A06FCA; }
.cm-s-yonce .cm-comment { color:#696d70; font-style:italic; font-weight:normal; } /**/
.cm-s-yonce .cm-comment.cm-tag { color: #FC4384 }
.cm-s-yonce .cm-comment.cm-attribute { color: #D4D4D4; }
.cm-s-yonce .cm-string { color:#E6DB74; } /**/
.cm-s-yonce .cm-string-2 { color:#F39B35; } /*?*/
.cm-s-yonce .cm-meta { color: #D4D4D4; background: inherit; }
.cm-s-yonce .cm-builtin { color: #FC4384; } /*?*/
.cm-s-yonce .cm-header { color: #da7dae; }
.cm-s-yonce .cm-hr { color: #98E342; }
.cm-s-yonce .cm-link { color:#696d70; font-style:italic; text-decoration:none; } /**/
.cm-s-yonce .cm-error { border-bottom: 1px solid #C42412; }
.cm-s-yonce .CodeMirror-activeline-background { background: #272727; }
.cm-s-yonce .CodeMirror-matchingbracket { outline:1px solid grey; color:#D4D4D4 !important; }

View File

@ -1,8 +1,8 @@
## Dropbox SDK v4.0.13 ## Dropbox SDK v4.0.28
Dropbox SDK JS installed via npm - source repo: Dropbox SDK JS installed via npm - source repo:
https://github.com/dropbox/dropbox-sdk-js/tree/v4.0.13 https://github.com/dropbox/dropbox-sdk-js/tree/v4.0.28
The source repo **does not** include the `dist` folder with the generated `dropbox-sdk.js` The source repo **does not** include the `dist` folder with the generated `dropbox-sdk.js`
distribution file. It can only be obtained from the npm `node_modules` folder after installing distribution file. It can only be obtained from the npm `node_modules` folder after installing

View File

@ -328,6 +328,21 @@ routes.filesCopy = function (arg) {
return this.request('files/copy', arg, 'user', 'api', 'rpc'); return this.request('files/copy', arg, 'user', 'api', 'rpc');
}; };
/**
* Copy multiple files or folders to different locations at once in the user's
* Dropbox. This route will replace copy_batch. The main difference is this
* route will return stutus for each entry, while copy_batch raises failure if
* any entry fails. This route will either finish synchronously, or return a job
* ID and do the async copy job in background. Please use copy_batch/check_v2 to
* check the job status.
* @function Dropbox#filesCopyBatchV2
* @arg {Object} arg - The request parameters.
* @returns {Promise.<FilesRelocationBatchV2Launch, Error.<void>>}
*/
routes.filesCopyBatchV2 = function (arg) {
return this.request('files/copy_batch_v2', arg, 'user', 'api', 'rpc');
};
/** /**
* Copy multiple files or folders to different locations at once in the user's * Copy multiple files or folders to different locations at once in the user's
* Dropbox. If RelocationBatchArg.allow_shared_folder is false, this route is * Dropbox. If RelocationBatchArg.allow_shared_folder is false, this route is
@ -337,6 +352,7 @@ routes.filesCopy = function (arg) {
* This route will return job ID immediately and do the async copy job in * This route will return job ID immediately and do the async copy job in
* background. Please use copy_batch/check to check the job status. * background. Please use copy_batch/check to check the job status.
* @function Dropbox#filesCopyBatch * @function Dropbox#filesCopyBatch
* @deprecated
* @arg {FilesRelocationBatchArg} arg - The request parameters. * @arg {FilesRelocationBatchArg} arg - The request parameters.
* @returns {Promise.<FilesRelocationBatchLaunch, Error.<void>>} * @returns {Promise.<FilesRelocationBatchLaunch, Error.<void>>}
*/ */
@ -344,10 +360,22 @@ routes.filesCopyBatch = function (arg) {
return this.request('files/copy_batch', arg, 'user', 'api', 'rpc'); return this.request('files/copy_batch', arg, 'user', 'api', 'rpc');
}; };
/**
* Returns the status of an asynchronous job for copy_batch_v2. It returns list
* of results for each entry.
* @function Dropbox#filesCopyBatchCheckV2
* @arg {AsyncPollArg} arg - The request parameters.
* @returns {Promise.<FilesRelocationBatchV2JobStatus, Error.<AsyncPollError>>}
*/
routes.filesCopyBatchCheckV2 = function (arg) {
return this.request('files/copy_batch/check_v2', arg, 'user', 'api', 'rpc');
};
/** /**
* Returns the status of an asynchronous job for copy_batch. If success, it * Returns the status of an asynchronous job for copy_batch. If success, it
* returns list of results for each entry. * returns list of results for each entry.
* @function Dropbox#filesCopyBatchCheck * @function Dropbox#filesCopyBatchCheck
* @deprecated
* @arg {AsyncPollArg} arg - The request parameters. * @arg {AsyncPollArg} arg - The request parameters.
* @returns {Promise.<FilesRelocationBatchJobStatus, Error.<AsyncPollError>>} * @returns {Promise.<FilesRelocationBatchJobStatus, Error.<AsyncPollError>>}
*/ */
@ -706,6 +734,21 @@ routes.filesMove = function (arg) {
return this.request('files/move', arg, 'user', 'api', 'rpc'); return this.request('files/move', arg, 'user', 'api', 'rpc');
}; };
/**
* Move multiple files or folders to different locations at once in the user's
* Dropbox. This route will replace move_batch_v2. The main difference is this
* route will return stutus for each entry, while move_batch raises failure if
* any entry fails. This route will either finish synchronously, or return a job
* ID and do the async move job in background. Please use move_batch/check_v2 to
* check the job status.
* @function Dropbox#filesMoveBatchV2
* @arg {FilesMoveBatchArg} arg - The request parameters.
* @returns {Promise.<FilesRelocationBatchV2Launch, Error.<void>>}
*/
routes.filesMoveBatchV2 = function (arg) {
return this.request('files/move_batch_v2', arg, 'user', 'api', 'rpc');
};
/** /**
* Move multiple files or folders to different locations at once in the user's * Move multiple files or folders to different locations at once in the user's
* Dropbox. This route is 'all or nothing', which means if one entry fails, the * Dropbox. This route is 'all or nothing', which means if one entry fails, the
@ -720,6 +763,17 @@ routes.filesMoveBatch = function (arg) {
return this.request('files/move_batch', arg, 'user', 'api', 'rpc'); return this.request('files/move_batch', arg, 'user', 'api', 'rpc');
}; };
/**
* Returns the status of an asynchronous job for move_batch_v2. It returns list
* of results for each entry.
* @function Dropbox#filesMoveBatchCheckV2
* @arg {AsyncPollArg} arg - The request parameters.
* @returns {Promise.<FilesRelocationBatchV2JobStatus, Error.<AsyncPollError>>}
*/
routes.filesMoveBatchCheckV2 = function (arg) {
return this.request('files/move_batch/check_v2', arg, 'user', 'api', 'rpc');
};
/** /**
* Returns the status of an asynchronous job for move_batch. If success, it * Returns the status of an asynchronous job for move_batch. If success, it
* returns list of results for each entry. * returns list of results for each entry.
@ -814,8 +868,10 @@ routes.filesRestore = function (arg) {
}; };
/** /**
* Save a specified URL into a file in user's Dropbox. If the given path already * Save the data from a specified URL into a file in user's Dropbox. Note that
* exists, the file will be renamed to avoid the conflict (e.g. myfile (1).txt). * the transfer from the URL must complete within 5 minutes, or the operation
* will time out and the job will fail. If the given path already exists, the
* file will be renamed to avoid the conflict (e.g. myfile (1).txt).
* @function Dropbox#filesSaveUrl * @function Dropbox#filesSaveUrl
* @arg {FilesSaveUrlArg} arg - The request parameters. * @arg {FilesSaveUrlArg} arg - The request parameters.
* @returns {Promise.<FilesSaveUrlResult, Error.<FilesSaveUrlError>>} * @returns {Promise.<FilesSaveUrlResult, Error.<FilesSaveUrlError>>}
@ -1169,7 +1225,7 @@ routes.sharingAddFileMember = function (arg) {
* Allows an owner or editor (if the ACL update policy allows) of a shared * Allows an owner or editor (if the ACL update policy allows) of a shared
* folder to add another member. For the new member to get access to all the * folder to add another member. For the new member to get access to all the
* functionality for this folder, you will need to call mount_folder on their * functionality for this folder, you will need to call mount_folder on their
* behalf. Apps must have full Dropbox access to use this endpoint. * behalf.
* @function Dropbox#sharingAddFolderMember * @function Dropbox#sharingAddFolderMember
* @arg {SharingAddFolderMemberArg} arg - The request parameters. * @arg {SharingAddFolderMemberArg} arg - The request parameters.
* @returns {Promise.<void, Error.<SharingAddFolderMemberError>>} * @returns {Promise.<void, Error.<SharingAddFolderMemberError>>}
@ -1190,8 +1246,7 @@ routes.sharingChangeFileMemberAccess = function (arg) {
}; };
/** /**
* Returns the status of an asynchronous job. Apps must have full Dropbox access * Returns the status of an asynchronous job.
* to use this endpoint.
* @function Dropbox#sharingCheckJobStatus * @function Dropbox#sharingCheckJobStatus
* @arg {AsyncPollArg} arg - The request parameters. * @arg {AsyncPollArg} arg - The request parameters.
* @returns {Promise.<SharingJobStatus, Error.<AsyncPollError>>} * @returns {Promise.<SharingJobStatus, Error.<AsyncPollError>>}
@ -1201,8 +1256,7 @@ routes.sharingCheckJobStatus = function (arg) {
}; };
/** /**
* Returns the status of an asynchronous job for sharing a folder. Apps must * Returns the status of an asynchronous job for sharing a folder.
* have full Dropbox access to use this endpoint.
* @function Dropbox#sharingCheckRemoveMemberJobStatus * @function Dropbox#sharingCheckRemoveMemberJobStatus
* @arg {AsyncPollArg} arg - The request parameters. * @arg {AsyncPollArg} arg - The request parameters.
* @returns {Promise.<SharingRemoveMemberJobStatus, Error.<AsyncPollError>>} * @returns {Promise.<SharingRemoveMemberJobStatus, Error.<AsyncPollError>>}
@ -1212,8 +1266,7 @@ routes.sharingCheckRemoveMemberJobStatus = function (arg) {
}; };
/** /**
* Returns the status of an asynchronous job for sharing a folder. Apps must * Returns the status of an asynchronous job for sharing a folder.
* have full Dropbox access to use this endpoint.
* @function Dropbox#sharingCheckShareJobStatus * @function Dropbox#sharingCheckShareJobStatus
* @arg {AsyncPollArg} arg - The request parameters. * @arg {AsyncPollArg} arg - The request parameters.
* @returns {Promise.<SharingShareFolderJobStatus, Error.<AsyncPollError>>} * @returns {Promise.<SharingShareFolderJobStatus, Error.<AsyncPollError>>}
@ -1273,8 +1326,7 @@ routes.sharingGetFileMetadataBatch = function (arg) {
}; };
/** /**
* Returns shared folder metadata by its folder ID. Apps must have full Dropbox * Returns shared folder metadata by its folder ID.
* access to use this endpoint.
* @function Dropbox#sharingGetFolderMetadata * @function Dropbox#sharingGetFolderMetadata
* @arg {SharingGetMetadataArgs} arg - The request parameters. * @arg {SharingGetMetadataArgs} arg - The request parameters.
* @returns {Promise.<SharingSharedFolderMetadata, Error.<SharingSharedFolderAccessError>>} * @returns {Promise.<SharingSharedFolderMetadata, Error.<SharingSharedFolderAccessError>>}
@ -1357,8 +1409,7 @@ routes.sharingListFileMembersContinue = function (arg) {
}; };
/** /**
* Returns shared folder membership by its folder ID. Apps must have full * Returns shared folder membership by its folder ID.
* Dropbox access to use this endpoint.
* @function Dropbox#sharingListFolderMembers * @function Dropbox#sharingListFolderMembers
* @arg {SharingListFolderMembersArgs} arg - The request parameters. * @arg {SharingListFolderMembersArgs} arg - The request parameters.
* @returns {Promise.<SharingSharedFolderMembers, Error.<SharingSharedFolderAccessError>>} * @returns {Promise.<SharingSharedFolderMembers, Error.<SharingSharedFolderAccessError>>}
@ -1369,8 +1420,7 @@ routes.sharingListFolderMembers = function (arg) {
/** /**
* Once a cursor has been retrieved from list_folder_members, use this to * Once a cursor has been retrieved from list_folder_members, use this to
* paginate through all shared folder members. Apps must have full Dropbox * paginate through all shared folder members.
* access to use this endpoint.
* @function Dropbox#sharingListFolderMembersContinue * @function Dropbox#sharingListFolderMembersContinue
* @arg {SharingListFolderMembersContinueArg} arg - The request parameters. * @arg {SharingListFolderMembersContinueArg} arg - The request parameters.
* @returns {Promise.<SharingSharedFolderMembers, Error.<SharingListFolderMembersContinueError>>} * @returns {Promise.<SharingSharedFolderMembers, Error.<SharingListFolderMembersContinueError>>}
@ -1380,8 +1430,7 @@ routes.sharingListFolderMembersContinue = function (arg) {
}; };
/** /**
* Return the list of all shared folders the current user has access to. Apps * Return the list of all shared folders the current user has access to.
* must have full Dropbox access to use this endpoint.
* @function Dropbox#sharingListFolders * @function Dropbox#sharingListFolders
* @arg {SharingListFoldersArgs} arg - The request parameters. * @arg {SharingListFoldersArgs} arg - The request parameters.
* @returns {Promise.<SharingListFoldersResult, Error.<void>>} * @returns {Promise.<SharingListFoldersResult, Error.<void>>}
@ -1393,8 +1442,7 @@ routes.sharingListFolders = function (arg) {
/** /**
* Once a cursor has been retrieved from list_folders, use this to paginate * Once a cursor has been retrieved from list_folders, use this to paginate
* through all shared folders. The cursor must come from a previous call to * through all shared folders. The cursor must come from a previous call to
* list_folders or list_folders/continue. Apps must have full Dropbox access to * list_folders or list_folders/continue.
* use this endpoint.
* @function Dropbox#sharingListFoldersContinue * @function Dropbox#sharingListFoldersContinue
* @arg {SharingListFoldersContinueArg} arg - The request parameters. * @arg {SharingListFoldersContinueArg} arg - The request parameters.
* @returns {Promise.<SharingListFoldersResult, Error.<SharingListFoldersContinueError>>} * @returns {Promise.<SharingListFoldersResult, Error.<SharingListFoldersContinueError>>}
@ -1405,7 +1453,6 @@ routes.sharingListFoldersContinue = function (arg) {
/** /**
* Return the list of all shared folders the current user can mount or unmount. * Return the list of all shared folders the current user can mount or unmount.
* Apps must have full Dropbox access to use this endpoint.
* @function Dropbox#sharingListMountableFolders * @function Dropbox#sharingListMountableFolders
* @arg {SharingListFoldersArgs} arg - The request parameters. * @arg {SharingListFoldersArgs} arg - The request parameters.
* @returns {Promise.<SharingListFoldersResult, Error.<void>>} * @returns {Promise.<SharingListFoldersResult, Error.<void>>}
@ -1418,7 +1465,6 @@ routes.sharingListMountableFolders = function (arg) {
* Once a cursor has been retrieved from list_mountable_folders, use this to * Once a cursor has been retrieved from list_mountable_folders, use this to
* paginate through all mountable shared folders. The cursor must come from a * paginate through all mountable shared folders. The cursor must come from a
* previous call to list_mountable_folders or list_mountable_folders/continue. * previous call to list_mountable_folders or list_mountable_folders/continue.
* Apps must have full Dropbox access to use this endpoint.
* @function Dropbox#sharingListMountableFoldersContinue * @function Dropbox#sharingListMountableFoldersContinue
* @arg {SharingListFoldersContinueArg} arg - The request parameters. * @arg {SharingListFoldersContinueArg} arg - The request parameters.
* @returns {Promise.<SharingListFoldersResult, Error.<SharingListFoldersContinueError>>} * @returns {Promise.<SharingListFoldersResult, Error.<SharingListFoldersContinueError>>}
@ -1481,8 +1527,7 @@ routes.sharingModifySharedLinkSettings = function (arg) {
/** /**
* The current user mounts the designated folder. Mount a shared folder for a * The current user mounts the designated folder. Mount a shared folder for a
* user after they have been added as a member. Once mounted, the shared folder * user after they have been added as a member. Once mounted, the shared folder
* will appear in their Dropbox. Apps must have full Dropbox access to use this * will appear in their Dropbox.
* endpoint.
* @function Dropbox#sharingMountFolder * @function Dropbox#sharingMountFolder
* @arg {SharingMountFolderArg} arg - The request parameters. * @arg {SharingMountFolderArg} arg - The request parameters.
* @returns {Promise.<SharingSharedFolderMetadata, Error.<SharingMountFolderError>>} * @returns {Promise.<SharingSharedFolderMetadata, Error.<SharingMountFolderError>>}
@ -1494,7 +1539,7 @@ routes.sharingMountFolder = function (arg) {
/** /**
* The current user relinquishes their membership in the designated file. Note * The current user relinquishes their membership in the designated file. Note
* that the current user may still have inherited access to this file through * that the current user may still have inherited access to this file through
* the parent folder. Apps must have full Dropbox access to use this endpoint. * the parent folder.
* @function Dropbox#sharingRelinquishFileMembership * @function Dropbox#sharingRelinquishFileMembership
* @arg {SharingRelinquishFileMembershipArg} arg - The request parameters. * @arg {SharingRelinquishFileMembershipArg} arg - The request parameters.
* @returns {Promise.<void, Error.<SharingRelinquishFileMembershipError>>} * @returns {Promise.<void, Error.<SharingRelinquishFileMembershipError>>}
@ -1507,8 +1552,7 @@ routes.sharingRelinquishFileMembership = function (arg) {
* The current user relinquishes their membership in the designated shared * The current user relinquishes their membership in the designated shared
* folder and will no longer have access to the folder. A folder owner cannot * folder and will no longer have access to the folder. A folder owner cannot
* relinquish membership in their own folder. This will run synchronously if * relinquish membership in their own folder. This will run synchronously if
* leave_a_copy is false, and asynchronously if leave_a_copy is true. Apps must * leave_a_copy is false, and asynchronously if leave_a_copy is true.
* have full Dropbox access to use this endpoint.
* @function Dropbox#sharingRelinquishFolderMembership * @function Dropbox#sharingRelinquishFolderMembership
* @arg {SharingRelinquishFolderMembershipArg} arg - The request parameters. * @arg {SharingRelinquishFolderMembershipArg} arg - The request parameters.
* @returns {Promise.<AsyncLaunchEmptyResult, Error.<SharingRelinquishFolderMembershipError>>} * @returns {Promise.<AsyncLaunchEmptyResult, Error.<SharingRelinquishFolderMembershipError>>}
@ -1540,8 +1584,7 @@ routes.sharingRemoveFileMember2 = function (arg) {
/** /**
* Allows an owner or editor (if the ACL update policy allows) of a shared * Allows an owner or editor (if the ACL update policy allows) of a shared
* folder to remove another member. Apps must have full Dropbox access to use * folder to remove another member.
* this endpoint.
* @function Dropbox#sharingRemoveFolderMember * @function Dropbox#sharingRemoveFolderMember
* @arg {SharingRemoveFolderMemberArg} arg - The request parameters. * @arg {SharingRemoveFolderMemberArg} arg - The request parameters.
* @returns {Promise.<AsyncLaunchResultBase, Error.<SharingRemoveFolderMemberError>>} * @returns {Promise.<AsyncLaunchResultBase, Error.<SharingRemoveFolderMemberError>>}
@ -1583,7 +1626,7 @@ routes.sharingSetAccessInheritance = function (arg) {
* testing the async case repeatable, set `ShareFolderArg.force_async`. If a * testing the async case repeatable, set `ShareFolderArg.force_async`. If a
* ShareFolderLaunch.async_job_id is returned, you'll need to call * ShareFolderLaunch.async_job_id is returned, you'll need to call
* check_share_job_status until the action completes to get the metadata for the * check_share_job_status until the action completes to get the metadata for the
* folder. Apps must have full Dropbox access to use this endpoint. * folder.
* @function Dropbox#sharingShareFolder * @function Dropbox#sharingShareFolder
* @arg {SharingShareFolderArg} arg - The request parameters. * @arg {SharingShareFolderArg} arg - The request parameters.
* @returns {Promise.<SharingShareFolderLaunch, Error.<SharingShareFolderError>>} * @returns {Promise.<SharingShareFolderLaunch, Error.<SharingShareFolderError>>}
@ -1595,7 +1638,7 @@ routes.sharingShareFolder = function (arg) {
/** /**
* Transfer ownership of a shared folder to a member of the shared folder. User * Transfer ownership of a shared folder to a member of the shared folder. User
* must have AccessLevel.owner access to the shared folder to perform a * must have AccessLevel.owner access to the shared folder to perform a
* transfer. Apps must have full Dropbox access to use this endpoint. * transfer.
* @function Dropbox#sharingTransferFolder * @function Dropbox#sharingTransferFolder
* @arg {SharingTransferFolderArg} arg - The request parameters. * @arg {SharingTransferFolderArg} arg - The request parameters.
* @returns {Promise.<void, Error.<SharingTransferFolderError>>} * @returns {Promise.<void, Error.<SharingTransferFolderError>>}
@ -1606,8 +1649,7 @@ routes.sharingTransferFolder = function (arg) {
/** /**
* The current user unmounts the designated folder. They can re-mount the folder * The current user unmounts the designated folder. They can re-mount the folder
* at a later time using mount_folder. Apps must have full Dropbox access to use * at a later time using mount_folder.
* this endpoint.
* @function Dropbox#sharingUnmountFolder * @function Dropbox#sharingUnmountFolder
* @arg {SharingUnmountFolderArg} arg - The request parameters. * @arg {SharingUnmountFolderArg} arg - The request parameters.
* @returns {Promise.<void, Error.<SharingUnmountFolderError>>} * @returns {Promise.<void, Error.<SharingUnmountFolderError>>}
@ -1628,8 +1670,7 @@ routes.sharingUnshareFile = function (arg) {
/** /**
* Allows a shared folder owner to unshare the folder. You'll need to call * Allows a shared folder owner to unshare the folder. You'll need to call
* check_job_status to determine if the action has completed successfully. Apps * check_job_status to determine if the action has completed successfully.
* must have full Dropbox access to use this endpoint.
* @function Dropbox#sharingUnshareFolder * @function Dropbox#sharingUnshareFolder
* @arg {SharingUnshareFolderArg} arg - The request parameters. * @arg {SharingUnshareFolderArg} arg - The request parameters.
* @returns {Promise.<AsyncLaunchEmptyResult, Error.<SharingUnshareFolderError>>} * @returns {Promise.<AsyncLaunchEmptyResult, Error.<SharingUnshareFolderError>>}
@ -1650,7 +1691,7 @@ routes.sharingUpdateFileMember = function (arg) {
/** /**
* Allows an owner or editor of a shared folder to update another member's * Allows an owner or editor of a shared folder to update another member's
* permissions. Apps must have full Dropbox access to use this endpoint. * permissions.
* @function Dropbox#sharingUpdateFolderMember * @function Dropbox#sharingUpdateFolderMember
* @arg {SharingUpdateFolderMemberArg} arg - The request parameters. * @arg {SharingUpdateFolderMemberArg} arg - The request parameters.
* @returns {Promise.<SharingMemberAccessLevelResult, Error.<SharingUpdateFolderMemberError>>} * @returns {Promise.<SharingMemberAccessLevelResult, Error.<SharingUpdateFolderMemberError>>}
@ -1661,8 +1702,7 @@ routes.sharingUpdateFolderMember = function (arg) {
/** /**
* Update the sharing policies for a shared folder. User must have * Update the sharing policies for a shared folder. User must have
* AccessLevel.owner access to the shared folder to update its policies. Apps * AccessLevel.owner access to the shared folder to update its policies.
* must have full Dropbox access to use this endpoint.
* @function Dropbox#sharingUpdateFolderPolicy * @function Dropbox#sharingUpdateFolderPolicy
* @arg {SharingUpdateFolderPolicyArg} arg - The request parameters. * @arg {SharingUpdateFolderPolicyArg} arg - The request parameters.
* @returns {Promise.<SharingSharedFolderMetadata, Error.<SharingUpdateFolderPolicyError>>} * @returns {Promise.<SharingSharedFolderMetadata, Error.<SharingUpdateFolderPolicyError>>}
@ -1920,6 +1960,9 @@ function downloadRequest(fetch) {
if (options.selectAdmin) { if (options.selectAdmin) {
fetchOptions.headers['Dropbox-API-Select-Admin'] = options.selectAdmin; fetchOptions.headers['Dropbox-API-Select-Admin'] = options.selectAdmin;
} }
if (options.pathRoot) {
fetchOptions.headers['Dropbox-API-Path-Root'] = options.pathRoot;
}
} }
return fetch(getBaseURL(host) + path, fetchOptions).then(function (res) { return fetch(getBaseURL(host) + path, fetchOptions).then(function (res) {
@ -1978,6 +2021,9 @@ function uploadRequest(fetch) {
if (options.selectAdmin) { if (options.selectAdmin) {
fetchOptions.headers['Dropbox-API-Select-Admin'] = options.selectAdmin; fetchOptions.headers['Dropbox-API-Select-Admin'] = options.selectAdmin;
} }
if (options.pathRoot) {
fetchOptions.headers['Dropbox-API-Path-Root'] = options.pathRoot;
}
} }
return fetch(getBaseURL(host) + path, fetchOptions).then(function (res) { return fetch(getBaseURL(host) + path, fetchOptions).then(function (res) {
@ -3982,6 +4028,9 @@ function rpcRequest(fetch) {
if (options.selectAdmin) { if (options.selectAdmin) {
headers['Dropbox-API-Select-Admin'] = options.selectAdmin; headers['Dropbox-API-Select-Admin'] = options.selectAdmin;
} }
if (options.pathRoot) {
headers['Dropbox-API-Path-Root'] = options.pathRoot;
}
} }
fetchOptions.headers = headers; fetchOptions.headers = headers;
@ -4111,6 +4160,8 @@ if (!Array.prototype.includes) {
* to act as. * to act as.
* @arg {String} [options.selectAdmin] - Team admin that the team access token would like * @arg {String} [options.selectAdmin] - Team admin that the team access token would like
* to act as. * to act as.
* @arg {String} [options.pathRoot] - root pass to access other namespaces
* Use to access team folders for example
*/ */
function parseBodyToType(res) { function parseBodyToType(res) {
@ -4139,6 +4190,7 @@ var DropboxBase = function () {
this.selectUser = options.selectUser; this.selectUser = options.selectUser;
this.selectAdmin = options.selectAdmin; this.selectAdmin = options.selectAdmin;
this.fetch = options.fetch || fetch; this.fetch = options.fetch || fetch;
this.pathRoot = options.pathRoot;
if (!options.fetch) { if (!options.fetch) {
console.warn('Global fetch is deprecated and will be unsupported in a future version. Please pass fetch function as option when instantiating dropbox instance: new Dropbox({fetch})'); console.warn('Global fetch is deprecated and will be unsupported in a future version. Please pass fetch function as option when instantiating dropbox instance: new Dropbox({fetch})');
} // eslint-disable-line no-console } // eslint-disable-line no-console
@ -4332,13 +4384,16 @@ var DropboxBase = function () {
var removed = false; var removed = false;
var browser = window.open(url, '_blank'); var browser = window.open(url, '_blank');
function onLoadError() { function onLoadError(event) {
if (event.code !== -999) {
// Workaround to fix wrong behavior on cordova-plugin-inappbrowser
// Try to avoid a browser crash on browser.close(). // Try to avoid a browser crash on browser.close().
window.setTimeout(function () { window.setTimeout(function () {
browser.close(); browser.close();
}, 10); }, 10);
errorCallback(); errorCallback();
} }
}
function onLoadStop(event) { function onLoadStop(event) {
var errorLabel = '&error='; var errorLabel = '&error=';
@ -4402,7 +4457,8 @@ var DropboxBase = function () {
selectUser: this.selectUser, selectUser: this.selectUser,
selectAdmin: this.selectAdmin, selectAdmin: this.selectAdmin,
clientId: this.getClientId(), clientId: this.getClientId(),
clientSecret: this.getClientSecret() clientSecret: this.getClientSecret(),
pathRoot: this.pathRoot
}; };
return request(path, args, auth, host, this.getAccessToken(), options); return request(path, args, auth, host, this.getAccessToken(), options);
} }
@ -4462,6 +4518,8 @@ var DropboxBase = function () {
* authentication URL. * authentication URL.
* @arg {String} [options.selectUser] - Select user is only used by DropboxTeam. * @arg {String} [options.selectUser] - Select user is only used by DropboxTeam.
* It specifies which user the team access token should be acting as. * It specifies which user the team access token should be acting as.
* @arg {String} [options.pathRoot] - root pass to access other namespaces
* Use to access team folders for example
*/ */
var Dropbox = function (_DropboxBase) { var Dropbox = function (_DropboxBase) {
inherits(Dropbox, _DropboxBase); inherits(Dropbox, _DropboxBase);
@ -4504,7 +4562,7 @@ routes$1.teamDevicesListMemberDevices = function (arg) {
}; };
/** /**
* List all device sessions of a team. * List all device sessions of a team. Permission : Team member file access.
* @function DropboxTeam#teamDevicesListMembersDevices * @function DropboxTeam#teamDevicesListMembersDevices
* @arg {TeamListMembersDevicesArg} arg - The request parameters. * @arg {TeamListMembersDevicesArg} arg - The request parameters.
* @returns {Promise.<TeamListMembersDevicesResult, Error.<TeamListMembersDevicesError>>} * @returns {Promise.<TeamListMembersDevicesResult, Error.<TeamListMembersDevicesError>>}
@ -4514,7 +4572,7 @@ routes$1.teamDevicesListMembersDevices = function (arg) {
}; };
/** /**
* List all device sessions of a team. * List all device sessions of a team. Permission : Team member file access.
* @function DropboxTeam#teamDevicesListTeamDevices * @function DropboxTeam#teamDevicesListTeamDevices
* @deprecated * @deprecated
* @arg {TeamListTeamDevicesArg} arg - The request parameters. * @arg {TeamListTeamDevicesArg} arg - The request parameters.
@ -5046,6 +5104,7 @@ routes$1.teamNamespacesListContinue = function (arg) {
}; };
/** /**
* Permission : Team member file access.
* @function DropboxTeam#teamPropertiesTemplateAdd * @function DropboxTeam#teamPropertiesTemplateAdd
* @deprecated * @deprecated
* @arg {FilePropertiesAddTemplateArg} arg - The request parameters. * @arg {FilePropertiesAddTemplateArg} arg - The request parameters.
@ -5056,6 +5115,7 @@ routes$1.teamPropertiesTemplateAdd = function (arg) {
}; };
/** /**
* Permission : Team member file access.
* @function DropboxTeam#teamPropertiesTemplateGet * @function DropboxTeam#teamPropertiesTemplateGet
* @deprecated * @deprecated
* @arg {FilePropertiesGetTemplateArg} arg - The request parameters. * @arg {FilePropertiesGetTemplateArg} arg - The request parameters.
@ -5066,6 +5126,7 @@ routes$1.teamPropertiesTemplateGet = function (arg) {
}; };
/** /**
* Permission : Team member file access.
* @function DropboxTeam#teamPropertiesTemplateList * @function DropboxTeam#teamPropertiesTemplateList
* @deprecated * @deprecated
* @arg {void} arg - The request parameters. * @arg {void} arg - The request parameters.
@ -5076,6 +5137,7 @@ routes$1.teamPropertiesTemplateList = function (arg) {
}; };
/** /**
* Permission : Team member file access.
* @function DropboxTeam#teamPropertiesTemplateUpdate * @function DropboxTeam#teamPropertiesTemplateUpdate
* @deprecated * @deprecated
* @arg {FilePropertiesUpdateTemplateArg} arg - The request parameters. * @arg {FilePropertiesUpdateTemplateArg} arg - The request parameters.