@atlaskit/smart-card 45.6.9 → 45.6.10
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 +8 -0
- package/dist/cjs/messages.js +0 -40
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +1 -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/HoverCard/components/HoverCardContent.js +7 -30
- 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/rovo-chat-utils/index.js +4 -68
- package/dist/es2019/messages.js +0 -40
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +2 -3
- 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/HoverCard/components/HoverCardContent.js +7 -30
- 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/rovo-chat-utils/index.js +4 -68
- package/dist/esm/messages.js +0 -40
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +2 -3
- 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/HoverCard/components/HoverCardContent.js +7 -30
- 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/rovo-chat-utils/index.js +4 -68
- package/dist/types/messages.d.ts +1 -1
- 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/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 +2 -2
- 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
|
@@ -5,10 +5,8 @@ import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { componentWithCondition, functionUnionWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
8
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
10
9
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
11
|
-
import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
|
|
12
10
|
import { getClickUrl, getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
|
|
13
11
|
import useRovoConfig from '../../../state/hooks/use-rovo-config';
|
|
14
12
|
import { useSmartLinkCrossProductUrlWrapperGated } from '../../../state/hooks/use-smart-link-cross-product-url-wrapper';
|
|
@@ -68,8 +66,7 @@ const HoverCardContent = ({
|
|
|
68
66
|
onMouseLeave,
|
|
69
67
|
onDismiss,
|
|
70
68
|
actionOptions,
|
|
71
|
-
hoverPreviewOptions
|
|
72
|
-
showRovoResolvedView
|
|
69
|
+
hoverPreviewOptions
|
|
73
70
|
}) => {
|
|
74
71
|
var _linkState$status, _cardState$details;
|
|
75
72
|
const {
|
|
@@ -262,8 +259,7 @@ const HoverCardContent = ({
|
|
|
262
259
|
}
|
|
263
260
|
if (isResolved) {
|
|
264
261
|
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
265
|
-
actionOptions
|
|
266
|
-
showRovoResolvedView
|
|
262
|
+
actionOptions
|
|
267
263
|
} : undefined, {
|
|
268
264
|
cardState: cardState,
|
|
269
265
|
extensionKey: extensionKey,
|
|
@@ -314,8 +310,7 @@ const HoverCardContent = ({
|
|
|
314
310
|
}
|
|
315
311
|
if (cardState.status === 'resolved') {
|
|
316
312
|
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
317
|
-
actionOptions
|
|
318
|
-
showRovoResolvedView
|
|
313
|
+
actionOptions
|
|
319
314
|
} : undefined, {
|
|
320
315
|
cardState: cardState,
|
|
321
316
|
extensionKey: extensionKey,
|
|
@@ -338,23 +333,10 @@ const HoverCardContent = ({
|
|
|
338
333
|
}
|
|
339
334
|
};
|
|
340
335
|
const HoverCardContentWithViewVariant = props => {
|
|
341
|
-
const {
|
|
342
|
-
cardState,
|
|
343
|
-
actionOptions
|
|
344
|
-
} = props;
|
|
345
|
-
const rovoConfig = useRovoConfig();
|
|
346
|
-
const isResolved = useIsResolvedView(props);
|
|
347
336
|
const showPreauthBetterHovercard = useIsShowPreauthBetterHovercard(props);
|
|
348
|
-
const showRovoResolvedView = useMemo(() => isResolved && cardState.details && extractRovoChatAction({
|
|
349
|
-
response: cardState.details,
|
|
350
|
-
rovoConfig,
|
|
351
|
-
actionOptions
|
|
352
|
-
}) !== undefined, [actionOptions, cardState.details, rovoConfig, isResolved]);
|
|
353
337
|
const data = useMemo(() => {
|
|
354
338
|
let viewVariant = 'default';
|
|
355
|
-
if (
|
|
356
|
-
viewVariant = 'rovo-resolved-view';
|
|
357
|
-
} else if (showPreauthBetterHovercard) {
|
|
339
|
+
if (showPreauthBetterHovercard) {
|
|
358
340
|
viewVariant = 'rovo-unauthorised-view';
|
|
359
341
|
}
|
|
360
342
|
return {
|
|
@@ -362,17 +344,12 @@ const HoverCardContentWithViewVariant = props => {
|
|
|
362
344
|
viewVariant
|
|
363
345
|
}
|
|
364
346
|
};
|
|
365
|
-
}, [
|
|
347
|
+
}, [showPreauthBetterHovercard]);
|
|
366
348
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
367
349
|
data: data
|
|
368
|
-
}, /*#__PURE__*/React.createElement(HoverCardContent,
|
|
369
|
-
showRovoResolvedView: showRovoResolvedView
|
|
370
|
-
})));
|
|
350
|
+
}, /*#__PURE__*/React.createElement(HoverCardContent, props));
|
|
371
351
|
};
|
|
372
352
|
const _default_1 = componentWithCondition(() => {
|
|
373
|
-
|
|
374
|
-
const flagA = fg('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
375
|
-
const flagB = fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
376
|
-
return flagA || flagB;
|
|
353
|
+
return fg('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
377
354
|
}, HoverCardContentWithViewVariant, HoverCardContent);
|
|
378
355
|
export default _default_1;
|
|
@@ -4,13 +4,12 @@ import "./index.compiled.css";
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
9
8
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
10
9
|
import { succeedUfoExperience } from '../../../../../state/analytics';
|
|
11
10
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
12
11
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
13
|
-
import { ActionBlock, AIFooterBlock, AISummaryBlock,
|
|
12
|
+
import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
14
13
|
import { getMetadata } from '../../../utils';
|
|
15
14
|
import ImagePreview from '../../ImagePreview';
|
|
16
15
|
const hiddenSnippetStyles = null;
|
|
@@ -23,7 +22,6 @@ const HoverCardResolvedView = ({
|
|
|
23
22
|
flexibleCardProps,
|
|
24
23
|
isAISummaryEnabled,
|
|
25
24
|
onActionClick,
|
|
26
|
-
showRovoResolvedView,
|
|
27
25
|
titleBlockProps,
|
|
28
26
|
id
|
|
29
27
|
}) => {
|
|
@@ -31,9 +29,6 @@ const HoverCardResolvedView = ({
|
|
|
31
29
|
const {
|
|
32
30
|
fireEvent
|
|
33
31
|
} = useAnalyticsEvents();
|
|
34
|
-
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
35
|
-
// by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
|
|
36
|
-
const is3PAuthRovoActionsExperimentOn = showRovoResolvedView && expValEquals('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
37
32
|
useEffect(() => {
|
|
38
33
|
// Since this hover view is only rendered on resolved status,
|
|
39
34
|
// there is no need to check for statuses.
|
|
@@ -81,8 +76,7 @@ const HoverCardResolvedView = ({
|
|
|
81
76
|
size: SmartLinkSize.Medium
|
|
82
77
|
}), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
83
78
|
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
84
|
-
placeholder: snippet
|
|
85
|
-
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn
|
|
79
|
+
placeholder: snippet
|
|
86
80
|
}) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
87
81
|
testId: "hidden-snippet",
|
|
88
82
|
onRender: onSnippetRender,
|
|
@@ -92,10 +86,7 @@ const HoverCardResolvedView = ({
|
|
|
92
86
|
}), /*#__PURE__*/React.createElement(ActionBlock, {
|
|
93
87
|
onClick: onActionClick,
|
|
94
88
|
spaceInline: "space.100",
|
|
95
|
-
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn,
|
|
96
89
|
className: ax(["_n3td1b66"])
|
|
97
|
-
}),
|
|
98
|
-
onActionClick: onActionClick
|
|
99
|
-
}) : /*#__PURE__*/React.createElement(AIFooterBlock, null));
|
|
90
|
+
}), /*#__PURE__*/React.createElement(AIFooterBlock, null));
|
|
100
91
|
};
|
|
101
92
|
export default HoverCardResolvedView;
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "45.6.
|
|
12
|
+
packageVersion: "45.6.9",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -7,13 +7,9 @@ import { RovoIcon } from '@atlaskit/logo';
|
|
|
7
7
|
import { CardDisplay } from '../../../constants';
|
|
8
8
|
import { messages } from '../../../messages';
|
|
9
9
|
import AiChapterIcon from '../../FlexibleCard/assets/ai-chapter-icon';
|
|
10
|
-
import AIEditIcon from '../../FlexibleCard/assets/ai-edit-icon';
|
|
11
10
|
import AISearchIcon from '../../FlexibleCard/assets/ai-search-icon';
|
|
12
11
|
import htmlToAdf from '../../FlexibleCard/components/actions/rovo-chat-action/html-to-adf';
|
|
13
12
|
export let RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
|
|
14
|
-
RovoChatPromptKey["RECOMMEND_OTHER_SOURCES"] = "recommend-other-sources";
|
|
15
|
-
RovoChatPromptKey["SHOW_OTHER_MENTIONS"] = "show-other-mentions";
|
|
16
|
-
RovoChatPromptKey["SUGGEST_IMPROVEMENT"] = "suggest-improvement";
|
|
17
13
|
RovoChatPromptKey["SUMMARIZE_LINK"] = "summarize-link";
|
|
18
14
|
RovoChatPromptKey["KEY_HIGHLIGHTS"] = "key-highlights";
|
|
19
15
|
RovoChatPromptKey["ASK_ROVO_ANYTHING"] = "ask-rovo-anything";
|
|
@@ -35,16 +31,14 @@ const getContext = (intl, product) => {
|
|
|
35
31
|
switch (product) {
|
|
36
32
|
case 'CONFLUENCE':
|
|
37
33
|
return {
|
|
38
|
-
contextLong: intl.formatMessage(messages.rovo_prompt_context_confluence_page)
|
|
39
|
-
contextShort: intl.formatMessage(messages.rovo_prompt_context_confluence_page_short)
|
|
34
|
+
contextLong: intl.formatMessage(messages.rovo_prompt_context_confluence_page)
|
|
40
35
|
};
|
|
41
36
|
case 'JSW':
|
|
42
37
|
case 'JWM':
|
|
43
38
|
case 'JSM':
|
|
44
39
|
case 'JPD':
|
|
45
40
|
return {
|
|
46
|
-
contextLong: intl.formatMessage(messages.rovo_prompt_context_jira_work_item)
|
|
47
|
-
contextShort: intl.formatMessage(messages.rovo_prompt_context_jira_work_item_short)
|
|
41
|
+
contextLong: intl.formatMessage(messages.rovo_prompt_context_jira_work_item)
|
|
48
42
|
};
|
|
49
43
|
}
|
|
50
44
|
};
|
|
@@ -59,69 +53,11 @@ export const getPromptAction = ({
|
|
|
59
53
|
}) => {
|
|
60
54
|
var _getContext;
|
|
61
55
|
const {
|
|
62
|
-
contextLong
|
|
63
|
-
contextShort
|
|
56
|
+
contextLong
|
|
64
57
|
} = (_getContext = getContext(intl, product)) !== null && _getContext !== void 0 ? _getContext : {
|
|
65
|
-
contextLong: intl.formatMessage(messages.rovo_prompt_context_generic)
|
|
66
|
-
contextShort: intl.formatMessage(messages.rovo_prompt_context_generic)
|
|
58
|
+
contextLong: intl.formatMessage(messages.rovo_prompt_context_generic)
|
|
67
59
|
};
|
|
68
60
|
switch (promptKey) {
|
|
69
|
-
case RovoChatPromptKey.RECOMMEND_OTHER_SOURCES:
|
|
70
|
-
const label_recommend = intl.formatMessage(messages.rovo_prompt_button_recommend_other_sources);
|
|
71
|
-
const html_recommend = intl.formatMessage(messages.rovo_prompt_message_recommend_other_sources, {
|
|
72
|
-
context: contextLong,
|
|
73
|
-
url
|
|
74
|
-
}, {
|
|
75
|
-
ignoreTag: true
|
|
76
|
-
});
|
|
77
|
-
return {
|
|
78
|
-
icon: /*#__PURE__*/React.createElement(AIEditIcon, null),
|
|
79
|
-
content: label_recommend,
|
|
80
|
-
tooltipMessage: label_recommend,
|
|
81
|
-
data: {
|
|
82
|
-
name: label_recommend,
|
|
83
|
-
dialogues: [],
|
|
84
|
-
prompt: htmlToAdf(html_recommend)
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
case RovoChatPromptKey.SHOW_OTHER_MENTIONS:
|
|
88
|
-
const label_other_mentions = intl.formatMessage(messages.rovo_prompt_button_show_other_mentions);
|
|
89
|
-
const html_other_mentions = intl.formatMessage(messages.rovo_prompt_message_show_other_mentions, {
|
|
90
|
-
context: contextLong,
|
|
91
|
-
url
|
|
92
|
-
}, {
|
|
93
|
-
ignoreTag: true
|
|
94
|
-
});
|
|
95
|
-
return {
|
|
96
|
-
icon: /*#__PURE__*/React.createElement(AiChapterIcon, null),
|
|
97
|
-
content: label_other_mentions,
|
|
98
|
-
tooltipMessage: label_other_mentions,
|
|
99
|
-
data: {
|
|
100
|
-
name: label_other_mentions,
|
|
101
|
-
dialogues: [],
|
|
102
|
-
prompt: htmlToAdf(html_other_mentions)
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
case RovoChatPromptKey.SUGGEST_IMPROVEMENT:
|
|
106
|
-
const label_improvement = intl.formatMessage(messages.rovo_prompt_button_suggest_improvement, {
|
|
107
|
-
context: contextShort
|
|
108
|
-
});
|
|
109
|
-
const html_improvement = intl.formatMessage(messages.rovo_prompt_message_suggest_improvement, {
|
|
110
|
-
context: contextLong,
|
|
111
|
-
url
|
|
112
|
-
}, {
|
|
113
|
-
ignoreTag: true
|
|
114
|
-
});
|
|
115
|
-
return {
|
|
116
|
-
icon: /*#__PURE__*/React.createElement(AISearchIcon, null),
|
|
117
|
-
content: label_improvement,
|
|
118
|
-
tooltipMessage: label_improvement,
|
|
119
|
-
data: {
|
|
120
|
-
name: label_improvement,
|
|
121
|
-
dialogues: [],
|
|
122
|
-
prompt: htmlToAdf(html_improvement)
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
61
|
case RovoChatPromptKey.SUMMARIZE_LINK:
|
|
126
62
|
const label_summarize = intl.formatMessage(messages.ai_summarize);
|
|
127
63
|
const html_summarize = intl.formatMessage(messages.rovo_prompt_message_summarize, {
|
package/dist/esm/messages.js
CHANGED
|
@@ -986,51 +986,11 @@ export var 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>',
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "45.6.
|
|
7
|
+
packageVersion: "45.6.9" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,10 +12,9 @@ import { ActionName } from '../../../../../constants';
|
|
|
12
12
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
13
13
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
14
14
|
import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
|
|
15
|
-
import { getPromptAction
|
|
15
|
+
import { getPromptAction } from '../../../../common/rovo-chat-utils';
|
|
16
16
|
import Action from '../action';
|
|
17
|
-
var
|
|
18
|
-
var DEFAULT_PROMPTS = GOOGLE_PROMPTS;
|
|
17
|
+
var DEFAULT_PROMPTS = [];
|
|
19
18
|
var RovoChatAction = function RovoChatAction(_ref) {
|
|
20
19
|
var _context$actions;
|
|
21
20
|
var onClickCallback = _ref.onClick,
|
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useMemo, useState } from 'react';
|
|
7
7
|
import { di } from 'react-magnetic-di';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { ActionName, SmartLinkSize } from '../../../../../constants';
|
|
10
9
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
11
10
|
import * as Actions from '../../actions';
|
|
@@ -42,18 +41,15 @@ export var getPrimitivesPaddingSpaceBySize = function getPrimitivesPaddingSpaceB
|
|
|
42
41
|
}
|
|
43
42
|
};
|
|
44
43
|
var ActionBlock = function ActionBlock(_ref) {
|
|
45
|
-
var _context$actions;
|
|
46
44
|
var blockRef = _ref.blockRef,
|
|
47
45
|
onClickCallback = _ref.onClick,
|
|
48
46
|
size = _ref.size,
|
|
49
47
|
spaceInline = _ref.spaceInline,
|
|
50
48
|
className = _ref.className,
|
|
51
49
|
_ref$testId = _ref.testId,
|
|
52
|
-
testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId
|
|
53
|
-
isAny3pRovoActionsExperimentOn = _ref.isAny3pRovoActionsExperimentOn;
|
|
50
|
+
testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId;
|
|
54
51
|
var context = useFlexibleUiContext();
|
|
55
52
|
var ui = useFlexibleUiOptionContext();
|
|
56
|
-
var isRovoChatActionAvailable = isAny3pRovoActionsExperimentOn && 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[ActionName.RovoChatAction]) !== undefined : undefined;
|
|
57
53
|
var _useState = useState(),
|
|
58
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
59
55
|
message = _useState2[0],
|
|
@@ -77,9 +73,9 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
77
73
|
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
78
74
|
return;
|
|
79
75
|
}
|
|
80
|
-
var arr =
|
|
76
|
+
var arr = Object.keys(context.actions).filter(function (name) {
|
|
81
77
|
return name !== ActionName.RovoChatAction;
|
|
82
|
-
})
|
|
78
|
+
});
|
|
83
79
|
arr.sort(sort);
|
|
84
80
|
var renderAction = function renderAction(name) {
|
|
85
81
|
var Action = name in Actions ? Actions[name] : undefined;
|
|
@@ -107,7 +103,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
107
103
|
return arr.map(function (name) {
|
|
108
104
|
return renderAction(name);
|
|
109
105
|
});
|
|
110
|
-
}, [context === null || context === void 0 ? void 0 : context.actions,
|
|
106
|
+
}, [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]);
|
|
111
107
|
if (!actions) {
|
|
112
108
|
return null;
|
|
113
109
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["testId"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
|
|
6
6
|
import { useFlexibleCardContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
7
|
-
import AISummaryBlockResolvedView
|
|
7
|
+
import AISummaryBlockResolvedView from './resolved';
|
|
8
8
|
/**
|
|
9
9
|
* Represents an AISummaryBlock, designed to summarising link resource
|
|
10
10
|
* content using AI.
|
|
@@ -13,9 +13,8 @@ import AISummaryBlockResolvedView, { RovoSummaryBlockResolvedView } from './reso
|
|
|
13
13
|
* @see Block
|
|
14
14
|
*/
|
|
15
15
|
var AISummaryBlock = function AISummaryBlock(_ref) {
|
|
16
|
-
var _context$actions, _props$
|
|
17
|
-
var
|
|
18
|
-
_ref$testId = _ref.testId,
|
|
16
|
+
var _context$actions, _props$size, _cardContext$ui;
|
|
17
|
+
var _ref$testId = _ref.testId,
|
|
19
18
|
testId = _ref$testId === void 0 ? 'smart-ai-summary-block' : _ref$testId,
|
|
20
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
20
|
var cardContext = useFlexibleCardContext();
|
|
@@ -27,16 +26,8 @@ var AISummaryBlock = function AISummaryBlock(_ref) {
|
|
|
27
26
|
if (!(actionData !== null && actionData !== void 0 && actionData.url)) {
|
|
28
27
|
return null;
|
|
29
28
|
}
|
|
30
|
-
if (isAny3pRovoActionsExperimentOn) {
|
|
31
|
-
var _props$size, _cardContext$ui;
|
|
32
|
-
return /*#__PURE__*/React.createElement(RovoSummaryBlockResolvedView, _extends({}, props, {
|
|
33
|
-
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,
|
|
34
|
-
testId: testId,
|
|
35
|
-
url: actionData.url
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
29
|
return /*#__PURE__*/React.createElement(AISummaryBlockResolvedView, _extends({}, props, {
|
|
39
|
-
size: (_props$
|
|
30
|
+
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,
|
|
40
31
|
testId: testId,
|
|
41
32
|
url: actionData.url
|
|
42
33
|
}));
|
|
@@ -8,10 +8,8 @@ import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { componentWithCondition, functionUnionWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
11
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
13
12
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
14
|
-
import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
|
|
15
13
|
import { getClickUrl, getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
|
|
16
14
|
import useRovoConfig from '../../../state/hooks/use-rovo-config';
|
|
17
15
|
import { useSmartLinkCrossProductUrlWrapperGated } from '../../../state/hooks/use-smart-link-cross-product-url-wrapper';
|
|
@@ -69,8 +67,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
69
67
|
onMouseLeave = _ref4.onMouseLeave,
|
|
70
68
|
onDismiss = _ref4.onDismiss,
|
|
71
69
|
actionOptions = _ref4.actionOptions,
|
|
72
|
-
hoverPreviewOptions = _ref4.hoverPreviewOptions
|
|
73
|
-
showRovoResolvedView = _ref4.showRovoResolvedView;
|
|
70
|
+
hoverPreviewOptions = _ref4.hoverPreviewOptions;
|
|
74
71
|
var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
|
|
75
72
|
createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
|
|
76
73
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -274,8 +271,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
274
271
|
}
|
|
275
272
|
if (isResolved) {
|
|
276
273
|
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
277
|
-
actionOptions: actionOptions
|
|
278
|
-
showRovoResolvedView: showRovoResolvedView
|
|
274
|
+
actionOptions: actionOptions
|
|
279
275
|
} : undefined, {
|
|
280
276
|
cardState: cardState,
|
|
281
277
|
extensionKey: extensionKey,
|
|
@@ -326,8 +322,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
326
322
|
}
|
|
327
323
|
if (cardState.status === 'resolved') {
|
|
328
324
|
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
329
|
-
actionOptions: actionOptions
|
|
330
|
-
showRovoResolvedView: showRovoResolvedView
|
|
325
|
+
actionOptions: actionOptions
|
|
331
326
|
} : undefined, {
|
|
332
327
|
cardState: cardState,
|
|
333
328
|
extensionKey: extensionKey,
|
|
@@ -350,23 +345,10 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
350
345
|
}
|
|
351
346
|
};
|
|
352
347
|
var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(props) {
|
|
353
|
-
var cardState = props.cardState,
|
|
354
|
-
actionOptions = props.actionOptions;
|
|
355
|
-
var rovoConfig = useRovoConfig();
|
|
356
|
-
var isResolved = useIsResolvedView(props);
|
|
357
348
|
var showPreauthBetterHovercard = useIsShowPreauthBetterHovercard(props);
|
|
358
|
-
var showRovoResolvedView = useMemo(function () {
|
|
359
|
-
return isResolved && cardState.details && extractRovoChatAction({
|
|
360
|
-
response: cardState.details,
|
|
361
|
-
rovoConfig: rovoConfig,
|
|
362
|
-
actionOptions: actionOptions
|
|
363
|
-
}) !== undefined;
|
|
364
|
-
}, [actionOptions, cardState.details, rovoConfig, isResolved]);
|
|
365
349
|
var data = useMemo(function () {
|
|
366
350
|
var viewVariant = 'default';
|
|
367
|
-
if (
|
|
368
|
-
viewVariant = 'rovo-resolved-view';
|
|
369
|
-
} else if (showPreauthBetterHovercard) {
|
|
351
|
+
if (showPreauthBetterHovercard) {
|
|
370
352
|
viewVariant = 'rovo-unauthorised-view';
|
|
371
353
|
}
|
|
372
354
|
return {
|
|
@@ -374,17 +356,12 @@ var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(p
|
|
|
374
356
|
viewVariant: viewVariant
|
|
375
357
|
}
|
|
376
358
|
};
|
|
377
|
-
}, [
|
|
359
|
+
}, [showPreauthBetterHovercard]);
|
|
378
360
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
379
361
|
data: data
|
|
380
|
-
}, /*#__PURE__*/React.createElement(HoverCardContent,
|
|
381
|
-
showRovoResolvedView: showRovoResolvedView
|
|
382
|
-
})));
|
|
362
|
+
}, /*#__PURE__*/React.createElement(HoverCardContent, props));
|
|
383
363
|
};
|
|
384
364
|
var _default_1 = componentWithCondition(function () {
|
|
385
|
-
|
|
386
|
-
var flagA = fg('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
387
|
-
var flagB = fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
388
|
-
return flagA || flagB;
|
|
365
|
+
return fg('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
389
366
|
}, HoverCardContentWithViewVariant, HoverCardContent);
|
|
390
367
|
export default _default_1;
|
|
@@ -4,13 +4,12 @@ import "./index.compiled.css";
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
9
8
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
10
9
|
import { succeedUfoExperience } from '../../../../../state/analytics';
|
|
11
10
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
12
11
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
13
|
-
import { ActionBlock, AIFooterBlock, AISummaryBlock,
|
|
12
|
+
import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
14
13
|
import { getMetadata } from '../../../utils';
|
|
15
14
|
import ImagePreview from '../../ImagePreview';
|
|
16
15
|
var hiddenSnippetStyles = null;
|
|
@@ -24,14 +23,10 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
24
23
|
flexibleCardProps = _ref.flexibleCardProps,
|
|
25
24
|
isAISummaryEnabled = _ref.isAISummaryEnabled,
|
|
26
25
|
onActionClick = _ref.onActionClick,
|
|
27
|
-
showRovoResolvedView = _ref.showRovoResolvedView,
|
|
28
26
|
titleBlockProps = _ref.titleBlockProps,
|
|
29
27
|
id = _ref.id;
|
|
30
28
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
31
29
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
32
|
-
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
33
|
-
// by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
|
|
34
|
-
var is3PAuthRovoActionsExperimentOn = showRovoResolvedView && expValEquals('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
35
30
|
useEffect(function () {
|
|
36
31
|
// Since this hover view is only rendered on resolved status,
|
|
37
32
|
// there is no need to check for statuses.
|
|
@@ -78,8 +73,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
78
73
|
size: SmartLinkSize.Medium
|
|
79
74
|
}), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
80
75
|
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
81
|
-
placeholder: snippet
|
|
82
|
-
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn
|
|
76
|
+
placeholder: snippet
|
|
83
77
|
}) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
84
78
|
testId: "hidden-snippet",
|
|
85
79
|
onRender: onSnippetRender,
|
|
@@ -89,10 +83,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
89
83
|
}), /*#__PURE__*/React.createElement(ActionBlock, {
|
|
90
84
|
onClick: onActionClick,
|
|
91
85
|
spaceInline: "space.100",
|
|
92
|
-
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn,
|
|
93
86
|
className: ax(["_n3td1b66"])
|
|
94
|
-
}),
|
|
95
|
-
onActionClick: onActionClick
|
|
96
|
-
}) : /*#__PURE__*/React.createElement(AIFooterBlock, null));
|
|
87
|
+
}), /*#__PURE__*/React.createElement(AIFooterBlock, null));
|
|
97
88
|
};
|
|
98
89
|
export default HoverCardResolvedView;
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "45.6.
|
|
15
|
+
packageVersion: "45.6.9",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|