@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.
Files changed (147) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/constants.js +70 -70
  3. package/dist/cjs/extractors/index.js +1 -1
  4. package/dist/cjs/i18n/cs.js +2 -1
  5. package/dist/cjs/i18n/da.js +2 -1
  6. package/dist/cjs/i18n/de.js +2 -1
  7. package/dist/cjs/i18n/en.js +5 -0
  8. package/dist/cjs/i18n/en_GB.js +5 -0
  9. package/dist/cjs/i18n/es.js +2 -1
  10. package/dist/cjs/i18n/fr.js +2 -1
  11. package/dist/cjs/i18n/hu.js +2 -1
  12. package/dist/cjs/i18n/it.js +2 -1
  13. package/dist/cjs/i18n/ja.js +1 -0
  14. package/dist/cjs/i18n/ko.js +2 -1
  15. package/dist/cjs/i18n/nb.js +2 -1
  16. package/dist/cjs/i18n/nl.js +1 -0
  17. package/dist/cjs/i18n/pl.js +2 -1
  18. package/dist/cjs/i18n/pt_BR.js +2 -1
  19. package/dist/cjs/i18n/ru.js +2 -1
  20. package/dist/cjs/i18n/sv.js +2 -1
  21. package/dist/cjs/i18n/th.js +2 -1
  22. package/dist/cjs/i18n/tr.js +2 -1
  23. package/dist/cjs/i18n/uk.js +2 -1
  24. package/dist/cjs/i18n/vi.js +2 -1
  25. package/dist/cjs/i18n/zh.js +2 -1
  26. package/dist/cjs/i18n/zh_TW.js +2 -1
  27. package/dist/cjs/state/actions/index.js +68 -72
  28. package/dist/cjs/state/hooks/use-invoke/index.js +13 -16
  29. package/dist/cjs/state/hooks/use-resolve/index.js +29 -32
  30. package/dist/cjs/state/hooks/usePrefetch.js +58 -61
  31. package/dist/cjs/utils/index.js +28 -30
  32. package/dist/cjs/utils/mocks.js +34 -41
  33. package/dist/cjs/version.json +1 -1
  34. package/dist/cjs/view/BlockCard/actions/DownloadAction.js +16 -19
  35. package/dist/cjs/view/BlockCard/actions/PreviewAction.js +31 -33
  36. package/dist/cjs/view/BlockCard/actions/RetryAction.js +9 -12
  37. package/dist/cjs/view/BlockCard/actions/ViewAction.js +16 -19
  38. package/dist/cjs/view/CardWithData/loader.js +1 -1
  39. package/dist/cjs/view/CardWithUrl/loader.js +1 -1
  40. package/dist/cjs/view/EmbedModal/types.js +4 -4
  41. package/dist/cjs/view/EmbedModal/utils.js +33 -35
  42. package/dist/cjs/view/FlexibleCard/components/actions/action/download-action/index.js +33 -36
  43. package/dist/cjs/view/FlexibleCard/components/actions/action/view-action/index.js +16 -19
  44. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +60 -60
  45. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/index.js +114 -99
  46. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/index.js +2 -2
  47. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/styled.js +1 -1
  48. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +14 -14
  49. package/dist/es2019/constants.js +63 -63
  50. package/dist/es2019/i18n/cs.js +2 -1
  51. package/dist/es2019/i18n/da.js +2 -1
  52. package/dist/es2019/i18n/de.js +2 -1
  53. package/dist/es2019/i18n/en.js +5 -0
  54. package/dist/es2019/i18n/en_GB.js +5 -0
  55. package/dist/es2019/i18n/es.js +2 -1
  56. package/dist/es2019/i18n/fr.js +2 -1
  57. package/dist/es2019/i18n/hu.js +2 -1
  58. package/dist/es2019/i18n/it.js +2 -1
  59. package/dist/es2019/i18n/ja.js +1 -0
  60. package/dist/es2019/i18n/ko.js +2 -1
  61. package/dist/es2019/i18n/nb.js +2 -1
  62. package/dist/es2019/i18n/nl.js +1 -0
  63. package/dist/es2019/i18n/pl.js +2 -1
  64. package/dist/es2019/i18n/pt_BR.js +2 -1
  65. package/dist/es2019/i18n/ru.js +2 -1
  66. package/dist/es2019/i18n/sv.js +2 -1
  67. package/dist/es2019/i18n/th.js +2 -1
  68. package/dist/es2019/i18n/tr.js +2 -1
  69. package/dist/es2019/i18n/uk.js +2 -1
  70. package/dist/es2019/i18n/vi.js +2 -1
  71. package/dist/es2019/i18n/zh.js +2 -1
  72. package/dist/es2019/i18n/zh_TW.js +2 -1
  73. package/dist/es2019/version.json +1 -1
  74. package/dist/es2019/view/EmbedModal/types.js +3 -3
  75. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/index.js +19 -5
  76. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/index.js +2 -2
  77. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/styled.js +3 -0
  78. package/dist/esm/constants.js +63 -63
  79. package/dist/esm/extractors/index.js +1 -1
  80. package/dist/esm/i18n/cs.js +2 -1
  81. package/dist/esm/i18n/da.js +2 -1
  82. package/dist/esm/i18n/de.js +2 -1
  83. package/dist/esm/i18n/en.js +5 -0
  84. package/dist/esm/i18n/en_GB.js +5 -0
  85. package/dist/esm/i18n/es.js +2 -1
  86. package/dist/esm/i18n/fr.js +2 -1
  87. package/dist/esm/i18n/hu.js +2 -1
  88. package/dist/esm/i18n/it.js +2 -1
  89. package/dist/esm/i18n/ja.js +1 -0
  90. package/dist/esm/i18n/ko.js +2 -1
  91. package/dist/esm/i18n/nb.js +2 -1
  92. package/dist/esm/i18n/nl.js +1 -0
  93. package/dist/esm/i18n/pl.js +2 -1
  94. package/dist/esm/i18n/pt_BR.js +2 -1
  95. package/dist/esm/i18n/ru.js +2 -1
  96. package/dist/esm/i18n/sv.js +2 -1
  97. package/dist/esm/i18n/th.js +2 -1
  98. package/dist/esm/i18n/tr.js +2 -1
  99. package/dist/esm/i18n/uk.js +2 -1
  100. package/dist/esm/i18n/vi.js +2 -1
  101. package/dist/esm/i18n/zh.js +2 -1
  102. package/dist/esm/i18n/zh_TW.js +2 -1
  103. package/dist/esm/state/actions/index.js +68 -73
  104. package/dist/esm/state/hooks/use-invoke/index.js +13 -16
  105. package/dist/esm/state/hooks/use-resolve/index.js +29 -32
  106. package/dist/esm/state/hooks/usePrefetch.js +58 -61
  107. package/dist/esm/utils/index.js +28 -31
  108. package/dist/esm/utils/mocks.js +34 -41
  109. package/dist/esm/version.json +1 -1
  110. package/dist/esm/view/BlockCard/actions/DownloadAction.js +16 -19
  111. package/dist/esm/view/BlockCard/actions/PreviewAction.js +29 -32
  112. package/dist/esm/view/BlockCard/actions/RetryAction.js +9 -12
  113. package/dist/esm/view/BlockCard/actions/ViewAction.js +16 -19
  114. package/dist/esm/view/EmbedModal/types.js +3 -3
  115. package/dist/esm/view/EmbedModal/utils.js +31 -34
  116. package/dist/esm/view/FlexibleCard/components/actions/action/download-action/index.js +33 -36
  117. package/dist/esm/view/FlexibleCard/components/actions/action/view-action/index.js +16 -19
  118. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/index.js +113 -101
  119. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/index.js +2 -2
  120. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/styled.js +1 -1
  121. package/dist/esm/view/HoverCard/components/HoverCardContent.js +12 -15
  122. package/dist/types/i18n/cs.d.ts +1 -0
  123. package/dist/types/i18n/da.d.ts +1 -0
  124. package/dist/types/i18n/de.d.ts +1 -0
  125. package/dist/types/i18n/en.d.ts +5 -0
  126. package/dist/types/i18n/en_GB.d.ts +5 -0
  127. package/dist/types/i18n/es.d.ts +1 -0
  128. package/dist/types/i18n/fr.d.ts +1 -0
  129. package/dist/types/i18n/hu.d.ts +1 -0
  130. package/dist/types/i18n/it.d.ts +1 -0
  131. package/dist/types/i18n/ja.d.ts +1 -0
  132. package/dist/types/i18n/ko.d.ts +1 -0
  133. package/dist/types/i18n/nb.d.ts +1 -0
  134. package/dist/types/i18n/nl.d.ts +1 -0
  135. package/dist/types/i18n/pl.d.ts +1 -0
  136. package/dist/types/i18n/pt_BR.d.ts +1 -0
  137. package/dist/types/i18n/ru.d.ts +1 -0
  138. package/dist/types/i18n/sv.d.ts +1 -0
  139. package/dist/types/i18n/th.d.ts +1 -0
  140. package/dist/types/i18n/tr.d.ts +1 -0
  141. package/dist/types/i18n/uk.d.ts +1 -0
  142. package/dist/types/i18n/vi.d.ts +1 -0
  143. package/dist/types/i18n/zh.d.ts +1 -0
  144. package/dist/types/i18n/zh_TW.d.ts +1 -0
  145. package/dist/types/view/Card/types.d.ts +0 -2
  146. package/dist/types/view/FlexibleCard/components/common/lozenge-action/lozenge-action-item/types.d.ts +3 -2
  147. package/package.json +1 -1
@@ -45,7 +45,7 @@ var _default = {
45
45
  'fabric.linking.invalid_permissions': 'Nội dung bị hạn chế',
46
46
  'fabric.linking.invalid_permissions_description': 'Bạn cần có quyền truy cập hoặc thử một tài khoản khác để xem bản xem trước này.',
47
47
  'fabric.linking.join_to_view': 'Tham gia {context} để xem vấn đề này',
48
- 'fabric.linking.learn_more_about_smart_links': 'Tìm hiểu thêm về Smart Link.',
48
+ 'fabric.linking.learn_more_about_smart_links': 'Tìm hiểu thêm về Liên kết Thông minh.',
49
49
  'fabric.linking.link_safety_warning_message': 'Liên kết {unsafeLinkText} sẽ đưa bạn đến một trang khác, <a>actual link here</a>',
50
50
  'fabric.linking.loading': 'Đang tải...',
51
51
  'fabric.linking.modified_on_absolute': 'Đã cập nhật trên {context}',
@@ -54,6 +54,7 @@ var _default = {
54
54
  'fabric.linking.not_found_description': 'Chúng tôi không thể tìm thấy đường liên kết này. Hãy kiểm tra url và thử chỉnh sửa hoặc dán lại.',
55
55
  'fabric.linking.not_found_title': 'Ôi! Chúng tôi không thể tìm thấy liên kết này!',
56
56
  'fabric.linking.open_link_in_a_new_tab': 'Mở liên kết trong tab mới',
57
+ 'fabric.linking.owned_by': 'Sở hữu bởi {context}',
57
58
  'fabric.linking.pending_request': 'Đang chờ xử lý yêu cầu quyền truy cập của bạn',
58
59
  'fabric.linking.preview': 'Chế độ xem toàn màn hình',
59
60
  'fabric.linking.preview_close': 'Đóng bản xem trước',
@@ -45,7 +45,7 @@ var _default = {
45
45
  'fabric.linking.invalid_permissions': '受限内容',
46
46
  'fabric.linking.invalid_permissions_description': '您需要请求访问权限或尝试使用其他帐户来查看此预览。',
47
47
  'fabric.linking.join_to_view': '加入{context}以查看此事务',
48
- 'fabric.linking.learn_more_about_smart_links': '了解有关 Smart Link 的更多信息。',
48
+ 'fabric.linking.learn_more_about_smart_links': '了解有关智能链接的更多信息。',
49
49
  'fabric.linking.link_safety_warning_message': '{unsafeLinkText} 链接会将您带到其他站点,<a>actual link here</a>',
50
50
  'fabric.linking.loading': '正在加载...',
51
51
  'fabric.linking.modified_on_absolute': '更新时间:{context}',
@@ -54,6 +54,7 @@ var _default = {
54
54
  'fabric.linking.not_found_description': '未找到此链接。请检查 URL,然后尝试编辑或重新粘贴。',
55
55
  'fabric.linking.not_found_title': '噢。找不到此链接!',
56
56
  'fabric.linking.open_link_in_a_new_tab': '在新选项卡中打开链接',
57
+ 'fabric.linking.owned_by': '负责人:{context}',
57
58
  'fabric.linking.pending_request': '您的访问请求正等待处理',
58
59
  'fabric.linking.preview': '全屏视图',
59
60
  'fabric.linking.preview_close': '关闭预览',
@@ -45,7 +45,7 @@ var _default = {
45
45
  'fabric.linking.invalid_permissions': '受限制的內容',
46
46
  'fabric.linking.invalid_permissions_description': '您需要請求存取或嘗試不同的帳戶,來檢視此預覽。',
47
47
  'fabric.linking.join_to_view': '加入 {context} 以查看此議題',
48
- 'fabric.linking.learn_more_about_smart_links': '深入了解 Smart Links。',
48
+ 'fabric.linking.learn_more_about_smart_links': '深入了解智慧連結。',
49
49
  'fabric.linking.link_safety_warning_message': '此連結 {unsafeLinkText} 會帶您前往不同的網站,<a>actual link here</a>',
50
50
  'fabric.linking.loading': '正在載入...',
51
51
  'fabric.linking.modified_on_absolute': '更新於 {context}',
@@ -54,6 +54,7 @@ var _default = {
54
54
  'fabric.linking.not_found_description': '我們找不到此連結。請檢查 URL,然後試著編輯或再次貼上。',
55
55
  'fabric.linking.not_found_title': '糟糕,我們找不到此連結!',
56
56
  'fabric.linking.open_link_in_a_new_tab': '在新分頁中開啟連結',
57
+ 'fabric.linking.owned_by': '負責人:{context}',
57
58
  'fabric.linking.pending_request': '您的存取要求擱置中',
58
59
  'fabric.linking.preview': '全螢幕檢視',
59
60
  'fabric.linking.preview_close': '關閉預覽',
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.useSmartCardActions = 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("react");
11
12
  var _outboundAuthFlowClient = require("@atlaskit/outbound-auth-flow-client");
@@ -17,7 +18,6 @@ var _constants = require("../../constants");
17
18
  var _useResolve = _interopRequireDefault(require("../hooks/use-resolve"));
18
19
  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); }
19
20
  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; }
20
- 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; }
21
21
  var useSmartCardActions = function useSmartCardActions(id, url, analytics) {
22
22
  var resolveUrl = (0, _useResolve.default)();
23
23
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
@@ -37,23 +37,21 @@ var useSmartCardActions = function useSmartCardActions(id, url, analytics) {
37
37
  url: url
38
38
  }, undefined, undefined, metadataStatus));
39
39
  }, [dispatch, url]);
40
- var resolve = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
40
+ var resolve = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
41
41
  var resourceUrl,
42
42
  isReloading,
43
43
  isMetadataRequest,
44
44
  _args = arguments;
45
- return _regeneratorRuntime().wrap(function _callee$(_context) {
46
- while (1) {
47
- switch (_context.prev = _context.next) {
48
- case 0:
49
- resourceUrl = _args.length > 0 && _args[0] !== undefined ? _args[0] : url;
50
- isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
51
- isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
52
- return _context.abrupt("return", resolveUrl(resourceUrl, isReloading, isMetadataRequest, id));
53
- case 4:
54
- case "end":
55
- return _context.stop();
56
- }
45
+ return _regenerator.default.wrap(function _callee$(_context) {
46
+ while (1) switch (_context.prev = _context.next) {
47
+ case 0:
48
+ resourceUrl = _args.length > 0 && _args[0] !== undefined ? _args[0] : url;
49
+ isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
50
+ isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
51
+ return _context.abrupt("return", resolveUrl(resourceUrl, isReloading, isMetadataRequest, id));
52
+ case 4:
53
+ case "end":
54
+ return _context.stop();
57
55
  }
58
56
  }, _callee);
59
57
  })), [id, resolveUrl, url]);
@@ -137,66 +135,64 @@ var useSmartCardActions = function useSmartCardActions(id, url, analytics) {
137
135
  }
138
136
  }, [analytics.ui, analytics.screen, analytics.track, analytics.operational, id, reload, details, status]);
139
137
  var invoke = (0, _react.useCallback)( /*#__PURE__*/function () {
140
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(opts, appearance) {
138
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(opts, appearance) {
141
139
  var key, action, source, markName, response;
142
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
143
- while (1) {
144
- switch (_context2.prev = _context2.next) {
145
- case 0:
146
- key = opts.key, action = opts.action;
147
- source = opts.source || appearance;
148
- markName = "".concat(id, "-").concat(action.type); // Begin performance instrumentation.
149
- measure.mark(markName, 'pending');
150
- _context2.prev = 4;
151
- // Begin analytics instrumentation.
152
- analytics.ui.actionClickedEvent({
153
- id: id,
154
- extensionKey: key,
155
- actionType: action.type,
156
- display: source,
157
- invokeType: opts.type
158
- });
159
- // Invoke action - either client-side or server-side.
160
- if (!(opts.type === 'client')) {
161
- _context2.next = 12;
162
- break;
163
- }
164
- _context2.next = 9;
165
- return opts.action.promise();
166
- case 9:
167
- response = _context2.sent;
168
- _context2.next = 15;
140
+ return _regenerator.default.wrap(function _callee2$(_context2) {
141
+ while (1) switch (_context2.prev = _context2.next) {
142
+ case 0:
143
+ key = opts.key, action = opts.action;
144
+ source = opts.source || appearance;
145
+ markName = "".concat(id, "-").concat(action.type); // Begin performance instrumentation.
146
+ measure.mark(markName, 'pending');
147
+ _context2.prev = 4;
148
+ // Begin analytics instrumentation.
149
+ analytics.ui.actionClickedEvent({
150
+ id: id,
151
+ extensionKey: key,
152
+ actionType: action.type,
153
+ display: source,
154
+ invokeType: opts.type
155
+ });
156
+ // Invoke action - either client-side or server-side.
157
+ if (!(opts.type === 'client')) {
158
+ _context2.next = 12;
169
159
  break;
170
- case 12:
171
- _context2.next = 14;
172
- return connections.client.postData(opts);
173
- case 14:
174
- response = _context2.sent;
175
- case 15:
176
- measure.mark(markName, 'resolved');
177
- analytics.operational.invokeSucceededEvent({
178
- id: id,
179
- extensionKey: key,
180
- actionType: action.type,
181
- display: source
182
- });
183
- return _context2.abrupt("return", response);
184
- case 20:
185
- _context2.prev = 20;
186
- _context2.t0 = _context2["catch"](4);
187
- measure.mark(markName, 'errored');
188
- analytics.operational.invokeFailedEvent({
189
- id: id,
190
- extensionKey: key,
191
- actionType: action.type,
192
- display: source,
193
- reason: _context2.t0.message
194
- });
195
- throw _context2.t0;
196
- case 25:
197
- case "end":
198
- return _context2.stop();
199
- }
160
+ }
161
+ _context2.next = 9;
162
+ return opts.action.promise();
163
+ case 9:
164
+ response = _context2.sent;
165
+ _context2.next = 15;
166
+ break;
167
+ case 12:
168
+ _context2.next = 14;
169
+ return connections.client.postData(opts);
170
+ case 14:
171
+ response = _context2.sent;
172
+ case 15:
173
+ measure.mark(markName, 'resolved');
174
+ analytics.operational.invokeSucceededEvent({
175
+ id: id,
176
+ extensionKey: key,
177
+ actionType: action.type,
178
+ display: source
179
+ });
180
+ return _context2.abrupt("return", response);
181
+ case 20:
182
+ _context2.prev = 20;
183
+ _context2.t0 = _context2["catch"](4);
184
+ measure.mark(markName, 'errored');
185
+ analytics.operational.invokeFailedEvent({
186
+ id: id,
187
+ extensionKey: key,
188
+ actionType: action.type,
189
+ display: source,
190
+ reason: _context2.t0.message
191
+ });
192
+ throw _context2.t0;
193
+ case 25:
194
+ case "end":
195
+ return _context2.stop();
200
196
  }
201
197
  }, _callee2, null, [[4, 20]]);
202
198
  }));
@@ -1,36 +1,33 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _react = require("react");
11
11
  var _linkClientExtension = require("@atlaskit/link-client-extension");
12
12
  var _linkProvider = require("@atlaskit/link-provider");
13
- 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; }
14
13
  var useInvoke = function useInvoke() {
15
14
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
16
15
  connections = _useSmartLinkContext.connections;
17
16
  var clientExt = (0, _linkClientExtension.useSmartLinkClientExtension)(connections.client);
18
17
  return (0, _react.useCallback)( /*#__PURE__*/function () {
19
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, cb) {
18
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(req, cb) {
20
19
  var response;
21
- return _regeneratorRuntime().wrap(function _callee$(_context) {
22
- while (1) {
23
- switch (_context.prev = _context.next) {
24
- case 0:
25
- _context.next = 2;
26
- return clientExt.invoke(req);
27
- case 2:
28
- response = _context.sent;
29
- return _context.abrupt("return", cb ? cb(response) : response);
30
- case 4:
31
- case "end":
32
- return _context.stop();
33
- }
20
+ return _regenerator.default.wrap(function _callee$(_context) {
21
+ while (1) switch (_context.prev = _context.next) {
22
+ case 0:
23
+ _context.next = 2;
24
+ return clientExt.invoke(req);
25
+ case 2:
26
+ response = _context.sent;
27
+ return _context.abrupt("return", cb ? cb(response) : response);
28
+ case 4:
29
+ case "end":
30
+ return _context.stop();
34
31
  }
35
32
  }, _callee);
36
33
  }));
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _react = require("react");
11
11
  var _analytics = require("../../analytics");
@@ -15,7 +15,6 @@ var _constants = require("../../actions/constants");
15
15
  var _jsonld = require("../../../utils/jsonld");
16
16
  var _constants2 = require("../../../constants");
17
17
  var _linkProvider = require("@atlaskit/link-provider");
18
- 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; }
19
18
  var useResolve = function useResolve() {
20
19
  // Request JSON-LD data for the card from ORS, if it has extended
21
20
  // its cache lifespan OR there is no data for it currently. Once the data
@@ -120,7 +119,7 @@ var useResolve = function useResolve() {
120
119
  }
121
120
  }, [dispatch, handleResolvedLinkError, hasAuthFlowSupported, setMetadataStatus]);
122
121
  return (0, _react.useCallback)( /*#__PURE__*/function () {
123
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url) {
122
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url) {
124
123
  var isReloading,
125
124
  isMetadataRequest,
126
125
  id,
@@ -128,35 +127,33 @@ var useResolve = function useResolve() {
128
127
  details,
129
128
  hasData,
130
129
  _args = arguments;
131
- return _regeneratorRuntime().wrap(function _callee$(_context) {
132
- while (1) {
133
- switch (_context.prev = _context.next) {
134
- case 0:
135
- isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
136
- isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
137
- id = _args.length > 3 && _args[3] !== undefined ? _args[3] : '';
138
- _ref3 = getState()[url] || {
139
- status: _constants2.SmartLinkStatus.Pending,
140
- details: undefined
141
- }, details = _ref3.details;
142
- hasData = !!(details && details.data);
143
- if (!(isReloading || !hasData || isMetadataRequest)) {
144
- _context.next = 9;
145
- break;
146
- }
147
- return _context.abrupt("return", connections.client.fetchData(url, isReloading).then(function (response) {
148
- return handleResolvedLinkResponse(url, response, isReloading, isMetadataRequest);
149
- }).catch(function (error) {
150
- return handleResolvedLinkError(url, error, undefined, isMetadataRequest);
151
- }));
152
- case 9:
153
- (0, _analytics.addMetadataToExperience)('smart-link-rendered', id, {
154
- cached: true
155
- });
156
- case 10:
157
- case "end":
158
- return _context.stop();
159
- }
130
+ return _regenerator.default.wrap(function _callee$(_context) {
131
+ while (1) switch (_context.prev = _context.next) {
132
+ case 0:
133
+ isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
134
+ isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
135
+ id = _args.length > 3 && _args[3] !== undefined ? _args[3] : '';
136
+ _ref3 = getState()[url] || {
137
+ status: _constants2.SmartLinkStatus.Pending,
138
+ details: undefined
139
+ }, details = _ref3.details;
140
+ hasData = !!(details && details.data);
141
+ if (!(isReloading || !hasData || isMetadataRequest)) {
142
+ _context.next = 9;
143
+ break;
144
+ }
145
+ return _context.abrupt("return", connections.client.fetchData(url, isReloading).then(function (response) {
146
+ return handleResolvedLinkResponse(url, response, isReloading, isMetadataRequest);
147
+ }).catch(function (error) {
148
+ return handleResolvedLinkError(url, error, undefined, isMetadataRequest);
149
+ }));
150
+ case 9:
151
+ (0, _analytics.addMetadataToExperience)('smart-link-rendered', id, {
152
+ cached: true
153
+ });
154
+ case 10:
155
+ case "end":
156
+ return _context.stop();
160
157
  }
161
158
  }, _callee);
162
159
  }));