@atlaskit/smart-card 40.10.3 → 40.10.5
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/action/extract-invoke-copy-link-action.js +1 -3
- package/dist/cjs/extractors/action/extract-invoke-download-action.js +1 -3
- package/dist/cjs/extractors/action/extract-invoke-preview-action.js +5 -7
- package/dist/cjs/extractors/common/primitives/extractSummary.js +3 -6
- package/dist/cjs/extractors/embed/index.js +1 -14
- package/dist/cjs/extractors/flexible/actions/extract-view-related-links-action.js +1 -2
- package/dist/cjs/extractors/flexible/extract-preview.js +0 -5
- package/dist/cjs/extractors/flexible/utils.js +12 -19
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/utils/index.js +21 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/action/extract-invoke-copy-link-action.js +2 -4
- package/dist/es2019/extractors/action/extract-invoke-download-action.js +1 -3
- package/dist/es2019/extractors/action/extract-invoke-preview-action.js +6 -8
- package/dist/es2019/extractors/common/primitives/extractSummary.js +3 -7
- package/dist/es2019/extractors/embed/index.js +2 -12
- package/dist/es2019/extractors/flexible/actions/extract-view-related-links-action.js +2 -3
- package/dist/es2019/extractors/flexible/extract-preview.js +1 -6
- package/dist/es2019/extractors/flexible/utils.js +10 -17
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/utils/index.js +21 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/action/extract-invoke-copy-link-action.js +2 -4
- package/dist/esm/extractors/action/extract-invoke-download-action.js +1 -3
- package/dist/esm/extractors/action/extract-invoke-preview-action.js +6 -8
- package/dist/esm/extractors/common/primitives/extractSummary.js +3 -7
- package/dist/esm/extractors/embed/index.js +2 -14
- package/dist/esm/extractors/flexible/actions/extract-view-related-links-action.js +2 -3
- package/dist/esm/extractors/flexible/extract-preview.js +1 -6
- package/dist/esm/extractors/flexible/utils.js +12 -19
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/utils/index.js +21 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +8 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 40.10.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2a46c52a9d189`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2a46c52a9d189) -
|
|
8
|
+
NAVX-1307 cleaning up smart-links-noun-support
|
|
9
|
+
- [`f72b5d8c897b8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f72b5d8c897b8) -
|
|
10
|
+
[ux] Add ownedBy support for passionfruit-object-provider smart-link resolver under
|
|
11
|
+
`passionfruit_ask_smart_links_enabled` feature-gate
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 40.10.4
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`72230d76e232a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/72230d76e232a) -
|
|
19
|
+
NAVX-1308 cleaning up platform-linking-slack-entity-support
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 40.10.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -8,7 +8,6 @@ exports.extractInvokeCopyLinkAction = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _index = require("../../index");
|
|
13
12
|
var _helpers = require("../../state/helpers");
|
|
14
13
|
var _canShowAction = require("../../utils/actions/can-show-action");
|
|
@@ -20,8 +19,7 @@ var extractInvokeCopyLinkAction = exports.extractInvokeCopyLinkAction = function
|
|
|
20
19
|
if (!(0, _canShowAction.canShowAction)(_index.CardAction.CopyLinkAction, actionOptions)) {
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
var
|
|
24
|
-
var url = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkUrl)(response) : (0, _linkExtractors.extractLink)(data);
|
|
22
|
+
var url = (0, _linkExtractors.extractSmartLinkUrl)(response);
|
|
25
23
|
if (!url) {
|
|
26
24
|
return;
|
|
27
25
|
}
|
|
@@ -8,13 +8,11 @@ exports.extractInvokeDownloadAction = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _index = require("../../index");
|
|
13
12
|
var _helpers = require("../../state/helpers");
|
|
14
13
|
var _utils = require("../../utils");
|
|
15
14
|
var _canShowAction = require("../../utils/actions/can-show-action");
|
|
16
15
|
var _extractActions = require("../common/actions/extractActions");
|
|
17
|
-
var _extractDownloadUrl = require("../common/download/extractDownloadUrl");
|
|
18
16
|
var extractInvokeDownloadAction = exports.extractInvokeDownloadAction = function extractInvokeDownloadAction(_ref) {
|
|
19
17
|
var actionOptions = _ref.actionOptions,
|
|
20
18
|
appearance = _ref.appearance,
|
|
@@ -28,7 +26,7 @@ var extractInvokeDownloadAction = exports.extractInvokeDownloadAction = function
|
|
|
28
26
|
return action['@type'] === 'DownloadAction';
|
|
29
27
|
});
|
|
30
28
|
if (downloadActionExists) {
|
|
31
|
-
var downloadUrl = (0,
|
|
29
|
+
var downloadUrl = (0, _linkExtractors.extractSmartLinkDownloadUrl)(response);
|
|
32
30
|
return {
|
|
33
31
|
actionFn: function () {
|
|
34
32
|
var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
@@ -8,7 +8,6 @@ exports.extractInvokePreviewAction = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _index = require("../../index");
|
|
13
12
|
var _helpers = require("../../state/helpers");
|
|
14
13
|
var _canShowAction = require("../../utils/actions/can-show-action");
|
|
@@ -34,12 +33,11 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
|
|
|
34
33
|
var meta = response.meta;
|
|
35
34
|
var src = (_extractPreviewData = (0, _linkExtractors.extractPreview)(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
|
|
36
35
|
if (src) {
|
|
37
|
-
var url = (0, _linkExtractors.extractLink)(data);
|
|
38
36
|
var extensionKey = (0, _helpers.getExtensionKey)(response);
|
|
39
37
|
return {
|
|
40
38
|
actionFn: function () {
|
|
41
39
|
var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
42
|
-
var _extractSmartLinkProv,
|
|
40
|
+
var _extractSmartLinkProv, _extractSmartLinkEmbe;
|
|
43
41
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
44
42
|
while (1) switch (_context.prev = _context.next) {
|
|
45
43
|
case 0:
|
|
@@ -52,12 +50,12 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
|
|
|
52
50
|
isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta),
|
|
53
51
|
isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
|
|
54
52
|
linkIcon: (0, _icon.extractLinkIcon)(response),
|
|
55
|
-
providerName: (
|
|
53
|
+
providerName: (_extractSmartLinkProv = (0, _linkExtractors.extractSmartLinkProvider)(response)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text,
|
|
56
54
|
onClose: onClose,
|
|
57
55
|
origin: origin,
|
|
58
|
-
src: (
|
|
59
|
-
title: (0,
|
|
60
|
-
url: (0,
|
|
56
|
+
src: (_extractSmartLinkEmbe = (0, _linkExtractors.extractSmartLinkEmbed)(response)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src,
|
|
57
|
+
title: (0, _linkExtractors.extractSmartLinkTitle)(response),
|
|
58
|
+
url: (0, _linkExtractors.extractSmartLinkUrl)(response)
|
|
61
59
|
}));
|
|
62
60
|
case 1:
|
|
63
61
|
case "end":
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractSummary = exports.extractSmartLinkSummary = void 0;
|
|
7
7
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
/**
|
|
10
9
|
* Return link summary
|
|
11
10
|
*/
|
|
@@ -20,11 +19,9 @@ var extractSummary = exports.extractSummary = function extractSummary(jsonLd) {
|
|
|
20
19
|
* Return link summary
|
|
21
20
|
*/
|
|
22
21
|
var extractSmartLinkSummary = exports.extractSmartLinkSummary = function extractSmartLinkSummary(response) {
|
|
23
|
-
if ((0,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return (_extractEntity = (0, _linkExtractors.extractEntity)(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
|
|
27
|
-
}
|
|
22
|
+
if ((0, _linkExtractors.isEntityPresent)(response)) {
|
|
23
|
+
var _extractEntity;
|
|
24
|
+
return (_extractEntity = (0, _linkExtractors.extractEntity)(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
|
|
28
25
|
}
|
|
29
26
|
return (response === null || response === void 0 ? void 0 : response.data) && extractSummary(response.data);
|
|
30
27
|
};
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.extractEmbedProps = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
8
|
var _jsonld = require("../../utils/jsonld");
|
|
12
9
|
var _context = require("../common/context");
|
|
13
10
|
var _extractIsSupportTheming = require("../common/meta/extractIsSupportTheming");
|
|
14
11
|
var _extractIsTrusted = require("../common/meta/extractIsTrusted");
|
|
15
|
-
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; }
|
|
16
|
-
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; }
|
|
17
|
-
var extractEmbedPreview = function extractEmbedPreview(jsonLd, platform, iframeUrlType) {
|
|
18
|
-
var preview = (0, _linkExtractors.extractPreview)(jsonLd, platform, iframeUrlType);
|
|
19
|
-
if (preview && preview.src) {
|
|
20
|
-
return _objectSpread(_objectSpread({}, preview), {}, {
|
|
21
|
-
src: preview.src
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
12
|
var extractEmbedProps = exports.extractEmbedProps = function extractEmbedProps(response, platform, iframeUrlType) {
|
|
26
13
|
var meta = response === null || response === void 0 ? void 0 : response.meta;
|
|
27
14
|
var jsonLd = (response === null || response === void 0 ? void 0 : response.data) || (0, _jsonld.getEmptyJsonLd)();
|
|
@@ -29,7 +16,7 @@ var extractEmbedProps = exports.extractEmbedProps = function extractEmbedProps(r
|
|
|
29
16
|
link: (0, _linkExtractors.extractSmartLinkUrl)(response) || '',
|
|
30
17
|
title: (0, _linkExtractors.extractSmartLinkTitle)(response),
|
|
31
18
|
context: (0, _context.extractSmartLinkContext)(response),
|
|
32
|
-
preview: (0,
|
|
19
|
+
preview: (0, _linkExtractors.extractSmartLinkEmbed)(response, iframeUrlType),
|
|
33
20
|
isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
|
|
34
21
|
isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta),
|
|
35
22
|
type: (0, _linkExtractors.extractType)(jsonLd)
|
|
@@ -5,13 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractViewRelatedLinksAction = void 0;
|
|
7
7
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var extractViewRelatedLinksAction = exports.extractViewRelatedLinksAction = function extractViewRelatedLinksAction(response) {
|
|
10
9
|
var _response$meta;
|
|
11
10
|
if (!(response !== null && response !== void 0 && (_response$meta = response.meta) !== null && _response$meta !== void 0 && (_response$meta = _response$meta.supportedFeature) !== null && _response$meta !== void 0 && _response$meta.includes('RelatedLinks'))) {
|
|
12
11
|
return;
|
|
13
12
|
}
|
|
14
|
-
var ari = (0,
|
|
13
|
+
var ari = (0, _linkExtractors.extractSmartLinkAri)(response);
|
|
15
14
|
if (!ari) {
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractSmartLinkPreviewImage = exports.default = void 0;
|
|
7
7
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _constants = require("../../constants");
|
|
10
9
|
var extractPreview = function extractPreview(data) {
|
|
11
10
|
if (!data) {
|
|
@@ -29,10 +28,6 @@ var extractSmartLinkPreviewImage = exports.extractSmartLinkPreviewImage = functi
|
|
|
29
28
|
var _entity$thumbnail;
|
|
30
29
|
var entity = (0, _linkExtractors.extractEntity)(response);
|
|
31
30
|
var url = entity === null || entity === void 0 || (_entity$thumbnail = entity.thumbnail) === null || _entity$thumbnail === void 0 ? void 0 : _entity$thumbnail.externalUrl;
|
|
32
|
-
if (!url && !(0, _platformFeatureFlags.fg)('smart_links_noun_support')) {
|
|
33
|
-
var provider = (0, _linkExtractors.extractEntityProvider)(response);
|
|
34
|
-
url = provider === null || provider === void 0 ? void 0 : provider.image;
|
|
35
|
-
}
|
|
36
31
|
return url ? {
|
|
37
32
|
type: _constants.MediaType.Image,
|
|
38
33
|
url: url
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.extractVoteCount = exports.extractViewCount = exports.extractUserAttributes = exports.extractTeamMemberCount = exports.extractTargetBranch = exports.extractSubscriberCount = exports.extractSubTasksProgress = exports.extractStoryPoints = exports.extractSourceBranch = exports.extractSmartLinkSentOn = exports.extractSmartLinkReactCount = exports.extractSmartLinkCommentCount = exports.extractSentOn = exports.extractReadTime = exports.extractReactCount = exports.extractProgrammingLanguage = exports.extractPersonAssignedToAsArray = exports.extractOwnedBy = exports.extractModifiedBy = exports.extractMetaTenantId = exports.extractMetaResourceType = exports.extractMetaObjectId = exports.extractLocation = exports.extractDueOn = exports.extractCreatedBy = exports.extractCommentCount = exports.extractChecklistProgress = exports.extractAttachmentCount = exports.extractAssignedTo = exports.extractAppliedToComponentsCount = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var extractLinkName = function extractLinkName(link) {
|
|
12
11
|
if (link && (0, _typeof2.default)(link) === 'object' && link['@type'] === 'Link') {
|
|
13
12
|
return link.name;
|
|
@@ -27,11 +26,9 @@ var extractSmartLinkCommentCount = exports.extractSmartLinkCommentCount = functi
|
|
|
27
26
|
if (!response || !response.data) {
|
|
28
27
|
return undefined;
|
|
29
28
|
}
|
|
30
|
-
if ((0,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return entity && 'commentCount' in entity && typeof entity.commentCount === 'number' ? entity === null || entity === void 0 ? void 0 : entity.commentCount : undefined;
|
|
34
|
-
}
|
|
29
|
+
if ((0, _linkExtractors.isEntityPresent)(response)) {
|
|
30
|
+
var entity = (0, _linkExtractors.extractEntity)(response);
|
|
31
|
+
return entity && 'commentCount' in entity && typeof entity.commentCount === 'number' ? entity === null || entity === void 0 ? void 0 : entity.commentCount : undefined;
|
|
35
32
|
}
|
|
36
33
|
return (response === null || response === void 0 ? void 0 : response.data) && extractCommentCount(response === null || response === void 0 ? void 0 : response.data);
|
|
37
34
|
};
|
|
@@ -55,14 +52,12 @@ var extractSmartLinkReactCount = exports.extractSmartLinkReactCount = function e
|
|
|
55
52
|
if (!response || !response.data) {
|
|
56
53
|
return undefined;
|
|
57
54
|
}
|
|
58
|
-
if ((0,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
}, 0);
|
|
65
|
-
}
|
|
55
|
+
if ((0, _linkExtractors.isEntityPresent)(response)) {
|
|
56
|
+
var entity = (0, _linkExtractors.extractEntity)(response);
|
|
57
|
+
var reactions = entity && 'reactions' in entity && Array.isArray(entity.reactions) ? entity.reactions : undefined;
|
|
58
|
+
return reactions === null || reactions === void 0 ? void 0 : reactions.reduce(function (total, reaction) {
|
|
59
|
+
return total + (reaction === null || reaction === void 0 ? void 0 : reaction.total);
|
|
60
|
+
}, 0);
|
|
66
61
|
}
|
|
67
62
|
return (response === null || response === void 0 ? void 0 : response.data) && extractReactCount(response === null || response === void 0 ? void 0 : response.data);
|
|
68
63
|
};
|
|
@@ -152,11 +147,9 @@ var extractSmartLinkSentOn = exports.extractSmartLinkSentOn = function extractSm
|
|
|
152
147
|
if (!response || !response.data) {
|
|
153
148
|
return undefined;
|
|
154
149
|
}
|
|
155
|
-
if ((0,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return (_extractEntity = (0, _linkExtractors.extractEntity)(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.createdAt;
|
|
159
|
-
}
|
|
150
|
+
if ((0, _linkExtractors.isEntityPresent)(response)) {
|
|
151
|
+
var _extractEntity;
|
|
152
|
+
return (_extractEntity = (0, _linkExtractors.extractEntity)(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.createdAt;
|
|
160
153
|
}
|
|
161
154
|
return (response === null || response === void 0 ? void 0 : response.data) && extractSentOn(response === null || response === void 0 ? void 0 : response.data);
|
|
162
155
|
};
|
|
@@ -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: "40.10.
|
|
14
|
+
packageVersion: "40.10.4"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.titleBlockOptions = exports.getSimulatedBetterMetadata = exports.PreviewBlockOptions = exports.FlexibleCardUiOptions = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
8
|
var _constants = require("../../../../constants");
|
|
8
9
|
var _utils = require("../../../../extractors/flexible/utils");
|
|
9
10
|
var _helpers = require("../../../../state/helpers");
|
|
@@ -73,6 +74,26 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
|
|
|
73
74
|
name: _constants.ElementName.AppliedToComponentsCount
|
|
74
75
|
}].concat(baseBottomMetaData)
|
|
75
76
|
};
|
|
77
|
+
case 'passionfruit-object-provider':
|
|
78
|
+
if ((0, _platformFeatureFlags.fg)('passionfruit_ask_smart_links_enabled')) {
|
|
79
|
+
return {
|
|
80
|
+
titleMetadata: defaultTitleMetadata,
|
|
81
|
+
topMetadata: (0, _utils.extractOwnedBy)(data) ? [{
|
|
82
|
+
name: _constants.ElementName.OwnedByGroup
|
|
83
|
+
}, {
|
|
84
|
+
name: _constants.ElementName.OwnedBy
|
|
85
|
+
}].concat(baseTopMetadata) : defaultTopMetadata,
|
|
86
|
+
bottomMetadata: [{
|
|
87
|
+
name: _constants.ElementName.AppliedToComponentsCount
|
|
88
|
+
}].concat(baseBottomMetaData)
|
|
89
|
+
};
|
|
90
|
+
} else {
|
|
91
|
+
return {
|
|
92
|
+
titleMetadata: defaultTitleMetadata,
|
|
93
|
+
topMetadata: defaultTopMetadata,
|
|
94
|
+
bottomMetadata: defaultBottomMetadata
|
|
95
|
+
};
|
|
96
|
+
}
|
|
76
97
|
case 'confluence-object-provider':
|
|
77
98
|
return {
|
|
78
99
|
titleMetadata: defaultTitleMetadata,
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "40.10.
|
|
22
|
+
packageVersion: "40.10.4",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
|
+
import { extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
3
2
|
import { ActionName, CardAction } from '../../index';
|
|
4
3
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
|
|
5
4
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
@@ -12,8 +11,7 @@ export const extractInvokeCopyLinkAction = ({
|
|
|
12
11
|
if (!canShowAction(CardAction.CopyLinkAction, actionOptions)) {
|
|
13
12
|
return;
|
|
14
13
|
}
|
|
15
|
-
const
|
|
16
|
-
const url = fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : extractLink(data);
|
|
14
|
+
const url = extractSmartLinkUrl(response);
|
|
17
15
|
if (!url) {
|
|
18
16
|
return;
|
|
19
17
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { extractSmartLinkDownloadUrl } from '@atlaskit/link-extractors';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { ActionName, CardAction } from '../../index';
|
|
4
3
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
|
|
5
4
|
import { downloadUrl as download } from '../../utils';
|
|
6
5
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
7
6
|
import { getActionsFromJsonLd } from '../common/actions/extractActions';
|
|
8
|
-
import { extractDownloadUrl } from '../common/download/extractDownloadUrl';
|
|
9
7
|
export const extractInvokeDownloadAction = ({
|
|
10
8
|
actionOptions,
|
|
11
9
|
appearance,
|
|
@@ -18,7 +16,7 @@ export const extractInvokeDownloadAction = ({
|
|
|
18
16
|
const data = response.data;
|
|
19
17
|
const downloadActionExists = getActionsFromJsonLd(data).find(action => action['@type'] === 'DownloadAction');
|
|
20
18
|
if (downloadActionExists) {
|
|
21
|
-
const downloadUrl =
|
|
19
|
+
const downloadUrl = extractSmartLinkDownloadUrl(response);
|
|
22
20
|
return {
|
|
23
21
|
actionFn: async () => download(downloadUrl),
|
|
24
22
|
actionSubjectId: 'downloadDocument',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
|
+
import { extractPreview as extractPreviewData, extractSmartLinkEmbed, extractSmartLinkProvider, extractSmartLinkTitle, extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
3
2
|
import { ActionName, CardAction } from '../../index';
|
|
4
3
|
import { getExtensionKey } from '../../state/helpers';
|
|
5
4
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
@@ -27,11 +26,10 @@ export const extractInvokePreviewAction = param => {
|
|
|
27
26
|
const meta = response.meta;
|
|
28
27
|
const src = (_extractPreviewData = extractPreviewData(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
|
|
29
28
|
if (src) {
|
|
30
|
-
const url = extractLink(data);
|
|
31
29
|
const extensionKey = getExtensionKey(response);
|
|
32
30
|
return {
|
|
33
31
|
actionFn: async () => {
|
|
34
|
-
var _extractSmartLinkProv,
|
|
32
|
+
var _extractSmartLinkProv, _extractSmartLinkEmbe;
|
|
35
33
|
return openEmbedModal({
|
|
36
34
|
fireEvent,
|
|
37
35
|
extensionKey,
|
|
@@ -41,12 +39,12 @@ export const extractInvokePreviewAction = param => {
|
|
|
41
39
|
isSupportTheming: extractIsSupportTheming(meta),
|
|
42
40
|
isTrusted: extractIsTrusted(meta),
|
|
43
41
|
linkIcon: extractLinkIcon(response),
|
|
44
|
-
providerName:
|
|
42
|
+
providerName: (_extractSmartLinkProv = extractSmartLinkProvider(response)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text,
|
|
45
43
|
onClose,
|
|
46
44
|
origin,
|
|
47
|
-
src:
|
|
48
|
-
title:
|
|
49
|
-
url:
|
|
45
|
+
src: (_extractSmartLinkEmbe = extractSmartLinkEmbed(response)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src,
|
|
46
|
+
title: extractSmartLinkTitle(response),
|
|
47
|
+
url: extractSmartLinkUrl(response)
|
|
50
48
|
});
|
|
51
49
|
},
|
|
52
50
|
actionSubjectId: 'invokePreviewScreen',
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { extractEntity, isEntityPresent } from '@atlaskit/link-extractors';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
|
|
4
2
|
/**
|
|
5
3
|
* Return link summary
|
|
6
4
|
*/
|
|
@@ -15,11 +13,9 @@ export const extractSummary = jsonLd => {
|
|
|
15
13
|
* Return link summary
|
|
16
14
|
*/
|
|
17
15
|
export const extractSmartLinkSummary = response => {
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
|
|
22
|
-
}
|
|
16
|
+
if (isEntityPresent(response)) {
|
|
17
|
+
var _extractEntity;
|
|
18
|
+
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
|
|
23
19
|
}
|
|
24
20
|
return (response === null || response === void 0 ? void 0 : response.data) && extractSummary(response.data);
|
|
25
21
|
};
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
|
+
import { extractSmartLinkEmbed, extractSmartLinkTitle, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
|
|
3
2
|
import { getEmptyJsonLd } from '../../utils/jsonld';
|
|
4
3
|
import { extractSmartLinkContext } from '../common/context';
|
|
5
4
|
import { extractIsSupportTheming } from '../common/meta/extractIsSupportTheming';
|
|
6
5
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
7
|
-
const extractEmbedPreview = (jsonLd, platform, iframeUrlType) => {
|
|
8
|
-
const preview = extractPreview(jsonLd, platform, iframeUrlType);
|
|
9
|
-
if (preview && preview.src) {
|
|
10
|
-
return {
|
|
11
|
-
...preview,
|
|
12
|
-
src: preview.src
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
6
|
export const extractEmbedProps = (response, platform, iframeUrlType) => {
|
|
17
7
|
const meta = response === null || response === void 0 ? void 0 : response.meta;
|
|
18
8
|
const jsonLd = (response === null || response === void 0 ? void 0 : response.data) || getEmptyJsonLd();
|
|
@@ -20,7 +10,7 @@ export const extractEmbedProps = (response, platform, iframeUrlType) => {
|
|
|
20
10
|
link: extractSmartLinkUrl(response) || '',
|
|
21
11
|
title: extractSmartLinkTitle(response),
|
|
22
12
|
context: extractSmartLinkContext(response),
|
|
23
|
-
preview:
|
|
13
|
+
preview: extractSmartLinkEmbed(response, iframeUrlType),
|
|
24
14
|
isTrusted: extractIsTrusted(meta),
|
|
25
15
|
isSupportTheming: extractIsSupportTheming(meta),
|
|
26
16
|
type: extractType(jsonLd)
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
|
+
import { extractSmartLinkAri } from '@atlaskit/link-extractors';
|
|
3
2
|
export const extractViewRelatedLinksAction = response => {
|
|
4
3
|
var _response$meta, _response$meta$suppor;
|
|
5
4
|
if (!(response !== null && response !== void 0 && (_response$meta = response.meta) !== null && _response$meta !== void 0 && (_response$meta$suppor = _response$meta.supportedFeature) !== null && _response$meta$suppor !== void 0 && _response$meta$suppor.includes('RelatedLinks'))) {
|
|
6
5
|
return;
|
|
7
6
|
}
|
|
8
|
-
const ari =
|
|
7
|
+
const ari = extractSmartLinkAri(response);
|
|
9
8
|
if (!ari) {
|
|
10
9
|
return;
|
|
11
10
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { extractEntity,
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
|
+
import { extractEntity, extractImage, isEntityPresent } from '@atlaskit/link-extractors';
|
|
3
2
|
import { MediaType } from '../../constants';
|
|
4
3
|
const extractPreview = data => {
|
|
5
4
|
if (!data) {
|
|
@@ -24,10 +23,6 @@ export const extractSmartLinkPreviewImage = response => {
|
|
|
24
23
|
var _entity$thumbnail;
|
|
25
24
|
const entity = extractEntity(response);
|
|
26
25
|
let url = entity === null || entity === void 0 ? void 0 : (_entity$thumbnail = entity.thumbnail) === null || _entity$thumbnail === void 0 ? void 0 : _entity$thumbnail.externalUrl;
|
|
27
|
-
if (!url && !fg('smart_links_noun_support')) {
|
|
28
|
-
const provider = extractEntityProvider(response);
|
|
29
|
-
url = provider === null || provider === void 0 ? void 0 : provider.image;
|
|
30
|
-
}
|
|
31
26
|
return url ? {
|
|
32
27
|
type: MediaType.Image,
|
|
33
28
|
url
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extractEntity, extractPersonAssignedTo, extractPersonCreatedBy, extractPersonOwnedBy, extractPersonUpdatedBy, isEntityPresent } from '@atlaskit/link-extractors';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
const extractLinkName = link => {
|
|
4
3
|
if (link && typeof link === 'object' && link['@type'] === 'Link') {
|
|
5
4
|
return link.name;
|
|
@@ -17,11 +16,9 @@ export const extractSmartLinkCommentCount = response => {
|
|
|
17
16
|
if (!response || !response.data) {
|
|
18
17
|
return undefined;
|
|
19
18
|
}
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return entity && 'commentCount' in entity && typeof entity.commentCount === 'number' ? entity === null || entity === void 0 ? void 0 : entity.commentCount : undefined;
|
|
24
|
-
}
|
|
19
|
+
if (isEntityPresent(response)) {
|
|
20
|
+
const entity = extractEntity(response);
|
|
21
|
+
return entity && 'commentCount' in entity && typeof entity.commentCount === 'number' ? entity === null || entity === void 0 ? void 0 : entity.commentCount : undefined;
|
|
25
22
|
}
|
|
26
23
|
return (response === null || response === void 0 ? void 0 : response.data) && extractCommentCount(response === null || response === void 0 ? void 0 : response.data);
|
|
27
24
|
};
|
|
@@ -37,12 +34,10 @@ export const extractSmartLinkReactCount = response => {
|
|
|
37
34
|
if (!response || !response.data) {
|
|
38
35
|
return undefined;
|
|
39
36
|
}
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return reactions === null || reactions === void 0 ? void 0 : reactions.reduce((total, reaction) => total + (reaction === null || reaction === void 0 ? void 0 : reaction.total), 0);
|
|
45
|
-
}
|
|
37
|
+
if (isEntityPresent(response)) {
|
|
38
|
+
const entity = extractEntity(response);
|
|
39
|
+
const reactions = entity && 'reactions' in entity && Array.isArray(entity.reactions) ? entity.reactions : undefined;
|
|
40
|
+
return reactions === null || reactions === void 0 ? void 0 : reactions.reduce((total, reaction) => total + (reaction === null || reaction === void 0 ? void 0 : reaction.total), 0);
|
|
46
41
|
}
|
|
47
42
|
return (response === null || response === void 0 ? void 0 : response.data) && extractReactCount(response === null || response === void 0 ? void 0 : response.data);
|
|
48
43
|
};
|
|
@@ -121,11 +116,9 @@ export const extractSmartLinkSentOn = response => {
|
|
|
121
116
|
if (!response || !response.data) {
|
|
122
117
|
return undefined;
|
|
123
118
|
}
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.createdAt;
|
|
128
|
-
}
|
|
119
|
+
if (isEntityPresent(response)) {
|
|
120
|
+
var _extractEntity;
|
|
121
|
+
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.createdAt;
|
|
129
122
|
}
|
|
130
123
|
return (response === null || response === void 0 ? void 0 : response.data) && extractSentOn(response === null || response === void 0 ? void 0 : response.data);
|
|
131
124
|
};
|
|
@@ -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: "40.10.
|
|
5
|
+
packageVersion: "40.10.4"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../constants';
|
|
2
3
|
import { extractOwnedBy } from '../../../../extractors/flexible/utils';
|
|
3
4
|
import { getExtensionKey } from '../../../../state/helpers';
|
|
@@ -67,6 +68,26 @@ export const getSimulatedBetterMetadata = cardDetails => {
|
|
|
67
68
|
name: ElementName.AppliedToComponentsCount
|
|
68
69
|
}, ...baseBottomMetaData]
|
|
69
70
|
};
|
|
71
|
+
case 'passionfruit-object-provider':
|
|
72
|
+
if (fg('passionfruit_ask_smart_links_enabled')) {
|
|
73
|
+
return {
|
|
74
|
+
titleMetadata: defaultTitleMetadata,
|
|
75
|
+
topMetadata: extractOwnedBy(data) ? [{
|
|
76
|
+
name: ElementName.OwnedByGroup
|
|
77
|
+
}, {
|
|
78
|
+
name: ElementName.OwnedBy
|
|
79
|
+
}, ...baseTopMetadata] : defaultTopMetadata,
|
|
80
|
+
bottomMetadata: [{
|
|
81
|
+
name: ElementName.AppliedToComponentsCount
|
|
82
|
+
}, ...baseBottomMetaData]
|
|
83
|
+
};
|
|
84
|
+
} else {
|
|
85
|
+
return {
|
|
86
|
+
titleMetadata: defaultTitleMetadata,
|
|
87
|
+
topMetadata: defaultTopMetadata,
|
|
88
|
+
bottomMetadata: defaultBottomMetadata
|
|
89
|
+
};
|
|
90
|
+
}
|
|
70
91
|
case 'confluence-object-provider':
|
|
71
92
|
return {
|
|
72
93
|
titleMetadata: defaultTitleMetadata,
|
|
@@ -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: "40.10.
|
|
12
|
+
packageVersion: "40.10.4",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import {
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
5
4
|
import { ActionName, CardAction } from '../../index';
|
|
6
5
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
|
|
7
6
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
@@ -13,8 +12,7 @@ export var extractInvokeCopyLinkAction = function extractInvokeCopyLinkAction(_r
|
|
|
13
12
|
if (!canShowAction(CardAction.CopyLinkAction, actionOptions)) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
|
-
var
|
|
17
|
-
var url = fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : extractLink(data);
|
|
15
|
+
var url = extractSmartLinkUrl(response);
|
|
18
16
|
if (!url) {
|
|
19
17
|
return;
|
|
20
18
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { extractSmartLinkDownloadUrl } from '@atlaskit/link-extractors';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { ActionName, CardAction } from '../../index';
|
|
6
5
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
|
|
7
6
|
import { downloadUrl as download } from '../../utils';
|
|
8
7
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
9
8
|
import { getActionsFromJsonLd } from '../common/actions/extractActions';
|
|
10
|
-
import { extractDownloadUrl } from '../common/download/extractDownloadUrl';
|
|
11
9
|
export var extractInvokeDownloadAction = function extractInvokeDownloadAction(_ref) {
|
|
12
10
|
var actionOptions = _ref.actionOptions,
|
|
13
11
|
appearance = _ref.appearance,
|
|
@@ -21,7 +19,7 @@ export var extractInvokeDownloadAction = function extractInvokeDownloadAction(_r
|
|
|
21
19
|
return action['@type'] === 'DownloadAction';
|
|
22
20
|
});
|
|
23
21
|
if (downloadActionExists) {
|
|
24
|
-
var downloadUrl =
|
|
22
|
+
var downloadUrl = extractSmartLinkDownloadUrl(response);
|
|
25
23
|
return {
|
|
26
24
|
actionFn: function () {
|
|
27
25
|
var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import {
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { extractPreview as extractPreviewData, extractSmartLinkEmbed, extractSmartLinkProvider, extractSmartLinkTitle, extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
5
4
|
import { ActionName, CardAction } from '../../index';
|
|
6
5
|
import { getExtensionKey } from '../../state/helpers';
|
|
7
6
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
@@ -27,12 +26,11 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
|
|
|
27
26
|
var meta = response.meta;
|
|
28
27
|
var src = (_extractPreviewData = extractPreviewData(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
|
|
29
28
|
if (src) {
|
|
30
|
-
var url = extractLink(data);
|
|
31
29
|
var extensionKey = getExtensionKey(response);
|
|
32
30
|
return {
|
|
33
31
|
actionFn: function () {
|
|
34
32
|
var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
35
|
-
var _extractSmartLinkProv,
|
|
33
|
+
var _extractSmartLinkProv, _extractSmartLinkEmbe;
|
|
36
34
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
37
35
|
while (1) switch (_context.prev = _context.next) {
|
|
38
36
|
case 0:
|
|
@@ -45,12 +43,12 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
|
|
|
45
43
|
isSupportTheming: extractIsSupportTheming(meta),
|
|
46
44
|
isTrusted: extractIsTrusted(meta),
|
|
47
45
|
linkIcon: extractLinkIcon(response),
|
|
48
|
-
providerName:
|
|
46
|
+
providerName: (_extractSmartLinkProv = extractSmartLinkProvider(response)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text,
|
|
49
47
|
onClose: onClose,
|
|
50
48
|
origin: origin,
|
|
51
|
-
src:
|
|
52
|
-
title:
|
|
53
|
-
url:
|
|
49
|
+
src: (_extractSmartLinkEmbe = extractSmartLinkEmbed(response)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src,
|
|
50
|
+
title: extractSmartLinkTitle(response),
|
|
51
|
+
url: extractSmartLinkUrl(response)
|
|
54
52
|
}));
|
|
55
53
|
case 1:
|
|
56
54
|
case "end":
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { extractEntity, isEntityPresent } from '@atlaskit/link-extractors';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
|
|
4
2
|
/**
|
|
5
3
|
* Return link summary
|
|
6
4
|
*/
|
|
@@ -15,11 +13,9 @@ export var extractSummary = function extractSummary(jsonLd) {
|
|
|
15
13
|
* Return link summary
|
|
16
14
|
*/
|
|
17
15
|
export var extractSmartLinkSummary = function extractSmartLinkSummary(response) {
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
|
|
22
|
-
}
|
|
16
|
+
if (isEntityPresent(response)) {
|
|
17
|
+
var _extractEntity;
|
|
18
|
+
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
|
|
23
19
|
}
|
|
24
20
|
return (response === null || response === void 0 ? void 0 : response.data) && extractSummary(response.data);
|
|
25
21
|
};
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import
|
|
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
|
-
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
|
-
import { extractPreview, extractSmartLinkEmbed, extractSmartLinkTitle, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
|
+
import { extractSmartLinkEmbed, extractSmartLinkTitle, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
|
|
6
2
|
import { getEmptyJsonLd } from '../../utils/jsonld';
|
|
7
3
|
import { extractSmartLinkContext } from '../common/context';
|
|
8
4
|
import { extractIsSupportTheming } from '../common/meta/extractIsSupportTheming';
|
|
9
5
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
10
|
-
var extractEmbedPreview = function extractEmbedPreview(jsonLd, platform, iframeUrlType) {
|
|
11
|
-
var preview = extractPreview(jsonLd, platform, iframeUrlType);
|
|
12
|
-
if (preview && preview.src) {
|
|
13
|
-
return _objectSpread(_objectSpread({}, preview), {}, {
|
|
14
|
-
src: preview.src
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
6
|
export var extractEmbedProps = function extractEmbedProps(response, platform, iframeUrlType) {
|
|
19
7
|
var meta = response === null || response === void 0 ? void 0 : response.meta;
|
|
20
8
|
var jsonLd = (response === null || response === void 0 ? void 0 : response.data) || getEmptyJsonLd();
|
|
@@ -22,7 +10,7 @@ export var extractEmbedProps = function extractEmbedProps(response, platform, if
|
|
|
22
10
|
link: extractSmartLinkUrl(response) || '',
|
|
23
11
|
title: extractSmartLinkTitle(response),
|
|
24
12
|
context: extractSmartLinkContext(response),
|
|
25
|
-
preview:
|
|
13
|
+
preview: extractSmartLinkEmbed(response, iframeUrlType),
|
|
26
14
|
isTrusted: extractIsTrusted(meta),
|
|
27
15
|
isSupportTheming: extractIsSupportTheming(meta),
|
|
28
16
|
type: extractType(jsonLd)
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
|
+
import { extractSmartLinkAri } from '@atlaskit/link-extractors';
|
|
3
2
|
export var extractViewRelatedLinksAction = function extractViewRelatedLinksAction(response) {
|
|
4
3
|
var _response$meta;
|
|
5
4
|
if (!(response !== null && response !== void 0 && (_response$meta = response.meta) !== null && _response$meta !== void 0 && (_response$meta = _response$meta.supportedFeature) !== null && _response$meta !== void 0 && _response$meta.includes('RelatedLinks'))) {
|
|
6
5
|
return;
|
|
7
6
|
}
|
|
8
|
-
var ari =
|
|
7
|
+
var ari = extractSmartLinkAri(response);
|
|
9
8
|
if (!ari) {
|
|
10
9
|
return;
|
|
11
10
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { extractEntity,
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
|
+
import { extractEntity, extractImage, isEntityPresent } from '@atlaskit/link-extractors';
|
|
3
2
|
import { MediaType } from '../../constants';
|
|
4
3
|
var extractPreview = function extractPreview(data) {
|
|
5
4
|
if (!data) {
|
|
@@ -24,10 +23,6 @@ export var extractSmartLinkPreviewImage = function extractSmartLinkPreviewImage(
|
|
|
24
23
|
var _entity$thumbnail;
|
|
25
24
|
var entity = extractEntity(response);
|
|
26
25
|
var url = entity === null || entity === void 0 || (_entity$thumbnail = entity.thumbnail) === null || _entity$thumbnail === void 0 ? void 0 : _entity$thumbnail.externalUrl;
|
|
27
|
-
if (!url && !fg('smart_links_noun_support')) {
|
|
28
|
-
var provider = extractEntityProvider(response);
|
|
29
|
-
url = provider === null || provider === void 0 ? void 0 : provider.image;
|
|
30
|
-
}
|
|
31
26
|
return url ? {
|
|
32
27
|
type: MediaType.Image,
|
|
33
28
|
url: url
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
2
|
import { extractEntity, extractPersonAssignedTo, extractPersonCreatedBy, extractPersonOwnedBy, extractPersonUpdatedBy, isEntityPresent } from '@atlaskit/link-extractors';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
var extractLinkName = function extractLinkName(link) {
|
|
5
4
|
if (link && _typeof(link) === 'object' && link['@type'] === 'Link') {
|
|
6
5
|
return link.name;
|
|
@@ -20,11 +19,9 @@ export var extractSmartLinkCommentCount = function extractSmartLinkCommentCount(
|
|
|
20
19
|
if (!response || !response.data) {
|
|
21
20
|
return undefined;
|
|
22
21
|
}
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return entity && 'commentCount' in entity && typeof entity.commentCount === 'number' ? entity === null || entity === void 0 ? void 0 : entity.commentCount : undefined;
|
|
27
|
-
}
|
|
22
|
+
if (isEntityPresent(response)) {
|
|
23
|
+
var entity = extractEntity(response);
|
|
24
|
+
return entity && 'commentCount' in entity && typeof entity.commentCount === 'number' ? entity === null || entity === void 0 ? void 0 : entity.commentCount : undefined;
|
|
28
25
|
}
|
|
29
26
|
return (response === null || response === void 0 ? void 0 : response.data) && extractCommentCount(response === null || response === void 0 ? void 0 : response.data);
|
|
30
27
|
};
|
|
@@ -48,14 +45,12 @@ export var extractSmartLinkReactCount = function extractSmartLinkReactCount(resp
|
|
|
48
45
|
if (!response || !response.data) {
|
|
49
46
|
return undefined;
|
|
50
47
|
}
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
}, 0);
|
|
58
|
-
}
|
|
48
|
+
if (isEntityPresent(response)) {
|
|
49
|
+
var entity = extractEntity(response);
|
|
50
|
+
var reactions = entity && 'reactions' in entity && Array.isArray(entity.reactions) ? entity.reactions : undefined;
|
|
51
|
+
return reactions === null || reactions === void 0 ? void 0 : reactions.reduce(function (total, reaction) {
|
|
52
|
+
return total + (reaction === null || reaction === void 0 ? void 0 : reaction.total);
|
|
53
|
+
}, 0);
|
|
59
54
|
}
|
|
60
55
|
return (response === null || response === void 0 ? void 0 : response.data) && extractReactCount(response === null || response === void 0 ? void 0 : response.data);
|
|
61
56
|
};
|
|
@@ -145,11 +140,9 @@ export var extractSmartLinkSentOn = function extractSmartLinkSentOn(response) {
|
|
|
145
140
|
if (!response || !response.data) {
|
|
146
141
|
return undefined;
|
|
147
142
|
}
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.createdAt;
|
|
152
|
-
}
|
|
143
|
+
if (isEntityPresent(response)) {
|
|
144
|
+
var _extractEntity;
|
|
145
|
+
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.createdAt;
|
|
153
146
|
}
|
|
154
147
|
return (response === null || response === void 0 ? void 0 : response.data) && extractSentOn(response === null || response === void 0 ? void 0 : response.data);
|
|
155
148
|
};
|
|
@@ -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: "40.10.
|
|
7
|
+
packageVersion: "40.10.4"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../constants';
|
|
2
3
|
import { extractOwnedBy } from '../../../../extractors/flexible/utils';
|
|
3
4
|
import { getExtensionKey } from '../../../../state/helpers';
|
|
@@ -67,6 +68,26 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
67
68
|
name: ElementName.AppliedToComponentsCount
|
|
68
69
|
}].concat(baseBottomMetaData)
|
|
69
70
|
};
|
|
71
|
+
case 'passionfruit-object-provider':
|
|
72
|
+
if (fg('passionfruit_ask_smart_links_enabled')) {
|
|
73
|
+
return {
|
|
74
|
+
titleMetadata: defaultTitleMetadata,
|
|
75
|
+
topMetadata: extractOwnedBy(data) ? [{
|
|
76
|
+
name: ElementName.OwnedByGroup
|
|
77
|
+
}, {
|
|
78
|
+
name: ElementName.OwnedBy
|
|
79
|
+
}].concat(baseTopMetadata) : defaultTopMetadata,
|
|
80
|
+
bottomMetadata: [{
|
|
81
|
+
name: ElementName.AppliedToComponentsCount
|
|
82
|
+
}].concat(baseBottomMetaData)
|
|
83
|
+
};
|
|
84
|
+
} else {
|
|
85
|
+
return {
|
|
86
|
+
titleMetadata: defaultTitleMetadata,
|
|
87
|
+
topMetadata: defaultTopMetadata,
|
|
88
|
+
bottomMetadata: defaultBottomMetadata
|
|
89
|
+
};
|
|
90
|
+
}
|
|
70
91
|
case 'confluence-object-provider':
|
|
71
92
|
return {
|
|
72
93
|
titleMetadata: defaultTitleMetadata,
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "40.10.
|
|
15
|
+
packageVersion: "40.10.4",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var Anchor = withLinkClickedEvent('a');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "40.10.
|
|
3
|
+
"version": "40.10.5",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"@atlaskit/avatar": "^25.1.0",
|
|
32
32
|
"@atlaskit/avatar-group": "^12.2.0",
|
|
33
33
|
"@atlaskit/badge": "^18.1.0",
|
|
34
|
-
"@atlaskit/button": "^23.
|
|
34
|
+
"@atlaskit/button": "^23.4.0",
|
|
35
35
|
"@atlaskit/checkbox": "^17.1.0",
|
|
36
36
|
"@atlaskit/css": "^0.12.0",
|
|
37
37
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
38
38
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
39
|
-
"@atlaskit/form": "^12.
|
|
39
|
+
"@atlaskit/form": "^12.1.0",
|
|
40
40
|
"@atlaskit/frontend-utilities": "^3.1.0",
|
|
41
41
|
"@atlaskit/heading": "^5.2.0",
|
|
42
42
|
"@atlaskit/icon": "^27.12.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/link-test-helpers": "^8.3.0",
|
|
55
55
|
"@atlaskit/linking-common": "^9.2.0",
|
|
56
56
|
"@atlaskit/linking-types": "^14.0.0",
|
|
57
|
-
"@atlaskit/logo": "^19.
|
|
57
|
+
"@atlaskit/logo": "^19.7.0",
|
|
58
58
|
"@atlaskit/lozenge": "^13.0.0",
|
|
59
59
|
"@atlaskit/menu": "^8.3.0",
|
|
60
60
|
"@atlaskit/modal-dialog": "^14.3.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@af/visual-regression": "workspace:^",
|
|
97
97
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
98
98
|
"@atlaskit/css-reset": "^7.3.0",
|
|
99
|
-
"@atlaskit/media-test-helpers": "^
|
|
99
|
+
"@atlaskit/media-test-helpers": "^39.0.0",
|
|
100
100
|
"@atlaskit/react-ufo": "^4.3.0",
|
|
101
101
|
"@atlaskit/ssr": "workspace:^",
|
|
102
102
|
"@atlaskit/visual-regression": "workspace:^",
|
|
@@ -190,9 +190,6 @@
|
|
|
190
190
|
"platform_smart_links_controlled_dsp_export_view": {
|
|
191
191
|
"type": "boolean"
|
|
192
192
|
},
|
|
193
|
-
"smart_links_noun_support": {
|
|
194
|
-
"type": "boolean"
|
|
195
|
-
},
|
|
196
193
|
"platform-linking-ai-summary-migration-to-convo-ai": {
|
|
197
194
|
"type": "boolean"
|
|
198
195
|
},
|
|
@@ -226,9 +223,6 @@
|
|
|
226
223
|
"platform_editor_inline_card_selected_state_fix": {
|
|
227
224
|
"type": "boolean"
|
|
228
225
|
},
|
|
229
|
-
"platform-linking-slack-entity-support": {
|
|
230
|
-
"type": "boolean"
|
|
231
|
-
},
|
|
232
226
|
"navx-1184-fix-smart-link-a11y-interactive-states": {
|
|
233
227
|
"type": "boolean"
|
|
234
228
|
},
|
|
@@ -238,6 +232,9 @@
|
|
|
238
232
|
"platform_smartlink_3pclick_analytics": {
|
|
239
233
|
"type": "boolean"
|
|
240
234
|
},
|
|
235
|
+
"passionfruit_ask_smart_links_enabled": {
|
|
236
|
+
"type": "boolean"
|
|
237
|
+
},
|
|
241
238
|
"ptc-enable-embed-team-smart-links": {
|
|
242
239
|
"type": "boolean"
|
|
243
240
|
}
|