@atlaskit/smart-card 27.16.2 → 27.17.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.
- package/CHANGELOG.md +19 -0
- package/dist/cjs/extractors/common/icon/extractIcon.js +1 -58
- package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +6 -16
- package/dist/cjs/extractors/embed/index.js +1 -2
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +7 -84
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/utils/index.js +1 -2
- package/dist/cjs/view/HoverCard/utils.js +3 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/common/icon/extractIcon.js +1 -58
- package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +6 -16
- package/dist/es2019/extractors/embed/index.js +1 -2
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +8 -82
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/utils/index.js +1 -2
- package/dist/es2019/view/HoverCard/utils.js +4 -4
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/common/icon/extractIcon.js +1 -58
- package/dist/esm/extractors/common/icon/extractIconFromDocument.js +6 -16
- package/dist/esm/extractors/embed/index.js +1 -2
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +8 -85
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/utils/index.js +1 -2
- package/dist/esm/view/HoverCard/utils.js +4 -4
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +9 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 27.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`25c7d3c7d5354`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/25c7d3c7d5354) -
|
|
8
|
+
Remove the platform.linking-platform.extractor.improve-bitbucket-file-links feature flag
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 27.16.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#132637](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/132637)
|
|
19
|
+
[`6f006eb423da7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6f006eb423da7) -
|
|
20
|
+
[ux] cleaning up link icon standardisation feature flag
|
|
21
|
+
|
|
3
22
|
## 27.16.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.extractIcon = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _peopleGroup = _interopRequireDefault(require("@atlaskit/icon/glyph/people-group"));
|
|
11
10
|
var _ = _interopRequireDefault(require("@atlaskit/icon-object/glyph/commit/16"));
|
|
12
11
|
var _2 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/pull-request/16"));
|
|
@@ -109,21 +108,6 @@ function standardisedExtractIcon(type, opts) {
|
|
|
109
108
|
* @returns The extracted icon as a React node, or `undefined` if no icon is found.
|
|
110
109
|
*/
|
|
111
110
|
var extractIconByType = function extractIconByType(type, opts) {
|
|
112
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour')) {
|
|
113
|
-
switch (type) {
|
|
114
|
-
case 'Document':
|
|
115
|
-
case 'schema:BlogPosting':
|
|
116
|
-
case 'schema:DigitalDocument':
|
|
117
|
-
case 'schema:TextDigitalDocument':
|
|
118
|
-
case 'schema:PresentationDigitalDocument':
|
|
119
|
-
case 'schema:SpreadsheetDigitalDocument':
|
|
120
|
-
case 'atlassian:Template':
|
|
121
|
-
case 'atlassian:UndefinedLink':
|
|
122
|
-
return (0, _extractIconFromDocument.extractIconFromDocument)(type, opts);
|
|
123
|
-
default:
|
|
124
|
-
return standardisedExtractIcon(type, opts);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
111
|
switch (type) {
|
|
128
112
|
case 'Document':
|
|
129
113
|
case 'schema:BlogPosting':
|
|
@@ -134,48 +118,7 @@ var extractIconByType = function extractIconByType(type, opts) {
|
|
|
134
118
|
case 'atlassian:Template':
|
|
135
119
|
case 'atlassian:UndefinedLink':
|
|
136
120
|
return (0, _extractIconFromDocument.extractIconFromDocument)(type, opts);
|
|
137
|
-
case 'atlassian:Goal':
|
|
138
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
139
|
-
return opts.icon || /*#__PURE__*/_react.default.createElement(_5.default, {
|
|
140
|
-
label: opts.title || 'goal',
|
|
141
|
-
testId: "task-icon"
|
|
142
|
-
});
|
|
143
|
-
case 'atlassian:Project':
|
|
144
|
-
return opts.icon ||
|
|
145
|
-
/*#__PURE__*/
|
|
146
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19498
|
|
147
|
-
_react.default.createElement(_peopleGroup.default, {
|
|
148
|
-
label: opts.title || 'project',
|
|
149
|
-
size: "small",
|
|
150
|
-
testId: "project-icon"
|
|
151
|
-
});
|
|
152
|
-
case 'atlassian:SourceCodeCommit':
|
|
153
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
154
|
-
return /*#__PURE__*/_react.default.createElement(_.default, {
|
|
155
|
-
label: opts.title || 'commit',
|
|
156
|
-
testId: "commit-icon"
|
|
157
|
-
});
|
|
158
|
-
case 'atlassian:SourceCodePullRequest':
|
|
159
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
160
|
-
return /*#__PURE__*/_react.default.createElement(_2.default, {
|
|
161
|
-
label: opts.title || 'pullRequest',
|
|
162
|
-
testId: "pull-request-icon"
|
|
163
|
-
});
|
|
164
|
-
case 'atlassian:SourceCodeReference':
|
|
165
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
166
|
-
return /*#__PURE__*/_react.default.createElement(_3.default, {
|
|
167
|
-
label: opts.title || 'reference',
|
|
168
|
-
testId: "branch-icon"
|
|
169
|
-
});
|
|
170
|
-
case 'atlassian:SourceCodeRepository':
|
|
171
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
172
|
-
return /*#__PURE__*/_react.default.createElement(_4.default, {
|
|
173
|
-
label: opts.title || 'repository',
|
|
174
|
-
testId: "repo-icon"
|
|
175
|
-
});
|
|
176
|
-
case 'atlassian:Task':
|
|
177
|
-
return (0, _extractIconFromTask.extractIconFromTask)(opts);
|
|
178
121
|
default:
|
|
179
|
-
return
|
|
122
|
+
return standardisedExtractIcon(type, opts);
|
|
180
123
|
}
|
|
181
124
|
};
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.extractIconFromDocument = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _ = _interopRequireDefault(require("@atlaskit/icon-object/glyph/blog/16"));
|
|
11
10
|
var _2 = _interopRequireDefault(require("@atlaskit/icon-file-type/glyph/generic/16"));
|
|
12
11
|
var _3 = _interopRequireDefault(require("@atlaskit/icon-file-type/glyph/presentation/16"));
|
|
@@ -26,21 +25,12 @@ var extractIconFromDocument = exports.extractIconFromDocument = function extract
|
|
|
26
25
|
var iconFromType = documentTypeToIcon(type, opts);
|
|
27
26
|
var iconFromFileFormat = documentFileFormatToIcon(opts);
|
|
28
27
|
var iconFromProvider = opts.provider && opts.provider.icon;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
// If we encounter a native provider, we privilege the
|
|
38
|
-
// icon generated by its type. Otherwise, we privilege the
|
|
39
|
-
// provider icon, followed by the type & mime type icons.
|
|
40
|
-
if (opts.priority === 'provider') {
|
|
41
|
-
return iconFromProvider || iconFromFileFormat || iconFromType;
|
|
42
|
-
}
|
|
43
|
-
return iconFromFileFormat || iconFromType || opts.icon || iconFromProvider;
|
|
28
|
+
return (0, _prioritiseIcon.prioritiseIcon)({
|
|
29
|
+
fileFormatIcon: iconFromFileFormat,
|
|
30
|
+
documentTypeIcon: iconFromType,
|
|
31
|
+
urlIcon: opts.icon,
|
|
32
|
+
providerIcon: iconFromProvider
|
|
33
|
+
});
|
|
44
34
|
};
|
|
45
35
|
var documentFileFormatToIcon = function documentFileFormatToIcon(opts) {
|
|
46
36
|
if (opts.fileFormat) {
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.extractEmbedProps = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _extractIsTrusted = require("../common/meta/extractIsTrusted");
|
|
12
11
|
var _extractIsSupportTheming = require("../common/meta/extractIsSupportTheming");
|
|
13
12
|
var _icon = require("../common/icon");
|
|
@@ -47,7 +46,7 @@ var extractEmbedProps = exports.extractEmbedProps = function extractEmbedProps(j
|
|
|
47
46
|
return {
|
|
48
47
|
link: (0, _linkExtractors.extractLink)(jsonLd) || '',
|
|
49
48
|
title: (0, _linkExtractors.extractTitle)(jsonLd),
|
|
50
|
-
context:
|
|
49
|
+
context: generateContext(jsonLd),
|
|
51
50
|
preview: extractEmbedPreview(jsonLd, platform, iframeUrlType),
|
|
52
51
|
isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
|
|
53
52
|
isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta)
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _constants = require("../../constants");
|
|
10
9
|
var _extractDocumentTypeIcon = _interopRequireDefault(require("./extract-document-type-icon"));
|
|
11
10
|
var _extractFileFormatIcon = _interopRequireDefault(require("./extract-file-formatIcon"));
|
|
@@ -37,15 +36,9 @@ var extractType = function extractType(jsonLd) {
|
|
|
37
36
|
return _priority.extractorPriorityMap[b] - _priority.extractorPriorityMap[a];
|
|
38
37
|
})[0] : type;
|
|
39
38
|
};
|
|
40
|
-
var isConfluenceProvider = function isConfluenceProvider(provider) {
|
|
41
|
-
return provider === _constants.CONFLUENCE_GENERATOR_ID;
|
|
42
|
-
};
|
|
43
39
|
var isJiraProvider = function isJiraProvider(provider) {
|
|
44
40
|
return provider === _constants.JIRA_GENERATOR_ID;
|
|
45
41
|
};
|
|
46
|
-
var isNativeProvider = function isNativeProvider(provider) {
|
|
47
|
-
return isConfluenceProvider(provider) || isJiraProvider(provider);
|
|
48
|
-
};
|
|
49
42
|
function chooseIcon(_ref2) {
|
|
50
43
|
var _data$generator;
|
|
51
44
|
var urlIcon = _ref2.urlIcon,
|
|
@@ -127,86 +120,16 @@ function typeToIconDescriptor(_ref3) {
|
|
|
127
120
|
* Return the icon object given a JSON-LD data object.
|
|
128
121
|
*/
|
|
129
122
|
var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
130
|
-
var generator = data.generator;
|
|
131
123
|
var label = (0, _linkExtractors.extractTitle)(data);
|
|
132
124
|
var type = extractType(data);
|
|
133
125
|
var urlIcon = (0, _extractUrlIcon.default)(data.icon, label);
|
|
134
|
-
var provider = generator === null || generator === void 0 ? void 0 : generator['@id'];
|
|
135
126
|
var providerIcon = (0, _extractProviderIcon.default)(data);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
switch (type) {
|
|
146
|
-
case 'Document':
|
|
147
|
-
case 'schema:BlogPosting':
|
|
148
|
-
case 'schema:DigitalDocument':
|
|
149
|
-
case 'schema:TextDigitalDocument':
|
|
150
|
-
case 'schema:PresentationDigitalDocument':
|
|
151
|
-
case 'schema:SpreadsheetDigitalDocument':
|
|
152
|
-
case 'atlassian:Template':
|
|
153
|
-
case 'atlassian:UndefinedLink':
|
|
154
|
-
// If we encounter a native provider, we privilege the
|
|
155
|
-
// icon generated by its mime type and document type.
|
|
156
|
-
// Otherwise, we privilege the provider icon,
|
|
157
|
-
// followed by mime type and document type icon.
|
|
158
|
-
var documentData = data;
|
|
159
|
-
var fileFormat = documentData === null || documentData === void 0 ? void 0 : documentData['schema:fileFormat'];
|
|
160
|
-
var fileFormatIcon = (0, _extractFileFormatIcon.default)(fileFormat);
|
|
161
|
-
var documentTypeIcon = (0, _extractDocumentTypeIcon.default)(type, label);
|
|
162
|
-
return isNativeProvider(provider) ? fileFormatIcon || documentTypeIcon || urlIcon || providerIcon : providerIcon || fileFormatIcon || documentTypeIcon;
|
|
163
|
-
case 'atlassian:Task':
|
|
164
|
-
var taskLabel = label || 'Task';
|
|
165
|
-
if (isJiraProvider(provider)) {
|
|
166
|
-
var _extractTask2 = extractTask(data),
|
|
167
|
-
taskType = _extractTask2.taskType,
|
|
168
|
-
taskIcon = _extractTask2.taskIcon;
|
|
169
|
-
return taskType === 'JiraCustomTaskType' ? taskIcon || urlIcon || providerIcon || {
|
|
170
|
-
icon: _constants2.IconType.Task,
|
|
171
|
-
label: taskLabel
|
|
172
|
-
} : (0, _extractJiraTaskIcon.default)(taskType, taskLabel);
|
|
173
|
-
}
|
|
174
|
-
return {
|
|
175
|
-
icon: _constants2.IconType.Task,
|
|
176
|
-
label: taskLabel
|
|
177
|
-
};
|
|
178
|
-
case 'atlassian:Goal':
|
|
179
|
-
return urlIcon || {
|
|
180
|
-
icon: _constants2.IconType.Task,
|
|
181
|
-
label: label || 'Goal'
|
|
182
|
-
};
|
|
183
|
-
case 'atlassian:Project':
|
|
184
|
-
return urlIcon || {
|
|
185
|
-
icon: _constants2.IconType.Project,
|
|
186
|
-
label: label || 'Project'
|
|
187
|
-
};
|
|
188
|
-
case 'atlassian:SourceCodeCommit':
|
|
189
|
-
return {
|
|
190
|
-
icon: _constants2.IconType.Commit,
|
|
191
|
-
label: label || 'Commit'
|
|
192
|
-
};
|
|
193
|
-
case 'atlassian:SourceCodePullRequest':
|
|
194
|
-
return {
|
|
195
|
-
icon: _constants2.IconType.PullRequest,
|
|
196
|
-
label: label || 'Pull request'
|
|
197
|
-
};
|
|
198
|
-
case 'atlassian:SourceCodeReference':
|
|
199
|
-
return {
|
|
200
|
-
icon: _constants2.IconType.Branch,
|
|
201
|
-
label: label || 'Reference'
|
|
202
|
-
};
|
|
203
|
-
case 'atlassian:SourceCodeRepository':
|
|
204
|
-
return {
|
|
205
|
-
icon: _constants2.IconType.Repo,
|
|
206
|
-
label: label || 'Repository'
|
|
207
|
-
};
|
|
208
|
-
default:
|
|
209
|
-
return providerIcon;
|
|
210
|
-
}
|
|
127
|
+
return chooseIcon({
|
|
128
|
+
urlIcon: urlIcon,
|
|
129
|
+
providerIcon: providerIcon,
|
|
130
|
+
type: type,
|
|
131
|
+
label: label,
|
|
132
|
+
data: data
|
|
133
|
+
});
|
|
211
134
|
};
|
|
212
135
|
var _default = exports.default = extractJsonldDataIcon;
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "27.
|
|
25
|
+
packageVersion: "27.17.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -8,7 +8,6 @@ var _constants = require("../../../../../constants");
|
|
|
8
8
|
var _utils = require("../../../../../extractors/flexible/utils");
|
|
9
9
|
var _helpers = require("../../../../../state/helpers");
|
|
10
10
|
var _styled = require("../styled");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var baseTopMetadata = [{
|
|
13
12
|
name: _constants.ElementName.ModifiedOn
|
|
14
13
|
}, {
|
|
@@ -54,7 +53,7 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
|
|
|
54
53
|
var isFile = data['@type'].includes('schema:DigitalDocument');
|
|
55
54
|
return {
|
|
56
55
|
titleMetadata: defaultTitleMetadata,
|
|
57
|
-
topMetadata:
|
|
56
|
+
topMetadata: isFile ? [{
|
|
58
57
|
name: _constants.ElementName.LatestCommit
|
|
59
58
|
}, {
|
|
60
59
|
name: _constants.ElementName.CollaboratorGroup
|
|
@@ -27,7 +27,7 @@ var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(extensionKe
|
|
|
27
27
|
subtitle: [_constants.ElementName.SourceBranch, _constants.ElementName.TargetBranch]
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
if (
|
|
30
|
+
if (types !== null && types !== void 0 && types.includes('schema:DigitalDocument')) {
|
|
31
31
|
return {
|
|
32
32
|
primary: [_constants.ElementName.LatestCommit, _constants.ElementName.CollaboratorGroup, _constants.ElementName.ModifiedOn]
|
|
33
33
|
};
|
|
@@ -95,11 +95,11 @@ var toElementItems = function toElementItems(elementNames) {
|
|
|
95
95
|
};
|
|
96
96
|
var getMetadata = exports.getMetadata = function getMetadata(extensionKey, data) {
|
|
97
97
|
var metadata = getSimulatedBetterMetadata(extensionKey, data);
|
|
98
|
-
var primary = (0, _platformFeatureFlags.
|
|
98
|
+
var primary = (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-card.hover-card-action-redesign') ? [].concat(metadata.primary, metadata.tertiary) : metadata.primary;
|
|
99
99
|
|
|
100
100
|
// `tertiary` should be removed completely during cleanup:
|
|
101
101
|
// https://product-fabric.atlassian.net/browse/EDM-9556
|
|
102
|
-
var tertiary = (0, _platformFeatureFlags.
|
|
102
|
+
var tertiary = (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-card.hover-card-action-redesign') ? undefined : metadata.tertiary;
|
|
103
103
|
return {
|
|
104
104
|
subtitle: toElementItems(metadata.subtitle),
|
|
105
105
|
primary: toElementItems(primary),
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "27.
|
|
20
|
+
packageVersion: "27.17.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import ProjectIcon from '@atlaskit/icon/glyph/people-group';
|
|
4
3
|
import CommitIcon from '@atlaskit/icon-object/glyph/commit/16';
|
|
5
4
|
import PullRequestIcon from '@atlaskit/icon-object/glyph/pull-request/16';
|
|
@@ -99,21 +98,6 @@ function standardisedExtractIcon(type, opts) {
|
|
|
99
98
|
* @returns The extracted icon as a React node, or `undefined` if no icon is found.
|
|
100
99
|
*/
|
|
101
100
|
const extractIconByType = (type, opts) => {
|
|
102
|
-
if (getBooleanFF('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour')) {
|
|
103
|
-
switch (type) {
|
|
104
|
-
case 'Document':
|
|
105
|
-
case 'schema:BlogPosting':
|
|
106
|
-
case 'schema:DigitalDocument':
|
|
107
|
-
case 'schema:TextDigitalDocument':
|
|
108
|
-
case 'schema:PresentationDigitalDocument':
|
|
109
|
-
case 'schema:SpreadsheetDigitalDocument':
|
|
110
|
-
case 'atlassian:Template':
|
|
111
|
-
case 'atlassian:UndefinedLink':
|
|
112
|
-
return extractIconFromDocument(type, opts);
|
|
113
|
-
default:
|
|
114
|
-
return standardisedExtractIcon(type, opts);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
101
|
switch (type) {
|
|
118
102
|
case 'Document':
|
|
119
103
|
case 'schema:BlogPosting':
|
|
@@ -124,48 +108,7 @@ const extractIconByType = (type, opts) => {
|
|
|
124
108
|
case 'atlassian:Template':
|
|
125
109
|
case 'atlassian:UndefinedLink':
|
|
126
110
|
return extractIconFromDocument(type, opts);
|
|
127
|
-
case 'atlassian:Goal':
|
|
128
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
129
|
-
return opts.icon || /*#__PURE__*/React.createElement(TaskIcon, {
|
|
130
|
-
label: opts.title || 'goal',
|
|
131
|
-
testId: "task-icon"
|
|
132
|
-
});
|
|
133
|
-
case 'atlassian:Project':
|
|
134
|
-
return opts.icon ||
|
|
135
|
-
/*#__PURE__*/
|
|
136
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19498
|
|
137
|
-
React.createElement(ProjectIcon, {
|
|
138
|
-
label: opts.title || 'project',
|
|
139
|
-
size: "small",
|
|
140
|
-
testId: "project-icon"
|
|
141
|
-
});
|
|
142
|
-
case 'atlassian:SourceCodeCommit':
|
|
143
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
144
|
-
return /*#__PURE__*/React.createElement(CommitIcon, {
|
|
145
|
-
label: opts.title || 'commit',
|
|
146
|
-
testId: "commit-icon"
|
|
147
|
-
});
|
|
148
|
-
case 'atlassian:SourceCodePullRequest':
|
|
149
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
150
|
-
return /*#__PURE__*/React.createElement(PullRequestIcon, {
|
|
151
|
-
label: opts.title || 'pullRequest',
|
|
152
|
-
testId: "pull-request-icon"
|
|
153
|
-
});
|
|
154
|
-
case 'atlassian:SourceCodeReference':
|
|
155
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
156
|
-
return /*#__PURE__*/React.createElement(BranchIcon, {
|
|
157
|
-
label: opts.title || 'reference',
|
|
158
|
-
testId: "branch-icon"
|
|
159
|
-
});
|
|
160
|
-
case 'atlassian:SourceCodeRepository':
|
|
161
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
162
|
-
return /*#__PURE__*/React.createElement(RepoIcon, {
|
|
163
|
-
label: opts.title || 'repository',
|
|
164
|
-
testId: "repo-icon"
|
|
165
|
-
});
|
|
166
|
-
case 'atlassian:Task':
|
|
167
|
-
return extractIconFromTask(opts);
|
|
168
111
|
default:
|
|
169
|
-
return
|
|
112
|
+
return standardisedExtractIcon(type, opts);
|
|
170
113
|
}
|
|
171
114
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import BlogIcon from '@atlaskit/icon-object/glyph/blog/16';
|
|
4
3
|
import FileIcon from '@atlaskit/icon-file-type/glyph/generic/16';
|
|
5
4
|
import PresentationIcon from '@atlaskit/icon-file-type/glyph/presentation/16';
|
|
@@ -19,21 +18,12 @@ export const extractIconFromDocument = (type, opts) => {
|
|
|
19
18
|
const iconFromType = documentTypeToIcon(type, opts);
|
|
20
19
|
const iconFromFileFormat = documentFileFormatToIcon(opts);
|
|
21
20
|
const iconFromProvider = opts.provider && opts.provider.icon;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
// If we encounter a native provider, we privilege the
|
|
31
|
-
// icon generated by its type. Otherwise, we privilege the
|
|
32
|
-
// provider icon, followed by the type & mime type icons.
|
|
33
|
-
if (opts.priority === 'provider') {
|
|
34
|
-
return iconFromProvider || iconFromFileFormat || iconFromType;
|
|
35
|
-
}
|
|
36
|
-
return iconFromFileFormat || iconFromType || opts.icon || iconFromProvider;
|
|
21
|
+
return prioritiseIcon({
|
|
22
|
+
fileFormatIcon: iconFromFileFormat,
|
|
23
|
+
documentTypeIcon: iconFromType,
|
|
24
|
+
urlIcon: opts.icon,
|
|
25
|
+
providerIcon: iconFromProvider
|
|
26
|
+
});
|
|
37
27
|
};
|
|
38
28
|
const documentFileFormatToIcon = opts => {
|
|
39
29
|
if (opts.fileFormat) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extractLink, extractTitle, extractProvider, extractProviderIcon, extractPreview, extractUrlFromIconJsonLd } from '@atlaskit/link-extractors';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
4
3
|
import { extractIsSupportTheming } from '../common/meta/extractIsSupportTheming';
|
|
5
4
|
import { prioritiseIcon } from '../common/icon';
|
|
@@ -38,7 +37,7 @@ function generateContext(jsonLd) {
|
|
|
38
37
|
export const extractEmbedProps = (jsonLd, meta, platform, iframeUrlType) => ({
|
|
39
38
|
link: extractLink(jsonLd) || '',
|
|
40
39
|
title: extractTitle(jsonLd),
|
|
41
|
-
context:
|
|
40
|
+
context: generateContext(jsonLd),
|
|
42
41
|
preview: extractEmbedPreview(jsonLd, platform, iframeUrlType),
|
|
43
42
|
isTrusted: extractIsTrusted(meta),
|
|
44
43
|
isSupportTheming: extractIsSupportTheming(meta)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../../constants';
|
|
1
|
+
import { JIRA_GENERATOR_ID } from '../../constants';
|
|
3
2
|
import extractDocumentTypeIcon from './extract-document-type-icon';
|
|
4
3
|
import extractFileFormatIcon from './extract-file-formatIcon';
|
|
5
4
|
import extractJiraTaskIcon from './extract-jira-task-icon';
|
|
@@ -29,9 +28,7 @@ const extractType = jsonLd => {
|
|
|
29
28
|
const type = jsonLd['@type'];
|
|
30
29
|
return Array.isArray(type) ? type.sort((a, b) => priorityMap[b] - priorityMap[a])[0] : type;
|
|
31
30
|
};
|
|
32
|
-
const isConfluenceProvider = provider => provider === CONFLUENCE_GENERATOR_ID;
|
|
33
31
|
const isJiraProvider = provider => provider === JIRA_GENERATOR_ID;
|
|
34
|
-
const isNativeProvider = provider => isConfluenceProvider(provider) || isJiraProvider(provider);
|
|
35
32
|
function chooseIcon({
|
|
36
33
|
urlIcon,
|
|
37
34
|
type,
|
|
@@ -116,87 +113,16 @@ function typeToIconDescriptor({
|
|
|
116
113
|
* Return the icon object given a JSON-LD data object.
|
|
117
114
|
*/
|
|
118
115
|
const extractJsonldDataIcon = data => {
|
|
119
|
-
const generator = data.generator;
|
|
120
116
|
const label = extractTitle(data);
|
|
121
117
|
const type = extractType(data);
|
|
122
118
|
const urlIcon = extractUrlIcon(data.icon, label);
|
|
123
|
-
const provider = generator === null || generator === void 0 ? void 0 : generator['@id'];
|
|
124
119
|
const providerIcon = extractProviderIcon(data);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
switch (type) {
|
|
135
|
-
case 'Document':
|
|
136
|
-
case 'schema:BlogPosting':
|
|
137
|
-
case 'schema:DigitalDocument':
|
|
138
|
-
case 'schema:TextDigitalDocument':
|
|
139
|
-
case 'schema:PresentationDigitalDocument':
|
|
140
|
-
case 'schema:SpreadsheetDigitalDocument':
|
|
141
|
-
case 'atlassian:Template':
|
|
142
|
-
case 'atlassian:UndefinedLink':
|
|
143
|
-
// If we encounter a native provider, we privilege the
|
|
144
|
-
// icon generated by its mime type and document type.
|
|
145
|
-
// Otherwise, we privilege the provider icon,
|
|
146
|
-
// followed by mime type and document type icon.
|
|
147
|
-
const documentData = data;
|
|
148
|
-
const fileFormat = documentData === null || documentData === void 0 ? void 0 : documentData['schema:fileFormat'];
|
|
149
|
-
const fileFormatIcon = extractFileFormatIcon(fileFormat);
|
|
150
|
-
const documentTypeIcon = extractDocumentTypeIcon(type, label);
|
|
151
|
-
return isNativeProvider(provider) ? fileFormatIcon || documentTypeIcon || urlIcon || providerIcon : providerIcon || fileFormatIcon || documentTypeIcon;
|
|
152
|
-
case 'atlassian:Task':
|
|
153
|
-
const taskLabel = label || 'Task';
|
|
154
|
-
if (isJiraProvider(provider)) {
|
|
155
|
-
const {
|
|
156
|
-
taskType,
|
|
157
|
-
taskIcon
|
|
158
|
-
} = extractTask(data);
|
|
159
|
-
return taskType === 'JiraCustomTaskType' ? taskIcon || urlIcon || providerIcon || {
|
|
160
|
-
icon: IconType.Task,
|
|
161
|
-
label: taskLabel
|
|
162
|
-
} : extractJiraTaskIcon(taskType, taskLabel);
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
icon: IconType.Task,
|
|
166
|
-
label: taskLabel
|
|
167
|
-
};
|
|
168
|
-
case 'atlassian:Goal':
|
|
169
|
-
return urlIcon || {
|
|
170
|
-
icon: IconType.Task,
|
|
171
|
-
label: label || 'Goal'
|
|
172
|
-
};
|
|
173
|
-
case 'atlassian:Project':
|
|
174
|
-
return urlIcon || {
|
|
175
|
-
icon: IconType.Project,
|
|
176
|
-
label: label || 'Project'
|
|
177
|
-
};
|
|
178
|
-
case 'atlassian:SourceCodeCommit':
|
|
179
|
-
return {
|
|
180
|
-
icon: IconType.Commit,
|
|
181
|
-
label: label || 'Commit'
|
|
182
|
-
};
|
|
183
|
-
case 'atlassian:SourceCodePullRequest':
|
|
184
|
-
return {
|
|
185
|
-
icon: IconType.PullRequest,
|
|
186
|
-
label: label || 'Pull request'
|
|
187
|
-
};
|
|
188
|
-
case 'atlassian:SourceCodeReference':
|
|
189
|
-
return {
|
|
190
|
-
icon: IconType.Branch,
|
|
191
|
-
label: label || 'Reference'
|
|
192
|
-
};
|
|
193
|
-
case 'atlassian:SourceCodeRepository':
|
|
194
|
-
return {
|
|
195
|
-
icon: IconType.Repo,
|
|
196
|
-
label: label || 'Repository'
|
|
197
|
-
};
|
|
198
|
-
default:
|
|
199
|
-
return providerIcon;
|
|
200
|
-
}
|
|
120
|
+
return chooseIcon({
|
|
121
|
+
urlIcon,
|
|
122
|
+
providerIcon,
|
|
123
|
+
type,
|
|
124
|
+
label,
|
|
125
|
+
data
|
|
126
|
+
});
|
|
201
127
|
};
|
|
202
128
|
export default extractJsonldDataIcon;
|
|
@@ -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: "27.
|
|
7
|
+
packageVersion: "27.17.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -2,7 +2,6 @@ import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '.
|
|
|
2
2
|
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
3
3
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
4
4
|
import { footerBlockCss, titleBlockCss } from '../styled';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
const baseTopMetadata = [{
|
|
7
6
|
name: ElementName.ModifiedOn
|
|
8
7
|
}, {
|
|
@@ -48,7 +47,7 @@ export const getSimulatedBetterMetadata = cardDetails => {
|
|
|
48
47
|
const isFile = data['@type'].includes('schema:DigitalDocument');
|
|
49
48
|
return {
|
|
50
49
|
titleMetadata: defaultTitleMetadata,
|
|
51
|
-
topMetadata:
|
|
50
|
+
topMetadata: isFile ? [{
|
|
52
51
|
name: ElementName.LatestCommit
|
|
53
52
|
}, {
|
|
54
53
|
name: ElementName.CollaboratorGroup
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementName } from '../../constants';
|
|
2
2
|
import { extractType } from '@atlaskit/link-extractors';
|
|
3
3
|
import { extractOwnedBy } from '../../extractors/flexible/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
const getSimulatedBetterMetadata = (extensionKey, data) => {
|
|
6
6
|
var _data$Type$includes, _data$Type;
|
|
7
7
|
const types = data ? extractType(data) : undefined;
|
|
@@ -17,7 +17,7 @@ const getSimulatedBetterMetadata = (extensionKey, data) => {
|
|
|
17
17
|
subtitle: [ElementName.SourceBranch, ElementName.TargetBranch]
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
if (
|
|
20
|
+
if (types !== null && types !== void 0 && types.includes('schema:DigitalDocument')) {
|
|
21
21
|
return {
|
|
22
22
|
primary: [ElementName.LatestCommit, ElementName.CollaboratorGroup, ElementName.ModifiedOn]
|
|
23
23
|
};
|
|
@@ -86,11 +86,11 @@ const toElementItems = elementNames => {
|
|
|
86
86
|
};
|
|
87
87
|
export const getMetadata = (extensionKey, data) => {
|
|
88
88
|
const metadata = getSimulatedBetterMetadata(extensionKey, data);
|
|
89
|
-
const primary =
|
|
89
|
+
const primary = fg('platform.linking-platform.smart-card.hover-card-action-redesign') ? [].concat(metadata.primary, metadata.tertiary) : metadata.primary;
|
|
90
90
|
|
|
91
91
|
// `tertiary` should be removed completely during cleanup:
|
|
92
92
|
// https://product-fabric.atlassian.net/browse/EDM-9556
|
|
93
|
-
const tertiary =
|
|
93
|
+
const tertiary = fg('platform.linking-platform.smart-card.hover-card-action-redesign') ? undefined : metadata.tertiary;
|
|
94
94
|
return {
|
|
95
95
|
subtitle: toElementItems(metadata.subtitle),
|
|
96
96
|
primary: toElementItems(primary),
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "27.
|
|
10
|
+
packageVersion: "27.17.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import ProjectIcon from '@atlaskit/icon/glyph/people-group';
|
|
4
3
|
import CommitIcon from '@atlaskit/icon-object/glyph/commit/16';
|
|
5
4
|
import PullRequestIcon from '@atlaskit/icon-object/glyph/pull-request/16';
|
|
@@ -102,21 +101,6 @@ function standardisedExtractIcon(type, opts) {
|
|
|
102
101
|
* @returns The extracted icon as a React node, or `undefined` if no icon is found.
|
|
103
102
|
*/
|
|
104
103
|
var extractIconByType = function extractIconByType(type, opts) {
|
|
105
|
-
if (getBooleanFF('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour')) {
|
|
106
|
-
switch (type) {
|
|
107
|
-
case 'Document':
|
|
108
|
-
case 'schema:BlogPosting':
|
|
109
|
-
case 'schema:DigitalDocument':
|
|
110
|
-
case 'schema:TextDigitalDocument':
|
|
111
|
-
case 'schema:PresentationDigitalDocument':
|
|
112
|
-
case 'schema:SpreadsheetDigitalDocument':
|
|
113
|
-
case 'atlassian:Template':
|
|
114
|
-
case 'atlassian:UndefinedLink':
|
|
115
|
-
return extractIconFromDocument(type, opts);
|
|
116
|
-
default:
|
|
117
|
-
return standardisedExtractIcon(type, opts);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
104
|
switch (type) {
|
|
121
105
|
case 'Document':
|
|
122
106
|
case 'schema:BlogPosting':
|
|
@@ -127,48 +111,7 @@ var extractIconByType = function extractIconByType(type, opts) {
|
|
|
127
111
|
case 'atlassian:Template':
|
|
128
112
|
case 'atlassian:UndefinedLink':
|
|
129
113
|
return extractIconFromDocument(type, opts);
|
|
130
|
-
case 'atlassian:Goal':
|
|
131
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
132
|
-
return opts.icon || /*#__PURE__*/React.createElement(TaskIcon, {
|
|
133
|
-
label: opts.title || 'goal',
|
|
134
|
-
testId: "task-icon"
|
|
135
|
-
});
|
|
136
|
-
case 'atlassian:Project':
|
|
137
|
-
return opts.icon ||
|
|
138
|
-
/*#__PURE__*/
|
|
139
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19498
|
|
140
|
-
React.createElement(ProjectIcon, {
|
|
141
|
-
label: opts.title || 'project',
|
|
142
|
-
size: "small",
|
|
143
|
-
testId: "project-icon"
|
|
144
|
-
});
|
|
145
|
-
case 'atlassian:SourceCodeCommit':
|
|
146
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
147
|
-
return /*#__PURE__*/React.createElement(CommitIcon, {
|
|
148
|
-
label: opts.title || 'commit',
|
|
149
|
-
testId: "commit-icon"
|
|
150
|
-
});
|
|
151
|
-
case 'atlassian:SourceCodePullRequest':
|
|
152
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
153
|
-
return /*#__PURE__*/React.createElement(PullRequestIcon, {
|
|
154
|
-
label: opts.title || 'pullRequest',
|
|
155
|
-
testId: "pull-request-icon"
|
|
156
|
-
});
|
|
157
|
-
case 'atlassian:SourceCodeReference':
|
|
158
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
159
|
-
return /*#__PURE__*/React.createElement(BranchIcon, {
|
|
160
|
-
label: opts.title || 'reference',
|
|
161
|
-
testId: "branch-icon"
|
|
162
|
-
});
|
|
163
|
-
case 'atlassian:SourceCodeRepository':
|
|
164
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19493
|
|
165
|
-
return /*#__PURE__*/React.createElement(RepoIcon, {
|
|
166
|
-
label: opts.title || 'repository',
|
|
167
|
-
testId: "repo-icon"
|
|
168
|
-
});
|
|
169
|
-
case 'atlassian:Task':
|
|
170
|
-
return extractIconFromTask(opts);
|
|
171
114
|
default:
|
|
172
|
-
return
|
|
115
|
+
return standardisedExtractIcon(type, opts);
|
|
173
116
|
}
|
|
174
117
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import BlogIcon from '@atlaskit/icon-object/glyph/blog/16';
|
|
4
3
|
import FileIcon from '@atlaskit/icon-file-type/glyph/generic/16';
|
|
5
4
|
import PresentationIcon from '@atlaskit/icon-file-type/glyph/presentation/16';
|
|
@@ -19,21 +18,12 @@ export var extractIconFromDocument = function extractIconFromDocument(type, opts
|
|
|
19
18
|
var iconFromType = documentTypeToIcon(type, opts);
|
|
20
19
|
var iconFromFileFormat = documentFileFormatToIcon(opts);
|
|
21
20
|
var iconFromProvider = opts.provider && opts.provider.icon;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
// If we encounter a native provider, we privilege the
|
|
31
|
-
// icon generated by its type. Otherwise, we privilege the
|
|
32
|
-
// provider icon, followed by the type & mime type icons.
|
|
33
|
-
if (opts.priority === 'provider') {
|
|
34
|
-
return iconFromProvider || iconFromFileFormat || iconFromType;
|
|
35
|
-
}
|
|
36
|
-
return iconFromFileFormat || iconFromType || opts.icon || iconFromProvider;
|
|
21
|
+
return prioritiseIcon({
|
|
22
|
+
fileFormatIcon: iconFromFileFormat,
|
|
23
|
+
documentTypeIcon: iconFromType,
|
|
24
|
+
urlIcon: opts.icon,
|
|
25
|
+
providerIcon: iconFromProvider
|
|
26
|
+
});
|
|
37
27
|
};
|
|
38
28
|
var documentFileFormatToIcon = function documentFileFormatToIcon(opts) {
|
|
39
29
|
if (opts.fileFormat) {
|
|
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { extractLink, extractTitle, extractProvider, extractProviderIcon, extractPreview, extractUrlFromIconJsonLd } from '@atlaskit/link-extractors';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
7
6
|
import { extractIsSupportTheming } from '../common/meta/extractIsSupportTheming';
|
|
8
7
|
import { prioritiseIcon } from '../common/icon';
|
|
@@ -40,7 +39,7 @@ export var extractEmbedProps = function extractEmbedProps(jsonLd, meta, platform
|
|
|
40
39
|
return {
|
|
41
40
|
link: extractLink(jsonLd) || '',
|
|
42
41
|
title: extractTitle(jsonLd),
|
|
43
|
-
context:
|
|
42
|
+
context: generateContext(jsonLd),
|
|
44
43
|
preview: extractEmbedPreview(jsonLd, platform, iframeUrlType),
|
|
45
44
|
isTrusted: extractIsTrusted(meta),
|
|
46
45
|
isSupportTheming: extractIsSupportTheming(meta)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../../constants';
|
|
1
|
+
import { JIRA_GENERATOR_ID } from '../../constants';
|
|
3
2
|
import extractDocumentTypeIcon from './extract-document-type-icon';
|
|
4
3
|
import extractFileFormatIcon from './extract-file-formatIcon';
|
|
5
4
|
import extractJiraTaskIcon from './extract-jira-task-icon';
|
|
@@ -30,15 +29,9 @@ var extractType = function extractType(jsonLd) {
|
|
|
30
29
|
return priorityMap[b] - priorityMap[a];
|
|
31
30
|
})[0] : type;
|
|
32
31
|
};
|
|
33
|
-
var isConfluenceProvider = function isConfluenceProvider(provider) {
|
|
34
|
-
return provider === CONFLUENCE_GENERATOR_ID;
|
|
35
|
-
};
|
|
36
32
|
var isJiraProvider = function isJiraProvider(provider) {
|
|
37
33
|
return provider === JIRA_GENERATOR_ID;
|
|
38
34
|
};
|
|
39
|
-
var isNativeProvider = function isNativeProvider(provider) {
|
|
40
|
-
return isConfluenceProvider(provider) || isJiraProvider(provider);
|
|
41
|
-
};
|
|
42
35
|
function chooseIcon(_ref2) {
|
|
43
36
|
var _data$generator;
|
|
44
37
|
var urlIcon = _ref2.urlIcon,
|
|
@@ -120,86 +113,16 @@ function typeToIconDescriptor(_ref3) {
|
|
|
120
113
|
* Return the icon object given a JSON-LD data object.
|
|
121
114
|
*/
|
|
122
115
|
var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
123
|
-
var generator = data.generator;
|
|
124
116
|
var label = extractTitle(data);
|
|
125
117
|
var type = extractType(data);
|
|
126
118
|
var urlIcon = extractUrlIcon(data.icon, label);
|
|
127
|
-
var provider = generator === null || generator === void 0 ? void 0 : generator['@id'];
|
|
128
119
|
var providerIcon = extractProviderIcon(data);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
switch (type) {
|
|
139
|
-
case 'Document':
|
|
140
|
-
case 'schema:BlogPosting':
|
|
141
|
-
case 'schema:DigitalDocument':
|
|
142
|
-
case 'schema:TextDigitalDocument':
|
|
143
|
-
case 'schema:PresentationDigitalDocument':
|
|
144
|
-
case 'schema:SpreadsheetDigitalDocument':
|
|
145
|
-
case 'atlassian:Template':
|
|
146
|
-
case 'atlassian:UndefinedLink':
|
|
147
|
-
// If we encounter a native provider, we privilege the
|
|
148
|
-
// icon generated by its mime type and document type.
|
|
149
|
-
// Otherwise, we privilege the provider icon,
|
|
150
|
-
// followed by mime type and document type icon.
|
|
151
|
-
var documentData = data;
|
|
152
|
-
var fileFormat = documentData === null || documentData === void 0 ? void 0 : documentData['schema:fileFormat'];
|
|
153
|
-
var fileFormatIcon = extractFileFormatIcon(fileFormat);
|
|
154
|
-
var documentTypeIcon = extractDocumentTypeIcon(type, label);
|
|
155
|
-
return isNativeProvider(provider) ? fileFormatIcon || documentTypeIcon || urlIcon || providerIcon : providerIcon || fileFormatIcon || documentTypeIcon;
|
|
156
|
-
case 'atlassian:Task':
|
|
157
|
-
var taskLabel = label || 'Task';
|
|
158
|
-
if (isJiraProvider(provider)) {
|
|
159
|
-
var _extractTask2 = extractTask(data),
|
|
160
|
-
taskType = _extractTask2.taskType,
|
|
161
|
-
taskIcon = _extractTask2.taskIcon;
|
|
162
|
-
return taskType === 'JiraCustomTaskType' ? taskIcon || urlIcon || providerIcon || {
|
|
163
|
-
icon: IconType.Task,
|
|
164
|
-
label: taskLabel
|
|
165
|
-
} : extractJiraTaskIcon(taskType, taskLabel);
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
icon: IconType.Task,
|
|
169
|
-
label: taskLabel
|
|
170
|
-
};
|
|
171
|
-
case 'atlassian:Goal':
|
|
172
|
-
return urlIcon || {
|
|
173
|
-
icon: IconType.Task,
|
|
174
|
-
label: label || 'Goal'
|
|
175
|
-
};
|
|
176
|
-
case 'atlassian:Project':
|
|
177
|
-
return urlIcon || {
|
|
178
|
-
icon: IconType.Project,
|
|
179
|
-
label: label || 'Project'
|
|
180
|
-
};
|
|
181
|
-
case 'atlassian:SourceCodeCommit':
|
|
182
|
-
return {
|
|
183
|
-
icon: IconType.Commit,
|
|
184
|
-
label: label || 'Commit'
|
|
185
|
-
};
|
|
186
|
-
case 'atlassian:SourceCodePullRequest':
|
|
187
|
-
return {
|
|
188
|
-
icon: IconType.PullRequest,
|
|
189
|
-
label: label || 'Pull request'
|
|
190
|
-
};
|
|
191
|
-
case 'atlassian:SourceCodeReference':
|
|
192
|
-
return {
|
|
193
|
-
icon: IconType.Branch,
|
|
194
|
-
label: label || 'Reference'
|
|
195
|
-
};
|
|
196
|
-
case 'atlassian:SourceCodeRepository':
|
|
197
|
-
return {
|
|
198
|
-
icon: IconType.Repo,
|
|
199
|
-
label: label || 'Repository'
|
|
200
|
-
};
|
|
201
|
-
default:
|
|
202
|
-
return providerIcon;
|
|
203
|
-
}
|
|
120
|
+
return chooseIcon({
|
|
121
|
+
urlIcon: urlIcon,
|
|
122
|
+
providerIcon: providerIcon,
|
|
123
|
+
type: type,
|
|
124
|
+
label: label,
|
|
125
|
+
data: data
|
|
126
|
+
});
|
|
204
127
|
};
|
|
205
128
|
export default extractJsonldDataIcon;
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "27.
|
|
18
|
+
packageVersion: "27.17.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -2,7 +2,6 @@ import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '.
|
|
|
2
2
|
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
3
3
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
4
4
|
import { footerBlockCss, titleBlockCss } from '../styled';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
var baseTopMetadata = [{
|
|
7
6
|
name: ElementName.ModifiedOn
|
|
8
7
|
}, {
|
|
@@ -48,7 +47,7 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
48
47
|
var isFile = data['@type'].includes('schema:DigitalDocument');
|
|
49
48
|
return {
|
|
50
49
|
titleMetadata: defaultTitleMetadata,
|
|
51
|
-
topMetadata:
|
|
50
|
+
topMetadata: isFile ? [{
|
|
52
51
|
name: ElementName.LatestCommit
|
|
53
52
|
}, {
|
|
54
53
|
name: ElementName.CollaboratorGroup
|
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { ElementName } from '../../constants';
|
|
5
5
|
import { extractType } from '@atlaskit/link-extractors';
|
|
6
6
|
import { extractOwnedBy } from '../../extractors/flexible/utils';
|
|
7
|
-
import {
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(extensionKey, data) {
|
|
9
9
|
var _data$Type$includes, _data$Type;
|
|
10
10
|
var types = data ? extractType(data) : undefined;
|
|
@@ -20,7 +20,7 @@ var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(extensionKe
|
|
|
20
20
|
subtitle: [ElementName.SourceBranch, ElementName.TargetBranch]
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
if (
|
|
23
|
+
if (types !== null && types !== void 0 && types.includes('schema:DigitalDocument')) {
|
|
24
24
|
return {
|
|
25
25
|
primary: [ElementName.LatestCommit, ElementName.CollaboratorGroup, ElementName.ModifiedOn]
|
|
26
26
|
};
|
|
@@ -88,11 +88,11 @@ var toElementItems = function toElementItems(elementNames) {
|
|
|
88
88
|
};
|
|
89
89
|
export var getMetadata = function getMetadata(extensionKey, data) {
|
|
90
90
|
var metadata = getSimulatedBetterMetadata(extensionKey, data);
|
|
91
|
-
var primary =
|
|
91
|
+
var primary = fg('platform.linking-platform.smart-card.hover-card-action-redesign') ? [].concat(metadata.primary, metadata.tertiary) : metadata.primary;
|
|
92
92
|
|
|
93
93
|
// `tertiary` should be removed completely during cleanup:
|
|
94
94
|
// https://product-fabric.atlassian.net/browse/EDM-9556
|
|
95
|
-
var tertiary =
|
|
95
|
+
var tertiary = fg('platform.linking-platform.smart-card.hover-card-action-redesign') ? undefined : metadata.tertiary;
|
|
96
96
|
return {
|
|
97
97
|
subtitle: toElementItems(metadata.subtitle),
|
|
98
98
|
primary: toElementItems(primary),
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "27.
|
|
13
|
+
packageVersion: "27.17.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.17.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"@atlaskit/avatar": "^21.15.0",
|
|
35
35
|
"@atlaskit/avatar-group": "^9.11.0",
|
|
36
36
|
"@atlaskit/badge": "^16.4.0",
|
|
37
|
-
"@atlaskit/button": "^20.
|
|
37
|
+
"@atlaskit/button": "^20.1.0",
|
|
38
38
|
"@atlaskit/checkbox": "^13.7.0",
|
|
39
39
|
"@atlaskit/dropdown-menu": "^12.17.0",
|
|
40
40
|
"@atlaskit/form": "^10.5.0",
|
|
41
41
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
42
42
|
"@atlaskit/heading": "^2.4.0",
|
|
43
|
-
"@atlaskit/icon": "^22.
|
|
44
|
-
"@atlaskit/icon-file-type": "^6.
|
|
43
|
+
"@atlaskit/icon": "^22.14.0",
|
|
44
|
+
"@atlaskit/icon-file-type": "^6.5.0",
|
|
45
45
|
"@atlaskit/icon-object": "^6.5.0",
|
|
46
46
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
47
47
|
"@atlaskit/link-analytics": "^8.5.0",
|
|
48
48
|
"@atlaskit/link-client-extension": "^2.1.0",
|
|
49
|
-
"@atlaskit/link-extractors": "^1.
|
|
49
|
+
"@atlaskit/link-extractors": "^1.8.0",
|
|
50
50
|
"@atlaskit/linking-common": "^5.11.0",
|
|
51
51
|
"@atlaskit/linking-types": "^9.0.0",
|
|
52
52
|
"@atlaskit/logo": "^14.2.0",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"@atlaskit/popup": "^1.23.0",
|
|
59
59
|
"@atlaskit/primitives": "^12.0.0",
|
|
60
60
|
"@atlaskit/section-message": "^6.6.0",
|
|
61
|
-
"@atlaskit/select": "^17.
|
|
61
|
+
"@atlaskit/select": "^17.15.0",
|
|
62
62
|
"@atlaskit/spinner": "^16.3.0",
|
|
63
63
|
"@atlaskit/textarea": "^5.6.0",
|
|
64
64
|
"@atlaskit/textfield": "^6.5.0",
|
|
65
65
|
"@atlaskit/theme": "^13.0.0",
|
|
66
|
-
"@atlaskit/tokens": "^1.
|
|
66
|
+
"@atlaskit/tokens": "^1.59.0",
|
|
67
67
|
"@atlaskit/tooltip": "^18.7.0",
|
|
68
68
|
"@atlaskit/ufo": "^0.3.0",
|
|
69
69
|
"@babel/runtime": "^7.0.0",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"@af/visual-regression": "*",
|
|
94
94
|
"@atlaskit/analytics-listeners": "^8.11.0",
|
|
95
95
|
"@atlaskit/css-reset": "^6.10.0",
|
|
96
|
-
"@atlaskit/link-test-helpers": "^7.
|
|
97
|
-
"@atlaskit/media-test-helpers": "^34.
|
|
96
|
+
"@atlaskit/link-test-helpers": "^7.5.0",
|
|
97
|
+
"@atlaskit/media-test-helpers": "^34.1.0",
|
|
98
98
|
"@atlaskit/ssr": "*",
|
|
99
99
|
"@atlaskit/visual-regression": "*",
|
|
100
100
|
"@atlassian/analytics-tooling": "*",
|
|
@@ -157,9 +157,6 @@
|
|
|
157
157
|
"platform.linking-platform.smart-card.enable-hover-card-related-urls": {
|
|
158
158
|
"type": "boolean"
|
|
159
159
|
},
|
|
160
|
-
"platform.linking-platform.extractor.improve-bitbucket-file-links": {
|
|
161
|
-
"type": "boolean"
|
|
162
|
-
},
|
|
163
160
|
"platform.linking-platform.smart-card.hover-card-ai-summaries": {
|
|
164
161
|
"type": "boolean"
|
|
165
162
|
},
|
|
@@ -169,9 +166,6 @@
|
|
|
169
166
|
"platform.linking-platform.smart-card.hover-card-action-redesign": {
|
|
170
167
|
"type": "boolean"
|
|
171
168
|
},
|
|
172
|
-
"platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour": {
|
|
173
|
-
"type": "boolean"
|
|
174
|
-
},
|
|
175
169
|
"platform.linking-platform.smart-card.fix-embed-card-blurring": {
|
|
176
170
|
"type": "boolean"
|
|
177
171
|
},
|