@atlaskit/smart-card 26.71.0 → 26.73.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 +23 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/extractors/flexible/actions/extract-view-related-links-action.js +20 -0
- package/dist/cjs/extractors/flexible/actions/index.js +6 -2
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/state/flexible-ui-context/types.js +3 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +14 -0
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +28 -0
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +27 -0
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +3 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/extractors/flexible/actions/extract-view-related-links-action.js +14 -0
- package/dist/es2019/extractors/flexible/actions/index.js +6 -1
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/state/flexible-ui-context/types.js +1 -8
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +14 -0
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +20 -0
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +17 -0
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/constants.js +1 -0
- package/dist/esm/extractors/flexible/actions/extract-view-related-links-action.js +14 -0
- package/dist/esm/extractors/flexible/actions/index.js +6 -2
- package/dist/esm/messages.js +5 -0
- package/dist/esm/state/flexible-ui-context/types.js +1 -8
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +14 -0
- package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +20 -0
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +19 -0
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/constants.d.ts +2 -1
- package/dist/types/extractors/flexible/actions/extract-view-related-links-action.d.ts +3 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +9 -5
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/view/BlockCard/index.d.ts +2 -2
- package/dist/types/view/BlockCard/views/flexible/unresolved-view/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +7 -7
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/view-related-links-action/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/view-related-links-action/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +10 -5
- package/dist/types/view/FlexibleCard/components/elements/icon/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/icon/types.d.ts +7 -2
- package/dist/types/view/FlexibleCard/components/elements/link/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/link/types.d.ts +3 -3
- package/dist/types-ts4.5/constants.d.ts +2 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-view-related-links-action.d.ts +3 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +9 -5
- package/dist/types-ts4.5/utils/index.d.ts +2 -2
- package/dist/types-ts4.5/view/BlockCard/index.d.ts +2 -2
- package/dist/types-ts4.5/view/BlockCard/views/flexible/unresolved-view/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +7 -7
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/view-related-links-action/index.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/view-related-links-action/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +10 -5
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/icon/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/icon/types.d.ts +7 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/link/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/link/types.d.ts +3 -3
- package/package.json +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.73.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#102031](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102031)
|
|
8
|
+
[`2707b0f7ae9b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2707b0f7ae9b) -
|
|
9
|
+
[ux] Add view related links action
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#102663](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102663)
|
|
14
|
+
[`36e468e4deb2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/36e468e4deb2) -
|
|
15
|
+
Handling adding theme query params to urls with hash
|
|
16
|
+
|
|
17
|
+
## 26.72.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- [#103201](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103201)
|
|
22
|
+
[`7cb62c61f30e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7cb62c61f30e) -
|
|
23
|
+
[ux] Added a new `icon` prop to override the icon rendered in the smart card TitleBlock
|
|
24
|
+
component.
|
|
25
|
+
|
|
3
26
|
## 26.71.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -156,6 +156,7 @@ var ActionName = exports.ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
156
156
|
}({});
|
|
157
157
|
var InternalActionName = exports.InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
158
158
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
159
|
+
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
159
160
|
return InternalActionName;
|
|
160
161
|
}({});
|
|
161
162
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.extractViewRelatedLinksAction = void 0;
|
|
7
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
|
+
var extractViewRelatedLinksAction = exports.extractViewRelatedLinksAction = function extractViewRelatedLinksAction(response) {
|
|
9
|
+
var _response$meta;
|
|
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'))) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
var url = (0, _linkExtractors.extractLink)(response.data);
|
|
14
|
+
if (!url) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
url: url
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
var _constants = require("../../../constants");
|
|
10
11
|
var _extractDownloadAction = require("./extract-download-action");
|
|
11
12
|
var _extractPreviewAction = require("./extract-preview-action");
|
|
@@ -13,10 +14,13 @@ var _extractAiSummaryAction = require("./extract-ai-summary-action");
|
|
|
13
14
|
var _extractFollowAction = _interopRequireDefault(require("./extract-follow-action"));
|
|
14
15
|
var _extractCopyLinkAction = require("./extract-copy-link-action");
|
|
15
16
|
var _extractAutomationAction = require("./extract-automation-action");
|
|
17
|
+
var _extractViewRelatedLinksAction = require("./extract-view-related-links-action");
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
16
20
|
var extractActions = function extractActions(response, url, actionOptions, id, aiSummaryConfig) {
|
|
17
|
-
var
|
|
21
|
+
var _objectSpread2;
|
|
18
22
|
var data = response.data;
|
|
19
|
-
var action = (
|
|
23
|
+
var action = _objectSpread((_objectSpread2 = {}, (0, _defineProperty2.default)(_objectSpread2, _constants.ActionName.CopyLinkAction, (0, _extractCopyLinkAction.extractCopyLinkAction)(data, actionOptions)), (0, _defineProperty2.default)(_objectSpread2, _constants.ActionName.DownloadAction, (0, _extractDownloadAction.extractDownloadAction)(data, actionOptions)), (0, _defineProperty2.default)(_objectSpread2, _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), (0, _defineProperty2.default)(_objectSpread2, _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewAction)(response, actionOptions)), (0, _defineProperty2.default)(_objectSpread2, _constants.ActionName.AutomationAction, (0, _extractAutomationAction.extractAutomationAction)(response)), (0, _defineProperty2.default)(_objectSpread2, _constants.InternalActionName.AISummaryAction, (0, _extractAiSummaryAction.extractAISummaryAction)(response, url, actionOptions, aiSummaryConfig)), _objectSpread2), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-view-related-urls-action') ? (0, _defineProperty2.default)({}, _constants.InternalActionName.ViewRelatedLinksAction, (0, _extractViewRelatedLinksAction.extractViewRelatedLinksAction)(response)) : {});
|
|
20
24
|
return Object.values(action).some(function (value) {
|
|
21
25
|
return Boolean(value);
|
|
22
26
|
}) ? action : undefined;
|
package/dist/cjs/messages.js
CHANGED
|
@@ -710,5 +710,10 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
710
710
|
id: 'fabric.linking.related_links_modal_title.nonfinal',
|
|
711
711
|
defaultMessage: 'Recent Links',
|
|
712
712
|
description: 'Shown as the title for the related links modal'
|
|
713
|
+
},
|
|
714
|
+
related_links_view_related_urls: {
|
|
715
|
+
id: 'fabric.linking.related_links_view_related_urls.nonfinal',
|
|
716
|
+
defaultMessage: 'View recent links...',
|
|
717
|
+
description: 'Action to view related links to the given resource'
|
|
713
718
|
}
|
|
714
719
|
});
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.
|
|
25
|
+
packageVersion: "26.73.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -474,6 +474,20 @@ var combineFrameStyle = exports.combineFrameStyle = function combineFrameStyle(f
|
|
|
474
474
|
* @param themeState
|
|
475
475
|
*/
|
|
476
476
|
var getPreviewUrlWithTheme = exports.getPreviewUrlWithTheme = function getPreviewUrlWithTheme(previewUrl, themeState) {
|
|
477
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.fix-embed-preview-url-query-params')) {
|
|
478
|
+
try {
|
|
479
|
+
var url = new URL(previewUrl);
|
|
480
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-theme-state-url')) {
|
|
481
|
+
url.searchParams.append('themeState', (0, _tokens.themeObjectToString)(themeState));
|
|
482
|
+
} else {
|
|
483
|
+
var _themeState$colorMode;
|
|
484
|
+
url.searchParams.append('themeMode', (_themeState$colorMode = themeState.colorMode) !== null && _themeState$colorMode !== void 0 ? _themeState$colorMode : '');
|
|
485
|
+
}
|
|
486
|
+
return url.href;
|
|
487
|
+
} catch (_unused) {
|
|
488
|
+
return previewUrl;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
477
491
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-theme-state-url')) {
|
|
478
492
|
var themeStateQueryString = encodeURIComponent((0, _tokens.themeObjectToString)(themeState));
|
|
479
493
|
return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
|
|
@@ -58,6 +58,12 @@ Object.defineProperty(exports, "PreviewAction", {
|
|
|
58
58
|
return _previewAction.default;
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
+
Object.defineProperty(exports, "ViewRelatedLinksAction", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _viewRelatedLinksAction.default;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
61
67
|
var _action = _interopRequireDefault(require("./action"));
|
|
62
68
|
var _deleteAction = _interopRequireDefault(require("./delete-action"));
|
|
63
69
|
var _editAction = _interopRequireDefault(require("./edit-action"));
|
|
@@ -66,4 +72,5 @@ var _followAction = _interopRequireDefault(require("./follow-action"));
|
|
|
66
72
|
var _previewAction = _interopRequireDefault(require("./preview-action"));
|
|
67
73
|
var _copyLinkAction = _interopRequireDefault(require("./copy-link-action"));
|
|
68
74
|
var _aiSummaryAction = _interopRequireDefault(require("./ai-summary-action"));
|
|
69
|
-
var _automationAction = _interopRequireDefault(require("./automation-action"));
|
|
75
|
+
var _automationAction = _interopRequireDefault(require("./automation-action"));
|
|
76
|
+
var _viewRelatedLinksAction = _interopRequireDefault(require("./view-related-links-action"));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _action = _interopRequireDefault(require("../action"));
|
|
11
|
+
var _reactIntlNext = require("react-intl-next");
|
|
12
|
+
var _messages = require("../../../../../messages");
|
|
13
|
+
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
14
|
+
var _relatedLinksActionIcon = _interopRequireDefault(require("./related-links-action-icon"));
|
|
15
|
+
/** @jsx jsx */
|
|
16
|
+
|
|
17
|
+
var ViewRelatedLinksAction = function ViewRelatedLinksAction(props) {
|
|
18
|
+
var _context$actions;
|
|
19
|
+
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
20
|
+
var actionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions.ViewRelatedLinksAction;
|
|
21
|
+
return actionData ? (0, _react.jsx)(_action.default, (0, _extends2.default)({
|
|
22
|
+
content: (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.related_links_view_related_urls),
|
|
23
|
+
icon: (0, _react.jsx)(_relatedLinksActionIcon.default, null),
|
|
24
|
+
testId: "smart-action-view-related-links-action",
|
|
25
|
+
ariaLabel: "View most recent pages or content types coming from or found on this link"
|
|
26
|
+
}, props)) : null;
|
|
27
|
+
};
|
|
28
|
+
var _default = exports.default = ViewRelatedLinksAction;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
var _childIssues = _interopRequireDefault(require("@atlaskit/icon/glyph/child-issues"));
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
|
|
12
|
+
var rotateSvg = (0, _react.css)({
|
|
13
|
+
transform: 'rotate(180deg)',
|
|
14
|
+
display: 'inline-block'
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* ChildIssuesIcon but 180 degrees rotated
|
|
19
|
+
*/
|
|
20
|
+
var RelatedLinksActionIcon = function RelatedLinksActionIcon() {
|
|
21
|
+
return (0, _react.jsx)("span", {
|
|
22
|
+
css: rotateSvg
|
|
23
|
+
}, (0, _react.jsx)(_childIssues.default, {
|
|
24
|
+
label: "View recent links..."
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
var _default = exports.default = RelatedLinksActionIcon;
|
|
@@ -15,7 +15,7 @@ var _block = _interopRequireDefault(require("../../block"));
|
|
|
15
15
|
var _constants = require("../../../../../../constants");
|
|
16
16
|
var _utils = require("../../../utils");
|
|
17
17
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
18
|
-
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "hideIcon"];
|
|
18
|
+
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
19
19
|
/** @jsx jsx */
|
|
20
20
|
var actionStyles = (0, _react2.css)({
|
|
21
21
|
cursor: 'pointer',
|
|
@@ -50,6 +50,7 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
50
50
|
position = _ref.position,
|
|
51
51
|
testId = _ref.testId,
|
|
52
52
|
title = _ref.title,
|
|
53
|
+
icon = _ref.icon,
|
|
53
54
|
hideIcon = _ref.hideIcon,
|
|
54
55
|
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
55
56
|
var _ref2 = retry || {},
|
|
@@ -62,6 +63,7 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
62
63
|
return (0, _react2.jsx)(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
63
64
|
testId: "".concat(testId, "-errored-view")
|
|
64
65
|
}), !hideIcon && (0, _react2.jsx)(_elements.LinkIcon, {
|
|
66
|
+
overrideIcon: icon,
|
|
65
67
|
position: position
|
|
66
68
|
}), title, descriptor && (0, _react2.jsx)(_elementGroup.default, {
|
|
67
69
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
@@ -18,7 +18,7 @@ var _errored = _interopRequireDefault(require("./errored"));
|
|
|
18
18
|
var _resolving = _interopRequireDefault(require("./resolving"));
|
|
19
19
|
var _actionGroup = _interopRequireDefault(require("../action-group"));
|
|
20
20
|
var _elements = require("../../elements");
|
|
21
|
-
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "theme", "hideRetry", "metadataPosition", "hideIcon"];
|
|
21
|
+
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "icon", "theme", "hideRetry", "metadataPosition", "hideIcon"];
|
|
22
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
24
|
var getActionStyles = function getActionStyles(showOnHover, isOpen) {
|
|
@@ -77,6 +77,7 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
77
77
|
_ref$testId = _ref.testId,
|
|
78
78
|
testId = _ref$testId === void 0 ? 'smart-block-title' : _ref$testId,
|
|
79
79
|
text = _ref.text,
|
|
80
|
+
icon = _ref.icon,
|
|
80
81
|
theme = _ref.theme,
|
|
81
82
|
hideRetry = _ref.hideRetry,
|
|
82
83
|
metadataPosition = _ref.metadataPosition,
|
|
@@ -124,7 +125,8 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
124
125
|
testId: testId,
|
|
125
126
|
title: title,
|
|
126
127
|
metadataPosition: metadataPosition,
|
|
127
|
-
hideIcon: hideIcon
|
|
128
|
+
hideIcon: hideIcon,
|
|
129
|
+
icon: icon
|
|
128
130
|
}));
|
|
129
131
|
};
|
|
130
132
|
var _default = exports.default = TitleBlock;
|
|
@@ -14,7 +14,7 @@ var _block = _interopRequireDefault(require("../../block"));
|
|
|
14
14
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
15
15
|
var _constants = require("../../../../../../constants");
|
|
16
16
|
var _utils = require("../../utils");
|
|
17
|
-
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "title", "metadataPosition", "hideIcon"];
|
|
17
|
+
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "icon", "title", "metadataPosition", "hideIcon"];
|
|
18
18
|
/**
|
|
19
19
|
* This renders a fully resolved TitleBlock.
|
|
20
20
|
* This should render when a Smart Link returns a valid response.
|
|
@@ -29,6 +29,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
29
29
|
subtitle = _ref$subtitle === void 0 ? [] : _ref$subtitle,
|
|
30
30
|
testId = _ref.testId,
|
|
31
31
|
text = _ref.text,
|
|
32
|
+
icon = _ref.icon,
|
|
32
33
|
title = _ref.title,
|
|
33
34
|
metadataPosition = _ref.metadataPosition,
|
|
34
35
|
hideIcon = _ref.hideIcon,
|
|
@@ -38,6 +39,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
38
39
|
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
39
40
|
testId: "".concat(testId, "-resolved-view")
|
|
40
41
|
}), !hideIcon && /*#__PURE__*/_react.default.createElement(_elements.LinkIcon, {
|
|
42
|
+
overrideIcon: icon,
|
|
41
43
|
position: position
|
|
42
44
|
}), /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
43
45
|
direction: _constants.SmartLinkDirection.Vertical,
|
|
@@ -81,6 +81,7 @@ var renderImageIcon = function renderImageIcon(defaultIcon, url, testId) {
|
|
|
81
81
|
*/
|
|
82
82
|
var Icon = function Icon(_ref) {
|
|
83
83
|
var icon = _ref.icon,
|
|
84
|
+
overrideIcon = _ref.overrideIcon,
|
|
84
85
|
_ref$label = _ref.label,
|
|
85
86
|
label = _ref$label === void 0 ? 'Link' : _ref$label,
|
|
86
87
|
name = _ref.name,
|
|
@@ -95,8 +96,8 @@ var Icon = function Icon(_ref) {
|
|
|
95
96
|
url = _ref.url;
|
|
96
97
|
var element = (0, _react.useMemo)(function () {
|
|
97
98
|
var defaultIcon = renderDefaultIcon(label, testId);
|
|
98
|
-
return (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
99
|
-
}, [icon, label, render, testId, url]);
|
|
99
|
+
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
100
|
+
}, [overrideIcon, icon, label, render, testId, url]);
|
|
100
101
|
var width = (0, _utils.getIconWidth)(size);
|
|
101
102
|
var styles = getIconStyles(position, width);
|
|
102
103
|
var renderStyles = render ? getCustomRenderStyles(width) : undefined;
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.
|
|
20
|
+
packageVersion: "26.73.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
package/dist/es2019/constants.js
CHANGED
|
@@ -158,6 +158,7 @@ export let ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
158
158
|
}({});
|
|
159
159
|
export let InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
160
160
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
161
|
+
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
161
162
|
return InternalActionName;
|
|
162
163
|
}({});
|
|
163
164
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { extractLink } from '@atlaskit/link-extractors';
|
|
2
|
+
export const extractViewRelatedLinksAction = response => {
|
|
3
|
+
var _response$meta, _response$meta$suppor;
|
|
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'))) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const url = extractLink(response.data);
|
|
8
|
+
if (!url) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
url
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { ActionName, InternalActionName } from '../../../constants';
|
|
2
3
|
import { extractDownloadAction } from './extract-download-action';
|
|
3
4
|
import { extractPreviewAction } from './extract-preview-action';
|
|
@@ -5,6 +6,7 @@ import { extractAISummaryAction } from './extract-ai-summary-action';
|
|
|
5
6
|
import extractFollowAction from './extract-follow-action';
|
|
6
7
|
import { extractCopyLinkAction } from './extract-copy-link-action';
|
|
7
8
|
import { extractAutomationAction } from './extract-automation-action';
|
|
9
|
+
import { extractViewRelatedLinksAction } from './extract-view-related-links-action';
|
|
8
10
|
const extractActions = (response, url, actionOptions, id, aiSummaryConfig) => {
|
|
9
11
|
const data = response.data;
|
|
10
12
|
const action = {
|
|
@@ -13,7 +15,10 @@ const extractActions = (response, url, actionOptions, id, aiSummaryConfig) => {
|
|
|
13
15
|
[ActionName.FollowAction]: extractFollowAction(response, actionOptions, id),
|
|
14
16
|
[ActionName.PreviewAction]: extractPreviewAction(response, actionOptions),
|
|
15
17
|
[ActionName.AutomationAction]: extractAutomationAction(response),
|
|
16
|
-
[InternalActionName.AISummaryAction]: extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)
|
|
18
|
+
[InternalActionName.AISummaryAction]: extractAISummaryAction(response, url, actionOptions, aiSummaryConfig),
|
|
19
|
+
...(getBooleanFF('platform.linking-platform.smart-card.enable-view-related-urls-action') ? {
|
|
20
|
+
[InternalActionName.ViewRelatedLinksAction]: extractViewRelatedLinksAction(response)
|
|
21
|
+
} : {})
|
|
17
22
|
};
|
|
18
23
|
return Object.values(action).some(value => Boolean(value)) ? action : undefined;
|
|
19
24
|
};
|
package/dist/es2019/messages.js
CHANGED
|
@@ -704,5 +704,10 @@ export const messages = defineMessages({
|
|
|
704
704
|
id: 'fabric.linking.related_links_modal_title.nonfinal',
|
|
705
705
|
defaultMessage: 'Recent Links',
|
|
706
706
|
description: 'Shown as the title for the related links modal'
|
|
707
|
+
},
|
|
708
|
+
related_links_view_related_urls: {
|
|
709
|
+
id: 'fabric.linking.related_links_view_related_urls.nonfinal',
|
|
710
|
+
defaultMessage: 'View recent links...',
|
|
711
|
+
description: 'Action to view related links to the given resource'
|
|
707
712
|
}
|
|
708
713
|
});
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.73.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -177,6 +177,20 @@ export const combineFrameStyle = (frameStyle, isFrameVisible) => {
|
|
|
177
177
|
* @param themeState
|
|
178
178
|
*/
|
|
179
179
|
export const getPreviewUrlWithTheme = (previewUrl, themeState) => {
|
|
180
|
+
if (getBooleanFF('platform.linking-platform.smart-card.fix-embed-preview-url-query-params')) {
|
|
181
|
+
try {
|
|
182
|
+
const url = new URL(previewUrl);
|
|
183
|
+
if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
|
|
184
|
+
url.searchParams.append('themeState', themeObjectToString(themeState));
|
|
185
|
+
} else {
|
|
186
|
+
var _themeState$colorMode;
|
|
187
|
+
url.searchParams.append('themeMode', (_themeState$colorMode = themeState.colorMode) !== null && _themeState$colorMode !== void 0 ? _themeState$colorMode : '');
|
|
188
|
+
}
|
|
189
|
+
return url.href;
|
|
190
|
+
} catch {
|
|
191
|
+
return previewUrl;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
180
194
|
if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
|
|
181
195
|
const themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
|
|
182
196
|
return `${previewUrl}${previewUrl.includes('?') ? '&' : '?'}themeState=${themeStateQueryString}`;
|
|
@@ -6,4 +6,5 @@ export { default as FollowAction } from './follow-action';
|
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
7
|
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
8
|
export { default as AISummaryAction } from './ai-summary-action';
|
|
9
|
-
export { default as AutomationAction } from './automation-action';
|
|
9
|
+
export { default as AutomationAction } from './automation-action';
|
|
10
|
+
export { default as ViewRelatedLinksAction } from './view-related-links-action';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import Action from '../action';
|
|
5
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import { messages } from '../../../../../messages';
|
|
7
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
|
+
import RelatedLinksActionIcon from './related-links-action-icon';
|
|
9
|
+
const ViewRelatedLinksAction = props => {
|
|
10
|
+
var _context$actions;
|
|
11
|
+
const context = useFlexibleUiContext();
|
|
12
|
+
const actionData = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions.ViewRelatedLinksAction;
|
|
13
|
+
return actionData ? jsx(Action, _extends({
|
|
14
|
+
content: jsx(FormattedMessage, messages.related_links_view_related_urls),
|
|
15
|
+
icon: jsx(RelatedLinksActionIcon, null),
|
|
16
|
+
testId: "smart-action-view-related-links-action",
|
|
17
|
+
ariaLabel: "View most recent pages or content types coming from or found on this link"
|
|
18
|
+
}, props)) : null;
|
|
19
|
+
};
|
|
20
|
+
export default ViewRelatedLinksAction;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import ChildIssuesIcon from '@atlaskit/icon/glyph/child-issues';
|
|
4
|
+
const rotateSvg = css({
|
|
5
|
+
transform: 'rotate(180deg)',
|
|
6
|
+
display: 'inline-block'
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* ChildIssuesIcon but 180 degrees rotated
|
|
11
|
+
*/
|
|
12
|
+
const RelatedLinksActionIcon = () => jsx("span", {
|
|
13
|
+
css: rotateSvg
|
|
14
|
+
}, jsx(ChildIssuesIcon, {
|
|
15
|
+
label: "View recent links..."
|
|
16
|
+
}));
|
|
17
|
+
export default RelatedLinksActionIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -41,6 +41,7 @@ const TitleBlockErroredView = ({
|
|
|
41
41
|
position,
|
|
42
42
|
testId,
|
|
43
43
|
title,
|
|
44
|
+
icon,
|
|
44
45
|
hideIcon,
|
|
45
46
|
...blockProps
|
|
46
47
|
}) => {
|
|
@@ -56,6 +57,7 @@ const TitleBlockErroredView = ({
|
|
|
56
57
|
return jsx(Block, _extends({}, blockProps, {
|
|
57
58
|
testId: `${testId}-errored-view`
|
|
58
59
|
}), !hideIcon && jsx(LinkIcon, {
|
|
60
|
+
overrideIcon: icon,
|
|
59
61
|
position: position
|
|
60
62
|
}), title, descriptor && jsx(ElementGroup, {
|
|
61
63
|
direction: SmartLinkDirection.Horizontal,
|
|
@@ -61,6 +61,7 @@ const TitleBlock = ({
|
|
|
61
61
|
showActionOnHover,
|
|
62
62
|
testId = 'smart-block-title',
|
|
63
63
|
text,
|
|
64
|
+
icon,
|
|
64
65
|
theme,
|
|
65
66
|
hideRetry,
|
|
66
67
|
metadataPosition,
|
|
@@ -105,7 +106,8 @@ const TitleBlock = ({
|
|
|
105
106
|
testId: testId,
|
|
106
107
|
title: title,
|
|
107
108
|
metadataPosition: metadataPosition,
|
|
108
|
-
hideIcon: hideIcon
|
|
109
|
+
hideIcon: hideIcon,
|
|
110
|
+
icon: icon
|
|
109
111
|
}));
|
|
110
112
|
};
|
|
111
113
|
export default TitleBlock;
|
|
@@ -19,6 +19,7 @@ const TitleBlockResolvedView = ({
|
|
|
19
19
|
subtitle = [],
|
|
20
20
|
testId,
|
|
21
21
|
text,
|
|
22
|
+
icon,
|
|
22
23
|
title,
|
|
23
24
|
metadataPosition,
|
|
24
25
|
hideIcon,
|
|
@@ -29,6 +30,7 @@ const TitleBlockResolvedView = ({
|
|
|
29
30
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
30
31
|
testId: `${testId}-resolved-view`
|
|
31
32
|
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
33
|
+
overrideIcon: icon,
|
|
32
34
|
position: position
|
|
33
35
|
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
34
36
|
direction: SmartLinkDirection.Vertical,
|
|
@@ -64,6 +64,7 @@ const renderImageIcon = (defaultIcon, url, testId) => {
|
|
|
64
64
|
*/
|
|
65
65
|
const Icon = ({
|
|
66
66
|
icon,
|
|
67
|
+
overrideIcon,
|
|
67
68
|
label = 'Link',
|
|
68
69
|
name,
|
|
69
70
|
position = SmartLinkPosition.Top,
|
|
@@ -75,8 +76,8 @@ const Icon = ({
|
|
|
75
76
|
}) => {
|
|
76
77
|
const element = useMemo(() => {
|
|
77
78
|
const defaultIcon = renderDefaultIcon(label, testId);
|
|
78
|
-
return (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
79
|
-
}, [icon, label, render, testId, url]);
|
|
79
|
+
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
80
|
+
}, [overrideIcon, icon, label, render, testId, url]);
|
|
80
81
|
const width = getIconWidth(size);
|
|
81
82
|
const styles = getIconStyles(position, width);
|
|
82
83
|
const renderStyles = render ? getCustomRenderStyles(width) : undefined;
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.
|
|
10
|
+
packageVersion: "26.73.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
package/dist/esm/constants.js
CHANGED
|
@@ -158,6 +158,7 @@ export var ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
158
158
|
}({});
|
|
159
159
|
export var InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
160
160
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
161
|
+
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
161
162
|
return InternalActionName;
|
|
162
163
|
}({});
|
|
163
164
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { extractLink } from '@atlaskit/link-extractors';
|
|
2
|
+
export var extractViewRelatedLinksAction = function extractViewRelatedLinksAction(response) {
|
|
3
|
+
var _response$meta;
|
|
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'))) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
var url = extractLink(response.data);
|
|
8
|
+
if (!url) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
url: url
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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 { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
5
|
import { ActionName, InternalActionName } from '../../../constants';
|
|
3
6
|
import { extractDownloadAction } from './extract-download-action';
|
|
4
7
|
import { extractPreviewAction } from './extract-preview-action';
|
|
@@ -6,10 +9,11 @@ import { extractAISummaryAction } from './extract-ai-summary-action';
|
|
|
6
9
|
import extractFollowAction from './extract-follow-action';
|
|
7
10
|
import { extractCopyLinkAction } from './extract-copy-link-action';
|
|
8
11
|
import { extractAutomationAction } from './extract-automation-action';
|
|
12
|
+
import { extractViewRelatedLinksAction } from './extract-view-related-links-action';
|
|
9
13
|
var extractActions = function extractActions(response, url, actionOptions, id, aiSummaryConfig) {
|
|
10
|
-
var
|
|
14
|
+
var _objectSpread2;
|
|
11
15
|
var data = response.data;
|
|
12
|
-
var action = (
|
|
16
|
+
var action = _objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, ActionName.CopyLinkAction, extractCopyLinkAction(data, actionOptions)), _defineProperty(_objectSpread2, ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), _defineProperty(_objectSpread2, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _defineProperty(_objectSpread2, ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), _defineProperty(_objectSpread2, ActionName.AutomationAction, extractAutomationAction(response)), _defineProperty(_objectSpread2, InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), _objectSpread2), getBooleanFF('platform.linking-platform.smart-card.enable-view-related-urls-action') ? _defineProperty({}, InternalActionName.ViewRelatedLinksAction, extractViewRelatedLinksAction(response)) : {});
|
|
13
17
|
return Object.values(action).some(function (value) {
|
|
14
18
|
return Boolean(value);
|
|
15
19
|
}) ? action : undefined;
|