@atlaskit/smart-card 25.9.2 → 25.9.4
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 +12 -0
- package/dist/cjs/constants.js +70 -70
- package/dist/cjs/extractors/index.js +1 -1
- package/dist/cjs/i18n/cs.js +2 -1
- package/dist/cjs/i18n/da.js +2 -1
- package/dist/cjs/i18n/de.js +2 -1
- package/dist/cjs/i18n/en.js +5 -0
- package/dist/cjs/i18n/en_GB.js +5 -0
- package/dist/cjs/i18n/es.js +2 -1
- package/dist/cjs/i18n/fr.js +2 -1
- package/dist/cjs/i18n/hu.js +2 -1
- package/dist/cjs/i18n/it.js +2 -1
- package/dist/cjs/i18n/ja.js +1 -0
- package/dist/cjs/i18n/ko.js +2 -1
- package/dist/cjs/i18n/nb.js +2 -1
- package/dist/cjs/i18n/nl.js +1 -0
- package/dist/cjs/i18n/pl.js +2 -1
- package/dist/cjs/i18n/pt_BR.js +2 -1
- package/dist/cjs/i18n/ru.js +2 -1
- package/dist/cjs/i18n/sv.js +2 -1
- package/dist/cjs/i18n/th.js +2 -1
- package/dist/cjs/i18n/tr.js +2 -1
- package/dist/cjs/i18n/uk.js +2 -1
- package/dist/cjs/i18n/vi.js +2 -1
- package/dist/cjs/i18n/zh.js +2 -1
- package/dist/cjs/i18n/zh_TW.js +2 -1
- package/dist/cjs/state/actions/index.js +68 -72
- package/dist/cjs/state/hooks/use-invoke/index.js +13 -16
- package/dist/cjs/state/hooks/use-resolve/index.js +29 -32
- package/dist/cjs/state/hooks/usePrefetch.js +58 -61
- package/dist/cjs/utils/index.js +28 -30
- package/dist/cjs/utils/mocks.js +34 -41
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/DownloadAction.js +16 -19
- package/dist/cjs/view/BlockCard/actions/PreviewAction.js +31 -33
- package/dist/cjs/view/BlockCard/actions/RetryAction.js +9 -12
- package/dist/cjs/view/BlockCard/actions/ViewAction.js +16 -19
- package/dist/cjs/view/CardWithData/loader.js +1 -1
- package/dist/cjs/view/CardWithUrl/loader.js +1 -1
- package/dist/cjs/view/EmbedModal/types.js +4 -4
- package/dist/cjs/view/EmbedModal/utils.js +33 -35
- package/dist/cjs/view/FlexibleCard/components/actions/action/download-action/index.js +33 -36
- package/dist/cjs/view/FlexibleCard/components/actions/action/view-action/index.js +16 -19
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +60 -60
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/index.js +114 -99
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/styled.js +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +14 -14
- package/dist/es2019/constants.js +63 -63
- package/dist/es2019/i18n/cs.js +2 -1
- package/dist/es2019/i18n/da.js +2 -1
- package/dist/es2019/i18n/de.js +2 -1
- package/dist/es2019/i18n/en.js +5 -0
- package/dist/es2019/i18n/en_GB.js +5 -0
- package/dist/es2019/i18n/es.js +2 -1
- package/dist/es2019/i18n/fr.js +2 -1
- package/dist/es2019/i18n/hu.js +2 -1
- package/dist/es2019/i18n/it.js +2 -1
- package/dist/es2019/i18n/ja.js +1 -0
- package/dist/es2019/i18n/ko.js +2 -1
- package/dist/es2019/i18n/nb.js +2 -1
- package/dist/es2019/i18n/nl.js +1 -0
- package/dist/es2019/i18n/pl.js +2 -1
- package/dist/es2019/i18n/pt_BR.js +2 -1
- package/dist/es2019/i18n/ru.js +2 -1
- package/dist/es2019/i18n/sv.js +2 -1
- package/dist/es2019/i18n/th.js +2 -1
- package/dist/es2019/i18n/tr.js +2 -1
- package/dist/es2019/i18n/uk.js +2 -1
- package/dist/es2019/i18n/vi.js +2 -1
- package/dist/es2019/i18n/zh.js +2 -1
- package/dist/es2019/i18n/zh_TW.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/EmbedModal/types.js +3 -3
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/index.js +19 -5
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/styled.js +3 -0
- package/dist/esm/constants.js +63 -63
- package/dist/esm/extractors/index.js +1 -1
- package/dist/esm/i18n/cs.js +2 -1
- package/dist/esm/i18n/da.js +2 -1
- package/dist/esm/i18n/de.js +2 -1
- package/dist/esm/i18n/en.js +5 -0
- package/dist/esm/i18n/en_GB.js +5 -0
- package/dist/esm/i18n/es.js +2 -1
- package/dist/esm/i18n/fr.js +2 -1
- package/dist/esm/i18n/hu.js +2 -1
- package/dist/esm/i18n/it.js +2 -1
- package/dist/esm/i18n/ja.js +1 -0
- package/dist/esm/i18n/ko.js +2 -1
- package/dist/esm/i18n/nb.js +2 -1
- package/dist/esm/i18n/nl.js +1 -0
- package/dist/esm/i18n/pl.js +2 -1
- package/dist/esm/i18n/pt_BR.js +2 -1
- package/dist/esm/i18n/ru.js +2 -1
- package/dist/esm/i18n/sv.js +2 -1
- package/dist/esm/i18n/th.js +2 -1
- package/dist/esm/i18n/tr.js +2 -1
- package/dist/esm/i18n/uk.js +2 -1
- package/dist/esm/i18n/vi.js +2 -1
- package/dist/esm/i18n/zh.js +2 -1
- package/dist/esm/i18n/zh_TW.js +2 -1
- package/dist/esm/state/actions/index.js +68 -73
- package/dist/esm/state/hooks/use-invoke/index.js +13 -16
- package/dist/esm/state/hooks/use-resolve/index.js +29 -32
- package/dist/esm/state/hooks/usePrefetch.js +58 -61
- package/dist/esm/utils/index.js +28 -31
- package/dist/esm/utils/mocks.js +34 -41
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/DownloadAction.js +16 -19
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +29 -32
- package/dist/esm/view/BlockCard/actions/RetryAction.js +9 -12
- package/dist/esm/view/BlockCard/actions/ViewAction.js +16 -19
- package/dist/esm/view/EmbedModal/types.js +3 -3
- package/dist/esm/view/EmbedModal/utils.js +31 -34
- package/dist/esm/view/FlexibleCard/components/actions/action/download-action/index.js +33 -36
- package/dist/esm/view/FlexibleCard/components/actions/action/view-action/index.js +16 -19
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/index.js +113 -101
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/styled.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +12 -15
- package/dist/types/i18n/cs.d.ts +1 -0
- package/dist/types/i18n/da.d.ts +1 -0
- package/dist/types/i18n/de.d.ts +1 -0
- package/dist/types/i18n/en.d.ts +5 -0
- package/dist/types/i18n/en_GB.d.ts +5 -0
- package/dist/types/i18n/es.d.ts +1 -0
- package/dist/types/i18n/fr.d.ts +1 -0
- package/dist/types/i18n/hu.d.ts +1 -0
- package/dist/types/i18n/it.d.ts +1 -0
- package/dist/types/i18n/ja.d.ts +1 -0
- package/dist/types/i18n/ko.d.ts +1 -0
- package/dist/types/i18n/nb.d.ts +1 -0
- package/dist/types/i18n/nl.d.ts +1 -0
- package/dist/types/i18n/pl.d.ts +1 -0
- package/dist/types/i18n/pt_BR.d.ts +1 -0
- package/dist/types/i18n/ru.d.ts +1 -0
- package/dist/types/i18n/sv.d.ts +1 -0
- package/dist/types/i18n/th.d.ts +1 -0
- package/dist/types/i18n/tr.d.ts +1 -0
- package/dist/types/i18n/uk.d.ts +1 -0
- package/dist/types/i18n/vi.d.ts +1 -0
- package/dist/types/i18n/zh.d.ts +1 -0
- package/dist/types/i18n/zh_TW.d.ts +1 -0
- package/dist/types/view/Card/types.d.ts +0 -2
- package/dist/types/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/types.d.ts +3 -2
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -24,7 +25,8 @@ var _useResolve = _interopRequireDefault(require("../../../../../state/hooks/use
|
|
|
24
25
|
var _types = require("./lozenge-action-error/types");
|
|
25
26
|
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); }
|
|
26
27
|
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; }
|
|
27
|
-
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; } /** @jsx jsx */
|
|
28
|
+
/** @jsx jsx */
|
|
29
|
+
|
|
28
30
|
var validateItems = function validateItems() {
|
|
29
31
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
30
32
|
var text = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -43,26 +45,39 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
43
45
|
testId = _ref$testId === void 0 ? 'smart-element-lozenge-action' : _ref$testId,
|
|
44
46
|
text = _ref.text,
|
|
45
47
|
zIndex = _ref.zIndex;
|
|
46
|
-
var _useState = (0, _react2.useState)(
|
|
48
|
+
var _useState = (0, _react2.useState)({
|
|
49
|
+
appearance: appearance,
|
|
50
|
+
text: text
|
|
51
|
+
}),
|
|
47
52
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
selected = _useState2[0],
|
|
54
|
+
setSelected = _useState2[1];
|
|
50
55
|
var _useState3 = (0, _react2.useState)(false),
|
|
51
56
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
isLoaded = _useState4[0],
|
|
58
|
+
setIsLoaded = _useState4[1];
|
|
54
59
|
var _useState5 = (0, _react2.useState)(false),
|
|
55
60
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var _useState7 = (0, _react2.useState)(),
|
|
61
|
+
isLoading = _useState6[0],
|
|
62
|
+
setIsLoading = _useState6[1];
|
|
63
|
+
var _useState7 = (0, _react2.useState)(false),
|
|
59
64
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
isOpen = _useState8[0],
|
|
66
|
+
setIsOpen = _useState8[1];
|
|
62
67
|
var _useState9 = (0, _react2.useState)(),
|
|
63
68
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
items = _useState10[0],
|
|
70
|
+
setItems = _useState10[1];
|
|
71
|
+
var _useState11 = (0, _react2.useState)(),
|
|
72
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
73
|
+
errorMessage = _useState12[0],
|
|
74
|
+
setErrorMessage = _useState12[1];
|
|
75
|
+
(0, _react2.useEffect)(function () {
|
|
76
|
+
setSelected({
|
|
77
|
+
text: text,
|
|
78
|
+
appearance: appearance
|
|
79
|
+
});
|
|
80
|
+
}, [text, appearance]);
|
|
66
81
|
var invoke = (0, _useInvoke.default)();
|
|
67
82
|
var reload = (0, _useResolve.default)();
|
|
68
83
|
var _ref2 = (action === null || action === void 0 ? void 0 : (_action$update = action.update) === null || _action$update === void 0 ? void 0 : _action$update.details) || {},
|
|
@@ -70,49 +85,47 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
70
85
|
linkId = _ref2.id,
|
|
71
86
|
previewData = _ref2.previewData;
|
|
72
87
|
var handleOpenChange = (0, _react2.useCallback)( /*#__PURE__*/function () {
|
|
73
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
88
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(args) {
|
|
74
89
|
var responseItems, validItems;
|
|
75
|
-
return
|
|
76
|
-
while (1) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
_context.next = 20;
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
_context.prev = 2;
|
|
85
|
-
setIsLoading(true);
|
|
86
|
-
_context.next = 6;
|
|
87
|
-
return invoke(action.read, _extractLozengeActionItems.default);
|
|
88
|
-
case 6:
|
|
89
|
-
responseItems = _context.sent;
|
|
90
|
-
validItems = typeof text === 'string' ? validateItems(responseItems, text) : responseItems;
|
|
91
|
-
setItems(validItems);
|
|
92
|
-
setIsLoaded(true);
|
|
93
|
-
if ((validItems === null || validItems === void 0 ? void 0 : validItems.length) === 0) {
|
|
94
|
-
setErrorMessage(_types.LozengeActionErrorMessages.noData);
|
|
95
|
-
setIsLoaded(false);
|
|
96
|
-
}
|
|
97
|
-
_context.next = 17;
|
|
90
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
91
|
+
while (1) switch (_context.prev = _context.next) {
|
|
92
|
+
case 0:
|
|
93
|
+
setIsOpen(args.isOpen);
|
|
94
|
+
if (!(args.isOpen && !isLoaded && action !== null && action !== void 0 && action.read)) {
|
|
95
|
+
_context.next = 20;
|
|
98
96
|
break;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
}
|
|
98
|
+
_context.prev = 2;
|
|
99
|
+
setIsLoading(true);
|
|
100
|
+
_context.next = 6;
|
|
101
|
+
return invoke(action.read, _extractLozengeActionItems.default);
|
|
102
|
+
case 6:
|
|
103
|
+
responseItems = _context.sent;
|
|
104
|
+
validItems = typeof text === 'string' ? validateItems(responseItems, text) : responseItems;
|
|
105
|
+
setItems(validItems);
|
|
106
|
+
setIsLoaded(true);
|
|
107
|
+
if ((validItems === null || validItems === void 0 ? void 0 : validItems.length) === 0) {
|
|
108
|
+
setErrorMessage(_types.LozengeActionErrorMessages.noData);
|
|
103
109
|
setIsLoaded(false);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
}
|
|
111
|
+
_context.next = 17;
|
|
112
|
+
break;
|
|
113
|
+
case 13:
|
|
114
|
+
_context.prev = 13;
|
|
115
|
+
_context.t0 = _context["catch"](2);
|
|
116
|
+
setErrorMessage(_types.LozengeActionErrorMessages.unknown);
|
|
117
|
+
setIsLoaded(false);
|
|
118
|
+
case 17:
|
|
119
|
+
_context.prev = 17;
|
|
120
|
+
setIsLoading(false);
|
|
121
|
+
return _context.finish(17);
|
|
122
|
+
case 20:
|
|
123
|
+
if (!args.isOpen) {
|
|
124
|
+
setErrorMessage(undefined);
|
|
125
|
+
}
|
|
126
|
+
case 21:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context.stop();
|
|
116
129
|
}
|
|
117
130
|
}, _callee, null, [[2, 13, 17, 20]]);
|
|
118
131
|
}));
|
|
@@ -122,59 +135,61 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
122
135
|
}(), [action === null || action === void 0 ? void 0 : action.read, invoke, isLoaded, text]);
|
|
123
136
|
var trigger = (0, _react2.useCallback)(function (props) {
|
|
124
137
|
return (0, _react.jsx)(_lozengeActionTrigger.default, (0, _extends2.default)({}, props, {
|
|
125
|
-
appearance: appearance,
|
|
138
|
+
appearance: selected.appearance,
|
|
126
139
|
testId: testId,
|
|
127
|
-
text: text
|
|
140
|
+
text: selected.text
|
|
128
141
|
}));
|
|
129
|
-
}, [
|
|
142
|
+
}, [testId, selected]);
|
|
130
143
|
var handleItemClick = (0, _react2.useCallback)( /*#__PURE__*/function () {
|
|
131
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
144
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(id, text, appearance) {
|
|
132
145
|
var updateAction, request;
|
|
133
|
-
return
|
|
134
|
-
while (1) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
_context2.next =
|
|
157
|
-
return reload(url, true, undefined, linkId);
|
|
158
|
-
case 14:
|
|
159
|
-
_context2.next = 20;
|
|
146
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
147
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
148
|
+
case 0:
|
|
149
|
+
_context2.prev = 0;
|
|
150
|
+
updateAction = action === null || action === void 0 ? void 0 : action.update;
|
|
151
|
+
if (!(updateAction && id)) {
|
|
152
|
+
_context2.next = 15;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
setIsLoading(true);
|
|
156
|
+
request = (0, _createStatusUpdateRequest.default)(updateAction, id);
|
|
157
|
+
_context2.next = 7;
|
|
158
|
+
return invoke(request);
|
|
159
|
+
case 7:
|
|
160
|
+
setSelected({
|
|
161
|
+
appearance: appearance,
|
|
162
|
+
text: text
|
|
163
|
+
});
|
|
164
|
+
setIsLoading(false);
|
|
165
|
+
setIsLoaded(false);
|
|
166
|
+
setIsOpen(false);
|
|
167
|
+
setItems([]);
|
|
168
|
+
if (!url) {
|
|
169
|
+
_context2.next = 15;
|
|
160
170
|
break;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
}
|
|
172
|
+
_context2.next = 15;
|
|
173
|
+
return reload(url, true, undefined, linkId);
|
|
174
|
+
case 15:
|
|
175
|
+
_context2.next = 21;
|
|
176
|
+
break;
|
|
177
|
+
case 17:
|
|
178
|
+
_context2.prev = 17;
|
|
179
|
+
_context2.t0 = _context2["catch"](0);
|
|
180
|
+
setIsLoading(false);
|
|
181
|
+
if (isInvokeCustomError(_context2.t0)) {
|
|
182
|
+
setErrorMessage(_context2.t0.message);
|
|
183
|
+
} else {
|
|
184
|
+
setErrorMessage(_types.LozengeActionErrorMessages.updateFailed);
|
|
185
|
+
}
|
|
186
|
+
case 21:
|
|
187
|
+
case "end":
|
|
188
|
+
return _context2.stop();
|
|
174
189
|
}
|
|
175
|
-
}, _callee2, null, [[0,
|
|
190
|
+
}, _callee2, null, [[0, 17]]);
|
|
176
191
|
}));
|
|
177
|
-
return function (_x2) {
|
|
192
|
+
return function (_x2, _x3, _x4) {
|
|
178
193
|
return _ref4.apply(this, arguments);
|
|
179
194
|
};
|
|
180
195
|
}(), [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url]);
|
package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/index.js
CHANGED
|
@@ -22,9 +22,9 @@ var LozengeActionItem = function LozengeActionItem(_ref) {
|
|
|
22
22
|
// We want to show loading screen.
|
|
23
23
|
e.stopPropagation();
|
|
24
24
|
if (onClick) {
|
|
25
|
-
onClick(id);
|
|
25
|
+
onClick(id, text, appearance);
|
|
26
26
|
}
|
|
27
|
-
}, [id, onClick]);
|
|
27
|
+
}, [appearance, id, onClick, text]);
|
|
28
28
|
var handleMouseEnter = (0, _react.useCallback)(function (e) {
|
|
29
29
|
var _e$currentTarget, _e$currentTarget$firs;
|
|
30
30
|
(_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 ? void 0 : (_e$currentTarget$firs = _e$currentTarget.firstElementChild) === null || _e$currentTarget$firs === void 0 ? void 0 : _e$currentTarget$firs.focus();
|
|
@@ -12,5 +12,5 @@ var triggerButtonStyles = (0, _react.css)(_templateObject || (_templateObject =
|
|
|
12
12
|
exports.triggerButtonStyles = triggerButtonStyles;
|
|
13
13
|
var triggerLozengeStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n display: flex;\n\n span[role='img'] {\n margin: -4px -8px -4px -1px;\n }\n"])));
|
|
14
14
|
exports.triggerLozengeStyles = triggerLozengeStyles;
|
|
15
|
-
var dropdownItemGroupStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n button {\n padding: 6px 12px;\n min-height: 28px;\n width: 220px;\n\n &:hover {\n background-color: inherit;\n }\n\n &:focus,\n &:focus-visible {\n background-color: ", ";\n box-sizing: border-box;\n box-shadow: inset 2px 0 0 ", ";\n outline: none;\n }\n }\n"])), "var(--ds-background-neutral-subtle-hovered, #091E420F)", "var(--ds-border-selected, #0C66E4)");
|
|
15
|
+
var dropdownItemGroupStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n max-height: 300px;\n overflow-y: auto;\n\n button {\n padding: 6px 12px;\n min-height: 28px;\n width: 220px;\n\n &:hover {\n background-color: inherit;\n }\n\n &:focus,\n &:focus-visible {\n background-color: ", ";\n box-sizing: border-box;\n box-shadow: inset 2px 0 0 ", ";\n outline: none;\n }\n }\n"])), "var(--ds-background-neutral-subtle-hovered, #091E420F)", "var(--ds-border-selected, #0C66E4)");
|
|
16
16
|
exports.dropdownItemGroupStyles = dropdownItemGroupStyles;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.hoverCardClassName = exports.getOpenAction = exports.getCopyAction = exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
11
|
var _react = require("@emotion/react");
|
|
11
12
|
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
@@ -27,7 +28,8 @@ var _actions = require("../../../state/actions");
|
|
|
27
28
|
var _click = require("../../../utils/analytics/click");
|
|
28
29
|
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); }
|
|
29
30
|
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; }
|
|
30
|
-
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; } /** @jsx jsx */
|
|
31
|
+
/** @jsx jsx */
|
|
32
|
+
|
|
31
33
|
var hoverCardClassName = 'smart-links-hover-preview';
|
|
32
34
|
exports.hoverCardClassName = hoverCardClassName;
|
|
33
35
|
var getOpenAction = function getOpenAction(url, analytics, onActionClick) {
|
|
@@ -61,19 +63,17 @@ var getCopyAction = function getCopyAction(url) {
|
|
|
61
63
|
}),
|
|
62
64
|
iconPosition: 'before',
|
|
63
65
|
onClick: function () {
|
|
64
|
-
var _onClick = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
65
|
-
return
|
|
66
|
-
while (1) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return _context.stop();
|
|
76
|
-
}
|
|
66
|
+
var _onClick = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
67
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
_context.next = 2;
|
|
71
|
+
return navigator.clipboard.writeText(url);
|
|
72
|
+
case 2:
|
|
73
|
+
return _context.abrupt("return", _context.sent);
|
|
74
|
+
case 3:
|
|
75
|
+
case "end":
|
|
76
|
+
return _context.stop();
|
|
77
77
|
}
|
|
78
78
|
}, _callee);
|
|
79
79
|
}));
|
package/dist/es2019/constants.js
CHANGED
|
@@ -3,56 +3,50 @@ export const CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.c
|
|
|
3
3
|
/**
|
|
4
4
|
* The alignment of Flexible UI component.
|
|
5
5
|
*/
|
|
6
|
-
export let SmartLinkAlignment
|
|
6
|
+
export let SmartLinkAlignment = /*#__PURE__*/function (SmartLinkAlignment) {
|
|
7
|
+
SmartLinkAlignment["Left"] = "left";
|
|
8
|
+
SmartLinkAlignment["Right"] = "right";
|
|
9
|
+
return SmartLinkAlignment;
|
|
10
|
+
}({});
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
13
|
* The direction of Flexible UI components. It establish the main-axis
|
|
10
14
|
* or how the child components laid out inside the parent component.
|
|
11
15
|
* Similar to flex's flex-direction concept.
|
|
12
16
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
export let SmartLinkDirection = /*#__PURE__*/function (SmartLinkDirection) {
|
|
18
|
+
SmartLinkDirection["Horizontal"] = "horizontal";
|
|
19
|
+
SmartLinkDirection["Vertical"] = "vertical";
|
|
20
|
+
return SmartLinkDirection;
|
|
21
|
+
}({});
|
|
18
22
|
|
|
19
23
|
/**
|
|
20
24
|
* The positioning of the component within the parent component.
|
|
21
25
|
* Similar to flex's align-items or align-self concept.
|
|
22
26
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
export let SmartLinkPosition = /*#__PURE__*/function (SmartLinkPosition) {
|
|
28
|
+
SmartLinkPosition["Top"] = "top";
|
|
29
|
+
SmartLinkPosition["Center"] = "center";
|
|
30
|
+
return SmartLinkPosition;
|
|
31
|
+
}({});
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* The sizing options of the Flexible UI component. Every component
|
|
31
35
|
* has or inherits the sizing props. Implementation varies
|
|
32
36
|
* as per component.
|
|
33
37
|
*/
|
|
34
|
-
|
|
35
|
-
SmartLinkPosition["Top"] = "top";
|
|
36
|
-
SmartLinkPosition["Center"] = "center";
|
|
37
|
-
})(SmartLinkPosition || (SmartLinkPosition = {}));
|
|
38
|
-
export let SmartLinkSize;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Smart Links link request status
|
|
42
|
-
*/
|
|
43
|
-
(function (SmartLinkSize) {
|
|
38
|
+
export let SmartLinkSize = /*#__PURE__*/function (SmartLinkSize) {
|
|
44
39
|
SmartLinkSize["XLarge"] = "xlarge";
|
|
45
40
|
SmartLinkSize["Large"] = "large";
|
|
46
41
|
SmartLinkSize["Medium"] = "medium";
|
|
47
42
|
SmartLinkSize["Small"] = "small";
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
return SmartLinkSize;
|
|
44
|
+
}({});
|
|
50
45
|
|
|
51
46
|
/**
|
|
52
|
-
*
|
|
53
|
-
* This determine the styling of the link.
|
|
47
|
+
* Smart Links link request status
|
|
54
48
|
*/
|
|
55
|
-
|
|
49
|
+
export let SmartLinkStatus = /*#__PURE__*/function (SmartLinkStatus) {
|
|
56
50
|
SmartLinkStatus["Pending"] = "pending";
|
|
57
51
|
SmartLinkStatus["Resolving"] = "resolving";
|
|
58
52
|
SmartLinkStatus["Resolved"] = "resolved";
|
|
@@ -61,23 +55,33 @@ export let SmartLinkStatus;
|
|
|
61
55
|
SmartLinkStatus["NotFound"] = "not_found";
|
|
62
56
|
SmartLinkStatus["Unauthorized"] = "unauthorized";
|
|
63
57
|
SmartLinkStatus["Fallback"] = "fallback";
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
return SmartLinkStatus;
|
|
59
|
+
}({});
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Flexible UI theme available on the Card level.
|
|
63
|
+
* This determine the styling of the link.
|
|
64
|
+
*/
|
|
65
|
+
export let SmartLinkTheme = /*#__PURE__*/function (SmartLinkTheme) {
|
|
67
66
|
SmartLinkTheme["Black"] = "black";
|
|
68
67
|
SmartLinkTheme["Link"] = "link";
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
return SmartLinkTheme;
|
|
69
|
+
}({});
|
|
70
|
+
export let SmartLinkInternalTheme = /*#__PURE__*/function (SmartLinkInternalTheme) {
|
|
71
|
+
SmartLinkInternalTheme["Grey"] = "grey";
|
|
72
|
+
return SmartLinkInternalTheme;
|
|
73
|
+
}({});
|
|
71
74
|
|
|
72
75
|
/**
|
|
73
76
|
* Determines whether the container size will fit to the content
|
|
74
77
|
* or expand to the available width or the parent component.
|
|
75
78
|
* Similar to flex's flex-grow concept.
|
|
76
79
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
export let SmartLinkWidth = /*#__PURE__*/function (SmartLinkWidth) {
|
|
81
|
+
SmartLinkWidth["FitToContent"] = "fit-to-content";
|
|
82
|
+
SmartLinkWidth["Flexible"] = "flexible";
|
|
83
|
+
return SmartLinkWidth;
|
|
84
|
+
}({});
|
|
81
85
|
|
|
82
86
|
/**
|
|
83
87
|
* Flexible UI element name - each reflecting the link data its represented.
|
|
@@ -95,16 +99,7 @@ export let SmartLinkWidth;
|
|
|
95
99
|
* 6) Update element ElementDisplaySchema for inline/block display
|
|
96
100
|
* (src/view/FlexibleCard/components/blocks/utils.tsx)
|
|
97
101
|
*/
|
|
98
|
-
|
|
99
|
-
SmartLinkWidth["FitToContent"] = "fit-to-content";
|
|
100
|
-
SmartLinkWidth["Flexible"] = "flexible";
|
|
101
|
-
})(SmartLinkWidth || (SmartLinkWidth = {}));
|
|
102
|
-
export let ElementName;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Flexible UI action (button)
|
|
106
|
-
*/
|
|
107
|
-
(function (ElementName) {
|
|
102
|
+
export let ElementName = /*#__PURE__*/function (ElementName) {
|
|
108
103
|
ElementName["AttachmentCount"] = "AttachmentCount";
|
|
109
104
|
ElementName["AuthorGroup"] = "AuthorGroup";
|
|
110
105
|
ElementName["ChecklistProgress"] = "ChecklistProgress";
|
|
@@ -132,26 +127,26 @@ export let ElementName;
|
|
|
132
127
|
ElementName["Title"] = "Title";
|
|
133
128
|
ElementName["ViewCount"] = "ViewCount";
|
|
134
129
|
ElementName["VoteCount"] = "VoteCount";
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
return ElementName;
|
|
131
|
+
}({});
|
|
137
132
|
|
|
138
133
|
/**
|
|
139
|
-
* Flexible UI
|
|
134
|
+
* Flexible UI action (button)
|
|
140
135
|
*/
|
|
141
|
-
|
|
136
|
+
export let ActionName = /*#__PURE__*/function (ActionName) {
|
|
142
137
|
ActionName["DeleteAction"] = "DeleteAction";
|
|
143
138
|
ActionName["EditAction"] = "EditAction";
|
|
144
139
|
ActionName["PreviewAction"] = "PreviewAction";
|
|
145
140
|
ActionName["ViewAction"] = "ViewAction";
|
|
146
141
|
ActionName["DownloadAction"] = "DownloadAction";
|
|
147
142
|
ActionName["CustomAction"] = "CustomAction";
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
return ActionName;
|
|
144
|
+
}({});
|
|
150
145
|
|
|
151
146
|
/**
|
|
152
|
-
*
|
|
147
|
+
* Flexible UI icons - each mapped to AK icons.
|
|
153
148
|
*/
|
|
154
|
-
|
|
149
|
+
export let IconType = /*#__PURE__*/function (IconType) {
|
|
155
150
|
IconType["Archive"] = "FileType:Archive";
|
|
156
151
|
IconType["Audio"] = "FileType:Audio";
|
|
157
152
|
IconType["Blog"] = "FileType:Blog";
|
|
@@ -214,22 +209,27 @@ export let IconType;
|
|
|
214
209
|
IconType["PriorityUndefined"] = "Badge:PriorityUndefined";
|
|
215
210
|
IconType["ProgrammingLanguage"] = "Badge:ProgrammingLanguage";
|
|
216
211
|
IconType["Subscriber"] = "Badge:Subscriber";
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
return IconType;
|
|
213
|
+
}({});
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Type for Flexible UI's Media element
|
|
217
|
+
*/
|
|
218
|
+
export let MediaType = /*#__PURE__*/function (MediaType) {
|
|
220
219
|
MediaType["Image"] = "image";
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
220
|
+
return MediaType;
|
|
221
|
+
}({});
|
|
222
|
+
export let MediaPlacement = /*#__PURE__*/function (MediaPlacement) {
|
|
224
223
|
MediaPlacement["Left"] = "left";
|
|
225
224
|
MediaPlacement["Right"] = "right";
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
return MediaPlacement;
|
|
226
|
+
}({});
|
|
227
|
+
export let CardDisplay = /*#__PURE__*/function (CardDisplay) {
|
|
229
228
|
CardDisplay["Inline"] = "inline";
|
|
230
229
|
CardDisplay["Block"] = "block";
|
|
231
230
|
CardDisplay["Embed"] = "embed";
|
|
232
231
|
CardDisplay["EmbedPreview"] = "embedPreview";
|
|
233
232
|
CardDisplay["Flexible"] = "flexible";
|
|
234
233
|
CardDisplay["HoverCardPreview"] = "hoverCardPreview";
|
|
235
|
-
|
|
234
|
+
return CardDisplay;
|
|
235
|
+
}({});
|
package/dist/es2019/i18n/cs.js
CHANGED
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
'fabric.linking.invalid_permissions': 'Omezený obsah',
|
|
40
40
|
'fabric.linking.invalid_permissions_description': 'Pokud si chcete zobrazit tento náhled, požádejte o přístup nebo vyzkoušejte jiný účet.',
|
|
41
41
|
'fabric.linking.join_to_view': 'Chcete-li si zobrazit tento požadavek, připojte se ke službě {context}.',
|
|
42
|
-
'fabric.linking.learn_more_about_smart_links': 'Další informace o odkazech
|
|
42
|
+
'fabric.linking.learn_more_about_smart_links': 'Další informace o chytrých odkazech',
|
|
43
43
|
'fabric.linking.link_safety_warning_message': 'Odkaz {unsafeLinkText} vás přesměruje na jiný web (<a>actual link here</a>)',
|
|
44
44
|
'fabric.linking.loading': 'Načítání…',
|
|
45
45
|
'fabric.linking.modified_on_absolute': 'Aktualizováno: {context}',
|
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
'fabric.linking.not_found_description': 'Odkaz se nepodařilo najít. Zkontrolujte adresu URL a zkuste ji upravit nebo vložit znovu.',
|
|
49
49
|
'fabric.linking.not_found_title': 'Jejda. Tento odkaz se nepodařilo najít.',
|
|
50
50
|
'fabric.linking.open_link_in_a_new_tab': 'Otevřít odkaz na nové kartě',
|
|
51
|
+
'fabric.linking.owned_by': 'Vlastník: {context}',
|
|
51
52
|
'fabric.linking.pending_request': 'Vaše žádost o přístup čeká na vyřízení.',
|
|
52
53
|
'fabric.linking.preview': 'Zobrazení na celou obrazovku',
|
|
53
54
|
'fabric.linking.preview_close': 'Zavřít náhled',
|