@atlaskit/editor-card-provider 5.0.0 → 5.0.2

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,23 @@
1
1
  # @atlaskit/editor-card-provider
2
2
 
3
+ ## 5.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#165007](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/165007)
8
+ [`1f50b1c7072cf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f50b1c7072cf) -
9
+ Remove atlassian:design and flattern the entity data
10
+ - Updated dependencies
11
+
12
+ ## 5.0.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#164735](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164735)
17
+ [`e775157fd06b8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e775157fd06b8) -
18
+ Rename nounData to entityData. Fg smart_links_noun_support
19
+ - Updated dependencies
20
+
3
21
  ## 5.0.0
4
22
 
5
23
  ### Patch Changes
@@ -22,8 +22,7 @@ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gat
22
22
  var _linkProvider = require("@atlaskit/link-provider");
23
23
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
24
  var api = _interopRequireWildcard(require("./api"));
25
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
26
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
+ 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); }
27
26
  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)), (0, _setPrototypeOf2.default)(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 (0, _inherits2.default)(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); }
28
27
  var BATCH_WAIT_TIME = 50;
29
28
 
@@ -412,7 +411,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
412
411
  isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
413
412
  }
414
413
  var isJiraIssueNavigatorEvaluated;
415
- if ((0, _platformFeatureFlags.fg)('jira_nin_smart_link')) {
414
+ if (this.getExperimentValue('jsc_nin_smart_link', 'isEnabled', false)) {
416
415
  isJiraIssueNavigatorEvaluated = isJiraIssueNavigator(url);
417
416
  }
418
417
  if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigatorEvaluated) {
@@ -523,45 +522,45 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
523
522
  }, {
524
523
  key: "resolve",
525
524
  value: function () {
526
- var _resolve = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
525
+ var _resolve = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
527
526
  var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, isSupported, providerDefaultAppearance, preferredAppearance, canItBeEmbed, datasource, id, parameters;
528
- return _regenerator.default.wrap(function _callee10$(_context10) {
529
- while (1) switch (_context10.prev = _context10.next) {
527
+ return _regenerator.default.wrap(function _callee0$(_context0) {
528
+ while (1) switch (_context0.prev = _context0.next) {
530
529
  case 0:
531
- _context10.prev = 0;
530
+ _context0.prev = 0;
532
531
  if (!(shouldForceAppearance === true)) {
533
- _context10.next = 3;
532
+ _context0.next = 3;
534
533
  break;
535
534
  }
536
- return _context10.abrupt("return", this.transformer.toSmartlinkAdf(url, appearance));
535
+ return _context0.abrupt("return", this.transformer.toSmartlinkAdf(url, appearance));
537
536
  case 3:
538
537
  hardCodedAppearance = this.getHardCodedAppearance(url);
539
- _context10.next = 6;
538
+ _context0.next = 6;
540
539
  return Promise.all([this.findPatternData(url), this.findUserPreference(url)]);
541
540
  case 6:
542
- _yield$Promise$all = _context10.sent;
541
+ _yield$Promise$all = _context0.sent;
543
542
  _yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 2);
544
543
  matchedProviderPattern = _yield$Promise$all2[0];
545
544
  userPreference = _yield$Promise$all2[1];
546
545
  if (!(shouldForceAppearance === false && userPreference === 'url')) {
547
- _context10.next = 12;
546
+ _context0.next = 12;
548
547
  break;
549
548
  }
550
- return _context10.abrupt("return", Promise.reject(undefined));
549
+ return _context0.abrupt("return", Promise.reject(undefined));
551
550
  case 12:
552
- _context10.t0 = !!matchedProviderPattern;
553
- if (_context10.t0) {
554
- _context10.next = 17;
551
+ _context0.t0 = !!matchedProviderPattern;
552
+ if (_context0.t0) {
553
+ _context0.next = 17;
555
554
  break;
556
555
  }
557
- _context10.next = 16;
556
+ _context0.next = 16;
558
557
  return this.checkLinkResolved(url);
559
558
  case 16:
560
- _context10.t0 = _context10.sent;
559
+ _context0.t0 = _context0.sent;
561
560
  case 17:
562
- isSupported = _context10.t0;
561
+ isSupported = _context0.t0;
563
562
  if (!isSupported) {
564
- _context10.next = 33;
563
+ _context0.next = 33;
565
564
  break;
566
565
  }
567
566
  providerDefaultAppearance = matchedProviderPattern === null || matchedProviderPattern === void 0 ? void 0 : matchedProviderPattern.defaultView;
@@ -579,27 +578,27 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
579
578
  // If not, we pick what editor (or any other client) requested
580
579
  appearance;
581
580
  if (!(preferredAppearance === userPreference && userPreference === 'embed')) {
582
- _context10.next = 26;
581
+ _context0.next = 26;
583
582
  break;
584
583
  }
585
- _context10.next = 24;
584
+ _context0.next = 24;
586
585
  return this.canBeResolvedAsEmbed(url);
587
586
  case 24:
588
- canItBeEmbed = _context10.sent;
587
+ canItBeEmbed = _context0.sent;
589
588
  if (!canItBeEmbed) {
590
589
  preferredAppearance = 'inline';
591
590
  }
592
591
  case 26:
593
- _context10.next = 28;
592
+ _context0.next = 28;
594
593
  return this.getDatasourceFromResolveResponse(url);
595
594
  case 28:
596
- datasource = _context10.sent;
595
+ datasource = _context0.sent;
597
596
  if (!datasource) {
598
- _context10.next = 32;
597
+ _context0.next = 32;
599
598
  break;
600
599
  }
601
600
  id = datasource.id, parameters = datasource.parameters;
602
- return _context10.abrupt("return", this.transformer.toDatasourceAdf({
601
+ return _context0.abrupt("return", this.transformer.toDatasourceAdf({
603
602
  id: id,
604
603
  parameters: parameters,
605
604
  // in the future when we support multiple views, we will need to pass this in as a parameter
@@ -609,24 +608,24 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
609
608
  }]
610
609
  }, url));
611
610
  case 32:
612
- return _context10.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
611
+ return _context0.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
613
612
  case 33:
614
- _context10.next = 38;
613
+ _context0.next = 38;
615
614
  break;
616
615
  case 35:
617
- _context10.prev = 35;
618
- _context10.t1 = _context10["catch"](0);
616
+ _context0.prev = 35;
617
+ _context0.t1 = _context0["catch"](0);
619
618
  // eslint-disable-next-line
620
- console.warn("Error when trying to check Smart Card url \"".concat(url, "\"").concat(_context10.t1 instanceof Error ? " - ".concat(_context10.t1.name, " ").concat(_context10.t1.message) : ''), _context10.t1);
619
+ 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);
621
620
  case 38:
622
- return _context10.abrupt("return", Promise.reject(undefined));
621
+ return _context0.abrupt("return", Promise.reject(undefined));
623
622
  case 39:
624
623
  case "end":
625
- return _context10.stop();
624
+ return _context0.stop();
626
625
  }
627
- }, _callee10, this, [[0, 35]]);
626
+ }, _callee0, this, [[0, 35]]);
628
627
  }));
629
- function resolve(_x8, _x9, _x10, _x11) {
628
+ function resolve(_x8, _x9, _x0, _x1) {
630
629
  return _resolve.apply(this, arguments);
631
630
  }
632
631
  return resolve;
@@ -180,7 +180,7 @@ export class EditorCardProvider {
180
180
  isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
181
181
  }
182
182
  let isJiraIssueNavigatorEvaluated;
183
- if (fg('jira_nin_smart_link')) {
183
+ if (this.getExperimentValue('jsc_nin_smart_link', 'isEnabled', false)) {
184
184
  isJiraIssueNavigatorEvaluated = isJiraIssueNavigator(url);
185
185
  }
186
186
  if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigatorEvaluated) {
@@ -194,7 +194,7 @@ export class EditorCardProvider {
194
194
  try {
195
195
  const details = await this.cardClient.fetchData(url);
196
196
 
197
- // Noun entities supported
197
+ // Entities supported
198
198
  if (fg('smart_links_noun_support')) {
199
199
  if (!details) {
200
200
  return false;
@@ -404,7 +404,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
404
404
  isConfluenceTeamCalendarsEvaluated = isConfluenceTeamCalendars(url);
405
405
  }
406
406
  var isJiraIssueNavigatorEvaluated;
407
- if (fg('jira_nin_smart_link')) {
407
+ if (this.getExperimentValue('jsc_nin_smart_link', 'isEnabled', false)) {
408
408
  isJiraIssueNavigatorEvaluated = isJiraIssueNavigator(url);
409
409
  }
410
410
  if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraVersion(url) || isJiraPlanEvaluated || isJiraFormEvaluated || isJiraSummaryEvaluated || isCustomer360LandingPage(url) || isConfluenceTeamCalendarsEvaluated || isJiraIssueNavigatorEvaluated) {
@@ -515,45 +515,45 @@ export var EditorCardProvider = /*#__PURE__*/function () {
515
515
  }, {
516
516
  key: "resolve",
517
517
  value: function () {
518
- var _resolve = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
518
+ var _resolve = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee0(url, appearance, shouldForceAppearance, isEmbedFriendlyLocation) {
519
519
  var hardCodedAppearance, _yield$Promise$all, _yield$Promise$all2, matchedProviderPattern, userPreference, isSupported, providerDefaultAppearance, preferredAppearance, canItBeEmbed, datasource, id, parameters;
520
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
521
- while (1) switch (_context10.prev = _context10.next) {
520
+ return _regeneratorRuntime.wrap(function _callee0$(_context0) {
521
+ while (1) switch (_context0.prev = _context0.next) {
522
522
  case 0:
523
- _context10.prev = 0;
523
+ _context0.prev = 0;
524
524
  if (!(shouldForceAppearance === true)) {
525
- _context10.next = 3;
525
+ _context0.next = 3;
526
526
  break;
527
527
  }
528
- return _context10.abrupt("return", this.transformer.toSmartlinkAdf(url, appearance));
528
+ return _context0.abrupt("return", this.transformer.toSmartlinkAdf(url, appearance));
529
529
  case 3:
530
530
  hardCodedAppearance = this.getHardCodedAppearance(url);
531
- _context10.next = 6;
531
+ _context0.next = 6;
532
532
  return Promise.all([this.findPatternData(url), this.findUserPreference(url)]);
533
533
  case 6:
534
- _yield$Promise$all = _context10.sent;
534
+ _yield$Promise$all = _context0.sent;
535
535
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
536
536
  matchedProviderPattern = _yield$Promise$all2[0];
537
537
  userPreference = _yield$Promise$all2[1];
538
538
  if (!(shouldForceAppearance === false && userPreference === 'url')) {
539
- _context10.next = 12;
539
+ _context0.next = 12;
540
540
  break;
541
541
  }
542
- return _context10.abrupt("return", Promise.reject(undefined));
542
+ return _context0.abrupt("return", Promise.reject(undefined));
543
543
  case 12:
544
- _context10.t0 = !!matchedProviderPattern;
545
- if (_context10.t0) {
546
- _context10.next = 17;
544
+ _context0.t0 = !!matchedProviderPattern;
545
+ if (_context0.t0) {
546
+ _context0.next = 17;
547
547
  break;
548
548
  }
549
- _context10.next = 16;
549
+ _context0.next = 16;
550
550
  return this.checkLinkResolved(url);
551
551
  case 16:
552
- _context10.t0 = _context10.sent;
552
+ _context0.t0 = _context0.sent;
553
553
  case 17:
554
- isSupported = _context10.t0;
554
+ isSupported = _context0.t0;
555
555
  if (!isSupported) {
556
- _context10.next = 33;
556
+ _context0.next = 33;
557
557
  break;
558
558
  }
559
559
  providerDefaultAppearance = matchedProviderPattern === null || matchedProviderPattern === void 0 ? void 0 : matchedProviderPattern.defaultView;
@@ -571,27 +571,27 @@ export var EditorCardProvider = /*#__PURE__*/function () {
571
571
  // If not, we pick what editor (or any other client) requested
572
572
  appearance;
573
573
  if (!(preferredAppearance === userPreference && userPreference === 'embed')) {
574
- _context10.next = 26;
574
+ _context0.next = 26;
575
575
  break;
576
576
  }
577
- _context10.next = 24;
577
+ _context0.next = 24;
578
578
  return this.canBeResolvedAsEmbed(url);
579
579
  case 24:
580
- canItBeEmbed = _context10.sent;
580
+ canItBeEmbed = _context0.sent;
581
581
  if (!canItBeEmbed) {
582
582
  preferredAppearance = 'inline';
583
583
  }
584
584
  case 26:
585
- _context10.next = 28;
585
+ _context0.next = 28;
586
586
  return this.getDatasourceFromResolveResponse(url);
587
587
  case 28:
588
- datasource = _context10.sent;
588
+ datasource = _context0.sent;
589
589
  if (!datasource) {
590
- _context10.next = 32;
590
+ _context0.next = 32;
591
591
  break;
592
592
  }
593
593
  id = datasource.id, parameters = datasource.parameters;
594
- return _context10.abrupt("return", this.transformer.toDatasourceAdf({
594
+ return _context0.abrupt("return", this.transformer.toDatasourceAdf({
595
595
  id: id,
596
596
  parameters: parameters,
597
597
  // in the future when we support multiple views, we will need to pass this in as a parameter
@@ -601,24 +601,24 @@ export var EditorCardProvider = /*#__PURE__*/function () {
601
601
  }]
602
602
  }, url));
603
603
  case 32:
604
- return _context10.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
604
+ return _context0.abrupt("return", this.transformer.toSmartlinkAdf(url, preferredAppearance));
605
605
  case 33:
606
- _context10.next = 38;
606
+ _context0.next = 38;
607
607
  break;
608
608
  case 35:
609
- _context10.prev = 35;
610
- _context10.t1 = _context10["catch"](0);
609
+ _context0.prev = 35;
610
+ _context0.t1 = _context0["catch"](0);
611
611
  // eslint-disable-next-line
612
- console.warn("Error when trying to check Smart Card url \"".concat(url, "\"").concat(_context10.t1 instanceof Error ? " - ".concat(_context10.t1.name, " ").concat(_context10.t1.message) : ''), _context10.t1);
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);
613
613
  case 38:
614
- return _context10.abrupt("return", Promise.reject(undefined));
614
+ return _context0.abrupt("return", Promise.reject(undefined));
615
615
  case 39:
616
616
  case "end":
617
- return _context10.stop();
617
+ return _context0.stop();
618
618
  }
619
- }, _callee10, this, [[0, 35]]);
619
+ }, _callee0, this, [[0, 35]]);
620
620
  }));
621
- function resolve(_x8, _x9, _x10, _x11) {
621
+ function resolve(_x8, _x9, _x0, _x1) {
622
622
  return _resolve.apply(this, arguments);
623
623
  }
624
624
  return resolve;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
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",
@@ -33,19 +33,18 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/eslint-plugin-platform": "^2.5.0",
37
36
  "@atlaskit/feature-gate-js-client": "^5.3.0",
38
37
  "@atlaskit/json-ld-types": "^1.2.0",
39
38
  "@atlaskit/link-client-extension": "^5.0.0",
40
39
  "@atlaskit/link-extractors": "^2.3.0",
41
40
  "@atlaskit/linking-common": "^9.0.0",
42
- "@atlaskit/linking-types": "^9.10.0",
41
+ "@atlaskit/linking-types": "^11.0.0",
43
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
43
  "@babel/runtime": "^7.0.0",
45
44
  "dataloader": "^2.1.0"
46
45
  },
47
46
  "peerDependencies": {
48
- "@atlaskit/link-provider": "^3.0.0",
47
+ "@atlaskit/link-provider": "^3.3.0",
49
48
  "react": "^18.2.0"
50
49
  },
51
50
  "devDependencies": {
@@ -71,5 +70,6 @@
71
70
  "jira_nin_smart_link": {
72
71
  "type": "boolean"
73
72
  }
74
- }
73
+ },
74
+ "compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/e145f3e3-514b-410f-a274-a92e6e6f9c47"
75
75
  }