@atlaskit/share 4.1.1 → 4.2.0
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 +10 -0
- package/dist/cjs/clients/AtlassianUrlShortenerClient.js +43 -46
- package/dist/cjs/components/LazyShareForm/lazy.js +2 -1
- package/dist/cjs/components/ShareDialogContainer.js +60 -65
- package/dist/cjs/components/ShareDialogWithTrigger.js +5 -5
- package/dist/cjs/components/analytics/analytics.js +1 -1
- package/dist/cjs/types/ShareEntities.js +4 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/ShareDialogContainer.js +3 -4
- package/dist/es2019/components/ShareDialogWithTrigger.js +5 -5
- package/dist/es2019/components/analytics/analytics.js +1 -1
- package/dist/es2019/types/ShareEntities.js +3 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/AtlassianUrlShortenerClient.js +43 -46
- package/dist/esm/components/ShareDialogContainer.js +60 -65
- package/dist/esm/components/ShareDialogWithTrigger.js +5 -5
- package/dist/esm/components/analytics/analytics.js +1 -1
- package/dist/esm/types/ShareEntities.js +3 -3
- package/dist/esm/version.json +1 -1
- package/package.json +24 -24
- package/tmp/api-report-tmp.d.ts +0 -319
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
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; }
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
5
|
export var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
|
|
7
6
|
function AtlassianUrlShortenerClient() {
|
|
8
7
|
_classCallCheck(this, AtlassianUrlShortenerClient);
|
|
@@ -10,51 +9,49 @@ export var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
|
|
|
10
9
|
_createClass(AtlassianUrlShortenerClient, [{
|
|
11
10
|
key: "shorten",
|
|
12
11
|
value: function () {
|
|
13
|
-
var _shorten = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
12
|
+
var _shorten = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
14
13
|
var response, result;
|
|
15
|
-
return _regeneratorRuntime
|
|
16
|
-
while (1) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return _context.stop();
|
|
57
|
-
}
|
|
14
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
15
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16
|
+
case 0:
|
|
17
|
+
_context.prev = 0;
|
|
18
|
+
_context.next = 3;
|
|
19
|
+
return fetch('/gateway/api/atl-link/create', {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': 'application/json'
|
|
23
|
+
},
|
|
24
|
+
body: JSON.stringify(data)
|
|
25
|
+
});
|
|
26
|
+
case 3:
|
|
27
|
+
response = _context.sent;
|
|
28
|
+
if (response.ok) {
|
|
29
|
+
_context.next = 6;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
throw new Error("status=\"".concat(response.status, "\""));
|
|
33
|
+
case 6:
|
|
34
|
+
_context.next = 8;
|
|
35
|
+
return response.json();
|
|
36
|
+
case 8:
|
|
37
|
+
result = _context.sent;
|
|
38
|
+
if (result.shortUrl) {
|
|
39
|
+
_context.next = 11;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
throw new Error('Breach of contract!');
|
|
43
|
+
case 11:
|
|
44
|
+
return _context.abrupt("return", result);
|
|
45
|
+
case 14:
|
|
46
|
+
_context.prev = 14;
|
|
47
|
+
_context.t0 = _context["catch"](0);
|
|
48
|
+
if (_context.t0 instanceof Error) {
|
|
49
|
+
_context.t0.message = "While shortening URL: ".concat(_context.t0.message, "!");
|
|
50
|
+
}
|
|
51
|
+
throw _context.t0;
|
|
52
|
+
case 18:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context.stop();
|
|
58
55
|
}
|
|
59
56
|
}, _callee, null, [[0, 14]]);
|
|
60
57
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -8,7 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
8
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
-
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; }
|
|
11
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
14
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -66,47 +66,45 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
66
66
|
_defineProperty(_assertThisInitialized(_this), "fetchConfig", function () {
|
|
67
67
|
_this.setState({
|
|
68
68
|
isFetchingConfig: true
|
|
69
|
-
}, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
69
|
+
}, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
70
70
|
var config, errObj;
|
|
71
|
-
return _regeneratorRuntime
|
|
72
|
-
while (1) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return _context.stop();
|
|
109
|
-
}
|
|
71
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
72
|
+
while (1) switch (_context.prev = _context.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
_context.prev = 0;
|
|
75
|
+
renderShareDialogExp.start();
|
|
76
|
+
_context.next = 4;
|
|
77
|
+
return _this.shareClient.getConfig(_this.props.cloudId);
|
|
78
|
+
case 4:
|
|
79
|
+
config = _context.sent;
|
|
80
|
+
if (_this._isMounted) {
|
|
81
|
+
_this.setState({
|
|
82
|
+
config: config,
|
|
83
|
+
isFetchingConfig: false
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
renderShareDialogExp.success();
|
|
87
|
+
_context.next = 15;
|
|
88
|
+
break;
|
|
89
|
+
case 9:
|
|
90
|
+
_context.prev = 9;
|
|
91
|
+
_context.t0 = _context["catch"](0);
|
|
92
|
+
if (_this._isMounted) {
|
|
93
|
+
_this.setState({
|
|
94
|
+
config: defaultConfig,
|
|
95
|
+
isFetchingConfig: false
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
errObj = _extends({}, (_objectDestructuringEmpty(_context.t0), _context.t0));
|
|
99
|
+
if (_context.t0 instanceof Error) {
|
|
100
|
+
errObj = _objectSpread(_objectSpread({}, errObj), {}, {
|
|
101
|
+
className: _context.t0.constructor.name
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
isValidFailedExperience(renderShareDialogExp, errObj);
|
|
105
|
+
case 15:
|
|
106
|
+
case "end":
|
|
107
|
+
return _context.stop();
|
|
110
108
|
}
|
|
111
109
|
}, _callee, null, [[0, 9]]);
|
|
112
110
|
})));
|
|
@@ -145,26 +143,24 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
145
143
|
});
|
|
146
144
|
});
|
|
147
145
|
});
|
|
148
|
-
_defineProperty(_assertThisInitialized(_this), "handleDialogOpen", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
149
|
-
return _regeneratorRuntime
|
|
150
|
-
while (1) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
});
|
|
146
|
+
_defineProperty(_assertThisInitialized(_this), "handleDialogOpen", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
147
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
148
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
149
|
+
case 0:
|
|
150
|
+
if (_this.props.onDialogOpen) {
|
|
151
|
+
_this.props.onDialogOpen();
|
|
152
|
+
}
|
|
153
|
+
_this.setState({
|
|
154
|
+
currentPageUrl: getCurrentPageUrl()
|
|
155
|
+
}, function () {
|
|
156
|
+
_this.updateShortCopyLink();
|
|
157
|
+
});
|
|
161
158
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
159
|
+
// always refetch the config when modal is re-opened
|
|
160
|
+
_this.fetchConfig();
|
|
161
|
+
case 3:
|
|
162
|
+
case "end":
|
|
163
|
+
return _context2.stop();
|
|
168
164
|
}
|
|
169
165
|
}, _callee2);
|
|
170
166
|
})));
|
|
@@ -182,9 +178,12 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
182
178
|
}
|
|
183
179
|
return payload;
|
|
184
180
|
});
|
|
181
|
+
// ensure origin is re-generated if the link or the factory changes
|
|
182
|
+
// separate memoization is needed since copy != form
|
|
185
183
|
_defineProperty(_assertThisInitialized(_this), "getUniqueCopyLinkOriginTracing", memoizeOne(function (link, originTracingFactory) {
|
|
186
184
|
return originTracingFactory();
|
|
187
185
|
}));
|
|
186
|
+
// form origin must furthermore be regenerated after each form share
|
|
188
187
|
_defineProperty(_assertThisInitialized(_this), "getUniqueFormShareOriginTracing", memoizeOne(function (link, originTracingFactory, shareCount) {
|
|
189
188
|
return originTracingFactory();
|
|
190
189
|
}));
|
|
@@ -236,10 +235,6 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
236
235
|
this.updateShortCopyLink();
|
|
237
236
|
}
|
|
238
237
|
}
|
|
239
|
-
|
|
240
|
-
// ensure origin is re-generated if the link or the factory changes
|
|
241
|
-
// separate memoization is needed since copy != form
|
|
242
|
-
// form origin must furthermore be regenerated after each form share
|
|
243
238
|
}, {
|
|
244
239
|
key: "getRawLink",
|
|
245
240
|
value: function getRawLink() {
|
|
@@ -55,6 +55,11 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
55
55
|
}
|
|
56
56
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
57
57
|
_defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/React.createRef());
|
|
58
|
+
/**
|
|
59
|
+
* Because the PopUp component has a higher zIndex it causes
|
|
60
|
+
* the select to be rendered within it, and add scrollbars.
|
|
61
|
+
* We will render the select options the PopUp outside,
|
|
62
|
+
*/
|
|
58
63
|
_defineProperty(_assertThisInitialized(_this), "selectPortalRef", /*#__PURE__*/React.createRef());
|
|
59
64
|
_defineProperty(_assertThisInitialized(_this), "start", 0);
|
|
60
65
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
@@ -362,11 +367,6 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
362
367
|
});
|
|
363
368
|
return _this;
|
|
364
369
|
}
|
|
365
|
-
/**
|
|
366
|
-
* Because the PopUp component has a higher zIndex it causes
|
|
367
|
-
* the select to be rendered within it, and add scrollbars.
|
|
368
|
-
* We will render the select options the PopUp outside,
|
|
369
|
-
*/
|
|
370
370
|
_createClass(ShareDialogWithTriggerInternal, [{
|
|
371
371
|
key: "componentDidMount",
|
|
372
372
|
value: function componentDidMount() {
|
|
@@ -6,7 +6,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
6
6
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
7
|
return _objectSpread({
|
|
8
8
|
packageName: "@atlaskit/share",
|
|
9
|
-
packageVersion: "4.
|
|
9
|
+
packageVersion: "4.2.0"
|
|
10
10
|
}, attributes);
|
|
11
11
|
};
|
|
12
12
|
var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Third party integrations
|
|
2
2
|
|
|
3
|
-
export var TabType
|
|
4
|
-
(function (TabType) {
|
|
3
|
+
export var TabType = /*#__PURE__*/function (TabType) {
|
|
5
4
|
TabType[TabType["default"] = 0] = "default";
|
|
6
5
|
TabType[TabType["Slack"] = 1] = "Slack";
|
|
7
|
-
|
|
6
|
+
return TabType;
|
|
7
|
+
}({});
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/share",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Fabric Share Element",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,23 +30,23 @@
|
|
|
30
30
|
"access": "private"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@atlaskit/analytics-next": "^9.
|
|
34
|
-
"@atlaskit/button": "^16.
|
|
35
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
36
|
-
"@atlaskit/form": "^8.
|
|
37
|
-
"@atlaskit/icon": "^21.
|
|
38
|
-
"@atlaskit/popup": "^1.
|
|
39
|
-
"@atlaskit/portal": "^4.
|
|
40
|
-
"@atlaskit/smart-user-picker": "^6.
|
|
41
|
-
"@atlaskit/spinner": "^15.
|
|
42
|
-
"@atlaskit/tabs": "^13.
|
|
43
|
-
"@atlaskit/textarea": "^4.
|
|
44
|
-
"@atlaskit/theme": "^12.
|
|
45
|
-
"@atlaskit/tokens": "^1.
|
|
46
|
-
"@atlaskit/tooltip": "^17.
|
|
47
|
-
"@atlaskit/ufo": "^0.
|
|
48
|
-
"@atlaskit/user-picker": "^10.
|
|
49
|
-
"@atlaskit/util-service-support": "^6.
|
|
33
|
+
"@atlaskit/analytics-next": "^9.1.0",
|
|
34
|
+
"@atlaskit/button": "^16.7.0",
|
|
35
|
+
"@atlaskit/dropdown-menu": "^11.8.0",
|
|
36
|
+
"@atlaskit/form": "^8.11.0",
|
|
37
|
+
"@atlaskit/icon": "^21.12.0",
|
|
38
|
+
"@atlaskit/popup": "^1.6.0",
|
|
39
|
+
"@atlaskit/portal": "^4.3.0",
|
|
40
|
+
"@atlaskit/smart-user-picker": "^6.1.0",
|
|
41
|
+
"@atlaskit/spinner": "^15.5.0",
|
|
42
|
+
"@atlaskit/tabs": "^13.4.0",
|
|
43
|
+
"@atlaskit/textarea": "^4.6.0",
|
|
44
|
+
"@atlaskit/theme": "^12.5.0",
|
|
45
|
+
"@atlaskit/tokens": "^1.3.0",
|
|
46
|
+
"@atlaskit/tooltip": "^17.8.0",
|
|
47
|
+
"@atlaskit/ufo": "^0.2.0",
|
|
48
|
+
"@atlaskit/user-picker": "^10.2.0",
|
|
49
|
+
"@atlaskit/util-service-support": "^6.2.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1",
|
|
52
52
|
"@react-loosely-lazy/manifest": "^1.0.0",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"react": "^16.8.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@atlaskit/docs": "^9.
|
|
63
|
+
"@atlaskit/docs": "^9.1.0",
|
|
64
64
|
"@atlaskit/editor-test-helpers": "^18.2.0",
|
|
65
|
-
"@atlaskit/flag": "^15.
|
|
66
|
-
"@atlaskit/section-message": "^6.
|
|
67
|
-
"@atlaskit/select": "^16.
|
|
68
|
-
"@atlaskit/toggle": "^12.
|
|
69
|
-
"@atlaskit/util-data-test": "^17.
|
|
65
|
+
"@atlaskit/flag": "^15.2.0",
|
|
66
|
+
"@atlaskit/section-message": "^6.4.0",
|
|
67
|
+
"@atlaskit/select": "^16.2.0",
|
|
68
|
+
"@atlaskit/toggle": "^12.6.0",
|
|
69
|
+
"@atlaskit/util-data-test": "^17.8.0",
|
|
70
70
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
71
71
|
"enzyme": "^3.10.0",
|
|
72
72
|
"enzyme-adapter-react-16": "^1.15.1",
|