@atlaskit/smart-card 44.23.1 → 44.23.3
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 +15 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-entity-support--default.png +2 -2
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +2 -4
- package/dist/cjs/extractors/flexible/actions/index.js +1 -1
- package/dist/cjs/extractors/flexible/index.js +1 -1
- package/dist/cjs/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/click-helpers.js +30 -1
- package/dist/cjs/view/CardWithUrl/component.js +109 -45
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -9
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +7 -28
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -10
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +2 -3
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +0 -7
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.compiled.css +2 -6
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +4 -26
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +0 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/index.js +2 -2
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +31 -16
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +4 -11
- package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +2 -8
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-summary/index.js +1 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-entity-support--default.png +2 -2
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +2 -4
- package/dist/es2019/extractors/flexible/actions/index.js +1 -1
- package/dist/es2019/extractors/flexible/index.js +1 -1
- package/dist/es2019/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/click-helpers.js +29 -0
- package/dist/es2019/view/CardWithUrl/component.js +111 -47
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -9
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +7 -28
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -10
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +0 -7
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.compiled.css +2 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +4 -26
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +0 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/index.js +2 -2
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +31 -17
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -11
- package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +3 -10
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-summary/index.js +1 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-entity-support--default.png +2 -2
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +2 -4
- package/dist/esm/extractors/flexible/actions/index.js +1 -1
- package/dist/esm/extractors/flexible/index.js +1 -1
- package/dist/esm/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/click-helpers.js +29 -0
- package/dist/esm/view/CardWithUrl/component.js +110 -46
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -9
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +7 -28
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -10
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +2 -3
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +0 -7
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -3
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.compiled.css +2 -6
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +4 -26
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +0 -1
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -4
- package/dist/esm/view/FlexibleCard/index.js +2 -2
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +31 -16
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +4 -11
- package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +3 -9
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-summary/index.js +1 -3
- package/dist/types/utils/click-helpers.d.ts +20 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -2
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/click-helpers.d.ts +20 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -2
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/package.json +1 -4
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-false.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-true.png +0 -3
- package/dist/cjs/state/hooks/use-inline-action-nudge-experiment/index.js +0 -54
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +0 -15
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +0 -44
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-false.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-true.png +0 -3
- package/dist/es2019/state/hooks/use-inline-action-nudge-experiment/index.js +0 -48
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +0 -15
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +0 -36
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-false.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-true.png +0 -3
- package/dist/esm/state/hooks/use-inline-action-nudge-experiment/index.js +0 -47
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +0 -15
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +0 -35
- package/dist/types/state/hooks/use-inline-action-nudge-experiment/index.d.ts +0 -24
- package/dist/types/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.d.ts +0 -12
- package/dist/types-ts4.5/state/hooks/use-inline-action-nudge-experiment/index.d.ts +0 -24
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.d.ts +0 -12
|
@@ -13,7 +13,6 @@ 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 _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
17
16
|
var _constants = require("../../../../../constants");
|
|
18
17
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
19
18
|
var _useInvokeClientAction = _interopRequireDefault(require("../../../../../state/hooks/use-invoke-client-action"));
|
|
@@ -25,9 +24,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
25
24
|
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; }
|
|
26
25
|
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; }
|
|
27
26
|
var GOOGLE_PROMPTS = [_rovoChatUtils.RovoChatPromptKey.RECOMMEND_OTHER_SOURCES, _rovoChatUtils.RovoChatPromptKey.SHOW_OTHER_MENTIONS, _rovoChatUtils.RovoChatPromptKey.SUGGEST_IMPROVEMENT];
|
|
28
|
-
var GENERIC_3P_PROMPTS = [
|
|
29
|
-
// For rovogrowth-640-inline-action-nudge-exp only
|
|
30
|
-
_rovoChatUtils.RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT, _rovoChatUtils.RovoChatPromptKey.SUMMARIZE_THIS_FOR_ME, _rovoChatUtils.RovoChatPromptKey.ASK_A_SPECIFIC_QUESTION];
|
|
31
27
|
var DEFAULT_PROMPTS = GOOGLE_PROMPTS;
|
|
32
28
|
var RovoChatAction = function RovoChatAction(_ref) {
|
|
33
29
|
var _context$actions;
|
|
@@ -46,9 +42,6 @@ var RovoChatAction = function RovoChatAction(_ref) {
|
|
|
46
42
|
if (prompts) {
|
|
47
43
|
return prompts;
|
|
48
44
|
}
|
|
49
|
-
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true)) {
|
|
50
|
-
return GENERIC_3P_PROMPTS;
|
|
51
|
-
}
|
|
52
45
|
return DEFAULT_PROMPTS;
|
|
53
46
|
}, [prompts]);
|
|
54
47
|
var invoke = (0, _useInvokeClientAction.default)({});
|
|
@@ -11,7 +11,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactIntl = require("react-intl");
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
15
14
|
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
16
15
|
var _messages = require("../../../../../messages");
|
|
17
16
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
@@ -50,10 +49,10 @@ var ViewRelatedLinksAction = function ViewRelatedLinksAction(_ref) {
|
|
|
50
49
|
}, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
|
|
51
50
|
return actionData ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
52
51
|
content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.related_links_view_related_links)
|
|
53
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
52
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
54
53
|
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.related_links_view_related_links)
|
|
55
54
|
} : {}, {
|
|
56
|
-
icon: /*#__PURE__*/_react.default.createElement(_relatedLinksActionIcon.default, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
55
|
+
icon: /*#__PURE__*/_react.default.createElement(_relatedLinksActionIcon.default, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
57
56
|
iconSize: props.iconSize
|
|
58
57
|
} : {}),
|
|
59
58
|
onClick: onClick,
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
._zulpu2gc{gap:var(--ds-space-100,8px)}._16jlkb7n{flex-grow:1}
|
|
1
|
+
._16jlkb7n{flex-grow:1}
|
|
3
2
|
._18u01ivi{margin-left:calc(var(--container-gap-left)*-1)}
|
|
4
3
|
._1bsb129b{width:calc(100% + var(--container-gap-left) + var(--container-gap-right))}
|
|
5
|
-
._1bsb1osq{width:100%}
|
|
6
|
-
._1e0c11p5{display:grid}
|
|
7
4
|
._1e0c1txw{display:flex}
|
|
8
5
|
._2hwxc10g{margin-right:calc(var(--container-gap-right)*-1)}
|
|
9
6
|
._2lx21bp4{flex-direction:column}
|
|
10
|
-
._vchhusvi{box-sizing:border-box}
|
|
11
|
-
._yv0e1ris{grid-template-columns:max-content}
|
|
7
|
+
._vchhusvi{box-sizing:border-box}
|
|
@@ -14,16 +14,12 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
18
17
|
var _constants = require("../../../../../constants");
|
|
19
18
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
20
19
|
var Actions = _interopRequireWildcard(require("../../actions"));
|
|
21
20
|
var _actionFooter = require("./action-footer");
|
|
22
|
-
var _askRovoSectionHeader = _interopRequireDefault(require("./ask-rovo-section-header"));
|
|
23
21
|
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); }
|
|
24
22
|
var ignoreContainerPaddingStyles = null;
|
|
25
|
-
var inlineActionNudgePillWrapperStyles = null;
|
|
26
|
-
var inlineActionNudgeColumnStyles = null;
|
|
27
23
|
var DEFAULT_SORT_ORDER = ['PreviewAction', 'CopyLinkAction', 'AISummaryAction'];
|
|
28
24
|
var sort = function sort(a, b) {
|
|
29
25
|
var idxA = DEFAULT_SORT_ORDER.indexOf(a);
|
|
@@ -66,10 +62,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
66
62
|
isAny3pRovoActionsExperimentOn = _ref.isAny3pRovoActionsExperimentOn;
|
|
67
63
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
68
64
|
var ui = (0, _flexibleUiContext.useFlexibleUiOptionContext)();
|
|
69
|
-
var isRovoChatActionAvailable =
|
|
70
|
-
|
|
71
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
72
|
-
var isInlineActionNudgeExperiment = (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
65
|
+
var isRovoChatActionAvailable = isAny3pRovoActionsExperimentOn && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? (context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.RovoChatAction]) !== undefined : undefined;
|
|
73
66
|
var _useState = (0, _react.useState)(),
|
|
74
67
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
75
68
|
message = _useState2[0],
|
|
@@ -93,7 +86,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
93
86
|
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
94
87
|
return;
|
|
95
88
|
}
|
|
96
|
-
var arr = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
89
|
+
var arr = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? isRovoChatActionAvailable ? [_constants.ActionName.RovoChatAction] : Object.keys(context.actions).filter(function (name) {
|
|
97
90
|
return name !== _constants.ActionName.RovoChatAction;
|
|
98
91
|
}) : Object.keys(context.actions);
|
|
99
92
|
arr.sort(sort);
|
|
@@ -114,7 +107,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
114
107
|
size: size || (ui === null || ui === void 0 ? void 0 : ui.size)
|
|
115
108
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
116
109
|
,
|
|
117
|
-
style:
|
|
110
|
+
style: padding ? {
|
|
118
111
|
paddingInline: padding
|
|
119
112
|
} : undefined,
|
|
120
113
|
hideTooltip: isLoading
|
|
@@ -123,25 +116,10 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
123
116
|
return arr.map(function (name) {
|
|
124
117
|
return renderAction(name);
|
|
125
118
|
});
|
|
126
|
-
}, [context === null || context === void 0 ? void 0 : context.actions, isRovoChatActionAvailable, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, _onClick
|
|
127
|
-
var showRovoSectionHeader = isInlineActionNudgeExperiment && isRovoChatActionAvailable;
|
|
119
|
+
}, [context === null || context === void 0 ? void 0 : context.actions, isRovoChatActionAvailable, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, _onClick]);
|
|
128
120
|
if (!actions) {
|
|
129
121
|
return null;
|
|
130
122
|
}
|
|
131
|
-
if (isInlineActionNudgeExperiment && isRovoChatActionAvailable) {
|
|
132
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
133
|
-
ref: blockRef,
|
|
134
|
-
"data-testid": testId,
|
|
135
|
-
className: (0, _runtime.ax)(["_1e0c1txw _2lx21bp4 _vchhusvi _1bsb1osq"])
|
|
136
|
-
}, showRovoSectionHeader && /*#__PURE__*/React.createElement(_askRovoSectionHeader.default, {
|
|
137
|
-
testId: testId ? "".concat(testId, "-rovo-section-header") : undefined
|
|
138
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
139
|
-
className: (0, _runtime.ax)(["_zulpu2gc _1e0c11p5 _yv0e1ris"])
|
|
140
|
-
}, actions), /*#__PURE__*/React.createElement(_actionFooter.ActionFooter, {
|
|
141
|
-
message: message,
|
|
142
|
-
testId: testId
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
123
|
return /*#__PURE__*/React.createElement("div", {
|
|
146
124
|
ref: blockRef,
|
|
147
125
|
"data-testid": testId
|
package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
._18u01ivi{margin-left:calc(var(--container-gap-left)*-1)}
|
|
11
11
|
._18u01wug{margin-left:auto}
|
|
12
12
|
._19p4ze3t *{padding-right:var(--ds-space-0,0)}
|
|
13
|
-
._19pkutpp{margin-top:var(--ds-space-150,9pt)}
|
|
14
13
|
._1bah1y6m{justify-content:flex-start}
|
|
15
14
|
._1bsb129b{width:calc(100% + var(--container-gap-left) + var(--container-gap-right))}
|
|
16
15
|
._1e0c1txw{display:flex}
|
|
@@ -13,8 +13,6 @@ 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 _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
18
16
|
var _constants = require("../../../../../constants");
|
|
19
17
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
20
18
|
var Actions = _interopRequireWildcard(require("../../actions"));
|
|
@@ -28,7 +26,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
28
26
|
*/
|
|
29
27
|
var HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [_constants.ActionName.RovoChatAction];
|
|
30
28
|
var ignoreContainerMarginStyles = null;
|
|
31
|
-
var inlineActionNudgeFooterMarginStyles = null;
|
|
32
29
|
var elevatedFooterStyles = null;
|
|
33
30
|
var providerStyles = null;
|
|
34
31
|
var actionsStyles = null;
|
|
@@ -74,7 +71,7 @@ var ResolvedHoverCardFooterBlock = function ResolvedHoverCardFooterBlock(_ref) {
|
|
|
74
71
|
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
75
72
|
size: size,
|
|
76
73
|
testId: "".concat(testId, "-resolved-view"),
|
|
77
|
-
className: (0, _runtime.ax)(["_18zrpxbi _1rjcutpp _vchhusvi _1bsb129b _18u01ivi _2hwxc10g _otyr1ya9 _4t3ioahv", "_zulpu2gc _x3doj0fz _bfhkhfxm _mrkb1mok _1o0z1mok"
|
|
74
|
+
className: (0, _runtime.ax)(["_18zrpxbi _1rjcutpp _vchhusvi _1bsb129b _18u01ivi _2hwxc10g _otyr1ya9 _4t3ioahv", "_zulpu2gc _x3doj0fz _bfhkhfxm _mrkb1mok _1o0z1mok"])
|
|
78
75
|
}), !hideProvider && /*#__PURE__*/React.createElement("div", {
|
|
79
76
|
className: (0, _runtime.ax)(["_4t3i1ejb _1e0c1txw _4cvr1h6o _1bah1y6m _vchhusvi _16jlkb7n"])
|
|
80
77
|
}, /*#__PURE__*/React.createElement(_elements.Provider, {
|
|
@@ -60,7 +60,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
60
60
|
isPreviewPanelAvailable = _useSmartLinkContext.isPreviewPanelAvailable,
|
|
61
61
|
openPreviewPanel = _useSmartLinkContext.openPreviewPanel,
|
|
62
62
|
product = _useSmartLinkContext.product;
|
|
63
|
-
var rovoConfig = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
63
|
+
var rovoConfig = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ?
|
|
64
64
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
65
65
|
(0, _useRovoConfig.default)() : undefined;
|
|
66
66
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
@@ -89,7 +89,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
89
89
|
origin: origin,
|
|
90
90
|
renderers: renderers,
|
|
91
91
|
resolve: resolve
|
|
92
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
92
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
93
93
|
product: product,
|
|
94
94
|
rovoConfig: rovoConfig
|
|
95
95
|
} : undefined), {}, {
|
|
@@ -19,12 +19,13 @@ var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-anal
|
|
|
19
19
|
var _constants = require("../../../constants");
|
|
20
20
|
var _extractRovoChatAction = _interopRequireDefault(require("../../../extractors/flexible/actions/extract-rovo-chat-action"));
|
|
21
21
|
var _helpers = require("../../../state/helpers");
|
|
22
|
-
var _useInlineActionNudgeExperiment = _interopRequireDefault(require("../../../state/hooks/use-inline-action-nudge-experiment"));
|
|
23
22
|
var _useRovoConfig2 = _interopRequireDefault(require("../../../state/hooks/use-rovo-config"));
|
|
23
|
+
var _useSmartLinkCrossProductUrlWrapper = require("../../../state/hooks/use-smart-link-cross-product-url-wrapper");
|
|
24
24
|
var _store = require("../../../state/store");
|
|
25
25
|
var _utils = require("../../../utils");
|
|
26
26
|
var _aiSummary = require("../../../utils/ai-summary");
|
|
27
27
|
var _click = require("../../../utils/analytics/click");
|
|
28
|
+
var _clickHelpers = require("../../../utils/click-helpers");
|
|
28
29
|
var _styled = require("../styled");
|
|
29
30
|
var _utils2 = require("../utils");
|
|
30
31
|
var _ContentContainer = _interopRequireDefault(require("./ContentContainer"));
|
|
@@ -96,6 +97,9 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
96
97
|
product = _useSmartLinkContext.product;
|
|
97
98
|
var isAISummaryEnabled = (0, _aiSummary.getIsAISummaryEnabled)(isAdminHubAIEnabled, cardState.details);
|
|
98
99
|
var services = (0, _helpers.getServices)(linkState.details);
|
|
100
|
+
var appendCrossProductAnalyticsParams = (0, _useSmartLinkCrossProductUrlWrapper.useSmartLinkCrossProductUrlWrapperGated)({
|
|
101
|
+
details: linkState.details
|
|
102
|
+
});
|
|
99
103
|
var statusRef = (0, _react.useRef)(linkStatus);
|
|
100
104
|
var fireEventRef = (0, _react.useRef)(fireEvent);
|
|
101
105
|
var definitionIdRef = (0, _react.useRef)(definitionId);
|
|
@@ -137,6 +141,24 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
137
141
|
};
|
|
138
142
|
}, []);
|
|
139
143
|
var onClick = (0, _react.useCallback)(function (event) {
|
|
144
|
+
if ((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping')) {
|
|
145
|
+
// Prevent the anchor's native navigation so we can open the destination URL
|
|
146
|
+
// with cross-product analytics query parameters appended.
|
|
147
|
+
// The href is read from the anchor element at click time rather than at render
|
|
148
|
+
// time because the URL for the anchor may be different from original URL.
|
|
149
|
+
// The component may use the URL from the resolved response which can be a redirect URL
|
|
150
|
+
// or other preferred URL based on link extractor.
|
|
151
|
+
// The cross-product params are client-only and cannot be rendered
|
|
152
|
+
// server-side. Falls back to the original `url` prop if the event target is
|
|
153
|
+
// not an anchor element.
|
|
154
|
+
event.preventDefault();
|
|
155
|
+
var _getAnchorAttributesF = (0, _clickHelpers.getAnchorAttributesFromEvent)(event),
|
|
156
|
+
_getAnchorAttributesF2 = _getAnchorAttributesF.href,
|
|
157
|
+
href = _getAnchorAttributesF2 === void 0 ? url : _getAnchorAttributesF2,
|
|
158
|
+
target = _getAnchorAttributesF.target;
|
|
159
|
+
var destinationUrl = appendCrossProductAnalyticsParams(href);
|
|
160
|
+
window.open(destinationUrl, target);
|
|
161
|
+
}
|
|
140
162
|
var isModifierKeyPressed = (0, _utils.isSpecialEvent)(event);
|
|
141
163
|
fireEvent('ui.smartLink.clicked.titleGoToLink', {
|
|
142
164
|
id: id,
|
|
@@ -145,7 +167,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
145
167
|
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
146
168
|
});
|
|
147
169
|
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
|
|
148
|
-
}, [createAnalyticsEvent, id, fireEvent, definitionId]);
|
|
170
|
+
}, [createAnalyticsEvent, appendCrossProductAnalyticsParams, id, fireEvent, definitionId, url]);
|
|
149
171
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
150
172
|
var _getMetadata = (0, _utils2.getMetadata)(extensionKey, data),
|
|
151
173
|
subtitle = _getMetadata.subtitle;
|
|
@@ -245,9 +267,8 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
245
267
|
flexibleCardProps: flexibleCardProps
|
|
246
268
|
});
|
|
247
269
|
}
|
|
248
|
-
var is3PInlinePostAuthActionsEnabled = (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
249
270
|
if (isResolved) {
|
|
250
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
271
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
251
272
|
actionOptions: actionOptions,
|
|
252
273
|
showRovoResolvedView: showRovoResolvedView
|
|
253
274
|
} : undefined, {
|
|
@@ -298,9 +319,8 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
298
319
|
flexibleCardProps: flexibleCardProps
|
|
299
320
|
});
|
|
300
321
|
}
|
|
301
|
-
var is3PInlinePostAuthActionsEnabled = (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
302
322
|
if (cardState.status === 'resolved') {
|
|
303
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
323
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
304
324
|
actionOptions: actionOptions,
|
|
305
325
|
showRovoResolvedView: showRovoResolvedView
|
|
306
326
|
} : undefined, {
|
|
@@ -326,8 +346,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
326
346
|
};
|
|
327
347
|
var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(props) {
|
|
328
348
|
var cardState = props.cardState,
|
|
329
|
-
actionOptions = props.actionOptions
|
|
330
|
-
url = props.url;
|
|
349
|
+
actionOptions = props.actionOptions;
|
|
331
350
|
var rovoConfig = (0, _useRovoConfig2.default)();
|
|
332
351
|
var isResolved = useIsResolvedView(props);
|
|
333
352
|
var showPreauthBetterHovercard = useIsShowPreauthBetterHovercard(props);
|
|
@@ -338,22 +357,19 @@ var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(p
|
|
|
338
357
|
actionOptions: actionOptions
|
|
339
358
|
}) !== undefined;
|
|
340
359
|
}, [actionOptions, cardState.details, rovoConfig, isResolved]);
|
|
341
|
-
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(url, true, actionOptions),
|
|
342
|
-
rovoActionsCtaShown = _useInlineActionNudge.isEnabled;
|
|
343
360
|
var data = (0, _react.useMemo)(function () {
|
|
344
361
|
var viewVariant = 'default';
|
|
345
|
-
if (showRovoResolvedView && (
|
|
362
|
+
if (showRovoResolvedView && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_sl_3p_auth_rovo_action', 'isEnabled', true)) {
|
|
346
363
|
viewVariant = 'rovo-resolved-view';
|
|
347
364
|
} else if (showPreauthBetterHovercard) {
|
|
348
365
|
viewVariant = 'rovo-unauthorised-view';
|
|
349
366
|
}
|
|
350
367
|
return {
|
|
351
368
|
attributes: {
|
|
352
|
-
viewVariant: viewVariant
|
|
353
|
-
rovoActionsCtaShown: rovoActionsCtaShown
|
|
369
|
+
viewVariant: viewVariant
|
|
354
370
|
}
|
|
355
371
|
};
|
|
356
|
-
}, [showRovoResolvedView, showPreauthBetterHovercard
|
|
372
|
+
}, [showRovoResolvedView, showPreauthBetterHovercard]);
|
|
357
373
|
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
358
374
|
data: data
|
|
359
375
|
}, /*#__PURE__*/_react.default.createElement(HoverCardContent, (0, _extends2.default)({}, props, {
|
|
@@ -364,7 +380,6 @@ var _default_1 = (0, _platformFeatureFlagsReact.componentWithCondition)(function
|
|
|
364
380
|
// We need to read both of them to sutisfy some of the tests that expect both to be checked.
|
|
365
381
|
var flagA = (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
366
382
|
var flagB = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
367
|
-
|
|
368
|
-
return flagA || flagB || flagC;
|
|
383
|
+
return flagA || flagB;
|
|
369
384
|
}, HoverCardContentWithViewVariant, HoverCardContent);
|
|
370
385
|
var _default = exports.default = _default_1;
|
|
@@ -17,7 +17,6 @@ var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/us
|
|
|
17
17
|
var _constants = require("../../../../../constants");
|
|
18
18
|
var _analytics = require("../../../../../state/analytics");
|
|
19
19
|
var _useAiSummaryAction = _interopRequireDefault(require("../../../../../state/hooks/use-ai-summary-action"));
|
|
20
|
-
var _useInlineActionNudgeExperiment = _interopRequireDefault(require("../../../../../state/hooks/use-inline-action-nudge-experiment"));
|
|
21
20
|
var _FlexibleCard = _interopRequireDefault(require("../../../../FlexibleCard"));
|
|
22
21
|
var _blocks = require("../../../../FlexibleCard/components/blocks");
|
|
23
22
|
var _utils = require("../../../utils");
|
|
@@ -29,8 +28,7 @@ var snippetBlockCss = null;
|
|
|
29
28
|
var actionBlockCss = null;
|
|
30
29
|
var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
31
30
|
var _cardState$details;
|
|
32
|
-
var
|
|
33
|
-
cardState = _ref.cardState,
|
|
31
|
+
var cardState = _ref.cardState,
|
|
34
32
|
extensionKey = _ref.extensionKey,
|
|
35
33
|
flexibleCardProps = _ref.flexibleCardProps,
|
|
36
34
|
isAISummaryEnabled = _ref.isAISummaryEnabled,
|
|
@@ -40,14 +38,9 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
40
38
|
id = _ref.id;
|
|
41
39
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
42
40
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
43
|
-
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(flexibleCardProps.url, true, actionOptions),
|
|
44
|
-
InlineActionNudgeExperimentValue = _useInlineActionNudge.isEnabled;
|
|
45
|
-
|
|
46
41
|
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
47
42
|
// by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
|
|
48
43
|
var is3PAuthRovoActionsExperimentOn = showRovoResolvedView && (0, _expValEquals.expValEquals)('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
49
|
-
var is3PInlinePostAuthActionsExperimentOn = showRovoResolvedView && InlineActionNudgeExperimentValue;
|
|
50
|
-
var isAny3pRovoActionsExperimentOn = is3PAuthRovoActionsExperimentOn || is3PInlinePostAuthActionsExperimentOn;
|
|
51
44
|
(0, _react.useEffect)(function () {
|
|
52
45
|
// Since this hover view is only rendered on resolved status,
|
|
53
46
|
// there is no need to check for statuses.
|
|
@@ -95,7 +88,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
95
88
|
}), isAISummaryEnabled ? /*#__PURE__*/_react.default.createElement(_blocks.AISummaryBlock, {
|
|
96
89
|
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
97
90
|
placeholder: snippet,
|
|
98
|
-
isAny3pRovoActionsExperimentOn:
|
|
91
|
+
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn
|
|
99
92
|
}) : snippet, /*#__PURE__*/_react.default.createElement(_blocks.SnippetBlock, {
|
|
100
93
|
testId: "hidden-snippet",
|
|
101
94
|
onRender: onSnippetRender,
|
|
@@ -105,9 +98,9 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
105
98
|
}), /*#__PURE__*/_react.default.createElement(_blocks.ActionBlock, {
|
|
106
99
|
onClick: onActionClick,
|
|
107
100
|
spaceInline: "space.100",
|
|
108
|
-
isAny3pRovoActionsExperimentOn:
|
|
101
|
+
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn,
|
|
109
102
|
className: (0, _runtime.ax)(["_n3td1b66"])
|
|
110
|
-
}),
|
|
103
|
+
}), is3PAuthRovoActionsExperimentOn ? /*#__PURE__*/_react.default.createElement(_blocks.ResolvedHoverCardFooterBlock, {
|
|
111
104
|
onActionClick: onActionClick
|
|
112
105
|
}) : /*#__PURE__*/_react.default.createElement(_blocks.AIFooterBlock, null));
|
|
113
106
|
};
|
|
@@ -8,9 +8,7 @@ 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");
|
|
12
11
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
13
|
-
var _useInlineActionNudgeExperiment = _interopRequireDefault(require("../../../state/hooks/use-inline-action-nudge-experiment"));
|
|
14
12
|
var _useInlineTailoredActionExperiment = _interopRequireDefault(require("../../../state/hooks/use-inline-tailored-action-experiment"));
|
|
15
13
|
var _HoverCard = require("../../HoverCard");
|
|
16
14
|
var _rovoActionsCta = require("../common/rovo-actions-cta");
|
|
@@ -90,8 +88,6 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
90
88
|
type = _ref2.type,
|
|
91
89
|
hideIconLoadingSkeleton = _ref2.hideIconLoadingSkeleton,
|
|
92
90
|
lozenge = _ref2.lozenge;
|
|
93
|
-
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(link, showHoverPreview, actionOptions),
|
|
94
|
-
isEnabled = _useInlineActionNudge.isEnabled;
|
|
95
91
|
var _useInlineTailoredAct = (0, _useInlineTailoredActionExperiment.default)(link, showHoverPreview, actionOptions),
|
|
96
92
|
isInlineTailoredRovoActionEnabled = _useInlineTailoredAct.isEnabled;
|
|
97
93
|
|
|
@@ -112,9 +108,7 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
112
108
|
titleTextColor: titleTextColor,
|
|
113
109
|
type: type,
|
|
114
110
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
115
|
-
}), (0, _renderLozenge.renderLozenge)(lozenge),
|
|
116
|
-
testId: "".concat(testId, "-rovo-actions-cta")
|
|
117
|
-
}), isInlineTailoredRovoActionEnabled && /*#__PURE__*/_react.default.createElement(_rovoActionsCta.InlineRovoActionButton, {
|
|
111
|
+
}), (0, _renderLozenge.renderLozenge)(lozenge), isInlineTailoredRovoActionEnabled && /*#__PURE__*/_react.default.createElement(_rovoActionsCta.InlineRovoActionButton, {
|
|
118
112
|
testId: "".concat(testId, "-rovo-actions-cta"),
|
|
119
113
|
url: link
|
|
120
114
|
}));
|
|
@@ -130,4 +124,4 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
130
124
|
}
|
|
131
125
|
|
|
132
126
|
// Todo: replace with platform_sl_3p_auth_inline_tailored_cta_killswitch after cleanup of rovogrowth-640-inline-action-nudge-fg
|
|
133
|
-
var InlineCardResolvedViewFunctional = exports.InlineCardResolvedViewFunctional = (0, _platformFeatureFlagsReact.componentWithFG)('
|
|
127
|
+
var InlineCardResolvedViewFunctional = exports.InlineCardResolvedViewFunctional = (0, _platformFeatureFlagsReact.componentWithFG)('platform_sl_3p_auth_inline_tailored_cta_killswitch', InlineCardResolvedViewFunctionalWithRovoActions, InlineCardResolvedViewBase);
|
|
@@ -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: "44.23.
|
|
22
|
+
packageVersion: "44.23.2",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -37,9 +37,7 @@ var AISummary = function AISummary(_ref) {
|
|
|
37
37
|
}
|
|
38
38
|
var is3pExperimentEnabled =
|
|
39
39
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
40
|
-
(0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_sl_3p_auth_rovo_action', 'isEnabled', true)
|
|
41
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
42
|
-
(0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
40
|
+
(0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
43
41
|
return /*#__PURE__*/React.createElement(_markdownToJsx.default, {
|
|
44
42
|
"data-testid": testId
|
|
45
43
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:13d8e863b7dcc6b41eef967c98a4e961078c5442a20e9d14ce373567ec6ea6f9
|
|
3
|
+
size 12894
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:79dfaed74e187a22da54cdf220a9f681e089542858ba84b0ffeb7e77b787f626
|
|
3
|
+
size 2111
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
4
3
|
import { ActionName, CardAction } from '../../../constants';
|
|
5
4
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../../state/helpers';
|
|
6
5
|
import { isBlockCardRovoActionExperimentEnabled } from '../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
7
6
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
8
7
|
import { getIsRovoChatEnabled } from '../../../utils/rovo';
|
|
9
|
-
// For
|
|
8
|
+
// For block card experiment (NAVX-4814)
|
|
10
9
|
const 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']);
|
|
11
10
|
const extractRovoChatAction = ({
|
|
12
11
|
actionOptions,
|
|
@@ -28,9 +27,8 @@ const extractRovoChatAction = ({
|
|
|
28
27
|
const isGoogleProvider = extensionKey === 'google-object-provider';
|
|
29
28
|
const is3PBlockExperimentEnabled = isBlockCardRovoActionExperimentEnabled((_rovoConfig$product = rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product) !== null && _rovoConfig$product !== void 0 ? _rovoConfig$product : product);
|
|
30
29
|
const is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
31
|
-
const is3PInlinePostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
32
30
|
const is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && is3PBlockExperimentEnabled;
|
|
33
|
-
const isSupportedFeature =
|
|
31
|
+
const isSupportedFeature = is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
|
|
34
32
|
const isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
35
33
|
const url = extractSmartLinkUrl(response);
|
|
36
34
|
return isSupportedFeature && isOptIn ? {
|
|
@@ -48,7 +48,7 @@ export const extractFlexibleCardActions = ({
|
|
|
48
48
|
}),
|
|
49
49
|
[ActionName.AutomationAction]: extractAutomationAction(response),
|
|
50
50
|
[InternalActionName.AISummaryAction]: extractAISummaryAction(response, url, actionOptions, aiSummaryConfig),
|
|
51
|
-
...(fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
51
|
+
...(fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
52
52
|
[ActionName.RovoChatAction]: extractRovoChatAction({
|
|
53
53
|
actionOptions,
|
|
54
54
|
appearance,
|
|
@@ -44,7 +44,7 @@ const extractFlexibleUiContext = ({
|
|
|
44
44
|
fireEvent,
|
|
45
45
|
id,
|
|
46
46
|
origin,
|
|
47
|
-
...(fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
47
|
+
...(fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
48
48
|
product,
|
|
49
49
|
rovoConfig
|
|
50
50
|
} : undefined),
|
|
@@ -28,7 +28,7 @@ const useRovoChat = () => {
|
|
|
28
28
|
agentId: undefined
|
|
29
29
|
},
|
|
30
30
|
openChat: true,
|
|
31
|
-
openChatMode: isJiraProduct &&
|
|
31
|
+
openChatMode: isJiraProduct && fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') ? 'mini-modal' : 'sidebar'
|
|
32
32
|
},
|
|
33
33
|
onAcknowledgeTimeout: () => {
|
|
34
34
|
// NAVX-3599: Add analytics event
|
|
@@ -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: "44.23.
|
|
5
|
+
packageVersion: "44.23.2" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,4 +5,33 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export const isAuxClick = e => {
|
|
7
7
|
return e.button === 1;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Extracts `href` and `target` from the anchor element that is the event's `currentTarget`.
|
|
12
|
+
*
|
|
13
|
+
* Smart Link click handlers are attached to multiple card renderers (InlineCard, BlockCard,
|
|
14
|
+
* EmbedCard, FlexibleCard). When the handler needs to manually open a link — for example,
|
|
15
|
+
* when native anchor navigation has been prevented — it uses this helper to read the
|
|
16
|
+
* anchor's resolved URL and intended target from the event rather than re-deriving them.
|
|
17
|
+
*
|
|
18
|
+
* Returns `{ href: undefined, target: '_self' }` when `currentTarget` is not an anchor
|
|
19
|
+
* element (e.g. a button or wrapper div), so callers can safely fall back to a default target.
|
|
20
|
+
*
|
|
21
|
+
* @param event - A React mouse or keyboard event whose `currentTarget` may be an anchor.
|
|
22
|
+
* @returns The resolved absolute `href` and `target` attribute of the anchor, or safe
|
|
23
|
+
* defaults if `currentTarget` is not an anchor.
|
|
24
|
+
*/
|
|
25
|
+
export const getAnchorAttributesFromEvent = event => {
|
|
26
|
+
const currentTarget = event.currentTarget;
|
|
27
|
+
if (!(currentTarget instanceof HTMLAnchorElement)) {
|
|
28
|
+
return {
|
|
29
|
+
href: undefined,
|
|
30
|
+
target: '_self'
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
href: currentTarget.href,
|
|
35
|
+
target: currentTarget.target || '_self'
|
|
36
|
+
};
|
|
8
37
|
};
|