@atlaskit/smart-card 26.13.0 → 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 (72) hide show
  1. package/CHANGELOG.md +12 -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 +31 -1
  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/FlexibleUnauthorisedView.js +15 -5
  10. package/dist/cjs/view/BlockCard/views/flexible/styled.js +15 -0
  11. package/dist/cjs/view/BlockCard/views/flexible/utils.js +116 -0
  12. package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +31 -18
  13. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
  14. package/dist/cjs/view/FlexibleCard/components/elements/index.js +33 -4
  15. package/dist/cjs/view/FlexibleCard/components/elements/utils.js +20 -0
  16. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +28 -12
  17. package/dist/cjs/view/HoverCard/utils.js +102 -3
  18. package/dist/es2019/constants.js +6 -0
  19. package/dist/es2019/extractors/flexible/index.js +7 -2
  20. package/dist/es2019/extractors/flexible/utils.js +18 -1
  21. package/dist/es2019/extractors/hover/extractMetadata.js +1 -1
  22. package/dist/es2019/messages.js +31 -1
  23. package/dist/es2019/version.json +1 -1
  24. package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +24 -38
  25. package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +13 -5
  26. package/dist/es2019/view/BlockCard/views/flexible/styled.js +14 -0
  27. package/dist/es2019/view/BlockCard/views/flexible/utils.js +108 -0
  28. package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +33 -20
  29. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +5 -0
  30. package/dist/es2019/view/FlexibleCard/components/elements/index.js +24 -0
  31. package/dist/es2019/view/FlexibleCard/components/elements/utils.js +25 -0
  32. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +30 -14
  33. package/dist/es2019/view/HoverCard/utils.js +100 -1
  34. package/dist/esm/constants.js +6 -0
  35. package/dist/esm/extractors/flexible/index.js +7 -2
  36. package/dist/esm/extractors/flexible/utils.js +18 -1
  37. package/dist/esm/extractors/hover/extractMetadata.js +1 -1
  38. package/dist/esm/messages.js +31 -1
  39. package/dist/esm/version.json +1 -1
  40. package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +23 -38
  41. package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -5
  42. package/dist/esm/view/BlockCard/views/flexible/styled.js +7 -0
  43. package/dist/esm/view/BlockCard/views/flexible/utils.js +108 -0
  44. package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +33 -20
  45. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
  46. package/dist/esm/view/FlexibleCard/components/elements/index.js +24 -0
  47. package/dist/esm/view/FlexibleCard/components/elements/utils.js +20 -0
  48. package/dist/esm/view/HoverCard/components/views/resolved/index.js +30 -14
  49. package/dist/esm/view/HoverCard/utils.js +98 -1
  50. package/dist/types/constants.d.ts +5 -0
  51. package/dist/types/extractors/flexible/utils.d.ts +5 -0
  52. package/dist/types/extractors/hover/extractMetadata.d.ts +2 -0
  53. package/dist/types/messages.d.ts +1 -1
  54. package/dist/types/state/flexible-ui-context/types.d.ts +25 -0
  55. package/dist/types/view/BlockCard/views/flexible/styled.d.ts +2 -0
  56. package/dist/types/view/BlockCard/views/flexible/utils.d.ts +10 -0
  57. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +35 -2
  58. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +24 -0
  59. package/dist/types/view/HoverCard/utils.d.ts +1 -0
  60. package/dist/types-ts4.5/constants.d.ts +5 -0
  61. package/dist/types-ts4.5/extractors/flexible/utils.d.ts +5 -0
  62. package/dist/types-ts4.5/extractors/hover/extractMetadata.d.ts +2 -0
  63. package/dist/types-ts4.5/messages.d.ts +1 -1
  64. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +25 -0
  65. package/dist/types-ts4.5/view/BlockCard/views/flexible/styled.d.ts +2 -0
  66. package/dist/types-ts4.5/view/BlockCard/views/flexible/utils.d.ts +10 -0
  67. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +35 -2
  68. package/dist/types-ts4.5/view/FlexibleCard/components/elements/index.d.ts +24 -0
  69. package/dist/types-ts4.5/view/HoverCard/utils.d.ts +1 -0
  70. package/package.json +5 -2
  71. package/report.api.md +40 -0
  72. package/tmp/api-report-tmp.d.ts +36 -1
@@ -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' | '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' | '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