@atlaskit/smart-card 44.3.23 → 44.4.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 +20 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/vrblock-card-resolved-rovo-actions--default.png +3 -0
- package/dist/cjs/messages.js +10 -0
- package/dist/cjs/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +17 -11
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +4 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +10 -1
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +41 -26
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +29 -11
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.compiled.css +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +25 -7
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +3 -7
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-badge-element/index.js +6 -2
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +3 -7
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +4 -7
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/vrblock-card-resolved-rovo-actions--default.png +3 -0
- package/dist/es2019/messages.js +10 -0
- package/dist/es2019/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +29 -21
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +4 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +12 -3
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +41 -28
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +29 -12
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.compiled.css +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +22 -8
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +3 -7
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-badge-element/index.js +5 -2
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +3 -7
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +4 -7
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/vrblock-card-resolved-rovo-actions--default.png +3 -0
- package/dist/esm/messages.js +10 -0
- package/dist/esm/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +18 -12
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +4 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +12 -3
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +42 -27
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +30 -12
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.compiled.css +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +26 -8
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +3 -7
- package/dist/esm/view/FlexibleCard/components/elements/common/base-badge-element/index.js +6 -2
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +3 -7
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +4 -7
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +6 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-group/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-group/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/footer-block/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +7 -2
- package/dist/types/view/FlexibleCard/components/elements/common/base-badge-element/index.d.ts +5 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +6 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-group/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-group/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/footer-block/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +7 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-badge-element/index.d.ts +5 -0
- package/package.json +5 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 44.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`5039083517ce8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5039083517ce8) -
|
|
8
|
+
[ux] NAVX-4533 Updating icons and styling for Block Card 3P Post Auth experiment
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 44.3.24
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`0e8d752e6dbb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e8d752e6dbb2) -
|
|
19
|
+
fix the conditional for fg check for mini modal logic
|
|
20
|
+
- [`5f2a9a94761d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5f2a9a94761d1) -
|
|
21
|
+
FG Cleanup platform_sl_a11y_enghealth_46829
|
|
22
|
+
|
|
3
23
|
## 44.3.23
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/cjs/messages.js
CHANGED
|
@@ -1007,6 +1007,16 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
1007
1007
|
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>',
|
|
1008
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
1009
|
},
|
|
1010
|
+
rovo_prompt_button_key_highlights: {
|
|
1011
|
+
id: 'fabric.linking.rovo_prompt_button_find_open_questions.non-final',
|
|
1012
|
+
defaultMessage: "Key highlights",
|
|
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_key_highlights: {
|
|
1016
|
+
id: 'fabric.linking.rovo_prompt_message_find_open_questions.non-final',
|
|
1017
|
+
defaultMessage: '<p>Based on this <a>{url}</a> and the page or ticket 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>',
|
|
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.)'
|
|
1019
|
+
},
|
|
1010
1020
|
rovo_chat_action_section_header: {
|
|
1011
1021
|
id: 'fabric.linking.rovo_chat_action_section_header.non-final',
|
|
1012
1022
|
defaultMessage: 'Ask Rovo',
|
|
@@ -35,7 +35,7 @@ var useRovoChat = function useRovoChat() {
|
|
|
35
35
|
agentId: undefined
|
|
36
36
|
}),
|
|
37
37
|
openChat: true,
|
|
38
|
-
openChatMode: product && jiraProducts.includes(product) && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_jira_kill_switch') || (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') ? 'mini-modal' : 'sidebar'
|
|
38
|
+
openChatMode: product && jiraProducts.includes(product) && ((0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_jira_kill_switch') || (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg')) ? 'mini-modal' : 'sidebar'
|
|
39
39
|
},
|
|
40
40
|
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
41
41
|
// NAVX-3599: Add analytics event
|
|
@@ -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.3.
|
|
14
|
+
packageVersion: "44.3.24" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -80,7 +80,7 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
80
80
|
var prompts = (0, _react.useMemo)(function () {
|
|
81
81
|
if ((0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch')) {
|
|
82
82
|
var _cardState$details;
|
|
83
|
-
var defaultPrompts = [_rovoChatAction.RovoChatPromptKey.
|
|
83
|
+
var defaultPrompts = [_rovoChatAction.RovoChatPromptKey.KEY_HIGHLIGHTS];
|
|
84
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
85
|
if (extensionKey === 'slack-object-provider') {
|
|
86
86
|
return [_rovoChatAction.RovoChatPromptKey.FIND_OPEN_QUESTIONS].concat(defaultPrompts);
|
|
@@ -96,16 +96,21 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
96
96
|
return [];
|
|
97
97
|
}, [cardState === null || cardState === void 0 || (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data, extensionKey]);
|
|
98
98
|
var footerActions = (0, _react.useMemo)(function () {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
if (showRovoResolvedView && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch')) {
|
|
100
|
+
return [{
|
|
101
|
+
name: _constants.ActionName.RovoChatAction,
|
|
102
|
+
prompts: prompts,
|
|
103
|
+
iconSize: 'small',
|
|
104
|
+
cardAppearance: _constants.CardDisplay.Block
|
|
105
|
+
}, {
|
|
106
|
+
name: _constants.ActionName.FollowAction,
|
|
107
|
+
iconSize: 'small'
|
|
108
|
+
}, {
|
|
109
|
+
name: _constants.ActionName.DownloadAction,
|
|
110
|
+
iconSize: 'small'
|
|
111
|
+
}];
|
|
112
|
+
}
|
|
113
|
+
return [{
|
|
109
114
|
name: _constants.ActionName.FollowAction,
|
|
110
115
|
hideIcon: true
|
|
111
116
|
}, {
|
|
@@ -152,6 +157,7 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
152
157
|
}
|
|
153
158
|
})) : null, /*#__PURE__*/React.createElement(_blocks.FooterBlock, {
|
|
154
159
|
actions: footerActions,
|
|
160
|
+
isPreviewBlockErrored: isPreviewBlockErrored,
|
|
155
161
|
className: (0, _runtime.ax)(["_4t3i1k8s _1e0c1txw _1bah1yb4 _4cvresu3 _1wpz1fhb", safari && "_4t3i1osq"])
|
|
156
162
|
}));
|
|
157
163
|
};
|
package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.compiled.css
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
._11c8wadc{font:var(--ds-font-body-small,normal 400 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._13bowadc button{font:var(--ds-font-body-small,normal 400 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
3
|
._11lv1b66 button{padding-left:var(--ds-space-050,4px)}
|
|
3
4
|
._11lvidpf button{padding-left:0}
|
|
4
5
|
._11lvv77o button{padding-left:var(--ds-space-025,2px)}
|
|
@@ -12,10 +13,13 @@
|
|
|
12
13
|
._1gqnv77o button{padding-bottom:var(--ds-space-025,2px)}
|
|
13
14
|
._1i3bidpf button:active>span{margin-top:0}
|
|
14
15
|
._1l0qidpf button:hover>span{margin-right:0}
|
|
16
|
+
._1q9t1wq8 button{font-weight:var(--ds-font-weight-medium,500)}
|
|
17
|
+
._1rlg1g80 button{flex-wrap:wrap}
|
|
15
18
|
._1vtwidpf button:active>span{margin-left:0}
|
|
16
19
|
._3kh9idpf button:active>span{margin-bottom:0}
|
|
17
20
|
._4wlcidpf button:hover>span{margin-top:0}
|
|
18
21
|
._8pvjidpf button:hover>span{margin-bottom:0}
|
|
22
|
+
._bdn61h6o button{align-content:center}
|
|
19
23
|
._i2vxidpf button:focus>span{margin-bottom:0}
|
|
20
24
|
._ijvwidpf button:focus>span{margin-left:0}
|
|
21
25
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
@@ -10,8 +10,10 @@ exports.default = void 0;
|
|
|
10
10
|
require("./index.compiled.css");
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _react2 = require("@compiled/react");
|
|
13
14
|
var _button = require("@atlaskit/button");
|
|
14
15
|
var _new = _interopRequireWildcard(require("@atlaskit/button/new"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
17
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
18
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
19
|
var _constants = require("../../../../../../constants");
|
|
@@ -21,6 +23,9 @@ var _utils = require("../../../utils");
|
|
|
21
23
|
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); }
|
|
22
24
|
var IconOnlyLarge = null;
|
|
23
25
|
var SizeSmall = null;
|
|
26
|
+
var styles = {
|
|
27
|
+
textSmall: "_13bowadc _1q9t1wq8 _1rlg1g80 _bdn61h6o"
|
|
28
|
+
};
|
|
24
29
|
var SizeSmallIconOnly = null;
|
|
25
30
|
var SizeSmallNotIconOnly = null;
|
|
26
31
|
var IconButtonAppearanceMap = {
|
|
@@ -45,6 +50,7 @@ var tooltipOptions = {
|
|
|
45
50
|
hideTooltipOnClick: true
|
|
46
51
|
};
|
|
47
52
|
var ActionButtonRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
53
|
+
var _context$actions;
|
|
48
54
|
var _ref$appearance = _ref.appearance,
|
|
49
55
|
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
50
56
|
content = _ref.content,
|
|
@@ -59,6 +65,8 @@ var ActionButtonRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
59
65
|
href = _ref.href,
|
|
60
66
|
ariaLabel = _ref.ariaLabel;
|
|
61
67
|
var iconOnly = !content;
|
|
68
|
+
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
69
|
+
var isRovoSupported = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[_constants.ActionName.RovoChatAction]) && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
62
70
|
var onButtonClick = (0, _react.useCallback)(function (handler) {
|
|
63
71
|
return function (e) {
|
|
64
72
|
e.preventDefault();
|
|
@@ -141,7 +149,8 @@ var ActionButtonRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
141
149
|
}, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading, onButtonClick, onClick, size, testId, tooltipMessage]);
|
|
142
150
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
143
151
|
testId: "".concat(testId, "-button-wrapper"),
|
|
144
|
-
ref: ref
|
|
152
|
+
ref: ref,
|
|
153
|
+
xcss: (0, _react2.cx)(isRovoSupported && size === _constants.SmartLinkSize.Small && styles.textSmall)
|
|
145
154
|
}, button);
|
|
146
155
|
});
|
|
147
156
|
var ActionButtonRefreshWithOverrideCss = (0, _withOverrideCss.withOverrideCss)(ActionButtonRefresh);
|
package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
CHANGED
|
@@ -49,7 +49,7 @@ function AISummariseAction(_ref) {
|
|
|
49
49
|
spacing: "spacious",
|
|
50
50
|
color: "currentColor",
|
|
51
51
|
label: "Summarise with AI"
|
|
52
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
52
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
53
53
|
size: props.iconSize
|
|
54
54
|
} : {})),
|
|
55
55
|
onClick: handleActionClick,
|
|
@@ -86,7 +86,7 @@ var AutomationAction = function AutomationAction(props) {
|
|
|
86
86
|
spacing: "spacious",
|
|
87
87
|
color: "currentColor",
|
|
88
88
|
label: automationActionIconLabel
|
|
89
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
89
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
90
90
|
size: props.iconSize
|
|
91
91
|
} : {})),
|
|
92
92
|
testId: "smart-action-automation-action",
|
|
@@ -70,7 +70,7 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
|
70
70
|
color: "currentColor",
|
|
71
71
|
label: (0, _platformFeatureFlags.fg)('navx-3698-flexible-card-a11y-fix') ? '' : 'copy url',
|
|
72
72
|
spacing: "spacious"
|
|
73
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
73
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
74
74
|
size: props.iconSize
|
|
75
75
|
} : {})),
|
|
76
76
|
onClick: onClick,
|
|
@@ -44,7 +44,7 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
44
44
|
color: "currentColor",
|
|
45
45
|
spacing: "spacious",
|
|
46
46
|
label: (0, _platformFeatureFlags.fg)('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview panel'
|
|
47
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
47
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
48
48
|
size: props.iconSize
|
|
49
49
|
} : {}));
|
|
50
50
|
}
|
|
@@ -52,7 +52,7 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
52
52
|
color: "currentColor",
|
|
53
53
|
spacing: "spacious",
|
|
54
54
|
label: (0, _platformFeatureFlags.fg)('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview'
|
|
55
|
-
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
55
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
56
56
|
size: props.iconSize
|
|
57
57
|
} : {}));
|
|
58
58
|
}, [hasPreviewPanel, props.iconSize]);
|
|
@@ -13,10 +13,12 @@ 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"));
|
|
17
16
|
var _aiSearch = _interopRequireDefault(require("@atlaskit/icon-lab/core/ai-search"));
|
|
17
|
+
var _aiChat = _interopRequireDefault(require("@atlaskit/icon/core/ai-chat"));
|
|
18
18
|
var _aiGenerativeTextSummary = _interopRequireDefault(require("@atlaskit/icon/core/ai-generative-text-summary"));
|
|
19
19
|
var _rovoChat = _interopRequireDefault(require("@atlaskit/icon/core/rovo-chat"));
|
|
20
|
+
var _logo = require("@atlaskit/logo");
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
22
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
21
23
|
var _constants = require("../../../../../constants");
|
|
22
24
|
var _messages = require("../../../../../messages");
|
|
@@ -74,6 +76,8 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
74
76
|
var _getContext;
|
|
75
77
|
var url = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
76
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;
|
|
77
81
|
var _ref = (_getContext = getContext(intl, product)) !== null && _getContext !== void 0 ? _getContext : {
|
|
78
82
|
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_generic),
|
|
79
83
|
contextShort: intl.formatMessage(_messages.messages.rovo_prompt_context_generic)
|
|
@@ -145,7 +149,10 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
145
149
|
ignoreTag: true
|
|
146
150
|
});
|
|
147
151
|
return {
|
|
148
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
152
|
+
icon: cardAppearance === _constants.CardDisplay.Block && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
153
|
+
label: label_summarize,
|
|
154
|
+
size: iconSize
|
|
155
|
+
}) : /*#__PURE__*/_react.default.createElement(_aiEditIcon.default, null),
|
|
149
156
|
content: label_summarize,
|
|
150
157
|
tooltipMessage: label_summarize,
|
|
151
158
|
data: {
|
|
@@ -179,9 +186,9 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
179
186
|
}
|
|
180
187
|
}
|
|
181
188
|
};
|
|
182
|
-
case RovoChatPromptKey.
|
|
183
|
-
var
|
|
184
|
-
var
|
|
189
|
+
case RovoChatPromptKey.HIGHLIGHT_RELEVANT_CONTENT:
|
|
190
|
+
var label_highlight_relevant_content = intl.formatMessage(_messages.messages.rovo_prompt_button_highlight_relevant_content);
|
|
191
|
+
var html_highlight_relevant_content = intl.formatMessage(_messages.messages.rovo_prompt_message_highlight_relevant_content, {
|
|
185
192
|
context: contextLong,
|
|
186
193
|
url: url
|
|
187
194
|
}, {
|
|
@@ -189,12 +196,12 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
189
196
|
});
|
|
190
197
|
return {
|
|
191
198
|
icon: /*#__PURE__*/_react.default.createElement(_aiChapterIcon.default, null),
|
|
192
|
-
content:
|
|
193
|
-
tooltipMessage:
|
|
199
|
+
content: label_highlight_relevant_content,
|
|
200
|
+
tooltipMessage: label_highlight_relevant_content,
|
|
194
201
|
data: {
|
|
195
|
-
name:
|
|
202
|
+
name: label_highlight_relevant_content,
|
|
196
203
|
dialogues: [],
|
|
197
|
-
prompt: (0, _htmlToAdf.default)(
|
|
204
|
+
prompt: (0, _htmlToAdf.default)(html_highlight_relevant_content),
|
|
198
205
|
mode: {
|
|
199
206
|
fastModeEnabled: true
|
|
200
207
|
}
|
|
@@ -206,7 +213,11 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
206
213
|
url: url
|
|
207
214
|
});
|
|
208
215
|
return {
|
|
209
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
216
|
+
icon: cardAppearance === _constants.CardDisplay.Block && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? /*#__PURE__*/_react.default.createElement(_logo.RovoIcon, {
|
|
217
|
+
label: label_ask_rovo_anything,
|
|
218
|
+
size: 'xxsmall',
|
|
219
|
+
shouldUseHexLogo: true
|
|
220
|
+
}) : /*#__PURE__*/_react.default.createElement(_aiSearchIcon.default, null),
|
|
210
221
|
content: label_ask_rovo_anything,
|
|
211
222
|
tooltipMessage: label_ask_rovo_anything,
|
|
212
223
|
data: {
|
|
@@ -236,24 +247,25 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
236
247
|
placeholderType: 'generic'
|
|
237
248
|
}
|
|
238
249
|
};
|
|
239
|
-
case RovoChatPromptKey.
|
|
240
|
-
var
|
|
241
|
-
var
|
|
250
|
+
case RovoChatPromptKey.KEY_HIGHLIGHTS:
|
|
251
|
+
var label_key_highlights = intl.formatMessage(_messages.messages.rovo_prompt_button_key_highlights);
|
|
252
|
+
var html_key_highlights = intl.formatMessage(_messages.messages.rovo_prompt_message_key_highlights, {
|
|
242
253
|
context: contextLong,
|
|
243
254
|
url: url
|
|
244
255
|
}, {
|
|
245
256
|
ignoreTag: true
|
|
246
257
|
});
|
|
247
258
|
return {
|
|
248
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
249
|
-
label:
|
|
259
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
260
|
+
label: label_key_highlights,
|
|
261
|
+
size: iconSize
|
|
250
262
|
}),
|
|
251
|
-
content:
|
|
252
|
-
tooltipMessage:
|
|
263
|
+
content: label_key_highlights,
|
|
264
|
+
tooltipMessage: label_key_highlights,
|
|
253
265
|
data: {
|
|
254
|
-
name:
|
|
266
|
+
name: label_key_highlights,
|
|
255
267
|
dialogues: [],
|
|
256
|
-
prompt: (0, _htmlToAdf.default)(
|
|
268
|
+
prompt: (0, _htmlToAdf.default)(html_key_highlights)
|
|
257
269
|
}
|
|
258
270
|
};
|
|
259
271
|
case RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT:
|
|
@@ -284,8 +296,9 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
284
296
|
ignoreTag: true
|
|
285
297
|
});
|
|
286
298
|
return {
|
|
287
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
288
|
-
label: label_identify_key_trends
|
|
299
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
300
|
+
label: label_identify_key_trends,
|
|
301
|
+
size: iconSize
|
|
289
302
|
}),
|
|
290
303
|
content: label_identify_key_trends,
|
|
291
304
|
tooltipMessage: label_identify_key_trends,
|
|
@@ -303,8 +316,9 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
303
316
|
ignoreTag: true
|
|
304
317
|
});
|
|
305
318
|
return {
|
|
306
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
307
|
-
label: label_identify_key_points
|
|
319
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
320
|
+
label: label_identify_key_points,
|
|
321
|
+
size: iconSize
|
|
308
322
|
}),
|
|
309
323
|
content: label_identify_key_points,
|
|
310
324
|
tooltipMessage: label_identify_key_points,
|
|
@@ -322,8 +336,9 @@ var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
|
322
336
|
ignoreTag: true
|
|
323
337
|
});
|
|
324
338
|
return {
|
|
325
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
326
|
-
label: label_find_open_questions
|
|
339
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiChat.default, {
|
|
340
|
+
label: label_find_open_questions,
|
|
341
|
+
size: iconSize
|
|
327
342
|
}),
|
|
328
343
|
content: label_find_open_questions,
|
|
329
344
|
tooltipMessage: label_find_open_questions,
|
|
@@ -385,7 +400,7 @@ var RovoChatAction = function RovoChatAction(_ref2) {
|
|
|
385
400
|
}, [data === null || data === void 0 ? void 0 : data.invokeAction, invoke, onClickCallback, sendPromptMessage]);
|
|
386
401
|
var promptActions = (0, _react.useMemo)(function () {
|
|
387
402
|
return resolvedPrompts.map(function (promptKey, idx) {
|
|
388
|
-
var _ref3 = getPromptAction(promptKey, intl, data === null || data === void 0 ? void 0 : data.url, data === null || data === void 0 ? void 0 : data.product) || {},
|
|
403
|
+
var _ref3 = 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) || {},
|
|
389
404
|
icon = _ref3.icon,
|
|
390
405
|
content = _ref3.content,
|
|
391
406
|
tooltipMessage = _ref3.tooltipMessage,
|
|
@@ -26,6 +26,7 @@ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
|
26
26
|
var _constants = require("../../../../../constants");
|
|
27
27
|
var _messages = require("../../../../../messages");
|
|
28
28
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
29
|
+
var _rovoChatAction = require("../../actions/rovo-chat-action");
|
|
29
30
|
var _utils = require("../../utils");
|
|
30
31
|
var _utils2 = require("../utils");
|
|
31
32
|
var _actionGroupItem = _interopRequireDefault(require("./action-group-item"));
|
|
@@ -33,6 +34,8 @@ var _excluded = ["triggerRef"];
|
|
|
33
34
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
34
35
|
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
36
|
var styles = null;
|
|
37
|
+
var FULL_ACTIONS_SIZE = 450;
|
|
38
|
+
var REDUCED_ACTIONS_SIZE = 360;
|
|
36
39
|
var renderActionItems = function renderActionItems() {
|
|
37
40
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
38
41
|
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _constants.SmartLinkSize.Medium;
|
|
@@ -67,7 +70,9 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
67
70
|
appearance = _ref.appearance,
|
|
68
71
|
_ref$visibleButtonsNu = _ref.visibleButtonsNum,
|
|
69
72
|
visibleButtonsNum = _ref$visibleButtonsNu === void 0 ? 2 : _ref$visibleButtonsNu,
|
|
70
|
-
onDropdownOpenChange = _ref.onDropdownOpenChange
|
|
73
|
+
onDropdownOpenChange = _ref.onDropdownOpenChange,
|
|
74
|
+
_ref$containerWidth = _ref.containerWidth,
|
|
75
|
+
containerWidth = _ref$containerWidth === void 0 ? Infinity : _ref$containerWidth;
|
|
71
76
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
72
77
|
var ui = (0, _flexibleUiContext.useFlexibleUiOptionContext)();
|
|
73
78
|
var _useState = (0, _react.useState)(false),
|
|
@@ -78,7 +83,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
78
83
|
return (0, _utils2.filterActionItems)(items, context);
|
|
79
84
|
}, [context, items]);
|
|
80
85
|
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]);
|
|
86
|
+
var isRovoActionsEnabled = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[_constants.ActionName.RovoChatAction]) && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
82
87
|
var onOpenChange = (0, _react.useCallback)(function (attrs) {
|
|
83
88
|
setIsOpen(attrs.isOpen);
|
|
84
89
|
if (onDropdownOpenChange) {
|
|
@@ -93,21 +98,34 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
93
98
|
}
|
|
94
99
|
}, [isOpen, onOpenChange]);
|
|
95
100
|
var actionButtons = (0, _react.useMemo)(function () {
|
|
96
|
-
if (isRovoActionsEnabled
|
|
97
|
-
var rovoActions = [].concat((0, _toConsumableArray2.default)(renderableActionItems.slice(0, visibleButtonsNum - 1)), [{
|
|
98
|
-
name: _constants.ActionName.
|
|
99
|
-
|
|
101
|
+
if (isRovoActionsEnabled) {
|
|
102
|
+
var rovoActions = [].concat((0, _toConsumableArray2.default)(containerWidth >= REDUCED_ACTIONS_SIZE ? renderableActionItems.slice(0, visibleButtonsNum - 1) : []), [{
|
|
103
|
+
name: _constants.ActionName.RovoChatAction,
|
|
104
|
+
prompts: [_rovoChatAction.RovoChatPromptKey.ASK_ROVO_ANYTHING],
|
|
105
|
+
iconSize: 'small',
|
|
106
|
+
cardAppearance: _constants.CardDisplay.Block,
|
|
107
|
+
hideContent: containerWidth < FULL_ACTIONS_SIZE && containerWidth >= REDUCED_ACTIONS_SIZE
|
|
100
108
|
}, {
|
|
101
109
|
name: _constants.ActionName.CopyLinkAction,
|
|
102
|
-
hideContent: true
|
|
110
|
+
hideContent: true,
|
|
111
|
+
iconSize: 'small'
|
|
112
|
+
}, {
|
|
113
|
+
name: _constants.ActionName.PreviewAction,
|
|
114
|
+
hideContent: true,
|
|
115
|
+
iconSize: 'small'
|
|
103
116
|
}]);
|
|
104
117
|
return renderActionItems(rovoActions, size, appearance, false, onActionItemClick);
|
|
105
118
|
}
|
|
106
119
|
var actionItems = isMoreThenTwoItems ? renderableActionItems.slice(0, visibleButtonsNum - 1) : renderableActionItems;
|
|
107
120
|
return renderActionItems(actionItems, size, appearance, false, onActionItemClick);
|
|
108
|
-
}, [appearance, isMoreThenTwoItems, onActionItemClick, renderableActionItems, size, visibleButtonsNum,
|
|
121
|
+
}, [appearance, isMoreThenTwoItems, isRovoActionsEnabled, onActionItemClick, renderableActionItems, size, visibleButtonsNum, containerWidth]);
|
|
109
122
|
var moreActionDropdown = (0, _react.useMemo)(function () {
|
|
110
|
-
var actionItems
|
|
123
|
+
var actionItems;
|
|
124
|
+
if (isRovoActionsEnabled && containerWidth < REDUCED_ACTIONS_SIZE) {
|
|
125
|
+
actionItems = renderableActionItems;
|
|
126
|
+
} else {
|
|
127
|
+
actionItems = isMoreThenTwoItems ? renderableActionItems.slice(visibleButtonsNum - 1) : [];
|
|
128
|
+
}
|
|
111
129
|
if (actionItems.length > 0) {
|
|
112
130
|
var spacing = _utils.sizeToButtonSpacing[size];
|
|
113
131
|
var moreIcon = /*#__PURE__*/React.createElement(_showMoreHorizontal.default, {
|
|
@@ -127,7 +145,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
127
145
|
testId: "action-group-more-button-tooltip",
|
|
128
146
|
tag: "span"
|
|
129
147
|
}, /*#__PURE__*/React.createElement(_standardButton.default, (0, _extends2.default)({}, props, {
|
|
130
|
-
spacing: spacing,
|
|
148
|
+
spacing: isRovoActionsEnabled && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ? size === _constants.SmartLinkSize.XLarge ? 'default' : 'compact' : spacing,
|
|
131
149
|
testId: "action-group-more-button",
|
|
132
150
|
iconBefore: moreIcon,
|
|
133
151
|
ref: triggerRef
|
|
@@ -140,7 +158,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
140
158
|
}, renderActionItems(actionItems, size, appearance, true, onActionItemClick));
|
|
141
159
|
}
|
|
142
160
|
return null;
|
|
143
|
-
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum,
|
|
161
|
+
}, [appearance, isMoreThenTwoItems, isOpen, isRovoActionsEnabled, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum, containerWidth]);
|
|
144
162
|
return renderableActionItems.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
145
163
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
146
164
|
className: (0, _runtime.ax)(["_1e0c116y _dzc21h6o _1ilq1i6y", "actions-button-group"]),
|
|
@@ -12,8 +12,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
16
|
var _userAgent = require("@atlaskit/linking-common/user-agent");
|
|
16
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
|
+
var _widthDetector = require("@atlaskit/width-detector");
|
|
17
19
|
var _constants = require("../../../../../../constants");
|
|
18
20
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
19
21
|
var _elements = require("../../../elements");
|
|
@@ -24,6 +26,8 @@ var _utils = require("../../utils");
|
|
|
24
26
|
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); }
|
|
25
27
|
var actionGroupStyles = null;
|
|
26
28
|
var safariStyles = null;
|
|
29
|
+
var providerStyles = null;
|
|
30
|
+
var rovoActionStyles = null;
|
|
27
31
|
var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
28
32
|
var _context$actions;
|
|
29
33
|
var actions = props.actions,
|
|
@@ -31,9 +35,11 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
|
31
35
|
onActionMenuOpenChange = props.onActionMenuOpenChange,
|
|
32
36
|
_props$size = props.size,
|
|
33
37
|
size = _props$size === void 0 ? _constants.SmartLinkSize.Medium : _props$size,
|
|
34
|
-
hideProvider = props.hideProvider
|
|
38
|
+
hideProvider = props.hideProvider,
|
|
39
|
+
isPreviewBlockErrored = props.isPreviewBlockErrored;
|
|
35
40
|
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]);
|
|
41
|
+
var isRovoSupportedFeature = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[_constants.ActionName.RovoChatAction]) && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
42
|
+
var hasPreview = isRovoSupportedFeature && !!(context !== null && context !== void 0 && context.preview) && !isPreviewBlockErrored;
|
|
37
43
|
var hasActions = (0, _react.useMemo)(function () {
|
|
38
44
|
var _filterActionItems;
|
|
39
45
|
return ((_filterActionItems = (0, _utils.filterActionItems)(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
@@ -52,22 +58,34 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
|
52
58
|
});
|
|
53
59
|
}
|
|
54
60
|
}, [onActionMenuOpenChange]);
|
|
61
|
+
|
|
62
|
+
// WidthObserver fires whenever the footer's available width changes.
|
|
63
|
+
var _useState = (0, _react.useState)(undefined),
|
|
64
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
65
|
+
containerWidth = _useState2[0],
|
|
66
|
+
setContainerWidth = _useState2[1];
|
|
55
67
|
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
56
68
|
testId: "".concat(testId, "-resolved-view")
|
|
57
69
|
}), !hideProvider && /*#__PURE__*/React.createElement(_elements.Provider, {
|
|
58
70
|
appearance: "subtle",
|
|
59
|
-
testId: "".concat(testId, "-provider")
|
|
71
|
+
testId: "".concat(testId, "-provider"),
|
|
72
|
+
hideLabel: hasPreview,
|
|
73
|
+
className: (0, _runtime.ax)([isRovoSupportedFeature && "_1wpz1h6o"])
|
|
60
74
|
}), actions && hasActions ? /*#__PURE__*/React.createElement(_elementGroup.default, {
|
|
61
75
|
testId: "smart-element-group-actions",
|
|
62
76
|
align: _constants.SmartLinkAlignment.Right,
|
|
63
77
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
64
78
|
width: _constants.SmartLinkWidth.Flexible,
|
|
65
|
-
className: (0, _runtime.ax)([size === _constants.SmartLinkSize.XLarge && "_c71lxy5q", safari && "_4t3i1osq"])
|
|
66
|
-
}, /*#__PURE__*/React.createElement(
|
|
79
|
+
className: (0, _runtime.ax)([size === _constants.SmartLinkSize.XLarge && "_c71lxy5q", safari && "_4t3i1osq", isRovoSupportedFeature && "_kqswh2mm"])
|
|
80
|
+
}, isRovoSupportedFeature && /*#__PURE__*/React.createElement(_widthDetector.WidthObserver, {
|
|
81
|
+
setWidth: setContainerWidth,
|
|
82
|
+
offscreen: true
|
|
83
|
+
}), /*#__PURE__*/React.createElement(_actionGroup.default, {
|
|
67
84
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
68
85
|
items: actions,
|
|
69
|
-
appearance: isRovoSupportedFeature
|
|
70
|
-
size: size
|
|
86
|
+
appearance: isRovoSupportedFeature ? 'subtle' : 'default',
|
|
87
|
+
size: isRovoSupportedFeature ? _constants.SmartLinkSize.Small : size,
|
|
88
|
+
containerWidth: isRovoSupportedFeature ? containerWidth : undefined
|
|
71
89
|
})) : null);
|
|
72
90
|
};
|
|
73
91
|
var _default = exports.default = FooterBlockResolvedView;
|
|
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
11
|
var _constants = require("../../../../../constants");
|
|
14
12
|
var _utils = require("../../../../../utils");
|
|
15
13
|
var _HoverCard = require("../../../../HoverCard");
|
|
@@ -72,14 +70,12 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
72
70
|
actionOptions: actionOptions,
|
|
73
71
|
url: url,
|
|
74
72
|
hoverPreviewOptions: hoverPreviewOptions
|
|
75
|
-
}, /*#__PURE__*/_react.default.createElement("span",
|
|
76
|
-
onBlur: _utils.noop
|
|
77
|
-
} : undefined, {
|
|
78
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
74
|
+
onBlur: _utils.noop,
|
|
79
75
|
onMouseLeave: onMouseLeave,
|
|
80
76
|
onMouseMove: onMouseMove,
|
|
81
77
|
"data-testid": "".concat(testId, "-hover-card-wrapper"),
|
|
82
78
|
role: 'presentation'
|
|
83
|
-
}
|
|
79
|
+
}, children));
|
|
84
80
|
};
|
|
85
81
|
var _default = exports.default = HoverCardControl;
|