@atlaskit/smart-card 44.21.0 → 44.23.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/state/hooks/use-inline-tailored-action-experiment/index.js +55 -0
- package/dist/cjs/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +18 -7
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +6 -6
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +15 -337
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +3 -3
- package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +10 -1
- package/dist/cjs/view/InlineCard/common/rovo-actions-cta/index.js +43 -5
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/rovo-chat-utils/index.js +332 -0
- package/dist/es2019/state/hooks/use-inline-tailored-action-experiment/index.js +49 -0
- package/dist/es2019/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +13 -5
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +2 -321
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -1
- package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +12 -2
- package/dist/es2019/view/InlineCard/common/rovo-actions-cta/index.js +44 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/rovo-chat-utils/index.js +322 -0
- package/dist/esm/state/hooks/use-inline-tailored-action-experiment/index.js +48 -0
- package/dist/esm/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +17 -7
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +13 -335
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +1 -1
- package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +11 -2
- package/dist/esm/view/InlineCard/common/rovo-actions-cta/index.js +41 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/rovo-chat-utils/index.js +325 -0
- package/dist/types/state/hooks/use-inline-tailored-action-experiment/index.d.ts +24 -0
- package/dist/types/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +1 -15
- package/dist/types/view/InlineCard/common/rovo-actions-cta/index.d.ts +4 -4
- package/dist/types/view/common/rovo-chat-utils/index.d.ts +25 -0
- package/dist/types-ts4.5/state/hooks/use-inline-tailored-action-experiment/index.d.ts +24 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +1 -15
- package/dist/types-ts4.5/view/InlineCard/common/rovo-actions-cta/index.d.ts +4 -4
- package/dist/types-ts4.5/view/common/rovo-chat-utils/index.d.ts +25 -0
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 44.23.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`d890e9e688ce5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d890e9e688ce5) -
|
|
8
|
+
Exposed subproduct and product for jira and townsquare
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 44.22.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [`be7cb592d8951`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be7cb592d8951) -
|
|
19
|
+
NAVX-5108 Implementing UI for new inline tailored rovo cta
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 44.21.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -0,0 +1,55 @@
|
|
|
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("react");
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
|
+
var _rovo = require("../../../utils/rovo");
|
|
12
|
+
var _helpers = require("../../helpers");
|
|
13
|
+
var _store = require("../../store");
|
|
14
|
+
var _useRovoConfig2 = _interopRequireDefault(require("../use-rovo-config"));
|
|
15
|
+
var ELIGIBLE_EXTENSION_KEYS = new Set(['slack-object-provider', 'google-object-provider', 'onedrive-object-provider', 'github-object-provider', 'ms-teams-object-provider', 'gitlab-object-provider', 'salesforce-object-provider']);
|
|
16
|
+
var NOT_ENABLED_RESULT = {
|
|
17
|
+
isEnabled: false
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns whether the platform_sl_3p_auth_inline_tailored_cta experiment
|
|
22
|
+
* is enabled for the current user and link context.
|
|
23
|
+
*
|
|
24
|
+
* All eligibility criteria are consolidated here:
|
|
25
|
+
* 1. Rovo chat must be enabled for the tenant.
|
|
26
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
27
|
+
* 3. The link must support the RovoActions feature.
|
|
28
|
+
* 4. The extension key must be one of the supported options.
|
|
29
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
30
|
+
*
|
|
31
|
+
* The extension key is derived from the card store via the resolved URL,
|
|
32
|
+
* so callers don't need to thread it as a prop.
|
|
33
|
+
*/
|
|
34
|
+
var useInlineTailoredActionExperiment = function useInlineTailoredActionExperiment(url, showHoverPreview, actionOptions) {
|
|
35
|
+
var _actionOptions$rovoCh, _actionOptions$rovoCh2;
|
|
36
|
+
var _useRovoConfig = (0, _useRovoConfig2.default)(),
|
|
37
|
+
rovoConfig = _useRovoConfig.rovoOptions;
|
|
38
|
+
var isRovoChatEnabled = (0, _rovo.getIsRovoChatEnabled)(rovoConfig);
|
|
39
|
+
var cardState = (0, _store.useSmartCardState)(url !== null && url !== void 0 ? url : '');
|
|
40
|
+
var extensionKey = (0, _helpers.getExtensionKey)(cardState.details);
|
|
41
|
+
var isRovoChatActionOptedIn = (_actionOptions$rovoCh = actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh2 = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh2 === void 0 ? void 0 : _actionOptions$rovoCh2.optIn) !== null && _actionOptions$rovoCh !== void 0 ? _actionOptions$rovoCh : false;
|
|
42
|
+
return (0, _react.useMemo)(function () {
|
|
43
|
+
if (!isRovoChatEnabled || !showHoverPreview || !url || !isRovoChatActionOptedIn) {
|
|
44
|
+
return NOT_ENABLED_RESULT;
|
|
45
|
+
}
|
|
46
|
+
if (!extensionKey || !ELIGIBLE_EXTENSION_KEYS.has(extensionKey)) {
|
|
47
|
+
return NOT_ENABLED_RESULT;
|
|
48
|
+
}
|
|
49
|
+
var isEnabled = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_inline_tailored_cta_killswitch') && (0, _expValEquals.expValEquals)('platform_sl_3p_auth_inline_tailored_cta', 'isEnabled', true);
|
|
50
|
+
return {
|
|
51
|
+
isEnabled: isEnabled
|
|
52
|
+
};
|
|
53
|
+
}, [isRovoChatEnabled, extensionKey, showHoverPreview, url, isRovoChatActionOptedIn]);
|
|
54
|
+
};
|
|
55
|
+
var _default = exports.default = useInlineTailoredActionExperiment;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.useSmartLinkCrossProductUrlWrapperGated = exports.getIsFirstPartyLink = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _react = require("react");
|
|
8
10
|
var _useCrossProductUrlWrapper = require("@atlaskit/analytics-cross-product/useCrossProductUrlWrapper");
|
|
9
11
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
10
12
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
11
15
|
var SMART_LINKS_XPC_BRIDGE = 'smartLinks';
|
|
12
16
|
var XPC_QUERY_PARAM = 'xpis';
|
|
13
17
|
var getIsFirstPartyLink = exports.getIsFirstPartyLink = function getIsFirstPartyLink(details) {
|
|
@@ -21,17 +25,24 @@ var useSmartLinkCrossProductUrlWrapperFallback = function useSmartLinkCrossProdu
|
|
|
21
25
|
return identityUrlWrapper;
|
|
22
26
|
};
|
|
23
27
|
var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProductUrlWrapper(_ref) {
|
|
24
|
-
var
|
|
28
|
+
var _effectiveProduct$toL;
|
|
25
29
|
var details = _ref.details;
|
|
26
30
|
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
27
31
|
product = _useSmartLinkContext.product,
|
|
28
|
-
bridgeProduct = _useSmartLinkContext.bridgeProduct
|
|
29
|
-
|
|
32
|
+
bridgeProduct = _useSmartLinkContext.bridgeProduct,
|
|
33
|
+
xpcProduct = _useSmartLinkContext.xpcProduct,
|
|
34
|
+
xpcSubProduct = _useSmartLinkContext.xpcSubProduct;
|
|
35
|
+
// xpcProduct takes precedence over product — it identifies the host product for XPC analytics
|
|
36
|
+
// without affecting link resolution (which uses the `product` prop separately).
|
|
37
|
+
var effectiveProduct = xpcProduct !== null && xpcProduct !== void 0 ? xpcProduct : product;
|
|
38
|
+
var wrapUrl = (0, _useCrossProductUrlWrapper.useCrossProductUrlWrapper)(_objectSpread({
|
|
30
39
|
bridge: bridgeProduct !== null && bridgeProduct !== void 0 ? bridgeProduct : SMART_LINKS_XPC_BRIDGE,
|
|
31
|
-
product: (
|
|
32
|
-
}
|
|
40
|
+
product: (_effectiveProduct$toL = effectiveProduct === null || effectiveProduct === void 0 ? void 0 : effectiveProduct.toLowerCase()) !== null && _effectiveProduct$toL !== void 0 ? _effectiveProduct$toL : 'unknown'
|
|
41
|
+
}, xpcSubProduct ? {
|
|
42
|
+
subProduct: xpcSubProduct
|
|
43
|
+
} : {}));
|
|
33
44
|
return (0, _react.useCallback)(function (url) {
|
|
34
|
-
if (!getIsFirstPartyLink(details) || !
|
|
45
|
+
if (!getIsFirstPartyLink(details) || !effectiveProduct) {
|
|
35
46
|
return url;
|
|
36
47
|
}
|
|
37
48
|
var parsedUrl;
|
|
@@ -44,6 +55,6 @@ var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProductUrlWra
|
|
|
44
55
|
return url;
|
|
45
56
|
}
|
|
46
57
|
return wrapUrl(url);
|
|
47
|
-
}, [details,
|
|
58
|
+
}, [details, effectiveProduct, wrapUrl]);
|
|
48
59
|
};
|
|
49
60
|
var useSmartLinkCrossProductUrlWrapperGated = exports.useSmartLinkCrossProductUrlWrapperGated = (0, _platformFeatureFlagsReact.functionWithFG)('platform_smartlink_xpc_url_wrapping', useSmartLinkCrossProductUrlWrapper, useSmartLinkCrossProductUrlWrapperFallback);
|
|
@@ -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.22.0" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -20,8 +20,8 @@ var _extractRovoChatAction = _interopRequireDefault(require("../../../extractors
|
|
|
20
20
|
var _helpers = require("../../../state/helpers");
|
|
21
21
|
var _useBlockCardRovoActionExperiment = _interopRequireDefault(require("../../../state/hooks/use-block-card-rovo-action-experiment"));
|
|
22
22
|
var _useRovoConfig = _interopRequireDefault(require("../../../state/hooks/use-rovo-config"));
|
|
23
|
+
var _rovoChatUtils = require("../../common/rovo-chat-utils");
|
|
23
24
|
var _FlexibleCard = _interopRequireDefault(require("../../FlexibleCard"));
|
|
24
|
-
var _rovoChatAction = require("../../FlexibleCard/components/actions/rovo-chat-action");
|
|
25
25
|
var _blocks = require("../../FlexibleCard/components/blocks");
|
|
26
26
|
var _utils = require("./utils");
|
|
27
27
|
var _withFlexibleUIBlockCardStyle = require("./utils/withFlexibleUIBlockCardStyle");
|
|
@@ -86,18 +86,18 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
86
86
|
var prompts = (0, _react.useMemo)(function () {
|
|
87
87
|
if (is3PRovoBlockExperimentEnabled) {
|
|
88
88
|
var _cardState$details;
|
|
89
|
-
var defaultPrompts = [
|
|
89
|
+
var defaultPrompts = [_rovoChatUtils.RovoChatPromptKey.KEY_HIGHLIGHTS];
|
|
90
90
|
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'];
|
|
91
91
|
if (extensionKey === 'slack-object-provider') {
|
|
92
|
-
return [
|
|
92
|
+
return [_rovoChatUtils.RovoChatPromptKey.FIND_OPEN_QUESTIONS].concat(defaultPrompts);
|
|
93
93
|
}
|
|
94
94
|
if (extensionKey === 'google-object-provider' && linkType !== null && linkType !== void 0 && linkType.includes('schema:PresentationDigitalDocument')) {
|
|
95
|
-
return [
|
|
95
|
+
return [_rovoChatUtils.RovoChatPromptKey.IDENTIFY_KEY_POINTS].concat(defaultPrompts);
|
|
96
96
|
}
|
|
97
97
|
if (extensionKey === 'google-object-provider' && linkType !== null && linkType !== void 0 && linkType.includes('schema:SpreadsheetDigitalDocument')) {
|
|
98
|
-
return [
|
|
98
|
+
return [_rovoChatUtils.RovoChatPromptKey.IDENTIFY_KEY_TRENDS].concat(defaultPrompts);
|
|
99
99
|
}
|
|
100
|
-
return [
|
|
100
|
+
return [_rovoChatUtils.RovoChatPromptKey.SUMMARIZE_LINK].concat(defaultPrompts);
|
|
101
101
|
}
|
|
102
102
|
return [];
|
|
103
103
|
}, [cardState === null || cardState === void 0 || (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data, extensionKey, is3PRovoBlockExperimentEnabled]);
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -13,351 +13,29 @@ 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 _aiSearch = _interopRequireDefault(require("@atlaskit/icon-lab/core/ai-search"));
|
|
17
|
-
var _aiChat = _interopRequireDefault(require("@atlaskit/icon/core/ai-chat"));
|
|
18
|
-
var _aiGenerativeTextSummary = _interopRequireDefault(require("@atlaskit/icon/core/ai-generative-text-summary"));
|
|
19
|
-
var _rovoChat = _interopRequireDefault(require("@atlaskit/icon/core/rovo-chat"));
|
|
20
|
-
var _logo = require("@atlaskit/logo");
|
|
21
16
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
22
17
|
var _constants = require("../../../../../constants");
|
|
23
|
-
var _messages = require("../../../../../messages");
|
|
24
18
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
25
|
-
var _useBlockCardRovoActionExperiment = require("../../../../../state/hooks/use-block-card-rovo-action-experiment");
|
|
26
19
|
var _useInvokeClientAction = _interopRequireDefault(require("../../../../../state/hooks/use-invoke-client-action"));
|
|
27
20
|
var _useRovoChat2 = _interopRequireDefault(require("../../../../../state/hooks/use-rovo-chat"));
|
|
28
|
-
var
|
|
29
|
-
var _aiEditIcon = _interopRequireDefault(require("../../../assets/ai-edit-icon"));
|
|
30
|
-
var _aiSearchIcon = _interopRequireDefault(require("../../../assets/ai-search-icon"));
|
|
21
|
+
var _rovoChatUtils = require("../../../../common/rovo-chat-utils");
|
|
31
22
|
var _action = _interopRequireDefault(require("../action"));
|
|
32
|
-
var _htmlToAdf = _interopRequireDefault(require("./html-to-adf"));
|
|
33
23
|
var _excluded = ["onClick", "prompts", "testId"];
|
|
34
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); }
|
|
35
25
|
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; }
|
|
36
26
|
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; }
|
|
37
|
-
var
|
|
38
|
-
RovoChatPromptKey["RECOMMEND_OTHER_SOURCES"] = "recommend-other-sources";
|
|
39
|
-
RovoChatPromptKey["SHOW_OTHER_MENTIONS"] = "show-other-mentions";
|
|
40
|
-
RovoChatPromptKey["SUGGEST_IMPROVEMENT"] = "suggest-improvement";
|
|
41
|
-
RovoChatPromptKey["SUMMARIZE_LINK"] = "summarize-link";
|
|
42
|
-
RovoChatPromptKey["KEY_HIGHLIGHTS"] = "key-highlights";
|
|
43
|
-
RovoChatPromptKey["ASK_ROVO_ANYTHING"] = "ask-rovo-anything";
|
|
44
|
-
RovoChatPromptKey["IDENTIFY_KEY_POINTS"] = "identify-key-points";
|
|
45
|
-
RovoChatPromptKey["IDENTIFY_KEY_TRENDS"] = "identify-key-trends";
|
|
46
|
-
RovoChatPromptKey["FIND_OPEN_QUESTIONS"] = "find-open-questions";
|
|
47
|
-
RovoChatPromptKey["HIGHLIGHT_RELEVANT_CONTENT"] = "highlight-relevant-content";
|
|
48
|
-
RovoChatPromptKey["SUMMARIZE_THIS_FOR_ME"] = "summarize-this-for-me";
|
|
49
|
-
RovoChatPromptKey["ASK_A_SPECIFIC_QUESTION"] = "ask-a-specific-question";
|
|
50
|
-
RovoChatPromptKey["SHOW_ME_WHATS_RELEVANT"] = "show-me-whats-relevant";
|
|
51
|
-
return RovoChatPromptKey;
|
|
52
|
-
}({});
|
|
53
|
-
var GOOGLE_PROMPTS = [RovoChatPromptKey.RECOMMEND_OTHER_SOURCES, RovoChatPromptKey.SHOW_OTHER_MENTIONS, RovoChatPromptKey.SUGGEST_IMPROVEMENT];
|
|
27
|
+
var GOOGLE_PROMPTS = [_rovoChatUtils.RovoChatPromptKey.RECOMMEND_OTHER_SOURCES, _rovoChatUtils.RovoChatPromptKey.SHOW_OTHER_MENTIONS, _rovoChatUtils.RovoChatPromptKey.SUGGEST_IMPROVEMENT];
|
|
54
28
|
var GENERIC_3P_PROMPTS = [
|
|
55
29
|
// For rovogrowth-640-inline-action-nudge-exp only
|
|
56
|
-
RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT, RovoChatPromptKey.SUMMARIZE_THIS_FOR_ME, RovoChatPromptKey.ASK_A_SPECIFIC_QUESTION];
|
|
30
|
+
_rovoChatUtils.RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT, _rovoChatUtils.RovoChatPromptKey.SUMMARIZE_THIS_FOR_ME, _rovoChatUtils.RovoChatPromptKey.ASK_A_SPECIFIC_QUESTION];
|
|
57
31
|
var DEFAULT_PROMPTS = GOOGLE_PROMPTS;
|
|
58
|
-
var
|
|
59
|
-
switch (product) {
|
|
60
|
-
case 'CONFLUENCE':
|
|
61
|
-
return {
|
|
62
|
-
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_confluence_page),
|
|
63
|
-
contextShort: intl.formatMessage(_messages.messages.rovo_prompt_context_confluence_page_short)
|
|
64
|
-
};
|
|
65
|
-
case 'JSW':
|
|
66
|
-
case 'JWM':
|
|
67
|
-
case 'JSM':
|
|
68
|
-
case 'JPD':
|
|
69
|
-
return {
|
|
70
|
-
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_jira_work_item),
|
|
71
|
-
contextShort: intl.formatMessage(_messages.messages.rovo_prompt_context_jira_work_item_short)
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
76
|
-
var _getContext;
|
|
77
|
-
var url = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
78
|
-
var product = arguments.length > 3 ? arguments[3] : undefined;
|
|
79
|
-
var iconSize = arguments.length > 4 ? arguments[4] : undefined;
|
|
80
|
-
var cardAppearance = arguments.length > 5 ? arguments[5] : undefined;
|
|
81
|
-
var _ref = (_getContext = getContext(intl, product)) !== null && _getContext !== void 0 ? _getContext : {
|
|
82
|
-
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_generic),
|
|
83
|
-
contextShort: intl.formatMessage(_messages.messages.rovo_prompt_context_generic)
|
|
84
|
-
},
|
|
85
|
-
contextLong = _ref.contextLong,
|
|
86
|
-
contextShort = _ref.contextShort;
|
|
87
|
-
var isBlockCard3PExperimentEnabled = (0, _useBlockCardRovoActionExperiment.isBlockCardRovoActionExperimentEnabled)(product);
|
|
88
|
-
switch (promptKey) {
|
|
89
|
-
case RovoChatPromptKey.RECOMMEND_OTHER_SOURCES:
|
|
90
|
-
var label_recommend = intl.formatMessage(_messages.messages.rovo_prompt_button_recommend_other_sources);
|
|
91
|
-
var html_recommend = intl.formatMessage(_messages.messages.rovo_prompt_message_recommend_other_sources, {
|
|
92
|
-
context: contextLong,
|
|
93
|
-
url: url
|
|
94
|
-
}, {
|
|
95
|
-
ignoreTag: true
|
|
96
|
-
});
|
|
97
|
-
return {
|
|
98
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiEditIcon.default, null),
|
|
99
|
-
content: label_recommend,
|
|
100
|
-
tooltipMessage: label_recommend,
|
|
101
|
-
data: {
|
|
102
|
-
name: label_recommend,
|
|
103
|
-
dialogues: [],
|
|
104
|
-
prompt: (0, _htmlToAdf.default)(html_recommend)
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
case RovoChatPromptKey.SHOW_OTHER_MENTIONS:
|
|
108
|
-
var label_other_mentions = intl.formatMessage(_messages.messages.rovo_prompt_button_show_other_mentions);
|
|
109
|
-
var html_other_mentions = intl.formatMessage(_messages.messages.rovo_prompt_message_show_other_mentions, {
|
|
110
|
-
context: contextLong,
|
|
111
|
-
url: url
|
|
112
|
-
}, {
|
|
113
|
-
ignoreTag: true
|
|
114
|
-
});
|
|
115
|
-
return {
|
|
116
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiChapterIcon.default, null),
|
|
117
|
-
content: label_other_mentions,
|
|
118
|
-
tooltipMessage: label_other_mentions,
|
|
119
|
-
data: {
|
|
120
|
-
name: label_other_mentions,
|
|
121
|
-
dialogues: [],
|
|
122
|
-
prompt: (0, _htmlToAdf.default)(html_other_mentions)
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
case RovoChatPromptKey.SUGGEST_IMPROVEMENT:
|
|
126
|
-
var label_improvement = intl.formatMessage(_messages.messages.rovo_prompt_button_suggest_improvement, {
|
|
127
|
-
context: contextShort
|
|
128
|
-
});
|
|
129
|
-
var html_improvement = intl.formatMessage(_messages.messages.rovo_prompt_message_suggest_improvement, {
|
|
130
|
-
context: contextLong,
|
|
131
|
-
url: url
|
|
132
|
-
}, {
|
|
133
|
-
ignoreTag: true
|
|
134
|
-
});
|
|
135
|
-
return {
|
|
136
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiSearchIcon.default, null),
|
|
137
|
-
content: label_improvement,
|
|
138
|
-
tooltipMessage: label_improvement,
|
|
139
|
-
data: {
|
|
140
|
-
name: label_improvement,
|
|
141
|
-
dialogues: [],
|
|
142
|
-
prompt: (0, _htmlToAdf.default)(html_improvement)
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
case RovoChatPromptKey.SUMMARIZE_LINK:
|
|
146
|
-
var label_summarize = intl.formatMessage(_messages.messages.ai_summarize);
|
|
147
|
-
var html_summarize = intl.formatMessage(_messages.messages.rovo_prompt_message_summarize, {
|
|
148
|
-
url: url
|
|
149
|
-
}, {
|
|
150
|
-
ignoreTag: true
|
|
151
|
-
});
|
|
152
|
-
return {
|
|
153
|
-
icon: cardAppearance === _constants.CardDisplay.Block && isBlockCard3PExperimentEnabled ? /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
154
|
-
label: label_summarize,
|
|
155
|
-
size: iconSize
|
|
156
|
-
}) : /*#__PURE__*/_react.default.createElement(_aiEditIcon.default, null),
|
|
157
|
-
content: label_summarize,
|
|
158
|
-
tooltipMessage: label_summarize,
|
|
159
|
-
data: {
|
|
160
|
-
name: label_summarize,
|
|
161
|
-
dialogues: [],
|
|
162
|
-
prompt: (0, _htmlToAdf.default)(html_summarize),
|
|
163
|
-
mode: {
|
|
164
|
-
fastModeEnabled: true
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
case RovoChatPromptKey.SUMMARIZE_THIS_FOR_ME:
|
|
169
|
-
var label_summarize_this_for_me = intl.formatMessage(_messages.messages.rovo_prompt_button_summarize_this);
|
|
170
|
-
var html_summarize_this_for_me = intl.formatMessage(_messages.messages.rovo_prompt_message_summarize, {
|
|
171
|
-
url: url
|
|
172
|
-
}, {
|
|
173
|
-
ignoreTag: true
|
|
174
|
-
});
|
|
175
|
-
return {
|
|
176
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiGenerativeTextSummary.default, {
|
|
177
|
-
label: label_summarize_this_for_me
|
|
178
|
-
}),
|
|
179
|
-
content: label_summarize_this_for_me,
|
|
180
|
-
tooltipMessage: label_summarize_this_for_me,
|
|
181
|
-
data: {
|
|
182
|
-
name: label_summarize_this_for_me,
|
|
183
|
-
dialogues: [],
|
|
184
|
-
prompt: (0, _htmlToAdf.default)(html_summarize_this_for_me),
|
|
185
|
-
mode: {
|
|
186
|
-
fastModeEnabled: true
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
case RovoChatPromptKey.HIGHLIGHT_RELEVANT_CONTENT:
|
|
191
|
-
var label_highlight_relevant_content = intl.formatMessage(_messages.messages.rovo_prompt_button_highlight_relevant_content);
|
|
192
|
-
var html_highlight_relevant_content = intl.formatMessage(_messages.messages.rovo_prompt_message_highlight_relevant_content, {
|
|
193
|
-
context: contextLong,
|
|
194
|
-
url: url
|
|
195
|
-
}, {
|
|
196
|
-
ignoreTag: true
|
|
197
|
-
});
|
|
198
|
-
return {
|
|
199
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiChapterIcon.default, null),
|
|
200
|
-
content: label_highlight_relevant_content,
|
|
201
|
-
tooltipMessage: label_highlight_relevant_content,
|
|
202
|
-
data: {
|
|
203
|
-
name: label_highlight_relevant_content,
|
|
204
|
-
dialogues: [],
|
|
205
|
-
prompt: (0, _htmlToAdf.default)(html_highlight_relevant_content),
|
|
206
|
-
mode: {
|
|
207
|
-
fastModeEnabled: true
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
case RovoChatPromptKey.ASK_ROVO_ANYTHING:
|
|
212
|
-
var label_ask_rovo_anything = intl.formatMessage(_messages.messages.rovo_prompt_button_ask_rovo_anything);
|
|
213
|
-
var prompt_ask_rovo_anything = intl.formatMessage(_messages.messages.rovo_prompt_message_ask_rovo_anything, {
|
|
214
|
-
url: url
|
|
215
|
-
});
|
|
216
|
-
return {
|
|
217
|
-
icon: cardAppearance === _constants.CardDisplay.Block && isBlockCard3PExperimentEnabled ? /*#__PURE__*/_react.default.createElement(_logo.RovoIcon, {
|
|
218
|
-
label: label_ask_rovo_anything,
|
|
219
|
-
size: 'xxsmall',
|
|
220
|
-
shouldUseHexLogo: true
|
|
221
|
-
}) : /*#__PURE__*/_react.default.createElement(_aiSearchIcon.default, null),
|
|
222
|
-
content: label_ask_rovo_anything,
|
|
223
|
-
tooltipMessage: label_ask_rovo_anything,
|
|
224
|
-
data: {
|
|
225
|
-
name: label_ask_rovo_anything,
|
|
226
|
-
dialogues: [],
|
|
227
|
-
prompt: prompt_ask_rovo_anything,
|
|
228
|
-
isPromptPlaceholder: true,
|
|
229
|
-
placeholderType: 'generic'
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
case RovoChatPromptKey.ASK_A_SPECIFIC_QUESTION:
|
|
233
|
-
var label_ask_a_specific_question = intl.formatMessage(_messages.messages.rovo_prompt_button_ask_a_specific_question);
|
|
234
|
-
var prompt_ask_a_specific_question = intl.formatMessage(_messages.messages.rovo_prompt_message_ask_rovo_anything, {
|
|
235
|
-
url: url
|
|
236
|
-
});
|
|
237
|
-
return {
|
|
238
|
-
icon: /*#__PURE__*/_react.default.createElement(_rovoChat.default, {
|
|
239
|
-
label: label_ask_a_specific_question
|
|
240
|
-
}),
|
|
241
|
-
content: label_ask_a_specific_question,
|
|
242
|
-
tooltipMessage: label_ask_a_specific_question,
|
|
243
|
-
data: {
|
|
244
|
-
name: label_ask_a_specific_question,
|
|
245
|
-
dialogues: [],
|
|
246
|
-
prompt: prompt_ask_a_specific_question,
|
|
247
|
-
isPromptPlaceholder: true,
|
|
248
|
-
placeholderType: 'generic'
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
case RovoChatPromptKey.KEY_HIGHLIGHTS:
|
|
252
|
-
var label_key_highlights = intl.formatMessage(_messages.messages.rovo_prompt_button_key_highlights);
|
|
253
|
-
var html_key_highlights = intl.formatMessage(_messages.messages.rovo_prompt_message_key_highlights, {
|
|
254
|
-
context: contextLong,
|
|
255
|
-
url: url
|
|
256
|
-
}, {
|
|
257
|
-
ignoreTag: true
|
|
258
|
-
});
|
|
259
|
-
return {
|
|
260
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
261
|
-
label: label_key_highlights,
|
|
262
|
-
size: iconSize
|
|
263
|
-
}),
|
|
264
|
-
content: label_key_highlights,
|
|
265
|
-
tooltipMessage: label_key_highlights,
|
|
266
|
-
data: {
|
|
267
|
-
name: label_key_highlights,
|
|
268
|
-
dialogues: [],
|
|
269
|
-
prompt: (0, _htmlToAdf.default)(html_key_highlights)
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
case RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT:
|
|
273
|
-
var label_show_me_whats_relevant = intl.formatMessage(_messages.messages.rovo_prompt_button_show_me_whats_relevant);
|
|
274
|
-
var html_show_me_whats_relevant = intl.formatMessage(_messages.messages.rovo_prompt_message_highlight_relevant_content, {
|
|
275
|
-
context: contextLong,
|
|
276
|
-
url: url
|
|
277
|
-
}, {
|
|
278
|
-
ignoreTag: true
|
|
279
|
-
});
|
|
280
|
-
return {
|
|
281
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiSearch.default, {
|
|
282
|
-
label: label_show_me_whats_relevant
|
|
283
|
-
}),
|
|
284
|
-
content: label_show_me_whats_relevant,
|
|
285
|
-
tooltipMessage: label_show_me_whats_relevant,
|
|
286
|
-
data: {
|
|
287
|
-
name: label_show_me_whats_relevant,
|
|
288
|
-
dialogues: [],
|
|
289
|
-
prompt: (0, _htmlToAdf.default)(html_show_me_whats_relevant)
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
case RovoChatPromptKey.IDENTIFY_KEY_TRENDS:
|
|
293
|
-
var label_identify_key_trends = intl.formatMessage(_messages.messages.rovo_prompt_button_identify_key_trends);
|
|
294
|
-
var html_identify_key_trends = intl.formatMessage(_messages.messages.rovo_prompt_message_identify_key_trends, {
|
|
295
|
-
url: url
|
|
296
|
-
}, {
|
|
297
|
-
ignoreTag: true
|
|
298
|
-
});
|
|
299
|
-
return {
|
|
300
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
301
|
-
label: label_identify_key_trends,
|
|
302
|
-
size: iconSize
|
|
303
|
-
}),
|
|
304
|
-
content: label_identify_key_trends,
|
|
305
|
-
tooltipMessage: label_identify_key_trends,
|
|
306
|
-
data: {
|
|
307
|
-
name: label_identify_key_trends,
|
|
308
|
-
dialogues: [],
|
|
309
|
-
prompt: (0, _htmlToAdf.default)(html_identify_key_trends)
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
case RovoChatPromptKey.IDENTIFY_KEY_POINTS:
|
|
313
|
-
var label_identify_key_points = intl.formatMessage(_messages.messages.rovo_prompt_button_identify_key_points);
|
|
314
|
-
var html_identify_key_points = intl.formatMessage(_messages.messages.rovo_prompt_message_identify_key_points, {
|
|
315
|
-
url: url
|
|
316
|
-
}, {
|
|
317
|
-
ignoreTag: true
|
|
318
|
-
});
|
|
319
|
-
return {
|
|
320
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
321
|
-
label: label_identify_key_points,
|
|
322
|
-
size: iconSize
|
|
323
|
-
}),
|
|
324
|
-
content: label_identify_key_points,
|
|
325
|
-
tooltipMessage: label_identify_key_points,
|
|
326
|
-
data: {
|
|
327
|
-
name: label_identify_key_points,
|
|
328
|
-
dialogues: [],
|
|
329
|
-
prompt: (0, _htmlToAdf.default)(html_identify_key_points)
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
case RovoChatPromptKey.FIND_OPEN_QUESTIONS:
|
|
333
|
-
var label_find_open_questions = intl.formatMessage(_messages.messages.rovo_prompt_button_find_open_questions);
|
|
334
|
-
var html_find_open_questions = intl.formatMessage(_messages.messages.rovo_prompt_message_find_open_questions, {
|
|
335
|
-
url: url
|
|
336
|
-
}, {
|
|
337
|
-
ignoreTag: true
|
|
338
|
-
});
|
|
339
|
-
return {
|
|
340
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
341
|
-
label: label_find_open_questions,
|
|
342
|
-
size: iconSize
|
|
343
|
-
}),
|
|
344
|
-
content: label_find_open_questions,
|
|
345
|
-
tooltipMessage: label_find_open_questions,
|
|
346
|
-
data: {
|
|
347
|
-
name: label_find_open_questions,
|
|
348
|
-
dialogues: [],
|
|
349
|
-
prompt: (0, _htmlToAdf.default)(html_find_open_questions)
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
var RovoChatAction = function RovoChatAction(_ref2) {
|
|
32
|
+
var RovoChatAction = function RovoChatAction(_ref) {
|
|
355
33
|
var _context$actions;
|
|
356
|
-
var onClickCallback =
|
|
357
|
-
prompts =
|
|
358
|
-
|
|
359
|
-
testId =
|
|
360
|
-
props = (0, _objectWithoutProperties2.default)(
|
|
34
|
+
var onClickCallback = _ref.onClick,
|
|
35
|
+
prompts = _ref.prompts,
|
|
36
|
+
_ref$testId = _ref.testId,
|
|
37
|
+
testId = _ref$testId === void 0 ? 'smart-action-rovo-chat-action' : _ref$testId,
|
|
38
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
361
39
|
var intl = (0, _reactIntl.useIntl)();
|
|
362
40
|
var _useRovoChat = (0, _useRovoChat2.default)(),
|
|
363
41
|
isRovoChatEnabled = _useRovoChat.isRovoChatEnabled,
|
|
@@ -401,11 +79,11 @@ var RovoChatAction = function RovoChatAction(_ref2) {
|
|
|
401
79
|
}, [data === null || data === void 0 ? void 0 : data.invokeAction, invoke, onClickCallback, sendPromptMessage]);
|
|
402
80
|
var promptActions = (0, _react.useMemo)(function () {
|
|
403
81
|
return resolvedPrompts.map(function (promptKey, idx) {
|
|
404
|
-
var
|
|
405
|
-
icon =
|
|
406
|
-
content =
|
|
407
|
-
tooltipMessage =
|
|
408
|
-
promptData =
|
|
82
|
+
var _ref2 = (0, _rovoChatUtils.getPromptAction)(promptKey, intl, data === null || data === void 0 ? void 0 : data.url, data === null || data === void 0 ? void 0 : data.product, props.iconSize, props.cardAppearance) || {},
|
|
83
|
+
icon = _ref2.icon,
|
|
84
|
+
content = _ref2.content,
|
|
85
|
+
tooltipMessage = _ref2.tooltipMessage,
|
|
86
|
+
promptData = _ref2.data;
|
|
409
87
|
return promptData ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
410
88
|
content: content,
|
|
411
89
|
icon: icon,
|
|
@@ -27,7 +27,7 @@ var _messages = require("../../../../../messages");
|
|
|
27
27
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
28
28
|
var _useBlockCardRovoActionExperiment = require("../../../../../state/hooks/use-block-card-rovo-action-experiment");
|
|
29
29
|
var _useRovoConfig2 = _interopRequireDefault(require("../../../../../state/hooks/use-rovo-config"));
|
|
30
|
-
var
|
|
30
|
+
var _rovoChatUtils = require("../../../../common/rovo-chat-utils");
|
|
31
31
|
var _utils = require("../../utils");
|
|
32
32
|
var _utils2 = require("../utils");
|
|
33
33
|
var _actionGroupItem = _interopRequireDefault(require("./action-group-item"));
|
|
@@ -107,7 +107,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
107
107
|
if (!!rovoChatAction && is3PBlockExperimentEnabled) {
|
|
108
108
|
var rovoActions = [].concat((0, _toConsumableArray2.default)(containerWidth >= REDUCED_ACTIONS_SIZE ? renderableActionItems.slice(0, visibleButtonsNum - 1) : []), (0, _toConsumableArray2.default)(containerWidth >= OVERFLOW_ONLY_ACTIONS_SIZE ? [{
|
|
109
109
|
name: _constants.ActionName.RovoChatAction,
|
|
110
|
-
prompts: [
|
|
110
|
+
prompts: [_rovoChatUtils.RovoChatPromptKey.ASK_ROVO_ANYTHING],
|
|
111
111
|
iconSize: 'small',
|
|
112
112
|
cardAppearance: _constants.CardDisplay.Block,
|
|
113
113
|
hideContent: containerWidth < FULL_ACTIONS_SIZE && containerWidth >= REDUCED_ACTIONS_SIZE || containerWidth < ICON_ONLY_ACTIONS_SIZE && containerWidth >= OVERFLOW_ONLY_ACTIONS_SIZE
|
|
@@ -130,7 +130,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
130
130
|
if (!!rovoChatAction && is3PBlockExperimentEnabled && containerWidth < OVERFLOW_ONLY_ACTIONS_SIZE) {
|
|
131
131
|
actionItems = [].concat((0, _toConsumableArray2.default)(renderableActionItems), [{
|
|
132
132
|
name: _constants.ActionName.RovoChatAction,
|
|
133
|
-
prompts: [
|
|
133
|
+
prompts: [_rovoChatUtils.RovoChatPromptKey.ASK_ROVO_ANYTHING],
|
|
134
134
|
iconSize: 'small',
|
|
135
135
|
cardAppearance: _constants.CardDisplay.Block
|
|
136
136
|
}, {
|
|
@@ -8,8 +8,10 @@ exports.InlineCardResolvedViewBase = InlineCardResolvedViewBase;
|
|
|
8
8
|
exports.InlineCardResolvedViewFunctional = void 0;
|
|
9
9
|
exports.InlineCardResolvedViewFunctionalWithRovoActions = InlineCardResolvedViewFunctionalWithRovoActions;
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
12
13
|
var _useInlineActionNudgeExperiment = _interopRequireDefault(require("../../../state/hooks/use-inline-action-nudge-experiment"));
|
|
14
|
+
var _useInlineTailoredActionExperiment = _interopRequireDefault(require("../../../state/hooks/use-inline-tailored-action-experiment"));
|
|
13
15
|
var _HoverCard = require("../../HoverCard");
|
|
14
16
|
var _rovoActionsCta = require("../common/rovo-actions-cta");
|
|
15
17
|
var _Frame = require("../Frame");
|
|
@@ -90,6 +92,8 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
90
92
|
lozenge = _ref2.lozenge;
|
|
91
93
|
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(link, showHoverPreview, actionOptions),
|
|
92
94
|
isEnabled = _useInlineActionNudge.isEnabled;
|
|
95
|
+
var _useInlineTailoredAct = (0, _useInlineTailoredActionExperiment.default)(link, showHoverPreview, actionOptions),
|
|
96
|
+
isInlineTailoredRovoActionEnabled = _useInlineTailoredAct.isEnabled;
|
|
93
97
|
|
|
94
98
|
// TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
|
|
95
99
|
var frame = /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
|
|
@@ -108,8 +112,11 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
108
112
|
titleTextColor: titleTextColor,
|
|
109
113
|
type: type,
|
|
110
114
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
111
|
-
}), (0, _renderLozenge.renderLozenge)(lozenge), isEnabled && /*#__PURE__*/_react.default.createElement(_rovoActionsCta.RovoActionsCta, {
|
|
115
|
+
}), (0, _renderLozenge.renderLozenge)(lozenge), isEnabled && !(0, _platformFeatureFlags.fg)('platform_sl_3p_auth_inline_tailored_cta_killswitch') && /*#__PURE__*/_react.default.createElement(_rovoActionsCta.RovoActionsCta, {
|
|
112
116
|
testId: "".concat(testId, "-rovo-actions-cta")
|
|
117
|
+
}), isInlineTailoredRovoActionEnabled && /*#__PURE__*/_react.default.createElement(_rovoActionsCta.InlineRovoActionButton, {
|
|
118
|
+
testId: "".concat(testId, "-rovo-actions-cta"),
|
|
119
|
+
url: link
|
|
113
120
|
}));
|
|
114
121
|
if (!showHoverPreview || !link) {
|
|
115
122
|
return frame;
|
|
@@ -121,4 +128,6 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
121
128
|
hoverPreviewOptions: hoverPreviewOptions
|
|
122
129
|
}, frame);
|
|
123
130
|
}
|
|
131
|
+
|
|
132
|
+
// Todo: replace with platform_sl_3p_auth_inline_tailored_cta_killswitch after cleanup of rovogrowth-640-inline-action-nudge-fg
|
|
124
133
|
var InlineCardResolvedViewFunctional = exports.InlineCardResolvedViewFunctional = (0, _platformFeatureFlagsReact.componentWithFG)('rovogrowth-640-inline-action-nudge-fg', InlineCardResolvedViewFunctionalWithRovoActions, InlineCardResolvedViewBase);
|