@atlaskit/smart-card 38.10.2 → 38.12.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 +20 -0
- package/dist/cjs/extractors/action/extract-invoke-copy-link-action.js +2 -1
- package/dist/cjs/extractors/action/extract-invoke-download-action.js +3 -1
- package/dist/cjs/extractors/action/extract-invoke-preview-action.js +6 -5
- package/dist/cjs/extractors/common/primitives/extractSummary.js +16 -1
- package/dist/cjs/extractors/flexible/actions/extract-view-related-links-action.js +2 -1
- package/dist/cjs/extractors/flexible/index.js +3 -3
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/mocks.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/elements/comment-count-element/index.js +18 -2
- package/dist/cjs/view/FlexibleCard/components/elements/modified-on-element/index.js +17 -2
- package/dist/cjs/view/FlexibleCard/components/elements/owned-by-element/index.js +17 -2
- package/dist/cjs/view/FlexibleCard/components/elements/owned-by-group-element/index.js +17 -2
- package/dist/cjs/view/FlexibleCard/components/elements/react-count-element/index.js +17 -2
- package/dist/cjs/view/FlexibleCard/external.js +14 -5
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/action/extract-invoke-copy-link-action.js +3 -2
- package/dist/es2019/extractors/action/extract-invoke-download-action.js +3 -1
- package/dist/es2019/extractors/action/extract-invoke-preview-action.js +7 -6
- package/dist/es2019/extractors/common/primitives/extractSummary.js +16 -0
- package/dist/es2019/extractors/flexible/actions/extract-view-related-links-action.js +3 -2
- package/dist/es2019/extractors/flexible/index.js +4 -4
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/mocks.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/comment-count-element/index.js +15 -2
- package/dist/es2019/view/FlexibleCard/components/elements/modified-on-element/index.js +14 -2
- package/dist/es2019/view/FlexibleCard/components/elements/owned-by-element/index.js +14 -2
- package/dist/es2019/view/FlexibleCard/components/elements/owned-by-group-element/index.js +14 -2
- package/dist/es2019/view/FlexibleCard/components/elements/react-count-element/index.js +14 -2
- package/dist/es2019/view/FlexibleCard/external.js +16 -5
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/action/extract-invoke-copy-link-action.js +3 -2
- package/dist/esm/extractors/action/extract-invoke-download-action.js +3 -1
- package/dist/esm/extractors/action/extract-invoke-preview-action.js +7 -6
- package/dist/esm/extractors/common/primitives/extractSummary.js +16 -0
- package/dist/esm/extractors/flexible/actions/extract-view-related-links-action.js +3 -2
- package/dist/esm/extractors/flexible/index.js +4 -4
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/mocks.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/comment-count-element/index.js +16 -2
- package/dist/esm/view/FlexibleCard/components/elements/modified-on-element/index.js +15 -2
- package/dist/esm/view/FlexibleCard/components/elements/owned-by-element/index.js +15 -2
- package/dist/esm/view/FlexibleCard/components/elements/owned-by-group-element/index.js +15 -2
- package/dist/esm/view/FlexibleCard/components/elements/react-count-element/index.js +15 -2
- package/dist/esm/view/FlexibleCard/external.js +14 -5
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/__fixtures__/document-entity.d.ts +3 -0
- package/dist/types/extractors/common/primitives/extractSummary.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/elements/comment-count-element/index.d.ts +3 -1
- package/dist/types/view/FlexibleCard/components/elements/modified-on-element/index.d.ts +3 -1
- package/dist/types/view/FlexibleCard/components/elements/owned-by-element/index.d.ts +3 -1
- package/dist/types/view/FlexibleCard/components/elements/owned-by-group-element/index.d.ts +3 -1
- package/dist/types/view/FlexibleCard/components/elements/react-count-element/index.d.ts +3 -1
- package/dist/types/view/FlexibleCard/external.d.ts +7 -6
- package/dist/types-ts4.5/__fixtures__/document-entity.d.ts +3 -0
- package/dist/types-ts4.5/extractors/common/primitives/extractSummary.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/comment-count-element/index.d.ts +3 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/modified-on-element/index.d.ts +3 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/owned-by-element/index.d.ts +3 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/owned-by-group-element/index.d.ts +3 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/react-count-element/index.d.ts +3 -1
- package/dist/types-ts4.5/view/FlexibleCard/external.d.ts +7 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 38.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#173028](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173028)
|
|
8
|
+
[`8350b887416f1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8350b887416f1) -
|
|
9
|
+
Add onRender callback to elements
|
|
10
|
+
|
|
11
|
+
## 38.11.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#172309](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172309)
|
|
16
|
+
[`2277073f3598c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2277073f3598c) -
|
|
17
|
+
EDM-12975 use entity data to render google document links
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 38.10.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -8,6 +8,7 @@ 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");
|
|
11
12
|
var _index = require("../../index");
|
|
12
13
|
var _helpers = require("../../state/helpers");
|
|
13
14
|
var _canShowAction = require("../../utils/actions/can-show-action");
|
|
@@ -20,7 +21,7 @@ var extractInvokeCopyLinkAction = exports.extractInvokeCopyLinkAction = function
|
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
23
|
var data = response.data;
|
|
23
|
-
var url = (0, _linkExtractors.extractLink)(data);
|
|
24
|
+
var url = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkUrl)(response) : (0, _linkExtractors.extractLink)(data);
|
|
24
25
|
if (!url) {
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.extractInvokeDownloadAction = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
12
|
var _index = require("../../index");
|
|
11
13
|
var _helpers = require("../../state/helpers");
|
|
12
14
|
var _utils = require("../../utils");
|
|
@@ -26,7 +28,7 @@ var extractInvokeDownloadAction = exports.extractInvokeDownloadAction = function
|
|
|
26
28
|
return action['@type'] === 'DownloadAction';
|
|
27
29
|
});
|
|
28
30
|
if (downloadActionExists) {
|
|
29
|
-
var downloadUrl = (0, _extractDownloadUrl.extractDownloadUrl)(data);
|
|
31
|
+
var downloadUrl = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkDownloadUrl)(response) : (0, _extractDownloadUrl.extractDownloadUrl)(data);
|
|
30
32
|
return {
|
|
31
33
|
actionFn: function () {
|
|
32
34
|
var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
@@ -8,6 +8,7 @@ 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");
|
|
11
12
|
var _index = require("../../index");
|
|
12
13
|
var _helpers = require("../../state/helpers");
|
|
13
14
|
var _canShowAction = require("../../utils/actions/can-show-action");
|
|
@@ -38,7 +39,7 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
|
|
|
38
39
|
return {
|
|
39
40
|
actionFn: function () {
|
|
40
41
|
var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
41
|
-
var _extractProvider;
|
|
42
|
+
var _extractSmartLinkProv, _extractProvider, _extractSmartLinkEmbe;
|
|
42
43
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
43
44
|
while (1) switch (_context.prev = _context.next) {
|
|
44
45
|
case 0:
|
|
@@ -51,12 +52,12 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
|
|
|
51
52
|
isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta),
|
|
52
53
|
isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
|
|
53
54
|
linkIcon: (0, _icon.extractLinkIcon)(response),
|
|
54
|
-
providerName: (_extractProvider = (0, _linkExtractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
|
|
55
|
+
providerName: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (_extractSmartLinkProv = (0, _linkExtractors.extractSmartLinkProvider)(response)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text : (_extractProvider = (0, _linkExtractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
|
|
55
56
|
onClose: onClose,
|
|
56
57
|
origin: origin,
|
|
57
|
-
src: src,
|
|
58
|
-
title: (0, _linkExtractors.extractTitle)(data),
|
|
59
|
-
url: url
|
|
58
|
+
src: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (_extractSmartLinkEmbe = (0, _linkExtractors.extractSmartLinkEmbed)(response)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : src,
|
|
59
|
+
title: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkTitle)(response) : (0, _linkExtractors.extractTitle)(data),
|
|
60
|
+
url: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkUrl)(response) : url
|
|
60
61
|
}));
|
|
61
62
|
case 1:
|
|
62
63
|
case "end":
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.extractSummary = void 0;
|
|
6
|
+
exports.extractSummary = exports.extractSmartLinkSummary = void 0;
|
|
7
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
9
|
/**
|
|
8
10
|
* Return link summary
|
|
9
11
|
*/
|
|
@@ -12,4 +14,17 @@ var extractSummary = exports.extractSummary = function extractSummary(jsonLd) {
|
|
|
12
14
|
var summary = jsonLd.summary.trim();
|
|
13
15
|
return Boolean(summary) ? summary : undefined;
|
|
14
16
|
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Return link summary
|
|
21
|
+
*/
|
|
22
|
+
var extractSmartLinkSummary = exports.extractSmartLinkSummary = function extractSmartLinkSummary(response) {
|
|
23
|
+
if ((0, _platformFeatureFlags.fg)('smart_links_noun_support')) {
|
|
24
|
+
if ((0, _linkExtractors.isEntityPresent)(response)) {
|
|
25
|
+
var _extractEntity;
|
|
26
|
+
return (_extractEntity = (0, _linkExtractors.extractEntity)(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return (response === null || response === void 0 ? void 0 : response.data) && extractSummary(response.data);
|
|
15
30
|
};
|
|
@@ -5,12 +5,13 @@ 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");
|
|
8
9
|
var extractViewRelatedLinksAction = exports.extractViewRelatedLinksAction = function extractViewRelatedLinksAction(response) {
|
|
9
10
|
var _response$meta;
|
|
10
11
|
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'))) {
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
|
-
var ari = (0, _linkExtractors.extractAri)(response.data);
|
|
14
|
+
var ari = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkAri)(response) : (0, _linkExtractors.extractAri)(response.data);
|
|
14
15
|
if (!ari) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
-
var
|
|
12
|
+
var _extractSummary = require("../common/primitives/extractSummary");
|
|
13
13
|
var _actions = require("./actions");
|
|
14
14
|
var _collaboratorGroup = require("./collaboratorGroup");
|
|
15
15
|
var _extractLinkTitle = _interopRequireDefault(require("./extract-link-title"));
|
|
@@ -57,7 +57,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
57
57
|
appliedToComponentsCount: (0, _utils.extractAppliedToComponentsCount)(data),
|
|
58
58
|
assignedToGroup: (0, _utils.extractPersonAssignedToAsArray)(data),
|
|
59
59
|
attachmentCount: (0, _utils.extractAttachmentCount)(data),
|
|
60
|
-
authorGroup: (0, _linkExtractors.
|
|
60
|
+
authorGroup: (0, _linkExtractors.extractSmartLinkAuthorGroup)(response),
|
|
61
61
|
ownedByGroup: (0, _linkExtractors.extractPersonOwnedBy)(data),
|
|
62
62
|
collaboratorGroup: (0, _collaboratorGroup.extractPersonsUpdatedBy)(data),
|
|
63
63
|
commentCount: (0, _utils.extractCommentCount)(data),
|
|
@@ -84,7 +84,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
84
84
|
programmingLanguage: (0, _utils.extractProgrammingLanguage)(data),
|
|
85
85
|
readTime: (0, _utils.extractReadTime)(data),
|
|
86
86
|
sentOn: (0, _utils.extractSentOn)(data),
|
|
87
|
-
snippet: (0,
|
|
87
|
+
snippet: (0, _extractSummary.extractSmartLinkSummary)(response) || undefined,
|
|
88
88
|
// Explicitly set here to remove an empty string
|
|
89
89
|
sourceBranch: (0, _utils.extractSourceBranch)(data),
|
|
90
90
|
state: (0, _extractState.default)(response, actionOptions, id, appearance, origin, fireEvent, resolve),
|
|
@@ -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.
|
|
14
|
+
packageVersion: "38.11.0"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/utils/mocks.js
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
13
|
var _constants = require("../../../../../constants");
|
|
11
14
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
12
15
|
var _common = require("../common");
|
|
16
|
+
var _excluded = ["onRender"];
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
18
|
var CommentCountElement = function CommentCountElement(props) {
|
|
14
19
|
var _context$commentCount;
|
|
15
20
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
16
21
|
var data = context ? (0, _common.toBadgeProps)((_context$commentCount = context.commentCount) === null || _context$commentCount === void 0 ? void 0 : _context$commentCount.toString()) : null;
|
|
22
|
+
var _ref = props || {},
|
|
23
|
+
onRender = _ref.onRender,
|
|
24
|
+
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
27
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
28
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
29
|
+
(0, _react.useEffect)(function () {
|
|
30
|
+
onRender === null || onRender === void 0 || onRender(!!data);
|
|
31
|
+
}, [data, onRender]);
|
|
32
|
+
}
|
|
17
33
|
return data ? /*#__PURE__*/_react.default.createElement(_common.BaseBadgeElement, (0, _extends2.default)({
|
|
18
34
|
icon: _constants.IconType.Comment
|
|
19
|
-
}, data,
|
|
35
|
+
}, data, restProps, {
|
|
20
36
|
name: _constants.ElementName.CommentCount
|
|
21
37
|
})) : null;
|
|
22
38
|
};
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
13
|
var _constants = require("../../../../../constants");
|
|
11
14
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
12
15
|
var _common = require("../common");
|
|
16
|
+
var _excluded = ["onRender"];
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
18
|
var ModifiedOnElement = function ModifiedOnElement(props) {
|
|
14
19
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
15
20
|
var data = context ? (0, _common.toDateTimeProps)('modified', context.modifiedOn) : null;
|
|
16
|
-
|
|
21
|
+
var _ref = props || {},
|
|
22
|
+
onRender = _ref.onRender,
|
|
23
|
+
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
24
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
25
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
26
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
27
|
+
(0, _react.useEffect)(function () {
|
|
28
|
+
onRender === null || onRender === void 0 || onRender(!!data);
|
|
29
|
+
}, [data, onRender]);
|
|
30
|
+
}
|
|
31
|
+
return data ? /*#__PURE__*/_react.default.createElement(_common.BaseDateTimeElement, (0, _extends2.default)({}, data, restProps, {
|
|
17
32
|
name: _constants.ElementName.ModifiedOn
|
|
18
33
|
})) : null;
|
|
19
34
|
};
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
13
|
var _constants = require("../../../../../constants");
|
|
11
14
|
var _messages = require("../../../../../messages");
|
|
12
15
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
13
16
|
var _common = require("../common");
|
|
17
|
+
var _excluded = ["onRender"];
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
19
|
var OwnedByElement = function OwnedByElement(props) {
|
|
15
20
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
16
21
|
var data = context ? (0, _common.toFormattedTextProps)(_messages.messages.owned_by, context.ownedBy) : null;
|
|
17
|
-
|
|
22
|
+
var _ref = props || {},
|
|
23
|
+
onRender = _ref.onRender,
|
|
24
|
+
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
25
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
26
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
27
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
28
|
+
(0, _react.useEffect)(function () {
|
|
29
|
+
onRender === null || onRender === void 0 || onRender(!!data);
|
|
30
|
+
}, [data, onRender]);
|
|
31
|
+
}
|
|
32
|
+
return data ? /*#__PURE__*/_react.default.createElement(_common.BaseTextElement, (0, _extends2.default)({}, data, restProps, {
|
|
18
33
|
name: _constants.ElementName.OwnedBy
|
|
19
34
|
})) : null;
|
|
20
35
|
};
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
13
|
var _constants = require("../../../../../constants");
|
|
11
14
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
12
15
|
var _common = require("../common");
|
|
16
|
+
var _excluded = ["onRender"];
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
18
|
var OwnedByGroupElement = function OwnedByGroupElement(props) {
|
|
14
19
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
15
20
|
var data = context ? (0, _common.toAvatarGroupProps)(context.ownedByGroup, false) : null;
|
|
16
|
-
|
|
21
|
+
var _ref = props || {},
|
|
22
|
+
onRender = _ref.onRender,
|
|
23
|
+
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
24
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
25
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
26
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
27
|
+
(0, _react.useEffect)(function () {
|
|
28
|
+
onRender === null || onRender === void 0 || onRender(!!data);
|
|
29
|
+
}, [data, onRender]);
|
|
30
|
+
}
|
|
31
|
+
return data ? /*#__PURE__*/_react.default.createElement(_common.BaseAvatarGroupElement, (0, _extends2.default)({}, data, restProps, {
|
|
17
32
|
name: _constants.ElementName.OwnedByGroup
|
|
18
33
|
})) : null;
|
|
19
34
|
};
|
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
13
|
var _constants = require("../../../../../constants");
|
|
11
14
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
12
15
|
var _common = require("../common");
|
|
16
|
+
var _excluded = ["onRender"];
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
18
|
var ReactCountElement = function ReactCountElement(props) {
|
|
14
19
|
var _context$reactCount;
|
|
15
20
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
16
21
|
var data = context ? (0, _common.toBadgeProps)((_context$reactCount = context.reactCount) === null || _context$reactCount === void 0 ? void 0 : _context$reactCount.toString()) : null;
|
|
22
|
+
var _ref = props || {},
|
|
23
|
+
onRender = _ref.onRender,
|
|
24
|
+
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
25
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
26
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
27
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
28
|
+
(0, _react.useEffect)(function () {
|
|
29
|
+
onRender === null || onRender === void 0 || onRender(!!data);
|
|
30
|
+
}, [data, onRender]);
|
|
31
|
+
}
|
|
17
32
|
return data ? /*#__PURE__*/_react.default.createElement(_common.BaseBadgeElement, (0, _extends2.default)({
|
|
18
33
|
icon: _constants.IconType.React
|
|
19
|
-
}, data,
|
|
34
|
+
}, data, restProps, {
|
|
20
35
|
name: _constants.ElementName.ReactCount
|
|
21
36
|
})) : null;
|
|
22
37
|
};
|
|
@@ -42,7 +42,8 @@ var CollaboratorGroupElement = exports.CollaboratorGroupElement = function Colla
|
|
|
42
42
|
var CommentCountElement = exports.CommentCountElement = function CommentCountElement(props) {
|
|
43
43
|
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
44
44
|
return /*#__PURE__*/_react.default.createElement(_elements.CommentCount, {
|
|
45
|
-
color: props === null || props === void 0 ? void 0 : props.color
|
|
45
|
+
color: props === null || props === void 0 ? void 0 : props.color,
|
|
46
|
+
onRender: props === null || props === void 0 ? void 0 : props.onRender
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
return /*#__PURE__*/_react.default.createElement(_elements.CommentCount, null);
|
|
@@ -78,7 +79,8 @@ var ModifiedOnElement = exports.ModifiedOnElement = function ModifiedOnElement(p
|
|
|
78
79
|
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
79
80
|
return /*#__PURE__*/_react.default.createElement(_elements.ModifiedOn, {
|
|
80
81
|
hideDatePrefix: props === null || props === void 0 ? void 0 : props.hideDatePrefix,
|
|
81
|
-
color: props === null || props === void 0 ? void 0 : props.color
|
|
82
|
+
color: props === null || props === void 0 ? void 0 : props.color,
|
|
83
|
+
onRender: props === null || props === void 0 ? void 0 : props.onRender
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
86
|
return /*#__PURE__*/_react.default.createElement(_elements.ModifiedOn, null);
|
|
@@ -87,12 +89,18 @@ var OwnedByElement = exports.OwnedByElement = function OwnedByElement(props) {
|
|
|
87
89
|
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
88
90
|
return /*#__PURE__*/_react.default.createElement(_elements.OwnedBy, {
|
|
89
91
|
hideFormat: props === null || props === void 0 ? void 0 : props.hideFormat,
|
|
90
|
-
color: props === null || props === void 0 ? void 0 : props.color
|
|
92
|
+
color: props === null || props === void 0 ? void 0 : props.color,
|
|
93
|
+
onRender: props === null || props === void 0 ? void 0 : props.onRender
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
96
|
return /*#__PURE__*/_react.default.createElement(_elements.OwnedBy, null);
|
|
94
97
|
};
|
|
95
|
-
var OwnedByGroupElement = exports.OwnedByGroupElement = function OwnedByGroupElement() {
|
|
98
|
+
var OwnedByGroupElement = exports.OwnedByGroupElement = function OwnedByGroupElement(props) {
|
|
99
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement(_elements.OwnedByGroup, {
|
|
101
|
+
onRender: props === null || props === void 0 ? void 0 : props.onRender
|
|
102
|
+
});
|
|
103
|
+
}
|
|
96
104
|
return /*#__PURE__*/_react.default.createElement(_elements.OwnedByGroup, null);
|
|
97
105
|
};
|
|
98
106
|
var PreviewElement = exports.PreviewElement = function PreviewElement(props) {
|
|
@@ -115,7 +123,8 @@ var ProviderElement = exports.ProviderElement = function ProviderElement() {
|
|
|
115
123
|
var ReactCountElement = exports.ReactCountElement = function ReactCountElement(props) {
|
|
116
124
|
if ((0, _platformFeatureFlags.fg)('platform-linking-additional-flexible-element-props')) {
|
|
117
125
|
return /*#__PURE__*/_react.default.createElement(_elements.ReactCount, {
|
|
118
|
-
color: props === null || props === void 0 ? void 0 : props.color
|
|
126
|
+
color: props === null || props === void 0 ? void 0 : props.color,
|
|
127
|
+
onRender: props === null || props === void 0 ? void 0 : props.onRender
|
|
119
128
|
});
|
|
120
129
|
}
|
|
121
130
|
return /*#__PURE__*/_react.default.createElement(_elements.ReactCount, null);
|
|
@@ -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.
|
|
23
|
+
packageVersion: "38.11.0",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { extractLink } from '@atlaskit/link-extractors';
|
|
1
|
+
import { extractLink, extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { ActionName, CardAction } from '../../index';
|
|
3
4
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
|
|
4
5
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
@@ -12,7 +13,7 @@ export const extractInvokeCopyLinkAction = ({
|
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const data = response.data;
|
|
15
|
-
const url = extractLink(data);
|
|
16
|
+
const url = fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : extractLink(data);
|
|
16
17
|
if (!url) {
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { extractSmartLinkDownloadUrl } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
3
|
import { ActionName, CardAction } from '../../index';
|
|
2
4
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
|
|
3
5
|
import { downloadUrl as download } from '../../utils';
|
|
@@ -16,7 +18,7 @@ export const extractInvokeDownloadAction = ({
|
|
|
16
18
|
const data = response.data;
|
|
17
19
|
const downloadActionExists = getActionsFromJsonLd(data).find(action => action['@type'] === 'DownloadAction');
|
|
18
20
|
if (downloadActionExists) {
|
|
19
|
-
const downloadUrl = extractDownloadUrl(data);
|
|
21
|
+
const downloadUrl = fg('smart_links_noun_support') ? extractSmartLinkDownloadUrl(response) : extractDownloadUrl(data);
|
|
20
22
|
return {
|
|
21
23
|
actionFn: async () => download(downloadUrl),
|
|
22
24
|
actionSubjectId: 'downloadDocument',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { extractLink, extractPreview as extractPreviewData, extractProvider, extractTitle } from '@atlaskit/link-extractors';
|
|
1
|
+
import { extractLink, extractPreview as extractPreviewData, extractProvider, extractSmartLinkEmbed, extractSmartLinkProvider, extractSmartLinkTitle, extractSmartLinkUrl, extractTitle } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { ActionName, CardAction } from '../../index';
|
|
3
4
|
import { getExtensionKey } from '../../state/helpers';
|
|
4
5
|
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
@@ -30,7 +31,7 @@ export const extractInvokePreviewAction = param => {
|
|
|
30
31
|
const extensionKey = getExtensionKey(response);
|
|
31
32
|
return {
|
|
32
33
|
actionFn: async () => {
|
|
33
|
-
var _extractProvider;
|
|
34
|
+
var _extractSmartLinkProv, _extractProvider, _extractSmartLinkEmbe;
|
|
34
35
|
return openEmbedModal({
|
|
35
36
|
fireEvent,
|
|
36
37
|
extensionKey,
|
|
@@ -40,12 +41,12 @@ export const extractInvokePreviewAction = param => {
|
|
|
40
41
|
isSupportTheming: extractIsSupportTheming(meta),
|
|
41
42
|
isTrusted: extractIsTrusted(meta),
|
|
42
43
|
linkIcon: extractLinkIcon(response),
|
|
43
|
-
providerName: (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
|
|
44
|
+
providerName: fg('smart_links_noun_support') ? (_extractSmartLinkProv = extractSmartLinkProvider(response)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text : (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
|
|
44
45
|
onClose,
|
|
45
46
|
origin,
|
|
46
|
-
src,
|
|
47
|
-
title: extractTitle(data),
|
|
48
|
-
url
|
|
47
|
+
src: fg('smart_links_noun_support') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(response)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : src,
|
|
48
|
+
title: fg('smart_links_noun_support') ? extractSmartLinkTitle(response) : extractTitle(data),
|
|
49
|
+
url: fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : url
|
|
49
50
|
});
|
|
50
51
|
},
|
|
51
52
|
actionSubjectId: 'invokePreviewScreen',
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { extractEntity, isEntityPresent } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Return link summary
|
|
3
6
|
*/
|
|
@@ -6,4 +9,17 @@ export const extractSummary = jsonLd => {
|
|
|
6
9
|
const summary = jsonLd.summary.trim();
|
|
7
10
|
return Boolean(summary) ? summary : undefined;
|
|
8
11
|
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Return link summary
|
|
16
|
+
*/
|
|
17
|
+
export const extractSmartLinkSummary = response => {
|
|
18
|
+
if (fg('smart_links_noun_support')) {
|
|
19
|
+
if (isEntityPresent(response)) {
|
|
20
|
+
var _extractEntity;
|
|
21
|
+
return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return (response === null || response === void 0 ? void 0 : response.data) && extractSummary(response.data);
|
|
9
25
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { extractAri } from '@atlaskit/link-extractors';
|
|
1
|
+
import { extractAri, extractSmartLinkAri } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
export const extractViewRelatedLinksAction = response => {
|
|
3
4
|
var _response$meta, _response$meta$suppor;
|
|
4
5
|
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'))) {
|
|
5
6
|
return;
|
|
6
7
|
}
|
|
7
|
-
const ari = extractAri(response.data);
|
|
8
|
+
const ari = fg('smart_links_noun_support') ? extractSmartLinkAri(response) : extractAri(response.data);
|
|
8
9
|
if (!ari) {
|
|
9
10
|
return;
|
|
10
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkAuthorGroup, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn, extractSmartLinkTitle, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import {
|
|
3
|
+
import { extractSmartLinkSummary } from '../common/primitives/extractSummary';
|
|
4
4
|
import { extractFlexibleCardActions } from './actions';
|
|
5
5
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
6
6
|
import extractLinkTitle from './extract-link-title';
|
|
@@ -45,7 +45,7 @@ const extractFlexibleUiContext = ({
|
|
|
45
45
|
appliedToComponentsCount: extractAppliedToComponentsCount(data),
|
|
46
46
|
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
47
47
|
attachmentCount: extractAttachmentCount(data),
|
|
48
|
-
authorGroup:
|
|
48
|
+
authorGroup: extractSmartLinkAuthorGroup(response),
|
|
49
49
|
ownedByGroup: extractPersonOwnedBy(data),
|
|
50
50
|
collaboratorGroup: extractPersonsUpdatedBy(data),
|
|
51
51
|
commentCount: extractCommentCount(data),
|
|
@@ -72,7 +72,7 @@ const extractFlexibleUiContext = ({
|
|
|
72
72
|
programmingLanguage: extractProgrammingLanguage(data),
|
|
73
73
|
readTime: extractReadTime(data),
|
|
74
74
|
sentOn: extractSentOn(data),
|
|
75
|
-
snippet:
|
|
75
|
+
snippet: extractSmartLinkSummary(response) || undefined,
|
|
76
76
|
// Explicitly set here to remove an empty string
|
|
77
77
|
sourceBranch: extractSourceBranch(data),
|
|
78
78
|
state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve),
|
|
@@ -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.
|
|
5
|
+
packageVersion: "38.11.0"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|