@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
@@ -1,43 +1,14 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
1
  import React from 'react';
4
2
  import { FormattedMessage } from 'react-intl-next';
5
- import { downloadUrl } from '@atlaskit/media-common';
6
3
  import { messages } from '../../../messages';
7
- export function downloadFunction(_x) {
8
- return _downloadFunction.apply(this, arguments);
9
- }
10
- function _downloadFunction() {
11
- _downloadFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
12
- var url;
13
- return _regeneratorRuntime.wrap(function _callee$(_context) {
14
- while (1) switch (_context.prev = _context.next) {
15
- case 0:
16
- url = _ref.url;
17
- if (url) {
18
- _context.next = 3;
19
- break;
20
- }
21
- return _context.abrupt("return");
22
- case 3:
23
- downloadUrl(url);
24
- case 4:
25
- case "end":
26
- return _context.stop();
27
- }
28
- }, _callee);
29
- }));
30
- return _downloadFunction.apply(this, arguments);
31
- }
32
- export var DownloadAction = function DownloadAction(_ref2) {
33
- var url = _ref2.url;
4
+ import { downloadUrl } from '../../../utils';
5
+ export var DownloadAction = function DownloadAction(_ref) {
6
+ var url = _ref.url;
34
7
  return {
35
8
  id: 'download-content',
36
9
  text: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
37
10
  promise: function promise() {
38
- return downloadFunction({
39
- url: url
40
- });
11
+ return downloadUrl(url);
41
12
  }
42
13
  };
43
14
  };
@@ -58,8 +58,20 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
58
58
  name: ElementName.AssignedToGroup
59
59
  }, {
60
60
  name: ElementName.AssignedTo
61
- }].concat(baseTopMetadata) : defaultTopMetadata,
62
- bottomMetadata: defaultBottomMetadata
61
+ }, {
62
+ name: ElementName.ModifiedOn
63
+ }] : [{
64
+ name: ElementName.AuthorGroup
65
+ }, {
66
+ name: ElementName.CreatedBy
67
+ }, {
68
+ name: ElementName.ModifiedOn
69
+ }],
70
+ bottomMetadata: [{
71
+ name: ElementName.Priority
72
+ }, {
73
+ name: ElementName.SubTasksProgress
74
+ }]
63
75
  };
64
76
  default:
65
77
  return {
@@ -1,11 +1,10 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
1
  import _extends from "@babel/runtime/helpers/extends";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import _regeneratorRuntime from "@babel/runtime/regenerator";
5
3
  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; }
6
4
  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) { _defineProperty(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; }
7
5
  import React from 'react';
8
6
  import Action from '../index';
7
+ import { downloadUrl as download } from '../../../../../../utils';
9
8
  var DownloadAction = function DownloadAction(props) {
10
9
  var appearance = props.appearance,
11
10
  asDropDownItem = props.asDropDownItem,
@@ -16,9 +15,7 @@ var DownloadAction = function DownloadAction(props) {
16
15
  if (downloadUrl && url) {
17
16
  var action = _objectSpread(_objectSpread({}, props), {}, {
18
17
  onClick: function onClick() {
19
- downloadFunction({
20
- url: downloadUrl
21
- });
18
+ download(downloadUrl);
22
19
  if (_onClick) {
23
20
  _onClick();
24
21
  }
@@ -33,46 +30,4 @@ var DownloadAction = function DownloadAction(props) {
33
30
  return null;
34
31
  }
35
32
  };
36
- function downloadFunction(_x) {
37
- return _downloadFunction.apply(this, arguments);
38
- }
39
- function _downloadFunction() {
40
- _downloadFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
41
- var url, isIE11, isSafari, iframeName, link, iframe;
42
- return _regeneratorRuntime.wrap(function _callee$(_context) {
43
- while (1) switch (_context.prev = _context.next) {
44
- case 0:
45
- url = _ref.url;
46
- if (url) {
47
- _context.next = 3;
48
- break;
49
- }
50
- return _context.abrupt("return");
51
- case 3:
52
- isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
53
- isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
54
- iframeName = 'media-download-iframe';
55
- link = document.createElement('a');
56
- iframe = document.getElementById(iframeName);
57
- if (!iframe) {
58
- iframe = document.createElement('iframe');
59
- iframe.style.display = 'none';
60
- iframe.id = iframeName;
61
- iframe.name = iframeName;
62
- document.body.appendChild(iframe);
63
- }
64
- link.href = url;
65
- link.download = url;
66
- link.target = isIE11 || isSafari ? '_blank' : iframeName;
67
- document.body.appendChild(link);
68
- link.click();
69
- document.body.removeChild(link);
70
- case 15:
71
- case "end":
72
- return _context.stop();
73
- }
74
- }, _callee);
75
- }));
76
- return _downloadFunction.apply(this, arguments);
77
- }
78
33
  export default DownloadAction;
@@ -15,7 +15,7 @@ import ElementGroup from './element-group';
15
15
 
16
16
  // Determine whether the element can be display as inline/block.
17
17
 
18
- export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_ElementDisplaySchema, ElementName.AssignedTo, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.AssignedToGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.AttachmentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.AuthorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ChecklistProgress, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CollaboratorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CommentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.DueOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LatestCommit, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LinkIcon, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Location, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.OwnedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.OwnedByGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Preview, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.Priority, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Provider, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ReactCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ReadTime, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Snippet, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.SourceBranch, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.State, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubscriberCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubTasksProgress, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.TargetBranch, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Title, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ViewCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.VoteCount, ['inline']), _ElementDisplaySchema);
18
+ export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_ElementDisplaySchema, ElementName.AssignedTo, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.AssignedToGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.AttachmentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.AuthorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ChecklistProgress, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CollaboratorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CommentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.DueOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LatestCommit, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LinkIcon, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Location, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.OwnedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.OwnedByGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Preview, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.Priority, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Provider, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ReactCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ReadTime, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Snippet, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.SourceBranch, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.State, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubscriberCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubTasksProgress, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.StoryPoints, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.TargetBranch, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Title, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ViewCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.VoteCount, ['inline']), _ElementDisplaySchema);
19
19
  var getDirectionStyles = function getDirectionStyles(direction) {
20
20
  switch (direction) {
21
21
  case SmartLinkDirection.Vertical:
@@ -137,6 +137,8 @@ var importIconMapper = (_importIconMapper = {}, _defineProperty(_importIconMappe
137
137
  return import( /* webpackChunkName: "glyphProgrammingLanguage" */'@atlaskit/icon/glyph/code');
138
138
  }), _defineProperty(_importIconMapper, IconType.Subscriber, function () {
139
139
  return import( /* webpackChunkName: "glyphSubscriber" */'@atlaskit/icon/glyph/people');
140
+ }), _defineProperty(_importIconMapper, IconType.SubTasksProgress, function () {
141
+ return import( /* webpackChunkName: "glyphSubtask" */'@atlaskit/icon/glyph/subtask');
140
142
  }), _importIconMapper);
141
143
  var getIconImportFn = function getIconImportFn(icon) {
142
144
  return importIconMapper[icon];
@@ -0,0 +1,28 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import AKBadge from '@atlaskit/badge';
4
+ import { jsx } from '@emotion/react';
5
+ /**
6
+ * A base element that displays a visual indicator for a numeric value
7
+ * @internal
8
+ * @see StoryPoints
9
+ * */
10
+
11
+ var AtlaskitBadge = function AtlaskitBadge(_ref) {
12
+ var value = _ref.value,
13
+ name = _ref.name,
14
+ overrideCss = _ref.overrideCss,
15
+ _ref$testId = _ref.testId,
16
+ testId = _ref$testId === void 0 ? 'smart-element-atlaskit-badge' : _ref$testId;
17
+ if (!value) {
18
+ return null;
19
+ }
20
+ return jsx("span", {
21
+ css: overrideCss,
22
+ "data-fit-to-content": true,
23
+ "data-smart-element": name,
24
+ "data-smart-element-atlaskit-badge": true,
25
+ "data-testid": testId
26
+ }, jsx(AKBadge, null, value));
27
+ };
28
+ export default AtlaskitBadge;
@@ -142,6 +142,11 @@ export var SubscriberCount = createElement(ElementName.SubscriberCount);
142
142
  * @see Badge
143
143
  */
144
144
  export var SubTasksProgress = createElement(ElementName.SubTasksProgress);
145
+ /**
146
+ * Create a StoryPoints Badge element using the data from storyPoints in the Flexible UI Context.
147
+ * @see AtlaskitBadge
148
+ */
149
+ export var StoryPoints = createElement(ElementName.StoryPoints);
145
150
  /**
146
151
  * Creates a TargetBranch Text element using the data from targetBranch in the Flexible UI Context.
147
152
  * @see Text
@@ -18,6 +18,7 @@ import Text from './text';
18
18
  import { messages } from '../../../../messages';
19
19
  import DateTime from './date-time';
20
20
  import { tokens } from '../../../../utils/token';
21
+ import AtlaskitBadge from './atlaskit-badge';
21
22
  var SNIPPET_DEFAULT_MAX_LINES = 3;
22
23
  var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings, ElementName.AttachmentCount, {
23
24
  component: Badge,
@@ -109,8 +110,10 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
109
110
  }), _defineProperty(_elementMappings, ElementName.SubTasksProgress, {
110
111
  component: Badge,
111
112
  props: {
112
- icon: IconType.CheckItem
113
+ icon: IconType.SubTasksProgress
113
114
  }
115
+ }), _defineProperty(_elementMappings, ElementName.StoryPoints, {
116
+ component: AtlaskitBadge
114
117
  }), _defineProperty(_elementMappings, ElementName.TargetBranch, {
115
118
  component: Text
116
119
  }), _defineProperty(_elementMappings, ElementName.Title, {
@@ -148,6 +151,8 @@ var getData = function getData(elementName, contextKey, context) {
148
151
  case ElementName.LatestCommit:
149
152
  case ElementName.SubTasksProgress:
150
153
  return toBadgeProps(data);
154
+ case ElementName.StoryPoints:
155
+ return toAtlaskitBadgeProps(data);
151
156
  case ElementName.CreatedBy:
152
157
  return toFormattedTextProps(messages.created_by, context.createdBy);
153
158
  case ElementName.AssignedTo:
@@ -184,6 +189,11 @@ var toBadgeProps = function toBadgeProps(label) {
184
189
  label: label
185
190
  } : undefined;
186
191
  };
192
+ var toAtlaskitBadgeProps = function toAtlaskitBadgeProps(value) {
193
+ return value ? {
194
+ value: value
195
+ } : undefined;
196
+ };
187
197
  var toDateLozengeProps = function toDateLozengeProps(dateString) {
188
198
  if (dateString) {
189
199
  var text = Date.parse(dateString) ? /*#__PURE__*/React.createElement(FormattedDate, {
@@ -123,7 +123,7 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
123
123
  subtitle: []
124
124
  },
125
125
  bottomMetadataBlock: {
126
- primary: [ElementName.CommentCount, ElementName.ReactCount, ElementName.ViewCount],
126
+ primary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.ViewCount],
127
127
  secondary: [],
128
128
  subtitle: []
129
129
  }
@@ -112,6 +112,7 @@ export declare enum ElementName {
112
112
  State = "State",
113
113
  SubscriberCount = "SubscriberCount",
114
114
  SubTasksProgress = "SubTasksProgress",
115
+ StoryPoints = "StoryPoints",
115
116
  TargetBranch = "TargetBranch",
116
117
  Title = "Title",
117
118
  ViewCount = "ViewCount",
@@ -193,7 +194,8 @@ export declare enum IconType {
193
194
  PriorityTrivial = "Badge:PriorityTrivial",
194
195
  PriorityUndefined = "Badge:PriorityUndefined",
195
196
  ProgrammingLanguage = "Badge:ProgrammingLanguage",
196
- Subscriber = "Badge:Subscriber"
197
+ Subscriber = "Badge:Subscriber",
198
+ SubTasksProgress = "Badge:SubTask"
197
199
  }
198
200
  /**
199
201
  * Type for Flexible UI's Media element
@@ -20,3 +20,4 @@ export declare const extractChecklistProgress: (data: JsonLd.Data.BaseData) => s
20
20
  export declare const extractLocation: (data: JsonLd.Data.BaseData) => LinkLocation | undefined;
21
21
  export declare const extractSubTasksProgress: (data: JsonLd.Data.BaseData) => string | undefined;
22
22
  export declare const extractReadTime: (data: JsonLd.Data.BaseData) => string | undefined;
23
+ export declare const extractStoryPoints: (data: JsonLd.Data.BaseData) => number | undefined;
@@ -7,6 +7,7 @@
7
7
  declare const _default: {
8
8
  'fabric.linking.actions': string;
9
9
  'fabric.linking.add_account': string;
10
+ 'fabric.linking.assigned_to': string;
10
11
  'fabric.linking.cancel': string;
11
12
  'fabric.linking.cannot_connect': string;
12
13
  'fabric.linking.cannot_find_link': string;
@@ -22,6 +23,7 @@ declare const _default: {
22
23
  'fabric.linking.connect_to': string;
23
24
  'fabric.linking.connect_unauthorised_account_action': string;
24
25
  'fabric.linking.connect_unauthorised_account_description': string;
26
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': string;
25
27
  'fabric.linking.continue': string;
26
28
  'fabric.linking.copy_url_to_clipboard': string;
27
29
  'fabric.linking.couldnt_load_link': string;
@@ -65,6 +67,7 @@ declare const _default: {
65
67
  'fabric.linking.priority_minor': string;
66
68
  'fabric.linking.priority_trivial': string;
67
69
  'fabric.linking.priority_undefined': string;
70
+ 'fabric.linking.read_time': string;
68
71
  'fabric.linking.request_access': string;
69
72
  'fabric.linking.request_access_description': string;
70
73
  'fabric.linking.request_access_pending': string;
@@ -82,6 +85,10 @@ declare const _default: {
82
85
  'fabric.linking.status_change_update_error': string;
83
86
  'fabric.linking.try_again': string;
84
87
  'fabric.linking.try_another_account': string;
88
+ 'fabric.linking.unauthorised_account_description': string;
89
+ 'fabric.linking.unauthorised_account_description_no_provider': string;
90
+ 'fabric.linking.unauthorised_account_name': string;
91
+ 'fabric.linking.unauthorised_account_name_no_provider': string;
85
92
  'fabric.linking.unlink_account': string;
86
93
  'fabric.linking.updated_by': string;
87
94
  'fabric.linking.view': string;
@@ -7,6 +7,7 @@
7
7
  declare const _default: {
8
8
  'fabric.linking.actions': string;
9
9
  'fabric.linking.add_account': string;
10
+ 'fabric.linking.assigned_to': string;
10
11
  'fabric.linking.cancel': string;
11
12
  'fabric.linking.cannot_connect': string;
12
13
  'fabric.linking.cannot_find_link': string;
@@ -22,6 +23,7 @@ declare const _default: {
22
23
  'fabric.linking.connect_to': string;
23
24
  'fabric.linking.connect_unauthorised_account_action': string;
24
25
  'fabric.linking.connect_unauthorised_account_description': string;
26
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': string;
25
27
  'fabric.linking.continue': string;
26
28
  'fabric.linking.copy_url_to_clipboard': string;
27
29
  'fabric.linking.couldnt_load_link': string;
@@ -65,6 +67,7 @@ declare const _default: {
65
67
  'fabric.linking.priority_minor': string;
66
68
  'fabric.linking.priority_trivial': string;
67
69
  'fabric.linking.priority_undefined': string;
70
+ 'fabric.linking.read_time': string;
68
71
  'fabric.linking.request_access': string;
69
72
  'fabric.linking.request_access_description': string;
70
73
  'fabric.linking.request_access_pending': string;
@@ -82,6 +85,10 @@ declare const _default: {
82
85
  'fabric.linking.status_change_update_error': string;
83
86
  'fabric.linking.try_again': string;
84
87
  'fabric.linking.try_another_account': string;
88
+ 'fabric.linking.unauthorised_account_description': string;
89
+ 'fabric.linking.unauthorised_account_description_no_provider': string;
90
+ 'fabric.linking.unauthorised_account_name': string;
91
+ 'fabric.linking.unauthorised_account_name_no_provider': string;
85
92
  'fabric.linking.unlink_account': string;
86
93
  'fabric.linking.updated_by': string;
87
94
  'fabric.linking.view': string;
@@ -7,6 +7,7 @@
7
7
  declare const _default: {
8
8
  'fabric.linking.actions': string;
9
9
  'fabric.linking.add_account': string;
10
+ 'fabric.linking.assigned_to': string;
10
11
  'fabric.linking.cancel': string;
11
12
  'fabric.linking.cannot_connect': string;
12
13
  'fabric.linking.cannot_find_link': string;
@@ -22,6 +23,7 @@ declare const _default: {
22
23
  'fabric.linking.connect_to': string;
23
24
  'fabric.linking.connect_unauthorised_account_action': string;
24
25
  'fabric.linking.connect_unauthorised_account_description': string;
26
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': string;
25
27
  'fabric.linking.continue': string;
26
28
  'fabric.linking.copy_url_to_clipboard': string;
27
29
  'fabric.linking.couldnt_load_link': string;
@@ -65,6 +67,7 @@ declare const _default: {
65
67
  'fabric.linking.priority_minor': string;
66
68
  'fabric.linking.priority_trivial': string;
67
69
  'fabric.linking.priority_undefined': string;
70
+ 'fabric.linking.read_time': string;
68
71
  'fabric.linking.request_access': string;
69
72
  'fabric.linking.request_access_description': string;
70
73
  'fabric.linking.request_access_pending': string;
@@ -82,6 +85,10 @@ declare const _default: {
82
85
  'fabric.linking.status_change_update_error': string;
83
86
  'fabric.linking.try_again': string;
84
87
  'fabric.linking.try_another_account': string;
88
+ 'fabric.linking.unauthorised_account_description': string;
89
+ 'fabric.linking.unauthorised_account_description_no_provider': string;
90
+ 'fabric.linking.unauthorised_account_name': string;
91
+ 'fabric.linking.unauthorised_account_name_no_provider': string;
85
92
  'fabric.linking.unlink_account': string;
86
93
  'fabric.linking.updated_by': string;
87
94
  'fabric.linking.view': string;
@@ -189,6 +189,12 @@ export type FlexibleUiDataContext = {
189
189
  * @see SubscriberCount
190
190
  */
191
191
  state?: LinkLozenge;
192
+ /**
193
+ * Contains the no of story points for a task.
194
+ * @type string
195
+ * @see StoryPoints
196
+ */
197
+ storyPoints?: number;
192
198
  /**
193
199
  * Contains the target branch name of the link typed pull request.
194
200
  * @type string
@@ -21,4 +21,5 @@ export declare const handleOnClick: (handler: Function) => (e: React.BaseSynthet
21
21
  export declare const isIntersectionObserverSupported: () => boolean;
22
22
  export declare const sleep: (ms: number) => Promise<void>;
23
23
  export declare const importWithRetry: <T>(importFn: () => Promise<T>, retries?: number, interval?: number) => Promise<T>;
24
+ export declare const downloadUrl: (url?: string) => Promise<void>;
24
25
  export declare const openUrl: (url?: string) => Promise<void>;
@@ -1,8 +1,4 @@
1
1
  import { ActionProps } from '../components/Action';
2
- export interface DownloadFunctionArg {
3
- url?: string;
4
- }
5
- export declare function downloadFunction({ url }: DownloadFunctionArg): Promise<void>;
6
2
  export declare const DownloadAction: ({ url }: {
7
3
  url?: string | undefined;
8
4
  }) => ActionProps;
@@ -3,6 +3,3 @@ export type DownloadActionProps = ActionProps & {
3
3
  downloadUrl?: string;
4
4
  url: string;
5
5
  };
6
- export interface DownloadFunctionProps {
7
- url?: string;
8
- }
@@ -168,7 +168,7 @@ export type OnActionMenuOpenChangeOptions = {
168
168
  /**
169
169
  * A type that contains all the possible combinations of elements with their corresponding props.
170
170
  */
171
- export type ElementItemProps = AssignedTo | AssignedToGroup | AttachmentCount | AuthorGroup | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | Location | ModifiedBy | ModifiedOn | OwnedBy | OwnedByGroup | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | ReadTime | Snippet | SourceBranch | State | SubscriberCount | SubTasksProgress | TargetBranch | Title | ViewCount | VoteCount;
171
+ export type ElementItemProps = AssignedTo | AssignedToGroup | AttachmentCount | AuthorGroup | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | Location | ModifiedBy | ModifiedOn | OwnedBy | OwnedByGroup | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | ReadTime | Snippet | SourceBranch | State | SubscriberCount | SubTasksProgress | StoryPoints | TargetBranch | Title | ViewCount | VoteCount;
172
172
  /**
173
173
  * Represents the props available for an AttachmentCount element.
174
174
  * @see AttachmentCount
@@ -365,11 +365,17 @@ export type SubscriberCount = {
365
365
  name: ElementName.SubscriberCount;
366
366
  };
367
367
  /**
368
- * Represents the props available for a Subtasks element.
368
+ * Represents the props available for a SubtasksProgress element.
369
369
  */
370
370
  export type SubTasksProgress = {
371
371
  name: ElementName.SubTasksProgress;
372
372
  };
373
+ /**
374
+ * Represents the props available for a StoryPoints element.
375
+ */
376
+ export type StoryPoints = {
377
+ name: ElementName.StoryPoints;
378
+ };
373
379
  /**
374
380
  * Represents the props available for an TargetBranch element.
375
381
  * @see TargetBranch
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { AtlaskitBadgeProps } from './types';
4
+ /**
5
+ * A base element that displays a visual indicator for a numeric value
6
+ * @internal
7
+ * @see StoryPoints
8
+ * */
9
+ declare const AtlaskitBadge: React.FC<AtlaskitBadgeProps>;
10
+ export default AtlaskitBadge;
@@ -0,0 +1,4 @@
1
+ import { ElementProps } from '../types';
2
+ export type AtlaskitBadgeProps = ElementProps & {
3
+ value?: number;
4
+ };
@@ -7,6 +7,7 @@ import { AvatarGroupProps } from './avatar-group/types';
7
7
  import { TextProps } from './text/types';
8
8
  import { DateTimeProps } from './date-time/types';
9
9
  import { MediaProps } from './media/types';
10
+ import { AtlaskitBadgeProps } from './atlaskit-badge/types';
10
11
  /**
11
12
  * Creates a AssignedTo text element using the data from AssignedTo in the Flexible UI Context.
12
13
  * @see Text
@@ -146,6 +147,11 @@ export declare const SubscriberCount: import("react").FC<BadgeProps>;
146
147
  * @see Badge
147
148
  */
148
149
  export declare const SubTasksProgress: import("react").FC<BadgeProps>;
150
+ /**
151
+ * Create a StoryPoints Badge element using the data from storyPoints in the Flexible UI Context.
152
+ * @see AtlaskitBadge
153
+ */
154
+ export declare const StoryPoints: import("react").FC<AtlaskitBadgeProps>;
149
155
  /**
150
156
  * Creates a TargetBranch Text element using the data from targetBranch in the Flexible UI Context.
151
157
  * @see Text
@@ -112,6 +112,7 @@ export declare enum ElementName {
112
112
  State = "State",
113
113
  SubscriberCount = "SubscriberCount",
114
114
  SubTasksProgress = "SubTasksProgress",
115
+ StoryPoints = "StoryPoints",
115
116
  TargetBranch = "TargetBranch",
116
117
  Title = "Title",
117
118
  ViewCount = "ViewCount",
@@ -193,7 +194,8 @@ export declare enum IconType {
193
194
  PriorityTrivial = "Badge:PriorityTrivial",
194
195
  PriorityUndefined = "Badge:PriorityUndefined",
195
196
  ProgrammingLanguage = "Badge:ProgrammingLanguage",
196
- Subscriber = "Badge:Subscriber"
197
+ Subscriber = "Badge:Subscriber",
198
+ SubTasksProgress = "Badge:SubTask"
197
199
  }
198
200
  /**
199
201
  * Type for Flexible UI's Media element
@@ -20,3 +20,4 @@ export declare const extractChecklistProgress: (data: JsonLd.Data.BaseData) => s
20
20
  export declare const extractLocation: (data: JsonLd.Data.BaseData) => LinkLocation | undefined;
21
21
  export declare const extractSubTasksProgress: (data: JsonLd.Data.BaseData) => string | undefined;
22
22
  export declare const extractReadTime: (data: JsonLd.Data.BaseData) => string | undefined;
23
+ export declare const extractStoryPoints: (data: JsonLd.Data.BaseData) => number | undefined;
@@ -7,6 +7,7 @@
7
7
  declare const _default: {
8
8
  'fabric.linking.actions': string;
9
9
  'fabric.linking.add_account': string;
10
+ 'fabric.linking.assigned_to': string;
10
11
  'fabric.linking.cancel': string;
11
12
  'fabric.linking.cannot_connect': string;
12
13
  'fabric.linking.cannot_find_link': string;
@@ -22,6 +23,7 @@ declare const _default: {
22
23
  'fabric.linking.connect_to': string;
23
24
  'fabric.linking.connect_unauthorised_account_action': string;
24
25
  'fabric.linking.connect_unauthorised_account_description': string;
26
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': string;
25
27
  'fabric.linking.continue': string;
26
28
  'fabric.linking.copy_url_to_clipboard': string;
27
29
  'fabric.linking.couldnt_load_link': string;
@@ -65,6 +67,7 @@ declare const _default: {
65
67
  'fabric.linking.priority_minor': string;
66
68
  'fabric.linking.priority_trivial': string;
67
69
  'fabric.linking.priority_undefined': string;
70
+ 'fabric.linking.read_time': string;
68
71
  'fabric.linking.request_access': string;
69
72
  'fabric.linking.request_access_description': string;
70
73
  'fabric.linking.request_access_pending': string;
@@ -82,6 +85,10 @@ declare const _default: {
82
85
  'fabric.linking.status_change_update_error': string;
83
86
  'fabric.linking.try_again': string;
84
87
  'fabric.linking.try_another_account': string;
88
+ 'fabric.linking.unauthorised_account_description': string;
89
+ 'fabric.linking.unauthorised_account_description_no_provider': string;
90
+ 'fabric.linking.unauthorised_account_name': string;
91
+ 'fabric.linking.unauthorised_account_name_no_provider': string;
85
92
  'fabric.linking.unlink_account': string;
86
93
  'fabric.linking.updated_by': string;
87
94
  'fabric.linking.view': string;
@@ -7,6 +7,7 @@
7
7
  declare const _default: {
8
8
  'fabric.linking.actions': string;
9
9
  'fabric.linking.add_account': string;
10
+ 'fabric.linking.assigned_to': string;
10
11
  'fabric.linking.cancel': string;
11
12
  'fabric.linking.cannot_connect': string;
12
13
  'fabric.linking.cannot_find_link': string;
@@ -22,6 +23,7 @@ declare const _default: {
22
23
  'fabric.linking.connect_to': string;
23
24
  'fabric.linking.connect_unauthorised_account_action': string;
24
25
  'fabric.linking.connect_unauthorised_account_description': string;
26
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': string;
25
27
  'fabric.linking.continue': string;
26
28
  'fabric.linking.copy_url_to_clipboard': string;
27
29
  'fabric.linking.couldnt_load_link': string;
@@ -65,6 +67,7 @@ declare const _default: {
65
67
  'fabric.linking.priority_minor': string;
66
68
  'fabric.linking.priority_trivial': string;
67
69
  'fabric.linking.priority_undefined': string;
70
+ 'fabric.linking.read_time': string;
68
71
  'fabric.linking.request_access': string;
69
72
  'fabric.linking.request_access_description': string;
70
73
  'fabric.linking.request_access_pending': string;
@@ -82,6 +85,10 @@ declare const _default: {
82
85
  'fabric.linking.status_change_update_error': string;
83
86
  'fabric.linking.try_again': string;
84
87
  'fabric.linking.try_another_account': string;
88
+ 'fabric.linking.unauthorised_account_description': string;
89
+ 'fabric.linking.unauthorised_account_description_no_provider': string;
90
+ 'fabric.linking.unauthorised_account_name': string;
91
+ 'fabric.linking.unauthorised_account_name_no_provider': string;
85
92
  'fabric.linking.unlink_account': string;
86
93
  'fabric.linking.updated_by': string;
87
94
  'fabric.linking.view': string;
@@ -7,6 +7,7 @@
7
7
  declare const _default: {
8
8
  'fabric.linking.actions': string;
9
9
  'fabric.linking.add_account': string;
10
+ 'fabric.linking.assigned_to': string;
10
11
  'fabric.linking.cancel': string;
11
12
  'fabric.linking.cannot_connect': string;
12
13
  'fabric.linking.cannot_find_link': string;
@@ -22,6 +23,7 @@ declare const _default: {
22
23
  'fabric.linking.connect_to': string;
23
24
  'fabric.linking.connect_unauthorised_account_action': string;
24
25
  'fabric.linking.connect_unauthorised_account_description': string;
26
+ 'fabric.linking.connect_unauthorised_account_description_no_provider': string;
25
27
  'fabric.linking.continue': string;
26
28
  'fabric.linking.copy_url_to_clipboard': string;
27
29
  'fabric.linking.couldnt_load_link': string;
@@ -65,6 +67,7 @@ declare const _default: {
65
67
  'fabric.linking.priority_minor': string;
66
68
  'fabric.linking.priority_trivial': string;
67
69
  'fabric.linking.priority_undefined': string;
70
+ 'fabric.linking.read_time': string;
68
71
  'fabric.linking.request_access': string;
69
72
  'fabric.linking.request_access_description': string;
70
73
  'fabric.linking.request_access_pending': string;
@@ -82,6 +85,10 @@ declare const _default: {
82
85
  'fabric.linking.status_change_update_error': string;
83
86
  'fabric.linking.try_again': string;
84
87
  'fabric.linking.try_another_account': string;
88
+ 'fabric.linking.unauthorised_account_description': string;
89
+ 'fabric.linking.unauthorised_account_description_no_provider': string;
90
+ 'fabric.linking.unauthorised_account_name': string;
91
+ 'fabric.linking.unauthorised_account_name_no_provider': string;
85
92
  'fabric.linking.unlink_account': string;
86
93
  'fabric.linking.updated_by': string;
87
94
  'fabric.linking.view': string;
@@ -189,6 +189,12 @@ export type FlexibleUiDataContext = {
189
189
  * @see SubscriberCount
190
190
  */
191
191
  state?: LinkLozenge;
192
+ /**
193
+ * Contains the no of story points for a task.
194
+ * @type string
195
+ * @see StoryPoints
196
+ */
197
+ storyPoints?: number;
192
198
  /**
193
199
  * Contains the target branch name of the link typed pull request.
194
200
  * @type string