@atlaskit/smart-card 46.1.12 → 46.1.14

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 (139) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/common/ui/icons/blog-icon.js +0 -3
  3. package/dist/cjs/common/ui/icons/live-document-icon.js +0 -3
  4. package/dist/cjs/common/ui/icons/transform-smart-link-size-to-icon-tile-size.js +3 -16
  5. package/dist/cjs/extractors/common/icon/extractIcon.js +9 -19
  6. package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +2 -4
  7. package/dist/cjs/extractors/common/icon/extractIconFromTask.js +10 -15
  8. package/dist/cjs/extractors/flexible/icon/extract-document-type-icon.js +14 -37
  9. package/dist/cjs/extractors/flexible/icon/extract-file-formatIcon.js +1 -4
  10. package/dist/cjs/extractors/flexible/icon/extract-jira-task-icon.js +15 -40
  11. package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +48 -127
  12. package/dist/cjs/extractors/inline/index.js +7 -11
  13. package/dist/cjs/utils/analytics/analytics.js +1 -1
  14. package/dist/cjs/utils/get-icon-for-file-type.js +7 -20
  15. package/dist/cjs/utils/get-lazy-icons.js +10 -31
  16. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +5 -13
  17. package/dist/cjs/view/FlexibleCard/components/elements/common/base-icon-element/index.js +15 -23
  18. package/dist/cjs/view/FlexibleCard/components/elements/link-icon-element/index.js +10 -25
  19. package/dist/cjs/view/LinkUrl/index.js +1 -1
  20. package/dist/cjs/view/common/image-icon/index.js +2 -14
  21. package/dist/es2019/common/ui/icons/blog-icon.js +0 -3
  22. package/dist/es2019/common/ui/icons/live-document-icon.js +0 -3
  23. package/dist/es2019/common/ui/icons/transform-smart-link-size-to-icon-tile-size.js +3 -16
  24. package/dist/es2019/extractors/common/icon/extractIcon.js +7 -13
  25. package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +2 -4
  26. package/dist/es2019/extractors/common/icon/extractIconFromTask.js +10 -13
  27. package/dist/es2019/extractors/flexible/icon/extract-document-type-icon.js +13 -36
  28. package/dist/es2019/extractors/flexible/icon/extract-file-formatIcon.js +2 -5
  29. package/dist/es2019/extractors/flexible/icon/extract-jira-task-icon.js +14 -39
  30. package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +46 -131
  31. package/dist/es2019/extractors/inline/index.js +7 -11
  32. package/dist/es2019/utils/analytics/analytics.js +1 -1
  33. package/dist/es2019/utils/get-icon-for-file-type.js +7 -20
  34. package/dist/es2019/utils/get-lazy-icons.js +20 -21
  35. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +5 -12
  36. package/dist/es2019/view/FlexibleCard/components/elements/common/base-icon-element/index.js +15 -24
  37. package/dist/es2019/view/FlexibleCard/components/elements/link-icon-element/index.js +9 -24
  38. package/dist/es2019/view/LinkUrl/index.js +1 -1
  39. package/dist/es2019/view/common/image-icon/index.js +2 -15
  40. package/dist/esm/common/ui/icons/blog-icon.js +0 -3
  41. package/dist/esm/common/ui/icons/live-document-icon.js +0 -3
  42. package/dist/esm/common/ui/icons/transform-smart-link-size-to-icon-tile-size.js +3 -16
  43. package/dist/esm/extractors/common/icon/extractIcon.js +9 -19
  44. package/dist/esm/extractors/common/icon/extractIconFromDocument.js +2 -4
  45. package/dist/esm/extractors/common/icon/extractIconFromTask.js +10 -15
  46. package/dist/esm/extractors/flexible/icon/extract-document-type-icon.js +14 -37
  47. package/dist/esm/extractors/flexible/icon/extract-file-formatIcon.js +1 -4
  48. package/dist/esm/extractors/flexible/icon/extract-jira-task-icon.js +15 -40
  49. package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +48 -127
  50. package/dist/esm/extractors/inline/index.js +7 -11
  51. package/dist/esm/utils/analytics/analytics.js +1 -1
  52. package/dist/esm/utils/get-icon-for-file-type.js +7 -20
  53. package/dist/esm/utils/get-lazy-icons.js +20 -21
  54. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +5 -13
  55. package/dist/esm/view/FlexibleCard/components/elements/common/base-icon-element/index.js +15 -24
  56. package/dist/esm/view/FlexibleCard/components/elements/link-icon-element/index.js +9 -24
  57. package/dist/esm/view/LinkUrl/index.js +1 -1
  58. package/dist/esm/view/common/image-icon/index.js +2 -14
  59. package/dist/types/extractors/common/icon/extractIcon.d.ts +0 -1
  60. package/dist/types/extractors/flexible/icon/extract-document-type-icon.d.ts +1 -3
  61. package/dist/types/extractors/flexible/icon/extract-jira-task-icon.d.ts +1 -1
  62. package/package.json +3 -15
  63. package/dist/cjs/common/ui/icons/priority-blocker-icon.compiled.css +0 -5
  64. package/dist/cjs/common/ui/icons/priority-blocker-icon.js +0 -50
  65. package/dist/cjs/common/ui/icons/priority-critical-icon.compiled.css +0 -5
  66. package/dist/cjs/common/ui/icons/priority-critical-icon.js +0 -50
  67. package/dist/cjs/common/ui/icons/priority-high-icon.compiled.css +0 -5
  68. package/dist/cjs/common/ui/icons/priority-high-icon.js +0 -50
  69. package/dist/cjs/common/ui/icons/priority-highest-icon.compiled.css +0 -5
  70. package/dist/cjs/common/ui/icons/priority-highest-icon.js +0 -56
  71. package/dist/cjs/common/ui/icons/priority-icon.compiled.css +0 -4
  72. package/dist/cjs/common/ui/icons/priority-icon.js +0 -49
  73. package/dist/cjs/common/ui/icons/priority-low-icon.compiled.css +0 -5
  74. package/dist/cjs/common/ui/icons/priority-low-icon.js +0 -50
  75. package/dist/cjs/common/ui/icons/priority-lowest-icon.compiled.css +0 -5
  76. package/dist/cjs/common/ui/icons/priority-lowest-icon.js +0 -56
  77. package/dist/cjs/common/ui/icons/priority-major-icon.compiled.css +0 -5
  78. package/dist/cjs/common/ui/icons/priority-major-icon.js +0 -62
  79. package/dist/cjs/common/ui/icons/priority-medium-icon.compiled.css +0 -5
  80. package/dist/cjs/common/ui/icons/priority-medium-icon.js +0 -50
  81. package/dist/cjs/common/ui/icons/priority-minor-icon.compiled.css +0 -5
  82. package/dist/cjs/common/ui/icons/priority-minor-icon.js +0 -62
  83. package/dist/cjs/common/ui/icons/priority-trivial-icon.compiled.css +0 -5
  84. package/dist/cjs/common/ui/icons/priority-trivial-icon.js +0 -50
  85. package/dist/es2019/common/ui/icons/priority-blocker-icon.compiled.css +0 -5
  86. package/dist/es2019/common/ui/icons/priority-blocker-icon.js +0 -38
  87. package/dist/es2019/common/ui/icons/priority-critical-icon.compiled.css +0 -5
  88. package/dist/es2019/common/ui/icons/priority-critical-icon.js +0 -38
  89. package/dist/es2019/common/ui/icons/priority-high-icon.compiled.css +0 -5
  90. package/dist/es2019/common/ui/icons/priority-high-icon.js +0 -38
  91. package/dist/es2019/common/ui/icons/priority-highest-icon.compiled.css +0 -5
  92. package/dist/es2019/common/ui/icons/priority-highest-icon.js +0 -44
  93. package/dist/es2019/common/ui/icons/priority-icon.compiled.css +0 -4
  94. package/dist/es2019/common/ui/icons/priority-icon.js +0 -35
  95. package/dist/es2019/common/ui/icons/priority-low-icon.compiled.css +0 -5
  96. package/dist/es2019/common/ui/icons/priority-low-icon.js +0 -38
  97. package/dist/es2019/common/ui/icons/priority-lowest-icon.compiled.css +0 -5
  98. package/dist/es2019/common/ui/icons/priority-lowest-icon.js +0 -44
  99. package/dist/es2019/common/ui/icons/priority-major-icon.compiled.css +0 -5
  100. package/dist/es2019/common/ui/icons/priority-major-icon.js +0 -50
  101. package/dist/es2019/common/ui/icons/priority-medium-icon.compiled.css +0 -5
  102. package/dist/es2019/common/ui/icons/priority-medium-icon.js +0 -38
  103. package/dist/es2019/common/ui/icons/priority-minor-icon.compiled.css +0 -5
  104. package/dist/es2019/common/ui/icons/priority-minor-icon.js +0 -50
  105. package/dist/es2019/common/ui/icons/priority-trivial-icon.compiled.css +0 -5
  106. package/dist/es2019/common/ui/icons/priority-trivial-icon.js +0 -38
  107. package/dist/esm/common/ui/icons/priority-blocker-icon.compiled.css +0 -5
  108. package/dist/esm/common/ui/icons/priority-blocker-icon.js +0 -41
  109. package/dist/esm/common/ui/icons/priority-critical-icon.compiled.css +0 -5
  110. package/dist/esm/common/ui/icons/priority-critical-icon.js +0 -41
  111. package/dist/esm/common/ui/icons/priority-high-icon.compiled.css +0 -5
  112. package/dist/esm/common/ui/icons/priority-high-icon.js +0 -41
  113. package/dist/esm/common/ui/icons/priority-highest-icon.compiled.css +0 -5
  114. package/dist/esm/common/ui/icons/priority-highest-icon.js +0 -47
  115. package/dist/esm/common/ui/icons/priority-icon.compiled.css +0 -4
  116. package/dist/esm/common/ui/icons/priority-icon.js +0 -40
  117. package/dist/esm/common/ui/icons/priority-low-icon.compiled.css +0 -5
  118. package/dist/esm/common/ui/icons/priority-low-icon.js +0 -41
  119. package/dist/esm/common/ui/icons/priority-lowest-icon.compiled.css +0 -5
  120. package/dist/esm/common/ui/icons/priority-lowest-icon.js +0 -47
  121. package/dist/esm/common/ui/icons/priority-major-icon.compiled.css +0 -5
  122. package/dist/esm/common/ui/icons/priority-major-icon.js +0 -53
  123. package/dist/esm/common/ui/icons/priority-medium-icon.compiled.css +0 -5
  124. package/dist/esm/common/ui/icons/priority-medium-icon.js +0 -41
  125. package/dist/esm/common/ui/icons/priority-minor-icon.compiled.css +0 -5
  126. package/dist/esm/common/ui/icons/priority-minor-icon.js +0 -53
  127. package/dist/esm/common/ui/icons/priority-trivial-icon.compiled.css +0 -5
  128. package/dist/esm/common/ui/icons/priority-trivial-icon.js +0 -41
  129. package/dist/types/common/ui/icons/priority-blocker-icon.d.ts +0 -13
  130. package/dist/types/common/ui/icons/priority-critical-icon.d.ts +0 -13
  131. package/dist/types/common/ui/icons/priority-high-icon.d.ts +0 -13
  132. package/dist/types/common/ui/icons/priority-highest-icon.d.ts +0 -13
  133. package/dist/types/common/ui/icons/priority-icon.d.ts +0 -13
  134. package/dist/types/common/ui/icons/priority-low-icon.d.ts +0 -13
  135. package/dist/types/common/ui/icons/priority-lowest-icon.d.ts +0 -13
  136. package/dist/types/common/ui/icons/priority-major-icon.d.ts +0 -13
  137. package/dist/types/common/ui/icons/priority-medium-icon.d.ts +0 -13
  138. package/dist/types/common/ui/icons/priority-minor-icon.d.ts +0 -13
  139. package/dist/types/common/ui/icons/priority-trivial-icon.d.ts +0 -13
@@ -1,5 +1,3 @@
1
- import { extractTitle } from '@atlaskit/link-extractors/extract-title';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
1
  import { IconType } from '../../../constants';
4
2
  import { prioritiseIcon } from '../../common/icon/prioritiseIcon';
5
3
  import { extractorPriorityMap as priorityMap } from '../../common/icon/priority';
@@ -10,28 +8,12 @@ import extractFileFormatIcon from './extract-file-formatIcon';
10
8
  import extractJiraTaskIcon from './extract-jira-task-icon';
11
9
  import extractProviderIcon from './extract-provider-icon';
12
10
  import extractUrlIcon from './extract-url-icon';
13
- const extractTask = (data, label) => {
14
- const {
15
- id,
16
- icon: url
17
- } = extractTaskType(data) || {};
18
- const taskType = id === null || id === void 0 ? void 0 : id.split('#').pop();
19
- const taskIcon = url ? {
20
- label,
21
- url
22
- } : undefined;
23
- return {
24
- taskType,
25
- taskIcon
26
- };
27
- };
28
- const extractTaskNew = data => {
29
- const taskTypeInfo = extractTaskType(data) || {};
11
+ const extractTask = data => {
30
12
  const {
31
13
  id,
32
14
  icon: url,
33
15
  name
34
- } = taskTypeInfo;
16
+ } = extractTaskType(data) || {};
35
17
  const taskType = id === null || id === void 0 ? void 0 : id.split('#').pop();
36
18
  const taskIconLabel = (name === null || name === void 0 ? void 0 : name.trim()) || 'Task';
37
19
  const taskIcon = url ? {
@@ -49,11 +31,7 @@ const extractType = jsonLd => {
49
31
  };
50
32
  const isJiraProvider = provider => provider === JIRA_GENERATOR_ID;
51
33
  function chooseIcon({
52
- urlIcon,
53
- // NAVX-4354: remove this during cleanup
54
34
  type,
55
- label,
56
- // NAVX-4354: remove this during cleanup
57
35
  data,
58
36
  providerIcon
59
37
  }) {
@@ -61,107 +39,58 @@ function chooseIcon({
61
39
  const providerId = (_data$generator = data.generator) === null || _data$generator === void 0 ? void 0 : _data$generator['@id'];
62
40
  const fileFormat = data === null || data === void 0 ? void 0 : data['schema:fileFormat'];
63
41
  const fileFormatIcon = extractFileFormatIcon(fileFormat);
64
- if (fg('platform_navx_smart_link_icon_label_a11y')) {
65
- const iconDescriptor = typeToIconDescriptor({
66
- type,
67
- providerId,
68
- data
69
- });
70
- const documentTitle = fg('platform_navx_smart_link_icon_label_a11y') ? undefined : extractTitle(data);
71
- const extractedDocumentTypeIcon = extractDocumentTypeIcon(type, documentTitle, providerId);
72
- const documentTypeIcon = iconDescriptor || extractedDocumentTypeIcon;
73
- const urlIconNew = extractUrlIcon(data.icon, documentTypeIcon === null || documentTypeIcon === void 0 ? void 0 : documentTypeIcon.label);
74
- return prioritiseIcon({
75
- fileFormatIcon,
76
- documentTypeIcon,
77
- urlIcon: urlIconNew,
78
- providerIcon
79
- });
80
- } else {
81
- const documentTypeIcon = typeToIconDescriptor({
82
- type,
83
- label,
84
- providerId,
85
- data
86
- }) || extractDocumentTypeIcon(type, label, providerId);
87
- return prioritiseIcon({
88
- fileFormatIcon,
89
- documentTypeIcon,
90
- urlIcon,
91
- providerIcon
92
- });
93
- }
42
+ const iconDescriptor = typeToIconDescriptor({
43
+ type,
44
+ providerId,
45
+ data
46
+ });
47
+ const extractedDocumentTypeIcon = extractDocumentTypeIcon(type, providerId);
48
+ const documentTypeIcon = iconDescriptor || extractedDocumentTypeIcon;
49
+ const urlIcon = extractUrlIcon(data.icon, documentTypeIcon === null || documentTypeIcon === void 0 ? void 0 : documentTypeIcon.label);
50
+ return prioritiseIcon({
51
+ fileFormatIcon,
52
+ documentTypeIcon,
53
+ urlIcon,
54
+ providerIcon
55
+ });
94
56
  }
95
57
  function typeToIconDescriptor({
96
58
  type,
97
- label,
98
- // NAVX-4354: remove this during cleanup
99
59
  providerId,
100
60
  data
101
61
  }) {
102
- const descriptorLabel = semantic => fg('platform_navx_smart_link_icon_label_a11y') ? semantic : label;
62
+ const getIconDescriptor = (icon, label) => ({
63
+ icon,
64
+ label
65
+ });
103
66
  switch (type) {
104
67
  case 'atlassian:Goal':
105
- return {
106
- icon: IconType.Task,
107
- label: descriptorLabel('goal')
108
- };
68
+ return getIconDescriptor(IconType.Task, 'goal');
109
69
  case 'atlassian:Project':
110
- return {
111
- // FIXME: atlassian:Project seem to be returned for many things, including Confluence space or Trello board,
112
- // But `IconType.Project` actual value is `BitBucket:Project`!
113
- icon: IconType.Project,
114
- label: descriptorLabel('project')
115
- };
70
+ // FIXME: atlassian:Project seem to be returned for many things, including Confluence space or Trello board,
71
+ // But `IconType.Project` actual value is `BitBucket:Project`!
72
+ return getIconDescriptor(IconType.Project, 'project');
116
73
  case 'atlassian:SourceCodeCommit':
117
- return {
118
- icon: IconType.Commit,
119
- label: descriptorLabel('commit')
120
- };
74
+ return getIconDescriptor(IconType.Commit, 'commit');
121
75
  case 'atlassian:SourceCodePullRequest':
122
- return {
123
- icon: IconType.PullRequest,
124
- label: descriptorLabel('pull request')
125
- };
76
+ return getIconDescriptor(IconType.PullRequest, 'pull request');
126
77
  case 'atlassian:SourceCodeReference':
127
- return {
128
- icon: IconType.Branch,
129
- label: descriptorLabel('branch')
130
- };
78
+ return getIconDescriptor(IconType.Branch, 'branch');
131
79
  case 'atlassian:SourceCodeRepository':
132
- return {
133
- icon: IconType.Repo,
134
- label: descriptorLabel('repository')
135
- };
80
+ return getIconDescriptor(IconType.Repo, 'repository');
136
81
  case 'atlassian:Task':
137
- if (fg('platform_navx_smart_link_icon_label_a11y')) {
138
- const taskIconDescriptor = {
139
- icon: IconType.Task,
140
- label: descriptorLabel('task')
141
- };
142
- if (isJiraProvider(providerId)) {
143
- const {
144
- taskType,
145
- taskIcon
146
- } = extractTaskNew(data);
147
- return taskType === 'JiraCustomTaskType' ? taskIcon || taskIconDescriptor : extractJiraTaskIcon(taskType);
148
- }
149
- return taskIconDescriptor;
150
- } else {
151
- const taskLabel = label || 'Task';
152
- const taskIconDescriptor = {
153
- icon: IconType.Task,
154
- label: taskLabel
155
- };
156
- if (isJiraProvider(providerId)) {
157
- const {
158
- taskType,
159
- taskIcon
160
- } = extractTask(data);
161
- return taskType === 'JiraCustomTaskType' ? taskIcon || taskIconDescriptor : extractJiraTaskIcon(taskType, taskLabel);
162
- }
163
- return taskIconDescriptor;
82
+ const taskIconDescriptor = {
83
+ icon: IconType.Task,
84
+ label: 'task'
85
+ };
86
+ if (isJiraProvider(providerId)) {
87
+ const {
88
+ taskType,
89
+ taskIcon
90
+ } = extractTask(data);
91
+ return taskType === 'JiraCustomTaskType' ? taskIcon || taskIconDescriptor : extractJiraTaskIcon(taskType);
164
92
  }
93
+ return taskIconDescriptor;
165
94
  default:
166
95
  return undefined;
167
96
  }
@@ -171,26 +100,12 @@ function typeToIconDescriptor({
171
100
  * Return the icon object given a JSON-LD data object.
172
101
  */
173
102
  const extractJsonldDataIcon = data => {
174
- if (fg('platform_navx_smart_link_icon_label_a11y')) {
175
- const type = extractType(data);
176
- const providerIcon = extractProviderIcon(data);
177
- return chooseIcon({
178
- type,
179
- data,
180
- providerIcon
181
- });
182
- } else {
183
- const label = extractTitle(data);
184
- const type = extractType(data);
185
- const urlIcon = extractUrlIcon(data.icon, label);
186
- const providerIcon = extractProviderIcon(data);
187
- return chooseIcon({
188
- urlIcon,
189
- providerIcon,
190
- type,
191
- label,
192
- data
193
- });
194
- }
103
+ const type = extractType(data);
104
+ const providerIcon = extractProviderIcon(data);
105
+ return chooseIcon({
106
+ type,
107
+ data,
108
+ providerIcon
109
+ });
195
110
  };
196
111
  export default extractJsonldDataIcon;
@@ -7,7 +7,6 @@ import { extractSmartLinkUrl } from '@atlaskit/link-extractors/extract-smart-lin
7
7
  import { extractType } from '@atlaskit/link-extractors/extract-type';
8
8
  import { isEntityPresent } from '@atlaskit/link-extractors/is-entity-present';
9
9
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
10
- import { fg } from '@atlaskit/platform-feature-flags/fg';
11
10
  import { getEmptyJsonLd } from '../../utils/get-empty-json-ld';
12
11
  import { extractIcon } from '../common/icon/extractIcon';
13
12
  import { extractLozenge } from '../common/lozenge/extractLozenge';
@@ -19,18 +18,15 @@ const extractInlineIcon = (jsonLd, showIconLabel = true) => {
19
18
  const provider = extractProvider(jsonLd);
20
19
  if (provider && provider.id) {
21
20
  if (provider.id === CONFLUENCE_GENERATOR_ID || provider.id === JIRA_GENERATOR_ID) {
22
- if (fg('platform_navx_jira_issue_type_icon_label_a11y')) {
23
- const icon = extractIcon(jsonLd, 'type', showIconLabel);
24
- if (provider.id === JIRA_GENERATOR_ID && typeof icon === 'string') {
25
- var _extractTaskType, _extractTaskType$name;
26
- const taskTypeLabel = (_extractTaskType = extractTaskType(jsonLd)) === null || _extractTaskType === void 0 ? void 0 : (_extractTaskType$name = _extractTaskType.name) === null || _extractTaskType$name === void 0 ? void 0 : _extractTaskType$name.trim();
27
- if (taskTypeLabel) {
28
- return [icon, taskTypeLabel];
29
- }
21
+ const icon = extractIcon(jsonLd, 'type', showIconLabel);
22
+ if (provider.id === JIRA_GENERATOR_ID && typeof icon === 'string') {
23
+ var _extractTaskType, _extractTaskType$name;
24
+ const taskTypeLabel = (_extractTaskType = extractTaskType(jsonLd)) === null || _extractTaskType === void 0 ? void 0 : (_extractTaskType$name = _extractTaskType.name) === null || _extractTaskType$name === void 0 ? void 0 : _extractTaskType$name.trim();
25
+ if (taskTypeLabel) {
26
+ return [icon, taskTypeLabel];
30
27
  }
31
- return icon;
32
28
  }
33
- return extractIcon(jsonLd, 'type', showIconLabel);
29
+ return icon;
34
30
  }
35
31
  }
36
32
  return extractIcon(jsonLd, 'provider', showIconLabel);
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "46.1.11" || ''
7
+ packageVersion: "46.1.13" || ''
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,21 +1,15 @@
1
1
  import React from 'react';
2
2
  import Loadable from 'react-loadable';
3
- import { fg } from '@atlaskit/platform-feature-flags/fg';
4
3
  import extractFileFormatIcon from '../extractors/flexible/icon/extract-file-formatIcon';
5
4
  import { getLazyIcons } from './get-lazy-icons';
6
5
  const getTypeToIconMap = fileFormat => {
6
+ var _lazyIcons$iconDescri, _iconDescriptor$label;
7
7
  const iconDescriptor = extractFileFormatIcon(fileFormat);
8
8
  if (!(iconDescriptor !== null && iconDescriptor !== void 0 && iconDescriptor.icon)) {
9
9
  return null;
10
10
  }
11
11
  const lazyIcons = getLazyIcons();
12
- if (fg('platform_navx_smart_link_icon_label_a11y')) {
13
- var _lazyIcons$iconDescri, _iconDescriptor$label;
14
- return [(_lazyIcons$iconDescri = lazyIcons[iconDescriptor.icon]) === null || _lazyIcons$iconDescri === void 0 ? void 0 : _lazyIcons$iconDescri.default, (_iconDescriptor$label = iconDescriptor.label) !== null && _iconDescriptor$label !== void 0 ? _iconDescriptor$label : ''];
15
- } else {
16
- var _lazyIcons$iconDescri2;
17
- return [(_lazyIcons$iconDescri2 = lazyIcons[iconDescriptor.icon]) === null || _lazyIcons$iconDescri2 === void 0 ? void 0 : _lazyIcons$iconDescri2.default];
18
- }
12
+ return [(_lazyIcons$iconDescri = lazyIcons[iconDescriptor.icon]) === null || _lazyIcons$iconDescri === void 0 ? void 0 : _lazyIcons$iconDescri.default, (_iconDescriptor$label = iconDescriptor.label) !== null && _iconDescriptor$label !== void 0 ? _iconDescriptor$label : ''];
19
13
  };
20
14
  export const getIconForFileType = (fileMimeType, showIconLabel) => {
21
15
  if (!fileMimeType) {
@@ -34,16 +28,9 @@ export const getIconForFileType = (fileMimeType, showIconLabel) => {
34
28
  loading: () => null
35
29
  }); // because we're using dynamic loading here, TS will not be able to infer the type
36
30
 
37
- if (fg('platform_navx_smart_link_icon_label_a11y')) {
38
- const descriptorLabel = icon[1] || ''; // NAVX-4354: Combine into const [importCb] = icon; above
39
- const label = (showIconLabel !== null && showIconLabel !== void 0 ? showIconLabel : true) ? descriptorLabel : '';
40
- return /*#__PURE__*/React.createElement(Icon, {
41
- testId: "document-file-format-icon",
42
- label: label
43
- });
44
- } else {
45
- return /*#__PURE__*/React.createElement(Icon, {
46
- testId: "document-file-format-icon"
47
- });
48
- }
31
+ const label = (showIconLabel !== null && showIconLabel !== void 0 ? showIconLabel : true) ? icon[1] || '' : '';
32
+ return /*#__PURE__*/React.createElement(Icon, {
33
+ testId: "document-file-format-icon",
34
+ label: label
35
+ });
49
36
  };
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { fg } from '@atlaskit/platform-feature-flags/fg';
4
3
  import { IconType } from '../constants';
5
4
  const loadPriorityIcons = () => import( /* webpackChunkName: "@atlaskit-internal_priority-icons" */'../common/ui/icons/priority-icons');
6
5
 
@@ -261,74 +260,74 @@ export const getLazyIcons = () => {
261
260
  },
262
261
  // Priority icons stay lazy, but share one chunk to avoid a cold-cache request per icon type.
263
262
  [IconType.PriorityBlocker]: {
264
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
263
+ default: () => loadPriorityIcons().then(({
265
264
  PriorityBlockerIcon: defaultIcon
266
265
  }) => ({
267
266
  default: defaultIcon
268
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphBlocker" */'../common/ui/icons/priority-blocker-icon')
267
+ }))
269
268
  },
270
269
  [IconType.PriorityCritical]: {
271
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
270
+ default: () => loadPriorityIcons().then(({
272
271
  PriorityCriticalIcon: defaultIcon
273
272
  }) => ({
274
273
  default: defaultIcon
275
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphCritical" */'../common/ui/icons/priority-critical-icon')
274
+ }))
276
275
  },
277
276
  [IconType.PriorityHigh]: {
278
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
277
+ default: () => loadPriorityIcons().then(({
279
278
  PriorityHighIcon: defaultIcon
280
279
  }) => ({
281
280
  default: defaultIcon
282
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphHigh" */'../common/ui/icons/priority-high-icon')
281
+ }))
283
282
  },
284
283
  [IconType.PriorityHighest]: {
285
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
284
+ default: () => loadPriorityIcons().then(({
286
285
  PriorityHighestIcon: defaultIcon
287
286
  }) => ({
288
287
  default: defaultIcon
289
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphHighest" */'../common/ui/icons/priority-highest-icon')
288
+ }))
290
289
  },
291
290
  [IconType.PriorityLow]: {
292
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
291
+ default: () => loadPriorityIcons().then(({
293
292
  PriorityLowIcon: defaultIcon
294
293
  }) => ({
295
294
  default: defaultIcon
296
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphLow" */'../common/ui/icons/priority-low-icon')
295
+ }))
297
296
  },
298
297
  [IconType.PriorityLowest]: {
299
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
298
+ default: () => loadPriorityIcons().then(({
300
299
  PriorityLowestIcon: defaultIcon
301
300
  }) => ({
302
301
  default: defaultIcon
303
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphLowest" */'../common/ui/icons/priority-lowest-icon')
302
+ }))
304
303
  },
305
304
  [IconType.PriorityMajor]: {
306
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
305
+ default: () => loadPriorityIcons().then(({
307
306
  PriorityMajorIcon: defaultIcon
308
307
  }) => ({
309
308
  default: defaultIcon
310
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphMajor" */'../common/ui/icons/priority-major-icon')
309
+ }))
311
310
  },
312
311
  [IconType.PriorityMedium]: {
313
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
312
+ default: () => loadPriorityIcons().then(({
314
313
  PriorityMediumIcon: defaultIcon
315
314
  }) => ({
316
315
  default: defaultIcon
317
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphMedium" */'../common/ui/icons/priority-medium-icon')
316
+ }))
318
317
  },
319
318
  [IconType.PriorityMinor]: {
320
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
319
+ default: () => loadPriorityIcons().then(({
321
320
  PriorityMinorIcon: defaultIcon
322
321
  }) => ({
323
322
  default: defaultIcon
324
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphMinor" */'../common/ui/icons/priority-minor-icon')
323
+ }))
325
324
  },
326
325
  [IconType.PriorityTrivial]: {
327
- default: () => fg('platform_sl_priority_icon') ? loadPriorityIcons().then(({
326
+ default: () => loadPriorityIcons().then(({
328
327
  PriorityTrivialIcon: defaultIcon
329
328
  }) => ({
330
329
  default: defaultIcon
331
- })) : import( /* webpackChunkName: "@atlaskit-internal_glyphTrivial" */'../common/ui/icons/priority-trivial-icon')
330
+ }))
332
331
  }
333
332
  };
334
333
  };
@@ -26,7 +26,7 @@ const getDocumentIcon = () => require('../../../../../common/ui/icons/page-icon'
26
26
  const getLiveDocumentIcon = () => require('../../../../../common/ui/icons/live-document-icon').default;
27
27
  const PRIORITY_ICONS = [IconType.PriorityBlocker, IconType.PriorityCritical, IconType.PriorityHigh, IconType.PriorityHighest, IconType.PriorityLow, IconType.PriorityLowest, IconType.PriorityMajor, IconType.PriorityMedium, IconType.PriorityMinor, IconType.PriorityTrivial];
28
28
  const isCoreIcon = icon => {
29
- return [IconType.Project, IconType.Template, IconType.Forbidden, IconType.Default, IconType.Error, IconType.Attachment, IconType.CheckItem, IconType.Component, IconType.Comment, IconType.View, IconType.React, IconType.Vote, IconType.PriorityUndefined, IconType.ProgrammingLanguage, IconType.Subscriber, IconType.SubTasksProgress, ...(fg('platform_sl_priority_icon') ? PRIORITY_ICONS : [])].includes(icon);
29
+ return [IconType.Project, IconType.Template, IconType.Forbidden, IconType.Default, IconType.Error, IconType.Attachment, IconType.CheckItem, IconType.Component, IconType.Comment, IconType.View, IconType.React, IconType.Vote, IconType.PriorityUndefined, IconType.ProgrammingLanguage, IconType.Subscriber, IconType.SubTasksProgress, ...PRIORITY_ICONS].includes(icon);
30
30
  };
31
31
  const AtlaskitIcon = ({
32
32
  icon,
@@ -75,7 +75,7 @@ const AtlaskitIcon = ({
75
75
  return null;
76
76
  }
77
77
  const ImportedIcon = importIcon(importFn);
78
- if (isCoreIcon(icon) && fg('platform_sl_icons_refactor')) {
78
+ if (isCoreIcon(icon)) {
79
79
  let color;
80
80
  if (icon === IconType.Error || icon === IconType.Forbidden) {
81
81
  color = "var(--ds-icon-danger, #C9372C)";
@@ -90,7 +90,7 @@ const AtlaskitIcon = ({
90
90
  });
91
91
  case SmartLinkSize.Large:
92
92
  case SmartLinkSize.XLarge:
93
- if (PRIORITY_ICONS.includes(icon) && fg('platform_sl_priority_icon')) {
93
+ if (PRIORITY_ICONS.includes(icon)) {
94
94
  return /*#__PURE__*/React.createElement(ImportedIcon, {
95
95
  label: label,
96
96
  testId: testId,
@@ -145,18 +145,11 @@ const AtlaskitIcon = ({
145
145
  }));
146
146
  case IconType.Error:
147
147
  case IconType.Forbidden:
148
- if (fg('platform_sl_icons_refactor')) {
149
- return /*#__PURE__*/React.createElement(ImportedIcon, {
150
- label: label,
151
- testId: testId,
152
- size: size,
153
- isTiledIcon: isTiledIcon
154
- });
155
- }
156
148
  return /*#__PURE__*/React.createElement(ImportedIcon, {
157
149
  label: label,
158
150
  testId: testId,
159
- color: "var(--ds-icon-danger, #C9372C)"
151
+ size: size,
152
+ isTiledIcon: isTiledIcon
160
153
  });
161
154
  default:
162
155
  return /*#__PURE__*/React.createElement(ImportedIcon, {
@@ -1,12 +1,10 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v3.0.2 */
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import "./index.compiled.css";
4
- import * as React from 'react';
5
- import { ax, ix } from "@compiled/react/runtime";
6
2
  /* eslint-disable @compiled/shorthand-property-sorting */
7
3
  /* eslint-disable @atlaskit/design-system/use-tokens-typography */
8
4
  /* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
9
-
5
+ import "./index.compiled.css";
6
+ import * as React from 'react';
7
+ import { ax, ix } from "@compiled/react/runtime";
10
8
  import { useMemo } from 'react';
11
9
  import LinkIcon from '@atlaskit/icon/core/link';
12
10
  import { fg } from '@atlaskit/platform-feature-flags/fg';
@@ -32,18 +30,13 @@ const customRenderStyleMap = {
32
30
  };
33
31
  const renderAtlaskitIcon = (icon, testId, size = SmartLinkSize.Medium, label, isTiledIcon) => {
34
32
  if (icon) {
35
- return /*#__PURE__*/React.createElement(AtlaskitIcon, _extends({
33
+ return /*#__PURE__*/React.createElement(AtlaskitIcon, {
36
34
  icon: icon,
37
- testId: `${testId}-icon`
38
- }, fg('platform_navx_smart_link_icon_label_a11y') ? {
39
- label
40
- } : {
41
- 'aria-hidden': true,
42
- label: ''
43
- }, {
35
+ testId: `${testId}-icon`,
36
+ label: label,
44
37
  size: size,
45
38
  isTiledIcon: isTiledIcon
46
- }));
39
+ });
47
40
  }
48
41
  };
49
42
  const renderDefaultIcon = (label, testId) => /*#__PURE__*/React.createElement(LinkIcon, {
@@ -68,9 +61,8 @@ const widthFromSize = (size, isTiledIcon) => {
68
61
  const renderImageIcon = (defaultIcon, url, testId, size = SmartLinkSize.Medium, appearance, hideLoadingSkeleton, label) => {
69
62
  const width = size === SmartLinkSize.Large ? "var(--ds-space-300, 24px)" : "var(--ds-space-200, 16px)";
70
63
  if (url) {
71
- return /*#__PURE__*/React.createElement(ImageIcon, _extends({}, fg('platform_navx_smart_link_icon_label_a11y') ? {
72
- label
73
- } : {}, {
64
+ return /*#__PURE__*/React.createElement(ImageIcon, {
65
+ label: label,
74
66
  defaultIcon: defaultIcon,
75
67
  testId: testId,
76
68
  url: url,
@@ -78,15 +70,14 @@ const renderImageIcon = (defaultIcon, url, testId, size = SmartLinkSize.Medium,
78
70
  height: width,
79
71
  appearance: appearance,
80
72
  hideLoadingSkeleton: hideLoadingSkeleton
81
- }));
73
+ });
82
74
  }
83
75
  };
84
76
  const renderImageIconNew = (defaultIcon, url, testId, size = SmartLinkSize.Medium, appearance, hideLoadingSkeleton, label, isTiledIcon = false) => {
85
77
  const width = widthFromSize(size, isTiledIcon);
86
78
  if (url) {
87
- return /*#__PURE__*/React.createElement(ImageIcon, _extends({}, fg('platform_navx_smart_link_icon_label_a11y') ? {
88
- label
89
- } : {}, {
79
+ return /*#__PURE__*/React.createElement(ImageIcon, {
80
+ label: label,
90
81
  defaultIcon: defaultIcon,
91
82
  testId: testId,
92
83
  url: url,
@@ -94,7 +85,7 @@ const renderImageIconNew = (defaultIcon, url, testId, size = SmartLinkSize.Mediu
94
85
  height: width,
95
86
  appearance: appearance,
96
87
  hideLoadingSkeleton: hideLoadingSkeleton
97
- }));
88
+ });
98
89
  }
99
90
  };
100
91
 
@@ -119,10 +110,10 @@ const IconElement = ({
119
110
  hideLoadingSkeleton,
120
111
  isTiledIcon
121
112
  }) => {
122
- const label = fg('platform_navx_smart_link_icon_label_a11y') ? labelProp !== null && labelProp !== void 0 ? labelProp : '' : labelProp !== null && labelProp !== void 0 ? labelProp : 'Link';
113
+ const label = labelProp !== null && labelProp !== void 0 ? labelProp : '';
123
114
  const element = useMemo(() => {
124
115
  const defaultIcon = renderDefaultIcon(label, testId);
125
- return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || (fg('platform_sl_3p_preauth_better_hovercard_killswitch') ? renderImageIconNew(defaultIcon, url, testId, size, appearance, hideLoadingSkeleton, fg('platform_navx_smart_link_icon_label_a11y') ? label : undefined, isTiledIcon) : renderImageIcon(defaultIcon, url, testId, size, appearance, hideLoadingSkeleton, fg('platform_navx_smart_link_icon_label_a11y') ? label : undefined)) || renderAtlaskitIcon(icon, testId, size, fg('platform_navx_smart_link_icon_label_a11y') ? label : undefined, isTiledIcon) || defaultIcon;
116
+ return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || (fg('platform_sl_3p_preauth_better_hovercard_killswitch') ? renderImageIconNew(defaultIcon, url, testId, size, appearance, hideLoadingSkeleton, label, isTiledIcon) : renderImageIcon(defaultIcon, url, testId, size, appearance, hideLoadingSkeleton, label)) || renderAtlaskitIcon(icon, testId, size, label, isTiledIcon) || defaultIcon;
126
117
  }, [label, testId, overrideIcon, render, url, size, appearance, hideLoadingSkeleton, icon, isTiledIcon]);
127
118
  const width = getIconWidth(size);
128
119
  return /*#__PURE__*/React.createElement("div", {
@@ -1,39 +1,24 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { fg } from '@atlaskit/platform-feature-flags/fg';
4
3
  import { ElementName } from '../../../../../constants';
5
4
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context/useFlexibleUiContext';
6
5
  import { BaseIconElement, toLinkIconProps } from '../common';
7
6
  import { resourceTypeToLabel } from './resourceTypeToLabel';
8
7
  const LinkIconElement = props => {
8
+ var _context$meta, _context$type, _linkIconProps$label, _ref, _ref2, _context$meta2, _linkIconProps$label2;
9
9
  const context = useFlexibleUiContext();
10
10
  if (!context) {
11
11
  return null;
12
12
  }
13
- if (fg('platform_navx_smart_link_icon_label_a11y')) {
14
- var _ref3, _resourceTypeToLabel, _context$meta3, _linkIconProps$label3;
15
- const linkIconProps = toLinkIconProps(context === null || context === void 0 ? void 0 : context.linkIcon, context.type);
16
- if (!linkIconProps) {
17
- return null;
18
- }
19
- if (fg('platform_navx_jira_issue_type_icon_label_a11y')) {
20
- var _context$meta, _context$type, _linkIconProps$label, _ref, _ref2, _context$meta2, _linkIconProps$label2;
21
- const jiraIssueTypeLabel = ((_context$meta = context.meta) === null || _context$meta === void 0 ? void 0 : _context$meta.resourceType) === 'issue' && (_context$type = context.type) !== null && _context$type !== void 0 && _context$type.includes('atlassian:Task') ? (_linkIconProps$label = linkIconProps.label) === null || _linkIconProps$label === void 0 ? void 0 : _linkIconProps$label.trim() : undefined;
22
- const label = (_ref = (_ref2 = jiraIssueTypeLabel !== null && jiraIssueTypeLabel !== void 0 ? jiraIssueTypeLabel : resourceTypeToLabel((_context$meta2 = context.meta) === null || _context$meta2 === void 0 ? void 0 : _context$meta2.resourceType)) !== null && _ref2 !== void 0 ? _ref2 : (_linkIconProps$label2 = linkIconProps.label) === null || _linkIconProps$label2 === void 0 ? void 0 : _linkIconProps$label2.trim()) !== null && _ref !== void 0 ? _ref : props.label;
23
- return /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, linkIconProps, props, {
24
- label: label,
25
- name: ElementName.LinkIcon
26
- }));
27
- }
28
- const label = (_ref3 = (_resourceTypeToLabel = resourceTypeToLabel((_context$meta3 = context.meta) === null || _context$meta3 === void 0 ? void 0 : _context$meta3.resourceType)) !== null && _resourceTypeToLabel !== void 0 ? _resourceTypeToLabel : (_linkIconProps$label3 = linkIconProps.label) === null || _linkIconProps$label3 === void 0 ? void 0 : _linkIconProps$label3.trim()) !== null && _ref3 !== void 0 ? _ref3 : props.label;
29
- return /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, linkIconProps, props, {
30
- label: label,
31
- name: ElementName.LinkIcon
32
- }));
13
+ const linkIconProps = toLinkIconProps(context === null || context === void 0 ? void 0 : context.linkIcon, context.type);
14
+ if (!linkIconProps) {
15
+ return null;
33
16
  }
34
- const data = toLinkIconProps(context === null || context === void 0 ? void 0 : context.linkIcon, context.type);
35
- return data ? /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, data, props, {
17
+ const jiraIssueTypeLabel = ((_context$meta = context.meta) === null || _context$meta === void 0 ? void 0 : _context$meta.resourceType) === 'issue' && (_context$type = context.type) !== null && _context$type !== void 0 && _context$type.includes('atlassian:Task') ? (_linkIconProps$label = linkIconProps.label) === null || _linkIconProps$label === void 0 ? void 0 : _linkIconProps$label.trim() : undefined;
18
+ const label = (_ref = (_ref2 = jiraIssueTypeLabel !== null && jiraIssueTypeLabel !== void 0 ? jiraIssueTypeLabel : resourceTypeToLabel((_context$meta2 = context.meta) === null || _context$meta2 === void 0 ? void 0 : _context$meta2.resourceType)) !== null && _ref2 !== void 0 ? _ref2 : (_linkIconProps$label2 = linkIconProps.label) === null || _linkIconProps$label2 === void 0 ? void 0 : _linkIconProps$label2.trim()) !== null && _ref !== void 0 ? _ref : props.label;
19
+ return /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, linkIconProps, props, {
20
+ label: label,
36
21
  name: ElementName.LinkIcon
37
- })) : null;
22
+ }));
38
23
  };
39
24
  export default LinkIconElement;
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "46.1.11",
12
+ packageVersion: "46.1.13",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({