@atlaskit/smart-card 26.13.1 → 26.14.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 (66) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/constants.js +5 -0
  3. package/dist/cjs/extractors/flexible/index.js +5 -0
  4. package/dist/cjs/extractors/flexible/utils.js +23 -2
  5. package/dist/cjs/extractors/hover/extractMetadata.js +2 -1
  6. package/dist/cjs/messages.js +10 -0
  7. package/dist/cjs/version.json +1 -1
  8. package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +21 -37
  9. package/dist/cjs/view/BlockCard/views/flexible/styled.js +15 -0
  10. package/dist/cjs/view/BlockCard/views/flexible/utils.js +116 -0
  11. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
  12. package/dist/cjs/view/FlexibleCard/components/elements/index.js +33 -4
  13. package/dist/cjs/view/FlexibleCard/components/elements/utils.js +20 -0
  14. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +28 -12
  15. package/dist/cjs/view/HoverCard/utils.js +102 -3
  16. package/dist/es2019/constants.js +6 -0
  17. package/dist/es2019/extractors/flexible/index.js +7 -2
  18. package/dist/es2019/extractors/flexible/utils.js +18 -1
  19. package/dist/es2019/extractors/hover/extractMetadata.js +1 -1
  20. package/dist/es2019/messages.js +10 -0
  21. package/dist/es2019/version.json +1 -1
  22. package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +24 -38
  23. package/dist/es2019/view/BlockCard/views/flexible/styled.js +14 -0
  24. package/dist/es2019/view/BlockCard/views/flexible/utils.js +108 -0
  25. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +5 -0
  26. package/dist/es2019/view/FlexibleCard/components/elements/index.js +24 -0
  27. package/dist/es2019/view/FlexibleCard/components/elements/utils.js +25 -0
  28. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +30 -14
  29. package/dist/es2019/view/HoverCard/utils.js +100 -1
  30. package/dist/esm/constants.js +6 -0
  31. package/dist/esm/extractors/flexible/index.js +7 -2
  32. package/dist/esm/extractors/flexible/utils.js +18 -1
  33. package/dist/esm/extractors/hover/extractMetadata.js +1 -1
  34. package/dist/esm/messages.js +10 -0
  35. package/dist/esm/version.json +1 -1
  36. package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +23 -38
  37. package/dist/esm/view/BlockCard/views/flexible/styled.js +7 -0
  38. package/dist/esm/view/BlockCard/views/flexible/utils.js +108 -0
  39. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
  40. package/dist/esm/view/FlexibleCard/components/elements/index.js +24 -0
  41. package/dist/esm/view/FlexibleCard/components/elements/utils.js +20 -0
  42. package/dist/esm/view/HoverCard/components/views/resolved/index.js +30 -14
  43. package/dist/esm/view/HoverCard/utils.js +98 -1
  44. package/dist/types/constants.d.ts +5 -0
  45. package/dist/types/extractors/flexible/utils.d.ts +5 -0
  46. package/dist/types/extractors/hover/extractMetadata.d.ts +2 -0
  47. package/dist/types/messages.d.ts +1 -1
  48. package/dist/types/state/flexible-ui-context/types.d.ts +25 -0
  49. package/dist/types/view/BlockCard/views/flexible/styled.d.ts +2 -0
  50. package/dist/types/view/BlockCard/views/flexible/utils.d.ts +10 -0
  51. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +35 -2
  52. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +24 -0
  53. package/dist/types/view/HoverCard/utils.d.ts +1 -0
  54. package/dist/types-ts4.5/constants.d.ts +5 -0
  55. package/dist/types-ts4.5/extractors/flexible/utils.d.ts +5 -0
  56. package/dist/types-ts4.5/extractors/hover/extractMetadata.d.ts +2 -0
  57. package/dist/types-ts4.5/messages.d.ts +1 -1
  58. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +25 -0
  59. package/dist/types-ts4.5/view/BlockCard/views/flexible/styled.d.ts +2 -0
  60. package/dist/types-ts4.5/view/BlockCard/views/flexible/utils.d.ts +10 -0
  61. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +35 -2
  62. package/dist/types-ts4.5/view/FlexibleCard/components/elements/index.d.ts +24 -0
  63. package/dist/types-ts4.5/view/HoverCard/utils.d.ts +1 -0
  64. package/package.json +4 -1
  65. package/report.api.md +40 -0
  66. package/tmp/api-report-tmp.d.ts +36 -1
@@ -57,6 +57,12 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
57
57
  component: Text
58
58
  }), _defineProperty(_elementMappings, ElementName.OwnedBy, {
59
59
  component: Text
60
+ }), _defineProperty(_elementMappings, ElementName.AssignedTo, {
61
+ component: Text
62
+ }), _defineProperty(_elementMappings, ElementName.AssignedToGroup, {
63
+ component: AvatarGroup
64
+ }), _defineProperty(_elementMappings, ElementName.OwnedByGroup, {
65
+ component: AvatarGroup
60
66
  }), _defineProperty(_elementMappings, ElementName.CreatedOn, {
61
67
  component: DateTime
62
68
  }), _defineProperty(_elementMappings, ElementName.DueOn, {
@@ -83,6 +89,8 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
83
89
  }
84
90
  }), _defineProperty(_elementMappings, ElementName.Provider, {
85
91
  component: Badge
92
+ }), _defineProperty(_elementMappings, ElementName.ReadTime, {
93
+ component: Text
86
94
  }), _defineProperty(_elementMappings, ElementName.Snippet, {
87
95
  component: Text,
88
96
  props: {
@@ -98,6 +106,11 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
98
106
  props: {
99
107
  icon: IconType.Subscriber
100
108
  }
109
+ }), _defineProperty(_elementMappings, ElementName.SubTasksProgress, {
110
+ component: Badge,
111
+ props: {
112
+ icon: IconType.CheckItem
113
+ }
101
114
  }), _defineProperty(_elementMappings, ElementName.TargetBranch, {
102
115
  component: Text
103
116
  }), _defineProperty(_elementMappings, ElementName.Title, {
@@ -120,7 +133,9 @@ var getData = function getData(elementName, contextKey, context) {
120
133
  var data = context[contextKey];
121
134
  switch (elementName) {
122
135
  case ElementName.AuthorGroup:
136
+ case ElementName.AssignedToGroup:
123
137
  case ElementName.CollaboratorGroup:
138
+ case ElementName.OwnedByGroup:
124
139
  return toAvatarGroupProps(data);
125
140
  case ElementName.AttachmentCount:
126
141
  case ElementName.ChecklistProgress:
@@ -131,9 +146,12 @@ var getData = function getData(elementName, contextKey, context) {
131
146
  case ElementName.ProgrammingLanguage:
132
147
  case ElementName.SubscriberCount:
133
148
  case ElementName.LatestCommit:
149
+ case ElementName.SubTasksProgress:
134
150
  return toBadgeProps(data);
135
151
  case ElementName.CreatedBy:
136
152
  return toFormattedTextProps(messages.created_by, context.createdBy);
153
+ case ElementName.AssignedTo:
154
+ return toFormattedTextProps(messages.assigned_to, context.assignedTo);
137
155
  case ElementName.OwnedBy:
138
156
  return toFormattedTextProps(messages.owned_by, context.ownedBy);
139
157
  case ElementName.CreatedOn:
@@ -144,6 +162,8 @@ var getData = function getData(elementName, contextKey, context) {
144
162
  return toFormattedTextProps(messages.modified_by, context.modifiedBy);
145
163
  case ElementName.ModifiedOn:
146
164
  return toDateTimeProps('modified', context.modifiedOn);
165
+ case ElementName.ReadTime:
166
+ return toFormattedTextProps(messages.read_time, data);
147
167
  case ElementName.Snippet:
148
168
  case ElementName.SourceBranch:
149
169
  case ElementName.TargetBranch:
@@ -8,11 +8,12 @@ import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../..
8
8
  import { FooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
9
9
  import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
10
10
  import FlexibleCard from '../../../../FlexibleCard';
11
- import { getSimulatedMetadata } from '../../../utils';
11
+ import { getSimulatedMetadata, getSimulatedBetterMetadata } from '../../../utils';
12
12
  import SnippetOrPreview from '../../SnippetOrPreview';
13
- import { extractMetadata } from '../../../../../extractors/hover/extractMetadata';
13
+ import { extractMetadata, elementNamesToItems } from '../../../../../extractors/hover/extractMetadata';
14
14
  import { messages } from '../../../../../messages';
15
15
  import { FormattedMessage } from 'react-intl-next';
16
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
17
  export var toFooterActions = function toFooterActions(cardActions, onActionClick, enableImprovedPreviewAction) {
17
18
  var appearance = enableImprovedPreviewAction ? {
18
19
  appearance: 'primary'
@@ -72,16 +73,24 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
72
73
  }, [cardActions, onActionClick, enableImprovedPreviewAction]);
73
74
  var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
74
75
  var _useMemo = useMemo(function () {
75
- //TODO: EDM-3224 deleted simulated and use real JsonLd
76
+ if (getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg')) {
77
+ var betterMetadata = getSimulatedBetterMetadata(extensionKey, data);
78
+ return {
79
+ topPrimary: elementNamesToItems(betterMetadata.topMetadataBlock.primary),
80
+ topSecondary: elementNamesToItems(betterMetadata.topMetadataBlock.secondary),
81
+ bottomPrimary: elementNamesToItems(betterMetadata.bottomMetadataBlock.primary)
82
+ };
83
+ }
76
84
  var metadata = extractMetadata(getSimulatedMetadata(extensionKey, data));
77
85
  return {
78
- primary: metadata.primary,
79
- secondary: metadata.secondary,
80
- subtitle: metadata.subtitle
86
+ topPrimary: metadata.primary,
87
+ topSecondary: metadata.secondary,
88
+ bottomPrimary: []
81
89
  };
82
90
  }, [data, extensionKey]),
83
- primary = _useMemo.primary,
84
- secondary = _useMemo.secondary;
91
+ topPrimary = _useMemo.topPrimary,
92
+ topSecondary = _useMemo.topSecondary,
93
+ bottomPrimary = _useMemo.bottomPrimary;
85
94
  var snippetHeight = React.useRef(0);
86
95
  var snippetBlockRef = useRef(null);
87
96
  var onSnippetRender = useCallback(function () {
@@ -94,17 +103,24 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
94
103
  });
95
104
  return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
96
105
  metadataPosition: SmartLinkPosition.Top
97
- })), /*#__PURE__*/React.createElement(MetadataBlock, {
98
- primary: primary,
99
- secondary: secondary,
100
- size: SmartLinkSize.Large,
106
+ })), /*#__PURE__*/React.createElement(MetadataBlock, _extends({
107
+ primary: topPrimary,
108
+ secondary: topSecondary,
101
109
  overrideCss: metadataBlockCss,
102
- maxLines: 1
103
- }), body, /*#__PURE__*/React.createElement(SnippetBlock, {
110
+ maxLines: 1,
111
+ size: SmartLinkSize.Large
112
+ }, getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && {
113
+ size: SmartLinkSize.Medium
114
+ })), body, /*#__PURE__*/React.createElement(SnippetBlock, {
104
115
  testId: 'hidden-snippet',
105
116
  onRender: onSnippetRender,
106
117
  blockRef: snippetBlockRef,
107
118
  overrideCss: hiddenSnippetStyles
119
+ }), getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && /*#__PURE__*/React.createElement(MetadataBlock, {
120
+ primary: bottomPrimary,
121
+ size: SmartLinkSize.Large,
122
+ overrideCss: metadataBlockCss,
123
+ maxLines: 1
108
124
  }), /*#__PURE__*/React.createElement(FooterBlock, {
109
125
  actions: footerActions,
110
126
  size: SmartLinkSize.Large,
@@ -1,3 +1,6 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ 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; }
3
+ 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; }
1
4
  import { ElementName } from '../../constants';
2
5
  import { extractType } from '@atlaskit/link-extractors';
3
6
  import { extractOwnedBy } from '../../extractors/flexible/utils';
@@ -29,7 +32,7 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
29
32
  return {
30
33
  metadata: {
31
34
  primary: [ElementName.AuthorGroup, primaryAttribution],
32
- secondary: [ElementName.CommentCount, ElementName.ReactCount],
35
+ secondary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.ViewCount],
33
36
  subtitle: []
34
37
  }
35
38
  };
@@ -75,4 +78,98 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
75
78
  }
76
79
  };
77
80
  }
81
+ };
82
+ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
83
+ var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
84
+ var data = arguments.length > 1 ? arguments[1] : undefined;
85
+ var types = data ? extractType(data) : undefined;
86
+ var defaultMetadata = {
87
+ topMetadataBlock: {
88
+ primary: [ElementName.ModifiedOn, ElementName.CreatedBy],
89
+ secondary: [],
90
+ subtitle: []
91
+ },
92
+ bottomMetadataBlock: {
93
+ primary: [],
94
+ secondary: [],
95
+ subtitle: []
96
+ }
97
+ };
98
+ switch (extensionKey) {
99
+ case 'bitbucket-object-provider':
100
+ case 'native-bitbucket-object-provider':
101
+ if (types !== null && types !== void 0 && types.includes('atlassian:SourceCodePullRequest')) {
102
+ return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
103
+ topMetadataBlock: {
104
+ primary: [ElementName.AuthorGroup, ElementName.ModifiedOn, ElementName.SubscriberCount, ElementName.State],
105
+ secondary: [],
106
+ subtitle: [ElementName.SourceBranch, ElementName.TargetBranch]
107
+ }
108
+ });
109
+ }
110
+ return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
111
+ topMetadataBlock: {
112
+ primary: [ElementName.ModifiedOn, ElementName.CreatedBy],
113
+ secondary: [],
114
+ subtitle: []
115
+ }
116
+ });
117
+ case 'confluence-object-provider':
118
+ var primaryAttribution = data && extractOwnedBy(data) ? ElementName.OwnedByGroup : ElementName.AuthorGroup;
119
+ return {
120
+ topMetadataBlock: {
121
+ primary: [primaryAttribution, ElementName.ModifiedOn],
122
+ secondary: [],
123
+ subtitle: []
124
+ },
125
+ bottomMetadataBlock: {
126
+ primary: [ElementName.CommentCount, ElementName.ReactCount, ElementName.ViewCount],
127
+ secondary: [],
128
+ subtitle: []
129
+ }
130
+ };
131
+ case 'jira-object-provider':
132
+ return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
133
+ topMetadataBlock: {
134
+ primary: [ElementName.AssignedToGroup, ElementName.State, ElementName.Priority],
135
+ secondary: [],
136
+ subtitle: []
137
+ }
138
+ });
139
+ case 'trello-object-provider':
140
+ return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
141
+ topMetadataBlock: {
142
+ primary: [ElementName.AuthorGroup, ElementName.State, ElementName.DueOn],
143
+ secondary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.AttachmentCount, ElementName.ChecklistProgress],
144
+ subtitle: [ElementName.Location]
145
+ }
146
+ });
147
+ case 'watermelon-object-provider':
148
+ if (types !== null && types !== void 0 && types.includes('atlassian:Project')) {
149
+ return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
150
+ topMetadataBlock: {
151
+ primary: [ElementName.AuthorGroup, ElementName.ModifiedOn, ElementName.State, ElementName.DueOn],
152
+ secondary: [],
153
+ subtitle: []
154
+ }
155
+ });
156
+ }
157
+ return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
158
+ topMetadataBlock: {
159
+ primary: [ElementName.AuthorGroup, ElementName.State, ElementName.DueOn],
160
+ secondary: [],
161
+ subtitle: []
162
+ }
163
+ });
164
+ case 'google-object-provider':
165
+ return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
166
+ topMetadataBlock: {
167
+ primary: [ElementName.AuthorGroup, ElementName.ModifiedOn],
168
+ secondary: [],
169
+ subtitle: []
170
+ }
171
+ });
172
+ default:
173
+ return defaultMetadata;
174
+ }
78
175
  };
@@ -84,6 +84,8 @@ export declare enum SmartLinkWidth {
84
84
  * (src/view/FlexibleCard/components/blocks/utils.tsx)
85
85
  */
86
86
  export declare enum ElementName {
87
+ AssignedTo = "AssignedTo",
88
+ AssignedToGroup = "AssignedToGroup",
87
89
  AttachmentCount = "AttachmentCount",
88
90
  AuthorGroup = "AuthorGroup",
89
91
  ChecklistProgress = "ChecklistProgress",
@@ -98,15 +100,18 @@ export declare enum ElementName {
98
100
  ModifiedBy = "ModifiedBy",
99
101
  ModifiedOn = "ModifiedOn",
100
102
  OwnedBy = "OwnedBy",
103
+ OwnedByGroup = "OwnedByGroup",
101
104
  Preview = "Preview",
102
105
  Priority = "Priority",
103
106
  ProgrammingLanguage = "ProgrammingLanguage",
104
107
  Provider = "Provider",
105
108
  ReactCount = "ReactCount",
109
+ ReadTime = "ReadTime",
106
110
  Snippet = "Snippet",
107
111
  SourceBranch = "SourceBranch",
108
112
  State = "State",
109
113
  SubscriberCount = "SubscriberCount",
114
+ SubTasksProgress = "SubTasksProgress",
110
115
  TargetBranch = "TargetBranch",
111
116
  Title = "Title",
112
117
  ViewCount = "ViewCount",
@@ -1,4 +1,5 @@
1
1
  import { JsonLd } from 'json-ld-types';
2
+ import { LinkPerson } from '@atlaskit/link-extractors';
2
3
  import { LinkLocation } from '../../state/flexible-ui-context/types';
3
4
  export declare const extractCommentCount: (data: JsonLd.Data.BaseData) => number | undefined;
4
5
  export declare const extractDueOn: (data: JsonLd.Data.BaseData) => string | undefined;
@@ -6,6 +7,8 @@ export declare const extractViewCount: (data: JsonLd.Data.BaseData) => number |
6
7
  export declare const extractReactCount: (data: JsonLd.Data.BaseData) => number | undefined;
7
8
  export declare const extractVoteCount: (data: JsonLd.Data.BaseData) => number | undefined;
8
9
  export declare const extractOwnedBy: (data: JsonLd.Data.BaseData) => string | undefined;
10
+ export declare const extractAssignedTo: (data: JsonLd.Data.BaseData) => string | undefined;
11
+ export declare const extractPersonAssignedToAsArray: (data: JsonLd.Data.BaseData) => LinkPerson[] | undefined;
9
12
  export declare const extractCreatedBy: (data: JsonLd.Data.BaseData) => string | undefined;
10
13
  export declare const extractModifiedBy: (data: JsonLd.Data.BaseData) => string | undefined;
11
14
  export declare const extractProgrammingLanguage: (data: JsonLd.Data.BaseData) => string | undefined;
@@ -15,3 +18,5 @@ export declare const extractAttachmentCount: (data: JsonLd.Data.BaseData) => num
15
18
  export declare const extractTargetBranch: (data: JsonLd.Data.SourceCodePullRequest) => string | undefined;
16
19
  export declare const extractChecklistProgress: (data: JsonLd.Data.BaseData) => string | undefined;
17
20
  export declare const extractLocation: (data: JsonLd.Data.BaseData) => LinkLocation | undefined;
21
+ export declare const extractSubTasksProgress: (data: JsonLd.Data.BaseData) => string | undefined;
22
+ export declare const extractReadTime: (data: JsonLd.Data.BaseData) => string | undefined;
@@ -1,3 +1,5 @@
1
+ import { ElementItem } from '../../view/FlexibleCard/components/blocks/types';
1
2
  import { MetadataOptions } from '../../view/HoverCard/types';
2
3
  import { JsonLd } from 'json-ld-types';
4
+ export declare const elementNamesToItems: (elementNames: string[]) => ElementItem[];
3
5
  export declare const extractMetadata: (jsonLd: JsonLd.Primitives.Property<any>) => MetadataOptions;
@@ -1,6 +1,6 @@
1
1
  import { MessageDescriptor } from 'react-intl-next';
2
2
  export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
3
- export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
3
+ export type MessageKey = 'assigned_to' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
4
4
  type Messages = {
5
5
  [K in MessageKey]: MessageDescriptor;
6
6
  };
@@ -6,6 +6,11 @@ import { IconType, MediaType } from '../../constants';
6
6
  * underlying elements.
7
7
  */
8
8
  export type FlexibleUiDataContext = {
9
+ /**
10
+ * An array containing data used to populate the AssignedToGroup element.
11
+ * @see AvatarGroup
12
+ */
13
+ assignedToGroup?: LinkPerson[];
9
14
  /**
10
15
  * Contains the number of attachments on the linked resource.
11
16
  * @type number
@@ -58,6 +63,12 @@ export type FlexibleUiDataContext = {
58
63
  * @see VoteCount
59
64
  */
60
65
  voteCount?: number;
66
+ /**
67
+ * Contains the name of the entity that has the resource assigend to.
68
+ * @type string
69
+ * @see AssignedTo
70
+ */
71
+ assignedTo?: string;
61
72
  /**
62
73
  * Contains the name of the entity that created the resource.
63
74
  * @type string
@@ -70,6 +81,12 @@ export type FlexibleUiDataContext = {
70
81
  * @see OwnedBy
71
82
  */
72
83
  ownedBy?: string;
84
+ /**
85
+ * Contains the person that owns the resource.
86
+ * @type LinkPerson
87
+ * @see OwnedByGroup
88
+ */
89
+ ownedByGroup?: LinkPerson[];
73
90
  /**
74
91
  * Contains the ISO timestamp of when the resource was created.
75
92
  * @type string - ISO Timestamp
@@ -146,6 +163,10 @@ export type FlexibleUiDataContext = {
146
163
  * @see Snippet
147
164
  */
148
165
  snippet?: string;
166
+ /**
167
+ * Contains read time (time taken to read) of the resource
168
+ */
169
+ readTime?: string;
149
170
  /**
150
171
  * Contains the source branch name of the link typed pull request.
151
172
  * @type string
@@ -158,6 +179,10 @@ export type FlexibleUiDataContext = {
158
179
  * @see SubscriberCount
159
180
  */
160
181
  subscriberCount?: number;
182
+ /**
183
+ * A string displaying progress on subtasks
184
+ */
185
+ subTasksProgress?: string;
161
186
  /**
162
187
  * Contains the number of subscribers of the linked resource.
163
188
  * @type number
@@ -0,0 +1,2 @@
1
+ export declare const metadataBlockCss: import("@emotion/react").SerializedStyles;
2
+ export declare const titleBlockCss: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,10 @@
1
+ import { JsonLd } from 'json-ld-types';
2
+ import { ElementItem } from '../../../FlexibleCard/components/blocks/types';
3
+ export declare const getSimulatedBetterMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
4
+ export declare const getSimulatedMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
5
+ type SimulatedMetadata = {
6
+ titleMetadata: ElementItem[];
7
+ topMetadata: ElementItem[];
8
+ bottomMetadata?: ElementItem[];
9
+ };
10
+ export {};
@@ -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 = AttachmentCount | AuthorGroup | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | Location | ModifiedBy | ModifiedOn | OwnedBy | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | SourceBranch | State | SubscriberCount | 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 | TargetBranch | Title | ViewCount | VoteCount;
172
172
  /**
173
173
  * Represents the props available for an AttachmentCount element.
174
174
  * @see AttachmentCount
@@ -183,6 +183,20 @@ export type AttachmentCount = {
183
183
  export type AuthorGroup = {
184
184
  name: ElementName.AuthorGroup;
185
185
  };
186
+ /**
187
+ * Represents the props available for an OwnedByGroup element.
188
+ * @see AuthorGroup
189
+ */
190
+ export type OwnedByGroup = {
191
+ name: ElementName.OwnedByGroup;
192
+ };
193
+ /**
194
+ * Represents the props available for an AssignedToGroup element.
195
+ * @see AuthorGroup
196
+ */
197
+ export type AssignedToGroup = {
198
+ name: ElementName.AssignedToGroup;
199
+ };
186
200
  /**
187
201
  * Represents the props available for an ChecklistProgress element.
188
202
  * @see ChecklistProgress
@@ -204,6 +218,13 @@ export type CollaboratorGroup = {
204
218
  export type CommentCount = {
205
219
  name: ElementName.CommentCount;
206
220
  };
221
+ /**
222
+ * Represents the props available for an AssignedTo element.
223
+ * @see AssignedTo
224
+ */
225
+ export type AssignedTo = {
226
+ name: ElementName.AssignedTo;
227
+ };
207
228
  /**
208
229
  * Represents the props available for an CreatedBy element.
209
230
  * @see CreatedBy
@@ -309,6 +330,12 @@ export type Provider = {
309
330
  export type ReactCount = {
310
331
  name: ElementName.ReactCount;
311
332
  };
333
+ /**
334
+ * Represents the props available for a ReadTime element.
335
+ */
336
+ export type ReadTime = {
337
+ name: ElementName.ReadTime;
338
+ };
312
339
  /**
313
340
  * Represents the props available for an Snippet element.
314
341
  * @see Snippet
@@ -331,12 +358,18 @@ export type State = {
331
358
  name: ElementName.State;
332
359
  };
333
360
  /**
334
- * Represents the props available for an SubscriberCount element.
361
+ * Represents the props available for a SubscriberCount element.
335
362
  * @see SubscriberCount
336
363
  */
337
364
  export type SubscriberCount = {
338
365
  name: ElementName.SubscriberCount;
339
366
  };
367
+ /**
368
+ * Represents the props available for a Subtasks element.
369
+ */
370
+ export type SubTasksProgress = {
371
+ name: ElementName.SubTasksProgress;
372
+ };
340
373
  /**
341
374
  * Represents the props available for an TargetBranch element.
342
375
  * @see TargetBranch
@@ -7,6 +7,16 @@ 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
+ /**
11
+ * Creates a AssignedTo text element using the data from AssignedTo in the Flexible UI Context.
12
+ * @see Text
13
+ */
14
+ export declare const AssignedTo: import("react").FC<TextProps>;
15
+ /**
16
+ * An AvatarGroup element using the data from AssignedToGroup in the Flexible UI Context.
17
+ * @see AvatarGroup
18
+ */
19
+ export declare const AssignedToGroup: import("react").FC<AvatarGroupProps>;
10
20
  /**
11
21
  * Creates a AttachmentCount Badge element using the data from AttachmentCount in the Flexible UI Context.
12
22
  * @see Badge
@@ -77,6 +87,11 @@ export declare const ModifiedOn: import("react").FC<DateTimeProps>;
77
87
  * @see Text
78
88
  */
79
89
  export declare const OwnedBy: import("react").FC<TextProps>;
90
+ /**
91
+ * An AvatarGroup element using the data from OwnedByGroup in the Flexible UI Context.
92
+ * @see AvatarGroup
93
+ */
94
+ export declare const OwnedByGroup: import("react").FC<AvatarGroupProps>;
80
95
  /**
81
96
  * Creates a Preview element using the data from Preview in the Flexible UI Context.
82
97
  * @see Preview
@@ -102,6 +117,10 @@ export declare const Provider: import("react").FC<BadgeProps>;
102
117
  * @see Badge
103
118
  */
104
119
  export declare const ReactCount: import("react").FC<BadgeProps>;
120
+ /**
121
+ * Creates a ReadTime Text element using the data from readTime in the Flexible UI Context
122
+ */
123
+ export declare const ReadTime: import("react").FC<TextProps>;
105
124
  /**
106
125
  * Creates a Snippet element using the data from Snippet in the Flexible UI Context.
107
126
  * @see Text
@@ -122,6 +141,11 @@ export declare const State: import("react").FC<LozengeProps>;
122
141
  * @see Badge
123
142
  */
124
143
  export declare const SubscriberCount: import("react").FC<BadgeProps>;
144
+ /**
145
+ * Create a SubTasks Badge element using the data from subTasks in the Flexible UI Context.
146
+ * @see Badge
147
+ */
148
+ export declare const SubTasksProgress: import("react").FC<BadgeProps>;
125
149
  /**
126
150
  * Creates a TargetBranch Text element using the data from targetBranch in the Flexible UI Context.
127
151
  * @see Text
@@ -1,2 +1,3 @@
1
1
  import { JsonLd } from 'json-ld-types';
2
2
  export declare const getSimulatedMetadata: (extensionKey: string | undefined, data: JsonLd.Data.BaseData) => JsonLd.Primitives.Property<any>;
3
+ export declare const getSimulatedBetterMetadata: (extensionKey: string | undefined, data: JsonLd.Data.BaseData) => JsonLd.Primitives.Property<any>;
@@ -84,6 +84,8 @@ export declare enum SmartLinkWidth {
84
84
  * (src/view/FlexibleCard/components/blocks/utils.tsx)
85
85
  */
86
86
  export declare enum ElementName {
87
+ AssignedTo = "AssignedTo",
88
+ AssignedToGroup = "AssignedToGroup",
87
89
  AttachmentCount = "AttachmentCount",
88
90
  AuthorGroup = "AuthorGroup",
89
91
  ChecklistProgress = "ChecklistProgress",
@@ -98,15 +100,18 @@ export declare enum ElementName {
98
100
  ModifiedBy = "ModifiedBy",
99
101
  ModifiedOn = "ModifiedOn",
100
102
  OwnedBy = "OwnedBy",
103
+ OwnedByGroup = "OwnedByGroup",
101
104
  Preview = "Preview",
102
105
  Priority = "Priority",
103
106
  ProgrammingLanguage = "ProgrammingLanguage",
104
107
  Provider = "Provider",
105
108
  ReactCount = "ReactCount",
109
+ ReadTime = "ReadTime",
106
110
  Snippet = "Snippet",
107
111
  SourceBranch = "SourceBranch",
108
112
  State = "State",
109
113
  SubscriberCount = "SubscriberCount",
114
+ SubTasksProgress = "SubTasksProgress",
110
115
  TargetBranch = "TargetBranch",
111
116
  Title = "Title",
112
117
  ViewCount = "ViewCount",
@@ -1,4 +1,5 @@
1
1
  import { JsonLd } from 'json-ld-types';
2
+ import { LinkPerson } from '@atlaskit/link-extractors';
2
3
  import { LinkLocation } from '../../state/flexible-ui-context/types';
3
4
  export declare const extractCommentCount: (data: JsonLd.Data.BaseData) => number | undefined;
4
5
  export declare const extractDueOn: (data: JsonLd.Data.BaseData) => string | undefined;
@@ -6,6 +7,8 @@ export declare const extractViewCount: (data: JsonLd.Data.BaseData) => number |
6
7
  export declare const extractReactCount: (data: JsonLd.Data.BaseData) => number | undefined;
7
8
  export declare const extractVoteCount: (data: JsonLd.Data.BaseData) => number | undefined;
8
9
  export declare const extractOwnedBy: (data: JsonLd.Data.BaseData) => string | undefined;
10
+ export declare const extractAssignedTo: (data: JsonLd.Data.BaseData) => string | undefined;
11
+ export declare const extractPersonAssignedToAsArray: (data: JsonLd.Data.BaseData) => LinkPerson[] | undefined;
9
12
  export declare const extractCreatedBy: (data: JsonLd.Data.BaseData) => string | undefined;
10
13
  export declare const extractModifiedBy: (data: JsonLd.Data.BaseData) => string | undefined;
11
14
  export declare const extractProgrammingLanguage: (data: JsonLd.Data.BaseData) => string | undefined;
@@ -15,3 +18,5 @@ export declare const extractAttachmentCount: (data: JsonLd.Data.BaseData) => num
15
18
  export declare const extractTargetBranch: (data: JsonLd.Data.SourceCodePullRequest) => string | undefined;
16
19
  export declare const extractChecklistProgress: (data: JsonLd.Data.BaseData) => string | undefined;
17
20
  export declare const extractLocation: (data: JsonLd.Data.BaseData) => LinkLocation | undefined;
21
+ export declare const extractSubTasksProgress: (data: JsonLd.Data.BaseData) => string | undefined;
22
+ export declare const extractReadTime: (data: JsonLd.Data.BaseData) => string | undefined;
@@ -1,3 +1,5 @@
1
+ import { ElementItem } from '../../view/FlexibleCard/components/blocks/types';
1
2
  import { MetadataOptions } from '../../view/HoverCard/types';
2
3
  import { JsonLd } from 'json-ld-types';
4
+ export declare const elementNamesToItems: (elementNames: string[]) => ElementItem[];
3
5
  export declare const extractMetadata: (jsonLd: JsonLd.Primitives.Property<any>) => MetadataOptions;
@@ -1,6 +1,6 @@
1
1
  import { MessageDescriptor } from 'react-intl-next';
2
2
  export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
3
- export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
3
+ export type MessageKey = 'assigned_to' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
4
4
  type Messages = {
5
5
  [K in MessageKey]: MessageDescriptor;
6
6
  };