@atlaskit/smart-card 45.6.9 → 45.6.11
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 +17 -0
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +1 -3
- package/dist/cjs/messages.js +0 -40
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +14 -7
- package/dist/cjs/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/cjs/view/EmbedModal/index.js +29 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +8 -6
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +4 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/index.js +5 -16
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +3 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +9 -37
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +2 -11
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-summary/index.compiled.css +0 -1
- package/dist/cjs/view/common/ai-summary/index.js +2 -8
- package/dist/cjs/view/common/rovo-chat-utils/index.js +4 -68
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +1 -3
- package/dist/es2019/messages.js +0 -40
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +13 -6
- package/dist/es2019/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/es2019/view/EmbedModal/index.js +30 -3
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +8 -6
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +3 -7
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/index.js +3 -12
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +3 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +9 -37
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -12
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-summary/index.compiled.css +0 -1
- package/dist/es2019/view/common/ai-summary/index.js +2 -8
- package/dist/es2019/view/common/rovo-chat-utils/index.js +4 -68
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +1 -3
- package/dist/esm/messages.js +0 -40
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedModal/components/link-info/index.js +14 -7
- package/dist/esm/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/esm/view/EmbedModal/index.js +30 -3
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +8 -6
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +2 -3
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +4 -8
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/index.js +5 -14
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +3 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +9 -37
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -12
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-summary/index.compiled.css +0 -1
- package/dist/esm/view/common/ai-summary/index.js +2 -8
- package/dist/esm/view/common/rovo-chat-utils/index.js +4 -68
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/view/EmbedModal/components/link-info/index.d.ts +1 -1
- package/dist/types/view/EmbedModal/components/link-info/link-info-button/index.d.ts +3 -2
- package/dist/types/view/EmbedModal/components/link-info/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +1 -2
- package/dist/types/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-block/types.d.ts +0 -4
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +0 -4
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +1 -2
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +0 -1
- package/dist/types/view/HoverCard/types.d.ts +0 -1
- package/dist/types/view/common/rovo-chat-utils/index.d.ts +0 -3
- package/package.json +6 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 45.6.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a6bff0d62fbcd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a6bff0d62fbcd) -
|
|
8
|
+
NAVX-4719 Adding keyboard focus support for embed modal
|
|
9
|
+
- [`3d8749ffa2391`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d8749ffa2391) -
|
|
10
|
+
Clean up platform_sl_3p_auth_rovo_action_kill_switch
|
|
11
|
+
|
|
12
|
+
## 45.6.10
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`e1ed54d330de5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1ed54d330de5) -
|
|
17
|
+
Cleanup platform_sl_3p_auth_rovo_action (no ship)
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 45.6.9
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -30,12 +30,10 @@ var extractRovoChatAction = function extractRovoChatAction(_ref) {
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
var extensionKey = (0, _helpers.getExtensionKey)(response);
|
|
33
|
-
var isGoogleProvider = extensionKey === 'google-object-provider';
|
|
34
33
|
var isInlineExperimentEnabled = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_inline_tailored_cta_killswitch') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_sl_3p_auth_inline_tailored_cta', 'isEnabled', true);
|
|
35
|
-
var is3PAuthRovoActionEnabled = isGoogleProvider && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
36
34
|
var is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && (rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product) === 'CONFLUENCE';
|
|
37
35
|
var is3PEmbedPostAuthActionsEnabled = isEmbedRovoActionsFooterExperimentEnabled === true;
|
|
38
|
-
var isSupportedFeature =
|
|
36
|
+
var isSupportedFeature = is3PBlockPostAuthActionsEnabled || isInlineExperimentEnabled || is3PEmbedPostAuthActionsEnabled;
|
|
39
37
|
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
40
38
|
var url = (0, _linkExtractors.extractSmartLinkUrl)(response);
|
|
41
39
|
return isSupportedFeature && isOptIn ? {
|
package/dist/cjs/messages.js
CHANGED
|
@@ -992,51 +992,11 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
992
992
|
defaultMessage: 'Confluence page',
|
|
993
993
|
description: 'The Confluence page the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
994
994
|
},
|
|
995
|
-
rovo_prompt_context_confluence_page_short: {
|
|
996
|
-
id: 'fabric.linking.rovo_prompt_context_confluence_page_short.non-final',
|
|
997
|
-
defaultMessage: 'page',
|
|
998
|
-
description: 'The Confluence page the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
999
|
-
},
|
|
1000
995
|
rovo_prompt_context_jira_work_item: {
|
|
1001
996
|
id: 'fabric.linking.rovo_prompt_context_jira_work_item.non-final',
|
|
1002
997
|
defaultMessage: 'Jira work item',
|
|
1003
998
|
description: 'The Jira work item the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
1004
999
|
},
|
|
1005
|
-
rovo_prompt_context_jira_work_item_short: {
|
|
1006
|
-
id: 'fabric.linking.rovo_prompt_context_jira_work_item_short.non-final',
|
|
1007
|
-
defaultMessage: 'work item',
|
|
1008
|
-
description: 'The Jira work item the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
1009
|
-
},
|
|
1010
|
-
rovo_prompt_button_recommend_other_sources: {
|
|
1011
|
-
id: 'fabric.linking.rovo_prompt_button_recommend_other_sources.non-final',
|
|
1012
|
-
defaultMessage: 'Recommend other sources',
|
|
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_recommend_other_sources: {
|
|
1016
|
-
id: 'fabric.linking.rovo_prompt_message_recommend_other_sources.non-final',
|
|
1017
|
-
defaultMessage: '<p>From this <a>{url}</a> and the {context} I’m viewing now as context:</p><ul><li><p>Search across all sources I can access for items that discuss <b>similar concepts, themes, or problems</b>, or that <b>reference similar or closely related sources</b> (including links to the same or related pages, issues, or docs).</p></li><li><p>Return the results as a list or table with columns: <code>Item</code>, <code>Type</code>, <code>Short summary</code>, and <code>Why it’s similar</code>.</p></li><li><p>For each result, give a one‑sentence <b>Short summary</b> of what the item is about.</p></li><li><p>In <b>Why it’s similar</b>, briefly explain (in a phrase or short sentence) what makes it related to this Smart Link and/or the item I’m viewing (for example: same project, similar decision, shared requirements, overlapping stakeholders, similar metrics, or referencing related docs).</p></li><li><p>Order the list from <b>most to least relevant</b> based on Rovo’s assessment of semantic similarity to both the Smart Link target and the current item. Prioritize items that I do not own or have not contributed to.</p></li><li><p>If there are more than 5 results, show the <b>5 most relevant</b> and state how many additional items you found.</p></li></ul>',
|
|
1018
|
-
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
1019
|
-
},
|
|
1020
|
-
rovo_prompt_button_show_other_mentions: {
|
|
1021
|
-
id: 'fabric.linking.rovo_prompt_button_show_other_mentions.non-final',
|
|
1022
|
-
defaultMessage: 'Show other mentions',
|
|
1023
|
-
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1024
|
-
},
|
|
1025
|
-
rovo_prompt_message_show_other_mentions: {
|
|
1026
|
-
id: 'fabric.linking.rovo_prompt_message_show_other_mentions.non-final',
|
|
1027
|
-
defaultMessage: '<p>From <a>{url}</a> and the {context} I’m viewing now:</p><ul><li><p>Search across all Confluence pages and Jira work items I can access for other items that contain this exact Smart Link (same underlying URL/resource).</p></li><li><p>List all matching items in a table with columns: <code>Item</code>, <code>Type</code>, <code>Short summary</code>, <code>How this item uses the link</code>, and <code>Relevance to current item</code>.</p></li><li><p>For <code>Short summary</code>, give a one‑sentence description of what the {context} is about.</p></li><li><p>For <code>How this item uses the link</code>, briefly explain the role this link plays there (e.g., decision doc, background context, implementation details, status update).</p></li><li><p>For <code>Relevance to current item</code>, compare each item to the {context} I’m viewing now and label it <code>High</code>, <code>Medium</code>, or <code>Low</code> relevance, with a short reason (a phrase or single clause).</p></li><li><p>If there are more than 15 matches, show the 15 most relevant and tell me how many additional matches exist.</p></li></ul>',
|
|
1028
|
-
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
1029
|
-
},
|
|
1030
|
-
rovo_prompt_button_suggest_improvement: {
|
|
1031
|
-
id: 'fabric.linking.rovo_prompt_button_suggest_improvement.non-final',
|
|
1032
|
-
defaultMessage: 'Suggest {context} improvement',
|
|
1033
|
-
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1034
|
-
},
|
|
1035
|
-
rovo_prompt_message_suggest_improvement: {
|
|
1036
|
-
id: 'fabric.linking.rovo_prompt_message_suggest_improvement.non-final',
|
|
1037
|
-
defaultMessage: '<p>Using the {context} I’m viewing now, plus all files and links referenced in it (including <a>{url}</a>):</p><ul><li><p>Identify unclear reasoning, missing context, or contradictions between the item and its linked files.</p></li><li><p>Call out any places where assumptions are not backed up by data or prior docs.</p></li><li><p>Stay concise: summarize your findings in <b>no more than three short paragraphs of content listed as bullets</b> of no more than a couple of sentences long focused only on the two points above.</p></li><li><p>After presenting that summary, <b>ask me explicitly</b> if I want you to go deeper. Only if I say yes, then:</p><ul><li><p>Suggest concrete rewrites (bullets or short paragraphs) to make the argument clearer, more concise, and better aligned with the supporting files.</p></li><li><p>Propose 3–5 follow‑up edits or additions that would make this item and its linked docs “share‑ready” for stakeholders.</p></li></ul></li></ul>',
|
|
1038
|
-
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
1039
|
-
},
|
|
1040
1000
|
rovo_prompt_message_summarize: {
|
|
1041
1001
|
id: 'fabric.linking.rovo_prompt_message_summarize.non-final',
|
|
1042
1002
|
defaultMessage: '<p>Summarize the main ideas and key points of <a>{url}</a> in 3-5 clear, complete bullet points (markdown list).</p><p>Preserve important details such as names, dates, and key decisions.</p>',
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card" || '',
|
|
14
|
-
packageVersion: "45.6.
|
|
14
|
+
packageVersion: "45.6.10" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("./index.compiled.css");
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _reactIntl = require("react-intl");
|
|
14
15
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
@@ -17,6 +18,7 @@ var _fullscreenEnter = _interopRequireDefault(require("@atlaskit/icon/core/fulls
|
|
|
17
18
|
var _fullscreenExit = _interopRequireDefault(require("@atlaskit/icon/core/fullscreen-exit"));
|
|
18
19
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
19
20
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
22
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
21
23
|
var _messages = require("../../../../messages");
|
|
22
24
|
var _Icon = require("../../../common/Icon");
|
|
@@ -42,13 +44,14 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
42
44
|
onViewButtonClick = _ref.onViewButtonClick,
|
|
43
45
|
size = _ref.size,
|
|
44
46
|
testId = _ref.testId,
|
|
45
|
-
title = _ref.title
|
|
47
|
+
title = _ref.title,
|
|
48
|
+
focusRef = _ref.focusRef;
|
|
46
49
|
var _useModal = (0, _modalDialog.useModal)(),
|
|
47
50
|
onClose = _useModal.onClose;
|
|
48
51
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
49
52
|
formatMessage = _useIntl.formatMessage;
|
|
50
53
|
var downloadButton = (0, _react.useMemo)(function () {
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, {
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, (0, _extends2.default)({
|
|
52
55
|
content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.download),
|
|
53
56
|
icon: function icon() {
|
|
54
57
|
return /*#__PURE__*/_react.default.createElement(_download.default, {
|
|
@@ -60,15 +63,17 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
60
63
|
label: formatMessage(_messages.messages.download),
|
|
61
64
|
onClick: onDownloadButtonClick,
|
|
62
65
|
testId: "".concat(testId, "-download")
|
|
63
|
-
})
|
|
64
|
-
|
|
66
|
+
}, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
67
|
+
focusRef: focusRef
|
|
68
|
+
} : {}));
|
|
69
|
+
}, [onDownloadButtonClick, testId, formatMessage, focusRef]);
|
|
65
70
|
var urlButton = (0, _react.useMemo)(function () {
|
|
66
71
|
if (onViewButtonClick) {
|
|
67
72
|
var label = providerName ? formatMessage(_messages.messages.viewInProvider, {
|
|
68
73
|
providerName: providerName
|
|
69
74
|
}) : formatMessage(_messages.messages.viewOriginal);
|
|
70
75
|
var content = providerName ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.viewIn), " ", providerName) : /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.viewOriginal);
|
|
71
|
-
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, {
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, (0, _extends2.default)({
|
|
72
77
|
content: content,
|
|
73
78
|
icon: function icon() {
|
|
74
79
|
return /*#__PURE__*/_react.default.createElement(_linkExternal.default, {
|
|
@@ -81,9 +86,11 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
81
86
|
onClick: onViewButtonClick,
|
|
82
87
|
testId: "".concat(testId, "-url"),
|
|
83
88
|
role: 'link'
|
|
84
|
-
})
|
|
89
|
+
}, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
90
|
+
focusRef: !onDownloadButtonClick ? focusRef : undefined
|
|
91
|
+
} : {}));
|
|
85
92
|
}
|
|
86
|
-
}, [onViewButtonClick, providerName, testId, formatMessage]);
|
|
93
|
+
}, [onViewButtonClick, providerName, testId, formatMessage, onDownloadButtonClick, focusRef]);
|
|
87
94
|
var sizeButton = (0, _react.useMemo)(function () {
|
|
88
95
|
var isFullScreen = size === _constants.MAX_MODAL_SIZE;
|
|
89
96
|
var message = isFullScreen ? _messages.messages.preview_min_size : _messages.messages.preview_max_size;
|
|
@@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _new = require("@atlaskit/button/new");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
12
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
11
13
|
var _useLinkClicked = require("../../../../../state/analytics/useLinkClicked");
|
|
12
14
|
var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
@@ -15,14 +17,15 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
15
17
|
label = _ref.label,
|
|
16
18
|
onClick = _ref.onClick,
|
|
17
19
|
testId = _ref.testId,
|
|
18
|
-
role = _ref.role
|
|
20
|
+
role = _ref.role,
|
|
21
|
+
focusRef = _ref.focusRef;
|
|
19
22
|
var onMouseDown = (0, _useLinkClicked.useMouseDownEvent)();
|
|
20
23
|
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
21
24
|
content: content,
|
|
22
25
|
hideTooltipOnClick: true,
|
|
23
26
|
tag: "span",
|
|
24
27
|
testId: "".concat(testId, "-tooltip")
|
|
25
|
-
}, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
|
|
28
|
+
}, /*#__PURE__*/_react.default.createElement(_new.IconButton, (0, _extends2.default)({
|
|
26
29
|
appearance: "subtle",
|
|
27
30
|
icon: icon,
|
|
28
31
|
label: label,
|
|
@@ -30,6 +33,8 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
30
33
|
onMouseDown: onMouseDown,
|
|
31
34
|
testId: "".concat(testId, "-button"),
|
|
32
35
|
role: role
|
|
33
|
-
}))
|
|
36
|
+
}, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
37
|
+
ref: focusRef
|
|
38
|
+
} : {})));
|
|
34
39
|
};
|
|
35
40
|
var _default = exports.default = LinkInfoButton;
|
|
@@ -10,6 +10,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _tokens = require("@atlaskit/tokens");
|
|
14
15
|
var _constants = require("../../constants");
|
|
15
16
|
var _useInvokeClientAction = _interopRequireDefault(require("../../state/hooks/use-invoke-client-action"));
|
|
@@ -125,6 +126,30 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
125
126
|
if (previewUrl && isSupportTheming) {
|
|
126
127
|
previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
|
|
127
128
|
}
|
|
129
|
+
var focusRef = (0, _react.useRef)(null);
|
|
130
|
+
var hasRestoredFocus = (0, _react.useRef)(false);
|
|
131
|
+
(0, _react.useEffect)(function () {
|
|
132
|
+
if (!isOpen || !(0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states')) {
|
|
133
|
+
hasRestoredFocus.current = false;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
var handleWindowBlur = function handleWindowBlur() {
|
|
137
|
+
if (hasRestoredFocus.current) return;
|
|
138
|
+
setTimeout(function () {
|
|
139
|
+
var _focusRef$current;
|
|
140
|
+
// document.hasFocus() returns true when focus moved to an
|
|
141
|
+
// iframe on the same page, false when the window itself
|
|
142
|
+
// lost focus (e.g. user switched browser tabs)
|
|
143
|
+
if (!document.hasFocus()) return;
|
|
144
|
+
hasRestoredFocus.current = true;
|
|
145
|
+
(_focusRef$current = focusRef.current) === null || _focusRef$current === void 0 || _focusRef$current.focus();
|
|
146
|
+
}, 0);
|
|
147
|
+
};
|
|
148
|
+
window.addEventListener('blur', handleWindowBlur);
|
|
149
|
+
return function () {
|
|
150
|
+
window.removeEventListener('blur', handleWindowBlur);
|
|
151
|
+
};
|
|
152
|
+
}, [isOpen]);
|
|
128
153
|
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
129
154
|
height: "100%",
|
|
130
155
|
onClose: handleOnClose,
|
|
@@ -134,7 +159,7 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
134
159
|
width: width,
|
|
135
160
|
label: title,
|
|
136
161
|
isBlanketHidden: isBlanketHidden
|
|
137
|
-
}, /*#__PURE__*/_react.default.createElement(_linkInfo.default, {
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement(_linkInfo.default, (0, _extends2.default)({
|
|
138
163
|
icon: linkIcon && {
|
|
139
164
|
icon: /*#__PURE__*/_react.default.createElement(_common.BaseIconElement, (0, _extends2.default)({}, linkIcon, {
|
|
140
165
|
size: _constants.SmartLinkSize.Large
|
|
@@ -148,7 +173,9 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
148
173
|
size: width,
|
|
149
174
|
title: title,
|
|
150
175
|
testId: testId
|
|
151
|
-
}
|
|
176
|
+
}, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
177
|
+
focusRef: focusRef
|
|
178
|
+
} : {})), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_embedContent.default, {
|
|
152
179
|
isTrusted: isTrusted,
|
|
153
180
|
name: iframeName,
|
|
154
181
|
src: previewUrl,
|
package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js
CHANGED
|
@@ -16,7 +16,6 @@ var _css = require("@atlaskit/css");
|
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
17
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
18
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
19
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
20
19
|
var _utils = require("../../../utils");
|
|
21
20
|
var _actionIcon = _interopRequireDefault(require("../action-icon"));
|
|
22
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); }
|
|
@@ -43,11 +42,14 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
43
42
|
onClickCallback();
|
|
44
43
|
}
|
|
45
44
|
}, [isDisabled, isLoading, onClickCallback]);
|
|
46
|
-
|
|
47
|
-
//
|
|
48
|
-
|
|
45
|
+
|
|
46
|
+
// FIX-ME: This is required for ResolvedHoverCardFooterBlock action to show proper size
|
|
47
|
+
// ResolvedHoverCardFooterBlock is currently not used but keeping inside the code base for
|
|
48
|
+
// upcoming experiment to refresh HoverCard design
|
|
49
|
+
// If ResolvedHoverCardFooterBlock is cleaned up, this code can be removed.
|
|
50
|
+
var showSpinnerSize24 = false;
|
|
49
51
|
var icon = iconOption && isLoading ? /*#__PURE__*/React.createElement(_actionIcon.default, {
|
|
50
|
-
icon:
|
|
52
|
+
icon: showSpinnerSize24 ? /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
51
53
|
xcss: styles.spinner
|
|
52
54
|
}, /*#__PURE__*/React.createElement(_spinner.default, {
|
|
53
55
|
size: 16,
|
|
@@ -64,7 +66,7 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
64
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
65
67
|
,
|
|
66
68
|
style: style
|
|
67
|
-
}, (0, _platformFeatureFlags.fg)('
|
|
69
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_action_refactoring') ? {
|
|
68
70
|
'aria-label': ariaLabel
|
|
69
71
|
} : {}), /*#__PURE__*/React.createElement(_compiled.Inline, {
|
|
70
72
|
alignBlock: "center",
|
|
@@ -27,7 +27,7 @@ var AISummaryActionComponent = exports.AISummaryActionComponent = function AISum
|
|
|
27
27
|
(0, _react.useEffect)(function () {
|
|
28
28
|
onLoadingChange === null || onLoadingChange === void 0 || onLoadingChange(status === 'loading');
|
|
29
29
|
}, [onLoadingChange, status]);
|
|
30
|
-
return status === 'done' ? (0, _platformFeatureFlags.fg)('
|
|
30
|
+
return status === 'done' ? (0, _platformFeatureFlags.fg)('platform_sl_action_refactoring') ? /*#__PURE__*/_react.default.createElement(_copySummaryAction.CopySummaryActionNew, (0, _extends2.default)({}, props, {
|
|
31
31
|
summary: content,
|
|
32
32
|
testId: testId
|
|
33
33
|
})) : /*#__PURE__*/_react.default.createElement(_copySummaryAction.CopySummaryAction, (0, _extends2.default)({}, props, {
|
|
@@ -86,7 +86,7 @@ var FollowAction = function FollowAction(props) {
|
|
|
86
86
|
};
|
|
87
87
|
return /*#__PURE__*/_react.default.createElement(_serverAction.default, (0, _extends2.default)({
|
|
88
88
|
content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, label)
|
|
89
|
-
}, (0, _platformFeatureFlags.fg)('
|
|
89
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_action_refactoring') ? {
|
|
90
90
|
ariaLabel: intl.formatMessage(label)
|
|
91
91
|
} : {}, {
|
|
92
92
|
icon: followIcon,
|
|
@@ -23,8 +23,7 @@ var _excluded = ["onClick", "prompts", "testId"];
|
|
|
23
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); }
|
|
24
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; }
|
|
25
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; }
|
|
26
|
-
var
|
|
27
|
-
var DEFAULT_PROMPTS = GOOGLE_PROMPTS;
|
|
26
|
+
var DEFAULT_PROMPTS = [];
|
|
28
27
|
var RovoChatAction = function RovoChatAction(_ref) {
|
|
29
28
|
var _context$actions;
|
|
30
29
|
var onClickCallback = _ref.onClick,
|
|
@@ -49,10 +49,10 @@ var ViewRelatedLinksAction = function ViewRelatedLinksAction(_ref) {
|
|
|
49
49
|
}, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
|
|
50
50
|
return actionData ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
51
51
|
content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.related_links_view_related_links)
|
|
52
|
-
}, (0, _platformFeatureFlags.fg)('
|
|
52
|
+
}, (0, _platformFeatureFlags.fg)('platform_sl_action_refactoring') ? {
|
|
53
53
|
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.related_links_view_related_links)
|
|
54
54
|
} : {}, {
|
|
55
|
-
icon: /*#__PURE__*/_react.default.createElement(_relatedLinksActionIcon.default, (0, _platformFeatureFlags.fg)('
|
|
55
|
+
icon: /*#__PURE__*/_react.default.createElement(_relatedLinksActionIcon.default, (0, _platformFeatureFlags.fg)('platform_sl_action_refactoring') ? {
|
|
56
56
|
iconSize: props.iconSize
|
|
57
57
|
} : {}),
|
|
58
58
|
onClick: onClick,
|
|
@@ -13,7 +13,6 @@ var React = _react;
|
|
|
13
13
|
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
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _constants = require("../../../../../constants");
|
|
18
17
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
19
18
|
var Actions = _interopRequireWildcard(require("../../actions"));
|
|
@@ -51,18 +50,15 @@ var getPrimitivesPaddingSpaceBySize = exports.getPrimitivesPaddingSpaceBySize =
|
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
52
|
var ActionBlock = function ActionBlock(_ref) {
|
|
54
|
-
var _context$actions;
|
|
55
53
|
var blockRef = _ref.blockRef,
|
|
56
54
|
onClickCallback = _ref.onClick,
|
|
57
55
|
size = _ref.size,
|
|
58
56
|
spaceInline = _ref.spaceInline,
|
|
59
57
|
className = _ref.className,
|
|
60
58
|
_ref$testId = _ref.testId,
|
|
61
|
-
testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId
|
|
62
|
-
isAny3pRovoActionsExperimentOn = _ref.isAny3pRovoActionsExperimentOn;
|
|
59
|
+
testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId;
|
|
63
60
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
64
61
|
var ui = (0, _flexibleUiContext.useFlexibleUiOptionContext)();
|
|
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;
|
|
66
62
|
var _useState = (0, _react.useState)(),
|
|
67
63
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
68
64
|
message = _useState2[0],
|
|
@@ -86,9 +82,9 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
86
82
|
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
87
83
|
return;
|
|
88
84
|
}
|
|
89
|
-
var arr =
|
|
85
|
+
var arr = Object.keys(context.actions).filter(function (name) {
|
|
90
86
|
return name !== _constants.ActionName.RovoChatAction;
|
|
91
|
-
})
|
|
87
|
+
});
|
|
92
88
|
arr.sort(sort);
|
|
93
89
|
var renderAction = function renderAction(name) {
|
|
94
90
|
var Action = name in Actions ? Actions[name] : undefined;
|
|
@@ -116,7 +112,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
116
112
|
return arr.map(function (name) {
|
|
117
113
|
return renderAction(name);
|
|
118
114
|
});
|
|
119
|
-
}, [context === null || context === void 0 ? void 0 : context.actions,
|
|
115
|
+
}, [context === null || context === void 0 ? void 0 : context.actions, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, _onClick]);
|
|
120
116
|
if (!actions) {
|
|
121
117
|
return null;
|
|
122
118
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -11,9 +10,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
var _constants = require("../../../../../constants");
|
|
13
12
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
14
|
-
var _resolved =
|
|
15
|
-
var _excluded = ["
|
|
16
|
-
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); }
|
|
13
|
+
var _resolved = _interopRequireDefault(require("./resolved"));
|
|
14
|
+
var _excluded = ["testId"];
|
|
17
15
|
/**
|
|
18
16
|
* Represents an AISummaryBlock, designed to summarising link resource
|
|
19
17
|
* content using AI.
|
|
@@ -22,9 +20,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
22
20
|
* @see Block
|
|
23
21
|
*/
|
|
24
22
|
var AISummaryBlock = function AISummaryBlock(_ref) {
|
|
25
|
-
var _context$actions, _props$
|
|
26
|
-
var
|
|
27
|
-
_ref$testId = _ref.testId,
|
|
23
|
+
var _context$actions, _props$size, _cardContext$ui;
|
|
24
|
+
var _ref$testId = _ref.testId,
|
|
28
25
|
testId = _ref$testId === void 0 ? 'smart-ai-summary-block' : _ref$testId,
|
|
29
26
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
27
|
var cardContext = (0, _flexibleUiContext.useFlexibleCardContext)();
|
|
@@ -36,16 +33,8 @@ var AISummaryBlock = function AISummaryBlock(_ref) {
|
|
|
36
33
|
if (!(actionData !== null && actionData !== void 0 && actionData.url)) {
|
|
37
34
|
return null;
|
|
38
35
|
}
|
|
39
|
-
if (isAny3pRovoActionsExperimentOn) {
|
|
40
|
-
var _props$size, _cardContext$ui;
|
|
41
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.RovoSummaryBlockResolvedView, (0, _extends2.default)({}, props, {
|
|
42
|
-
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
43
|
-
testId: testId,
|
|
44
|
-
url: actionData.url
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
36
|
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, props, {
|
|
48
|
-
size: (_props$
|
|
37
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
49
38
|
testId: testId,
|
|
50
39
|
url: actionData.url
|
|
51
40
|
}));
|
|
@@ -22,7 +22,6 @@ var _excluded = ["testId", "onActionClick", "hideProvider"];
|
|
|
22
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
23
23
|
/**
|
|
24
24
|
* Allowed footer actions for HoverCard, in display order. Fetched from context.
|
|
25
|
-
* @featureGate platform_sl_3p_auth_rovo_action_kill_switch
|
|
26
25
|
*/
|
|
27
26
|
var HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [_constants.ActionName.RovoChatAction];
|
|
28
27
|
var ignoreContainerMarginStyles = null;
|
|
@@ -56,6 +55,9 @@ var ResolvedHoverCardFooterBlock = function ResolvedHoverCardFooterBlock(_ref) {
|
|
|
56
55
|
});
|
|
57
56
|
return arr.map(function (name) {
|
|
58
57
|
var Action = name in Actions ? Actions[name] : undefined;
|
|
58
|
+
|
|
59
|
+
// Note: For the spinner to render properly, e.g. AI summary action,
|
|
60
|
+
// the spinner need to be updated. See FIX-ME comment on ActionButton
|
|
59
61
|
return Action ? /*#__PURE__*/React.createElement(Action, {
|
|
60
62
|
key: name,
|
|
61
63
|
as: "stack-item",
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.hoverCardClassName = exports.default = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
@@ -14,10 +13,8 @@ var _linkProvider = require("@atlaskit/link-provider");
|
|
|
14
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
16
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
18
16
|
var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
|
|
19
17
|
var _constants = require("../../../constants");
|
|
20
|
-
var _extractRovoChatAction = _interopRequireDefault(require("../../../extractors/flexible/actions/extract-rovo-chat-action"));
|
|
21
18
|
var _helpers = require("../../../state/helpers");
|
|
22
19
|
var _useRovoConfig2 = _interopRequireDefault(require("../../../state/hooks/use-rovo-config"));
|
|
23
20
|
var _useSmartLinkCrossProductUrlWrapper = require("../../../state/hooks/use-smart-link-cross-product-url-wrapper");
|
|
@@ -78,8 +75,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
78
75
|
onMouseLeave = _ref4.onMouseLeave,
|
|
79
76
|
onDismiss = _ref4.onDismiss,
|
|
80
77
|
actionOptions = _ref4.actionOptions,
|
|
81
|
-
hoverPreviewOptions = _ref4.hoverPreviewOptions
|
|
82
|
-
showRovoResolvedView = _ref4.showRovoResolvedView;
|
|
78
|
+
hoverPreviewOptions = _ref4.hoverPreviewOptions;
|
|
83
79
|
var _useAnalyticsEventsNe = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
84
80
|
createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
|
|
85
81
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
@@ -282,17 +278,14 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
282
278
|
});
|
|
283
279
|
}
|
|
284
280
|
if (isResolved) {
|
|
285
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default,
|
|
286
|
-
actionOptions: actionOptions,
|
|
287
|
-
showRovoResolvedView: showRovoResolvedView
|
|
288
|
-
} : undefined, {
|
|
281
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, {
|
|
289
282
|
cardState: cardState,
|
|
290
283
|
extensionKey: extensionKey,
|
|
291
284
|
flexibleCardProps: flexibleCardProps,
|
|
292
285
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
293
286
|
onActionClick: onActionClick,
|
|
294
287
|
titleBlockProps: titleBlockProps
|
|
295
|
-
})
|
|
288
|
+
});
|
|
296
289
|
}
|
|
297
290
|
return null;
|
|
298
291
|
}();
|
|
@@ -334,17 +327,14 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
334
327
|
});
|
|
335
328
|
}
|
|
336
329
|
if (cardState.status === 'resolved') {
|
|
337
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default,
|
|
338
|
-
actionOptions: actionOptions,
|
|
339
|
-
showRovoResolvedView: showRovoResolvedView
|
|
340
|
-
} : undefined, {
|
|
330
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, {
|
|
341
331
|
cardState: cardState,
|
|
342
332
|
extensionKey: extensionKey,
|
|
343
333
|
flexibleCardProps: flexibleCardProps,
|
|
344
334
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
345
335
|
onActionClick: onActionClick,
|
|
346
336
|
titleBlockProps: titleBlockProps
|
|
347
|
-
})
|
|
337
|
+
});
|
|
348
338
|
}
|
|
349
339
|
return null;
|
|
350
340
|
};
|
|
@@ -359,23 +349,10 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
359
349
|
}
|
|
360
350
|
};
|
|
361
351
|
var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(props) {
|
|
362
|
-
var cardState = props.cardState,
|
|
363
|
-
actionOptions = props.actionOptions;
|
|
364
|
-
var rovoConfig = (0, _useRovoConfig2.default)();
|
|
365
|
-
var isResolved = useIsResolvedView(props);
|
|
366
352
|
var showPreauthBetterHovercard = useIsShowPreauthBetterHovercard(props);
|
|
367
|
-
var showRovoResolvedView = (0, _react.useMemo)(function () {
|
|
368
|
-
return isResolved && cardState.details && (0, _extractRovoChatAction.default)({
|
|
369
|
-
response: cardState.details,
|
|
370
|
-
rovoConfig: rovoConfig,
|
|
371
|
-
actionOptions: actionOptions
|
|
372
|
-
}) !== undefined;
|
|
373
|
-
}, [actionOptions, cardState.details, rovoConfig, isResolved]);
|
|
374
353
|
var data = (0, _react.useMemo)(function () {
|
|
375
354
|
var viewVariant = 'default';
|
|
376
|
-
if (
|
|
377
|
-
viewVariant = 'rovo-resolved-view';
|
|
378
|
-
} else if (showPreauthBetterHovercard) {
|
|
355
|
+
if (showPreauthBetterHovercard) {
|
|
379
356
|
viewVariant = 'rovo-unauthorised-view';
|
|
380
357
|
}
|
|
381
358
|
return {
|
|
@@ -383,17 +360,12 @@ var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(p
|
|
|
383
360
|
viewVariant: viewVariant
|
|
384
361
|
}
|
|
385
362
|
};
|
|
386
|
-
}, [
|
|
363
|
+
}, [showPreauthBetterHovercard]);
|
|
387
364
|
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
388
365
|
data: data
|
|
389
|
-
}, /*#__PURE__*/_react.default.createElement(HoverCardContent,
|
|
390
|
-
showRovoResolvedView: showRovoResolvedView
|
|
391
|
-
})));
|
|
366
|
+
}, /*#__PURE__*/_react.default.createElement(HoverCardContent, props));
|
|
392
367
|
};
|
|
393
368
|
var _default_1 = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
|
|
394
|
-
|
|
395
|
-
var flagA = (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
396
|
-
var flagB = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
397
|
-
return flagA || flagB;
|
|
369
|
+
return (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
398
370
|
}, HoverCardContentWithViewVariant, HoverCardContent);
|
|
399
371
|
var _default = exports.default = _default_1;
|