@atlaskit/editor-extension-dropbox 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/dropboxscript.js +417 -550
- package/dist/cjs/enable-dropbox.js +3 -15
- package/dist/cjs/icons/DropboxIcon.js +0 -5
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/manifest.js +6 -45
- package/dist/cjs/modal.js +8 -28
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/dropboxscript.js +401 -529
- package/dist/es2019/manifest.js +9 -29
- package/dist/es2019/modal.js +0 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/dropboxscript.js +417 -548
- package/dist/esm/enable-dropbox.js +4 -7
- package/dist/esm/manifest.js +10 -43
- package/dist/esm/modal.js +7 -16
- package/dist/esm/version.json +1 -1
- package/package.json +7 -5
- package/report.api.md +15 -1
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
16
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
13
|
var _default = /*#__PURE__*/function () {
|
|
21
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
22
|
-
return
|
|
14
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(appKey) {
|
|
15
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
23
16
|
while (1) {
|
|
24
17
|
switch (_context.prev = _context.next) {
|
|
25
18
|
case 0:
|
|
@@ -27,17 +20,14 @@ var _default = /*#__PURE__*/function () {
|
|
|
27
20
|
_context.next = 4;
|
|
28
21
|
break;
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
return _context.abrupt("return", Promise.resolve().then(function () {
|
|
32
24
|
return _interopRequireWildcard(require('./dropboxscript'));
|
|
33
25
|
}).then(function () {
|
|
34
26
|
window.Dropbox.appKey = appKey;
|
|
35
27
|
}));
|
|
36
|
-
|
|
37
28
|
case 4:
|
|
38
29
|
window.Dropbox.appKey = appKey;
|
|
39
30
|
return _context.abrupt("return", Promise.resolve());
|
|
40
|
-
|
|
41
31
|
case 6:
|
|
42
32
|
case "end":
|
|
43
33
|
return _context.stop();
|
|
@@ -45,10 +35,8 @@ var _default = /*#__PURE__*/function () {
|
|
|
45
35
|
}
|
|
46
36
|
}, _callee);
|
|
47
37
|
}));
|
|
48
|
-
|
|
49
38
|
return function (_x) {
|
|
50
39
|
return _ref.apply(this, arguments);
|
|
51
40
|
};
|
|
52
41
|
}();
|
|
53
|
-
|
|
54
42
|
exports.default = _default;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _dropbox = _interopRequireDefault(require("@atlaskit/icon/glyph/dropbox"));
|
|
13
|
-
|
|
14
10
|
var _default = function _default() {
|
|
15
11
|
return (
|
|
16
12
|
/*#__PURE__*/
|
|
@@ -22,5 +18,4 @@ var _default = function _default() {
|
|
|
22
18
|
})
|
|
23
19
|
);
|
|
24
20
|
};
|
|
25
|
-
|
|
26
21
|
exports.default = _default;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -11,5 +10,4 @@ Object.defineProperty(exports, "default", {
|
|
|
11
10
|
return _manifest.default;
|
|
12
11
|
}
|
|
13
12
|
});
|
|
14
|
-
|
|
15
13
|
var _manifest = _interopRequireDefault(require("./manifest"));
|
package/dist/cjs/manifest.js
CHANGED
|
@@ -1,57 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
10
|
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
|
|
18
11
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
19
|
-
|
|
20
12
|
var _builders = require("@atlaskit/adf-utils/builders");
|
|
21
|
-
|
|
22
13
|
var _enableDropbox = _interopRequireDefault(require("./enable-dropbox"));
|
|
23
|
-
|
|
24
14
|
var _constants = require("./constants");
|
|
25
|
-
|
|
15
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
26
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
18
|
function pickFromDropbox(_x, _x2) {
|
|
31
19
|
return _pickFromDropbox.apply(this, arguments);
|
|
32
20
|
}
|
|
33
|
-
|
|
34
21
|
function _pickFromDropbox() {
|
|
35
|
-
_pickFromDropbox = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
22
|
+
_pickFromDropbox = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(appKey, canMountinIframe) {
|
|
36
23
|
var popupMountPoint, Modal, files, node, newNodes;
|
|
37
|
-
return
|
|
24
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
38
25
|
while (1) {
|
|
39
26
|
switch (_context2.prev = _context2.next) {
|
|
40
27
|
case 0:
|
|
41
28
|
_context2.next = 2;
|
|
42
29
|
return (0, _enableDropbox.default)(appKey);
|
|
43
|
-
|
|
44
30
|
case 2:
|
|
45
31
|
if (!canMountinIframe) {
|
|
46
32
|
_context2.next = 9;
|
|
47
33
|
break;
|
|
48
34
|
}
|
|
49
|
-
|
|
50
35
|
_context2.next = 5;
|
|
51
36
|
return Promise.resolve().then(function () {
|
|
52
37
|
return _interopRequireWildcard(require('./modal'));
|
|
53
38
|
});
|
|
54
|
-
|
|
55
39
|
case 5:
|
|
56
40
|
Modal = _context2.sent;
|
|
57
41
|
// The decision has been made to simply append our modal to the body
|
|
@@ -60,17 +44,14 @@ function _pickFromDropbox() {
|
|
|
60
44
|
//
|
|
61
45
|
// We want to append it and attach it to a new div so we have complete control.
|
|
62
46
|
popupMountPoint = document.getElementById(_constants.POPUP_MOUNTPOINT);
|
|
63
|
-
|
|
64
47
|
if (!popupMountPoint) {
|
|
65
48
|
popupMountPoint = document.createElement('div');
|
|
66
49
|
popupMountPoint.id = _constants.POPUP_MOUNTPOINT;
|
|
67
50
|
document.body.appendChild(popupMountPoint);
|
|
68
51
|
}
|
|
69
|
-
|
|
70
52
|
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(Modal.default, {
|
|
71
53
|
onClose: function onClose() {}
|
|
72
54
|
}), popupMountPoint);
|
|
73
|
-
|
|
74
55
|
case 9:
|
|
75
56
|
_context2.prev = 9;
|
|
76
57
|
_context2.next = 12;
|
|
@@ -82,41 +63,32 @@ function _pickFromDropbox() {
|
|
|
82
63
|
cancel: reject
|
|
83
64
|
});
|
|
84
65
|
});
|
|
85
|
-
|
|
86
66
|
case 12:
|
|
87
67
|
files = _context2.sent;
|
|
88
68
|
_context2.next = 19;
|
|
89
69
|
break;
|
|
90
|
-
|
|
91
70
|
case 15:
|
|
92
71
|
_context2.prev = 15;
|
|
93
72
|
_context2.t0 = _context2["catch"](9);
|
|
94
|
-
|
|
95
73
|
if (popupMountPoint) {
|
|
96
74
|
_reactDom.default.unmountComponentAtNode(popupMountPoint);
|
|
97
75
|
}
|
|
98
|
-
|
|
99
76
|
return _context2.abrupt("return");
|
|
100
|
-
|
|
101
77
|
case 19:
|
|
102
78
|
if (files.length) {
|
|
103
79
|
_context2.next = 22;
|
|
104
80
|
break;
|
|
105
81
|
}
|
|
106
|
-
|
|
107
82
|
if (popupMountPoint) {
|
|
108
83
|
_reactDom.default.unmountComponentAtNode(popupMountPoint);
|
|
109
84
|
}
|
|
110
|
-
|
|
111
85
|
return _context2.abrupt("return");
|
|
112
|
-
|
|
113
86
|
case 22:
|
|
114
87
|
newNodes = files.map(function (file) {
|
|
115
88
|
return (0, _builders.inlineCard)({
|
|
116
89
|
url: file.link
|
|
117
90
|
});
|
|
118
91
|
});
|
|
119
|
-
|
|
120
92
|
if (newNodes.length === 1) {
|
|
121
93
|
node = newNodes[0];
|
|
122
94
|
} else {
|
|
@@ -127,13 +99,10 @@ function _pickFromDropbox() {
|
|
|
127
99
|
content: newNodes
|
|
128
100
|
};
|
|
129
101
|
}
|
|
130
|
-
|
|
131
102
|
if (popupMountPoint) {
|
|
132
103
|
_reactDom.default.unmountComponentAtNode(popupMountPoint);
|
|
133
104
|
}
|
|
134
|
-
|
|
135
105
|
return _context2.abrupt("return", node);
|
|
136
|
-
|
|
137
106
|
case 26:
|
|
138
107
|
case "end":
|
|
139
108
|
return _context2.stop();
|
|
@@ -143,10 +112,9 @@ function _pickFromDropbox() {
|
|
|
143
112
|
}));
|
|
144
113
|
return _pickFromDropbox.apply(this, arguments);
|
|
145
114
|
}
|
|
146
|
-
|
|
147
115
|
var manifestFunction = function manifestFunction(_ref) {
|
|
148
116
|
var appKey = _ref.appKey,
|
|
149
|
-
|
|
117
|
+
canMountinIframe = _ref.canMountinIframe;
|
|
150
118
|
return {
|
|
151
119
|
title: 'Dropbox',
|
|
152
120
|
type: 'com.dropbox.fabric',
|
|
@@ -180,33 +148,28 @@ var manifestFunction = function manifestFunction(_ref) {
|
|
|
180
148
|
key: 'item',
|
|
181
149
|
action: function action() {
|
|
182
150
|
return new Promise( /*#__PURE__*/function () {
|
|
183
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
151
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
184
152
|
var newNode;
|
|
185
|
-
return
|
|
153
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
186
154
|
while (1) {
|
|
187
155
|
switch (_context.prev = _context.next) {
|
|
188
156
|
case 0:
|
|
189
157
|
_context.prev = 0;
|
|
190
158
|
_context.next = 3;
|
|
191
159
|
return pickFromDropbox(appKey, canMountinIframe);
|
|
192
|
-
|
|
193
160
|
case 3:
|
|
194
161
|
newNode = _context.sent;
|
|
195
|
-
|
|
196
162
|
if (!newNode) {
|
|
197
163
|
reject();
|
|
198
164
|
} else {
|
|
199
165
|
resolve(newNode);
|
|
200
166
|
}
|
|
201
|
-
|
|
202
167
|
_context.next = 10;
|
|
203
168
|
break;
|
|
204
|
-
|
|
205
169
|
case 7:
|
|
206
170
|
_context.prev = 7;
|
|
207
171
|
_context.t0 = _context["catch"](0);
|
|
208
172
|
reject(_context.t0);
|
|
209
|
-
|
|
210
173
|
case 10:
|
|
211
174
|
case "end":
|
|
212
175
|
return _context.stop();
|
|
@@ -214,7 +177,6 @@ var manifestFunction = function manifestFunction(_ref) {
|
|
|
214
177
|
}
|
|
215
178
|
}, _callee, null, [[0, 7]]);
|
|
216
179
|
}));
|
|
217
|
-
|
|
218
180
|
return function (_x3, _x4) {
|
|
219
181
|
return _ref2.apply(this, arguments);
|
|
220
182
|
};
|
|
@@ -224,6 +186,5 @@ var manifestFunction = function manifestFunction(_ref) {
|
|
|
224
186
|
}
|
|
225
187
|
};
|
|
226
188
|
};
|
|
227
|
-
|
|
228
189
|
var _default = manifestFunction;
|
|
229
190
|
exports.default = _default;
|
package/dist/cjs/modal.js
CHANGED
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _react2 = require("@emotion/react");
|
|
17
|
-
|
|
18
12
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
19
|
-
|
|
20
13
|
var _close = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/close"));
|
|
21
|
-
|
|
22
14
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
23
|
-
|
|
24
15
|
var _constants = require("./constants");
|
|
25
|
-
|
|
26
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
18
|
/** @jsx jsx */
|
|
19
|
+
|
|
31
20
|
var ModalBody = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
32
21
|
return (0, _react2.jsx)("div", {
|
|
33
22
|
ref: ref,
|
|
@@ -36,7 +25,6 @@ var ModalBody = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
36
25
|
}
|
|
37
26
|
}, props.children);
|
|
38
27
|
});
|
|
39
|
-
|
|
40
28
|
var iframeStyle = {
|
|
41
29
|
width: '100%',
|
|
42
30
|
height: '100%',
|
|
@@ -53,12 +41,10 @@ var spacingDivStyle = {
|
|
|
53
41
|
var headingStyle = {
|
|
54
42
|
marginTop: '8px'
|
|
55
43
|
};
|
|
56
|
-
|
|
57
44
|
var Header = function Header() {
|
|
58
45
|
var _useModal = (0, _modalDialog.useModal)(),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
onClose = _useModal.onClose,
|
|
47
|
+
titleId = _useModal.titleId;
|
|
62
48
|
return (0, _react2.jsx)("div", {
|
|
63
49
|
css: bottomShadow
|
|
64
50
|
}, (0, _react2.jsx)("div", {
|
|
@@ -74,27 +60,22 @@ var Header = function Header() {
|
|
|
74
60
|
onClick: onClose
|
|
75
61
|
})));
|
|
76
62
|
};
|
|
77
|
-
|
|
78
63
|
var Modal = function Modal(_ref) {
|
|
79
64
|
var _onClose = _ref.onClose,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
65
|
+
TEST_ONLY_src = _ref.TEST_ONLY_src,
|
|
66
|
+
showModal = _ref.showModal;
|
|
83
67
|
var _useState = (0, _react.useState)(true),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
68
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
69
|
+
isOpen = _useState2[0],
|
|
70
|
+
setIsOpen = _useState2[1];
|
|
88
71
|
if (typeof showModal === 'boolean' && isOpen !== showModal) {
|
|
89
72
|
setIsOpen(showModal);
|
|
90
73
|
}
|
|
91
|
-
|
|
92
74
|
return (0, _react2.jsx)(_modalDialog.ModalTransition, null, isOpen && (0, _react2.jsx)(_modalDialog.default, {
|
|
93
75
|
height: "100%",
|
|
94
76
|
width: "large",
|
|
95
77
|
onClose: function onClose() {
|
|
96
78
|
setIsOpen(false);
|
|
97
|
-
|
|
98
79
|
_onClose();
|
|
99
80
|
}
|
|
100
81
|
}, (0, _react2.jsx)(Header, null), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)(ModalBody, null, TEST_ONLY_src ? (0, _react2.jsx)("iframe", {
|
|
@@ -108,6 +89,5 @@ var Modal = function Modal(_ref) {
|
|
|
108
89
|
frameBorder: 0
|
|
109
90
|
})))));
|
|
110
91
|
};
|
|
111
|
-
|
|
112
92
|
var _default = Modal;
|
|
113
93
|
exports.default = _default;
|
package/dist/cjs/version.json
CHANGED