@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
|
@@ -12,7 +12,6 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
15
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
17
16
|
var _constants = require("../../../../../constants");
|
|
18
17
|
var _analytics = require("../../../../../state/analytics");
|
|
@@ -33,14 +32,10 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
33
32
|
flexibleCardProps = _ref.flexibleCardProps,
|
|
34
33
|
isAISummaryEnabled = _ref.isAISummaryEnabled,
|
|
35
34
|
onActionClick = _ref.onActionClick,
|
|
36
|
-
showRovoResolvedView = _ref.showRovoResolvedView,
|
|
37
35
|
titleBlockProps = _ref.titleBlockProps,
|
|
38
36
|
id = _ref.id;
|
|
39
37
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
40
38
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
41
|
-
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
42
|
-
// by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
|
|
43
|
-
var is3PAuthRovoActionsExperimentOn = showRovoResolvedView && (0, _expValEquals.expValEquals)('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
44
39
|
(0, _react.useEffect)(function () {
|
|
45
40
|
// Since this hover view is only rendered on resolved status,
|
|
46
41
|
// there is no need to check for statuses.
|
|
@@ -87,8 +82,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
87
82
|
size: _constants.SmartLinkSize.Medium
|
|
88
83
|
}), isAISummaryEnabled ? /*#__PURE__*/_react.default.createElement(_blocks.AISummaryBlock, {
|
|
89
84
|
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
90
|
-
placeholder: snippet
|
|
91
|
-
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn
|
|
85
|
+
placeholder: snippet
|
|
92
86
|
}) : snippet, /*#__PURE__*/_react.default.createElement(_blocks.SnippetBlock, {
|
|
93
87
|
testId: "hidden-snippet",
|
|
94
88
|
onRender: onSnippetRender,
|
|
@@ -98,10 +92,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
98
92
|
}), /*#__PURE__*/_react.default.createElement(_blocks.ActionBlock, {
|
|
99
93
|
onClick: onActionClick,
|
|
100
94
|
spaceInline: "space.100",
|
|
101
|
-
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn,
|
|
102
95
|
className: (0, _runtime.ax)(["_n3td1b66"])
|
|
103
|
-
}),
|
|
104
|
-
onActionClick: onActionClick
|
|
105
|
-
}) : /*#__PURE__*/_react.default.createElement(_blocks.AIFooterBlock, null));
|
|
96
|
+
}), /*#__PURE__*/_react.default.createElement(_blocks.AIFooterBlock, null));
|
|
106
97
|
};
|
|
107
98
|
var _default = exports.default = HoverCardResolvedView;
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "45.6.
|
|
22
|
+
packageVersion: "45.6.10",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -5,6 +5,5 @@
|
|
|
5
5
|
._o5724jg8{white-space:normal}
|
|
6
6
|
._slp31hna{word-wrap:break-word}
|
|
7
7
|
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
8
|
-
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
9
8
|
._te171kdv{-ms-user-select:text}
|
|
10
9
|
._uizt1kdv{-webkit-user-select:text;-ms-user-select:text;user-select:text}
|
|
@@ -11,13 +11,10 @@ require("./index.compiled.css");
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _markdownToJsx = _interopRequireDefault(require("markdown-to-jsx"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
16
14
|
var _ulist = _interopRequireDefault(require("./ulist"));
|
|
17
15
|
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); }
|
|
18
16
|
var baseStyle = null;
|
|
19
|
-
var
|
|
20
|
-
var textStyleOld = null;
|
|
17
|
+
var textStyle = null;
|
|
21
18
|
|
|
22
19
|
/**
|
|
23
20
|
* A component to render a response from AI in markdown text.
|
|
@@ -35,14 +32,11 @@ var AISummary = function AISummary(_ref) {
|
|
|
35
32
|
if (!content && minHeight === 0) {
|
|
36
33
|
return null;
|
|
37
34
|
}
|
|
38
|
-
var is3pExperimentEnabled =
|
|
39
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
40
|
-
(0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
41
35
|
return /*#__PURE__*/React.createElement(_markdownToJsx.default, {
|
|
42
36
|
"data-testid": testId
|
|
43
37
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
44
38
|
,
|
|
45
|
-
className: (0, _runtime.ax)(["_11c8wadc _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv",
|
|
39
|
+
className: (0, _runtime.ax)(["_11c8wadc _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv", "_syazazsu", className]),
|
|
46
40
|
children: content,
|
|
47
41
|
options: {
|
|
48
42
|
forceWrapper: true,
|
|
@@ -14,13 +14,9 @@ var _logo = require("@atlaskit/logo");
|
|
|
14
14
|
var _constants = require("../../../constants");
|
|
15
15
|
var _messages = require("../../../messages");
|
|
16
16
|
var _aiChapterIcon = _interopRequireDefault(require("../../FlexibleCard/assets/ai-chapter-icon"));
|
|
17
|
-
var _aiEditIcon = _interopRequireDefault(require("../../FlexibleCard/assets/ai-edit-icon"));
|
|
18
17
|
var _aiSearchIcon = _interopRequireDefault(require("../../FlexibleCard/assets/ai-search-icon"));
|
|
19
18
|
var _htmlToAdf = _interopRequireDefault(require("../../FlexibleCard/components/actions/rovo-chat-action/html-to-adf"));
|
|
20
19
|
var RovoChatPromptKey = exports.RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
|
|
21
|
-
RovoChatPromptKey["RECOMMEND_OTHER_SOURCES"] = "recommend-other-sources";
|
|
22
|
-
RovoChatPromptKey["SHOW_OTHER_MENTIONS"] = "show-other-mentions";
|
|
23
|
-
RovoChatPromptKey["SUGGEST_IMPROVEMENT"] = "suggest-improvement";
|
|
24
20
|
RovoChatPromptKey["SUMMARIZE_LINK"] = "summarize-link";
|
|
25
21
|
RovoChatPromptKey["KEY_HIGHLIGHTS"] = "key-highlights";
|
|
26
22
|
RovoChatPromptKey["ASK_ROVO_ANYTHING"] = "ask-rovo-anything";
|
|
@@ -42,16 +38,14 @@ var getContext = function getContext(intl, product) {
|
|
|
42
38
|
switch (product) {
|
|
43
39
|
case 'CONFLUENCE':
|
|
44
40
|
return {
|
|
45
|
-
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_confluence_page)
|
|
46
|
-
contextShort: intl.formatMessage(_messages.messages.rovo_prompt_context_confluence_page_short)
|
|
41
|
+
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_confluence_page)
|
|
47
42
|
};
|
|
48
43
|
case 'JSW':
|
|
49
44
|
case 'JWM':
|
|
50
45
|
case 'JSM':
|
|
51
46
|
case 'JPD':
|
|
52
47
|
return {
|
|
53
|
-
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_jira_work_item)
|
|
54
|
-
contextShort: intl.formatMessage(_messages.messages.rovo_prompt_context_jira_work_item_short)
|
|
48
|
+
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_jira_work_item)
|
|
55
49
|
};
|
|
56
50
|
}
|
|
57
51
|
};
|
|
@@ -66,68 +60,10 @@ var getPromptAction = exports.getPromptAction = function getPromptAction(_ref) {
|
|
|
66
60
|
cardAppearance = _ref.cardAppearance,
|
|
67
61
|
provider = _ref.provider;
|
|
68
62
|
var _ref2 = (_getContext = getContext(intl, product)) !== null && _getContext !== void 0 ? _getContext : {
|
|
69
|
-
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_generic)
|
|
70
|
-
contextShort: intl.formatMessage(_messages.messages.rovo_prompt_context_generic)
|
|
63
|
+
contextLong: intl.formatMessage(_messages.messages.rovo_prompt_context_generic)
|
|
71
64
|
},
|
|
72
|
-
contextLong = _ref2.contextLong
|
|
73
|
-
contextShort = _ref2.contextShort;
|
|
65
|
+
contextLong = _ref2.contextLong;
|
|
74
66
|
switch (promptKey) {
|
|
75
|
-
case RovoChatPromptKey.RECOMMEND_OTHER_SOURCES:
|
|
76
|
-
var label_recommend = intl.formatMessage(_messages.messages.rovo_prompt_button_recommend_other_sources);
|
|
77
|
-
var html_recommend = intl.formatMessage(_messages.messages.rovo_prompt_message_recommend_other_sources, {
|
|
78
|
-
context: contextLong,
|
|
79
|
-
url: url
|
|
80
|
-
}, {
|
|
81
|
-
ignoreTag: true
|
|
82
|
-
});
|
|
83
|
-
return {
|
|
84
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiEditIcon.default, null),
|
|
85
|
-
content: label_recommend,
|
|
86
|
-
tooltipMessage: label_recommend,
|
|
87
|
-
data: {
|
|
88
|
-
name: label_recommend,
|
|
89
|
-
dialogues: [],
|
|
90
|
-
prompt: (0, _htmlToAdf.default)(html_recommend)
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
case RovoChatPromptKey.SHOW_OTHER_MENTIONS:
|
|
94
|
-
var label_other_mentions = intl.formatMessage(_messages.messages.rovo_prompt_button_show_other_mentions);
|
|
95
|
-
var html_other_mentions = intl.formatMessage(_messages.messages.rovo_prompt_message_show_other_mentions, {
|
|
96
|
-
context: contextLong,
|
|
97
|
-
url: url
|
|
98
|
-
}, {
|
|
99
|
-
ignoreTag: true
|
|
100
|
-
});
|
|
101
|
-
return {
|
|
102
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiChapterIcon.default, null),
|
|
103
|
-
content: label_other_mentions,
|
|
104
|
-
tooltipMessage: label_other_mentions,
|
|
105
|
-
data: {
|
|
106
|
-
name: label_other_mentions,
|
|
107
|
-
dialogues: [],
|
|
108
|
-
prompt: (0, _htmlToAdf.default)(html_other_mentions)
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
case RovoChatPromptKey.SUGGEST_IMPROVEMENT:
|
|
112
|
-
var label_improvement = intl.formatMessage(_messages.messages.rovo_prompt_button_suggest_improvement, {
|
|
113
|
-
context: contextShort
|
|
114
|
-
});
|
|
115
|
-
var html_improvement = intl.formatMessage(_messages.messages.rovo_prompt_message_suggest_improvement, {
|
|
116
|
-
context: contextLong,
|
|
117
|
-
url: url
|
|
118
|
-
}, {
|
|
119
|
-
ignoreTag: true
|
|
120
|
-
});
|
|
121
|
-
return {
|
|
122
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiSearchIcon.default, null),
|
|
123
|
-
content: label_improvement,
|
|
124
|
-
tooltipMessage: label_improvement,
|
|
125
|
-
data: {
|
|
126
|
-
name: label_improvement,
|
|
127
|
-
dialogues: [],
|
|
128
|
-
prompt: (0, _htmlToAdf.default)(html_improvement)
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
67
|
case RovoChatPromptKey.SUMMARIZE_LINK:
|
|
132
68
|
var label_summarize = intl.formatMessage(_messages.messages.ai_summarize);
|
|
133
69
|
var html_summarize = intl.formatMessage(_messages.messages.rovo_prompt_message_summarize, {
|
|
@@ -25,12 +25,10 @@ const extractRovoChatAction = ({
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
const extensionKey = getExtensionKey(response);
|
|
28
|
-
const isGoogleProvider = extensionKey === 'google-object-provider';
|
|
29
28
|
const isInlineExperimentEnabled = fg('platform_sl_3p_auth_inline_tailored_cta_killswitch') && expValEqualsNoExposure('platform_sl_3p_auth_inline_tailored_cta', 'isEnabled', true);
|
|
30
|
-
const is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
31
29
|
const is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && (rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product) === 'CONFLUENCE';
|
|
32
30
|
const is3PEmbedPostAuthActionsEnabled = isEmbedRovoActionsFooterExperimentEnabled === true;
|
|
33
|
-
const isSupportedFeature =
|
|
31
|
+
const isSupportedFeature = is3PBlockPostAuthActionsEnabled || isInlineExperimentEnabled || is3PEmbedPostAuthActionsEnabled;
|
|
34
32
|
const isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
35
33
|
const url = extractSmartLinkUrl(response);
|
|
36
34
|
return isSupportedFeature && isOptIn ? {
|
package/dist/es2019/messages.js
CHANGED
|
@@ -986,51 +986,11 @@ export const messages = defineMessages({
|
|
|
986
986
|
defaultMessage: 'Confluence page',
|
|
987
987
|
description: 'The Confluence page the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
988
988
|
},
|
|
989
|
-
rovo_prompt_context_confluence_page_short: {
|
|
990
|
-
id: 'fabric.linking.rovo_prompt_context_confluence_page_short.non-final',
|
|
991
|
-
defaultMessage: 'page',
|
|
992
|
-
description: 'The Confluence page the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
993
|
-
},
|
|
994
989
|
rovo_prompt_context_jira_work_item: {
|
|
995
990
|
id: 'fabric.linking.rovo_prompt_context_jira_work_item.non-final',
|
|
996
991
|
defaultMessage: 'Jira work item',
|
|
997
992
|
description: 'The Jira work item the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
998
993
|
},
|
|
999
|
-
rovo_prompt_context_jira_work_item_short: {
|
|
1000
|
-
id: 'fabric.linking.rovo_prompt_context_jira_work_item_short.non-final',
|
|
1001
|
-
defaultMessage: 'work item',
|
|
1002
|
-
description: 'The Jira work item the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
1003
|
-
},
|
|
1004
|
-
rovo_prompt_button_recommend_other_sources: {
|
|
1005
|
-
id: 'fabric.linking.rovo_prompt_button_recommend_other_sources.non-final',
|
|
1006
|
-
defaultMessage: 'Recommend other sources',
|
|
1007
|
-
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1008
|
-
},
|
|
1009
|
-
rovo_prompt_message_recommend_other_sources: {
|
|
1010
|
-
id: 'fabric.linking.rovo_prompt_message_recommend_other_sources.non-final',
|
|
1011
|
-
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>',
|
|
1012
|
-
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.)'
|
|
1013
|
-
},
|
|
1014
|
-
rovo_prompt_button_show_other_mentions: {
|
|
1015
|
-
id: 'fabric.linking.rovo_prompt_button_show_other_mentions.non-final',
|
|
1016
|
-
defaultMessage: 'Show other mentions',
|
|
1017
|
-
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1018
|
-
},
|
|
1019
|
-
rovo_prompt_message_show_other_mentions: {
|
|
1020
|
-
id: 'fabric.linking.rovo_prompt_message_show_other_mentions.non-final',
|
|
1021
|
-
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>',
|
|
1022
|
-
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.)'
|
|
1023
|
-
},
|
|
1024
|
-
rovo_prompt_button_suggest_improvement: {
|
|
1025
|
-
id: 'fabric.linking.rovo_prompt_button_suggest_improvement.non-final',
|
|
1026
|
-
defaultMessage: 'Suggest {context} improvement',
|
|
1027
|
-
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1028
|
-
},
|
|
1029
|
-
rovo_prompt_message_suggest_improvement: {
|
|
1030
|
-
id: 'fabric.linking.rovo_prompt_message_suggest_improvement.non-final',
|
|
1031
|
-
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>',
|
|
1032
|
-
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.)'
|
|
1033
|
-
},
|
|
1034
994
|
rovo_prompt_message_summarize: {
|
|
1035
995
|
id: 'fabric.linking.rovo_prompt_message_summarize.non-final',
|
|
1036
996
|
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>',
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card" || '',
|
|
5
|
-
packageVersion: "45.6.
|
|
5
|
+
packageVersion: "45.6.10" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import "./index.compiled.css";
|
|
3
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
5
|
import React, { useMemo } from 'react';
|
|
@@ -9,6 +10,7 @@ import VidFullScreenOnIcon from '@atlaskit/icon/core/fullscreen-enter';
|
|
|
9
10
|
import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
|
|
10
11
|
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
11
12
|
import { CloseButton, useModal } from '@atlaskit/modal-dialog';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
15
|
import { messages } from '../../../../messages';
|
|
14
16
|
import { Icon } from '../../../common/Icon';
|
|
@@ -33,7 +35,8 @@ const LinkInfo = ({
|
|
|
33
35
|
onViewButtonClick,
|
|
34
36
|
size,
|
|
35
37
|
testId,
|
|
36
|
-
title
|
|
38
|
+
title,
|
|
39
|
+
focusRef
|
|
37
40
|
}) => {
|
|
38
41
|
const {
|
|
39
42
|
onClose
|
|
@@ -41,7 +44,7 @@ const LinkInfo = ({
|
|
|
41
44
|
const {
|
|
42
45
|
formatMessage
|
|
43
46
|
} = useIntl();
|
|
44
|
-
const downloadButton = useMemo(() => /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
47
|
+
const downloadButton = useMemo(() => /*#__PURE__*/React.createElement(LinkInfoButton, _extends({
|
|
45
48
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
|
|
46
49
|
icon: () => /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
47
50
|
label: "",
|
|
@@ -51,14 +54,16 @@ const LinkInfo = ({
|
|
|
51
54
|
label: formatMessage(messages.download),
|
|
52
55
|
onClick: onDownloadButtonClick,
|
|
53
56
|
testId: `${testId}-download`
|
|
54
|
-
}
|
|
57
|
+
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
58
|
+
focusRef
|
|
59
|
+
} : {})), [onDownloadButtonClick, testId, formatMessage, focusRef]);
|
|
55
60
|
const urlButton = useMemo(() => {
|
|
56
61
|
if (onViewButtonClick) {
|
|
57
62
|
const label = providerName ? formatMessage(messages.viewInProvider, {
|
|
58
63
|
providerName
|
|
59
64
|
}) : formatMessage(messages.viewOriginal);
|
|
60
65
|
const content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
|
|
61
|
-
return /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
66
|
+
return /*#__PURE__*/React.createElement(LinkInfoButton, _extends({
|
|
62
67
|
content: content,
|
|
63
68
|
icon: () => /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
64
69
|
label: "",
|
|
@@ -69,9 +74,11 @@ const LinkInfo = ({
|
|
|
69
74
|
onClick: onViewButtonClick,
|
|
70
75
|
testId: `${testId}-url`,
|
|
71
76
|
role: 'link'
|
|
72
|
-
})
|
|
77
|
+
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
78
|
+
focusRef: !onDownloadButtonClick ? focusRef : undefined
|
|
79
|
+
} : {}));
|
|
73
80
|
}
|
|
74
|
-
}, [onViewButtonClick, providerName, testId, formatMessage]);
|
|
81
|
+
}, [onViewButtonClick, providerName, testId, formatMessage, onDownloadButtonClick, focusRef]);
|
|
75
82
|
const sizeButton = useMemo(() => {
|
|
76
83
|
const isFullScreen = size === MAX_MODAL_SIZE;
|
|
77
84
|
const message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { IconButton } from '@atlaskit/button/new';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
6
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
5
7
|
const LinkInfoButton = ({
|
|
@@ -8,7 +10,8 @@ const LinkInfoButton = ({
|
|
|
8
10
|
label,
|
|
9
11
|
onClick,
|
|
10
12
|
testId,
|
|
11
|
-
role
|
|
13
|
+
role,
|
|
14
|
+
focusRef
|
|
12
15
|
}) => {
|
|
13
16
|
const onMouseDown = useMouseDownEvent();
|
|
14
17
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -16,7 +19,7 @@ const LinkInfoButton = ({
|
|
|
16
19
|
hideTooltipOnClick: true,
|
|
17
20
|
tag: "span",
|
|
18
21
|
testId: `${testId}-tooltip`
|
|
19
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
22
|
+
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
20
23
|
appearance: "subtle",
|
|
21
24
|
icon: icon,
|
|
22
25
|
label: label,
|
|
@@ -24,6 +27,8 @@ const LinkInfoButton = ({
|
|
|
24
27
|
onMouseDown: onMouseDown,
|
|
25
28
|
testId: `${testId}-button`,
|
|
26
29
|
role: role
|
|
27
|
-
})
|
|
30
|
+
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
31
|
+
ref: focusRef
|
|
32
|
+
} : {})));
|
|
28
33
|
};
|
|
29
34
|
export default LinkInfoButton;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useCallback, useRef, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import ModalDialog, { ModalBody, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
5
6
|
import { SmartLinkSize } from '../../constants';
|
|
6
7
|
import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
|
|
@@ -101,6 +102,30 @@ const EmbedModal = ({
|
|
|
101
102
|
if (previewUrl && isSupportTheming) {
|
|
102
103
|
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
103
104
|
}
|
|
105
|
+
const focusRef = useRef(null);
|
|
106
|
+
const hasRestoredFocus = useRef(false);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (!isOpen || !fg('navx-4719-a11y-embed-modal-focus-states')) {
|
|
109
|
+
hasRestoredFocus.current = false;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const handleWindowBlur = () => {
|
|
113
|
+
if (hasRestoredFocus.current) return;
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
var _focusRef$current;
|
|
116
|
+
// document.hasFocus() returns true when focus moved to an
|
|
117
|
+
// iframe on the same page, false when the window itself
|
|
118
|
+
// lost focus (e.g. user switched browser tabs)
|
|
119
|
+
if (!document.hasFocus()) return;
|
|
120
|
+
hasRestoredFocus.current = true;
|
|
121
|
+
(_focusRef$current = focusRef.current) === null || _focusRef$current === void 0 ? void 0 : _focusRef$current.focus();
|
|
122
|
+
}, 0);
|
|
123
|
+
};
|
|
124
|
+
window.addEventListener('blur', handleWindowBlur);
|
|
125
|
+
return () => {
|
|
126
|
+
window.removeEventListener('blur', handleWindowBlur);
|
|
127
|
+
};
|
|
128
|
+
}, [isOpen]);
|
|
104
129
|
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
|
|
105
130
|
height: "100%",
|
|
106
131
|
onClose: handleOnClose,
|
|
@@ -110,7 +135,7 @@ const EmbedModal = ({
|
|
|
110
135
|
width: width,
|
|
111
136
|
label: title,
|
|
112
137
|
isBlanketHidden: isBlanketHidden
|
|
113
|
-
}, /*#__PURE__*/React.createElement(LinkInfo, {
|
|
138
|
+
}, /*#__PURE__*/React.createElement(LinkInfo, _extends({
|
|
114
139
|
icon: linkIcon && {
|
|
115
140
|
icon: /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, linkIcon, {
|
|
116
141
|
size: SmartLinkSize.Large
|
|
@@ -124,7 +149,9 @@ const EmbedModal = ({
|
|
|
124
149
|
size: width,
|
|
125
150
|
title: title,
|
|
126
151
|
testId: testId
|
|
127
|
-
}
|
|
152
|
+
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
153
|
+
focusRef
|
|
154
|
+
} : {})), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(EmbedContent, {
|
|
128
155
|
isTrusted: isTrusted,
|
|
129
156
|
name: iframeName,
|
|
130
157
|
src: previewUrl,
|
package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js
CHANGED
|
@@ -8,7 +8,6 @@ import { cx } from '@atlaskit/css';
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { Box, Inline, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
10
|
import Spinner from '@atlaskit/spinner';
|
|
11
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
11
|
import { getPrimitivesInlineSpaceBySize } from '../../../utils';
|
|
13
12
|
import ActionIcon from '../action-icon';
|
|
14
13
|
const styles = {
|
|
@@ -35,11 +34,14 @@ const ActionButton = ({
|
|
|
35
34
|
onClickCallback();
|
|
36
35
|
}
|
|
37
36
|
}, [isDisabled, isLoading, onClickCallback]);
|
|
38
|
-
|
|
39
|
-
//
|
|
40
|
-
|
|
37
|
+
|
|
38
|
+
// FIX-ME: This is required for ResolvedHoverCardFooterBlock action to show proper size
|
|
39
|
+
// ResolvedHoverCardFooterBlock is currently not used but keeping inside the code base for
|
|
40
|
+
// upcoming experiment to refresh HoverCard design
|
|
41
|
+
// If ResolvedHoverCardFooterBlock is cleaned up, this code can be removed.
|
|
42
|
+
const showSpinnerSize24 = false;
|
|
41
43
|
const icon = iconOption && isLoading ? /*#__PURE__*/React.createElement(ActionIcon, {
|
|
42
|
-
icon:
|
|
44
|
+
icon: showSpinnerSize24 ? /*#__PURE__*/React.createElement(Box, {
|
|
43
45
|
xcss: styles.spinner
|
|
44
46
|
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
45
47
|
size: 16,
|
|
@@ -56,7 +58,7 @@ const ActionButton = ({
|
|
|
56
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
57
59
|
,
|
|
58
60
|
style: style
|
|
59
|
-
}, fg('
|
|
61
|
+
}, fg('platform_sl_action_refactoring') ? {
|
|
60
62
|
'aria-label': ariaLabel
|
|
61
63
|
} : {}), /*#__PURE__*/React.createElement(Inline, {
|
|
62
64
|
alignBlock: "center",
|
|
@@ -21,7 +21,7 @@ export const AISummaryActionComponent = props => {
|
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
onLoadingChange === null || onLoadingChange === void 0 ? void 0 : onLoadingChange(status === 'loading');
|
|
23
23
|
}, [onLoadingChange, status]);
|
|
24
|
-
return status === 'done' ? fg('
|
|
24
|
+
return status === 'done' ? fg('platform_sl_action_refactoring') ? /*#__PURE__*/React.createElement(CopySummaryActionNew, _extends({}, props, {
|
|
25
25
|
summary: content,
|
|
26
26
|
testId: testId
|
|
27
27
|
})) : /*#__PURE__*/React.createElement(CopySummaryAction, _extends({}, props, {
|
|
@@ -69,7 +69,7 @@ const FollowAction = props => {
|
|
|
69
69
|
};
|
|
70
70
|
return /*#__PURE__*/React.createElement(ServerAction, _extends({
|
|
71
71
|
content: /*#__PURE__*/React.createElement(FormattedMessage, label)
|
|
72
|
-
}, fg('
|
|
72
|
+
}, fg('platform_sl_action_refactoring') ? {
|
|
73
73
|
ariaLabel: intl.formatMessage(label)
|
|
74
74
|
} : {}, {
|
|
75
75
|
icon: followIcon,
|
|
@@ -5,10 +5,9 @@ import { ActionName } from '../../../../../constants';
|
|
|
5
5
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
6
6
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
7
7
|
import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
|
|
8
|
-
import { getPromptAction
|
|
8
|
+
import { getPromptAction } from '../../../../common/rovo-chat-utils';
|
|
9
9
|
import Action from '../action';
|
|
10
|
-
const
|
|
11
|
-
const DEFAULT_PROMPTS = GOOGLE_PROMPTS;
|
|
10
|
+
const DEFAULT_PROMPTS = [];
|
|
12
11
|
const RovoChatAction = ({
|
|
13
12
|
onClick: onClickCallback,
|
|
14
13
|
prompts,
|
|
@@ -34,10 +34,10 @@ const ViewRelatedLinksAction = ({
|
|
|
34
34
|
}, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
|
|
35
35
|
return actionData ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
36
36
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
37
|
-
}, fg('
|
|
37
|
+
}, fg('platform_sl_action_refactoring') ? {
|
|
38
38
|
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
39
39
|
} : {}, {
|
|
40
|
-
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('
|
|
40
|
+
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('platform_sl_action_refactoring') ? {
|
|
41
41
|
iconSize: props.iconSize
|
|
42
42
|
} : {}),
|
|
43
43
|
onClick: onClick,
|
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { ActionName, SmartLinkSize } from '../../../../../constants';
|
|
9
8
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
10
9
|
import * as Actions from '../../actions';
|
|
@@ -46,13 +45,10 @@ const ActionBlock = ({
|
|
|
46
45
|
size,
|
|
47
46
|
spaceInline,
|
|
48
47
|
className,
|
|
49
|
-
testId = 'smart-block-action'
|
|
50
|
-
isAny3pRovoActionsExperimentOn
|
|
48
|
+
testId = 'smart-block-action'
|
|
51
49
|
}) => {
|
|
52
|
-
var _context$actions;
|
|
53
50
|
const context = useFlexibleUiContext();
|
|
54
51
|
const ui = useFlexibleUiOptionContext();
|
|
55
|
-
const isRovoChatActionAvailable = isAny3pRovoActionsExperimentOn && fg('platform_sl_3p_auth_rovo_action_kill_switch') ? (context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.RovoChatAction]) !== undefined : undefined;
|
|
56
52
|
const [message, setMessage] = useState();
|
|
57
53
|
const [isLoading, setIsLoading] = useState(false);
|
|
58
54
|
const onLoadingChange = useCallback(isLoading => {
|
|
@@ -70,7 +66,7 @@ const ActionBlock = ({
|
|
|
70
66
|
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
71
67
|
return;
|
|
72
68
|
}
|
|
73
|
-
const arr =
|
|
69
|
+
const arr = Object.keys(context.actions).filter(name => name !== ActionName.RovoChatAction);
|
|
74
70
|
arr.sort(sort);
|
|
75
71
|
const renderAction = name => {
|
|
76
72
|
const Action = name in Actions ? Actions[name] : undefined;
|
|
@@ -94,7 +90,7 @@ const ActionBlock = ({
|
|
|
94
90
|
});
|
|
95
91
|
};
|
|
96
92
|
return arr.map(name => renderAction(name));
|
|
97
|
-
}, [context === null || context === void 0 ? void 0 : context.actions,
|
|
93
|
+
}, [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]);
|
|
98
94
|
if (!actions) {
|
|
99
95
|
return null;
|
|
100
96
|
}
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
|
|
4
4
|
import { useFlexibleCardContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
5
|
-
import AISummaryBlockResolvedView
|
|
5
|
+
import AISummaryBlockResolvedView from './resolved';
|
|
6
6
|
/**
|
|
7
7
|
* Represents an AISummaryBlock, designed to summarising link resource
|
|
8
8
|
* content using AI.
|
|
@@ -11,11 +11,10 @@ import AISummaryBlockResolvedView, { RovoSummaryBlockResolvedView } from './reso
|
|
|
11
11
|
* @see Block
|
|
12
12
|
*/
|
|
13
13
|
const AISummaryBlock = ({
|
|
14
|
-
isAny3pRovoActionsExperimentOn,
|
|
15
14
|
testId = 'smart-ai-summary-block',
|
|
16
15
|
...props
|
|
17
16
|
}) => {
|
|
18
|
-
var _context$actions, _props$
|
|
17
|
+
var _context$actions, _props$size, _cardContext$ui;
|
|
19
18
|
const cardContext = useFlexibleCardContext();
|
|
20
19
|
const context = useFlexibleUiContext();
|
|
21
20
|
const actionData = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.AISummaryAction];
|
|
@@ -25,16 +24,8 @@ const AISummaryBlock = ({
|
|
|
25
24
|
if (!(actionData !== null && actionData !== void 0 && actionData.url)) {
|
|
26
25
|
return null;
|
|
27
26
|
}
|
|
28
|
-
if (isAny3pRovoActionsExperimentOn) {
|
|
29
|
-
var _props$size, _cardContext$ui;
|
|
30
|
-
return /*#__PURE__*/React.createElement(RovoSummaryBlockResolvedView, _extends({}, props, {
|
|
31
|
-
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
32
|
-
testId: testId,
|
|
33
|
-
url: actionData.url
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
27
|
return /*#__PURE__*/React.createElement(AISummaryBlockResolvedView, _extends({}, props, {
|
|
37
|
-
size: (_props$
|
|
28
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
38
29
|
testId: testId,
|
|
39
30
|
url: actionData.url
|
|
40
31
|
}));
|
|
@@ -12,7 +12,6 @@ import { Provider } from '../../elements';
|
|
|
12
12
|
import Block from '../block';
|
|
13
13
|
/**
|
|
14
14
|
* Allowed footer actions for HoverCard, in display order. Fetched from context.
|
|
15
|
-
* @featureGate platform_sl_3p_auth_rovo_action_kill_switch
|
|
16
15
|
*/
|
|
17
16
|
const HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [ActionName.RovoChatAction];
|
|
18
17
|
const ignoreContainerMarginStyles = null;
|
|
@@ -44,6 +43,9 @@ const ResolvedHoverCardFooterBlock = ({
|
|
|
44
43
|
arr = arr.filter(name => !HIDDEN_HOVER_CARD_FOOTER_ACTIONS.includes(name));
|
|
45
44
|
return arr.map(name => {
|
|
46
45
|
const Action = name in Actions ? Actions[name] : undefined;
|
|
46
|
+
|
|
47
|
+
// Note: For the spinner to render properly, e.g. AI summary action,
|
|
48
|
+
// the spinner need to be updated. See FIX-ME comment on ActionButton
|
|
47
49
|
return Action ? /*#__PURE__*/React.createElement(Action, {
|
|
48
50
|
key: name,
|
|
49
51
|
as: "stack-item",
|