@atlaskit/smart-card 26.14.5 → 26.15.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 (84) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/constants.js +2 -0
  3. package/dist/cjs/extractors/flexible/index.js +1 -0
  4. package/dist/cjs/extractors/flexible/utils.js +6 -2
  5. package/dist/cjs/i18n/en.js +8 -1
  6. package/dist/cjs/i18n/en_GB.js +8 -1
  7. package/dist/cjs/i18n/en_ZZ.js +8 -1
  8. package/dist/cjs/utils/index.js +46 -5
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/cjs/view/BlockCard/actions/DownloadAction.js +4 -34
  11. package/dist/cjs/view/BlockCard/views/flexible/utils.js +14 -2
  12. package/dist/cjs/view/FlexibleCard/components/actions/action/download-action/index.js +2 -47
  13. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
  14. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +4 -0
  15. package/dist/cjs/view/FlexibleCard/components/elements/atlaskit-badge/index.js +37 -0
  16. package/dist/cjs/view/FlexibleCard/components/elements/atlaskit-badge/types.js +5 -0
  17. package/dist/cjs/view/FlexibleCard/components/elements/index.js +8 -2
  18. package/dist/cjs/view/FlexibleCard/components/elements/utils.js +11 -1
  19. package/dist/cjs/view/HoverCard/utils.js +1 -1
  20. package/dist/es2019/constants.js +2 -0
  21. package/dist/es2019/extractors/flexible/index.js +2 -1
  22. package/dist/es2019/extractors/flexible/utils.js +3 -0
  23. package/dist/es2019/i18n/en.js +8 -1
  24. package/dist/es2019/i18n/en_GB.js +8 -1
  25. package/dist/es2019/i18n/en_ZZ.js +8 -1
  26. package/dist/es2019/utils/index.js +23 -0
  27. package/dist/es2019/version.json +1 -1
  28. package/dist/es2019/view/BlockCard/actions/DownloadAction.js +2 -12
  29. package/dist/es2019/view/BlockCard/views/flexible/utils.js +14 -2
  30. package/dist/es2019/view/FlexibleCard/components/actions/action/download-action/index.js +2 -28
  31. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +1 -0
  32. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +2 -1
  33. package/dist/es2019/view/FlexibleCard/components/elements/atlaskit-badge/index.js +28 -0
  34. package/dist/es2019/view/FlexibleCard/components/elements/atlaskit-badge/types.js +1 -0
  35. package/dist/es2019/view/FlexibleCard/components/elements/index.js +5 -0
  36. package/dist/es2019/view/FlexibleCard/components/elements/utils.js +12 -1
  37. package/dist/es2019/view/HoverCard/utils.js +1 -1
  38. package/dist/esm/constants.js +2 -0
  39. package/dist/esm/extractors/flexible/index.js +2 -1
  40. package/dist/esm/extractors/flexible/utils.js +3 -0
  41. package/dist/esm/i18n/en.js +8 -1
  42. package/dist/esm/i18n/en_GB.js +8 -1
  43. package/dist/esm/i18n/en_ZZ.js +8 -1
  44. package/dist/esm/utils/index.js +44 -4
  45. package/dist/esm/version.json +1 -1
  46. package/dist/esm/view/BlockCard/actions/DownloadAction.js +4 -33
  47. package/dist/esm/view/BlockCard/views/flexible/utils.js +14 -2
  48. package/dist/esm/view/FlexibleCard/components/actions/action/download-action/index.js +2 -47
  49. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
  50. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +2 -0
  51. package/dist/esm/view/FlexibleCard/components/elements/atlaskit-badge/index.js +28 -0
  52. package/dist/esm/view/FlexibleCard/components/elements/atlaskit-badge/types.js +1 -0
  53. package/dist/esm/view/FlexibleCard/components/elements/index.js +5 -0
  54. package/dist/esm/view/FlexibleCard/components/elements/utils.js +11 -1
  55. package/dist/esm/view/HoverCard/utils.js +1 -1
  56. package/dist/types/constants.d.ts +3 -1
  57. package/dist/types/extractors/flexible/utils.d.ts +1 -0
  58. package/dist/types/i18n/en.d.ts +7 -0
  59. package/dist/types/i18n/en_GB.d.ts +7 -0
  60. package/dist/types/i18n/en_ZZ.d.ts +7 -0
  61. package/dist/types/state/flexible-ui-context/types.d.ts +6 -0
  62. package/dist/types/utils/index.d.ts +1 -0
  63. package/dist/types/view/BlockCard/actions/DownloadAction.d.ts +0 -4
  64. package/dist/types/view/FlexibleCard/components/actions/action/download-action/types.d.ts +0 -3
  65. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +8 -2
  66. package/dist/types/view/FlexibleCard/components/elements/atlaskit-badge/index.d.ts +10 -0
  67. package/dist/types/view/FlexibleCard/components/elements/atlaskit-badge/types.d.ts +4 -0
  68. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +6 -0
  69. package/dist/types-ts4.5/constants.d.ts +3 -1
  70. package/dist/types-ts4.5/extractors/flexible/utils.d.ts +1 -0
  71. package/dist/types-ts4.5/i18n/en.d.ts +7 -0
  72. package/dist/types-ts4.5/i18n/en_GB.d.ts +7 -0
  73. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +7 -0
  74. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +6 -0
  75. package/dist/types-ts4.5/utils/index.d.ts +1 -0
  76. package/dist/types-ts4.5/view/BlockCard/actions/DownloadAction.d.ts +0 -4
  77. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/download-action/types.d.ts +0 -3
  78. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +8 -2
  79. package/dist/types-ts4.5/view/FlexibleCard/components/elements/atlaskit-badge/index.d.ts +10 -0
  80. package/dist/types-ts4.5/view/FlexibleCard/components/elements/atlaskit-badge/types.d.ts +4 -0
  81. package/dist/types-ts4.5/view/FlexibleCard/components/elements/index.d.ts +6 -0
  82. package/package.json +2 -2
  83. package/report.api.md +8 -0
  84. package/tmp/api-report-tmp.d.ts +8 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`560f5be1d2c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/560f5be1d2c) - Add FlexUI element for dispalying StoryPoints as a Badge
8
+
9
+ ## 26.14.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`88b90baf84c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/88b90baf84c) - Update icon for SubTasksProgress flex ui element & update metadata elements order in Block & Hover Card
14
+ - [`e6d7b777ce0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6d7b777ce0) - Remove dependency to @atlaskit/media-common
15
+
3
16
  ## 26.14.5
4
17
 
5
18
  ### Patch Changes
@@ -136,6 +136,7 @@ var ElementName = /*#__PURE__*/function (ElementName) {
136
136
  ElementName["State"] = "State";
137
137
  ElementName["SubscriberCount"] = "SubscriberCount";
138
138
  ElementName["SubTasksProgress"] = "SubTasksProgress";
139
+ ElementName["StoryPoints"] = "StoryPoints";
139
140
  ElementName["TargetBranch"] = "TargetBranch";
140
141
  ElementName["Title"] = "Title";
141
142
  ElementName["ViewCount"] = "ViewCount";
@@ -222,6 +223,7 @@ var IconType = /*#__PURE__*/function (IconType) {
222
223
  IconType["PriorityUndefined"] = "Badge:PriorityUndefined";
223
224
  IconType["ProgrammingLanguage"] = "Badge:ProgrammingLanguage";
224
225
  IconType["Subscriber"] = "Badge:Subscriber";
226
+ IconType["SubTasksProgress"] = "Badge:SubTask";
225
227
  return IconType;
226
228
  }({});
227
229
  /**
@@ -66,6 +66,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
66
66
  state: (0, _extractState.default)(response, showServerActions || showLozengeAction, id),
67
67
  subscriberCount: (0, _utils.extractSubscriberCount)(data),
68
68
  subTasksProgress: (0, _utils.extractSubTasksProgress)(data),
69
+ storyPoints: (0, _utils.extractStoryPoints)(data),
69
70
  targetBranch: (0, _utils.extractTargetBranch)(data),
70
71
  title: (0, _linkExtractors.extractTitle)(data) || url,
71
72
  url: url
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.extractVoteCount = exports.extractViewCount = exports.extractTargetBranch = exports.extractSubscriberCount = exports.extractSubTasksProgress = exports.extractSourceBranch = exports.extractReadTime = exports.extractReactCount = exports.extractProgrammingLanguage = exports.extractPersonAssignedToAsArray = exports.extractOwnedBy = exports.extractModifiedBy = exports.extractLocation = exports.extractDueOn = exports.extractCreatedBy = exports.extractCommentCount = exports.extractChecklistProgress = exports.extractAttachmentCount = exports.extractAssignedTo = void 0;
7
+ exports.extractVoteCount = exports.extractViewCount = exports.extractTargetBranch = exports.extractSubscriberCount = exports.extractSubTasksProgress = exports.extractStoryPoints = exports.extractSourceBranch = exports.extractReadTime = exports.extractReactCount = exports.extractProgrammingLanguage = exports.extractPersonAssignedToAsArray = exports.extractOwnedBy = exports.extractModifiedBy = exports.extractLocation = exports.extractDueOn = exports.extractCreatedBy = exports.extractCommentCount = exports.extractChecklistProgress = exports.extractAttachmentCount = exports.extractAssignedTo = void 0;
8
8
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
9
  var _linkExtractors = require("@atlaskit/link-extractors");
10
10
  var extractLinkName = function extractLinkName(link) {
@@ -113,4 +113,8 @@ exports.extractSubTasksProgress = extractSubTasksProgress;
113
113
  var extractReadTime = function extractReadTime(data) {
114
114
  return extractValue(data, 'atlassian:readTimeInMinutes');
115
115
  };
116
- exports.extractReadTime = extractReadTime;
116
+ exports.extractReadTime = extractReadTime;
117
+ var extractStoryPoints = function extractStoryPoints(data) {
118
+ return extractValue(data, 'atlassian:storyPoints');
119
+ };
120
+ exports.extractStoryPoints = extractStoryPoints;
@@ -15,6 +15,7 @@ exports.default = void 0;
15
15
  var _default = {
16
16
  'fabric.linking.actions': 'Actions',
17
17
  'fabric.linking.add_account': 'Add account',
18
+ 'fabric.linking.assigned_to': 'Assigned to {context}',
18
19
  'fabric.linking.cancel': 'Cancel',
19
20
  'fabric.linking.cannot_connect': "Can't connect, try again",
20
21
  'fabric.linking.cannot_find_link': "Can't find link",
@@ -29,7 +30,8 @@ var _default = {
29
30
  'fabric.linking.connect_link_account_card_view_name': 'Connect your {context} account',
30
31
  'fabric.linking.connect_to': 'Connect to {name}',
31
32
  'fabric.linking.connect_unauthorised_account_action': 'Connect to {context}',
32
- 'fabric.linking.connect_unauthorised_account_description': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
33
+ 'fabric.linking.connect_unauthorised_account_description': 'Connect {context} to Atlassian to view more details of your work and collaborate from one place.',
34
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
33
35
  'fabric.linking.continue': 'Continue',
34
36
  'fabric.linking.copy_url_to_clipboard': 'Copy link',
35
37
  'fabric.linking.couldnt_load_link': "We couldn't load this link for an unknown reason.",
@@ -73,6 +75,7 @@ var _default = {
73
75
  'fabric.linking.priority_minor': 'Minor',
74
76
  'fabric.linking.priority_trivial': 'Trivial',
75
77
  'fabric.linking.priority_undefined': 'Undefined',
78
+ 'fabric.linking.read_time': '{context} min read',
76
79
  'fabric.linking.request_access': 'Request access',
77
80
  'fabric.linking.request_access_description': 'Request access to {context} view this preview.',
78
81
  'fabric.linking.request_access_pending': 'Access pending',
@@ -90,6 +93,10 @@ var _default = {
90
93
  'fabric.linking.status_change_update_error': 'We couldn’t update the status',
91
94
  'fabric.linking.try_again': 'Try again',
92
95
  'fabric.linking.try_another_account': 'Try another account',
96
+ 'fabric.linking.unauthorised_account_description': "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
97
+ 'fabric.linking.unauthorised_account_description_no_provider': "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
98
+ 'fabric.linking.unauthorised_account_name': "We can't display private pages from {context}",
99
+ 'fabric.linking.unauthorised_account_name_no_provider': "We can't display private pages",
93
100
  'fabric.linking.unlink_account': 'Unlink Account',
94
101
  'fabric.linking.updated_by': 'Modified by {context}',
95
102
  'fabric.linking.view': 'View'
@@ -15,6 +15,7 @@ exports.default = void 0;
15
15
  var _default = {
16
16
  'fabric.linking.actions': 'Actions',
17
17
  'fabric.linking.add_account': 'Add account',
18
+ 'fabric.linking.assigned_to': 'Assigned to {context}',
18
19
  'fabric.linking.cancel': 'Cancel',
19
20
  'fabric.linking.cannot_connect': "Can't connect, try again",
20
21
  'fabric.linking.cannot_find_link': "Can't find link",
@@ -29,7 +30,8 @@ var _default = {
29
30
  'fabric.linking.connect_link_account_card_view_name': 'Connect your {context} account',
30
31
  'fabric.linking.connect_to': 'Connect to {name}',
31
32
  'fabric.linking.connect_unauthorised_account_action': 'Connect to {context}',
32
- 'fabric.linking.connect_unauthorised_account_description': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
33
+ 'fabric.linking.connect_unauthorised_account_description': 'Connect {context} to Atlassian to view more details of your work and collaborate from one place.',
34
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': 'Connect to Atlassian to view more details of your work and collaborate from one place.',
33
35
  'fabric.linking.continue': 'Continue',
34
36
  'fabric.linking.copy_url_to_clipboard': 'Copy link',
35
37
  'fabric.linking.couldnt_load_link': "We couldn't load this link for an unknown reason.",
@@ -73,6 +75,7 @@ var _default = {
73
75
  'fabric.linking.priority_minor': 'Minor',
74
76
  'fabric.linking.priority_trivial': 'Trivial',
75
77
  'fabric.linking.priority_undefined': 'Undefined',
78
+ 'fabric.linking.read_time': '{context} min read',
76
79
  'fabric.linking.request_access': 'Request access',
77
80
  'fabric.linking.request_access_description': 'Request access to {context} view this preview.',
78
81
  'fabric.linking.request_access_pending': 'Access pending',
@@ -90,6 +93,10 @@ var _default = {
90
93
  'fabric.linking.status_change_update_error': 'We couldn’t update the status',
91
94
  'fabric.linking.try_again': 'Try again',
92
95
  'fabric.linking.try_another_account': 'Try another account',
96
+ 'fabric.linking.unauthorised_account_description': "You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.",
97
+ 'fabric.linking.unauthorised_account_description_no_provider': "You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.",
98
+ 'fabric.linking.unauthorised_account_name': "We can't display private pages from {context}",
99
+ 'fabric.linking.unauthorised_account_name_no_provider': "We can't display private pages",
93
100
  'fabric.linking.unlink_account': 'Unlink Account',
94
101
  'fabric.linking.updated_by': 'Modified by {context}',
95
102
  'fabric.linking.view': 'View'
@@ -15,6 +15,7 @@ exports.default = void 0;
15
15
  var _default = {
16
16
  'fabric.linking.actions': '⁣⁢Actions؜‌‌⁠‌⁡‌‌؜⁣⁤',
17
17
  'fabric.linking.add_account': '⁣⁢Add account‌‍‌⁡⁠⁠‌‌⁡‌⁠⁣⁤',
18
+ 'fabric.linking.assigned_to': '⁣⁢Assigned to {context}؜‌‍‍⁡؜؜‌‌‍⁡‍⁠⁠؜⁣⁤',
18
19
  'fabric.linking.cancel': '⁣⁢Cancel؜⁡‌‌؜⁡‌‌⁠‍‍‍⁣⁤',
19
20
  'fabric.linking.cannot_connect': "⁣⁢Can't connect, try again‌‍‍⁡؜؜⁡‌⁡⁣⁤",
20
21
  'fabric.linking.cannot_find_link': "⁣⁢Can't find link⁡‌‌‌‌⁡‍⁡⁣⁤",
@@ -29,7 +30,8 @@ var _default = {
29
30
  'fabric.linking.connect_link_account_card_view_name': '⁣⁢Connect your {context} account‍؜⁡‌⁠⁡؜‍‍⁠⁡⁠‌⁣⁤',
30
31
  'fabric.linking.connect_to': '⁣⁢Connect to {name}؜‌؜⁡‌؜‍⁡‌‍⁣⁤',
31
32
  'fabric.linking.connect_unauthorised_account_action': '⁣⁢Connect to {context}‌⁠⁠⁡‌؜‌؜⁣⁤',
32
- 'fabric.linking.connect_unauthorised_account_description': '⁣⁢Connect to Atlassian to view more details of your work and collaborate from one place.⁠⁡؜⁡؜⁡⁡‌؜‍؜‌‍⁣⁤',
33
+ 'fabric.linking.connect_unauthorised_account_description': '⁣⁢Connect {context} to Atlassian to view more details of your work and collaborate from one place.؜‍‍‍؜؜‍‌‍‌⁣⁤',
34
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': '⁣⁢Connect to Atlassian to view more details of your work and collaborate from one place.⁠‌⁠‍⁠‍‌‌⁡‍⁡⁡⁣⁤',
33
35
  'fabric.linking.continue': '⁣⁢Continue‌؜⁡؜⁠⁡⁠‌؜⁠⁣⁤',
34
36
  'fabric.linking.copy_url_to_clipboard': '⁣⁢Copy link⁡‍⁠‍‌‍⁡⁠⁣⁤',
35
37
  'fabric.linking.couldnt_load_link': "⁣⁢We couldn't load this link for an unknown reason.؜‍⁡⁡؜‌‌؜⁡؜⁣⁤",
@@ -73,6 +75,7 @@ var _default = {
73
75
  'fabric.linking.priority_minor': '⁣⁢Minor⁠⁠‍؜‍⁠⁣⁤',
74
76
  'fabric.linking.priority_trivial': '⁣⁢Trivial⁡‌⁠؜؜‍؜⁡⁡⁠⁡⁡⁡⁣⁤',
75
77
  'fabric.linking.priority_undefined': '⁣⁢Undefined⁠⁡⁡؜‌⁡⁠‍⁠⁡⁠⁣⁤',
78
+ 'fabric.linking.read_time': '⁣⁢{context} min read؜‍⁠؜‌⁠⁠⁣⁤',
76
79
  'fabric.linking.request_access': '⁣⁢Request access؜‌؜‌‍‌‌⁠⁡⁣⁤',
77
80
  'fabric.linking.request_access_description': '⁣⁢Request access to {context} view this preview.؜‌‌⁡‌‍‌‍⁣⁤',
78
81
  'fabric.linking.request_access_pending': '⁣⁢Access pending؜؜⁠؜؜؜⁠‌‍؜؜‌؜⁣⁤',
@@ -90,6 +93,10 @@ var _default = {
90
93
  'fabric.linking.status_change_update_error': '⁣⁢We couldn’t update the status⁠‌⁠‍⁠‍‍⁡⁠‍‌⁠⁡‌‍⁣⁤',
91
94
  'fabric.linking.try_again': '⁣⁢Try again؜؜؜⁠‍⁠‌⁡‌⁣⁤',
92
95
  'fabric.linking.try_another_account': '⁣⁢Try another account؜‌؜؜‍‍؜‌⁠⁠⁠⁠⁣⁤',
96
+ 'fabric.linking.unauthorised_account_description': "⁣⁢You're trying to preview a link to a private {context} page. We recommend you review the URL or contact the page owner.؜‌؜‍⁣⁤",
97
+ 'fabric.linking.unauthorised_account_description_no_provider': "⁣⁢You're trying to preview a link to a private page. We recommend you review the URL or contact the page owner.⁡⁠‌⁠‌‌‍⁣⁤",
98
+ 'fabric.linking.unauthorised_account_name': "⁣⁢We can't display private pages from {context}‌؜‍⁠‌⁡؜⁠‍⁣⁤",
99
+ 'fabric.linking.unauthorised_account_name_no_provider': "⁣⁢We can't display private pages‌⁡؜⁠؜‌؜‌⁡⁠⁣⁤",
93
100
  'fabric.linking.unlink_account': '⁣⁢Unlink Account⁠⁡⁡‌⁡⁣⁤',
94
101
  'fabric.linking.updated_by': '⁣⁢Modified by {context}؜⁠‍‍⁡⁡‌⁡‌⁣⁤',
95
102
  'fabric.linking.view': '⁣⁢View⁡‍⁠‍⁠؜؜⁠⁡؜‌‌⁣⁤'
@@ -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.sleep = exports.openUrl = exports.isSpecialKey = exports.isSpecialEvent = exports.isSpecialClick = exports.isIntersectionObserverSupported = exports.isIframe = exports.isCardWithData = exports.importWithRetry = exports.handleOnClick = exports.getLabelForFileType = exports.getIframeSandboxAttribute = exports.getIconForFileType = void 0;
8
+ exports.sleep = exports.openUrl = exports.isSpecialKey = exports.isSpecialEvent = exports.isSpecialClick = exports.isIntersectionObserverSupported = exports.isIframe = exports.isCardWithData = exports.importWithRetry = exports.handleOnClick = exports.getLabelForFileType = exports.getIframeSandboxAttribute = exports.getIconForFileType = exports.downloadUrl = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -398,8 +398,9 @@ var importWithRetry = /*#__PURE__*/function () {
398
398
  };
399
399
  }();
400
400
  exports.importWithRetry = importWithRetry;
401
- var openUrl = /*#__PURE__*/function () {
401
+ var downloadUrl = /*#__PURE__*/function () {
402
402
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(url) {
403
+ var isIE11, isSafari, iframeName, link, iframe;
403
404
  return _regenerator.default.wrap(function _callee2$(_context2) {
404
405
  while (1) switch (_context2.prev = _context2.next) {
405
406
  case 0:
@@ -409,15 +410,55 @@ var openUrl = /*#__PURE__*/function () {
409
410
  }
410
411
  return _context2.abrupt("return");
411
412
  case 2:
412
- window.open(url, '_blank', 'noopener=yes');
413
- case 3:
413
+ isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
414
+ isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
415
+ iframeName = 'media-download-iframe';
416
+ link = document.createElement('a');
417
+ iframe = document.getElementById(iframeName);
418
+ if (!iframe) {
419
+ iframe = document.createElement('iframe');
420
+ iframe.style.display = 'none';
421
+ iframe.id = iframeName;
422
+ iframe.name = iframeName;
423
+ document.body.appendChild(iframe);
424
+ }
425
+ link.href = url;
426
+ link.download = url;
427
+ link.target = isIE11 || isSafari ? '_blank' : iframeName;
428
+ document.body.appendChild(link);
429
+ link.click();
430
+ document.body.removeChild(link);
431
+ case 14:
414
432
  case "end":
415
433
  return _context2.stop();
416
434
  }
417
435
  }, _callee2);
418
436
  }));
419
- return function openUrl(_x2) {
437
+ return function downloadUrl(_x2) {
420
438
  return _ref2.apply(this, arguments);
421
439
  };
422
440
  }();
441
+ exports.downloadUrl = downloadUrl;
442
+ var openUrl = /*#__PURE__*/function () {
443
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(url) {
444
+ return _regenerator.default.wrap(function _callee3$(_context3) {
445
+ while (1) switch (_context3.prev = _context3.next) {
446
+ case 0:
447
+ if (url) {
448
+ _context3.next = 2;
449
+ break;
450
+ }
451
+ return _context3.abrupt("return");
452
+ case 2:
453
+ window.open(url, '_blank', 'noopener=yes');
454
+ case 3:
455
+ case "end":
456
+ return _context3.stop();
457
+ }
458
+ }, _callee3);
459
+ }));
460
+ return function openUrl(_x3) {
461
+ return _ref3.apply(this, arguments);
462
+ };
463
+ }();
423
464
  exports.openUrl = openUrl;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.5",
3
+ "version": "26.15.0",
4
4
  "sideEffects": false
5
5
  }
@@ -5,47 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.DownloadAction = void 0;
8
- exports.downloadFunction = downloadFunction;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
8
  var _react = _interopRequireDefault(require("react"));
12
9
  var _reactIntlNext = require("react-intl-next");
13
- var _mediaCommon = require("@atlaskit/media-common");
14
10
  var _messages = require("../../../messages");
15
- function downloadFunction(_x) {
16
- return _downloadFunction.apply(this, arguments);
17
- }
18
- function _downloadFunction() {
19
- _downloadFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
20
- var url;
21
- return _regenerator.default.wrap(function _callee$(_context) {
22
- while (1) switch (_context.prev = _context.next) {
23
- case 0:
24
- url = _ref.url;
25
- if (url) {
26
- _context.next = 3;
27
- break;
28
- }
29
- return _context.abrupt("return");
30
- case 3:
31
- (0, _mediaCommon.downloadUrl)(url);
32
- case 4:
33
- case "end":
34
- return _context.stop();
35
- }
36
- }, _callee);
37
- }));
38
- return _downloadFunction.apply(this, arguments);
39
- }
40
- var DownloadAction = function DownloadAction(_ref2) {
41
- var url = _ref2.url;
11
+ var _utils = require("../../../utils");
12
+ var DownloadAction = function DownloadAction(_ref) {
13
+ var url = _ref.url;
42
14
  return {
43
15
  id: 'download-content',
44
16
  text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.download),
45
17
  promise: function promise() {
46
- return downloadFunction({
47
- url: url
48
- });
18
+ return (0, _utils.downloadUrl)(url);
49
19
  }
50
20
  };
51
21
  };
@@ -64,8 +64,20 @@ var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(cardDetails
64
64
  name: _constants.ElementName.AssignedToGroup
65
65
  }, {
66
66
  name: _constants.ElementName.AssignedTo
67
- }].concat(baseTopMetadata) : defaultTopMetadata,
68
- bottomMetadata: defaultBottomMetadata
67
+ }, {
68
+ name: _constants.ElementName.ModifiedOn
69
+ }] : [{
70
+ name: _constants.ElementName.AuthorGroup
71
+ }, {
72
+ name: _constants.ElementName.CreatedBy
73
+ }, {
74
+ name: _constants.ElementName.ModifiedOn
75
+ }],
76
+ bottomMetadata: [{
77
+ name: _constants.ElementName.Priority
78
+ }, {
79
+ name: _constants.ElementName.SubTasksProgress
80
+ }]
69
81
  };
70
82
  default:
71
83
  return {
@@ -5,12 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
10
  var _react = _interopRequireDefault(require("react"));
13
11
  var _index = _interopRequireDefault(require("../index"));
12
+ var _utils = require("../../../../../../utils");
14
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
15
  var DownloadAction = function DownloadAction(props) {
@@ -23,9 +22,7 @@ var DownloadAction = function DownloadAction(props) {
23
22
  if (downloadUrl && url) {
24
23
  var action = _objectSpread(_objectSpread({}, props), {}, {
25
24
  onClick: function onClick() {
26
- downloadFunction({
27
- url: downloadUrl
28
- });
25
+ (0, _utils.downloadUrl)(downloadUrl);
29
26
  if (_onClick) {
30
27
  _onClick();
31
28
  }
@@ -40,47 +37,5 @@ var DownloadAction = function DownloadAction(props) {
40
37
  return null;
41
38
  }
42
39
  };
43
- function downloadFunction(_x) {
44
- return _downloadFunction.apply(this, arguments);
45
- }
46
- function _downloadFunction() {
47
- _downloadFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
48
- var url, isIE11, isSafari, iframeName, link, iframe;
49
- return _regenerator.default.wrap(function _callee$(_context) {
50
- while (1) switch (_context.prev = _context.next) {
51
- case 0:
52
- url = _ref.url;
53
- if (url) {
54
- _context.next = 3;
55
- break;
56
- }
57
- return _context.abrupt("return");
58
- case 3:
59
- isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
60
- isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
61
- iframeName = 'media-download-iframe';
62
- link = document.createElement('a');
63
- iframe = document.getElementById(iframeName);
64
- if (!iframe) {
65
- iframe = document.createElement('iframe');
66
- iframe.style.display = 'none';
67
- iframe.id = iframeName;
68
- iframe.name = iframeName;
69
- document.body.appendChild(iframe);
70
- }
71
- link.href = url;
72
- link.download = url;
73
- link.target = isIE11 || isSafari ? '_blank' : iframeName;
74
- document.body.appendChild(link);
75
- link.click();
76
- document.body.removeChild(link);
77
- case 15:
78
- case "end":
79
- return _context.stop();
80
- }
81
- }, _callee);
82
- }));
83
- return _downloadFunction.apply(this, arguments);
84
- }
85
40
  var _default = DownloadAction;
86
41
  exports.default = _default;
@@ -24,7 +24,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
24
24
  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; }
25
25
  // Determine whether the element can be display as inline/block.
26
26
 
27
- var ElementDisplaySchema = (_ElementDisplaySchema = {}, (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AssignedTo, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AssignedToGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AttachmentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AuthorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ChecklistProgress, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CollaboratorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CommentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.DueOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LatestCommit, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LinkIcon, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Location, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.OwnedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.OwnedByGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Preview, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Priority, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ProgrammingLanguage, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Provider, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ReactCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ReadTime, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Snippet, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SourceBranch, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.State, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubscriberCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubTasksProgress, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.TargetBranch, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Title, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ViewCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.VoteCount, ['inline']), _ElementDisplaySchema);
27
+ var ElementDisplaySchema = (_ElementDisplaySchema = {}, (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AssignedTo, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AssignedToGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AttachmentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AuthorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ChecklistProgress, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CollaboratorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CommentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.DueOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LatestCommit, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LinkIcon, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Location, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.OwnedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.OwnedByGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Preview, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Priority, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ProgrammingLanguage, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Provider, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ReactCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ReadTime, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Snippet, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SourceBranch, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.State, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubscriberCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubTasksProgress, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.StoryPoints, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.TargetBranch, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Title, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ViewCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.VoteCount, ['inline']), _ElementDisplaySchema);
28
28
  exports.ElementDisplaySchema = ElementDisplaySchema;
29
29
  var getDirectionStyles = function getDirectionStyles(direction) {
30
30
  switch (direction) {
@@ -267,6 +267,10 @@ var importIconMapper = (_importIconMapper = {}, (0, _defineProperty2.default)(_i
267
267
  return Promise.resolve().then(function () {
268
268
  return _interopRequireWildcard(require( /* webpackChunkName: "glyphSubscriber" */'@atlaskit/icon/glyph/people'));
269
269
  });
270
+ }), (0, _defineProperty2.default)(_importIconMapper, _constants.IconType.SubTasksProgress, function () {
271
+ return Promise.resolve().then(function () {
272
+ return _interopRequireWildcard(require( /* webpackChunkName: "glyphSubtask" */'@atlaskit/icon/glyph/subtask'));
273
+ });
270
274
  }), _importIconMapper);
271
275
  var getIconImportFn = function getIconImportFn(icon) {
272
276
  return importIconMapper[icon];
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _badge = _interopRequireDefault(require("@atlaskit/badge"));
10
+ var _react2 = require("@emotion/react");
11
+ /** @jsx jsx */
12
+
13
+ /**
14
+ * A base element that displays a visual indicator for a numeric value
15
+ * @internal
16
+ * @see StoryPoints
17
+ * */
18
+
19
+ var AtlaskitBadge = function AtlaskitBadge(_ref) {
20
+ var value = _ref.value,
21
+ name = _ref.name,
22
+ overrideCss = _ref.overrideCss,
23
+ _ref$testId = _ref.testId,
24
+ testId = _ref$testId === void 0 ? 'smart-element-atlaskit-badge' : _ref$testId;
25
+ if (!value) {
26
+ return null;
27
+ }
28
+ return (0, _react2.jsx)("span", {
29
+ css: overrideCss,
30
+ "data-fit-to-content": true,
31
+ "data-smart-element": name,
32
+ "data-smart-element-atlaskit-badge": true,
33
+ "data-testid": testId
34
+ }, (0, _react2.jsx)(_badge.default, null, value));
35
+ };
36
+ var _default = AtlaskitBadge;
37
+ exports.default = _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.VoteCount = exports.ViewCount = exports.Title = exports.TargetBranch = exports.SubscriberCount = exports.SubTasksProgress = exports.State = exports.SourceBranch = exports.Snippet = exports.ReadTime = exports.ReactCount = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.Preview = exports.OwnedByGroup = exports.OwnedBy = exports.ModifiedOn = exports.ModifiedBy = exports.Location = exports.LinkIcon = exports.LatestCommit = exports.DueOn = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.ChecklistProgress = exports.AuthorGroup = exports.AttachmentCount = exports.AssignedToGroup = exports.AssignedTo = void 0;
6
+ exports.VoteCount = exports.ViewCount = exports.Title = exports.TargetBranch = exports.SubscriberCount = exports.SubTasksProgress = exports.StoryPoints = exports.State = exports.SourceBranch = exports.Snippet = exports.ReadTime = exports.ReactCount = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.Preview = exports.OwnedByGroup = exports.OwnedBy = exports.ModifiedOn = exports.ModifiedBy = exports.Location = exports.LinkIcon = exports.LatestCommit = exports.DueOn = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.ChecklistProgress = exports.AuthorGroup = exports.AttachmentCount = exports.AssignedToGroup = exports.AssignedTo = void 0;
7
7
  var _utils = require("./utils");
8
8
  var _constants = require("../../../../constants");
9
9
  // Attention: Keep the export name and element name the same.
@@ -175,11 +175,17 @@ var SubscriberCount = (0, _utils.createElement)(_constants.ElementName.Subscribe
175
175
  */
176
176
  exports.SubscriberCount = SubscriberCount;
177
177
  var SubTasksProgress = (0, _utils.createElement)(_constants.ElementName.SubTasksProgress);
178
+ /**
179
+ * Create a StoryPoints Badge element using the data from storyPoints in the Flexible UI Context.
180
+ * @see AtlaskitBadge
181
+ */
182
+ exports.SubTasksProgress = SubTasksProgress;
183
+ var StoryPoints = (0, _utils.createElement)(_constants.ElementName.StoryPoints);
178
184
  /**
179
185
  * Creates a TargetBranch Text element using the data from targetBranch in the Flexible UI Context.
180
186
  * @see Text
181
187
  */
182
- exports.SubTasksProgress = SubTasksProgress;
188
+ exports.StoryPoints = StoryPoints;
183
189
  var TargetBranch = (0, _utils.createElement)(_constants.ElementName.TargetBranch);
184
190
  /**
185
191
  * Creates a Title Link element using the data from Title in the Flexible UI Context.
@@ -25,6 +25,7 @@ var _text = _interopRequireDefault(require("./text"));
25
25
  var _messages = require("../../../../messages");
26
26
  var _dateTime = _interopRequireDefault(require("./date-time"));
27
27
  var _token = require("../../../../utils/token");
28
+ var _atlaskitBadge = _interopRequireDefault(require("./atlaskit-badge"));
28
29
  var _templateObject, _elementMappings;
29
30
  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); }
30
31
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
@@ -119,8 +120,10 @@ var elementMappings = (_elementMappings = {}, (0, _defineProperty2.default)(_ele
119
120
  }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.SubTasksProgress, {
120
121
  component: _badge.default,
121
122
  props: {
122
- icon: _constants.IconType.CheckItem
123
+ icon: _constants.IconType.SubTasksProgress
123
124
  }
125
+ }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.StoryPoints, {
126
+ component: _atlaskitBadge.default
124
127
  }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.TargetBranch, {
125
128
  component: _text.default
126
129
  }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.Title, {
@@ -158,6 +161,8 @@ var getData = function getData(elementName, contextKey, context) {
158
161
  case _constants.ElementName.LatestCommit:
159
162
  case _constants.ElementName.SubTasksProgress:
160
163
  return toBadgeProps(data);
164
+ case _constants.ElementName.StoryPoints:
165
+ return toAtlaskitBadgeProps(data);
161
166
  case _constants.ElementName.CreatedBy:
162
167
  return toFormattedTextProps(_messages.messages.created_by, context.createdBy);
163
168
  case _constants.ElementName.AssignedTo:
@@ -194,6 +199,11 @@ var toBadgeProps = function toBadgeProps(label) {
194
199
  label: label
195
200
  } : undefined;
196
201
  };
202
+ var toAtlaskitBadgeProps = function toAtlaskitBadgeProps(value) {
203
+ return value ? {
204
+ value: value
205
+ } : undefined;
206
+ };
197
207
  var toDateLozengeProps = function toDateLozengeProps(dateString) {
198
208
  if (dateString) {
199
209
  var text = Date.parse(dateString) ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedDate, {
@@ -131,7 +131,7 @@ var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
131
131
  subtitle: []
132
132
  },
133
133
  bottomMetadataBlock: {
134
- primary: [_constants.ElementName.CommentCount, _constants.ElementName.ReactCount, _constants.ElementName.ViewCount],
134
+ primary: [_constants.ElementName.ReactCount, _constants.ElementName.CommentCount, _constants.ElementName.ViewCount],
135
135
  secondary: [],
136
136
  subtitle: []
137
137
  }
@@ -128,6 +128,7 @@ export let ElementName = /*#__PURE__*/function (ElementName) {
128
128
  ElementName["State"] = "State";
129
129
  ElementName["SubscriberCount"] = "SubscriberCount";
130
130
  ElementName["SubTasksProgress"] = "SubTasksProgress";
131
+ ElementName["StoryPoints"] = "StoryPoints";
131
132
  ElementName["TargetBranch"] = "TargetBranch";
132
133
  ElementName["Title"] = "Title";
133
134
  ElementName["ViewCount"] = "ViewCount";
@@ -215,6 +216,7 @@ export let IconType = /*#__PURE__*/function (IconType) {
215
216
  IconType["PriorityUndefined"] = "Badge:PriorityUndefined";
216
217
  IconType["ProgrammingLanguage"] = "Badge:ProgrammingLanguage";
217
218
  IconType["Subscriber"] = "Badge:Subscriber";
219
+ IconType["SubTasksProgress"] = "Badge:SubTask";
218
220
  return IconType;
219
221
  }({});
220
222
 
@@ -1,6 +1,6 @@
1
1
  import { extractSummary } from '../common/primitives';
2
2
  import { extractLinkIcon } from './icon';
3
- import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn, extractLocation, extractOwnedBy, extractAssignedTo, extractSubTasksProgress, extractReadTime, extractPersonAssignedToAsArray } from './utils';
3
+ import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn, extractLocation, extractOwnedBy, extractAssignedTo, extractSubTasksProgress, extractStoryPoints, extractReadTime, extractPersonAssignedToAsArray } from './utils';
4
4
  import { extractPersonsUpdatedBy } from './collaboratorGroup';
5
5
  import { extractPersonCreatedBy, extractTitle, extractDateUpdated, extractDateCreated, extractLink, extractPersonOwnedBy } from '@atlaskit/link-extractors';
6
6
  import extractPriority from './extract-priority';
@@ -59,6 +59,7 @@ const extractFlexibleUiContext = ({
59
59
  state: extractState(response, showServerActions || showLozengeAction, id),
60
60
  subscriberCount: extractSubscriberCount(data),
61
61
  subTasksProgress: extractSubTasksProgress(data),
62
+ storyPoints: extractStoryPoints(data),
62
63
  targetBranch: extractTargetBranch(data),
63
64
  title: extractTitle(data) || url,
64
65
  url
@@ -67,4 +67,7 @@ export const extractSubTasksProgress = data => {
67
67
  };
68
68
  export const extractReadTime = data => {
69
69
  return extractValue(data, 'atlassian:readTimeInMinutes');
70
+ };
71
+ export const extractStoryPoints = data => {
72
+ return extractValue(data, 'atlassian:storyPoints');
70
73
  };