@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.
@@ -1,8 +1,9 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ 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; }
3
4
  export default /*#__PURE__*/(function () {
4
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(appKey) {
5
- return _regeneratorRuntime.wrap(function _callee$(_context) {
5
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(appKey) {
6
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
6
7
  while (1) {
7
8
  switch (_context.prev = _context.next) {
8
9
  case 0:
@@ -10,15 +11,12 @@ export default /*#__PURE__*/(function () {
10
11
  _context.next = 4;
11
12
  break;
12
13
  }
13
-
14
14
  return _context.abrupt("return", import('./dropboxscript').then(function () {
15
15
  window.Dropbox.appKey = appKey;
16
16
  }));
17
-
18
17
  case 4:
19
18
  window.Dropbox.appKey = appKey;
20
19
  return _context.abrupt("return", Promise.resolve());
21
-
22
20
  case 6:
23
21
  case "end":
24
22
  return _context.stop();
@@ -26,7 +24,6 @@ export default /*#__PURE__*/(function () {
26
24
  }
27
25
  }, _callee);
28
26
  }));
29
-
30
27
  return function (_x) {
31
28
  return _ref.apply(this, arguments);
32
29
  };
@@ -1,34 +1,30 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ 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; }
3
4
  import React from 'react';
4
5
  import ReactDOM from 'react-dom';
5
6
  import { inlineCard } from '@atlaskit/adf-utils/builders';
6
7
  import enableDropbox from './enable-dropbox';
7
8
  import { POPUP_MOUNTPOINT, DROPBOX_IFRAME_NAME } from './constants';
8
-
9
9
  function pickFromDropbox(_x, _x2) {
10
10
  return _pickFromDropbox.apply(this, arguments);
11
11
  }
12
-
13
12
  function _pickFromDropbox() {
14
- _pickFromDropbox = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(appKey, canMountinIframe) {
13
+ _pickFromDropbox = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(appKey, canMountinIframe) {
15
14
  var popupMountPoint, Modal, files, node, newNodes;
16
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
15
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
17
16
  while (1) {
18
17
  switch (_context2.prev = _context2.next) {
19
18
  case 0:
20
19
  _context2.next = 2;
21
20
  return enableDropbox(appKey);
22
-
23
21
  case 2:
24
22
  if (!canMountinIframe) {
25
23
  _context2.next = 9;
26
24
  break;
27
25
  }
28
-
29
26
  _context2.next = 5;
30
27
  return import('./modal');
31
-
32
28
  case 5:
33
29
  Modal = _context2.sent;
34
30
  // The decision has been made to simply append our modal to the body
@@ -37,17 +33,14 @@ function _pickFromDropbox() {
37
33
  //
38
34
  // We want to append it and attach it to a new div so we have complete control.
39
35
  popupMountPoint = document.getElementById(POPUP_MOUNTPOINT);
40
-
41
36
  if (!popupMountPoint) {
42
37
  popupMountPoint = document.createElement('div');
43
38
  popupMountPoint.id = POPUP_MOUNTPOINT;
44
39
  document.body.appendChild(popupMountPoint);
45
40
  }
46
-
47
41
  ReactDOM.render( /*#__PURE__*/React.createElement(Modal.default, {
48
42
  onClose: function onClose() {}
49
43
  }), popupMountPoint);
50
-
51
44
  case 9:
52
45
  _context2.prev = 9;
53
46
  _context2.next = 12;
@@ -59,41 +52,32 @@ function _pickFromDropbox() {
59
52
  cancel: reject
60
53
  });
61
54
  });
62
-
63
55
  case 12:
64
56
  files = _context2.sent;
65
57
  _context2.next = 19;
66
58
  break;
67
-
68
59
  case 15:
69
60
  _context2.prev = 15;
70
61
  _context2.t0 = _context2["catch"](9);
71
-
72
62
  if (popupMountPoint) {
73
63
  ReactDOM.unmountComponentAtNode(popupMountPoint);
74
64
  }
75
-
76
65
  return _context2.abrupt("return");
77
-
78
66
  case 19:
79
67
  if (files.length) {
80
68
  _context2.next = 22;
81
69
  break;
82
70
  }
83
-
84
71
  if (popupMountPoint) {
85
72
  ReactDOM.unmountComponentAtNode(popupMountPoint);
86
73
  }
87
-
88
74
  return _context2.abrupt("return");
89
-
90
75
  case 22:
91
76
  newNodes = files.map(function (file) {
92
77
  return inlineCard({
93
78
  url: file.link
94
79
  });
95
80
  });
96
-
97
81
  if (newNodes.length === 1) {
98
82
  node = newNodes[0];
99
83
  } else {
@@ -104,13 +88,10 @@ function _pickFromDropbox() {
104
88
  content: newNodes
105
89
  };
106
90
  }
107
-
108
91
  if (popupMountPoint) {
109
92
  ReactDOM.unmountComponentAtNode(popupMountPoint);
110
93
  }
111
-
112
94
  return _context2.abrupt("return", node);
113
-
114
95
  case 26:
115
96
  case "end":
116
97
  return _context2.stop();
@@ -120,10 +101,9 @@ function _pickFromDropbox() {
120
101
  }));
121
102
  return _pickFromDropbox.apply(this, arguments);
122
103
  }
123
-
124
104
  var manifestFunction = function manifestFunction(_ref) {
125
105
  var appKey = _ref.appKey,
126
- canMountinIframe = _ref.canMountinIframe;
106
+ canMountinIframe = _ref.canMountinIframe;
127
107
  return {
128
108
  title: 'Dropbox',
129
109
  type: 'com.dropbox.fabric',
@@ -131,23 +111,17 @@ var manifestFunction = function manifestFunction(_ref) {
131
111
  description: 'Embed Dropbox file to collaborate with your team',
132
112
  icons: {
133
113
  '16': function _() {
134
- return import(
135
- /* webpackChunkName: "@atlaskit-internal_editor-dropbox" */
136
- './icons/DropboxIcon').then(function (mod) {
114
+ return import( /* webpackChunkName: "@atlaskit-internal_editor-dropbox" */'./icons/DropboxIcon').then(function (mod) {
137
115
  return mod.default;
138
116
  });
139
117
  },
140
118
  '24': function _() {
141
- return import(
142
- /* webpackChunkName: "@atlaskit-internal_editor-dropbox" */
143
- './icons/DropboxIcon').then(function (mod) {
119
+ return import( /* webpackChunkName: "@atlaskit-internal_editor-dropbox" */'./icons/DropboxIcon').then(function (mod) {
144
120
  return mod.default;
145
121
  });
146
122
  },
147
123
  '48': function _() {
148
- return import(
149
- /* webpackChunkName: "@atlaskit-internal_editor-dropbox" */
150
- './icons/DropboxIcon').then(function (mod) {
124
+ return import( /* webpackChunkName: "@atlaskit-internal_editor-dropbox" */'./icons/DropboxIcon').then(function (mod) {
151
125
  return mod.default;
152
126
  });
153
127
  }
@@ -157,33 +131,28 @@ var manifestFunction = function manifestFunction(_ref) {
157
131
  key: 'item',
158
132
  action: function action() {
159
133
  return new Promise( /*#__PURE__*/function () {
160
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve, reject) {
134
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
161
135
  var newNode;
162
- return _regeneratorRuntime.wrap(function _callee$(_context) {
136
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
163
137
  while (1) {
164
138
  switch (_context.prev = _context.next) {
165
139
  case 0:
166
140
  _context.prev = 0;
167
141
  _context.next = 3;
168
142
  return pickFromDropbox(appKey, canMountinIframe);
169
-
170
143
  case 3:
171
144
  newNode = _context.sent;
172
-
173
145
  if (!newNode) {
174
146
  reject();
175
147
  } else {
176
148
  resolve(newNode);
177
149
  }
178
-
179
150
  _context.next = 10;
180
151
  break;
181
-
182
152
  case 7:
183
153
  _context.prev = 7;
184
154
  _context.t0 = _context["catch"](0);
185
155
  reject(_context.t0);
186
-
187
156
  case 10:
188
157
  case "end":
189
158
  return _context.stop();
@@ -191,7 +160,6 @@ var manifestFunction = function manifestFunction(_ref) {
191
160
  }
192
161
  }, _callee, null, [[0, 7]]);
193
162
  }));
194
-
195
163
  return function (_x3, _x4) {
196
164
  return _ref2.apply(this, arguments);
197
165
  };
@@ -201,5 +169,4 @@ var manifestFunction = function manifestFunction(_ref) {
201
169
  }
202
170
  };
203
171
  };
204
-
205
172
  export default manifestFunction;
package/dist/esm/modal.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
-
3
2
  /** @jsx jsx */
4
3
  import React, { useState } from 'react';
5
4
  import { jsx, css } from '@emotion/react';
@@ -31,12 +30,10 @@ var spacingDivStyle = {
31
30
  var headingStyle = {
32
31
  marginTop: '8px'
33
32
  };
34
-
35
33
  var Header = function Header() {
36
34
  var _useModal = useModal(),
37
- onClose = _useModal.onClose,
38
- titleId = _useModal.titleId;
39
-
35
+ onClose = _useModal.onClose,
36
+ titleId = _useModal.titleId;
40
37
  return jsx("div", {
41
38
  css: bottomShadow
42
39
  }, jsx("div", {
@@ -52,27 +49,22 @@ var Header = function Header() {
52
49
  onClick: onClose
53
50
  })));
54
51
  };
55
-
56
52
  var Modal = function Modal(_ref) {
57
53
  var _onClose = _ref.onClose,
58
- TEST_ONLY_src = _ref.TEST_ONLY_src,
59
- showModal = _ref.showModal;
60
-
54
+ TEST_ONLY_src = _ref.TEST_ONLY_src,
55
+ showModal = _ref.showModal;
61
56
  var _useState = useState(true),
62
- _useState2 = _slicedToArray(_useState, 2),
63
- isOpen = _useState2[0],
64
- setIsOpen = _useState2[1];
65
-
57
+ _useState2 = _slicedToArray(_useState, 2),
58
+ isOpen = _useState2[0],
59
+ setIsOpen = _useState2[1];
66
60
  if (typeof showModal === 'boolean' && isOpen !== showModal) {
67
61
  setIsOpen(showModal);
68
62
  }
69
-
70
63
  return jsx(ModalTransition, null, isOpen && jsx(ModalDialog, {
71
64
  height: "100%",
72
65
  width: "large",
73
66
  onClose: function onClose() {
74
67
  setIsOpen(false);
75
-
76
68
  _onClose();
77
69
  }
78
70
  }, jsx(Header, null), jsx(AKModalBody, null, jsx(ModalBody, null, TEST_ONLY_src ? jsx("iframe", {
@@ -86,5 +78,4 @@ var Modal = function Modal(_ref) {
86
78
  frameBorder: 0
87
79
  })))));
88
80
  };
89
-
90
81
  export default Modal;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-extension-dropbox",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-extension-dropbox",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "A an atlassian editor extension to add a native dropbox picker",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,9 +24,9 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@atlaskit/adf-utils": "^17.1.0",
28
- "@atlaskit/button": "^16.5.0",
29
- "@atlaskit/editor-common": "^71.0.0",
27
+ "@atlaskit/adf-utils": "^18.1.0",
28
+ "@atlaskit/button": "^16.6.0",
29
+ "@atlaskit/editor-common": "^72.8.0",
30
30
  "@atlaskit/icon": "^21.11.0",
31
31
  "@atlaskit/modal-dialog": "^12.4.0",
32
32
  "@babel/runtime": "^7.0.0",
@@ -47,7 +47,9 @@
47
47
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
48
48
  "techstack": {
49
49
  "@repo/internal": {
50
- "theming": "tokens",
50
+ "design-tokens": [
51
+ "color"
52
+ ],
51
53
  "deprecation": "no-deprecated-imports",
52
54
  "styling": [
53
55
  "emotion"
package/report.api.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- API Report Version: 2.2 -->
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
3
  ## API Report File for "@atlaskit/editor-extension-dropbox"
4
4
 
@@ -8,6 +8,7 @@
8
8
  ### Table of contents
9
9
 
10
10
  - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
11
12
 
12
13
  ### Main Entry Types
13
14
 
@@ -30,3 +31,16 @@ export default manifestFunction;
30
31
  ```
31
32
 
32
33
  <!--SECTION END: Main Entry Types-->
34
+
35
+ ### Peer Dependencies
36
+
37
+ <!--SECTION START: Peer Dependencies-->
38
+
39
+ ```json
40
+ {
41
+ "react": "^16.8.0",
42
+ "react-dom": "^16.8.0"
43
+ }
44
+ ```
45
+
46
+ <!--SECTION END: Peer Dependencies-->