@atlaskit/smart-card 44.16.5 → 44.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  3. package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  4. package/dist/cjs/extractors/action/extract-invoke-copy-link-action.js +1 -1
  5. package/dist/cjs/extractors/action/extract-invoke-download-action.js +1 -1
  6. package/dist/cjs/extractors/action/extract-invoke-preview-action.js +7 -7
  7. package/dist/cjs/extractors/action/extract-invoke-view-action.js +1 -1
  8. package/dist/cjs/i18n/cs.js +3 -180
  9. package/dist/cjs/i18n/da.js +3 -180
  10. package/dist/cjs/i18n/de.js +3 -180
  11. package/dist/cjs/i18n/en.js +3 -182
  12. package/dist/cjs/i18n/en_GB.js +3 -182
  13. package/dist/cjs/i18n/en_ZZ.js +3 -182
  14. package/dist/cjs/i18n/es.js +3 -180
  15. package/dist/cjs/i18n/fi.js +3 -180
  16. package/dist/cjs/i18n/fr.js +3 -180
  17. package/dist/cjs/i18n/hr.js +3 -175
  18. package/dist/cjs/i18n/hu.js +3 -180
  19. package/dist/cjs/i18n/it.js +3 -180
  20. package/dist/cjs/i18n/ja.js +3 -180
  21. package/dist/cjs/i18n/ko.js +3 -180
  22. package/dist/cjs/i18n/nb.js +3 -180
  23. package/dist/cjs/i18n/nl.js +3 -180
  24. package/dist/cjs/i18n/pl.js +3 -180
  25. package/dist/cjs/i18n/pt_BR.js +3 -180
  26. package/dist/cjs/i18n/ru.js +3 -180
  27. package/dist/cjs/i18n/sl.js +3 -175
  28. package/dist/cjs/i18n/sr_RS.js +3 -175
  29. package/dist/cjs/i18n/sr_YR.js +3 -175
  30. package/dist/cjs/i18n/sv.js +3 -180
  31. package/dist/cjs/i18n/th.js +3 -180
  32. package/dist/cjs/i18n/tr.js +3 -180
  33. package/dist/cjs/i18n/uk.js +3 -180
  34. package/dist/cjs/i18n/vi.js +3 -180
  35. package/dist/cjs/i18n/zh.js +3 -180
  36. package/dist/cjs/i18n/zh_TW.js +3 -180
  37. package/dist/cjs/state/actions/index.js +7 -7
  38. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +46 -46
  39. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/readStream.js +44 -44
  40. package/dist/cjs/state/hooks/use-incoming-outgoing-links/index.js +34 -34
  41. package/dist/cjs/state/hooks/use-invoke/index.js +4 -4
  42. package/dist/cjs/state/hooks/use-invoke-client-action/index.js +12 -12
  43. package/dist/cjs/state/hooks/use-resolve/index.js +4 -4
  44. package/dist/cjs/state/hooks/usePrefetch.js +14 -14
  45. package/dist/cjs/state/services/current-site-cloud-id/index.js +16 -16
  46. package/dist/cjs/state/services/personalization/index.js +23 -23
  47. package/dist/cjs/utils/analytics/analytics.js +1 -1
  48. package/dist/cjs/utils/index.js +26 -25
  49. package/dist/cjs/utils/mocks.js +16 -16
  50. package/dist/cjs/view/EmbedModal/utils.js +4 -4
  51. package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +17 -17
  52. package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +8 -8
  53. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +2 -2
  54. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +10 -10
  55. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +31 -31
  56. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +10 -10
  57. package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +4 -4
  58. package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +1 -1
  59. package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +34 -34
  60. package/dist/cjs/view/InlineCard/common/action-button/index.compiled.css +1 -1
  61. package/dist/cjs/view/InlineCard/common/action-button/index.js +1 -1
  62. package/dist/cjs/view/LinkUrl/index.js +1 -1
  63. package/dist/cjs/view/RelatedLinksModal/index.js +41 -41
  64. package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  65. package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  66. package/dist/es2019/i18n/cs.js +3 -180
  67. package/dist/es2019/i18n/da.js +3 -180
  68. package/dist/es2019/i18n/de.js +3 -180
  69. package/dist/es2019/i18n/en.js +3 -182
  70. package/dist/es2019/i18n/en_GB.js +3 -182
  71. package/dist/es2019/i18n/en_ZZ.js +3 -182
  72. package/dist/es2019/i18n/es.js +3 -180
  73. package/dist/es2019/i18n/fi.js +3 -180
  74. package/dist/es2019/i18n/fr.js +3 -180
  75. package/dist/es2019/i18n/hr.js +3 -175
  76. package/dist/es2019/i18n/hu.js +3 -180
  77. package/dist/es2019/i18n/it.js +3 -180
  78. package/dist/es2019/i18n/ja.js +3 -180
  79. package/dist/es2019/i18n/ko.js +3 -180
  80. package/dist/es2019/i18n/nb.js +3 -180
  81. package/dist/es2019/i18n/nl.js +3 -180
  82. package/dist/es2019/i18n/pl.js +3 -180
  83. package/dist/es2019/i18n/pt_BR.js +3 -180
  84. package/dist/es2019/i18n/ru.js +3 -180
  85. package/dist/es2019/i18n/sl.js +3 -175
  86. package/dist/es2019/i18n/sr_RS.js +3 -175
  87. package/dist/es2019/i18n/sr_YR.js +3 -175
  88. package/dist/es2019/i18n/sv.js +3 -180
  89. package/dist/es2019/i18n/th.js +3 -180
  90. package/dist/es2019/i18n/tr.js +3 -180
  91. package/dist/es2019/i18n/uk.js +3 -180
  92. package/dist/es2019/i18n/vi.js +3 -180
  93. package/dist/es2019/i18n/zh.js +3 -180
  94. package/dist/es2019/i18n/zh_TW.js +3 -180
  95. package/dist/es2019/utils/analytics/analytics.js +1 -1
  96. package/dist/es2019/view/InlineCard/common/action-button/index.compiled.css +1 -1
  97. package/dist/es2019/view/InlineCard/common/action-button/index.js +1 -1
  98. package/dist/es2019/view/LinkUrl/index.js +1 -1
  99. package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
  100. package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
  101. package/dist/esm/extractors/action/extract-invoke-copy-link-action.js +1 -1
  102. package/dist/esm/extractors/action/extract-invoke-download-action.js +1 -1
  103. package/dist/esm/extractors/action/extract-invoke-preview-action.js +7 -7
  104. package/dist/esm/extractors/action/extract-invoke-view-action.js +1 -1
  105. package/dist/esm/i18n/cs.js +3 -180
  106. package/dist/esm/i18n/da.js +3 -180
  107. package/dist/esm/i18n/de.js +3 -180
  108. package/dist/esm/i18n/en.js +3 -182
  109. package/dist/esm/i18n/en_GB.js +3 -182
  110. package/dist/esm/i18n/en_ZZ.js +3 -182
  111. package/dist/esm/i18n/es.js +3 -180
  112. package/dist/esm/i18n/fi.js +3 -180
  113. package/dist/esm/i18n/fr.js +3 -180
  114. package/dist/esm/i18n/hr.js +3 -175
  115. package/dist/esm/i18n/hu.js +3 -180
  116. package/dist/esm/i18n/it.js +3 -180
  117. package/dist/esm/i18n/ja.js +3 -180
  118. package/dist/esm/i18n/ko.js +3 -180
  119. package/dist/esm/i18n/nb.js +3 -180
  120. package/dist/esm/i18n/nl.js +3 -180
  121. package/dist/esm/i18n/pl.js +3 -180
  122. package/dist/esm/i18n/pt_BR.js +3 -180
  123. package/dist/esm/i18n/ru.js +3 -180
  124. package/dist/esm/i18n/sl.js +3 -175
  125. package/dist/esm/i18n/sr_RS.js +3 -175
  126. package/dist/esm/i18n/sr_YR.js +3 -175
  127. package/dist/esm/i18n/sv.js +3 -180
  128. package/dist/esm/i18n/th.js +3 -180
  129. package/dist/esm/i18n/tr.js +3 -180
  130. package/dist/esm/i18n/uk.js +3 -180
  131. package/dist/esm/i18n/vi.js +3 -180
  132. package/dist/esm/i18n/zh.js +3 -180
  133. package/dist/esm/i18n/zh_TW.js +3 -180
  134. package/dist/esm/state/actions/index.js +7 -7
  135. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +46 -46
  136. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/readStream.js +44 -44
  137. package/dist/esm/state/hooks/use-incoming-outgoing-links/index.js +34 -34
  138. package/dist/esm/state/hooks/use-invoke/index.js +4 -4
  139. package/dist/esm/state/hooks/use-invoke-client-action/index.js +11 -11
  140. package/dist/esm/state/hooks/use-resolve/index.js +4 -4
  141. package/dist/esm/state/hooks/usePrefetch.js +14 -14
  142. package/dist/esm/state/services/current-site-cloud-id/index.js +16 -16
  143. package/dist/esm/state/services/personalization/index.js +23 -23
  144. package/dist/esm/utils/analytics/analytics.js +1 -1
  145. package/dist/esm/utils/index.js +25 -24
  146. package/dist/esm/utils/mocks.js +16 -16
  147. package/dist/esm/view/EmbedModal/utils.js +4 -4
  148. package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +16 -16
  149. package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +8 -8
  150. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +2 -2
  151. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/utils/api.js +10 -10
  152. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/main.js +30 -30
  153. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/services/index.js +10 -10
  154. package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +4 -4
  155. package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +1 -1
  156. package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +33 -33
  157. package/dist/esm/view/InlineCard/common/action-button/index.compiled.css +1 -1
  158. package/dist/esm/view/InlineCard/common/action-button/index.js +1 -1
  159. package/dist/esm/view/LinkUrl/index.js +1 -1
  160. package/dist/esm/view/RelatedLinksModal/index.js +40 -40
  161. package/dist/types/i18n/cs.d.ts +2 -180
  162. package/dist/types/i18n/da.d.ts +2 -180
  163. package/dist/types/i18n/de.d.ts +2 -180
  164. package/dist/types/i18n/en.d.ts +2 -182
  165. package/dist/types/i18n/en_GB.d.ts +2 -182
  166. package/dist/types/i18n/en_ZZ.d.ts +2 -182
  167. package/dist/types/i18n/es.d.ts +2 -180
  168. package/dist/types/i18n/fi.d.ts +2 -180
  169. package/dist/types/i18n/fr.d.ts +2 -180
  170. package/dist/types/i18n/hr.d.ts +2 -175
  171. package/dist/types/i18n/hu.d.ts +2 -180
  172. package/dist/types/i18n/it.d.ts +2 -180
  173. package/dist/types/i18n/ja.d.ts +2 -180
  174. package/dist/types/i18n/ko.d.ts +2 -180
  175. package/dist/types/i18n/nb.d.ts +2 -180
  176. package/dist/types/i18n/nl.d.ts +2 -180
  177. package/dist/types/i18n/pl.d.ts +2 -180
  178. package/dist/types/i18n/pt_BR.d.ts +2 -180
  179. package/dist/types/i18n/ru.d.ts +2 -180
  180. package/dist/types/i18n/sl.d.ts +2 -175
  181. package/dist/types/i18n/sr_RS.d.ts +2 -175
  182. package/dist/types/i18n/sr_YR.d.ts +2 -175
  183. package/dist/types/i18n/sv.d.ts +2 -180
  184. package/dist/types/i18n/th.d.ts +2 -180
  185. package/dist/types/i18n/tr.d.ts +2 -180
  186. package/dist/types/i18n/uk.d.ts +2 -180
  187. package/dist/types/i18n/vi.d.ts +2 -180
  188. package/dist/types/i18n/zh.d.ts +2 -180
  189. package/dist/types/i18n/zh_TW.d.ts +2 -180
  190. package/dist/types-ts4.5/i18n/cs.d.ts +2 -180
  191. package/dist/types-ts4.5/i18n/da.d.ts +2 -180
  192. package/dist/types-ts4.5/i18n/de.d.ts +2 -180
  193. package/dist/types-ts4.5/i18n/en.d.ts +2 -182
  194. package/dist/types-ts4.5/i18n/en_GB.d.ts +2 -182
  195. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +2 -182
  196. package/dist/types-ts4.5/i18n/es.d.ts +2 -180
  197. package/dist/types-ts4.5/i18n/fi.d.ts +2 -180
  198. package/dist/types-ts4.5/i18n/fr.d.ts +2 -180
  199. package/dist/types-ts4.5/i18n/hr.d.ts +2 -175
  200. package/dist/types-ts4.5/i18n/hu.d.ts +2 -180
  201. package/dist/types-ts4.5/i18n/it.d.ts +2 -180
  202. package/dist/types-ts4.5/i18n/ja.d.ts +2 -180
  203. package/dist/types-ts4.5/i18n/ko.d.ts +2 -180
  204. package/dist/types-ts4.5/i18n/nb.d.ts +2 -180
  205. package/dist/types-ts4.5/i18n/nl.d.ts +2 -180
  206. package/dist/types-ts4.5/i18n/pl.d.ts +2 -180
  207. package/dist/types-ts4.5/i18n/pt_BR.d.ts +2 -180
  208. package/dist/types-ts4.5/i18n/ru.d.ts +2 -180
  209. package/dist/types-ts4.5/i18n/sl.d.ts +2 -175
  210. package/dist/types-ts4.5/i18n/sr_RS.d.ts +2 -175
  211. package/dist/types-ts4.5/i18n/sr_YR.d.ts +2 -175
  212. package/dist/types-ts4.5/i18n/sv.d.ts +2 -180
  213. package/dist/types-ts4.5/i18n/th.d.ts +2 -180
  214. package/dist/types-ts4.5/i18n/tr.d.ts +2 -180
  215. package/dist/types-ts4.5/i18n/uk.d.ts +2 -180
  216. package/dist/types-ts4.5/i18n/vi.d.ts +2 -180
  217. package/dist/types-ts4.5/i18n/zh.d.ts +2 -180
  218. package/dist/types-ts4.5/i18n/zh_TW.d.ts +2 -180
  219. package/package.json +8 -8
@@ -57,14 +57,14 @@ var useSmartCardActions = exports.useSmartCardActions = function useSmartCardAct
57
57
  isReloading,
58
58
  isMetadataRequest,
59
59
  _args = arguments;
60
- return _regenerator.default.wrap(function _callee$(_context) {
60
+ return _regenerator.default.wrap(function (_context) {
61
61
  while (1) switch (_context.prev = _context.next) {
62
62
  case 0:
63
63
  resourceUrl = _args.length > 0 && _args[0] !== undefined ? _args[0] : url;
64
64
  isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
65
65
  isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
66
66
  return _context.abrupt("return", resolveUrl(resourceUrl, isReloading, isMetadataRequest, id));
67
- case 4:
67
+ case 1:
68
68
  case "end":
69
69
  return _context.stop();
70
70
  }
@@ -168,25 +168,25 @@ var useSmartCardActions = exports.useSmartCardActions = function useSmartCardAct
168
168
  var invoke = (0, _react.useCallback)( /*#__PURE__*/function () {
169
169
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(opts, appearance) {
170
170
  var key, action, source;
171
- return _regenerator.default.wrap(function _callee2$(_context2) {
171
+ return _regenerator.default.wrap(function (_context2) {
172
172
  while (1) switch (_context2.prev = _context2.next) {
173
173
  case 0:
174
174
  key = opts.key, action = opts.action;
175
175
  source = opts.source || appearance;
176
176
  if (!(opts.type === 'client')) {
177
- _context2.next = 6;
177
+ _context2.next = 2;
178
178
  break;
179
179
  }
180
- _context2.next = 5;
180
+ _context2.next = 1;
181
181
  return invokeClientAction({
182
182
  actionFn: opts.action.promise,
183
183
  actionType: action.type,
184
184
  display: source,
185
185
  extensionKey: key
186
186
  });
187
- case 5:
187
+ case 1:
188
188
  return _context2.abrupt("return", _context2.sent);
189
- case 6:
189
+ case 2:
190
190
  case "end":
191
191
  return _context2.stop();
192
192
  }
@@ -42,7 +42,7 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
42
42
  });
43
43
  (0, _defineProperty2.default)(this, "fetchStream", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
44
44
  var payload, options, response;
45
- return _regenerator.default.wrap(function _callee$(_context) {
45
+ return _regenerator.default.wrap(function (_context) {
46
46
  while (1) switch (_context.prev = _context.next) {
47
47
  case 0:
48
48
  payload = _objectSpread({
@@ -67,18 +67,18 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
67
67
  body: JSON.stringify(payload),
68
68
  credentials: 'include'
69
69
  };
70
- _context.next = 4;
70
+ _context.next = 1;
71
71
  return fetch(_this.config.requestUrl, options);
72
- case 4:
72
+ case 1:
73
73
  response = _context.sent;
74
74
  if (!(!response.ok || response.status >= 400)) {
75
- _context.next = 9;
75
+ _context.next = 2;
76
76
  break;
77
77
  }
78
78
  throw new Error("Status: ".concat(response.status, "\n URL: ").concat(_this.url, "\n StatusText ").concat(response.statusText));
79
- case 9:
79
+ case 2:
80
80
  return _context.abrupt("return", (0, _readStream.readStream)(response));
81
- case 10:
81
+ case 3:
82
82
  case "end":
83
83
  return _context.stop();
84
84
  }
@@ -103,8 +103,8 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
103
103
  key: "summariseUrl",
104
104
  value: function () {
105
105
  var _summariseUrl = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
106
- var _iterator2, _step2, _subscriber, id, _this$onStart, _this$onSuccess, stream, bufferContent, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, _iterator3, _step3, subscriber, _chunk$message, _this$onError, message, _iterator4, _step4, _subscriber2;
107
- return _regenerator.default.wrap(function _callee2$(_context2) {
106
+ var _iterator2, _step2, _subscriber, id, _this$onStart, _this$onSuccess, stream, bufferContent, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, _iterator3, _step3, subscriber, _chunk$message, _this$onError, message, _iterator4, _step4, _subscriber2, _t, _t2;
107
+ return _regenerator.default.wrap(function (_context2) {
108
108
  while (1) switch (_context2.prev = _context2.next) {
109
109
  case 0:
110
110
  this.state = {
@@ -125,23 +125,23 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
125
125
  _iterator2.f();
126
126
  }
127
127
  id = (0, _uuid.default)();
128
- _context2.prev = 4;
128
+ _context2.prev = 1;
129
129
  (_this$onStart = this.onStart) === null || _this$onStart === void 0 || _this$onStart.call(this, id);
130
- _context2.next = 8;
130
+ _context2.next = 2;
131
131
  return this.fetchStream();
132
- case 8:
132
+ case 2:
133
133
  stream = _context2.sent;
134
134
  bufferContent = '';
135
135
  _iteratorAbruptCompletion = false;
136
136
  _didIteratorError = false;
137
- _context2.prev = 12;
137
+ _context2.prev = 3;
138
138
  _iterator = _asyncIterator(stream);
139
- case 14:
140
- _context2.next = 16;
139
+ case 4:
140
+ _context2.next = 5;
141
141
  return _iterator.next();
142
- case 16:
142
+ case 5:
143
143
  if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
144
- _context2.next = 25;
144
+ _context2.next = 7;
145
145
  break;
146
146
  }
147
147
  chunk = _step.value;
@@ -167,61 +167,61 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
167
167
  bufferContent = chunk.message.content;
168
168
  }
169
169
  if (!(chunk.type === 'ERROR')) {
170
- _context2.next = 22;
170
+ _context2.next = 6;
171
171
  break;
172
172
  }
173
173
  throw new _types.ChunkProcessingError(chunk === null || chunk === void 0 || (_chunk$message = chunk.message) === null || _chunk$message === void 0 ? void 0 : _chunk$message.message_template);
174
- case 22:
174
+ case 6:
175
175
  _iteratorAbruptCompletion = false;
176
- _context2.next = 14;
176
+ _context2.next = 4;
177
177
  break;
178
- case 25:
179
- _context2.next = 31;
178
+ case 7:
179
+ _context2.next = 9;
180
180
  break;
181
- case 27:
182
- _context2.prev = 27;
183
- _context2.t0 = _context2["catch"](12);
181
+ case 8:
182
+ _context2.prev = 8;
183
+ _t = _context2["catch"](3);
184
184
  _didIteratorError = true;
185
- _iteratorError = _context2.t0;
186
- case 31:
187
- _context2.prev = 31;
188
- _context2.prev = 32;
185
+ _iteratorError = _t;
186
+ case 9:
187
+ _context2.prev = 9;
188
+ _context2.prev = 10;
189
189
  if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
190
- _context2.next = 36;
190
+ _context2.next = 11;
191
191
  break;
192
192
  }
193
- _context2.next = 36;
193
+ _context2.next = 11;
194
194
  return _iterator.return();
195
- case 36:
196
- _context2.prev = 36;
195
+ case 11:
196
+ _context2.prev = 11;
197
197
  if (!_didIteratorError) {
198
- _context2.next = 39;
198
+ _context2.next = 12;
199
199
  break;
200
200
  }
201
201
  throw _iteratorError;
202
- case 39:
203
- return _context2.finish(36);
204
- case 40:
205
- return _context2.finish(31);
206
- case 41:
202
+ case 12:
203
+ return _context2.finish(11);
204
+ case 13:
205
+ return _context2.finish(9);
206
+ case 14:
207
207
  (_this$onSuccess = this.onSuccess) === null || _this$onSuccess === void 0 || _this$onSuccess.call(this, id);
208
208
  this.state = {
209
209
  status: 'done',
210
210
  content: bufferContent
211
211
  };
212
- _context2.next = 50;
212
+ _context2.next = 16;
213
213
  break;
214
- case 45:
215
- _context2.prev = 45;
216
- _context2.t1 = _context2["catch"](4);
217
- message = _context2.t1 instanceof _types.ChunkProcessingError ? _context2.t1.message : 'UNEXPECTED';
214
+ case 15:
215
+ _context2.prev = 15;
216
+ _t2 = _context2["catch"](1);
217
+ message = _t2 instanceof _types.ChunkProcessingError ? _t2.message : 'UNEXPECTED';
218
218
  (_this$onError = this.onError) === null || _this$onError === void 0 || _this$onError.call(this, id, message);
219
219
  this.state = {
220
220
  status: 'error',
221
221
  content: '',
222
222
  error: message
223
223
  };
224
- case 50:
224
+ case 16:
225
225
  _iterator4 = _createForOfIteratorHelper(this.subscribedStateSetters);
226
226
  try {
227
227
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -234,11 +234,11 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
234
234
  _iterator4.f();
235
235
  }
236
236
  return _context2.abrupt("return", this.state);
237
- case 53:
237
+ case 17:
238
238
  case "end":
239
239
  return _context2.stop();
240
240
  }
241
- }, _callee2, this, [[4, 45], [12, 27, 31, 41], [32,, 36, 40]]);
241
+ }, _callee2, this, [[1, 15], [3, 8, 9, 14], [10,, 11, 13]]);
242
242
  }));
243
243
  function summariseUrl() {
244
244
  return _summariseUrl.apply(this, arguments);
@@ -17,99 +17,99 @@ function readStream(_x) {
17
17
  }
18
18
  function _readStream() {
19
19
  _readStream = (0, _wrapAsyncGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response) {
20
- var reader, doneStreaming, chunkBuffer, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
21
- return _regenerator.default.wrap(function _callee$(_context) {
20
+ var reader, doneStreaming, chunkBuffer, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error, _t, _t2, _t3;
21
+ return _regenerator.default.wrap(function (_context) {
22
22
  while (1) switch (_context.prev = _context.next) {
23
23
  case 0:
24
24
  reader = (0, _utils.getBufferReader)(response);
25
25
  doneStreaming = false;
26
26
  chunkBuffer = '';
27
- case 3:
28
- _context.prev = 3;
29
- _context.next = 6;
27
+ case 1:
28
+ _context.prev = 1;
29
+ _context.next = 2;
30
30
  return (0, _awaitAsyncGenerator2.default)(reader.read());
31
- case 6:
31
+ case 2:
32
32
  _yield$_awaitAsyncGen = _context.sent;
33
33
  value = _yield$_awaitAsyncGen.value;
34
34
  done = _yield$_awaitAsyncGen.done;
35
35
  doneStreaming = done;
36
36
  if (!value) {
37
- _context.next = 38;
37
+ _context.next = 12;
38
38
  break;
39
39
  }
40
40
  processedChunks = "".concat(chunkBuffer).concat(value).split('\n'); // assumes that all JSON chunks are separated by a new-line;
41
41
  chunkBuffer = '';
42
42
  _iterator = _createForOfIteratorHelper(processedChunks);
43
- _context.prev = 14;
43
+ _context.prev = 3;
44
44
  _iterator.s();
45
- case 16:
45
+ case 4:
46
46
  if ((_step = _iterator.n()).done) {
47
- _context.next = 30;
47
+ _context.next = 9;
48
48
  break;
49
49
  }
50
50
  chunk = _step.value;
51
- _context.prev = 18;
51
+ _context.prev = 5;
52
52
  jsonChunk = JSON.parse(chunk);
53
53
  if (jsonChunk.type === 'ERROR') {
54
54
  reader.cancel();
55
55
  }
56
- _context.next = 23;
56
+ _context.next = 6;
57
57
  return jsonChunk;
58
- case 23:
59
- _context.next = 28;
58
+ case 6:
59
+ _context.next = 8;
60
60
  break;
61
- case 25:
62
- _context.prev = 25;
63
- _context.t0 = _context["catch"](18);
61
+ case 7:
62
+ _context.prev = 7;
63
+ _t = _context["catch"](5);
64
64
  // the chunk may be incomplete, so we'll save it for the next iteration.
65
65
  chunkBuffer = chunk;
66
- case 28:
67
- _context.next = 16;
66
+ case 8:
67
+ _context.next = 4;
68
68
  break;
69
- case 30:
70
- _context.next = 35;
69
+ case 9:
70
+ _context.next = 11;
71
71
  break;
72
- case 32:
73
- _context.prev = 32;
74
- _context.t1 = _context["catch"](14);
75
- _iterator.e(_context.t1);
76
- case 35:
77
- _context.prev = 35;
72
+ case 10:
73
+ _context.prev = 10;
74
+ _t2 = _context["catch"](3);
75
+ _iterator.e(_t2);
76
+ case 11:
77
+ _context.prev = 11;
78
78
  _iterator.f();
79
- return _context.finish(35);
80
- case 38:
81
- _context.next = 48;
79
+ return _context.finish(11);
80
+ case 12:
81
+ _context.next = 15;
82
82
  break;
83
- case 40:
84
- _context.prev = 40;
85
- _context.t2 = _context["catch"](3);
86
- if (!(_context.t2 instanceof DOMException && _context.t2.name === 'AbortError')) {
87
- _context.next = 46;
83
+ case 13:
84
+ _context.prev = 13;
85
+ _t3 = _context["catch"](1);
86
+ if (!(_t3 instanceof DOMException && _t3.name === 'AbortError')) {
87
+ _context.next = 14;
88
88
  break;
89
89
  }
90
90
  doneStreaming = true;
91
- _context.next = 48;
91
+ _context.next = 15;
92
92
  break;
93
- case 46:
93
+ case 14:
94
94
  reader.cancel();
95
- throw _context.t2;
96
- case 48:
95
+ throw _t3;
96
+ case 15:
97
97
  if (!doneStreaming) {
98
- _context.next = 3;
98
+ _context.next = 1;
99
99
  break;
100
100
  }
101
- case 49:
101
+ case 16:
102
102
  if (!chunkBuffer) {
103
- _context.next = 52;
103
+ _context.next = 17;
104
104
  break;
105
105
  }
106
106
  error = new Error("Not all the data was processed: ".concat(chunkBuffer));
107
107
  throw error;
108
- case 52:
108
+ case 17:
109
109
  case "end":
110
110
  return _context.stop();
111
111
  }
112
- }, _callee, null, [[3, 40], [14, 32, 35, 38], [18, 25]]);
112
+ }, _callee, null, [[1, 13], [3, 10, 11, 12], [5, 7]]);
113
113
  }));
114
114
  return _readStream.apply(this, arguments);
115
115
  }
@@ -19,7 +19,7 @@ var useIncomingOutgoingAri = function useIncomingOutgoingAri() {
19
19
  var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
20
20
  var aggRequestCall = (0, _react.useCallback)( /*#__PURE__*/function () {
21
21
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(body, headers) {
22
- return _regenerator.default.wrap(function _callee$(_context) {
22
+ return _regenerator.default.wrap(function (_context) {
23
23
  while (1) switch (_context.prev = _context.next) {
24
24
  case 0:
25
25
  return _context.abrupt("return", (0, _linkingCommon.request)('post', baseUriWithNoTrailingSlash + '/gateway/api/graphql', body, headers, [200]));
@@ -34,30 +34,30 @@ var useIncomingOutgoingAri = function useIncomingOutgoingAri() {
34
34
  };
35
35
  }(), [baseUriWithNoTrailingSlash]);
36
36
  var getCurrentSiteId = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
37
- var response;
38
- return _regenerator.default.wrap(function _callee2$(_context2) {
37
+ var response, _t;
38
+ return _regenerator.default.wrap(function (_context2) {
39
39
  while (1) switch (_context2.prev = _context2.next) {
40
40
  case 0:
41
41
  _context2.prev = 0;
42
- _context2.next = 3;
42
+ _context2.next = 1;
43
43
  return (0, _linkingCommon.request)('get', baseUriWithNoTrailingSlash + '/_edge/tenant_info');
44
- case 3:
44
+ case 1:
45
45
  response = _context2.sent;
46
46
  return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.cloudId);
47
- case 7:
48
- _context2.prev = 7;
49
- _context2.t0 = _context2["catch"](0);
47
+ case 2:
48
+ _context2.prev = 2;
49
+ _t = _context2["catch"](0);
50
50
  return _context2.abrupt("return", undefined);
51
- case 10:
51
+ case 3:
52
52
  case "end":
53
53
  return _context2.stop();
54
54
  }
55
- }, _callee2, null, [[0, 7]]);
55
+ }, _callee2, null, [[0, 2]]);
56
56
  })), [baseUriWithNoTrailingSlash]);
57
57
  var getSiteId = (0, _react.useCallback)( /*#__PURE__*/function () {
58
58
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resourceAri) {
59
- var ariPattern, match;
60
- return _regenerator.default.wrap(function _callee3$(_context3) {
59
+ var ariPattern, match, _t2;
60
+ return _regenerator.default.wrap(function (_context3) {
61
61
  while (1) switch (_context3.prev = _context3.next) {
62
62
  case 0:
63
63
  // ARI pattern that matches both formats:
@@ -74,29 +74,29 @@ var useIncomingOutgoingAri = function useIncomingOutgoingAri() {
74
74
  ariPattern = /^ari:cloud:([a-z][a-z.-]+):([a-zA-Z0-9_.-]+):([a-z][a-zA-Z.-]+)\/(.+)$/;
75
75
  match = resourceAri.match(ariPattern);
76
76
  if (!(match && match[2])) {
77
- _context3.next = 4;
77
+ _context3.next = 1;
78
78
  break;
79
79
  }
80
80
  return _context3.abrupt("return", match[2]);
81
- case 4:
81
+ case 1:
82
82
  if (!(0, _platformFeatureFlags.fg)('platform_sl_incoming_outgoing_tenant_info_killswitch')) {
83
- _context3.next = 10;
83
+ _context3.next = 3;
84
84
  break;
85
85
  }
86
- _context3.next = 7;
86
+ _context3.next = 2;
87
87
  return (0, _currentSiteCloudId.getCurrentSiteCloudId)(baseUriWithNoTrailingSlash);
88
- case 7:
89
- _context3.t0 = _context3.sent;
90
- _context3.next = 13;
88
+ case 2:
89
+ _t2 = _context3.sent;
90
+ _context3.next = 5;
91
91
  break;
92
- case 10:
93
- _context3.next = 12;
92
+ case 3:
93
+ _context3.next = 4;
94
94
  return getCurrentSiteId();
95
- case 12:
96
- _context3.t0 = _context3.sent;
97
- case 13:
98
- return _context3.abrupt("return", _context3.t0);
99
- case 14:
95
+ case 4:
96
+ _t2 = _context3.sent;
97
+ case 5:
98
+ return _context3.abrupt("return", _t2);
99
+ case 6:
100
100
  case "end":
101
101
  return _context3.stop();
102
102
  }
@@ -127,28 +127,28 @@ var useIncomingOutgoingAri = function useIncomingOutgoingAri() {
127
127
  incomingAris,
128
128
  outgoingAris,
129
129
  _args4 = arguments;
130
- return _regenerator.default.wrap(function _callee4$(_context4) {
130
+ return _regenerator.default.wrap(function (_context4) {
131
131
  while (1) switch (_context4.prev = _context4.next) {
132
132
  case 0:
133
133
  firstIncoming = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 50;
134
134
  firstOutgoing = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : 50;
135
- _context4.next = 4;
135
+ _context4.next = 1;
136
136
  return getSiteId(ari);
137
- case 4:
137
+ case 1:
138
138
  siteId = _context4.sent;
139
139
  if (siteId) {
140
- _context4.next = 7;
140
+ _context4.next = 2;
141
141
  break;
142
142
  }
143
143
  return _context4.abrupt("return", {
144
144
  incomingAris: [],
145
145
  outgoingAris: []
146
146
  });
147
- case 7:
147
+ case 2:
148
148
  headers = {
149
149
  'X-Query-Context': "ari:cloud:platform::site/".concat(siteId)
150
150
  };
151
- _context4.next = 10;
151
+ _context4.next = 3;
152
152
  return aggRequestCall({
153
153
  variables: {
154
154
  id: ari,
@@ -157,7 +157,7 @@ var useIncomingOutgoingAri = function useIncomingOutgoingAri() {
157
157
  },
158
158
  query: _query.queryIncomingOutgoingLinks
159
159
  }, headers);
160
- case 10:
160
+ case 3:
161
161
  response = _context4.sent;
162
162
  incomingAris = (_response$data$graphS = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.graphStore) === null || _response$data === void 0 || (_response$data = _response$data.incoming) === null || _response$data === void 0 || (_response$data = _response$data.aris) === null || _response$data === void 0 || (_response$data = _response$data.map(function (node) {
163
163
  return node === null || node === void 0 ? void 0 : node.id;
@@ -173,7 +173,7 @@ var useIncomingOutgoingAri = function useIncomingOutgoingAri() {
173
173
  incomingAris: incomingAris,
174
174
  outgoingAris: outgoingAris
175
175
  });
176
- case 14:
176
+ case 4:
177
177
  case "end":
178
178
  return _context4.stop();
179
179
  }
@@ -17,15 +17,15 @@ var useInvoke = function useInvoke() {
17
17
  return (0, _react.useCallback)( /*#__PURE__*/function () {
18
18
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(req, cb) {
19
19
  var response;
20
- return _regenerator.default.wrap(function _callee$(_context) {
20
+ return _regenerator.default.wrap(function (_context) {
21
21
  while (1) switch (_context.prev = _context.next) {
22
22
  case 0:
23
- _context.next = 2;
23
+ _context.next = 1;
24
24
  return clientExt.invoke(req);
25
- case 2:
25
+ case 1:
26
26
  response = _context.sent;
27
27
  return _context.abrupt("return", cb ? cb(response) : response);
28
- case 4:
28
+ case 2:
29
29
  case "end":
30
30
  return _context.stop();
31
31
  }
@@ -13,7 +13,7 @@ var _uuid = _interopRequireDefault(require("uuid"));
13
13
  var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
14
14
  var measure = _interopRequireWildcard(require("../../../utils/performance"));
15
15
  var _analytics = require("../../analytics");
16
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
16
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
17
17
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
18
18
 
19
19
  var ACTION_EXPERIENCE_NAME = 'smart-link-action-invocation';
@@ -28,8 +28,8 @@ var useInvokeClientAction = function useInvokeClientAction(_ref) {
28
28
  var fireEvent = fireEventProp !== null && fireEventProp !== void 0 ? fireEventProp : defaultFireEvent;
29
29
  return (0, _react.useCallback)( /*#__PURE__*/function () {
30
30
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref2) {
31
- var actionSubjectId, actionType, actionFn, _ref2$definitionId, definitionId, extensionKey, display, id, prompt, _ref2$resourceType, resourceType, experienceId, markName, _measure$getMeasure$d, _measure$getMeasure, result, _measure$getMeasure$d2, _measure$getMeasure2, reason;
32
- return _regenerator.default.wrap(function _callee$(_context) {
31
+ var actionSubjectId, actionType, actionFn, _ref2$definitionId, definitionId, extensionKey, display, id, prompt, _ref2$resourceType, resourceType, experienceId, markName, _measure$getMeasure$d, _measure$getMeasure, result, _measure$getMeasure$d2, _measure$getMeasure2, reason, _t;
32
+ return _regenerator.default.wrap(function (_context) {
33
33
  while (1) switch (_context.prev = _context.next) {
34
34
  case 0:
35
35
  actionSubjectId = _ref2.actionSubjectId, actionType = _ref2.actionType, actionFn = _ref2.actionFn, _ref2$definitionId = _ref2.definitionId, definitionId = _ref2$definitionId === void 0 ? null : _ref2$definitionId, extensionKey = _ref2.extensionKey, display = _ref2.display, id = _ref2.id, prompt = _ref2.prompt, _ref2$resourceType = _ref2.resourceType, resourceType = _ref2$resourceType === void 0 ? null : _ref2$resourceType;
@@ -37,7 +37,7 @@ var useInvokeClientAction = function useInvokeClientAction(_ref) {
37
37
  experienceId = (0, _uuid.default)(); // Begin performance instrumentation.
38
38
  markName = "".concat(experienceId, "-").concat(actionType);
39
39
  measure.mark(markName, 'pending');
40
- _context.prev = 4;
40
+ _context.prev = 1;
41
41
  // Begin UFO experience
42
42
  (0, _analytics.startUfoExperience)(ACTION_EXPERIENCE_NAME, experienceId, {
43
43
  actionType: actionType,
@@ -58,9 +58,9 @@ var useInvokeClientAction = function useInvokeClientAction(_ref) {
58
58
  });
59
59
  }
60
60
  // Invoke action
61
- _context.next = 9;
61
+ _context.next = 2;
62
62
  return actionFn();
63
- case 9:
63
+ case 2:
64
64
  result = _context.sent;
65
65
  measure.mark(markName, 'resolved');
66
66
  (0, _analytics.succeedUfoExperience)(ACTION_EXPERIENCE_NAME, experienceId);
@@ -73,12 +73,12 @@ var useInvokeClientAction = function useInvokeClientAction(_ref) {
73
73
  resourceType: resourceType
74
74
  });
75
75
  return _context.abrupt("return", result);
76
- case 16:
77
- _context.prev = 16;
78
- _context.t0 = _context["catch"](4);
76
+ case 3:
77
+ _context.prev = 3;
78
+ _t = _context["catch"](1);
79
79
  measure.mark(markName, 'errored');
80
80
  (0, _analytics.failUfoExperience)(ACTION_EXPERIENCE_NAME, experienceId);
81
- reason = typeof _context.t0 === 'string' ? _context.t0 : _context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message;
81
+ reason = typeof _t === 'string' ? _t : _t === null || _t === void 0 ? void 0 : _t.message;
82
82
  fireEvent('operational.smartLinkAction.unresolved', {
83
83
  actionType: actionType !== null && actionType !== void 0 ? actionType : null,
84
84
  definitionId: definitionId,
@@ -88,11 +88,11 @@ var useInvokeClientAction = function useInvokeClientAction(_ref) {
88
88
  reason: reason,
89
89
  resourceType: resourceType
90
90
  });
91
- case 22:
91
+ case 4:
92
92
  case "end":
93
93
  return _context.stop();
94
94
  }
95
- }, _callee, null, [[4, 16]]);
95
+ }, _callee, null, [[1, 3]]);
96
96
  }));
97
97
  return function (_x) {
98
98
  return _ref3.apply(this, arguments);
@@ -34,7 +34,7 @@ var useResolve = function useResolve() {
34
34
  details,
35
35
  hasData,
36
36
  _args = arguments;
37
- return _regenerator.default.wrap(function _callee$(_context) {
37
+ return _regenerator.default.wrap(function (_context) {
38
38
  while (1) switch (_context.prev = _context.next) {
39
39
  case 0:
40
40
  isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
@@ -46,7 +46,7 @@ var useResolve = function useResolve() {
46
46
  }, details = _ref2.details;
47
47
  hasData = !!(details && details.data || (0, _linkExtractors.isEntityPresent)(details));
48
48
  if (!(isReloading || !hasData || isMetadataRequest)) {
49
- _context.next = 9;
49
+ _context.next = 1;
50
50
  break;
51
51
  }
52
52
  return _context.abrupt("return", connections.client.fetchData(url, isReloading).then(function (response) {
@@ -54,11 +54,11 @@ var useResolve = function useResolve() {
54
54
  }).catch(function (error) {
55
55
  return handleResolvedLinkError(url, error, undefined, isMetadataRequest);
56
56
  }));
57
- case 9:
57
+ case 1:
58
58
  (0, _analytics.addMetadataToExperience)('smart-link-rendered', id, {
59
59
  cached: true
60
60
  });
61
- case 10:
61
+ case 2:
62
62
  case "end":
63
63
  return _context.stop();
64
64
  }