@atlaskit/smart-card 45.6.6 → 45.6.7
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 +9 -0
- package/dist/cjs/extractors/flexible/actions/index.js +3 -3
- package/dist/cjs/extractors/flexible/index.js +3 -5
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -8
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +3 -8
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -8
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +7 -13
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +12 -7
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +11 -6
- package/dist/cjs/view/FlexibleCard/index.js +5 -12
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/index.js +8 -10
- package/dist/es2019/extractors/flexible/index.js +2 -4
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -9
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +3 -9
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -9
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +7 -14
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +10 -7
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +9 -6
- package/dist/es2019/view/FlexibleCard/index.js +3 -7
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/index.js +3 -3
- package/dist/esm/extractors/flexible/index.js +3 -5
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedModal/components/link-info/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -8
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +3 -8
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -8
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +7 -13
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +12 -7
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +11 -6
- package/dist/esm/view/FlexibleCard/index.js +5 -12
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 45.6.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`97bff75e44905`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/97bff75e44905) -
|
|
8
|
+
NAVX-5125 cleaning up sl a11y embed modal fg
|
|
9
|
+
- [`d85240382e716`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d85240382e716) -
|
|
10
|
+
NO-ISSUE Shipping rovo action in block card for eligible providers only
|
|
11
|
+
|
|
3
12
|
## 45.6.6
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -32,7 +32,7 @@ var extractFlexibleCardActions = exports.extractFlexibleCardActions = function e
|
|
|
32
32
|
url = _ref.url,
|
|
33
33
|
isPreviewPanelAvailable = _ref.isPreviewPanelAvailable,
|
|
34
34
|
openPreviewPanel = _ref.openPreviewPanel;
|
|
35
|
-
var action =
|
|
35
|
+
var action = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.ActionName.CopyLinkAction, (0, _extractCopyLinkAction.extractCopyLinkClientAction)({
|
|
36
36
|
actionOptions: actionOptions,
|
|
37
37
|
appearance: appearance,
|
|
38
38
|
id: id,
|
|
@@ -53,14 +53,14 @@ var extractFlexibleCardActions = exports.extractFlexibleCardActions = function e
|
|
|
53
53
|
openPreviewPanel: openPreviewPanel
|
|
54
54
|
}, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? {
|
|
55
55
|
transformUrl: transformUrl
|
|
56
|
-
} : undefined))), _constants.ActionName.AutomationAction, (0, _extractAutomationAction.extractAutomationAction)(response)), _constants.InternalActionName.AISummaryAction, (0, _extractAiSummaryAction.extractAISummaryAction)(response, url, actionOptions, aiSummaryConfig)),
|
|
56
|
+
} : undefined))), _constants.ActionName.AutomationAction, (0, _extractAutomationAction.extractAutomationAction)(response)), _constants.InternalActionName.AISummaryAction, (0, _extractAiSummaryAction.extractAISummaryAction)(response, url, actionOptions, aiSummaryConfig)), _constants.ActionName.RovoChatAction, (0, _extractRovoChatAction.default)({
|
|
57
57
|
actionOptions: actionOptions,
|
|
58
58
|
appearance: appearance,
|
|
59
59
|
id: id,
|
|
60
60
|
product: product,
|
|
61
61
|
response: response,
|
|
62
62
|
rovoConfig: rovoConfig
|
|
63
|
-
}))
|
|
63
|
+
})), _constants.InternalActionName.ViewRelatedLinksAction, (0, _extractViewRelatedLinksAction.extractViewRelatedLinksAction)(response));
|
|
64
64
|
return Object.values(action).some(function (value) {
|
|
65
65
|
return Boolean(value);
|
|
66
66
|
}) ? action : undefined;
|
|
@@ -50,17 +50,15 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
50
50
|
var meta = response.meta;
|
|
51
51
|
var url = (0, _linkExtractors.extractSmartLinkUrl)(response);
|
|
52
52
|
return {
|
|
53
|
-
actions: (0, _actions.extractFlexibleCardActions)(_objectSpread(
|
|
53
|
+
actions: (0, _actions.extractFlexibleCardActions)(_objectSpread({
|
|
54
54
|
actionOptions: actionOptions,
|
|
55
55
|
aiSummaryConfig: aiSummaryConfig,
|
|
56
56
|
appearance: appearance,
|
|
57
57
|
fireEvent: fireEvent,
|
|
58
58
|
id: id,
|
|
59
|
-
origin: origin
|
|
60
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
59
|
+
origin: origin,
|
|
61
60
|
product: product,
|
|
62
|
-
rovoConfig: rovoConfig
|
|
63
|
-
} : undefined), {}, {
|
|
61
|
+
rovoConfig: rovoConfig,
|
|
64
62
|
response: response,
|
|
65
63
|
url: props.url,
|
|
66
64
|
// Use the original URL in edge cases, such as short links for AI summary and copy link actions.
|
|
@@ -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: "45.6.
|
|
14
|
+
packageVersion: "45.6.6" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -17,7 +17,6 @@ var _fullscreenEnter = _interopRequireDefault(require("@atlaskit/icon/core/fulls
|
|
|
17
17
|
var _fullscreenExit = _interopRequireDefault(require("@atlaskit/icon/core/fullscreen-exit"));
|
|
18
18
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
19
19
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
20
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
20
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
22
21
|
var _messages = require("../../../../messages");
|
|
23
22
|
var _Icon = require("../../../common/Icon");
|
|
@@ -65,7 +64,7 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
65
64
|
}, [onDownloadButtonClick, testId, formatMessage]);
|
|
66
65
|
var urlButton = (0, _react.useMemo)(function () {
|
|
67
66
|
if (onViewButtonClick) {
|
|
68
|
-
var label = providerName
|
|
67
|
+
var label = providerName ? formatMessage(_messages.messages.viewInProvider, {
|
|
69
68
|
providerName: providerName
|
|
70
69
|
}) : formatMessage(_messages.messages.viewOriginal);
|
|
71
70
|
var content = providerName ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.viewIn), " ", providerName) : /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.viewOriginal);
|
package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
CHANGED
|
@@ -11,10 +11,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactIntl = require("react-intl");
|
|
13
13
|
var _rovo = _interopRequireDefault(require("@atlaskit/icon-lab/core/rovo"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
16
15
|
var _messages = require("../../../../../messages");
|
|
17
|
-
var _useRovoConfig2 = _interopRequireDefault(require("../../../../../state/hooks/use-rovo-config"));
|
|
18
16
|
var _action = _interopRequireDefault(require("../action"));
|
|
19
17
|
var _utils = require("./utils");
|
|
20
18
|
var _excluded = ["onClick", "onError", "testId", "status", "summariseUrl"];
|
|
@@ -28,8 +26,6 @@ function AISummariseAction(_ref) {
|
|
|
28
26
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
27
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
30
28
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
31
|
-
var _useRovoConfig = (0, _useRovoConfig2.default)(),
|
|
32
|
-
product = _useRovoConfig.product;
|
|
33
29
|
var onCompleted = (0, _react.useCallback)(function (state) {
|
|
34
30
|
if ((state === null || state === void 0 ? void 0 : state.status) === 'error') {
|
|
35
31
|
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback((0, _utils.getErrorMessage)(state.error));
|
|
@@ -48,13 +44,12 @@ function AISummariseAction(_ref) {
|
|
|
48
44
|
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
49
45
|
return /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
50
46
|
content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.ai_summary_action_rebrand),
|
|
51
|
-
icon: /*#__PURE__*/_react.default.createElement(_rovo.default,
|
|
47
|
+
icon: /*#__PURE__*/_react.default.createElement(_rovo.default, {
|
|
52
48
|
spacing: "spacious",
|
|
53
49
|
color: "currentColor",
|
|
54
|
-
label: "Summarise with AI"
|
|
55
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || !!product && product === 'CONFLUENCE' ? {
|
|
50
|
+
label: "Summarise with AI",
|
|
56
51
|
size: props.iconSize
|
|
57
|
-
}
|
|
52
|
+
}),
|
|
58
53
|
onClick: handleActionClick,
|
|
59
54
|
testId: "".concat(testId, "-summarise-action"),
|
|
60
55
|
isLoading: status === 'loading',
|
|
@@ -10,13 +10,11 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactIntl = require("react-intl");
|
|
12
12
|
var _automation = _interopRequireDefault(require("@atlaskit/icon/core/automation"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
14
|
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
16
15
|
var _constants = require("../../../../../constants");
|
|
17
16
|
var _messages = require("../../../../../messages");
|
|
18
17
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
19
|
-
var _useRovoConfig2 = _interopRequireDefault(require("../../../../../state/hooks/use-rovo-config"));
|
|
20
18
|
var _modal = require("../../../../../state/modal");
|
|
21
19
|
var _action = _interopRequireDefault(require("../action"));
|
|
22
20
|
var _utils = require("./utils");
|
|
@@ -36,8 +34,6 @@ var AutomationAction = function AutomationAction(props) {
|
|
|
36
34
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
37
35
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
38
36
|
var automationActionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.AutomationAction];
|
|
39
|
-
var _useRovoConfig = (0, _useRovoConfig2.default)(),
|
|
40
|
-
rovoProduct = _useRovoConfig.product;
|
|
41
37
|
var automationActionOnClick = (0, _react.useCallback)(function (automationActionData) {
|
|
42
38
|
var product = automationActionData.product,
|
|
43
39
|
resourceType = automationActionData.resourceType,
|
|
@@ -85,13 +81,12 @@ var AutomationAction = function AutomationAction(props) {
|
|
|
85
81
|
var automationActionIconLabel = formatMessage(_messages.messages.automation_action_icon_label);
|
|
86
82
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
87
83
|
content: automationActionTitle,
|
|
88
|
-
icon: /*#__PURE__*/_react.default.createElement(_automation.default,
|
|
84
|
+
icon: /*#__PURE__*/_react.default.createElement(_automation.default, {
|
|
89
85
|
spacing: "spacious",
|
|
90
86
|
color: "currentColor",
|
|
91
|
-
label: automationActionIconLabel
|
|
92
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || !!rovoProduct && rovoProduct === 'CONFLUENCE' ? {
|
|
87
|
+
label: automationActionIconLabel,
|
|
93
88
|
size: props.iconSize
|
|
94
|
-
}
|
|
89
|
+
}),
|
|
95
90
|
testId: "smart-action-automation-action",
|
|
96
91
|
tooltipMessage: automationActionTooltip
|
|
97
92
|
}, props, {
|
|
@@ -15,12 +15,10 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _reactIntl = require("react-intl");
|
|
17
17
|
var _link = _interopRequireDefault(require("@atlaskit/icon/core/link"));
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _constants = require("../../../../../constants");
|
|
20
19
|
var _messages = require("../../../../../messages");
|
|
21
20
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
22
21
|
var _useInvokeClientAction = _interopRequireDefault(require("../../../../../state/hooks/use-invoke-client-action"));
|
|
23
|
-
var _useRovoConfig2 = _interopRequireDefault(require("../../../../../state/hooks/use-rovo-config"));
|
|
24
22
|
var _action = _interopRequireDefault(require("../action"));
|
|
25
23
|
var _excluded = ["onClick"];
|
|
26
24
|
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); }
|
|
@@ -38,8 +36,6 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
|
38
36
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
39
37
|
tooltipMessage = _useState2[0],
|
|
40
38
|
setTooltipMessage = _useState2[1];
|
|
41
|
-
var _useRovoConfig = (0, _useRovoConfig2.default)(),
|
|
42
|
-
product = _useRovoConfig.product;
|
|
43
39
|
var onClick = (0, _react.useCallback)(function () {
|
|
44
40
|
if (data !== null && data !== void 0 && data.invokeAction) {
|
|
45
41
|
invoke(_objectSpread(_objectSpread({}, data.invokeAction), {}, {
|
|
@@ -71,13 +67,12 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
|
71
67
|
return data ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
72
68
|
ariaLabel: intl.formatMessage(_messages.messages.copy_url_to_clipboard),
|
|
73
69
|
content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.copy_url_to_clipboard),
|
|
74
|
-
icon: /*#__PURE__*/_react.default.createElement(_link.default,
|
|
70
|
+
icon: /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
75
71
|
color: "currentColor",
|
|
76
72
|
label: "",
|
|
77
|
-
spacing: "spacious"
|
|
78
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || !!product && product === 'CONFLUENCE' ? {
|
|
73
|
+
spacing: "spacious",
|
|
79
74
|
size: props.iconSize
|
|
80
|
-
}
|
|
75
|
+
}),
|
|
81
76
|
onClick: onClick,
|
|
82
77
|
testId: "smart-action-copy-link-action",
|
|
83
78
|
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, tooltipMessage),
|
|
@@ -12,13 +12,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _reactIntl = require("react-intl");
|
|
13
13
|
var _growDiagonal = _interopRequireDefault(require("@atlaskit/icon/core/grow-diagonal"));
|
|
14
14
|
var _panelRight = _interopRequireDefault(require("@atlaskit/icon/core/panel-right"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
var _constants = require("../../../../../constants");
|
|
18
17
|
var _messages = require("../../../../../messages");
|
|
19
18
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
20
19
|
var _useInvokeClientAction = _interopRequireDefault(require("../../../../../state/hooks/use-invoke-client-action"));
|
|
21
|
-
var _useRovoConfig2 = _interopRequireDefault(require("../../../../../state/hooks/use-rovo-config"));
|
|
22
20
|
var _action = _interopRequireDefault(require("../action"));
|
|
23
21
|
var _excluded = ["onClick"];
|
|
24
22
|
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); }
|
|
@@ -31,8 +29,6 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
31
29
|
var invoke = (0, _useInvokeClientAction.default)({});
|
|
32
30
|
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.PreviewAction];
|
|
33
31
|
var hasPreviewPanel = data === null || data === void 0 ? void 0 : data.hasPreviewPanel;
|
|
34
|
-
var _useRovoConfig = (0, _useRovoConfig2.default)(),
|
|
35
|
-
product = _useRovoConfig.product;
|
|
36
32
|
var onClick = (0, _react.useCallback)(function () {
|
|
37
33
|
if (data !== null && data !== void 0 && data.invokeAction) {
|
|
38
34
|
invoke(data.invokeAction);
|
|
@@ -44,22 +40,20 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
44
40
|
var actionIcon = (0, _react.useCallback)(function () {
|
|
45
41
|
// Only use panel icon if experiment is enabled and hasPreviewPanel is true
|
|
46
42
|
if ((0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') && hasPreviewPanel) {
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement(_panelRight.default,
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_panelRight.default, {
|
|
48
44
|
color: "currentColor",
|
|
49
45
|
spacing: "spacious",
|
|
50
|
-
label: ""
|
|
51
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || !!product && product === 'CONFLUENCE' ? {
|
|
46
|
+
label: "",
|
|
52
47
|
size: props.iconSize
|
|
53
|
-
}
|
|
48
|
+
});
|
|
54
49
|
}
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(_growDiagonal.default,
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_growDiagonal.default, {
|
|
56
51
|
color: "currentColor",
|
|
57
52
|
spacing: "spacious",
|
|
58
|
-
label: ""
|
|
59
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || !!product && product === 'CONFLUENCE' ? {
|
|
53
|
+
label: "",
|
|
60
54
|
size: props.iconSize
|
|
61
|
-
}
|
|
62
|
-
}, [hasPreviewPanel, props.iconSize
|
|
55
|
+
});
|
|
56
|
+
}, [hasPreviewPanel, props.iconSize]);
|
|
63
57
|
var actionLabel = (0, _react.useMemo)(function () {
|
|
64
58
|
// Only use panel message if experiment is enabled and hasPreviewPanel is true
|
|
65
59
|
if ((0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') && hasPreviewPanel) {
|
|
@@ -88,6 +88,11 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
88
88
|
}, [context, items, product]);
|
|
89
89
|
var isMoreThenTwoItems = renderableActionItems.length > visibleButtonsNum;
|
|
90
90
|
var rovoChatAction = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.RovoChatAction];
|
|
91
|
+
var isRovoActionsEnabled = (0, _react.useMemo)(function () {
|
|
92
|
+
return !!rovoChatAction && rovoChatAction.product === 'CONFLUENCE' && items.some(function (action) {
|
|
93
|
+
return action.name === 'RovoChatAction';
|
|
94
|
+
});
|
|
95
|
+
}, [rovoChatAction, items]);
|
|
91
96
|
var onOpenChange = (0, _react.useCallback)(function (attrs) {
|
|
92
97
|
setIsOpen(attrs.isOpen);
|
|
93
98
|
if (onDropdownOpenChange) {
|
|
@@ -102,7 +107,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
102
107
|
}
|
|
103
108
|
}, [isOpen, onOpenChange]);
|
|
104
109
|
var actionButtons = (0, _react.useMemo)(function () {
|
|
105
|
-
if (
|
|
110
|
+
if (isRovoActionsEnabled) {
|
|
106
111
|
var rovoActions = [].concat((0, _toConsumableArray2.default)(containerWidth >= REDUCED_ACTIONS_SIZE ? renderableActionItems.slice(0, visibleButtonsNum - 1) : []), (0, _toConsumableArray2.default)(containerWidth >= OVERFLOW_ONLY_ACTIONS_SIZE ? [{
|
|
107
112
|
name: _constants.ActionName.RovoChatAction,
|
|
108
113
|
prompts: [_rovoChatUtils.RovoChatPromptKey.ASK_ROVO_ANYTHING],
|
|
@@ -122,10 +127,10 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
122
127
|
}
|
|
123
128
|
var actionItems = isMoreThenTwoItems ? renderableActionItems.slice(0, visibleButtonsNum - 1) : renderableActionItems;
|
|
124
129
|
return renderActionItems(actionItems, size, appearance, false, onActionItemClick);
|
|
125
|
-
}, [appearance, isMoreThenTwoItems, onActionItemClick, renderableActionItems, size, visibleButtonsNum,
|
|
130
|
+
}, [appearance, isMoreThenTwoItems, onActionItemClick, renderableActionItems, size, visibleButtonsNum, isRovoActionsEnabled, containerWidth]);
|
|
126
131
|
var moreActionDropdown = (0, _react.useMemo)(function () {
|
|
127
132
|
var actionItems;
|
|
128
|
-
if (
|
|
133
|
+
if (isRovoActionsEnabled && containerWidth < OVERFLOW_ONLY_ACTIONS_SIZE) {
|
|
129
134
|
actionItems = [].concat((0, _toConsumableArray2.default)(renderableActionItems), [{
|
|
130
135
|
name: _constants.ActionName.RovoChatAction,
|
|
131
136
|
prompts: [_rovoChatUtils.RovoChatPromptKey.ASK_ROVO_ANYTHING],
|
|
@@ -138,7 +143,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
138
143
|
name: _constants.ActionName.PreviewAction,
|
|
139
144
|
iconSize: 'small'
|
|
140
145
|
}]);
|
|
141
|
-
} else if (
|
|
146
|
+
} else if (isRovoActionsEnabled && containerWidth < REDUCED_ACTIONS_SIZE) {
|
|
142
147
|
actionItems = renderableActionItems;
|
|
143
148
|
} else {
|
|
144
149
|
actionItems = isMoreThenTwoItems ? renderableActionItems.slice(visibleButtonsNum - 1) : [];
|
|
@@ -162,11 +167,11 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
162
167
|
testId: "action-group-more-button-tooltip",
|
|
163
168
|
tag: "span"
|
|
164
169
|
}, /*#__PURE__*/React.createElement(_standardButton.default, (0, _extends2.default)({}, props, {
|
|
165
|
-
spacing:
|
|
170
|
+
spacing: isRovoActionsEnabled ? size === _constants.SmartLinkSize.XLarge ? 'default' : 'compact' : spacing,
|
|
166
171
|
testId: "action-group-more-button",
|
|
167
172
|
iconBefore: moreIcon,
|
|
168
173
|
ref: triggerRef
|
|
169
|
-
},
|
|
174
|
+
}, isRovoActionsEnabled ? {
|
|
170
175
|
appearance: appearance
|
|
171
176
|
} : {})));
|
|
172
177
|
},
|
|
@@ -175,7 +180,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
175
180
|
}, renderActionItems(actionItems, size, appearance, true, onActionItemClick));
|
|
176
181
|
}
|
|
177
182
|
return null;
|
|
178
|
-
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum,
|
|
183
|
+
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum, isRovoActionsEnabled, containerWidth]);
|
|
179
184
|
return renderableActionItems.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
180
185
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
181
186
|
className: (0, _runtime.ax)(["_1e0c116y _dzc21h6o _1ilq1i6y", "actions-button-group"]),
|
|
@@ -38,7 +38,12 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
|
38
38
|
isPreviewBlockErrored = props.isPreviewBlockErrored;
|
|
39
39
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
40
40
|
var rovoChatAction = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.RovoChatAction];
|
|
41
|
-
var
|
|
41
|
+
var isRovoActionsEnabled = (0, _react.useMemo)(function () {
|
|
42
|
+
return !!rovoChatAction && rovoChatAction.product === 'CONFLUENCE' && (actions === null || actions === void 0 ? void 0 : actions.some(function (action) {
|
|
43
|
+
return action.name === 'RovoChatAction';
|
|
44
|
+
}));
|
|
45
|
+
}, [rovoChatAction, actions]);
|
|
46
|
+
var hasPreview = isRovoActionsEnabled && !!(context !== null && context !== void 0 && context.preview) && !isPreviewBlockErrored;
|
|
42
47
|
var hasActions = (0, _react.useMemo)(function () {
|
|
43
48
|
var _filterActionItems;
|
|
44
49
|
return ((_filterActionItems = (0, _utils.filterActionItems)(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
@@ -69,22 +74,22 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
|
69
74
|
appearance: "subtle",
|
|
70
75
|
testId: "".concat(testId, "-provider"),
|
|
71
76
|
hideLabel: hasPreview,
|
|
72
|
-
className: (0, _runtime.ax)([
|
|
77
|
+
className: (0, _runtime.ax)([isRovoActionsEnabled && "_1wpz1h6o"])
|
|
73
78
|
}), actions && hasActions ? /*#__PURE__*/React.createElement(_elementGroup.default, {
|
|
74
79
|
testId: "smart-element-group-actions",
|
|
75
80
|
align: _constants.SmartLinkAlignment.Right,
|
|
76
81
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
77
82
|
width: _constants.SmartLinkWidth.Flexible,
|
|
78
|
-
className: (0, _runtime.ax)([size === _constants.SmartLinkSize.XLarge && "_c71lxy5q", safari && "_4t3i1osq",
|
|
83
|
+
className: (0, _runtime.ax)([size === _constants.SmartLinkSize.XLarge && "_c71lxy5q", safari && "_4t3i1osq", isRovoActionsEnabled && "_kqswh2mm"])
|
|
79
84
|
}, !!rovoChatAction && (rovoChatAction === null || rovoChatAction === void 0 ? void 0 : rovoChatAction.product) === 'CONFLUENCE' && /*#__PURE__*/React.createElement(_widthDetector.WidthObserver, {
|
|
80
85
|
setWidth: setContainerWidth,
|
|
81
86
|
offscreen: true
|
|
82
87
|
}), /*#__PURE__*/React.createElement(_actionGroup.default, {
|
|
83
88
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
84
89
|
items: actions,
|
|
85
|
-
appearance:
|
|
86
|
-
size:
|
|
87
|
-
containerWidth:
|
|
90
|
+
appearance: isRovoActionsEnabled ? 'subtle' : 'default',
|
|
91
|
+
size: isRovoActionsEnabled ? _constants.SmartLinkSize.Small : size,
|
|
92
|
+
containerWidth: isRovoActionsEnabled ? containerWidth : undefined
|
|
88
93
|
})) : null);
|
|
89
94
|
};
|
|
90
95
|
var _default = exports.default = FooterBlockResolvedView;
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
13
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -23,8 +22,6 @@ var _useSmartLinkCrossProductUrlWrapper = require("../../state/hooks/use-smart-l
|
|
|
23
22
|
var _container = _interopRequireDefault(require("./components/container"));
|
|
24
23
|
var _utils = require("./utils");
|
|
25
24
|
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); }
|
|
26
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
25
|
var PENDING_LINK_STATUSES = [_constants.SmartLinkStatus.Pending, _constants.SmartLinkStatus.Resolving];
|
|
29
26
|
|
|
30
27
|
/**
|
|
@@ -62,9 +59,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
62
59
|
isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
|
|
63
60
|
openPreviewPanel = _useSmartLinkContext.openPreviewPanel,
|
|
64
61
|
product = _useSmartLinkContext.product;
|
|
65
|
-
var rovoConfig = (0,
|
|
66
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
67
|
-
(0, _useRovoConfig.default)() : undefined;
|
|
62
|
+
var rovoConfig = (0, _useRovoConfig.default)();
|
|
68
63
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
69
64
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
70
65
|
var cardType = cardState.status,
|
|
@@ -86,7 +81,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
86
81
|
}, [placeholderData, status]);
|
|
87
82
|
var placeHolderStatus = placeholderCardState ? placeholderCardState.status : undefined;
|
|
88
83
|
var context = (0, _react.useMemo)(function () {
|
|
89
|
-
return (0, _utils.getContextByStatus)(
|
|
84
|
+
return (0, _utils.getContextByStatus)({
|
|
90
85
|
aiSummaryConfig: aiSummaryConfig,
|
|
91
86
|
appearance: appearance,
|
|
92
87
|
fireEvent: fireEvent,
|
|
@@ -98,18 +93,16 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
98
93
|
onContextMenu: onContextMenu,
|
|
99
94
|
origin: origin,
|
|
100
95
|
renderers: renderers,
|
|
101
|
-
resolve: resolve
|
|
102
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
96
|
+
resolve: resolve,
|
|
103
97
|
product: product,
|
|
104
|
-
rovoConfig: rovoConfig
|
|
105
|
-
} : undefined), {}, {
|
|
98
|
+
rovoConfig: rovoConfig,
|
|
106
99
|
actionOptions: actionOptions,
|
|
107
100
|
status: placeholderCardState ? placeHolderStatus : status,
|
|
108
101
|
url: url,
|
|
109
102
|
isPreviewPanelAvailable: isPreviewPanelAvailable,
|
|
110
103
|
openPreviewPanel: openPreviewPanel,
|
|
111
104
|
transformUrl: transformUrl
|
|
112
|
-
})
|
|
105
|
+
});
|
|
113
106
|
}, [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
|
|
114
107
|
var flexibleCardContext = (0, _react.useMemo)(function () {
|
|
115
108
|
return {
|
|
@@ -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: "45.6.
|
|
22
|
+
packageVersion: "45.6.6",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -52,16 +52,14 @@ export const extractFlexibleCardActions = ({
|
|
|
52
52
|
}),
|
|
53
53
|
[ActionName.AutomationAction]: extractAutomationAction(response),
|
|
54
54
|
[InternalActionName.AISummaryAction]: extractAISummaryAction(response, url, actionOptions, aiSummaryConfig),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
64
|
-
} : undefined),
|
|
55
|
+
[ActionName.RovoChatAction]: extractRovoChatAction({
|
|
56
|
+
actionOptions,
|
|
57
|
+
appearance,
|
|
58
|
+
id,
|
|
59
|
+
product,
|
|
60
|
+
response,
|
|
61
|
+
rovoConfig
|
|
62
|
+
}),
|
|
65
63
|
[InternalActionName.ViewRelatedLinksAction]: extractViewRelatedLinksAction(response)
|
|
66
64
|
};
|
|
67
65
|
return Object.values(action).some(value => Boolean(value)) ? action : undefined;
|
|
@@ -45,10 +45,8 @@ const extractFlexibleUiContext = ({
|
|
|
45
45
|
fireEvent,
|
|
46
46
|
id,
|
|
47
47
|
origin,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
rovoConfig
|
|
51
|
-
} : undefined),
|
|
48
|
+
product,
|
|
49
|
+
rovoConfig,
|
|
52
50
|
response,
|
|
53
51
|
url: props.url,
|
|
54
52
|
// Use the original URL in edge cases, such as short links for AI summary and copy link actions.
|
|
@@ -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: "45.6.
|
|
5
|
+
packageVersion: "45.6.6" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -9,7 +9,6 @@ import VidFullScreenOnIcon from '@atlaskit/icon/core/fullscreen-enter';
|
|
|
9
9
|
import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
|
|
10
10
|
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
11
11
|
import { CloseButton, useModal } from '@atlaskit/modal-dialog';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
13
|
import { messages } from '../../../../messages';
|
|
15
14
|
import { Icon } from '../../../common/Icon';
|
|
@@ -55,7 +54,7 @@ const LinkInfo = ({
|
|
|
55
54
|
}), [onDownloadButtonClick, testId, formatMessage]);
|
|
56
55
|
const urlButton = useMemo(() => {
|
|
57
56
|
if (onViewButtonClick) {
|
|
58
|
-
const label = providerName
|
|
57
|
+
const label = providerName ? formatMessage(messages.viewInProvider, {
|
|
59
58
|
providerName
|
|
60
59
|
}) : formatMessage(messages.viewOriginal);
|
|
61
60
|
const content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
|
package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
CHANGED
|
@@ -2,10 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import RovoIcon from '@atlaskit/icon-lab/core/rovo';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
7
6
|
import { messages } from '../../../../../messages';
|
|
8
|
-
import useRovoConfig from '../../../../../state/hooks/use-rovo-config';
|
|
9
7
|
import Action from '../action';
|
|
10
8
|
import { getErrorMessage } from './utils';
|
|
11
9
|
export function AISummariseAction({
|
|
@@ -19,9 +17,6 @@ export function AISummariseAction({
|
|
|
19
17
|
const {
|
|
20
18
|
fireEvent
|
|
21
19
|
} = useAnalyticsEvents();
|
|
22
|
-
const {
|
|
23
|
-
product
|
|
24
|
-
} = useRovoConfig();
|
|
25
20
|
const onCompleted = useCallback(state => {
|
|
26
21
|
if ((state === null || state === void 0 ? void 0 : state.status) === 'error') {
|
|
27
22
|
onErrorCallback === null || onErrorCallback === void 0 ? void 0 : onErrorCallback(getErrorMessage(state.error));
|
|
@@ -40,13 +35,12 @@ export function AISummariseAction({
|
|
|
40
35
|
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
41
36
|
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
42
37
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action_rebrand),
|
|
43
|
-
icon: /*#__PURE__*/React.createElement(RovoIcon,
|
|
38
|
+
icon: /*#__PURE__*/React.createElement(RovoIcon, {
|
|
44
39
|
spacing: "spacious",
|
|
45
40
|
color: "currentColor",
|
|
46
|
-
label: "Summarise with AI"
|
|
47
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || !!product && product === 'CONFLUENCE' ? {
|
|
41
|
+
label: "Summarise with AI",
|
|
48
42
|
size: props.iconSize
|
|
49
|
-
}
|
|
43
|
+
}),
|
|
50
44
|
onClick: handleActionClick,
|
|
51
45
|
testId: `${testId}-summarise-action`,
|
|
52
46
|
isLoading: status === 'loading',
|
|
@@ -2,13 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { lazy, useCallback } from 'react';
|
|
3
3
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
4
|
import AutomationIcon from '@atlaskit/icon/core/automation';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
8
7
|
import { ActionName } from '../../../../../constants';
|
|
9
8
|
import { messages } from '../../../../../messages';
|
|
10
9
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
11
|
-
import useRovoConfig from '../../../../../state/hooks/use-rovo-config';
|
|
12
10
|
import { useSmartLinkModal } from '../../../../../state/modal';
|
|
13
11
|
import Action from '../action';
|
|
14
12
|
import { getModalContent } from './utils';
|
|
@@ -27,9 +25,6 @@ const AutomationAction = props => {
|
|
|
27
25
|
fireEvent
|
|
28
26
|
} = useAnalyticsEvents();
|
|
29
27
|
const automationActionData = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.AutomationAction];
|
|
30
|
-
const {
|
|
31
|
-
product: rovoProduct
|
|
32
|
-
} = useRovoConfig();
|
|
33
28
|
const automationActionOnClick = useCallback(automationActionData => {
|
|
34
29
|
const {
|
|
35
30
|
product,
|
|
@@ -76,13 +71,12 @@ const AutomationAction = props => {
|
|
|
76
71
|
const automationActionIconLabel = formatMessage(messages.automation_action_icon_label);
|
|
77
72
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Action, _extends({
|
|
78
73
|
content: automationActionTitle,
|
|
79
|
-
icon: /*#__PURE__*/React.createElement(AutomationIcon,
|
|
74
|
+
icon: /*#__PURE__*/React.createElement(AutomationIcon, {
|
|
80
75
|
spacing: "spacious",
|
|
81
76
|
color: "currentColor",
|
|
82
|
-
label: automationActionIconLabel
|
|
83
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || !!rovoProduct && rovoProduct === 'CONFLUENCE' ? {
|
|
77
|
+
label: automationActionIconLabel,
|
|
84
78
|
size: props.iconSize
|
|
85
|
-
}
|
|
79
|
+
}),
|
|
86
80
|
testId: "smart-action-automation-action",
|
|
87
81
|
tooltipMessage: automationActionTooltip
|
|
88
82
|
}, props, {
|