@atlaskit/editor-card-provider 5.0.2 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-card-provider
2
2
 
3
+ ## 5.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#167423](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/167423)
8
+ [`064579ff3e75c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/064579ff3e75c) -
9
+ Move smart_links_noun_support feature gate to link-extractor
10
+ - Updated dependencies
11
+
12
+ ## 5.0.3
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 5.0.2
4
19
 
5
20
  ### Patch Changes
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.editorCardProvider = exports.EditorCardProvider = void 0;
8
+ exports.isJiraWorkItem = exports.editorCardProvider = exports.EditorCardProvider = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
@@ -105,8 +105,11 @@ var isConfluenceTeamCalendars = function isConfluenceTeamCalendars(url) {
105
105
  var isJiraIssueNavigator = function isJiraIssueNavigator(url) {
106
106
  return url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
107
107
  };
108
+ var isJiraWorkItem = exports.isJiraWorkItem = function isJiraWorkItem(url) {
109
+ return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
110
+ };
108
111
  var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
109
- function EditorCardProvider(envKey, baseUrlOverride, product) {
112
+ function EditorCardProvider(envKey, baseUrlOverride, product, onResolve) {
110
113
  var _this = this;
111
114
  (0, _classCallCheck2.default)(this, EditorCardProvider);
112
115
  (0, _defineProperty2.default)(this, "getExperimentValue", function (experimentName, parameterName, defaultValue) {
@@ -119,6 +122,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
119
122
  this.baseUrl = baseUrlOverride || (0, _linkingCommon.getBaseUrl)(envKey);
120
123
  this.resolverUrl = (0, _linkingCommon.getResolverUrl)(envKey, baseUrlOverride);
121
124
  this.transformer = new _transformer.Transformer();
125
+ this.onResolve = onResolve;
122
126
  this.requestHeaders = {
123
127
  Origin: this.baseUrl
124
128
  };
@@ -426,7 +430,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
426
430
  */
427
431
  function () {
428
432
  var _canBeResolvedAsEmbed = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(url) {
429
- var details, embed, data, preview;
433
+ var details, embed;
430
434
  return _regenerator.default.wrap(function _callee8$(_context8) {
431
435
  while (1) switch (_context8.prev = _context8.next) {
432
436
  case 0:
@@ -435,43 +439,29 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
435
439
  return this.cardClient.fetchData(url);
436
440
  case 3:
437
441
  details = _context8.sent;
438
- if (!(0, _platformFeatureFlags.fg)('smart_links_noun_support')) {
439
- _context8.next = 9;
440
- break;
441
- }
442
442
  if (details) {
443
- _context8.next = 7;
444
- break;
445
- }
446
- return _context8.abrupt("return", false);
447
- case 7:
448
- embed = (0, _linkExtractors.extractSmartLinkEmbed)(details);
449
- return _context8.abrupt("return", !!embed);
450
- case 9:
451
- data = details && details.data;
452
- if (data) {
453
- _context8.next = 12;
443
+ _context8.next = 6;
454
444
  break;
455
445
  }
456
446
  return _context8.abrupt("return", false);
457
- case 12:
447
+ case 6:
458
448
  if (!((0, _linkingCommon.getStatus)(details) !== 'resolved')) {
459
- _context8.next = 14;
449
+ _context8.next = 8;
460
450
  break;
461
451
  }
462
452
  return _context8.abrupt("return", false);
463
- case 14:
464
- preview = (0, _linkExtractors.extractPreview)(data, 'web');
465
- return _context8.abrupt("return", !!preview);
466
- case 18:
467
- _context8.prev = 18;
453
+ case 8:
454
+ embed = (0, _linkExtractors.extractSmartLinkEmbed)(details);
455
+ return _context8.abrupt("return", !!embed);
456
+ case 12:
457
+ _context8.prev = 12;
468
458
  _context8.t0 = _context8["catch"](0);
469
459
  return _context8.abrupt("return", false);
470
- case 21:
460
+ case 15:
471
461
  case "end":
472
462
  return _context8.stop();
473
463
  }
474
- }, _callee8, this, [[0, 18]]);
464
+ }, _callee8, this, [[0, 12]]);
475
465
  }));
476
466
  function canBeResolvedAsEmbed(_x6) {
477
467
  return _canBeResolvedAsEmbed.apply(this, arguments);
@@ -523,7 +513,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
523
513
  key: "resolve",
524
514
  value: function () {
525
515
  var _resolve = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
526
- var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, isSupported, providerDefaultAppearance, preferredAppearance, canItBeEmbed, datasource, id, parameters;
516
+ var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, _this$onResolve, isSupported, providerDefaultAppearance, preferredAppearance, canItBeEmbed, datasource, id, parameters;
527
517
  return _regenerator.default.wrap(function _callee0$(_context0) {
528
518
  while (1) switch (_context0.prev = _context0.next) {
529
519
  case 0:
@@ -542,25 +532,28 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
542
532
  _yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 2);
543
533
  matchedProviderPattern = _yield$Promise$all2[0];
544
534
  userPreference = _yield$Promise$all2[1];
535
+ if (isJiraWorkItem(url) && (0, _platformFeatureFlags.fg)('issue-link-suggestions-in-comments')) {
536
+ (_this$onResolve = this.onResolve) === null || _this$onResolve === void 0 || _this$onResolve.call(this, url);
537
+ }
545
538
  if (!(shouldForceAppearance === false && userPreference === 'url')) {
546
- _context0.next = 12;
539
+ _context0.next = 13;
547
540
  break;
548
541
  }
549
542
  return _context0.abrupt("return", Promise.reject(undefined));
550
- case 12:
543
+ case 13:
551
544
  _context0.t0 = !!matchedProviderPattern;
552
545
  if (_context0.t0) {
553
- _context0.next = 17;
546
+ _context0.next = 18;
554
547
  break;
555
548
  }
556
- _context0.next = 16;
549
+ _context0.next = 17;
557
550
  return this.checkLinkResolved(url);
558
- case 16:
559
- _context0.t0 = _context0.sent;
560
551
  case 17:
552
+ _context0.t0 = _context0.sent;
553
+ case 18:
561
554
  isSupported = _context0.t0;
562
555
  if (!isSupported) {
563
- _context0.next = 33;
556
+ _context0.next = 34;
564
557
  break;
565
558
  }
566
559
  providerDefaultAppearance = matchedProviderPattern === null || matchedProviderPattern === void 0 ? void 0 : matchedProviderPattern.defaultView;
@@ -578,23 +571,23 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
578
571
  // If not, we pick what editor (or any other client) requested
579
572
  appearance;
580
573
  if (!(preferredAppearance === userPreference && userPreference === 'embed')) {
581
- _context0.next = 26;
574
+ _context0.next = 27;
582
575
  break;
583
576
  }
584
- _context0.next = 24;
577
+ _context0.next = 25;
585
578
  return this.canBeResolvedAsEmbed(url);
586
- case 24:
579
+ case 25:
587
580
  canItBeEmbed = _context0.sent;
588
581
  if (!canItBeEmbed) {
589
582
  preferredAppearance = 'inline';
590
583
  }
591
- case 26:
592
- _context0.next = 28;
584
+ case 27:
585
+ _context0.next = 29;
593
586
  return this.getDatasourceFromResolveResponse(url);
594
- case 28:
587
+ case 29:
595
588
  datasource = _context0.sent;
596
589
  if (!datasource) {
597
- _context0.next = 32;
590
+ _context0.next = 33;
598
591
  break;
599
592
  }
600
593
  id = datasource.id, parameters = datasource.parameters;
@@ -607,23 +600,23 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
607
600
  type: 'table'
608
601
  }]
609
602
  }, url));
610
- case 32:
611
- return _context0.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
612
603
  case 33:
613
- _context0.next = 38;
604
+ return _context0.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
605
+ case 34:
606
+ _context0.next = 39;
614
607
  break;
615
- case 35:
616
- _context0.prev = 35;
608
+ case 36:
609
+ _context0.prev = 36;
617
610
  _context0.t1 = _context0["catch"](0);
618
611
  // eslint-disable-next-line
619
612
  console.warn("Error when trying to check Smart Card url \"".concat(url, "\"").concat(_context0.t1 instanceof Error ? " - ".concat(_context0.t1.name, " ").concat(_context0.t1.message) : ''), _context0.t1);
620
- case 38:
621
- return _context0.abrupt("return", Promise.reject(undefined));
622
613
  case 39:
614
+ return _context0.abrupt("return", Promise.reject(undefined));
615
+ case 40:
623
616
  case "end":
624
617
  return _context0.stop();
625
618
  }
626
- }, _callee0, this, [[0, 35]]);
619
+ }, _callee0, this, [[0, 36]]);
627
620
  }));
628
621
  function resolve(_x8, _x9, _x0, _x1) {
629
622
  return _resolve.apply(this, arguments);
@@ -1,5 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { extractPreview, extractSmartLinkEmbed } from '@atlaskit/link-extractors';
2
+ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
3
3
  import { getStatus } from '@atlaskit/linking-common';
4
4
  import DataLoader from 'dataloader';
5
5
  import { Transformer } from './transformer';
@@ -51,8 +51,9 @@ const isRovoAgentProfilePage = url => {
51
51
  const isCustomer360LandingPage = url => url.match(/^https:\/\/customer\.atlassian\.com\/.*$/);
52
52
  const isConfluenceTeamCalendars = url => url.match(/\/wiki\/spaces\/(?<resourceContext>[^\/]+)\/calendars\/(?<resourceId>[a-zA-Z0-9-]+)/);
53
53
  const isJiraIssueNavigator = url => url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
54
+ export const isJiraWorkItem = url => /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
54
55
  export class EditorCardProvider {
55
- constructor(envKey, baseUrlOverride, product) {
56
+ constructor(envKey, baseUrlOverride, product, onResolve) {
56
57
  _defineProperty(this, "getExperimentValue", (experimentName, parameterName, defaultValue) => {
57
58
  try {
58
59
  return FeatureGates.getExperimentValue(experimentName, parameterName, defaultValue);
@@ -63,6 +64,7 @@ export class EditorCardProvider {
63
64
  this.baseUrl = baseUrlOverride || getBaseUrl(envKey);
64
65
  this.resolverUrl = getResolverUrl(envKey, baseUrlOverride);
65
66
  this.transformer = new Transformer();
67
+ this.onResolve = onResolve;
66
68
  this.requestHeaders = {
67
69
  Origin: this.baseUrl
68
70
  };
@@ -193,19 +195,10 @@ export class EditorCardProvider {
193
195
  async canBeResolvedAsEmbed(url) {
194
196
  try {
195
197
  const details = await this.cardClient.fetchData(url);
196
-
197
- // Entities supported
198
- if (fg('smart_links_noun_support')) {
199
- if (!details) {
200
- return false;
201
- }
202
- const embed = extractSmartLinkEmbed(details);
203
- return !!embed;
204
- }
205
- const data = details && details.data;
206
- if (!data) {
198
+ if (!details) {
207
199
  return false;
208
200
  }
201
+
209
202
  // Imagine response is "unauthorized". We won't be able to tell if even after auth
210
203
  // page going to have preview. Yes, we can show auth view for embed. But what if even after
211
204
  // success auth flow there won't be preview? We will already have ugly embed ADF.
@@ -213,8 +206,8 @@ export class EditorCardProvider {
213
206
  if (getStatus(details) !== 'resolved') {
214
207
  return false;
215
208
  }
216
- const preview = extractPreview(data, 'web');
217
- return !!preview;
209
+ const embed = extractSmartLinkEmbed(details);
210
+ return !!embed;
218
211
  } catch (e) {
219
212
  return false;
220
213
  }
@@ -246,6 +239,10 @@ export class EditorCardProvider {
246
239
  }
247
240
  const hardCodedAppearance = this.getHardCodedAppearance(url);
248
241
  const [matchedProviderPattern, userPreference] = await Promise.all([this.findPatternData(url), this.findUserPreference(url)]);
242
+ if (isJiraWorkItem(url) && fg('issue-link-suggestions-in-comments')) {
243
+ var _this$onResolve;
244
+ (_this$onResolve = this.onResolve) === null || _this$onResolve === void 0 ? void 0 : _this$onResolve.call(this, url);
245
+ }
249
246
  if (shouldForceAppearance === false && userPreference === 'url') {
250
247
  return Promise.reject(undefined);
251
248
  }
@@ -8,7 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _setPrototypeOf from "@babel/runtime/helpers/setPrototypeOf";
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
  function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function (e, r, t) { if ("" === t) return e; var p = o[r]; return Array.isArray(p) ? "$" + p.join("$") : "number" == typeof p ? "$" + p : ""; })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
11
- import { extractPreview, extractSmartLinkEmbed } from '@atlaskit/link-extractors';
11
+ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
12
12
  import { getStatus } from '@atlaskit/linking-common';
13
13
  import DataLoader from 'dataloader';
14
14
  import { Transformer } from './transformer';
@@ -98,8 +98,11 @@ var isConfluenceTeamCalendars = function isConfluenceTeamCalendars(url) {
98
98
  var isJiraIssueNavigator = function isJiraIssueNavigator(url) {
99
99
  return url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
100
100
  };
101
+ export var isJiraWorkItem = function isJiraWorkItem(url) {
102
+ return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
103
+ };
101
104
  export var EditorCardProvider = /*#__PURE__*/function () {
102
- function EditorCardProvider(envKey, baseUrlOverride, product) {
105
+ function EditorCardProvider(envKey, baseUrlOverride, product, onResolve) {
103
106
  var _this = this;
104
107
  _classCallCheck(this, EditorCardProvider);
105
108
  _defineProperty(this, "getExperimentValue", function (experimentName, parameterName, defaultValue) {
@@ -112,6 +115,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
112
115
  this.baseUrl = baseUrlOverride || getBaseUrl(envKey);
113
116
  this.resolverUrl = getResolverUrl(envKey, baseUrlOverride);
114
117
  this.transformer = new Transformer();
118
+ this.onResolve = onResolve;
115
119
  this.requestHeaders = {
116
120
  Origin: this.baseUrl
117
121
  };
@@ -419,7 +423,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
419
423
  */
420
424
  function () {
421
425
  var _canBeResolvedAsEmbed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(url) {
422
- var details, embed, data, preview;
426
+ var details, embed;
423
427
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
424
428
  while (1) switch (_context8.prev = _context8.next) {
425
429
  case 0:
@@ -428,43 +432,29 @@ export var EditorCardProvider = /*#__PURE__*/function () {
428
432
  return this.cardClient.fetchData(url);
429
433
  case 3:
430
434
  details = _context8.sent;
431
- if (!fg('smart_links_noun_support')) {
432
- _context8.next = 9;
433
- break;
434
- }
435
435
  if (details) {
436
- _context8.next = 7;
437
- break;
438
- }
439
- return _context8.abrupt("return", false);
440
- case 7:
441
- embed = extractSmartLinkEmbed(details);
442
- return _context8.abrupt("return", !!embed);
443
- case 9:
444
- data = details && details.data;
445
- if (data) {
446
- _context8.next = 12;
436
+ _context8.next = 6;
447
437
  break;
448
438
  }
449
439
  return _context8.abrupt("return", false);
450
- case 12:
440
+ case 6:
451
441
  if (!(getStatus(details) !== 'resolved')) {
452
- _context8.next = 14;
442
+ _context8.next = 8;
453
443
  break;
454
444
  }
455
445
  return _context8.abrupt("return", false);
456
- case 14:
457
- preview = extractPreview(data, 'web');
458
- return _context8.abrupt("return", !!preview);
459
- case 18:
460
- _context8.prev = 18;
446
+ case 8:
447
+ embed = extractSmartLinkEmbed(details);
448
+ return _context8.abrupt("return", !!embed);
449
+ case 12:
450
+ _context8.prev = 12;
461
451
  _context8.t0 = _context8["catch"](0);
462
452
  return _context8.abrupt("return", false);
463
- case 21:
453
+ case 15:
464
454
  case "end":
465
455
  return _context8.stop();
466
456
  }
467
- }, _callee8, this, [[0, 18]]);
457
+ }, _callee8, this, [[0, 12]]);
468
458
  }));
469
459
  function canBeResolvedAsEmbed(_x6) {
470
460
  return _canBeResolvedAsEmbed.apply(this, arguments);
@@ -516,7 +506,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
516
506
  key: "resolve",
517
507
  value: function () {
518
508
  var _resolve = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee0(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
519
- var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, isSupported, providerDefaultAppearance, preferredAppearance, canItBeEmbed, datasource, id, parameters;
509
+ var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, _this$onResolve, isSupported, providerDefaultAppearance, preferredAppearance, canItBeEmbed, datasource, id, parameters;
520
510
  return _regeneratorRuntime.wrap(function _callee0$(_context0) {
521
511
  while (1) switch (_context0.prev = _context0.next) {
522
512
  case 0:
@@ -535,25 +525,28 @@ export var EditorCardProvider = /*#__PURE__*/function () {
535
525
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
536
526
  matchedProviderPattern = _yield$Promise$all2[0];
537
527
  userPreference = _yield$Promise$all2[1];
528
+ if (isJiraWorkItem(url) && fg('issue-link-suggestions-in-comments')) {
529
+ (_this$onResolve = this.onResolve) === null || _this$onResolve === void 0 || _this$onResolve.call(this, url);
530
+ }
538
531
  if (!(shouldForceAppearance === false && userPreference === 'url')) {
539
- _context0.next = 12;
532
+ _context0.next = 13;
540
533
  break;
541
534
  }
542
535
  return _context0.abrupt("return", Promise.reject(undefined));
543
- case 12:
536
+ case 13:
544
537
  _context0.t0 = !!matchedProviderPattern;
545
538
  if (_context0.t0) {
546
- _context0.next = 17;
539
+ _context0.next = 18;
547
540
  break;
548
541
  }
549
- _context0.next = 16;
542
+ _context0.next = 17;
550
543
  return this.checkLinkResolved(url);
551
- case 16:
552
- _context0.t0 = _context0.sent;
553
544
  case 17:
545
+ _context0.t0 = _context0.sent;
546
+ case 18:
554
547
  isSupported = _context0.t0;
555
548
  if (!isSupported) {
556
- _context0.next = 33;
549
+ _context0.next = 34;
557
550
  break;
558
551
  }
559
552
  providerDefaultAppearance = matchedProviderPattern === null || matchedProviderPattern === void 0 ? void 0 : matchedProviderPattern.defaultView;
@@ -571,23 +564,23 @@ export var EditorCardProvider = /*#__PURE__*/function () {
571
564
  // If not, we pick what editor (or any other client) requested
572
565
  appearance;
573
566
  if (!(preferredAppearance === userPreference && userPreference === 'embed')) {
574
- _context0.next = 26;
567
+ _context0.next = 27;
575
568
  break;
576
569
  }
577
- _context0.next = 24;
570
+ _context0.next = 25;
578
571
  return this.canBeResolvedAsEmbed(url);
579
- case 24:
572
+ case 25:
580
573
  canItBeEmbed = _context0.sent;
581
574
  if (!canItBeEmbed) {
582
575
  preferredAppearance = 'inline';
583
576
  }
584
- case 26:
585
- _context0.next = 28;
577
+ case 27:
578
+ _context0.next = 29;
586
579
  return this.getDatasourceFromResolveResponse(url);
587
- case 28:
580
+ case 29:
588
581
  datasource = _context0.sent;
589
582
  if (!datasource) {
590
- _context0.next = 32;
583
+ _context0.next = 33;
591
584
  break;
592
585
  }
593
586
  id = datasource.id, parameters = datasource.parameters;
@@ -600,23 +593,23 @@ export var EditorCardProvider = /*#__PURE__*/function () {
600
593
  type: 'table'
601
594
  }]
602
595
  }, url));
603
- case 32:
604
- return _context0.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
605
596
  case 33:
606
- _context0.next = 38;
597
+ return _context0.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
598
+ case 34:
599
+ _context0.next = 39;
607
600
  break;
608
- case 35:
609
- _context0.prev = 35;
601
+ case 36:
602
+ _context0.prev = 36;
610
603
  _context0.t1 = _context0["catch"](0);
611
604
  // eslint-disable-next-line
612
605
  console.warn("Error when trying to check Smart Card url \"".concat(url, "\"").concat(_context0.t1 instanceof Error ? " - ".concat(_context0.t1.name, " ").concat(_context0.t1.message) : ''), _context0.t1);
613
- case 38:
614
- return _context0.abrupt("return", Promise.reject(undefined));
615
606
  case 39:
607
+ return _context0.abrupt("return", Promise.reject(undefined));
608
+ case 40:
616
609
  case "end":
617
610
  return _context0.stop();
618
611
  }
619
- }, _callee0, this, [[0, 35]]);
612
+ }, _callee0, this, [[0, 36]]);
620
613
  }));
621
614
  function resolve(_x8, _x9, _x0, _x1) {
622
615
  return _resolve.apply(this, arguments);
@@ -1,6 +1,7 @@
1
1
  import { type CardAdf, type CardAppearance, type DatasourceAdf, type ProductType } from '@atlaskit/linking-common';
2
2
  import { type CardProvider } from './types';
3
3
  import { type EnvironmentsKeys } from '@atlaskit/linking-common';
4
+ export declare const isJiraWorkItem: (url: string) => boolean;
4
5
  export declare class EditorCardProvider implements CardProvider {
5
6
  private baseUrl;
6
7
  private resolverUrl;
@@ -9,7 +10,8 @@ export declare class EditorCardProvider implements CardProvider {
9
10
  private transformer;
10
11
  private providersLoader;
11
12
  private cardClient;
12
- constructor(envKey?: EnvironmentsKeys, baseUrlOverride?: string, product?: ProductType);
13
+ private onResolve;
14
+ constructor(envKey?: EnvironmentsKeys, baseUrlOverride?: string, product?: ProductType, onResolve?: (url: string) => void);
13
15
  private batchProviders;
14
16
  private checkLinkResolved;
15
17
  private fetchProvidersData;
@@ -1,6 +1,7 @@
1
1
  import { type CardAdf, type CardAppearance, type DatasourceAdf, type ProductType } from '@atlaskit/linking-common';
2
2
  import { type CardProvider } from './types';
3
3
  import { type EnvironmentsKeys } from '@atlaskit/linking-common';
4
+ export declare const isJiraWorkItem: (url: string) => boolean;
4
5
  export declare class EditorCardProvider implements CardProvider {
5
6
  private baseUrl;
6
7
  private resolverUrl;
@@ -9,7 +10,8 @@ export declare class EditorCardProvider implements CardProvider {
9
10
  private transformer;
10
11
  private providersLoader;
11
12
  private cardClient;
12
- constructor(envKey?: EnvironmentsKeys, baseUrlOverride?: string, product?: ProductType);
13
+ private onResolve;
14
+ constructor(envKey?: EnvironmentsKeys, baseUrlOverride?: string, product?: ProductType, onResolve?: (url: string) => void);
13
15
  private batchProviders;
14
16
  private checkLinkResolved;
15
17
  private fetchProvidersData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "description": "Contains the EditorCardProvider, for determining smart card behaviour in the editor.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/link-client-extension": "^5.0.0",
39
39
  "@atlaskit/link-extractors": "^2.3.0",
40
40
  "@atlaskit/linking-common": "^9.0.0",
41
- "@atlaskit/linking-types": "^11.0.0",
41
+ "@atlaskit/linking-types": "^12.0.0",
42
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "dataloader": "^2.1.0"
@@ -69,6 +69,9 @@
69
69
  },
70
70
  "jira_nin_smart_link": {
71
71
  "type": "boolean"
72
+ },
73
+ "issue-link-suggestions-in-comments": {
74
+ "type": "boolean"
72
75
  }
73
76
  },
74
77
  "compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/e145f3e3-514b-410f-a274-a92e6e6f9c47"