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',
'neo',
'night',
'nord',
'oceanic-next',
'panda-syntax',
'paraiso-dark',
@ -57,5 +58,6 @@ const CODEMIRROR_THEMES = [
'xq-dark',
'xq-light',
'yeti',
'yonce',
'zenburn'
];

View File

@ -1,6 +1,6 @@
{
"name": "Stylus",
"version": "1.5.2",
"version": "1.5.3",
"minimum_chrome_version": "49",
"description": "__MSG_description__",
"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.

View File

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

View File

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

View File

@ -46,6 +46,10 @@
completion.update(true);
});
CodeMirror.defineExtension("closeHint", function() {
if (this.state.completionActive) this.state.completionActive.close()
})
function Completion(cm, options) {
this.cm = cm;
this.options = options;
@ -163,6 +167,14 @@
Tab: handle.pick,
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 ourMap = custom ? {} : baseMap;
function addBinding(key, val) {
@ -217,14 +229,26 @@
elt.hintId = i;
}
var container = completion.options.container || ownerDocument.body;
var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
var left = pos.left, top = pos.bottom, below = true;
hints.style.left = left + "px";
hints.style.top = top + "px";
var offsetLeft = 0, offsetTop = 0;
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.
var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);
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 scrolls = hints.scrollHeight > hints.clientHeight + 1
var startScroll = cm.getScrollInfo();
@ -232,15 +256,15 @@
if (overlapY > 0) {
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
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;
} else if (height > winH) {
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();
if (data.from.ch != cursor.ch) {
pos = cm.cursorCoords(cursor);
hints.style.left = (left = pos.left) + "px";
hints.style.left = (left = pos.left - offsetLeft) + "px";
box = hints.getBoundingClientRect();
}
}
@ -251,7 +275,7 @@
hints.style.width = (winW - 5) + "px";
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)
node.style.paddingRight = cm.display.nativeBarWidth + "px"

View File

@ -46,7 +46,7 @@
if (match.from.line >= this.gap.to) break;
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;
while (cursor.findNext()) {
var match = {from: cursor.from(), to: cursor.to()};

View File

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

View File

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

View File

@ -53,6 +53,7 @@
{ keys: '<Down>', type: 'keyToKey', toKeys: 'j' },
{ keys: '<Space>', type: 'keyToKey', toKeys: 'l' },
{ 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-BS>', type: 'keyToKey', toKeys: 'B', context: 'normal' },
{ 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: 'operator', operator: 'changeCase', context: 'visual'},
{ 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
{ keys: '<C-i>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }},
{ keys: '<C-o>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }},
@ -283,7 +286,9 @@
enterVimMode(cm);
}
function fatCursorMarks(cm) {
function updateFatCursorMark(cm) {
if (!cm.state.fatCursorMarks) return;
clearFatCursorMark(cm);
var ranges = cm.listSelections(), result = []
for (var i = 0; i < ranges.length; i++) {
var range = ranges[i]
@ -299,25 +304,26 @@
}
}
}
return result
cm.state.fatCursorMarks = result;
}
function updateFatCursorMark(cm) {
var marks = cm.state.fatCursorMarks
if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear()
cm.state.fatCursorMarks = fatCursorMarks(cm)
function clearFatCursorMark(cm) {
var marks = cm.state.fatCursorMarks;
if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();
}
function enableFatCursorMark(cm) {
cm.state.fatCursorMarks = fatCursorMarks(cm)
cm.state.fatCursorMarks = [];
updateFatCursorMark(cm)
cm.on("cursorActivity", updateFatCursorMark)
}
function disableFatCursorMark(cm) {
var marks = cm.state.fatCursorMarks
if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear()
cm.state.fatCursorMarks = null
cm.off("cursorActivity", updateFatCursorMark)
clearFatCursorMark(cm);
cm.off("cursorActivity", updateFatCursorMark);
// explicitly set fatCursorMarks to null because event listener above
// can be invoke after removing it, if off is called from operation
cm.state.fatCursorMarks = null;
}
// Deprecated, simply setting the keymap works again.
@ -1711,6 +1717,7 @@
vim.lastEditActionCommand = actionCommand;
macroModeState.lastInsertModeChanges.changes = [];
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){
return this.moveToStartOfLine(cm, head, motionArgs, vim);
}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){
endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line));
@ -1943,13 +1950,15 @@
vim.lastHSPos = cm.charCoords(head,'div').left;
return moveToColumn(cm, repeat);
},
moveToEol: function(cm, head, motionArgs, vim) {
moveToEol: function(cm, head, motionArgs, vim, keepHPos) {
var cur = head;
vim.lastHPos = Infinity;
var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);
var end=cm.clipPos(retval);
end.ch--;
vim.lastHSPos = cm.charCoords(end,'div').left;
if (!keepHPos) {
vim.lastHPos = Infinity;
vim.lastHSPos = cm.charCoords(end,'div').left;
}
return retval;
},
moveToFirstNonWhiteSpaceCharacter: function(cm, head) {
@ -1975,7 +1984,9 @@
}
}
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;
} else {
return cursor;
@ -1995,13 +2006,11 @@
textObjectManipulation: function(cm, head, motionArgs, vim) {
// TODO: lots of possible exceptions that can be thrown here. Try da(
// outside of a () block.
// TODO: adding <> >< to this map doesn't work, presumably because
// they're operators
var mirroredPairs = {'(': ')', ')': '(',
'{': '}', '}': '{',
'[': ']', ']': '['};
var selfPaired = {'\'': true, '"': true};
'[': ']', ']': '[',
'<': '>', '>': '<'};
var selfPaired = {'\'': true, '"': true, '`': true};
var character = motionArgs.selectedCharacter;
// 'b' refers to '()' block.
@ -2089,7 +2098,6 @@
change: function(cm, args, ranges) {
var finalHead, text;
var vim = cm.state.vim;
vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock;
if (!vim.visualMode) {
var anchor = ranges[0].anchor,
head = ranges[0].head;
@ -2312,6 +2320,8 @@
var macroModeState = vimGlobalState.macroModeState;
if (registerName == '@') {
registerName = macroModeState.latestRegister;
} else {
macroModeState.latestRegister = registerName;
}
while(repeat--){
executeMacroRegister(cm, vim, macroModeState, registerName);
@ -2350,6 +2360,8 @@
} else if (insertAt == 'firstNonBlank') {
head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head);
} else if (insertAt == 'startOfSelectedArea') {
if (!vim.visualMode)
return;
if (!vim.visualBlock) {
if (sel.head.line < sel.anchor.line) {
head = sel.head;
@ -2363,6 +2375,8 @@
height = Math.abs(sel.head.line - sel.anchor.line) + 1;
}
} else if (insertAt == 'endOfSelectedArea') {
if (!vim.visualMode)
return;
if (!vim.visualBlock) {
if (sel.head.line >= sel.anchor.line) {
head = offsetCursor(sel.head, 0, 1);
@ -2556,7 +2570,17 @@
}
var linewise = register.linewise;
var blockwise = register.blockwise;
if (linewise) {
if (blockwise) {
text = text.split('\n');
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) {
text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n';
} else if (actionArgs.after) {
@ -2568,12 +2592,6 @@
cur.ch = 0;
}
} 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;
}
var curPosFinal;
@ -2808,12 +2826,6 @@
}
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) {
// Partial matches are not applied. They inform the key handler
// that the current key sequence is a subsequence of a valid key
@ -3802,11 +3814,13 @@
var bracketRegexp = ({
'(': /[()]/, ')': /[()]/,
'[': /[[\]]/, ']': /[[\]]/,
'{': /[{}]/, '}': /[{}]/})[symb];
'{': /[{}]/, '}': /[{}]/,
'<': /[<>]/, '>': /[<>]/})[symb];
var openSym = ({
'(': '(', ')': '(',
'[': '[', ']': '[',
'{': '{', '}': '{'})[symb];
'{': '{', '}': '{',
'<': '<', '>': '<'})[symb];
var curChar = cm.getLine(cur.line).charAt(cur.ch);
// Due to the behavior of scanForBracket, we need to add an offset if the
// cursor is on a matching open bracket.
@ -4215,23 +4229,27 @@
query: query
};
}
var highlightTimeout = 0;
function highlightSearchMatches(cm, query) {
var searchState = getSearchState(cm);
var overlay = searchState.getOverlay();
if (!overlay || query != overlay.query) {
if (overlay) {
cm.removeOverlay(overlay);
}
overlay = searchOverlay(query);
cm.addOverlay(overlay);
if (cm.showMatchesOnScrollbar) {
if (searchState.getScrollbarAnnotate()) {
searchState.getScrollbarAnnotate().clear();
clearTimeout(highlightTimeout);
highlightTimeout = setTimeout(function() {
var searchState = getSearchState(cm);
var overlay = searchState.getOverlay();
if (!overlay || query != overlay.query) {
if (overlay) {
cm.removeOverlay(overlay);
}
searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query));
overlay = searchOverlay(query);
cm.addOverlay(overlay);
if (cm.showMatchesOnScrollbar) {
if (searchState.getScrollbarAnnotate()) {
searchState.getScrollbarAnnotate().clear();
}
searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query));
}
searchState.setOverlay(overlay);
}
searchState.setOverlay(overlay);
}
}, 50);
}
function findNext(cm, prev, query, repeat) {
if (repeat === undefined) { repeat = 1; }
@ -5431,18 +5449,15 @@
return true;
}
var head = cm.getCursor('head');
var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock;
if (inVisualBlock) {
var visualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.visualBlock;
if (visualBlock) {
// Set up block selection again for repeating the changes.
var vim = cm.state.vim;
var lastSel = vim.lastSelection;
var offset = getOffset(lastSel.anchor, lastSel.head);
selectForInsert(cm, head, offset.line + 1);
selectForInsert(cm, head, visualBlock + 1);
repeat = cm.listSelections().length;
cm.setCursor(head);
}
for (var i = 0; i < repeat; i++) {
if (inVisualBlock) {
if (visualBlock) {
cm.setCursor(offsetCursor(head, i, 0));
}
for (var j = 0; j < changes.length; j++) {
@ -5459,7 +5474,7 @@
}
}
}
if (inVisualBlock) {
if (visualBlock) {
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())) {
stream.eatWhile(/[\w.%]/);
return ret("number", "unit");
} else if (stream.match(/^-[\w\\\-]+/)) {
} else if (stream.match(/^-[\w\\\-]*/)) {
stream.eatWhile(/[\w\\\-]/);
if (stream.match(/^\s*:/, false))
return ret("variable-2", "variable-definition");
@ -77,12 +77,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return ret("qualifier", "qualifier");
} else if (/[:;{}\[\]\(\)]/.test(ch)) {
return ret(null, ch);
} else if (((ch == "u" || ch == "U") && stream.match(/rl(-prefix)?\(/i)) ||
((ch == "d" || ch == "D") && stream.match("omain(", true, true)) ||
((ch == "r" || ch == "R") && stream.match("egexp(", true, true))) {
stream.backUp(1);
state.tokenize = tokenParenthesized;
return ret("property", "word");
} else if (stream.match(/[\w-.]+(?=\()/)) {
if (/^(url(-prefix)?|domain|regexp)$/.test(stream.current().toLowerCase())) {
state.tokenize = tokenParenthesized;
}
return ret("variable callee", "variable");
} else if (/[\w\\\-]/.test(ch)) {
stream.eatWhile(/[\w\\\-]/);
return ret("property", "word");

View File

@ -365,7 +365,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
if (type == "function") return cont(functiondef);
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 (isTS && value == "declare") {
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)) {
cx.marked = "keyword"
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 if (isTS && value == "namespace") {
cx.marked = "keyword"
return cont(pushlex("form"), expression, block, poplex)
return cont(pushlex("form"), expression, statement, poplex)
} else if (isTS && value == "abstract") {
cx.marked = "keyword"
return cont(statement)
@ -522,7 +525,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.marked = "keyword"
return cont(objprop)
} else if (type == "[") {
return cont(expression, maybetype, expect("]"), afterprop);
return cont(expression, maybetypeOrIn, expect("]"), afterprop);
} else if (type == "spread") {
return cont(expressionNoComma, afterprop);
} else if (value == "*") {
@ -552,6 +555,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}, proceed);
}
if (type == end || value == end) return cont();
if (sep && sep.indexOf(";") > -1) return pass(what)
return cont(expect(end));
}
return function(type, value) {
@ -574,6 +578,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "?") return cont(maybetype);
}
}
function maybetypeOrIn(type, value) {
if (isTS && (type == ":" || value == "in")) return cont(typeexpr)
}
function mayberettype(type) {
if (isTS && type == ":") {
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) {
if (value == "keyof" || value == "typeof") {
if (value == "keyof" || value == "typeof" || value == "infer") {
cx.marked = "keyword"
return cont(value == "keyof" ? typeexpr : expressionNoComma)
return cont(value == "typeof" ? expressionNoComma : typeexpr)
}
if (type == "variable" || value == "void") {
cx.marked = "type"
return cont(afterType)
}
if (value == "|" || value == "&") return cont(typeexpr)
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(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)
}
function maybeReturnType(type) {
@ -608,24 +616,28 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property"
return cont(typeprop)
} else if (value == "?") {
} else if (value == "?" || type == "number" || type == "string") {
return cont(typeprop)
} else if (type == ":") {
return cont(typeexpr)
} 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) {
if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
if (type == ":") return cont(typeexpr)
if (type == "spread") return cont(typearg)
return pass(typeexpr)
}
function afterType(type, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
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 == "?") return cont(typeexpr, expect(":"), typeexpr)
}
function maybeTypeArgs(_, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
@ -672,25 +684,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
function forspec(type, value) {
if (value == "await") return cont(forspec);
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
if (type == "(") return cont(pushlex(")"), forspec1, poplex);
}
function forspec1(type) {
if (type == "var") return cont(vardef, expect(";"), forspec2);
if (type == ";") return cont(forspec2);
if (type == "variable") return cont(formaybeinof);
return pass(expression, expect(";"), forspec2);
}
function formaybeinof(_type, value) {
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
return cont(maybeoperatorComma, forspec2);
if (type == "var") return cont(vardef, forspec2);
if (type == "variable") return cont(forspec2);
return pass(forspec2)
}
function forspec2(type, value) {
if (type == ";") return cont(forspec3);
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
return pass(expression, expect(";"), forspec3);
}
function forspec3(type) {
if (type != ")") cont(expression);
if (type == ")") return cont()
if (type == ";") return cont(forspec2)
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) }
return pass(expression, forspec2)
}
function functiondef(type, value) {
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 (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) {
if (value == "@") cont(expression, funarg)
if (type == "spread") 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);
}
function classExpression(type, value) {
@ -732,13 +752,15 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.marked = "property";
return cont(isTS ? classfield : functiondef, classBody);
}
if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody);
if (type == "[")
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
if (value == "*") {
cx.marked = "keyword";
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 (value == "@") return cont(expression, classBody)
}
@ -746,7 +768,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "?") return cont(classfield)
if (type == ":") return cont(typeexpr, maybeAssign)
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) {
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 .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-attribute { color: #81a4d5; }
.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 .CodeMirror-activeline-background { background: #3C3A3A; }

View File

@ -1,9 +1,5 @@
/* 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-->*/
.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;
color: #E6E6E6;
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-activeline-background {

View File

@ -27,7 +27,7 @@
.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; }
.cm-s-vibrant-ink .cm-header { color: #FF6400; }
.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 .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:
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`
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');
};
/**
* 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
* 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
* background. Please use copy_batch/check to check the job status.
* @function Dropbox#filesCopyBatch
* @deprecated
* @arg {FilesRelocationBatchArg} arg - The request parameters.
* @returns {Promise.<FilesRelocationBatchLaunch, Error.<void>>}
*/
@ -344,10 +360,22 @@ routes.filesCopyBatch = function (arg) {
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 list of results for each entry.
* @function Dropbox#filesCopyBatchCheck
* @deprecated
* @arg {AsyncPollArg} arg - The request parameters.
* @returns {Promise.<FilesRelocationBatchJobStatus, Error.<AsyncPollError>>}
*/
@ -706,6 +734,21 @@ routes.filesMove = function (arg) {
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
* 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');
};
/**
* 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 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
* exists, the file will be renamed to avoid the conflict (e.g. myfile (1).txt).
* Save the data from a specified URL into a file in user's Dropbox. Note that
* 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
* @arg {FilesSaveUrlArg} arg - The request parameters.
* @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
* 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
* behalf. Apps must have full Dropbox access to use this endpoint.
* behalf.
* @function Dropbox#sharingAddFolderMember
* @arg {SharingAddFolderMemberArg} arg - The request parameters.
* @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
* to use this endpoint.
* Returns the status of an asynchronous job.
* @function Dropbox#sharingCheckJobStatus
* @arg {AsyncPollArg} arg - The request parameters.
* @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
* have full Dropbox access to use this endpoint.
* Returns the status of an asynchronous job for sharing a folder.
* @function Dropbox#sharingCheckRemoveMemberJobStatus
* @arg {AsyncPollArg} arg - The request parameters.
* @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
* have full Dropbox access to use this endpoint.
* Returns the status of an asynchronous job for sharing a folder.
* @function Dropbox#sharingCheckShareJobStatus
* @arg {AsyncPollArg} arg - The request parameters.
* @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
* access to use this endpoint.
* Returns shared folder metadata by its folder ID.
* @function Dropbox#sharingGetFolderMetadata
* @arg {SharingGetMetadataArgs} arg - The request parameters.
* @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
* Dropbox access to use this endpoint.
* Returns shared folder membership by its folder ID.
* @function Dropbox#sharingListFolderMembers
* @arg {SharingListFolderMembersArgs} arg - The request parameters.
* @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
* paginate through all shared folder members. Apps must have full Dropbox
* access to use this endpoint.
* paginate through all shared folder members.
* @function Dropbox#sharingListFolderMembersContinue
* @arg {SharingListFolderMembersContinueArg} arg - The request parameters.
* @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
* must have full Dropbox access to use this endpoint.
* Return the list of all shared folders the current user has access to.
* @function Dropbox#sharingListFolders
* @arg {SharingListFoldersArgs} arg - The request parameters.
* @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
* 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
* use this endpoint.
* list_folders or list_folders/continue.
* @function Dropbox#sharingListFoldersContinue
* @arg {SharingListFoldersContinueArg} arg - The request parameters.
* @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.
* Apps must have full Dropbox access to use this endpoint.
* @function Dropbox#sharingListMountableFolders
* @arg {SharingListFoldersArgs} arg - The request parameters.
* @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
* paginate through all mountable shared folders. The cursor must come from a
* previous call to list_mountable_folders or list_mountable_folders/continue.
* Apps must have full Dropbox access to use this endpoint.
* @function Dropbox#sharingListMountableFoldersContinue
* @arg {SharingListFoldersContinueArg} arg - The request parameters.
* @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
* 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
* endpoint.
* will appear in their Dropbox.
* @function Dropbox#sharingMountFolder
* @arg {SharingMountFolderArg} arg - The request parameters.
* @returns {Promise.<SharingSharedFolderMetadata, Error.<SharingMountFolderError>>}
@ -1494,7 +1539,7 @@ routes.sharingMountFolder = function (arg) {
/**
* The current user relinquishes their membership in the designated file. Note
* 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
* @arg {SharingRelinquishFileMembershipArg} arg - The request parameters.
* @returns {Promise.<void, Error.<SharingRelinquishFileMembershipError>>}
@ -1507,8 +1552,7 @@ routes.sharingRelinquishFileMembership = function (arg) {
* The current user relinquishes their membership in the designated shared
* 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
* leave_a_copy is false, and asynchronously if leave_a_copy is true. Apps must
* have full Dropbox access to use this endpoint.
* leave_a_copy is false, and asynchronously if leave_a_copy is true.
* @function Dropbox#sharingRelinquishFolderMembership
* @arg {SharingRelinquishFolderMembershipArg} arg - The request parameters.
* @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
* folder to remove another member. Apps must have full Dropbox access to use
* this endpoint.
* folder to remove another member.
* @function Dropbox#sharingRemoveFolderMember
* @arg {SharingRemoveFolderMemberArg} arg - The request parameters.
* @returns {Promise.<AsyncLaunchResultBase, Error.<SharingRemoveFolderMemberError>>}
@ -1583,7 +1626,7 @@ routes.sharingSetAccessInheritance = function (arg) {
* testing the async case repeatable, set `ShareFolderArg.force_async`. If a
* 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
* folder. Apps must have full Dropbox access to use this endpoint.
* folder.
* @function Dropbox#sharingShareFolder
* @arg {SharingShareFolderArg} arg - The request parameters.
* @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
* 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
* @arg {SharingTransferFolderArg} arg - The request parameters.
* @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
* at a later time using mount_folder. Apps must have full Dropbox access to use
* this endpoint.
* at a later time using mount_folder.
* @function Dropbox#sharingUnmountFolder
* @arg {SharingUnmountFolderArg} arg - The request parameters.
* @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
* check_job_status to determine if the action has completed successfully. Apps
* must have full Dropbox access to use this endpoint.
* check_job_status to determine if the action has completed successfully.
* @function Dropbox#sharingUnshareFolder
* @arg {SharingUnshareFolderArg} arg - The request parameters.
* @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
* permissions. Apps must have full Dropbox access to use this endpoint.
* permissions.
* @function Dropbox#sharingUpdateFolderMember
* @arg {SharingUpdateFolderMemberArg} arg - The request parameters.
* @returns {Promise.<SharingMemberAccessLevelResult, Error.<SharingUpdateFolderMemberError>>}
@ -1661,8 +1702,7 @@ routes.sharingUpdateFolderMember = function (arg) {
/**
* Update the sharing policies for a shared folder. User must have
* AccessLevel.owner access to the shared folder to update its policies. Apps
* must have full Dropbox access to use this endpoint.
* AccessLevel.owner access to the shared folder to update its policies.
* @function Dropbox#sharingUpdateFolderPolicy
* @arg {SharingUpdateFolderPolicyArg} arg - The request parameters.
* @returns {Promise.<SharingSharedFolderMetadata, Error.<SharingUpdateFolderPolicyError>>}
@ -1920,6 +1960,9 @@ function downloadRequest(fetch) {
if (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) {
@ -1978,6 +2021,9 @@ function uploadRequest(fetch) {
if (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) {
@ -3982,6 +4028,9 @@ function rpcRequest(fetch) {
if (options.selectAdmin) {
headers['Dropbox-API-Select-Admin'] = options.selectAdmin;
}
if (options.pathRoot) {
headers['Dropbox-API-Path-Root'] = options.pathRoot;
}
}
fetchOptions.headers = headers;
@ -4111,6 +4160,8 @@ if (!Array.prototype.includes) {
* to act as.
* @arg {String} [options.selectAdmin] - Team admin that the team access token would like
* to act as.
* @arg {String} [options.pathRoot] - root pass to access other namespaces
* Use to access team folders for example
*/
function parseBodyToType(res) {
@ -4139,6 +4190,7 @@ var DropboxBase = function () {
this.selectUser = options.selectUser;
this.selectAdmin = options.selectAdmin;
this.fetch = options.fetch || fetch;
this.pathRoot = options.pathRoot;
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})');
} // eslint-disable-line no-console
@ -4332,12 +4384,15 @@ var DropboxBase = function () {
var removed = false;
var browser = window.open(url, '_blank');
function onLoadError() {
// Try to avoid a browser crash on browser.close().
window.setTimeout(function () {
browser.close();
}, 10);
errorCallback();
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().
window.setTimeout(function () {
browser.close();
}, 10);
errorCallback();
}
}
function onLoadStop(event) {
@ -4402,7 +4457,8 @@ var DropboxBase = function () {
selectUser: this.selectUser,
selectAdmin: this.selectAdmin,
clientId: this.getClientId(),
clientSecret: this.getClientSecret()
clientSecret: this.getClientSecret(),
pathRoot: this.pathRoot
};
return request(path, args, auth, host, this.getAccessToken(), options);
}
@ -4462,6 +4518,8 @@ var DropboxBase = function () {
* authentication URL.
* @arg {String} [options.selectUser] - Select user is only used by DropboxTeam.
* 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) {
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
* @arg {TeamListMembersDevicesArg} arg - The request parameters.
* @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
* @deprecated
* @arg {TeamListTeamDevicesArg} arg - The request parameters.
@ -5046,6 +5104,7 @@ routes$1.teamNamespacesListContinue = function (arg) {
};
/**
* Permission : Team member file access.
* @function DropboxTeam#teamPropertiesTemplateAdd
* @deprecated
* @arg {FilePropertiesAddTemplateArg} arg - The request parameters.
@ -5056,6 +5115,7 @@ routes$1.teamPropertiesTemplateAdd = function (arg) {
};
/**
* Permission : Team member file access.
* @function DropboxTeam#teamPropertiesTemplateGet
* @deprecated
* @arg {FilePropertiesGetTemplateArg} arg - The request parameters.
@ -5066,6 +5126,7 @@ routes$1.teamPropertiesTemplateGet = function (arg) {
};
/**
* Permission : Team member file access.
* @function DropboxTeam#teamPropertiesTemplateList
* @deprecated
* @arg {void} arg - The request parameters.
@ -5076,6 +5137,7 @@ routes$1.teamPropertiesTemplateList = function (arg) {
};
/**
* Permission : Team member file access.
* @function DropboxTeam#teamPropertiesTemplateUpdate
* @deprecated
* @arg {FilePropertiesUpdateTemplateArg} arg - The request parameters.