@atlaskit/smart-card 44.21.0 → 44.22.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 +11 -0
- package/dist/cjs/state/hooks/use-inline-tailored-action-experiment/index.js +55 -0
- 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/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/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 +5 -2
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import AiSearchIcon from '@atlaskit/icon-lab/core/ai-search';
|
|
3
|
+
import AiChatIcon from '@atlaskit/icon/core/ai-chat';
|
|
4
|
+
import AiGenerativeTextSummaryIcon from '@atlaskit/icon/core/ai-generative-text-summary';
|
|
5
|
+
import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
|
|
6
|
+
import { RovoIcon } from '@atlaskit/logo';
|
|
7
|
+
import { CardDisplay } from "../../../constants";
|
|
8
|
+
import { messages } from "../../../messages";
|
|
9
|
+
import { isBlockCardRovoActionExperimentEnabled } from "../../../state/hooks/use-block-card-rovo-action-experiment";
|
|
10
|
+
import AiChapterIcon from "../../FlexibleCard/assets/ai-chapter-icon";
|
|
11
|
+
import AIEditIcon from "../../FlexibleCard/assets/ai-edit-icon";
|
|
12
|
+
import AISearchIcon from "../../FlexibleCard/assets/ai-search-icon";
|
|
13
|
+
import htmlToAdf from "../../FlexibleCard/components/actions/rovo-chat-action/html-to-adf";
|
|
14
|
+
export var RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
|
|
15
|
+
RovoChatPromptKey["RECOMMEND_OTHER_SOURCES"] = "recommend-other-sources";
|
|
16
|
+
RovoChatPromptKey["SHOW_OTHER_MENTIONS"] = "show-other-mentions";
|
|
17
|
+
RovoChatPromptKey["SUGGEST_IMPROVEMENT"] = "suggest-improvement";
|
|
18
|
+
RovoChatPromptKey["SUMMARIZE_LINK"] = "summarize-link";
|
|
19
|
+
RovoChatPromptKey["KEY_HIGHLIGHTS"] = "key-highlights";
|
|
20
|
+
RovoChatPromptKey["ASK_ROVO_ANYTHING"] = "ask-rovo-anything";
|
|
21
|
+
RovoChatPromptKey["IDENTIFY_KEY_POINTS"] = "identify-key-points";
|
|
22
|
+
RovoChatPromptKey["IDENTIFY_KEY_TRENDS"] = "identify-key-trends";
|
|
23
|
+
RovoChatPromptKey["FIND_OPEN_QUESTIONS"] = "find-open-questions";
|
|
24
|
+
RovoChatPromptKey["HIGHLIGHT_RELEVANT_CONTENT"] = "highlight-relevant-content";
|
|
25
|
+
RovoChatPromptKey["SUMMARIZE_THIS_FOR_ME"] = "summarize-this-for-me";
|
|
26
|
+
RovoChatPromptKey["ASK_A_SPECIFIC_QUESTION"] = "ask-a-specific-question";
|
|
27
|
+
RovoChatPromptKey["SHOW_ME_WHATS_RELEVANT"] = "show-me-whats-relevant";
|
|
28
|
+
return RovoChatPromptKey;
|
|
29
|
+
}({});
|
|
30
|
+
var getContext = function getContext(intl, product) {
|
|
31
|
+
switch (product) {
|
|
32
|
+
case 'CONFLUENCE':
|
|
33
|
+
return {
|
|
34
|
+
contextLong: intl.formatMessage(messages.rovo_prompt_context_confluence_page),
|
|
35
|
+
contextShort: intl.formatMessage(messages.rovo_prompt_context_confluence_page_short)
|
|
36
|
+
};
|
|
37
|
+
case 'JSW':
|
|
38
|
+
case 'JWM':
|
|
39
|
+
case 'JSM':
|
|
40
|
+
case 'JPD':
|
|
41
|
+
return {
|
|
42
|
+
contextLong: intl.formatMessage(messages.rovo_prompt_context_jira_work_item),
|
|
43
|
+
contextShort: intl.formatMessage(messages.rovo_prompt_context_jira_work_item_short)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
48
|
+
var _getContext;
|
|
49
|
+
var url = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
50
|
+
var product = arguments.length > 3 ? arguments[3] : undefined;
|
|
51
|
+
var iconSize = arguments.length > 4 ? arguments[4] : undefined;
|
|
52
|
+
var cardAppearance = arguments.length > 5 ? arguments[5] : undefined;
|
|
53
|
+
var _ref = (_getContext = getContext(intl, product)) !== null && _getContext !== void 0 ? _getContext : {
|
|
54
|
+
contextLong: intl.formatMessage(messages.rovo_prompt_context_generic),
|
|
55
|
+
contextShort: intl.formatMessage(messages.rovo_prompt_context_generic)
|
|
56
|
+
},
|
|
57
|
+
contextLong = _ref.contextLong,
|
|
58
|
+
contextShort = _ref.contextShort;
|
|
59
|
+
var isBlockCard3PExperimentEnabled = isBlockCardRovoActionExperimentEnabled(product);
|
|
60
|
+
switch (promptKey) {
|
|
61
|
+
case RovoChatPromptKey.RECOMMEND_OTHER_SOURCES:
|
|
62
|
+
var label_recommend = intl.formatMessage(messages.rovo_prompt_button_recommend_other_sources);
|
|
63
|
+
var html_recommend = intl.formatMessage(messages.rovo_prompt_message_recommend_other_sources, {
|
|
64
|
+
context: contextLong,
|
|
65
|
+
url: url
|
|
66
|
+
}, {
|
|
67
|
+
ignoreTag: true
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
icon: /*#__PURE__*/React.createElement(AIEditIcon, null),
|
|
71
|
+
content: label_recommend,
|
|
72
|
+
tooltipMessage: label_recommend,
|
|
73
|
+
data: {
|
|
74
|
+
name: label_recommend,
|
|
75
|
+
dialogues: [],
|
|
76
|
+
prompt: htmlToAdf(html_recommend)
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
case RovoChatPromptKey.SHOW_OTHER_MENTIONS:
|
|
80
|
+
var label_other_mentions = intl.formatMessage(messages.rovo_prompt_button_show_other_mentions);
|
|
81
|
+
var html_other_mentions = intl.formatMessage(messages.rovo_prompt_message_show_other_mentions, {
|
|
82
|
+
context: contextLong,
|
|
83
|
+
url: url
|
|
84
|
+
}, {
|
|
85
|
+
ignoreTag: true
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
icon: /*#__PURE__*/React.createElement(AiChapterIcon, null),
|
|
89
|
+
content: label_other_mentions,
|
|
90
|
+
tooltipMessage: label_other_mentions,
|
|
91
|
+
data: {
|
|
92
|
+
name: label_other_mentions,
|
|
93
|
+
dialogues: [],
|
|
94
|
+
prompt: htmlToAdf(html_other_mentions)
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
case RovoChatPromptKey.SUGGEST_IMPROVEMENT:
|
|
98
|
+
var label_improvement = intl.formatMessage(messages.rovo_prompt_button_suggest_improvement, {
|
|
99
|
+
context: contextShort
|
|
100
|
+
});
|
|
101
|
+
var html_improvement = intl.formatMessage(messages.rovo_prompt_message_suggest_improvement, {
|
|
102
|
+
context: contextLong,
|
|
103
|
+
url: url
|
|
104
|
+
}, {
|
|
105
|
+
ignoreTag: true
|
|
106
|
+
});
|
|
107
|
+
return {
|
|
108
|
+
icon: /*#__PURE__*/React.createElement(AISearchIcon, null),
|
|
109
|
+
content: label_improvement,
|
|
110
|
+
tooltipMessage: label_improvement,
|
|
111
|
+
data: {
|
|
112
|
+
name: label_improvement,
|
|
113
|
+
dialogues: [],
|
|
114
|
+
prompt: htmlToAdf(html_improvement)
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
case RovoChatPromptKey.SUMMARIZE_LINK:
|
|
118
|
+
var label_summarize = intl.formatMessage(messages.ai_summarize);
|
|
119
|
+
var html_summarize = intl.formatMessage(messages.rovo_prompt_message_summarize, {
|
|
120
|
+
url: url
|
|
121
|
+
}, {
|
|
122
|
+
ignoreTag: true
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
icon: cardAppearance === CardDisplay.Block && isBlockCard3PExperimentEnabled ? /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
126
|
+
label: label_summarize,
|
|
127
|
+
size: iconSize
|
|
128
|
+
}) : /*#__PURE__*/React.createElement(AIEditIcon, null),
|
|
129
|
+
content: label_summarize,
|
|
130
|
+
tooltipMessage: label_summarize,
|
|
131
|
+
data: {
|
|
132
|
+
name: label_summarize,
|
|
133
|
+
dialogues: [],
|
|
134
|
+
prompt: htmlToAdf(html_summarize),
|
|
135
|
+
mode: {
|
|
136
|
+
fastModeEnabled: true
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
case RovoChatPromptKey.SUMMARIZE_THIS_FOR_ME:
|
|
141
|
+
var label_summarize_this_for_me = intl.formatMessage(messages.rovo_prompt_button_summarize_this);
|
|
142
|
+
var html_summarize_this_for_me = intl.formatMessage(messages.rovo_prompt_message_summarize, {
|
|
143
|
+
url: url
|
|
144
|
+
}, {
|
|
145
|
+
ignoreTag: true
|
|
146
|
+
});
|
|
147
|
+
return {
|
|
148
|
+
icon: /*#__PURE__*/React.createElement(AiGenerativeTextSummaryIcon, {
|
|
149
|
+
label: label_summarize_this_for_me
|
|
150
|
+
}),
|
|
151
|
+
content: label_summarize_this_for_me,
|
|
152
|
+
tooltipMessage: label_summarize_this_for_me,
|
|
153
|
+
data: {
|
|
154
|
+
name: label_summarize_this_for_me,
|
|
155
|
+
dialogues: [],
|
|
156
|
+
prompt: htmlToAdf(html_summarize_this_for_me),
|
|
157
|
+
mode: {
|
|
158
|
+
fastModeEnabled: true
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
case RovoChatPromptKey.HIGHLIGHT_RELEVANT_CONTENT:
|
|
163
|
+
var label_highlight_relevant_content = intl.formatMessage(messages.rovo_prompt_button_highlight_relevant_content);
|
|
164
|
+
var html_highlight_relevant_content = intl.formatMessage(messages.rovo_prompt_message_highlight_relevant_content, {
|
|
165
|
+
context: contextLong,
|
|
166
|
+
url: url
|
|
167
|
+
}, {
|
|
168
|
+
ignoreTag: true
|
|
169
|
+
});
|
|
170
|
+
return {
|
|
171
|
+
icon: /*#__PURE__*/React.createElement(AiChapterIcon, null),
|
|
172
|
+
content: label_highlight_relevant_content,
|
|
173
|
+
tooltipMessage: label_highlight_relevant_content,
|
|
174
|
+
data: {
|
|
175
|
+
name: label_highlight_relevant_content,
|
|
176
|
+
dialogues: [],
|
|
177
|
+
prompt: htmlToAdf(html_highlight_relevant_content),
|
|
178
|
+
mode: {
|
|
179
|
+
fastModeEnabled: true
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
case RovoChatPromptKey.ASK_ROVO_ANYTHING:
|
|
184
|
+
var label_ask_rovo_anything = intl.formatMessage(messages.rovo_prompt_button_ask_rovo_anything);
|
|
185
|
+
var prompt_ask_rovo_anything = intl.formatMessage(messages.rovo_prompt_message_ask_rovo_anything, {
|
|
186
|
+
url: url
|
|
187
|
+
});
|
|
188
|
+
return {
|
|
189
|
+
icon: cardAppearance === CardDisplay.Block && isBlockCard3PExperimentEnabled ? /*#__PURE__*/React.createElement(RovoIcon, {
|
|
190
|
+
label: label_ask_rovo_anything,
|
|
191
|
+
size: 'xxsmall',
|
|
192
|
+
shouldUseHexLogo: true
|
|
193
|
+
}) : /*#__PURE__*/React.createElement(AISearchIcon, null),
|
|
194
|
+
content: label_ask_rovo_anything,
|
|
195
|
+
tooltipMessage: label_ask_rovo_anything,
|
|
196
|
+
data: {
|
|
197
|
+
name: label_ask_rovo_anything,
|
|
198
|
+
dialogues: [],
|
|
199
|
+
prompt: prompt_ask_rovo_anything,
|
|
200
|
+
isPromptPlaceholder: true,
|
|
201
|
+
placeholderType: 'generic'
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
case RovoChatPromptKey.ASK_A_SPECIFIC_QUESTION:
|
|
205
|
+
var label_ask_a_specific_question = intl.formatMessage(messages.rovo_prompt_button_ask_a_specific_question);
|
|
206
|
+
var prompt_ask_a_specific_question = intl.formatMessage(messages.rovo_prompt_message_ask_rovo_anything, {
|
|
207
|
+
url: url
|
|
208
|
+
});
|
|
209
|
+
return {
|
|
210
|
+
icon: /*#__PURE__*/React.createElement(RovoChatIcon, {
|
|
211
|
+
label: label_ask_a_specific_question
|
|
212
|
+
}),
|
|
213
|
+
content: label_ask_a_specific_question,
|
|
214
|
+
tooltipMessage: label_ask_a_specific_question,
|
|
215
|
+
data: {
|
|
216
|
+
name: label_ask_a_specific_question,
|
|
217
|
+
dialogues: [],
|
|
218
|
+
prompt: prompt_ask_a_specific_question,
|
|
219
|
+
isPromptPlaceholder: true,
|
|
220
|
+
placeholderType: 'generic'
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
case RovoChatPromptKey.KEY_HIGHLIGHTS:
|
|
224
|
+
var label_key_highlights = intl.formatMessage(messages.rovo_prompt_button_key_highlights);
|
|
225
|
+
var html_key_highlights = intl.formatMessage(messages.rovo_prompt_message_key_highlights, {
|
|
226
|
+
context: contextLong,
|
|
227
|
+
url: url
|
|
228
|
+
}, {
|
|
229
|
+
ignoreTag: true
|
|
230
|
+
});
|
|
231
|
+
return {
|
|
232
|
+
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
233
|
+
label: label_key_highlights,
|
|
234
|
+
size: iconSize
|
|
235
|
+
}),
|
|
236
|
+
content: label_key_highlights,
|
|
237
|
+
tooltipMessage: label_key_highlights,
|
|
238
|
+
data: {
|
|
239
|
+
name: label_key_highlights,
|
|
240
|
+
dialogues: [],
|
|
241
|
+
prompt: htmlToAdf(html_key_highlights)
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
case RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT:
|
|
245
|
+
var label_show_me_whats_relevant = intl.formatMessage(messages.rovo_prompt_button_show_me_whats_relevant);
|
|
246
|
+
var html_show_me_whats_relevant = intl.formatMessage(messages.rovo_prompt_message_highlight_relevant_content, {
|
|
247
|
+
context: contextLong,
|
|
248
|
+
url: url
|
|
249
|
+
}, {
|
|
250
|
+
ignoreTag: true
|
|
251
|
+
});
|
|
252
|
+
return {
|
|
253
|
+
icon: /*#__PURE__*/React.createElement(AiSearchIcon, {
|
|
254
|
+
label: label_show_me_whats_relevant
|
|
255
|
+
}),
|
|
256
|
+
content: label_show_me_whats_relevant,
|
|
257
|
+
tooltipMessage: label_show_me_whats_relevant,
|
|
258
|
+
data: {
|
|
259
|
+
name: label_show_me_whats_relevant,
|
|
260
|
+
dialogues: [],
|
|
261
|
+
prompt: htmlToAdf(html_show_me_whats_relevant)
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
case RovoChatPromptKey.IDENTIFY_KEY_TRENDS:
|
|
265
|
+
var label_identify_key_trends = intl.formatMessage(messages.rovo_prompt_button_identify_key_trends);
|
|
266
|
+
var html_identify_key_trends = intl.formatMessage(messages.rovo_prompt_message_identify_key_trends, {
|
|
267
|
+
url: url
|
|
268
|
+
}, {
|
|
269
|
+
ignoreTag: true
|
|
270
|
+
});
|
|
271
|
+
return {
|
|
272
|
+
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
273
|
+
label: label_identify_key_trends,
|
|
274
|
+
size: iconSize
|
|
275
|
+
}),
|
|
276
|
+
content: label_identify_key_trends,
|
|
277
|
+
tooltipMessage: label_identify_key_trends,
|
|
278
|
+
data: {
|
|
279
|
+
name: label_identify_key_trends,
|
|
280
|
+
dialogues: [],
|
|
281
|
+
prompt: htmlToAdf(html_identify_key_trends)
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
case RovoChatPromptKey.IDENTIFY_KEY_POINTS:
|
|
285
|
+
var label_identify_key_points = intl.formatMessage(messages.rovo_prompt_button_identify_key_points);
|
|
286
|
+
var html_identify_key_points = intl.formatMessage(messages.rovo_prompt_message_identify_key_points, {
|
|
287
|
+
url: url
|
|
288
|
+
}, {
|
|
289
|
+
ignoreTag: true
|
|
290
|
+
});
|
|
291
|
+
return {
|
|
292
|
+
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
293
|
+
label: label_identify_key_points,
|
|
294
|
+
size: iconSize
|
|
295
|
+
}),
|
|
296
|
+
content: label_identify_key_points,
|
|
297
|
+
tooltipMessage: label_identify_key_points,
|
|
298
|
+
data: {
|
|
299
|
+
name: label_identify_key_points,
|
|
300
|
+
dialogues: [],
|
|
301
|
+
prompt: htmlToAdf(html_identify_key_points)
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
case RovoChatPromptKey.FIND_OPEN_QUESTIONS:
|
|
305
|
+
var label_find_open_questions = intl.formatMessage(messages.rovo_prompt_button_find_open_questions);
|
|
306
|
+
var html_find_open_questions = intl.formatMessage(messages.rovo_prompt_message_find_open_questions, {
|
|
307
|
+
url: url
|
|
308
|
+
}, {
|
|
309
|
+
ignoreTag: true
|
|
310
|
+
});
|
|
311
|
+
return {
|
|
312
|
+
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
313
|
+
label: label_find_open_questions,
|
|
314
|
+
size: iconSize
|
|
315
|
+
}),
|
|
316
|
+
content: label_find_open_questions,
|
|
317
|
+
tooltipMessage: label_find_open_questions,
|
|
318
|
+
data: {
|
|
319
|
+
name: label_find_open_questions,
|
|
320
|
+
dialogues: [],
|
|
321
|
+
prompt: htmlToAdf(html_find_open_questions)
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CardActionOptions } from '../../../view/Card/types';
|
|
2
|
+
export interface InlineTailoredActionExperiment {
|
|
3
|
+
/**
|
|
4
|
+
* True when the user is in the treatment cohort and should see the
|
|
5
|
+
* inline action button UI. All treatment surfaces should gate on this.
|
|
6
|
+
*/
|
|
7
|
+
isEnabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns whether the platform_sl_3p_auth_inline_tailored_cta experiment
|
|
11
|
+
* is enabled for the current user and link context.
|
|
12
|
+
*
|
|
13
|
+
* All eligibility criteria are consolidated here:
|
|
14
|
+
* 1. Rovo chat must be enabled for the tenant.
|
|
15
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
16
|
+
* 3. The link must support the RovoActions feature.
|
|
17
|
+
* 4. The extension key must be one of the supported options.
|
|
18
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
19
|
+
*
|
|
20
|
+
* The extension key is derived from the card store via the resolved URL,
|
|
21
|
+
* so callers don't need to thread it as a prop.
|
|
22
|
+
*/
|
|
23
|
+
declare const useInlineTailoredActionExperiment: (url?: string, showHoverPreview?: boolean, actionOptions?: CardActionOptions) => InlineTailoredActionExperiment;
|
|
24
|
+
export default useInlineTailoredActionExperiment;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { RovoChatPromptKey } from "../../../../common/rovo-chat-utils";
|
|
2
3
|
import { type LinkActionProps } from '../types';
|
|
3
|
-
export declare enum RovoChatPromptKey {
|
|
4
|
-
RECOMMEND_OTHER_SOURCES = "recommend-other-sources",
|
|
5
|
-
SHOW_OTHER_MENTIONS = "show-other-mentions",
|
|
6
|
-
SUGGEST_IMPROVEMENT = "suggest-improvement",
|
|
7
|
-
SUMMARIZE_LINK = "summarize-link",
|
|
8
|
-
KEY_HIGHLIGHTS = "key-highlights",
|
|
9
|
-
ASK_ROVO_ANYTHING = "ask-rovo-anything",
|
|
10
|
-
IDENTIFY_KEY_POINTS = "identify-key-points",
|
|
11
|
-
IDENTIFY_KEY_TRENDS = "identify-key-trends",
|
|
12
|
-
FIND_OPEN_QUESTIONS = "find-open-questions",
|
|
13
|
-
HIGHLIGHT_RELEVANT_CONTENT = "highlight-relevant-content",
|
|
14
|
-
SUMMARIZE_THIS_FOR_ME = "summarize-this-for-me",
|
|
15
|
-
ASK_A_SPECIFIC_QUESTION = "ask-a-specific-question",
|
|
16
|
-
SHOW_ME_WHATS_RELEVANT = "show-me-whats-relevant"
|
|
17
|
-
}
|
|
18
4
|
type RovoChatActionProps = LinkActionProps & {
|
|
19
5
|
prompts?: RovoChatPromptKey[];
|
|
20
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
1
|
export declare const RovoActionsCta: ({ testId }: {
|
|
6
2
|
testId?: string;
|
|
7
3
|
}) => JSX.Element;
|
|
4
|
+
export declare const InlineRovoActionButton: ({ testId, url }: {
|
|
5
|
+
testId?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
}) => JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type IntlShape } from 'react-intl';
|
|
3
|
+
import type { ProductType } from '@atlaskit/linking-common';
|
|
4
|
+
import { CardDisplay } from "../../../constants";
|
|
5
|
+
import type { SendPromptMessageData } from "../../../state/hooks/use-rovo-chat";
|
|
6
|
+
import type Action from "../../FlexibleCard/components/actions/action";
|
|
7
|
+
import type { ActionProps } from "../../FlexibleCard/components/actions/action/types";
|
|
8
|
+
export declare enum RovoChatPromptKey {
|
|
9
|
+
RECOMMEND_OTHER_SOURCES = "recommend-other-sources",
|
|
10
|
+
SHOW_OTHER_MENTIONS = "show-other-mentions",
|
|
11
|
+
SUGGEST_IMPROVEMENT = "suggest-improvement",
|
|
12
|
+
SUMMARIZE_LINK = "summarize-link",
|
|
13
|
+
KEY_HIGHLIGHTS = "key-highlights",
|
|
14
|
+
ASK_ROVO_ANYTHING = "ask-rovo-anything",
|
|
15
|
+
IDENTIFY_KEY_POINTS = "identify-key-points",
|
|
16
|
+
IDENTIFY_KEY_TRENDS = "identify-key-trends",
|
|
17
|
+
FIND_OPEN_QUESTIONS = "find-open-questions",
|
|
18
|
+
HIGHLIGHT_RELEVANT_CONTENT = "highlight-relevant-content",
|
|
19
|
+
SUMMARIZE_THIS_FOR_ME = "summarize-this-for-me",
|
|
20
|
+
ASK_A_SPECIFIC_QUESTION = "ask-a-specific-question",
|
|
21
|
+
SHOW_ME_WHATS_RELEVANT = "show-me-whats-relevant"
|
|
22
|
+
}
|
|
23
|
+
export declare const getPromptAction: (promptKey: RovoChatPromptKey, intl: IntlShape, url?: string, product?: ProductType, iconSize?: ActionProps["iconSize"], cardAppearance?: CardDisplay) => (Pick<React.ComponentProps<typeof Action>, "content" | "icon" | "tooltipMessage"> & {
|
|
24
|
+
data: SendPromptMessageData;
|
|
25
|
+
}) | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CardActionOptions } from '../../../view/Card/types';
|
|
2
|
+
export interface InlineTailoredActionExperiment {
|
|
3
|
+
/**
|
|
4
|
+
* True when the user is in the treatment cohort and should see the
|
|
5
|
+
* inline action button UI. All treatment surfaces should gate on this.
|
|
6
|
+
*/
|
|
7
|
+
isEnabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns whether the platform_sl_3p_auth_inline_tailored_cta experiment
|
|
11
|
+
* is enabled for the current user and link context.
|
|
12
|
+
*
|
|
13
|
+
* All eligibility criteria are consolidated here:
|
|
14
|
+
* 1. Rovo chat must be enabled for the tenant.
|
|
15
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
16
|
+
* 3. The link must support the RovoActions feature.
|
|
17
|
+
* 4. The extension key must be one of the supported options.
|
|
18
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
19
|
+
*
|
|
20
|
+
* The extension key is derived from the card store via the resolved URL,
|
|
21
|
+
* so callers don't need to thread it as a prop.
|
|
22
|
+
*/
|
|
23
|
+
declare const useInlineTailoredActionExperiment: (url?: string, showHoverPreview?: boolean, actionOptions?: CardActionOptions) => InlineTailoredActionExperiment;
|
|
24
|
+
export default useInlineTailoredActionExperiment;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { RovoChatPromptKey } from "../../../../common/rovo-chat-utils";
|
|
2
3
|
import { type LinkActionProps } from '../types';
|
|
3
|
-
export declare enum RovoChatPromptKey {
|
|
4
|
-
RECOMMEND_OTHER_SOURCES = "recommend-other-sources",
|
|
5
|
-
SHOW_OTHER_MENTIONS = "show-other-mentions",
|
|
6
|
-
SUGGEST_IMPROVEMENT = "suggest-improvement",
|
|
7
|
-
SUMMARIZE_LINK = "summarize-link",
|
|
8
|
-
KEY_HIGHLIGHTS = "key-highlights",
|
|
9
|
-
ASK_ROVO_ANYTHING = "ask-rovo-anything",
|
|
10
|
-
IDENTIFY_KEY_POINTS = "identify-key-points",
|
|
11
|
-
IDENTIFY_KEY_TRENDS = "identify-key-trends",
|
|
12
|
-
FIND_OPEN_QUESTIONS = "find-open-questions",
|
|
13
|
-
HIGHLIGHT_RELEVANT_CONTENT = "highlight-relevant-content",
|
|
14
|
-
SUMMARIZE_THIS_FOR_ME = "summarize-this-for-me",
|
|
15
|
-
ASK_A_SPECIFIC_QUESTION = "ask-a-specific-question",
|
|
16
|
-
SHOW_ME_WHATS_RELEVANT = "show-me-whats-relevant"
|
|
17
|
-
}
|
|
18
4
|
type RovoChatActionProps = LinkActionProps & {
|
|
19
5
|
prompts?: RovoChatPromptKey[];
|
|
20
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
1
|
export declare const RovoActionsCta: ({ testId }: {
|
|
6
2
|
testId?: string;
|
|
7
3
|
}) => JSX.Element;
|
|
4
|
+
export declare const InlineRovoActionButton: ({ testId, url }: {
|
|
5
|
+
testId?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
}) => JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type IntlShape } from 'react-intl';
|
|
3
|
+
import type { ProductType } from '@atlaskit/linking-common';
|
|
4
|
+
import { CardDisplay } from "../../../constants";
|
|
5
|
+
import type { SendPromptMessageData } from "../../../state/hooks/use-rovo-chat";
|
|
6
|
+
import type Action from "../../FlexibleCard/components/actions/action";
|
|
7
|
+
import type { ActionProps } from "../../FlexibleCard/components/actions/action/types";
|
|
8
|
+
export declare enum RovoChatPromptKey {
|
|
9
|
+
RECOMMEND_OTHER_SOURCES = "recommend-other-sources",
|
|
10
|
+
SHOW_OTHER_MENTIONS = "show-other-mentions",
|
|
11
|
+
SUGGEST_IMPROVEMENT = "suggest-improvement",
|
|
12
|
+
SUMMARIZE_LINK = "summarize-link",
|
|
13
|
+
KEY_HIGHLIGHTS = "key-highlights",
|
|
14
|
+
ASK_ROVO_ANYTHING = "ask-rovo-anything",
|
|
15
|
+
IDENTIFY_KEY_POINTS = "identify-key-points",
|
|
16
|
+
IDENTIFY_KEY_TRENDS = "identify-key-trends",
|
|
17
|
+
FIND_OPEN_QUESTIONS = "find-open-questions",
|
|
18
|
+
HIGHLIGHT_RELEVANT_CONTENT = "highlight-relevant-content",
|
|
19
|
+
SUMMARIZE_THIS_FOR_ME = "summarize-this-for-me",
|
|
20
|
+
ASK_A_SPECIFIC_QUESTION = "ask-a-specific-question",
|
|
21
|
+
SHOW_ME_WHATS_RELEVANT = "show-me-whats-relevant"
|
|
22
|
+
}
|
|
23
|
+
export declare const getPromptAction: (promptKey: RovoChatPromptKey, intl: IntlShape, url?: string, product?: ProductType, iconSize?: ActionProps["iconSize"], cardAppearance?: CardDisplay) => (Pick<React.ComponentProps<typeof Action>, "content" | "icon" | "tooltipMessage"> & {
|
|
24
|
+
data: SendPromptMessageData;
|
|
25
|
+
}) | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "44.
|
|
3
|
+
"version": "44.22.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@atlaskit/textfield": "^8.3.0",
|
|
88
88
|
"@atlaskit/theme": "^25.0.0",
|
|
89
89
|
"@atlaskit/tile": "^1.1.0",
|
|
90
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
90
|
+
"@atlaskit/tmp-editor-statsig": "^89.0.0",
|
|
91
91
|
"@atlaskit/tokens": "^13.1.0",
|
|
92
92
|
"@atlaskit/tooltip": "^22.6.0",
|
|
93
93
|
"@atlaskit/ufo": "^0.5.0",
|
|
@@ -282,6 +282,9 @@
|
|
|
282
282
|
},
|
|
283
283
|
"platform_sl_3p_post_auth_chat_open_fg": {
|
|
284
284
|
"type": "boolean"
|
|
285
|
+
},
|
|
286
|
+
"platform_sl_3p_auth_inline_tailored_cta_killswitch": {
|
|
287
|
+
"type": "boolean"
|
|
285
288
|
}
|
|
286
289
|
},
|
|
287
290
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|