@atlaskit/smart-card 38.1.0 → 38.1.1
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 +8 -0
- package/dist/cjs/extractors/flexible/index.js +11 -83
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/index.js +11 -83
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/index.js +11 -83
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/flexible/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 38.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#154969](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154969)
|
|
8
|
+
[`b495a5c681f5b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b495a5c681f5b) -
|
|
9
|
+
Update flexible card extractor to allow noun support
|
|
10
|
+
|
|
3
11
|
## 38.1.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -25,7 +25,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
25
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
26
|
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; }
|
|
27
27
|
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) { (0, _defineProperty2.default)(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; }
|
|
28
|
-
var
|
|
28
|
+
var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
29
29
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
30
|
var appearance = _ref.appearance,
|
|
31
31
|
fireEvent = _ref.fireEvent,
|
|
@@ -41,7 +41,7 @@ var extractFlexibleUiContextFromJsonLd = function extractFlexibleUiContextFromJs
|
|
|
41
41
|
return undefined;
|
|
42
42
|
}
|
|
43
43
|
var data = response.data;
|
|
44
|
-
var url = (0, _linkExtractors.extractLink)(data);
|
|
44
|
+
var url = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkUrl)(response) : (0, _linkExtractors.extractLink)(data);
|
|
45
45
|
return _objectSpread({
|
|
46
46
|
actions: (0, _actions.extractFlexibleCardActions)({
|
|
47
47
|
actionOptions: actionOptions,
|
|
@@ -64,19 +64,19 @@ var extractFlexibleUiContextFromJsonLd = function extractFlexibleUiContextFromJs
|
|
|
64
64
|
reactCount: (0, _utils.extractReactCount)(data),
|
|
65
65
|
voteCount: (0, _utils.extractVoteCount)(data),
|
|
66
66
|
checklistProgress: (0, _utils.extractChecklistProgress)(data),
|
|
67
|
-
createdBy: (0, _utils.extractCreatedBy)(data),
|
|
67
|
+
createdBy: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkCreatedBy)(response) : (0, _utils.extractCreatedBy)(data),
|
|
68
68
|
ownedBy: (0, _utils.extractOwnedBy)(data),
|
|
69
69
|
assignedTo: (0, _utils.extractAssignedTo)(data),
|
|
70
|
-
createdOn: (0, _linkExtractors.extractDateCreated)(data),
|
|
70
|
+
createdOn: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkCreatedOn)(response) : (0, _linkExtractors.extractDateCreated)(data),
|
|
71
71
|
dueOn: (0, _utils.extractDueOn)(data),
|
|
72
72
|
latestCommit: (0, _latestCommit.extractLatestCommit)(data),
|
|
73
|
-
linkIcon: (0, _icon.extractLinkIcon)(response, renderers),
|
|
73
|
+
linkIcon: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _icon.extractSmartLinkIcon)(response) : (0, _icon.extractLinkIcon)(response, renderers),
|
|
74
74
|
location: (0, _utils.extractLocation)(data),
|
|
75
|
-
modifiedBy: (0, _utils.extractModifiedBy)(data),
|
|
76
|
-
modifiedOn: (0, _linkExtractors.extractDateUpdated)(data),
|
|
77
|
-
preview: (0, _extractPreview.default)(data),
|
|
75
|
+
modifiedBy: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkModifiedBy)(response) : (0, _utils.extractModifiedBy)(data),
|
|
76
|
+
modifiedOn: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkModifiedOn)(response) : (0, _linkExtractors.extractDateUpdated)(data),
|
|
77
|
+
preview: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _extractPreview.extractSmartLinkPreviewImage)(response) : (0, _extractPreview.default)(data),
|
|
78
78
|
priority: (0, _extractPriority.default)(data),
|
|
79
|
-
provider: (0, _extractProviderIcon.default)(data),
|
|
79
|
+
provider: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _extractProviderIcon.extractSmartLinkProviderIcon)(response) : (0, _extractProviderIcon.default)(data),
|
|
80
80
|
programmingLanguage: (0, _utils.extractProgrammingLanguage)(data),
|
|
81
81
|
readTime: (0, _utils.extractReadTime)(data),
|
|
82
82
|
sentOn: (0, _utils.extractSentOn)(data),
|
|
@@ -88,83 +88,11 @@ var extractFlexibleUiContextFromJsonLd = function extractFlexibleUiContextFromJs
|
|
|
88
88
|
subTasksProgress: (0, _utils.extractSubTasksProgress)(data),
|
|
89
89
|
storyPoints: (0, _utils.extractStoryPoints)(data),
|
|
90
90
|
targetBranch: (0, _utils.extractTargetBranch)(data),
|
|
91
|
-
title: (0, _linkExtractors.extractTitle)(data) || url,
|
|
91
|
+
title: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkTitle)(response) || url : (0, _linkExtractors.extractTitle)(data) || url,
|
|
92
92
|
url: url,
|
|
93
|
-
ari: (0, _linkExtractors.extractAri)(data)
|
|
93
|
+
ari: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkAri)(response) : (0, _linkExtractors.extractAri)(data)
|
|
94
94
|
}, (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v2') && {
|
|
95
95
|
type: (0, _linkExtractors.extractType)(data)
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
|
-
var extractFlexibleUiContextFromEntity = function extractFlexibleUiContextFromEntity() {
|
|
99
|
-
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
100
|
-
actionOptions = _ref2.actionOptions,
|
|
101
|
-
appearance = _ref2.appearance,
|
|
102
|
-
fireEvent = _ref2.fireEvent,
|
|
103
|
-
id = _ref2.id,
|
|
104
|
-
origin = _ref2.origin,
|
|
105
|
-
resolve = _ref2.resolve,
|
|
106
|
-
response = _ref2.response;
|
|
107
|
-
if (!response) {
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
var data = response.data;
|
|
111
|
-
var url = (0, _linkExtractors.extractSmartLinkUrl)(response);
|
|
112
|
-
return _objectSpread({
|
|
113
|
-
actions: (0, _actions.extractFlexibleCardActions)({
|
|
114
|
-
response: response,
|
|
115
|
-
actionOptions: actionOptions,
|
|
116
|
-
id: id,
|
|
117
|
-
appearance: appearance,
|
|
118
|
-
fireEvent: fireEvent
|
|
119
|
-
}),
|
|
120
|
-
url: url,
|
|
121
|
-
ari: (0, _linkExtractors.extractSmartLinkAri)(response),
|
|
122
|
-
title: (0, _linkExtractors.extractSmartLinkTitle)(response) || url,
|
|
123
|
-
linkIcon: (0, _icon.extractSmartLinkIcon)(response),
|
|
124
|
-
preview: (0, _extractPreview.extractSmartLinkPreviewImage)(response),
|
|
125
|
-
provider: (0, _extractProviderIcon.extractSmartLinkProviderIcon)(response),
|
|
126
|
-
modifiedOn: (0, _linkExtractors.extractSmartLinkModifiedOn)(response),
|
|
127
|
-
createdOn: (0, _linkExtractors.extractSmartLinkCreatedOn)(response),
|
|
128
|
-
createdBy: (0, _linkExtractors.extractSmartLinkCreatedBy)(response),
|
|
129
|
-
modifiedBy: (0, _linkExtractors.extractSmartLinkModifiedBy)(response),
|
|
130
|
-
// We need to add/remove these as we support new entity types
|
|
131
|
-
assignedToGroup: (0, _utils.extractPersonAssignedToAsArray)(data),
|
|
132
|
-
appliedToComponentsCount: (0, _utils.extractAppliedToComponentsCount)(data),
|
|
133
|
-
attachmentCount: (0, _utils.extractAttachmentCount)(data),
|
|
134
|
-
authorGroup: (0, _linkExtractors.extractPersonCreatedBy)(data),
|
|
135
|
-
ownedByGroup: (0, _linkExtractors.extractPersonOwnedBy)(data),
|
|
136
|
-
collaboratorGroup: (0, _collaboratorGroup.extractPersonsUpdatedBy)(data),
|
|
137
|
-
commentCount: (0, _utils.extractCommentCount)(data),
|
|
138
|
-
viewCount: (0, _utils.extractViewCount)(data),
|
|
139
|
-
reactCount: (0, _utils.extractReactCount)(data),
|
|
140
|
-
voteCount: (0, _utils.extractVoteCount)(data),
|
|
141
|
-
checklistProgress: (0, _utils.extractChecklistProgress)(data),
|
|
142
|
-
ownedBy: (0, _utils.extractOwnedBy)(data),
|
|
143
|
-
assignedTo: (0, _utils.extractAssignedTo)(data),
|
|
144
|
-
dueOn: (0, _utils.extractDueOn)(data),
|
|
145
|
-
latestCommit: (0, _latestCommit.extractLatestCommit)(data),
|
|
146
|
-
location: (0, _utils.extractLocation)(data),
|
|
147
|
-
priority: (0, _extractPriority.default)(data),
|
|
148
|
-
programmingLanguage: (0, _utils.extractProgrammingLanguage)(data),
|
|
149
|
-
readTime: (0, _utils.extractReadTime)(data),
|
|
150
|
-
sentOn: (0, _utils.extractSentOn)(data),
|
|
151
|
-
snippet: (0, _primitives.extractSummary)(data) || undefined,
|
|
152
|
-
// Explicitly set here to remove an empty string
|
|
153
|
-
sourceBranch: (0, _utils.extractSourceBranch)(data),
|
|
154
|
-
state: (0, _extractState.default)(response, actionOptions, id, appearance, origin, fireEvent, resolve),
|
|
155
|
-
subscriberCount: (0, _utils.extractSubscriberCount)(data),
|
|
156
|
-
subTasksProgress: (0, _utils.extractSubTasksProgress)(data),
|
|
157
|
-
storyPoints: (0, _utils.extractStoryPoints)(data),
|
|
158
|
-
targetBranch: (0, _utils.extractTargetBranch)(data)
|
|
159
|
-
}, (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v2') && {
|
|
160
|
-
type: (0, _linkExtractors.extractType)(data)
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
164
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
165
|
-
if ((0, _platformFeatureFlags.fg)('smart_links_noun_support')) {
|
|
166
|
-
return extractFlexibleUiContextFromEntity(props);
|
|
167
|
-
}
|
|
168
|
-
return extractFlexibleUiContextFromJsonLd(props);
|
|
169
|
-
};
|
|
170
98
|
var _default = exports.default = extractFlexibleUiContext;
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "38.1.
|
|
14
|
+
packageVersion: "38.1.1"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
20
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
21
21
|
var PACKAGE_DATA = {
|
|
22
22
|
packageName: "@atlaskit/smart-card",
|
|
23
|
-
packageVersion: "38.1.
|
|
23
|
+
packageVersion: "38.1.1",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -10,7 +10,7 @@ import { extractLinkIcon, extractSmartLinkIcon } from './icon';
|
|
|
10
10
|
import extractProviderIcon, { extractSmartLinkProviderIcon } from './icon/extract-provider-icon';
|
|
11
11
|
import { extractLatestCommit } from './latest-commit';
|
|
12
12
|
import { extractAppliedToComponentsCount, extractAssignedTo, extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractDueOn, extractLocation, extractModifiedBy, extractOwnedBy, extractPersonAssignedToAsArray, extractProgrammingLanguage, extractReactCount, extractReadTime, extractSentOn, extractSourceBranch, extractStoryPoints, extractSubscriberCount, extractSubTasksProgress, extractTargetBranch, extractViewCount, extractVoteCount } from './utils';
|
|
13
|
-
const
|
|
13
|
+
const extractFlexibleUiContext = ({
|
|
14
14
|
appearance,
|
|
15
15
|
fireEvent,
|
|
16
16
|
id,
|
|
@@ -26,7 +26,7 @@ const extractFlexibleUiContextFromJsonLd = ({
|
|
|
26
26
|
return undefined;
|
|
27
27
|
}
|
|
28
28
|
const data = response.data;
|
|
29
|
-
const url = extractLink(data);
|
|
29
|
+
const url = fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : extractLink(data);
|
|
30
30
|
return {
|
|
31
31
|
actions: extractFlexibleCardActions({
|
|
32
32
|
actionOptions,
|
|
@@ -49,19 +49,19 @@ const extractFlexibleUiContextFromJsonLd = ({
|
|
|
49
49
|
reactCount: extractReactCount(data),
|
|
50
50
|
voteCount: extractVoteCount(data),
|
|
51
51
|
checklistProgress: extractChecklistProgress(data),
|
|
52
|
-
createdBy: extractCreatedBy(data),
|
|
52
|
+
createdBy: fg('smart_links_noun_support') ? extractSmartLinkCreatedBy(response) : extractCreatedBy(data),
|
|
53
53
|
ownedBy: extractOwnedBy(data),
|
|
54
54
|
assignedTo: extractAssignedTo(data),
|
|
55
|
-
createdOn: extractDateCreated(data),
|
|
55
|
+
createdOn: fg('smart_links_noun_support') ? extractSmartLinkCreatedOn(response) : extractDateCreated(data),
|
|
56
56
|
dueOn: extractDueOn(data),
|
|
57
57
|
latestCommit: extractLatestCommit(data),
|
|
58
|
-
linkIcon: extractLinkIcon(response, renderers),
|
|
58
|
+
linkIcon: fg('smart_links_noun_support') ? extractSmartLinkIcon(response) : extractLinkIcon(response, renderers),
|
|
59
59
|
location: extractLocation(data),
|
|
60
|
-
modifiedBy: extractModifiedBy(data),
|
|
61
|
-
modifiedOn: extractDateUpdated(data),
|
|
62
|
-
preview: extractPreview(data),
|
|
60
|
+
modifiedBy: fg('smart_links_noun_support') ? extractSmartLinkModifiedBy(response) : extractModifiedBy(data),
|
|
61
|
+
modifiedOn: fg('smart_links_noun_support') ? extractSmartLinkModifiedOn(response) : extractDateUpdated(data),
|
|
62
|
+
preview: fg('smart_links_noun_support') ? extractSmartLinkPreviewImage(response) : extractPreview(data),
|
|
63
63
|
priority: extractPriority(data),
|
|
64
|
-
provider: extractProviderIcon(data),
|
|
64
|
+
provider: fg('smart_links_noun_support') ? extractSmartLinkProviderIcon(response) : extractProviderIcon(data),
|
|
65
65
|
programmingLanguage: extractProgrammingLanguage(data),
|
|
66
66
|
readTime: extractReadTime(data),
|
|
67
67
|
sentOn: extractSentOn(data),
|
|
@@ -73,84 +73,12 @@ const extractFlexibleUiContextFromJsonLd = ({
|
|
|
73
73
|
subTasksProgress: extractSubTasksProgress(data),
|
|
74
74
|
storyPoints: extractStoryPoints(data),
|
|
75
75
|
targetBranch: extractTargetBranch(data),
|
|
76
|
-
title: extractTitle(data) || url,
|
|
76
|
+
title: fg('smart_links_noun_support') ? extractSmartLinkTitle(response) || url : extractTitle(data) || url,
|
|
77
77
|
url,
|
|
78
|
-
ari: extractAri(data),
|
|
78
|
+
ari: fg('smart_links_noun_support') ? extractSmartLinkAri(response) : extractAri(data),
|
|
79
79
|
...(fg('platform-linking-visual-refresh-v2') && {
|
|
80
80
|
type: extractType(data)
|
|
81
81
|
})
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
|
-
const extractFlexibleUiContextFromEntity = ({
|
|
85
|
-
actionOptions,
|
|
86
|
-
appearance,
|
|
87
|
-
fireEvent,
|
|
88
|
-
id,
|
|
89
|
-
origin,
|
|
90
|
-
resolve,
|
|
91
|
-
response
|
|
92
|
-
} = {}) => {
|
|
93
|
-
if (!response) {
|
|
94
|
-
return undefined;
|
|
95
|
-
}
|
|
96
|
-
const data = response.data;
|
|
97
|
-
const url = extractSmartLinkUrl(response);
|
|
98
|
-
return {
|
|
99
|
-
actions: extractFlexibleCardActions({
|
|
100
|
-
response,
|
|
101
|
-
actionOptions,
|
|
102
|
-
id,
|
|
103
|
-
appearance,
|
|
104
|
-
fireEvent
|
|
105
|
-
}),
|
|
106
|
-
url,
|
|
107
|
-
ari: extractSmartLinkAri(response),
|
|
108
|
-
title: extractSmartLinkTitle(response) || url,
|
|
109
|
-
linkIcon: extractSmartLinkIcon(response),
|
|
110
|
-
preview: extractSmartLinkPreviewImage(response),
|
|
111
|
-
provider: extractSmartLinkProviderIcon(response),
|
|
112
|
-
modifiedOn: extractSmartLinkModifiedOn(response),
|
|
113
|
-
createdOn: extractSmartLinkCreatedOn(response),
|
|
114
|
-
createdBy: extractSmartLinkCreatedBy(response),
|
|
115
|
-
modifiedBy: extractSmartLinkModifiedBy(response),
|
|
116
|
-
// We need to add/remove these as we support new entity types
|
|
117
|
-
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
118
|
-
appliedToComponentsCount: extractAppliedToComponentsCount(data),
|
|
119
|
-
attachmentCount: extractAttachmentCount(data),
|
|
120
|
-
authorGroup: extractPersonCreatedBy(data),
|
|
121
|
-
ownedByGroup: extractPersonOwnedBy(data),
|
|
122
|
-
collaboratorGroup: extractPersonsUpdatedBy(data),
|
|
123
|
-
commentCount: extractCommentCount(data),
|
|
124
|
-
viewCount: extractViewCount(data),
|
|
125
|
-
reactCount: extractReactCount(data),
|
|
126
|
-
voteCount: extractVoteCount(data),
|
|
127
|
-
checklistProgress: extractChecklistProgress(data),
|
|
128
|
-
ownedBy: extractOwnedBy(data),
|
|
129
|
-
assignedTo: extractAssignedTo(data),
|
|
130
|
-
dueOn: extractDueOn(data),
|
|
131
|
-
latestCommit: extractLatestCommit(data),
|
|
132
|
-
location: extractLocation(data),
|
|
133
|
-
priority: extractPriority(data),
|
|
134
|
-
programmingLanguage: extractProgrammingLanguage(data),
|
|
135
|
-
readTime: extractReadTime(data),
|
|
136
|
-
sentOn: extractSentOn(data),
|
|
137
|
-
snippet: extractSummary(data) || undefined,
|
|
138
|
-
// Explicitly set here to remove an empty string
|
|
139
|
-
sourceBranch: extractSourceBranch(data),
|
|
140
|
-
state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve),
|
|
141
|
-
subscriberCount: extractSubscriberCount(data),
|
|
142
|
-
subTasksProgress: extractSubTasksProgress(data),
|
|
143
|
-
storyPoints: extractStoryPoints(data),
|
|
144
|
-
targetBranch: extractTargetBranch(data),
|
|
145
|
-
...(fg('platform-linking-visual-refresh-v2') && {
|
|
146
|
-
type: extractType(data)
|
|
147
|
-
})
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
const extractFlexibleUiContext = (props = {}) => {
|
|
151
|
-
if (fg('smart_links_noun_support')) {
|
|
152
|
-
return extractFlexibleUiContextFromEntity(props);
|
|
153
|
-
}
|
|
154
|
-
return extractFlexibleUiContextFromJsonLd(props);
|
|
155
|
-
};
|
|
156
84
|
export default extractFlexibleUiContext;
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "38.1.
|
|
5
|
+
packageVersion: "38.1.1"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
const PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "38.1.
|
|
13
|
+
packageVersion: "38.1.1",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -15,7 +15,7 @@ import { extractLinkIcon, extractSmartLinkIcon } from './icon';
|
|
|
15
15
|
import extractProviderIcon, { extractSmartLinkProviderIcon } from './icon/extract-provider-icon';
|
|
16
16
|
import { extractLatestCommit } from './latest-commit';
|
|
17
17
|
import { extractAppliedToComponentsCount, extractAssignedTo, extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractDueOn, extractLocation, extractModifiedBy, extractOwnedBy, extractPersonAssignedToAsArray, extractProgrammingLanguage, extractReactCount, extractReadTime, extractSentOn, extractSourceBranch, extractStoryPoints, extractSubscriberCount, extractSubTasksProgress, extractTargetBranch, extractViewCount, extractVoteCount } from './utils';
|
|
18
|
-
var
|
|
18
|
+
var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
19
19
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
20
|
var appearance = _ref.appearance,
|
|
21
21
|
fireEvent = _ref.fireEvent,
|
|
@@ -31,7 +31,7 @@ var extractFlexibleUiContextFromJsonLd = function extractFlexibleUiContextFromJs
|
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
33
|
var data = response.data;
|
|
34
|
-
var url = extractLink(data);
|
|
34
|
+
var url = fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : extractLink(data);
|
|
35
35
|
return _objectSpread({
|
|
36
36
|
actions: extractFlexibleCardActions({
|
|
37
37
|
actionOptions: actionOptions,
|
|
@@ -54,19 +54,19 @@ var extractFlexibleUiContextFromJsonLd = function extractFlexibleUiContextFromJs
|
|
|
54
54
|
reactCount: extractReactCount(data),
|
|
55
55
|
voteCount: extractVoteCount(data),
|
|
56
56
|
checklistProgress: extractChecklistProgress(data),
|
|
57
|
-
createdBy: extractCreatedBy(data),
|
|
57
|
+
createdBy: fg('smart_links_noun_support') ? extractSmartLinkCreatedBy(response) : extractCreatedBy(data),
|
|
58
58
|
ownedBy: extractOwnedBy(data),
|
|
59
59
|
assignedTo: extractAssignedTo(data),
|
|
60
|
-
createdOn: extractDateCreated(data),
|
|
60
|
+
createdOn: fg('smart_links_noun_support') ? extractSmartLinkCreatedOn(response) : extractDateCreated(data),
|
|
61
61
|
dueOn: extractDueOn(data),
|
|
62
62
|
latestCommit: extractLatestCommit(data),
|
|
63
|
-
linkIcon: extractLinkIcon(response, renderers),
|
|
63
|
+
linkIcon: fg('smart_links_noun_support') ? extractSmartLinkIcon(response) : extractLinkIcon(response, renderers),
|
|
64
64
|
location: extractLocation(data),
|
|
65
|
-
modifiedBy: extractModifiedBy(data),
|
|
66
|
-
modifiedOn: extractDateUpdated(data),
|
|
67
|
-
preview: extractPreview(data),
|
|
65
|
+
modifiedBy: fg('smart_links_noun_support') ? extractSmartLinkModifiedBy(response) : extractModifiedBy(data),
|
|
66
|
+
modifiedOn: fg('smart_links_noun_support') ? extractSmartLinkModifiedOn(response) : extractDateUpdated(data),
|
|
67
|
+
preview: fg('smart_links_noun_support') ? extractSmartLinkPreviewImage(response) : extractPreview(data),
|
|
68
68
|
priority: extractPriority(data),
|
|
69
|
-
provider: extractProviderIcon(data),
|
|
69
|
+
provider: fg('smart_links_noun_support') ? extractSmartLinkProviderIcon(response) : extractProviderIcon(data),
|
|
70
70
|
programmingLanguage: extractProgrammingLanguage(data),
|
|
71
71
|
readTime: extractReadTime(data),
|
|
72
72
|
sentOn: extractSentOn(data),
|
|
@@ -78,83 +78,11 @@ var extractFlexibleUiContextFromJsonLd = function extractFlexibleUiContextFromJs
|
|
|
78
78
|
subTasksProgress: extractSubTasksProgress(data),
|
|
79
79
|
storyPoints: extractStoryPoints(data),
|
|
80
80
|
targetBranch: extractTargetBranch(data),
|
|
81
|
-
title: extractTitle(data) || url,
|
|
81
|
+
title: fg('smart_links_noun_support') ? extractSmartLinkTitle(response) || url : extractTitle(data) || url,
|
|
82
82
|
url: url,
|
|
83
|
-
ari: extractAri(data)
|
|
83
|
+
ari: fg('smart_links_noun_support') ? extractSmartLinkAri(response) : extractAri(data)
|
|
84
84
|
}, fg('platform-linking-visual-refresh-v2') && {
|
|
85
85
|
type: extractType(data)
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
|
-
var extractFlexibleUiContextFromEntity = function extractFlexibleUiContextFromEntity() {
|
|
89
|
-
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
90
|
-
actionOptions = _ref2.actionOptions,
|
|
91
|
-
appearance = _ref2.appearance,
|
|
92
|
-
fireEvent = _ref2.fireEvent,
|
|
93
|
-
id = _ref2.id,
|
|
94
|
-
origin = _ref2.origin,
|
|
95
|
-
resolve = _ref2.resolve,
|
|
96
|
-
response = _ref2.response;
|
|
97
|
-
if (!response) {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
var data = response.data;
|
|
101
|
-
var url = extractSmartLinkUrl(response);
|
|
102
|
-
return _objectSpread({
|
|
103
|
-
actions: extractFlexibleCardActions({
|
|
104
|
-
response: response,
|
|
105
|
-
actionOptions: actionOptions,
|
|
106
|
-
id: id,
|
|
107
|
-
appearance: appearance,
|
|
108
|
-
fireEvent: fireEvent
|
|
109
|
-
}),
|
|
110
|
-
url: url,
|
|
111
|
-
ari: extractSmartLinkAri(response),
|
|
112
|
-
title: extractSmartLinkTitle(response) || url,
|
|
113
|
-
linkIcon: extractSmartLinkIcon(response),
|
|
114
|
-
preview: extractSmartLinkPreviewImage(response),
|
|
115
|
-
provider: extractSmartLinkProviderIcon(response),
|
|
116
|
-
modifiedOn: extractSmartLinkModifiedOn(response),
|
|
117
|
-
createdOn: extractSmartLinkCreatedOn(response),
|
|
118
|
-
createdBy: extractSmartLinkCreatedBy(response),
|
|
119
|
-
modifiedBy: extractSmartLinkModifiedBy(response),
|
|
120
|
-
// We need to add/remove these as we support new entity types
|
|
121
|
-
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
122
|
-
appliedToComponentsCount: extractAppliedToComponentsCount(data),
|
|
123
|
-
attachmentCount: extractAttachmentCount(data),
|
|
124
|
-
authorGroup: extractPersonCreatedBy(data),
|
|
125
|
-
ownedByGroup: extractPersonOwnedBy(data),
|
|
126
|
-
collaboratorGroup: extractPersonsUpdatedBy(data),
|
|
127
|
-
commentCount: extractCommentCount(data),
|
|
128
|
-
viewCount: extractViewCount(data),
|
|
129
|
-
reactCount: extractReactCount(data),
|
|
130
|
-
voteCount: extractVoteCount(data),
|
|
131
|
-
checklistProgress: extractChecklistProgress(data),
|
|
132
|
-
ownedBy: extractOwnedBy(data),
|
|
133
|
-
assignedTo: extractAssignedTo(data),
|
|
134
|
-
dueOn: extractDueOn(data),
|
|
135
|
-
latestCommit: extractLatestCommit(data),
|
|
136
|
-
location: extractLocation(data),
|
|
137
|
-
priority: extractPriority(data),
|
|
138
|
-
programmingLanguage: extractProgrammingLanguage(data),
|
|
139
|
-
readTime: extractReadTime(data),
|
|
140
|
-
sentOn: extractSentOn(data),
|
|
141
|
-
snippet: extractSummary(data) || undefined,
|
|
142
|
-
// Explicitly set here to remove an empty string
|
|
143
|
-
sourceBranch: extractSourceBranch(data),
|
|
144
|
-
state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve),
|
|
145
|
-
subscriberCount: extractSubscriberCount(data),
|
|
146
|
-
subTasksProgress: extractSubTasksProgress(data),
|
|
147
|
-
storyPoints: extractStoryPoints(data),
|
|
148
|
-
targetBranch: extractTargetBranch(data)
|
|
149
|
-
}, fg('platform-linking-visual-refresh-v2') && {
|
|
150
|
-
type: extractType(data)
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
154
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
155
|
-
if (fg('smart_links_noun_support')) {
|
|
156
|
-
return extractFlexibleUiContextFromEntity(props);
|
|
157
|
-
}
|
|
158
|
-
return extractFlexibleUiContextFromJsonLd(props);
|
|
159
|
-
};
|
|
160
88
|
export default extractFlexibleUiContext;
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "38.1.
|
|
7
|
+
packageVersion: "38.1.1"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
13
13
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
14
14
|
var PACKAGE_DATA = {
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "38.1.
|
|
16
|
+
packageVersion: "38.1.1",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
|
|
2
2
|
import { type ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
|
|
3
|
-
declare const extractFlexibleUiContext: (props?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
3
|
+
declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, origin, renderers, resolve, actionOptions, response, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
4
4
|
export default extractFlexibleUiContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
|
|
2
2
|
import { type ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
|
|
3
|
-
declare const extractFlexibleUiContext: (props?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
3
|
+
declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, origin, renderers, resolve, actionOptions, response, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
4
4
|
export default extractFlexibleUiContext;
|