@atlaskit/smart-card 44.1.2 → 44.3.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 +22 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/block-card-resolved-icon-variations-resolvedclient-icontesturls-/342/200/224-flexible-extractsmartlinkicon-path---default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-icon-variations-resolvedclient-icontesturls-/342/200/224-extracticon-document-non-document-paths---default.png +3 -0
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +3 -2
- package/dist/cjs/extractors/flexible/actions/index.js +1 -1
- package/dist/cjs/messages.js +40 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +48 -2
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +83 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +3 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +20 -4
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +4 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +11 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-resolved-icon-variations-resolvedclient-icontesturls-/342/200/224-flexible-extractsmartlinkicon-path---default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-icon-variations-resolvedclient-icontesturls-/342/200/224-extracticon-document-non-document-paths---default.png +3 -0
- package/dist/es2019/constants.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +4 -3
- package/dist/es2019/extractors/flexible/actions/index.js +1 -1
- package/dist/es2019/messages.js +40 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +46 -2
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +84 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +3 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +20 -5
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +5 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +11 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-resolved-icon-variations-resolvedclient-icontesturls-/342/200/224-flexible-extractsmartlinkicon-path---default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-icon-variations-resolvedclient-icontesturls-/342/200/224-extracticon-document-non-document-paths---default.png +3 -0
- package/dist/esm/constants.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +4 -3
- package/dist/esm/extractors/flexible/actions/index.js +1 -1
- package/dist/esm/messages.js +40 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +48 -2
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +84 -2
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +4 -4
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +21 -5
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +5 -2
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +11 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/constants.d.ts +2 -2
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +5 -1
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +1 -1
- package/dist/types-ts4.5/constants.d.ts +2 -2
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +5 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 44.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6752a0f97f86d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6752a0f97f86d) -
|
|
8
|
+
[ux] NAVX-4446 Add new Rovo actions on block card for 3P Auth experiment
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 44.2.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [`c4f985702c3d5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c4f985702c3d5) -
|
|
19
|
+
Remove flag to increase accessibility in links.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 44.1.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -157,11 +157,11 @@ var ActionName = exports.ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
157
157
|
ActionName["AutomationAction"] = "AutomationAction";
|
|
158
158
|
ActionName["DownloadAction"] = "DownloadAction";
|
|
159
159
|
ActionName["CustomAction"] = "CustomAction";
|
|
160
|
+
ActionName["RovoChatAction"] = "RovoChatAction";
|
|
160
161
|
return ActionName;
|
|
161
162
|
}({});
|
|
162
163
|
var InternalActionName = exports.InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
163
164
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
164
|
-
InternalActionName["RovoChatAction"] = "RovoChatAction";
|
|
165
165
|
InternalActionName["UnresolvedAction"] = "UnresolvedAction";
|
|
166
166
|
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
167
167
|
return InternalActionName;
|
|
@@ -30,13 +30,14 @@ var extractRovoChatAction = function extractRovoChatAction(_ref) {
|
|
|
30
30
|
var isGoogleProvider = (0, _helpers.getExtensionKey)(response) === 'google-object-provider';
|
|
31
31
|
var is3PAuthRovoActionEnabled = isGoogleProvider && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
32
32
|
var is3PInlinePostAuthActionsEnabled = !isGoogleProvider && (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg');
|
|
33
|
-
var
|
|
33
|
+
var is3PBlockPostAuthActionsEnabled = supportsRovoActions && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
34
|
+
var isSupportedFeature = supportsRovoActions && is3PInlinePostAuthActionsEnabled || is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
|
|
34
35
|
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
35
36
|
var url = (0, _linkExtractors.extractSmartLinkUrl)(response);
|
|
36
37
|
return isSupportedFeature && isOptIn ? {
|
|
37
38
|
invokeAction: {
|
|
38
39
|
actionSubjectId: 'rovoChatPrompt',
|
|
39
|
-
actionType: _constants.
|
|
40
|
+
actionType: _constants.ActionName.RovoChatAction,
|
|
40
41
|
definitionId: (0, _helpers.getDefinitionId)(response),
|
|
41
42
|
display: appearance,
|
|
42
43
|
extensionKey: (0, _helpers.getExtensionKey)(response),
|
|
@@ -50,7 +50,7 @@ var extractFlexibleCardActions = exports.extractFlexibleCardActions = function e
|
|
|
50
50
|
response: response,
|
|
51
51
|
isPreviewPanelAvailable: isPreviewPanelAvailable,
|
|
52
52
|
openPreviewPanel: openPreviewPanel
|
|
53
|
-
})), _constants.ActionName.AutomationAction, (0, _extractAutomationAction.extractAutomationAction)(response)), _constants.InternalActionName.AISummaryAction, (0, _extractAiSummaryAction.extractAISummaryAction)(response, url, actionOptions, aiSummaryConfig)), (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') ? (0, _defineProperty2.default)({}, _constants.
|
|
53
|
+
})), _constants.ActionName.AutomationAction, (0, _extractAutomationAction.extractAutomationAction)(response)), _constants.InternalActionName.AISummaryAction, (0, _extractAiSummaryAction.extractAISummaryAction)(response, url, actionOptions, aiSummaryConfig)), (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') ? (0, _defineProperty2.default)({}, _constants.ActionName.RovoChatAction, (0, _extractRovoChatAction.default)({
|
|
54
54
|
actionOptions: actionOptions,
|
|
55
55
|
appearance: appearance,
|
|
56
56
|
id: id,
|
package/dist/cjs/messages.js
CHANGED
|
@@ -976,5 +976,45 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
976
976
|
id: 'fabric.linking.rovo_prompt_message_ask_rovo_anything.non-final',
|
|
977
977
|
defaultMessage: '`I have a question about this linked item` {url}',
|
|
978
978
|
description: 'The placeholder prompt message pre-filled in Rovo Chat input. {url} refers to the Smart Link URL. This is not auto-submitted — the user types their question.'
|
|
979
|
+
},
|
|
980
|
+
rovo_prompt_button_highlight_relevant_content: {
|
|
981
|
+
id: 'fabric.linking.rovo_prompt_button_highlight_relevant_content.non-final',
|
|
982
|
+
defaultMessage: "Highlight what's relevant",
|
|
983
|
+
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
984
|
+
},
|
|
985
|
+
rovo_prompt_message_highlight_relevant_content: {
|
|
986
|
+
id: 'fabric.linking.rovo_prompt_message_highlight_relevant_content.non-final',
|
|
987
|
+
defaultMessage: '<p>Based on this linked item (<a>{url}</a>) and the {context} I’m currently viewing, highlight the parts of the linked content that are most relevant to this work. Explain briefly why each part is relevant.</p>',
|
|
988
|
+
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
989
|
+
},
|
|
990
|
+
rovo_prompt_button_identify_key_trends: {
|
|
991
|
+
id: 'fabric.linking.rovo_prompt_button_identify_key_trends.non-final',
|
|
992
|
+
defaultMessage: "Identify key trends",
|
|
993
|
+
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
994
|
+
},
|
|
995
|
+
rovo_prompt_message_identify_key_trends: {
|
|
996
|
+
id: 'fabric.linking.rovo_prompt_message_identify_key_trends.non-final',
|
|
997
|
+
defaultMessage: '<p>From this <a>{url}</a>, identify the key trends, anomalies, and headline numbers. Call out anything increasing/decreasing significantly, noteworthy comparisons, and any risks or opportunities the data suggests.</p>',
|
|
998
|
+
description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
999
|
+
},
|
|
1000
|
+
rovo_prompt_button_identify_key_points: {
|
|
1001
|
+
id: 'fabric.linking.rovo_prompt_button_identify_key_points.non-final',
|
|
1002
|
+
defaultMessage: "Identify key points",
|
|
1003
|
+
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1004
|
+
},
|
|
1005
|
+
rovo_prompt_message_identify_key_points: {
|
|
1006
|
+
id: 'fabric.linking.rovo_prompt_message_identify_key_points.non-final',
|
|
1007
|
+
defaultMessage: '<p>From this <a>{url}</a>, identify the key points, proposals, and decisions. Focus on what someone skimming the deck should know in order to understand the main message.</p>',
|
|
1008
|
+
description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
1009
|
+
},
|
|
1010
|
+
rovo_prompt_button_find_open_questions: {
|
|
1011
|
+
id: 'fabric.linking.rovo_prompt_button_find_open_questions.non-final',
|
|
1012
|
+
defaultMessage: "Find open questions",
|
|
1013
|
+
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1014
|
+
},
|
|
1015
|
+
rovo_prompt_message_find_open_questions: {
|
|
1016
|
+
id: 'fabric.linking.rovo_prompt_message_find_open_questions.non-final',
|
|
1017
|
+
defaultMessage: '<p>Look at this <a>{url}</a> and list any open questions, unresolved decisions, or asks that still need follow‑up. Group them by owner if possible and keep it concise.</p>',
|
|
1018
|
+
description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
979
1019
|
}
|
|
980
1020
|
});
|
|
@@ -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: "44.
|
|
14
|
+
packageVersion: "44.2.0"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -14,8 +14,13 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _userAgent = require("@atlaskit/linking-common/user-agent");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _constants = require("../../../constants");
|
|
19
|
+
var _extractRovoChatAction = _interopRequireDefault(require("../../../extractors/flexible/actions/extract-rovo-chat-action"));
|
|
20
|
+
var _helpers = require("../../../state/helpers");
|
|
21
|
+
var _useRovoConfig = _interopRequireDefault(require("../../../state/hooks/use-rovo-config"));
|
|
18
22
|
var _FlexibleCard = _interopRequireDefault(require("../../FlexibleCard"));
|
|
23
|
+
var _rovoChatAction = require("../../FlexibleCard/components/actions/rovo-chat-action");
|
|
19
24
|
var _blocks = require("../../FlexibleCard/components/blocks");
|
|
20
25
|
var _utils = require("./utils");
|
|
21
26
|
var _withFlexibleUIBlockCardStyle = require("./utils/withFlexibleUIBlockCardStyle");
|
|
@@ -30,6 +35,7 @@ var footerBlockSafariStyles = null;
|
|
|
30
35
|
* @see FlexibleCardProps
|
|
31
36
|
*/
|
|
32
37
|
var ResolvedView = function ResolvedView(_ref) {
|
|
38
|
+
var _cardState$details2;
|
|
33
39
|
var cardState = _ref.cardState,
|
|
34
40
|
onClick = _ref.onClick,
|
|
35
41
|
onError = _ref.onError,
|
|
@@ -44,6 +50,19 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
44
50
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
45
51
|
isPreviewBlockErrored = _useState2[0],
|
|
46
52
|
setIsPreviewBlockErrored = _useState2[1];
|
|
53
|
+
var extensionKey = (0, _helpers.getExtensionKey)(cardState.details);
|
|
54
|
+
var rovoConfig = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ?
|
|
55
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
56
|
+
(0, _useRovoConfig.default)() : undefined;
|
|
57
|
+
var showRovoResolvedView = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ?
|
|
58
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
59
|
+
(0, _react.useMemo)(function () {
|
|
60
|
+
return (cardState === null || cardState === void 0 ? void 0 : cardState.status) === 'resolved' && cardState.details && (0, _extractRovoChatAction.default)({
|
|
61
|
+
response: cardState.details,
|
|
62
|
+
rovoConfig: rovoConfig,
|
|
63
|
+
actionOptions: actionOptions
|
|
64
|
+
}) !== undefined;
|
|
65
|
+
}, [actionOptions, cardState === null || cardState === void 0 ? void 0 : cardState.details, cardState === null || cardState === void 0 ? void 0 : cardState.status, rovoConfig]) : undefined;
|
|
47
66
|
|
|
48
67
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
49
68
|
var _useMemo = (0, _react.useMemo)(function () {
|
|
@@ -58,8 +77,35 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
58
77
|
titleMetadata = _getSimulatedBetterMe.titleMetadata,
|
|
59
78
|
topMetadata = _getSimulatedBetterMe.topMetadata,
|
|
60
79
|
bottomMetadata = _getSimulatedBetterMe.bottomMetadata;
|
|
80
|
+
var prompts = (0, _react.useMemo)(function () {
|
|
81
|
+
if ((0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch')) {
|
|
82
|
+
var _cardState$details;
|
|
83
|
+
var defaultPrompts = [_rovoChatAction.RovoChatPromptKey.HIGHLIGHT_RELEVANT_CONTENT, _rovoChatAction.RovoChatPromptKey.ASK_ROVO_ANYTHING];
|
|
84
|
+
var linkType = (_cardState$details = cardState.details) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.data) === null || _cardState$details === void 0 ? void 0 : _cardState$details['@type'];
|
|
85
|
+
if (extensionKey === 'slack-object-provider') {
|
|
86
|
+
return [_rovoChatAction.RovoChatPromptKey.FIND_OPEN_QUESTIONS].concat(defaultPrompts);
|
|
87
|
+
}
|
|
88
|
+
if (extensionKey === 'google-object-provider' && linkType !== null && linkType !== void 0 && linkType.includes('schema:PresentationDigitalDocument')) {
|
|
89
|
+
return [_rovoChatAction.RovoChatPromptKey.IDENTIFY_KEY_POINTS].concat(defaultPrompts);
|
|
90
|
+
}
|
|
91
|
+
if (extensionKey === 'google-object-provider' && linkType !== null && linkType !== void 0 && linkType.includes('schema:SpreadsheetDigitalDocument')) {
|
|
92
|
+
return [_rovoChatAction.RovoChatPromptKey.IDENTIFY_KEY_TRENDS].concat(defaultPrompts);
|
|
93
|
+
}
|
|
94
|
+
return [_rovoChatAction.RovoChatPromptKey.SUMMARIZE_LINK].concat(defaultPrompts);
|
|
95
|
+
}
|
|
96
|
+
return [];
|
|
97
|
+
}, [cardState === null || cardState === void 0 || (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data, extensionKey]);
|
|
61
98
|
var footerActions = (0, _react.useMemo)(function () {
|
|
62
|
-
return [{
|
|
99
|
+
return showRovoResolvedView && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? [{
|
|
100
|
+
name: _constants.ActionName.RovoChatAction,
|
|
101
|
+
prompts: prompts
|
|
102
|
+
}, {
|
|
103
|
+
name: _constants.ActionName.FollowAction,
|
|
104
|
+
hideIcon: true
|
|
105
|
+
}, {
|
|
106
|
+
name: _constants.ActionName.DownloadAction,
|
|
107
|
+
hideIcon: true
|
|
108
|
+
}] : [{
|
|
63
109
|
name: _constants.ActionName.FollowAction,
|
|
64
110
|
hideIcon: true
|
|
65
111
|
}, {
|
|
@@ -69,7 +115,7 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
69
115
|
name: _constants.ActionName.DownloadAction,
|
|
70
116
|
hideIcon: true
|
|
71
117
|
}];
|
|
72
|
-
}, []);
|
|
118
|
+
}, [showRovoResolvedView, prompts]);
|
|
73
119
|
var uiOptions = _utils.FlexibleCardUiOptions;
|
|
74
120
|
uiOptions.enableSnippetRenderer = true;
|
|
75
121
|
uiOptions.hideLoadingSkeleton = hideIconLoadingSkeleton;
|
|
@@ -13,6 +13,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _reactIntl = require("react-intl");
|
|
16
|
+
var _aiGenerativeText = _interopRequireDefault(require("@atlaskit/icon-lab/core/ai-generative-text"));
|
|
16
17
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
17
18
|
var _constants = require("../../../../../constants");
|
|
18
19
|
var _messages = require("../../../../../messages");
|
|
@@ -35,6 +36,10 @@ var RovoChatPromptKey = exports.RovoChatPromptKey = /*#__PURE__*/function (RovoC
|
|
|
35
36
|
RovoChatPromptKey["SUMMARIZE_LINK"] = "summarize-link";
|
|
36
37
|
RovoChatPromptKey["KEY_HIGHLIGHTS"] = "key-highlights";
|
|
37
38
|
RovoChatPromptKey["ASK_ROVO_ANYTHING"] = "ask-rovo-anything";
|
|
39
|
+
RovoChatPromptKey["IDENTIFY_KEY_POINTS"] = "identify-key-points";
|
|
40
|
+
RovoChatPromptKey["IDENTIFY_KEY_TRENDS"] = "identify-key-trends";
|
|
41
|
+
RovoChatPromptKey["FIND_OPEN_QUESTIONS"] = "find-open-questions";
|
|
42
|
+
RovoChatPromptKey["HIGHLIGHT_RELEVANT_CONTENT"] = "highlight-relevant-content";
|
|
38
43
|
return RovoChatPromptKey;
|
|
39
44
|
}({});
|
|
40
45
|
var GOOGLE_PROMPTS = [RovoChatPromptKey.RECOMMEND_OTHER_SOURCES, RovoChatPromptKey.SHOW_OTHER_MENTIONS, RovoChatPromptKey.SUGGEST_IMPROVEMENT];
|
|
@@ -183,6 +188,83 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
183
188
|
placeholderType: 'generic'
|
|
184
189
|
}
|
|
185
190
|
};
|
|
191
|
+
case RovoChatPromptKey.HIGHLIGHT_RELEVANT_CONTENT:
|
|
192
|
+
var label_highlight_relevant_content = intl.formatMessage(_messages.messages.rovo_prompt_button_highlight_relevant_content);
|
|
193
|
+
var html_highlight_relevant_content = intl.formatMessage(_messages.messages.rovo_prompt_message_highlight_relevant_content, {
|
|
194
|
+
context: contextLong,
|
|
195
|
+
url: url
|
|
196
|
+
}, {
|
|
197
|
+
ignoreTag: true
|
|
198
|
+
});
|
|
199
|
+
return {
|
|
200
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiGenerativeText.default, {
|
|
201
|
+
label: label_highlight_relevant_content
|
|
202
|
+
}),
|
|
203
|
+
content: label_highlight_relevant_content,
|
|
204
|
+
tooltipMessage: label_highlight_relevant_content,
|
|
205
|
+
data: {
|
|
206
|
+
name: label_highlight_relevant_content,
|
|
207
|
+
dialogues: [],
|
|
208
|
+
prompt: (0, _htmlToAdf.default)(html_highlight_relevant_content)
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
case RovoChatPromptKey.IDENTIFY_KEY_TRENDS:
|
|
212
|
+
var label_identify_key_trends = intl.formatMessage(_messages.messages.rovo_prompt_button_identify_key_trends);
|
|
213
|
+
var html_identify_key_trends = intl.formatMessage(_messages.messages.rovo_prompt_message_identify_key_trends, {
|
|
214
|
+
url: url
|
|
215
|
+
}, {
|
|
216
|
+
ignoreTag: true
|
|
217
|
+
});
|
|
218
|
+
return {
|
|
219
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiGenerativeText.default, {
|
|
220
|
+
label: label_identify_key_trends
|
|
221
|
+
}),
|
|
222
|
+
content: label_identify_key_trends,
|
|
223
|
+
tooltipMessage: label_identify_key_trends,
|
|
224
|
+
data: {
|
|
225
|
+
name: label_identify_key_trends,
|
|
226
|
+
dialogues: [],
|
|
227
|
+
prompt: (0, _htmlToAdf.default)(html_identify_key_trends)
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
case RovoChatPromptKey.IDENTIFY_KEY_POINTS:
|
|
231
|
+
var label_identify_key_points = intl.formatMessage(_messages.messages.rovo_prompt_button_identify_key_points);
|
|
232
|
+
var html_identify_key_points = intl.formatMessage(_messages.messages.rovo_prompt_message_identify_key_points, {
|
|
233
|
+
url: url
|
|
234
|
+
}, {
|
|
235
|
+
ignoreTag: true
|
|
236
|
+
});
|
|
237
|
+
return {
|
|
238
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiGenerativeText.default, {
|
|
239
|
+
label: label_identify_key_points
|
|
240
|
+
}),
|
|
241
|
+
content: label_identify_key_points,
|
|
242
|
+
tooltipMessage: label_identify_key_points,
|
|
243
|
+
data: {
|
|
244
|
+
name: label_identify_key_points,
|
|
245
|
+
dialogues: [],
|
|
246
|
+
prompt: (0, _htmlToAdf.default)(html_identify_key_points)
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
case RovoChatPromptKey.FIND_OPEN_QUESTIONS:
|
|
250
|
+
var label_find_open_questions = intl.formatMessage(_messages.messages.rovo_prompt_button_find_open_questions);
|
|
251
|
+
var html_find_open_questions = intl.formatMessage(_messages.messages.rovo_prompt_message_find_open_questions, {
|
|
252
|
+
url: url
|
|
253
|
+
}, {
|
|
254
|
+
ignoreTag: true
|
|
255
|
+
});
|
|
256
|
+
return {
|
|
257
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiGenerativeText.default, {
|
|
258
|
+
label: label_find_open_questions
|
|
259
|
+
}),
|
|
260
|
+
content: label_find_open_questions,
|
|
261
|
+
tooltipMessage: label_find_open_questions,
|
|
262
|
+
data: {
|
|
263
|
+
name: label_find_open_questions,
|
|
264
|
+
dialogues: [],
|
|
265
|
+
prompt: (0, _htmlToAdf.default)(html_find_open_questions)
|
|
266
|
+
}
|
|
267
|
+
};
|
|
186
268
|
}
|
|
187
269
|
};
|
|
188
270
|
var RovoChatAction = function RovoChatAction(_ref2) {
|
|
@@ -197,7 +279,7 @@ var RovoChatAction = function RovoChatAction(_ref2) {
|
|
|
197
279
|
isRovoChatEnabled = _useRovoChat.isRovoChatEnabled,
|
|
198
280
|
sendPromptMessage = _useRovoChat.sendPromptMessage;
|
|
199
281
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
200
|
-
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.
|
|
282
|
+
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.RovoChatAction];
|
|
201
283
|
var resolvedPrompts = (0, _react.useMemo)(function () {
|
|
202
284
|
var _data$invokeAction;
|
|
203
285
|
if (prompts) {
|
|
@@ -62,7 +62,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
62
62
|
isAny3pRovoActionsExperimentOn = _ref.isAny3pRovoActionsExperimentOn;
|
|
63
63
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
64
64
|
var ui = (0, _flexibleUiContext.useFlexibleUiOptionContext)();
|
|
65
|
-
var isRovoChatActionAvailable = ((0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg')) && isAny3pRovoActionsExperimentOn ? (context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.
|
|
65
|
+
var isRovoChatActionAvailable = ((0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg')) && isAny3pRovoActionsExperimentOn ? (context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.RovoChatAction]) !== undefined : undefined;
|
|
66
66
|
var _useState = (0, _react.useState)(),
|
|
67
67
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
68
68
|
message = _useState2[0],
|
|
@@ -86,8 +86,8 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
86
86
|
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
var arr = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') ? isRovoChatActionAvailable ? [_constants.
|
|
90
|
-
return name !== _constants.
|
|
89
|
+
var arr = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') ? isRovoChatActionAvailable ? [_constants.ActionName.RovoChatAction] : Object.keys(context.actions).filter(function (name) {
|
|
90
|
+
return name !== _constants.ActionName.RovoChatAction;
|
|
91
91
|
}) : Object.keys(context.actions);
|
|
92
92
|
arr.sort(sort);
|
|
93
93
|
var renderAction = function renderAction(name) {
|
|
@@ -13,6 +13,7 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
16
17
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
18
|
var _reactIntl = require("react-intl");
|
|
18
19
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
@@ -20,6 +21,7 @@ var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group
|
|
|
20
21
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
21
22
|
var _dropdownMenu = _interopRequireDefault(require("@atlaskit/dropdown-menu"));
|
|
22
23
|
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
24
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
25
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
24
26
|
var _constants = require("../../../../../constants");
|
|
25
27
|
var _messages = require("../../../../../messages");
|
|
@@ -57,6 +59,7 @@ var renderActionItems = function renderActionItems() {
|
|
|
57
59
|
* @see Action
|
|
58
60
|
*/
|
|
59
61
|
var ActionGroup = function ActionGroup(_ref) {
|
|
62
|
+
var _context$actions;
|
|
60
63
|
var _ref$items = _ref.items,
|
|
61
64
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
62
65
|
_ref$size = _ref.size,
|
|
@@ -75,6 +78,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
75
78
|
return (0, _utils2.filterActionItems)(items, context);
|
|
76
79
|
}, [context, items]);
|
|
77
80
|
var isMoreThenTwoItems = renderableActionItems.length > visibleButtonsNum;
|
|
81
|
+
var isRovoActionsEnabled = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[_constants.ActionName.RovoChatAction]);
|
|
78
82
|
var onOpenChange = (0, _react.useCallback)(function (attrs) {
|
|
79
83
|
setIsOpen(attrs.isOpen);
|
|
80
84
|
if (onDropdownOpenChange) {
|
|
@@ -89,11 +93,21 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
89
93
|
}
|
|
90
94
|
}, [isOpen, onOpenChange]);
|
|
91
95
|
var actionButtons = (0, _react.useMemo)(function () {
|
|
96
|
+
if (isRovoActionsEnabled && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch')) {
|
|
97
|
+
var rovoActions = [].concat((0, _toConsumableArray2.default)(renderableActionItems.slice(0, visibleButtonsNum - 1)), [{
|
|
98
|
+
name: _constants.ActionName.PreviewAction,
|
|
99
|
+
hideContent: true
|
|
100
|
+
}, {
|
|
101
|
+
name: _constants.ActionName.CopyLinkAction,
|
|
102
|
+
hideContent: true
|
|
103
|
+
}]);
|
|
104
|
+
return renderActionItems(rovoActions, size, appearance, false, onActionItemClick);
|
|
105
|
+
}
|
|
92
106
|
var actionItems = isMoreThenTwoItems ? renderableActionItems.slice(0, visibleButtonsNum - 1) : renderableActionItems;
|
|
93
107
|
return renderActionItems(actionItems, size, appearance, false, onActionItemClick);
|
|
94
|
-
}, [appearance, isMoreThenTwoItems, onActionItemClick, renderableActionItems, size, visibleButtonsNum]);
|
|
108
|
+
}, [appearance, isMoreThenTwoItems, onActionItemClick, renderableActionItems, size, visibleButtonsNum, isRovoActionsEnabled]);
|
|
95
109
|
var moreActionDropdown = (0, _react.useMemo)(function () {
|
|
96
|
-
var actionItems = isMoreThenTwoItems ? renderableActionItems.slice(visibleButtonsNum - 1) : [];
|
|
110
|
+
var actionItems = isMoreThenTwoItems || isRovoActionsEnabled && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? renderableActionItems.slice(visibleButtonsNum - 1) : [];
|
|
97
111
|
if (actionItems.length > 0) {
|
|
98
112
|
var spacing = _utils.sizeToButtonSpacing[size];
|
|
99
113
|
var moreIcon = /*#__PURE__*/React.createElement(_showMoreHorizontal.default, {
|
|
@@ -117,14 +131,16 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
117
131
|
testId: "action-group-more-button",
|
|
118
132
|
iconBefore: moreIcon,
|
|
119
133
|
ref: triggerRef
|
|
120
|
-
}))
|
|
134
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
135
|
+
appearance: appearance
|
|
136
|
+
} : {})));
|
|
121
137
|
},
|
|
122
138
|
testId: "action-group-dropdown",
|
|
123
139
|
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
124
140
|
}, renderActionItems(actionItems, size, appearance, true, onActionItemClick));
|
|
125
141
|
}
|
|
126
142
|
return null;
|
|
127
|
-
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum]);
|
|
143
|
+
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum, isRovoActionsEnabled]);
|
|
128
144
|
return renderableActionItems.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
129
145
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
130
146
|
className: (0, _runtime.ax)(["_1e0c116y _dzc21h6o _1ilq1i6y", "actions-button-group"]),
|
|
@@ -13,6 +13,7 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _userAgent = require("@atlaskit/linking-common/user-agent");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _constants = require("../../../../../../constants");
|
|
17
18
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
18
19
|
var _elements = require("../../../elements");
|
|
@@ -24,6 +25,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
24
25
|
var actionGroupStyles = null;
|
|
25
26
|
var safariStyles = null;
|
|
26
27
|
var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
28
|
+
var _context$actions;
|
|
27
29
|
var actions = props.actions,
|
|
28
30
|
testId = props.testId,
|
|
29
31
|
onActionMenuOpenChange = props.onActionMenuOpenChange,
|
|
@@ -31,6 +33,7 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
|
31
33
|
size = _props$size === void 0 ? _constants.SmartLinkSize.Medium : _props$size,
|
|
32
34
|
hideProvider = props.hideProvider;
|
|
33
35
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
36
|
+
var isRovoSupportedFeature = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[_constants.ActionName.RovoChatAction]);
|
|
34
37
|
var hasActions = (0, _react.useMemo)(function () {
|
|
35
38
|
var _filterActionItems;
|
|
36
39
|
return ((_filterActionItems = (0, _utils.filterActionItems)(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
@@ -63,7 +66,7 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
|
63
66
|
}, /*#__PURE__*/React.createElement(_actionGroup.default, {
|
|
64
67
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
65
68
|
items: actions,
|
|
66
|
-
appearance:
|
|
69
|
+
appearance: isRovoSupportedFeature && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? 'subtle' : 'default',
|
|
67
70
|
size: size
|
|
68
71
|
})) : null);
|
|
69
72
|
};
|
|
@@ -24,7 +24,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
24
24
|
* Allowed footer actions for HoverCard, in display order. Fetched from context.
|
|
25
25
|
* @featureGate platform_sl_3p_auth_rovo_action_kill_switch
|
|
26
26
|
*/
|
|
27
|
-
var HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [_constants.
|
|
27
|
+
var HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [_constants.ActionName.RovoChatAction];
|
|
28
28
|
var ignoreContainerMarginStyles = null;
|
|
29
29
|
var elevatedFooterStyles = null;
|
|
30
30
|
var providerStyles = null;
|
|
@@ -11,6 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _constants = require("../../../../constants");
|
|
15
16
|
var _flexible = require("../../../../utils/flexible");
|
|
16
17
|
var Elements = _interopRequireWildcard(require("../elements"));
|
|
@@ -64,6 +65,16 @@ var filterActionItems = exports.filterActionItems = function filterActionItems()
|
|
|
64
65
|
case _constants.ActionName.CustomAction:
|
|
65
66
|
// Named and custom actions that user defines.
|
|
66
67
|
return Boolean(_constants.ActionName[item.name]);
|
|
68
|
+
case _constants.ActionName.RovoChatAction:
|
|
69
|
+
if ((0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch')) {
|
|
70
|
+
return Boolean(_constants.ActionName[item.name]);
|
|
71
|
+
}
|
|
72
|
+
// same as default case below
|
|
73
|
+
// remove on cleanup of platform_sl_3p_auth_rovo_block_card_kill_switch
|
|
74
|
+
if ((context === null || context === void 0 ? void 0 : context.actions) === undefined) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return Boolean(item.name in context.actions ? context.actions[item.name] : undefined);
|
|
67
78
|
default:
|
|
68
79
|
// Action that require data from the data context to render.
|
|
69
80
|
if ((context === null || context === void 0 ? void 0 : context.actions) === undefined) {
|
|
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
22
22
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
23
23
|
var PACKAGE_DATA = {
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "44.
|
|
25
|
+
packageVersion: "44.2.0",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
28
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
package/dist/es2019/constants.js
CHANGED
|
@@ -159,11 +159,11 @@ export let ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
159
159
|
ActionName["AutomationAction"] = "AutomationAction";
|
|
160
160
|
ActionName["DownloadAction"] = "DownloadAction";
|
|
161
161
|
ActionName["CustomAction"] = "CustomAction";
|
|
162
|
+
ActionName["RovoChatAction"] = "RovoChatAction";
|
|
162
163
|
return ActionName;
|
|
163
164
|
}({});
|
|
164
165
|
export let InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
165
166
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
166
|
-
InternalActionName["RovoChatAction"] = "RovoChatAction";
|
|
167
167
|
InternalActionName["UnresolvedAction"] = "UnresolvedAction";
|
|
168
168
|
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
169
169
|
return InternalActionName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import {
|
|
3
|
+
import { ActionName } from '../../../constants';
|
|
4
4
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../../state/helpers';
|
|
5
5
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
6
6
|
import { getIsRovoChatEnabled } from '../../../utils/rovo';
|
|
@@ -25,13 +25,14 @@ const extractRovoChatAction = ({
|
|
|
25
25
|
const isGoogleProvider = getExtensionKey(response) === 'google-object-provider';
|
|
26
26
|
const is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
27
27
|
const is3PInlinePostAuthActionsEnabled = !isGoogleProvider && fg('rovogrowth-640-inline-action-nudge-fg');
|
|
28
|
-
const
|
|
28
|
+
const is3PBlockPostAuthActionsEnabled = supportsRovoActions && fg('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
29
|
+
const isSupportedFeature = supportsRovoActions && is3PInlinePostAuthActionsEnabled || is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
|
|
29
30
|
const isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
30
31
|
const url = extractSmartLinkUrl(response);
|
|
31
32
|
return isSupportedFeature && isOptIn ? {
|
|
32
33
|
invokeAction: {
|
|
33
34
|
actionSubjectId: 'rovoChatPrompt',
|
|
34
|
-
actionType:
|
|
35
|
+
actionType: ActionName.RovoChatAction,
|
|
35
36
|
definitionId: getDefinitionId(response),
|
|
36
37
|
display: appearance,
|
|
37
38
|
extensionKey: getExtensionKey(response),
|
|
@@ -49,7 +49,7 @@ export const extractFlexibleCardActions = ({
|
|
|
49
49
|
[ActionName.AutomationAction]: extractAutomationAction(response),
|
|
50
50
|
[InternalActionName.AISummaryAction]: extractAISummaryAction(response, url, actionOptions, aiSummaryConfig),
|
|
51
51
|
...(fg('platform_sl_3p_auth_rovo_action_kill_switch') || fg('rovogrowth-640-inline-action-nudge-fg') ? {
|
|
52
|
-
[
|
|
52
|
+
[ActionName.RovoChatAction]: extractRovoChatAction({
|
|
53
53
|
actionOptions,
|
|
54
54
|
appearance,
|
|
55
55
|
id,
|
package/dist/es2019/messages.js
CHANGED
|
@@ -970,5 +970,45 @@ export const messages = defineMessages({
|
|
|
970
970
|
id: 'fabric.linking.rovo_prompt_message_ask_rovo_anything.non-final',
|
|
971
971
|
defaultMessage: '`I have a question about this linked item` {url}',
|
|
972
972
|
description: 'The placeholder prompt message pre-filled in Rovo Chat input. {url} refers to the Smart Link URL. This is not auto-submitted — the user types their question.'
|
|
973
|
+
},
|
|
974
|
+
rovo_prompt_button_highlight_relevant_content: {
|
|
975
|
+
id: 'fabric.linking.rovo_prompt_button_highlight_relevant_content.non-final',
|
|
976
|
+
defaultMessage: `Highlight what's relevant`,
|
|
977
|
+
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
978
|
+
},
|
|
979
|
+
rovo_prompt_message_highlight_relevant_content: {
|
|
980
|
+
id: 'fabric.linking.rovo_prompt_message_highlight_relevant_content.non-final',
|
|
981
|
+
defaultMessage: '<p>Based on this linked item (<a>{url}</a>) and the {context} I’m currently viewing, highlight the parts of the linked content that are most relevant to this work. Explain briefly why each part is relevant.</p>',
|
|
982
|
+
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
983
|
+
},
|
|
984
|
+
rovo_prompt_button_identify_key_trends: {
|
|
985
|
+
id: 'fabric.linking.rovo_prompt_button_identify_key_trends.non-final',
|
|
986
|
+
defaultMessage: `Identify key trends`,
|
|
987
|
+
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
988
|
+
},
|
|
989
|
+
rovo_prompt_message_identify_key_trends: {
|
|
990
|
+
id: 'fabric.linking.rovo_prompt_message_identify_key_trends.non-final',
|
|
991
|
+
defaultMessage: '<p>From this <a>{url}</a>, identify the key trends, anomalies, and headline numbers. Call out anything increasing/decreasing significantly, noteworthy comparisons, and any risks or opportunities the data suggests.</p>',
|
|
992
|
+
description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
993
|
+
},
|
|
994
|
+
rovo_prompt_button_identify_key_points: {
|
|
995
|
+
id: 'fabric.linking.rovo_prompt_button_identify_key_points.non-final',
|
|
996
|
+
defaultMessage: `Identify key points`,
|
|
997
|
+
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
998
|
+
},
|
|
999
|
+
rovo_prompt_message_identify_key_points: {
|
|
1000
|
+
id: 'fabric.linking.rovo_prompt_message_identify_key_points.non-final',
|
|
1001
|
+
defaultMessage: '<p>From this <a>{url}</a>, identify the key points, proposals, and decisions. Focus on what someone skimming the deck should know in order to understand the main message.</p>',
|
|
1002
|
+
description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
1003
|
+
},
|
|
1004
|
+
rovo_prompt_button_find_open_questions: {
|
|
1005
|
+
id: 'fabric.linking.rovo_prompt_button_find_open_questions.non-final',
|
|
1006
|
+
defaultMessage: `Find open questions`,
|
|
1007
|
+
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1008
|
+
},
|
|
1009
|
+
rovo_prompt_message_find_open_questions: {
|
|
1010
|
+
id: 'fabric.linking.rovo_prompt_message_find_open_questions.non-final',
|
|
1011
|
+
defaultMessage: '<p>Look at this <a>{url}</a> and list any open questions, unresolved decisions, or asks that still need follow‑up. Group them by owner if possible and keep it concise.</p>',
|
|
1012
|
+
description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
973
1013
|
}
|
|
974
1014
|
});
|