@atlaskit/smart-card 44.21.0 → 44.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/state/hooks/use-inline-tailored-action-experiment/index.js +55 -0
- package/dist/cjs/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +18 -7
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +6 -6
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +15 -337
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +3 -3
- package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +10 -1
- package/dist/cjs/view/InlineCard/common/rovo-actions-cta/index.js +43 -5
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/rovo-chat-utils/index.js +332 -0
- package/dist/es2019/state/hooks/use-inline-tailored-action-experiment/index.js +49 -0
- package/dist/es2019/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +13 -5
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +2 -321
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -1
- package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +12 -2
- package/dist/es2019/view/InlineCard/common/rovo-actions-cta/index.js +44 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/rovo-chat-utils/index.js +322 -0
- package/dist/esm/state/hooks/use-inline-tailored-action-experiment/index.js +48 -0
- package/dist/esm/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +17 -7
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +13 -335
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +1 -1
- package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +11 -2
- package/dist/esm/view/InlineCard/common/rovo-actions-cta/index.js +41 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/rovo-chat-utils/index.js +325 -0
- package/dist/types/state/hooks/use-inline-tailored-action-experiment/index.d.ts +24 -0
- package/dist/types/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +1 -15
- package/dist/types/view/InlineCard/common/rovo-actions-cta/index.d.ts +4 -4
- package/dist/types/view/common/rovo-chat-utils/index.d.ts +25 -0
- package/dist/types-ts4.5/state/hooks/use-inline-tailored-action-experiment/index.d.ts +24 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +1 -15
- package/dist/types-ts4.5/view/InlineCard/common/rovo-actions-cta/index.d.ts +4 -4
- package/dist/types-ts4.5/view/common/rovo-chat-utils/index.d.ts +25 -0
- package/package.json +6 -3
|
@@ -8,347 +8,25 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
8
8
|
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) { _defineProperty(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; }
|
|
9
9
|
import React, { useCallback, useMemo } from 'react';
|
|
10
10
|
import { useIntl } from 'react-intl';
|
|
11
|
-
import AiSearchIcon from '@atlaskit/icon-lab/core/ai-search';
|
|
12
|
-
import AiChatIcon from '@atlaskit/icon/core/ai-chat';
|
|
13
|
-
import AiGenerativeTextSummaryIcon from '@atlaskit/icon/core/ai-generative-text-summary';
|
|
14
|
-
import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
|
|
15
|
-
import { RovoIcon } from '@atlaskit/logo';
|
|
16
11
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
17
|
-
import { ActionName
|
|
18
|
-
import { messages } from '../../../../../messages';
|
|
12
|
+
import { ActionName } from '../../../../../constants';
|
|
19
13
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
20
|
-
import { isBlockCardRovoActionExperimentEnabled } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
21
14
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
22
15
|
import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
|
|
23
|
-
import
|
|
24
|
-
import AIEditIcon from '../../../assets/ai-edit-icon';
|
|
25
|
-
import AISearchIcon from '../../../assets/ai-search-icon';
|
|
16
|
+
import { getPromptAction, RovoChatPromptKey } from "../../../../common/rovo-chat-utils";
|
|
26
17
|
import Action from '../action';
|
|
27
|
-
import htmlToAdf from './html-to-adf';
|
|
28
|
-
export var RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
|
|
29
|
-
RovoChatPromptKey["RECOMMEND_OTHER_SOURCES"] = "recommend-other-sources";
|
|
30
|
-
RovoChatPromptKey["SHOW_OTHER_MENTIONS"] = "show-other-mentions";
|
|
31
|
-
RovoChatPromptKey["SUGGEST_IMPROVEMENT"] = "suggest-improvement";
|
|
32
|
-
RovoChatPromptKey["SUMMARIZE_LINK"] = "summarize-link";
|
|
33
|
-
RovoChatPromptKey["KEY_HIGHLIGHTS"] = "key-highlights";
|
|
34
|
-
RovoChatPromptKey["ASK_ROVO_ANYTHING"] = "ask-rovo-anything";
|
|
35
|
-
RovoChatPromptKey["IDENTIFY_KEY_POINTS"] = "identify-key-points";
|
|
36
|
-
RovoChatPromptKey["IDENTIFY_KEY_TRENDS"] = "identify-key-trends";
|
|
37
|
-
RovoChatPromptKey["FIND_OPEN_QUESTIONS"] = "find-open-questions";
|
|
38
|
-
RovoChatPromptKey["HIGHLIGHT_RELEVANT_CONTENT"] = "highlight-relevant-content";
|
|
39
|
-
RovoChatPromptKey["SUMMARIZE_THIS_FOR_ME"] = "summarize-this-for-me";
|
|
40
|
-
RovoChatPromptKey["ASK_A_SPECIFIC_QUESTION"] = "ask-a-specific-question";
|
|
41
|
-
RovoChatPromptKey["SHOW_ME_WHATS_RELEVANT"] = "show-me-whats-relevant";
|
|
42
|
-
return RovoChatPromptKey;
|
|
43
|
-
}({});
|
|
44
18
|
var GOOGLE_PROMPTS = [RovoChatPromptKey.RECOMMEND_OTHER_SOURCES, RovoChatPromptKey.SHOW_OTHER_MENTIONS, RovoChatPromptKey.SUGGEST_IMPROVEMENT];
|
|
45
19
|
var GENERIC_3P_PROMPTS = [
|
|
46
20
|
// For rovogrowth-640-inline-action-nudge-exp only
|
|
47
21
|
RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT, RovoChatPromptKey.SUMMARIZE_THIS_FOR_ME, RovoChatPromptKey.ASK_A_SPECIFIC_QUESTION];
|
|
48
22
|
var DEFAULT_PROMPTS = GOOGLE_PROMPTS;
|
|
49
|
-
var
|
|
50
|
-
switch (product) {
|
|
51
|
-
case 'CONFLUENCE':
|
|
52
|
-
return {
|
|
53
|
-
contextLong: intl.formatMessage(messages.rovo_prompt_context_confluence_page),
|
|
54
|
-
contextShort: intl.formatMessage(messages.rovo_prompt_context_confluence_page_short)
|
|
55
|
-
};
|
|
56
|
-
case 'JSW':
|
|
57
|
-
case 'JWM':
|
|
58
|
-
case 'JSM':
|
|
59
|
-
case 'JPD':
|
|
60
|
-
return {
|
|
61
|
-
contextLong: intl.formatMessage(messages.rovo_prompt_context_jira_work_item),
|
|
62
|
-
contextShort: intl.formatMessage(messages.rovo_prompt_context_jira_work_item_short)
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
67
|
-
var _getContext;
|
|
68
|
-
var url = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
69
|
-
var product = arguments.length > 3 ? arguments[3] : undefined;
|
|
70
|
-
var iconSize = arguments.length > 4 ? arguments[4] : undefined;
|
|
71
|
-
var cardAppearance = arguments.length > 5 ? arguments[5] : undefined;
|
|
72
|
-
var _ref = (_getContext = getContext(intl, product)) !== null && _getContext !== void 0 ? _getContext : {
|
|
73
|
-
contextLong: intl.formatMessage(messages.rovo_prompt_context_generic),
|
|
74
|
-
contextShort: intl.formatMessage(messages.rovo_prompt_context_generic)
|
|
75
|
-
},
|
|
76
|
-
contextLong = _ref.contextLong,
|
|
77
|
-
contextShort = _ref.contextShort;
|
|
78
|
-
var isBlockCard3PExperimentEnabled = isBlockCardRovoActionExperimentEnabled(product);
|
|
79
|
-
switch (promptKey) {
|
|
80
|
-
case RovoChatPromptKey.RECOMMEND_OTHER_SOURCES:
|
|
81
|
-
var label_recommend = intl.formatMessage(messages.rovo_prompt_button_recommend_other_sources);
|
|
82
|
-
var html_recommend = intl.formatMessage(messages.rovo_prompt_message_recommend_other_sources, {
|
|
83
|
-
context: contextLong,
|
|
84
|
-
url: url
|
|
85
|
-
}, {
|
|
86
|
-
ignoreTag: true
|
|
87
|
-
});
|
|
88
|
-
return {
|
|
89
|
-
icon: /*#__PURE__*/React.createElement(AIEditIcon, null),
|
|
90
|
-
content: label_recommend,
|
|
91
|
-
tooltipMessage: label_recommend,
|
|
92
|
-
data: {
|
|
93
|
-
name: label_recommend,
|
|
94
|
-
dialogues: [],
|
|
95
|
-
prompt: htmlToAdf(html_recommend)
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
case RovoChatPromptKey.SHOW_OTHER_MENTIONS:
|
|
99
|
-
var label_other_mentions = intl.formatMessage(messages.rovo_prompt_button_show_other_mentions);
|
|
100
|
-
var html_other_mentions = intl.formatMessage(messages.rovo_prompt_message_show_other_mentions, {
|
|
101
|
-
context: contextLong,
|
|
102
|
-
url: url
|
|
103
|
-
}, {
|
|
104
|
-
ignoreTag: true
|
|
105
|
-
});
|
|
106
|
-
return {
|
|
107
|
-
icon: /*#__PURE__*/React.createElement(AiChapterIcon, null),
|
|
108
|
-
content: label_other_mentions,
|
|
109
|
-
tooltipMessage: label_other_mentions,
|
|
110
|
-
data: {
|
|
111
|
-
name: label_other_mentions,
|
|
112
|
-
dialogues: [],
|
|
113
|
-
prompt: htmlToAdf(html_other_mentions)
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
case RovoChatPromptKey.SUGGEST_IMPROVEMENT:
|
|
117
|
-
var label_improvement = intl.formatMessage(messages.rovo_prompt_button_suggest_improvement, {
|
|
118
|
-
context: contextShort
|
|
119
|
-
});
|
|
120
|
-
var html_improvement = intl.formatMessage(messages.rovo_prompt_message_suggest_improvement, {
|
|
121
|
-
context: contextLong,
|
|
122
|
-
url: url
|
|
123
|
-
}, {
|
|
124
|
-
ignoreTag: true
|
|
125
|
-
});
|
|
126
|
-
return {
|
|
127
|
-
icon: /*#__PURE__*/React.createElement(AISearchIcon, null),
|
|
128
|
-
content: label_improvement,
|
|
129
|
-
tooltipMessage: label_improvement,
|
|
130
|
-
data: {
|
|
131
|
-
name: label_improvement,
|
|
132
|
-
dialogues: [],
|
|
133
|
-
prompt: htmlToAdf(html_improvement)
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
case RovoChatPromptKey.SUMMARIZE_LINK:
|
|
137
|
-
var label_summarize = intl.formatMessage(messages.ai_summarize);
|
|
138
|
-
var html_summarize = intl.formatMessage(messages.rovo_prompt_message_summarize, {
|
|
139
|
-
url: url
|
|
140
|
-
}, {
|
|
141
|
-
ignoreTag: true
|
|
142
|
-
});
|
|
143
|
-
return {
|
|
144
|
-
icon: cardAppearance === CardDisplay.Block && isBlockCard3PExperimentEnabled ? /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
145
|
-
label: label_summarize,
|
|
146
|
-
size: iconSize
|
|
147
|
-
}) : /*#__PURE__*/React.createElement(AIEditIcon, null),
|
|
148
|
-
content: label_summarize,
|
|
149
|
-
tooltipMessage: label_summarize,
|
|
150
|
-
data: {
|
|
151
|
-
name: label_summarize,
|
|
152
|
-
dialogues: [],
|
|
153
|
-
prompt: htmlToAdf(html_summarize),
|
|
154
|
-
mode: {
|
|
155
|
-
fastModeEnabled: true
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
case RovoChatPromptKey.SUMMARIZE_THIS_FOR_ME:
|
|
160
|
-
var label_summarize_this_for_me = intl.formatMessage(messages.rovo_prompt_button_summarize_this);
|
|
161
|
-
var html_summarize_this_for_me = intl.formatMessage(messages.rovo_prompt_message_summarize, {
|
|
162
|
-
url: url
|
|
163
|
-
}, {
|
|
164
|
-
ignoreTag: true
|
|
165
|
-
});
|
|
166
|
-
return {
|
|
167
|
-
icon: /*#__PURE__*/React.createElement(AiGenerativeTextSummaryIcon, {
|
|
168
|
-
label: label_summarize_this_for_me
|
|
169
|
-
}),
|
|
170
|
-
content: label_summarize_this_for_me,
|
|
171
|
-
tooltipMessage: label_summarize_this_for_me,
|
|
172
|
-
data: {
|
|
173
|
-
name: label_summarize_this_for_me,
|
|
174
|
-
dialogues: [],
|
|
175
|
-
prompt: htmlToAdf(html_summarize_this_for_me),
|
|
176
|
-
mode: {
|
|
177
|
-
fastModeEnabled: true
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
case RovoChatPromptKey.HIGHLIGHT_RELEVANT_CONTENT:
|
|
182
|
-
var label_highlight_relevant_content = intl.formatMessage(messages.rovo_prompt_button_highlight_relevant_content);
|
|
183
|
-
var html_highlight_relevant_content = intl.formatMessage(messages.rovo_prompt_message_highlight_relevant_content, {
|
|
184
|
-
context: contextLong,
|
|
185
|
-
url: url
|
|
186
|
-
}, {
|
|
187
|
-
ignoreTag: true
|
|
188
|
-
});
|
|
189
|
-
return {
|
|
190
|
-
icon: /*#__PURE__*/React.createElement(AiChapterIcon, null),
|
|
191
|
-
content: label_highlight_relevant_content,
|
|
192
|
-
tooltipMessage: label_highlight_relevant_content,
|
|
193
|
-
data: {
|
|
194
|
-
name: label_highlight_relevant_content,
|
|
195
|
-
dialogues: [],
|
|
196
|
-
prompt: htmlToAdf(html_highlight_relevant_content),
|
|
197
|
-
mode: {
|
|
198
|
-
fastModeEnabled: true
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
case RovoChatPromptKey.ASK_ROVO_ANYTHING:
|
|
203
|
-
var label_ask_rovo_anything = intl.formatMessage(messages.rovo_prompt_button_ask_rovo_anything);
|
|
204
|
-
var prompt_ask_rovo_anything = intl.formatMessage(messages.rovo_prompt_message_ask_rovo_anything, {
|
|
205
|
-
url: url
|
|
206
|
-
});
|
|
207
|
-
return {
|
|
208
|
-
icon: cardAppearance === CardDisplay.Block && isBlockCard3PExperimentEnabled ? /*#__PURE__*/React.createElement(RovoIcon, {
|
|
209
|
-
label: label_ask_rovo_anything,
|
|
210
|
-
size: 'xxsmall',
|
|
211
|
-
shouldUseHexLogo: true
|
|
212
|
-
}) : /*#__PURE__*/React.createElement(AISearchIcon, null),
|
|
213
|
-
content: label_ask_rovo_anything,
|
|
214
|
-
tooltipMessage: label_ask_rovo_anything,
|
|
215
|
-
data: {
|
|
216
|
-
name: label_ask_rovo_anything,
|
|
217
|
-
dialogues: [],
|
|
218
|
-
prompt: prompt_ask_rovo_anything,
|
|
219
|
-
isPromptPlaceholder: true,
|
|
220
|
-
placeholderType: 'generic'
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
case RovoChatPromptKey.ASK_A_SPECIFIC_QUESTION:
|
|
224
|
-
var label_ask_a_specific_question = intl.formatMessage(messages.rovo_prompt_button_ask_a_specific_question);
|
|
225
|
-
var prompt_ask_a_specific_question = intl.formatMessage(messages.rovo_prompt_message_ask_rovo_anything, {
|
|
226
|
-
url: url
|
|
227
|
-
});
|
|
228
|
-
return {
|
|
229
|
-
icon: /*#__PURE__*/React.createElement(RovoChatIcon, {
|
|
230
|
-
label: label_ask_a_specific_question
|
|
231
|
-
}),
|
|
232
|
-
content: label_ask_a_specific_question,
|
|
233
|
-
tooltipMessage: label_ask_a_specific_question,
|
|
234
|
-
data: {
|
|
235
|
-
name: label_ask_a_specific_question,
|
|
236
|
-
dialogues: [],
|
|
237
|
-
prompt: prompt_ask_a_specific_question,
|
|
238
|
-
isPromptPlaceholder: true,
|
|
239
|
-
placeholderType: 'generic'
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
case RovoChatPromptKey.KEY_HIGHLIGHTS:
|
|
243
|
-
var label_key_highlights = intl.formatMessage(messages.rovo_prompt_button_key_highlights);
|
|
244
|
-
var html_key_highlights = intl.formatMessage(messages.rovo_prompt_message_key_highlights, {
|
|
245
|
-
context: contextLong,
|
|
246
|
-
url: url
|
|
247
|
-
}, {
|
|
248
|
-
ignoreTag: true
|
|
249
|
-
});
|
|
250
|
-
return {
|
|
251
|
-
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
252
|
-
label: label_key_highlights,
|
|
253
|
-
size: iconSize
|
|
254
|
-
}),
|
|
255
|
-
content: label_key_highlights,
|
|
256
|
-
tooltipMessage: label_key_highlights,
|
|
257
|
-
data: {
|
|
258
|
-
name: label_key_highlights,
|
|
259
|
-
dialogues: [],
|
|
260
|
-
prompt: htmlToAdf(html_key_highlights)
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
case RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT:
|
|
264
|
-
var label_show_me_whats_relevant = intl.formatMessage(messages.rovo_prompt_button_show_me_whats_relevant);
|
|
265
|
-
var html_show_me_whats_relevant = intl.formatMessage(messages.rovo_prompt_message_highlight_relevant_content, {
|
|
266
|
-
context: contextLong,
|
|
267
|
-
url: url
|
|
268
|
-
}, {
|
|
269
|
-
ignoreTag: true
|
|
270
|
-
});
|
|
271
|
-
return {
|
|
272
|
-
icon: /*#__PURE__*/React.createElement(AiSearchIcon, {
|
|
273
|
-
label: label_show_me_whats_relevant
|
|
274
|
-
}),
|
|
275
|
-
content: label_show_me_whats_relevant,
|
|
276
|
-
tooltipMessage: label_show_me_whats_relevant,
|
|
277
|
-
data: {
|
|
278
|
-
name: label_show_me_whats_relevant,
|
|
279
|
-
dialogues: [],
|
|
280
|
-
prompt: htmlToAdf(html_show_me_whats_relevant)
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
case RovoChatPromptKey.IDENTIFY_KEY_TRENDS:
|
|
284
|
-
var label_identify_key_trends = intl.formatMessage(messages.rovo_prompt_button_identify_key_trends);
|
|
285
|
-
var html_identify_key_trends = intl.formatMessage(messages.rovo_prompt_message_identify_key_trends, {
|
|
286
|
-
url: url
|
|
287
|
-
}, {
|
|
288
|
-
ignoreTag: true
|
|
289
|
-
});
|
|
290
|
-
return {
|
|
291
|
-
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
292
|
-
label: label_identify_key_trends,
|
|
293
|
-
size: iconSize
|
|
294
|
-
}),
|
|
295
|
-
content: label_identify_key_trends,
|
|
296
|
-
tooltipMessage: label_identify_key_trends,
|
|
297
|
-
data: {
|
|
298
|
-
name: label_identify_key_trends,
|
|
299
|
-
dialogues: [],
|
|
300
|
-
prompt: htmlToAdf(html_identify_key_trends)
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
case RovoChatPromptKey.IDENTIFY_KEY_POINTS:
|
|
304
|
-
var label_identify_key_points = intl.formatMessage(messages.rovo_prompt_button_identify_key_points);
|
|
305
|
-
var html_identify_key_points = intl.formatMessage(messages.rovo_prompt_message_identify_key_points, {
|
|
306
|
-
url: url
|
|
307
|
-
}, {
|
|
308
|
-
ignoreTag: true
|
|
309
|
-
});
|
|
310
|
-
return {
|
|
311
|
-
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
312
|
-
label: label_identify_key_points,
|
|
313
|
-
size: iconSize
|
|
314
|
-
}),
|
|
315
|
-
content: label_identify_key_points,
|
|
316
|
-
tooltipMessage: label_identify_key_points,
|
|
317
|
-
data: {
|
|
318
|
-
name: label_identify_key_points,
|
|
319
|
-
dialogues: [],
|
|
320
|
-
prompt: htmlToAdf(html_identify_key_points)
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
case RovoChatPromptKey.FIND_OPEN_QUESTIONS:
|
|
324
|
-
var label_find_open_questions = intl.formatMessage(messages.rovo_prompt_button_find_open_questions);
|
|
325
|
-
var html_find_open_questions = intl.formatMessage(messages.rovo_prompt_message_find_open_questions, {
|
|
326
|
-
url: url
|
|
327
|
-
}, {
|
|
328
|
-
ignoreTag: true
|
|
329
|
-
});
|
|
330
|
-
return {
|
|
331
|
-
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
332
|
-
label: label_find_open_questions,
|
|
333
|
-
size: iconSize
|
|
334
|
-
}),
|
|
335
|
-
content: label_find_open_questions,
|
|
336
|
-
tooltipMessage: label_find_open_questions,
|
|
337
|
-
data: {
|
|
338
|
-
name: label_find_open_questions,
|
|
339
|
-
dialogues: [],
|
|
340
|
-
prompt: htmlToAdf(html_find_open_questions)
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
var RovoChatAction = function RovoChatAction(_ref2) {
|
|
23
|
+
var RovoChatAction = function RovoChatAction(_ref) {
|
|
346
24
|
var _context$actions;
|
|
347
|
-
var onClickCallback =
|
|
348
|
-
prompts =
|
|
349
|
-
|
|
350
|
-
testId =
|
|
351
|
-
props = _objectWithoutProperties(
|
|
25
|
+
var onClickCallback = _ref.onClick,
|
|
26
|
+
prompts = _ref.prompts,
|
|
27
|
+
_ref$testId = _ref.testId,
|
|
28
|
+
testId = _ref$testId === void 0 ? 'smart-action-rovo-chat-action' : _ref$testId,
|
|
29
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
352
30
|
var intl = useIntl();
|
|
353
31
|
var _useRovoChat = useRovoChat(),
|
|
354
32
|
isRovoChatEnabled = _useRovoChat.isRovoChatEnabled,
|
|
@@ -392,11 +70,11 @@ var RovoChatAction = function RovoChatAction(_ref2) {
|
|
|
392
70
|
}, [data === null || data === void 0 ? void 0 : data.invokeAction, invoke, onClickCallback, sendPromptMessage]);
|
|
393
71
|
var promptActions = useMemo(function () {
|
|
394
72
|
return resolvedPrompts.map(function (promptKey, idx) {
|
|
395
|
-
var
|
|
396
|
-
icon =
|
|
397
|
-
content =
|
|
398
|
-
tooltipMessage =
|
|
399
|
-
promptData =
|
|
73
|
+
var _ref2 = getPromptAction(promptKey, intl, data === null || data === void 0 ? void 0 : data.url, data === null || data === void 0 ? void 0 : data.product, props.iconSize, props.cardAppearance) || {},
|
|
74
|
+
icon = _ref2.icon,
|
|
75
|
+
content = _ref2.content,
|
|
76
|
+
tooltipMessage = _ref2.tooltipMessage,
|
|
77
|
+
promptData = _ref2.data;
|
|
400
78
|
return promptData ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
401
79
|
content: content,
|
|
402
80
|
icon: icon,
|
|
@@ -22,7 +22,7 @@ import { messages } from '../../../../../messages';
|
|
|
22
22
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
23
23
|
import { isBlockCardRovoActionExperimentEnabled } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
24
24
|
import useRovoConfig from '../../../../../state/hooks/use-rovo-config';
|
|
25
|
-
import { RovoChatPromptKey } from '
|
|
25
|
+
import { RovoChatPromptKey } from '../../../../common/rovo-chat-utils';
|
|
26
26
|
import { sizeToButtonSpacing } from '../../utils';
|
|
27
27
|
import { filterActionItems } from '../utils';
|
|
28
28
|
import ActionGroupItem from './action-group-item';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { fg } from "@atlaskit/platform-feature-flags";
|
|
2
3
|
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
3
4
|
import useInlineActionNudgeExperiment from '../../../state/hooks/use-inline-action-nudge-experiment';
|
|
5
|
+
import useInlineTailoredActionExperiment from '../../../state/hooks/use-inline-tailored-action-experiment';
|
|
4
6
|
import { HoverCard } from '../../HoverCard';
|
|
5
|
-
import { RovoActionsCta } from '../common/rovo-actions-cta';
|
|
7
|
+
import { RovoActionsCta, InlineRovoActionButton } from '../common/rovo-actions-cta';
|
|
6
8
|
import { Frame } from '../Frame';
|
|
7
9
|
import { IconAndTitleLayout } from '../IconAndTitleLayout';
|
|
8
10
|
import { renderLozenge } from './renderLozenge';
|
|
@@ -81,6 +83,8 @@ export function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
81
83
|
lozenge = _ref2.lozenge;
|
|
82
84
|
var _useInlineActionNudge = useInlineActionNudgeExperiment(link, showHoverPreview, actionOptions),
|
|
83
85
|
isEnabled = _useInlineActionNudge.isEnabled;
|
|
86
|
+
var _useInlineTailoredAct = useInlineTailoredActionExperiment(link, showHoverPreview, actionOptions),
|
|
87
|
+
isInlineTailoredRovoActionEnabled = _useInlineTailoredAct.isEnabled;
|
|
84
88
|
|
|
85
89
|
// TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
|
|
86
90
|
var frame = /*#__PURE__*/React.createElement(Frame, {
|
|
@@ -99,8 +103,11 @@ export function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
99
103
|
titleTextColor: titleTextColor,
|
|
100
104
|
type: type,
|
|
101
105
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
102
|
-
}), renderLozenge(lozenge), isEnabled && /*#__PURE__*/React.createElement(RovoActionsCta, {
|
|
106
|
+
}), renderLozenge(lozenge), isEnabled && !fg('platform_sl_3p_auth_inline_tailored_cta_killswitch') && /*#__PURE__*/React.createElement(RovoActionsCta, {
|
|
103
107
|
testId: "".concat(testId, "-rovo-actions-cta")
|
|
108
|
+
}), isInlineTailoredRovoActionEnabled && /*#__PURE__*/React.createElement(InlineRovoActionButton, {
|
|
109
|
+
testId: "".concat(testId, "-rovo-actions-cta"),
|
|
110
|
+
url: link
|
|
104
111
|
}));
|
|
105
112
|
if (!showHoverPreview || !link) {
|
|
106
113
|
return frame;
|
|
@@ -112,4 +119,6 @@ export function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
112
119
|
hoverPreviewOptions: hoverPreviewOptions
|
|
113
120
|
}, frame);
|
|
114
121
|
}
|
|
122
|
+
|
|
123
|
+
// Todo: replace with platform_sl_3p_auth_inline_tailored_cta_killswitch after cleanup of rovogrowth-640-inline-action-nudge-fg
|
|
115
124
|
export var InlineCardResolvedViewFunctional = componentWithFG('rovogrowth-640-inline-action-nudge-fg', InlineCardResolvedViewFunctionalWithRovoActions, InlineCardResolvedViewBase);
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import "./index.compiled.css";
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
5
6
|
import { cx } from '@atlaskit/css';
|
|
7
|
+
import AiGenerativeTextSummaryIcon from '@atlaskit/icon/core/ai-generative-text-summary';
|
|
6
8
|
import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
|
|
7
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
9
|
+
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import useRovoChat from "../../../../state/hooks/use-rovo-chat";
|
|
11
|
+
import { getPromptAction, RovoChatPromptKey } from "../../../common/rovo-chat-utils";
|
|
12
|
+
import { ActionButton } from "../action-button";
|
|
8
13
|
var styles = {
|
|
9
14
|
innerContainer: "_1e0c1nu9 _1y1m1u8q _16d9qvcn _19bv12x7 _u5f312x7",
|
|
10
|
-
rovoIcon: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _ca0qv77o _n3tdv77o"
|
|
15
|
+
rovoIcon: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _ca0qv77o _n3tdv77o",
|
|
16
|
+
text: "_1e0c1nu9 _19bv12x7"
|
|
11
17
|
};
|
|
12
18
|
export var RovoActionsCta = function RovoActionsCta(_ref) {
|
|
13
19
|
var testId = _ref.testId;
|
|
@@ -19,4 +25,36 @@ export var RovoActionsCta = function RovoActionsCta(_ref) {
|
|
|
19
25
|
color: "var(--ds-icon-inverse, #FFFFFF)",
|
|
20
26
|
size: "small"
|
|
21
27
|
}));
|
|
28
|
+
};
|
|
29
|
+
export var InlineRovoActionButton = function InlineRovoActionButton(_ref2) {
|
|
30
|
+
var testId = _ref2.testId,
|
|
31
|
+
url = _ref2.url;
|
|
32
|
+
var _useRovoChat = useRovoChat(),
|
|
33
|
+
sendPromptMessage = _useRovoChat.sendPromptMessage,
|
|
34
|
+
isRovoChatEnabled = _useRovoChat.isRovoChatEnabled;
|
|
35
|
+
var intl = useIntl();
|
|
36
|
+
|
|
37
|
+
// TODO: NAVX-5109 implement tailored rovo chat actions here
|
|
38
|
+
var _ref3 = getPromptAction(RovoChatPromptKey.SUMMARIZE_LINK, intl, url) || {},
|
|
39
|
+
promptData = _ref3.data,
|
|
40
|
+
content = _ref3.content;
|
|
41
|
+
var handleClick = useCallback(function (event) {
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
if (isRovoChatEnabled && promptData) {
|
|
45
|
+
sendPromptMessage(promptData);
|
|
46
|
+
}
|
|
47
|
+
}, [sendPromptMessage, isRovoChatEnabled, promptData]);
|
|
48
|
+
return promptData && content ? /*#__PURE__*/React.createElement(ActionButton, {
|
|
49
|
+
onClick: handleClick,
|
|
50
|
+
testId: testId
|
|
51
|
+
}, /*#__PURE__*/React.createElement(AiGenerativeTextSummaryIcon, {
|
|
52
|
+
label: "Rovo",
|
|
53
|
+
color: "var(--ds-icon, #292A2E)",
|
|
54
|
+
size: "small"
|
|
55
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
56
|
+
xcss: styles.text
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
58
|
+
size: "small"
|
|
59
|
+
}, content))) : null;
|
|
22
60
|
};
|
|
@@ -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: "44.
|
|
15
|
+
packageVersion: "44.22.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|