@atlaskit/rovo-agent-components 8.10.5 → 8.11.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 +17 -0
- package/agent-conversation-starters/package.json +10 -0
- package/conversation-starters/package.json +10 -0
- package/dist/cjs/index.js +8 -6
- package/dist/cjs/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +73 -0
- package/dist/cjs/ui/agent-avatar/generated-avatars/index.js +15 -0
- package/dist/cjs/ui/agent-conversation-starters/AgentConversationStarters.js +44 -0
- package/dist/cjs/ui/agent-conversation-starters/ConversationStarters.js +78 -0
- package/dist/cjs/ui/agent-conversation-starters/getConversationStarters.js +49 -0
- package/dist/cjs/ui/agent-conversation-starters/index.js +21 -149
- package/dist/cjs/ui/agent-dropdown-menu/AgentDropdownMenu.js +223 -0
- package/dist/cjs/ui/agent-dropdown-menu/ChatToAgentButton.js +46 -0
- package/dist/cjs/ui/agent-dropdown-menu/index.js +14 -249
- package/dist/cjs/ui/agent-verified/agent-verified-icon.js +40 -0
- package/dist/cjs/ui/agent-verified/agent-verified.js +22 -0
- package/dist/cjs/ui/agent-verified/agent-verified.stories.js +6 -6
- package/dist/cjs/ui/agent-verified/index.js +13 -47
- package/dist/es2019/index.js +4 -2
- package/dist/es2019/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +65 -0
- package/dist/es2019/ui/agent-avatar/generated-avatars/index.js +9 -0
- package/dist/es2019/ui/agent-conversation-starters/AgentConversationStarters.js +30 -0
- package/dist/es2019/ui/agent-conversation-starters/ConversationStarters.js +67 -0
- package/dist/es2019/ui/agent-conversation-starters/getConversationStarters.js +42 -0
- package/dist/es2019/ui/agent-conversation-starters/index.js +20 -136
- package/dist/es2019/ui/agent-dropdown-menu/AgentDropdownMenu.js +160 -0
- package/dist/es2019/ui/agent-dropdown-menu/ChatToAgentButton.js +39 -0
- package/dist/es2019/ui/agent-dropdown-menu/index.js +14 -192
- package/dist/es2019/ui/agent-verified/agent-verified-icon.js +34 -0
- package/dist/es2019/ui/agent-verified/agent-verified.js +16 -0
- package/dist/es2019/ui/agent-verified/agent-verified.stories.js +2 -2
- package/dist/es2019/ui/agent-verified/index.js +11 -48
- package/dist/esm/index.js +4 -2
- package/dist/esm/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +66 -0
- package/dist/esm/ui/agent-avatar/generated-avatars/index.js +13 -0
- package/dist/esm/ui/agent-conversation-starters/AgentConversationStarters.js +35 -0
- package/dist/esm/ui/agent-conversation-starters/ConversationStarters.js +71 -0
- package/dist/esm/ui/agent-conversation-starters/getConversationStarters.js +42 -0
- package/dist/esm/ui/agent-conversation-starters/index.js +20 -145
- package/dist/esm/ui/agent-dropdown-menu/AgentDropdownMenu.js +214 -0
- package/dist/esm/ui/agent-dropdown-menu/ChatToAgentButton.js +37 -0
- package/dist/esm/ui/agent-dropdown-menu/index.js +14 -244
- package/dist/esm/ui/agent-verified/agent-verified-icon.js +33 -0
- package/dist/esm/ui/agent-verified/agent-verified.js +15 -0
- package/dist/esm/ui/agent-verified/agent-verified.stories.js +2 -2
- package/dist/esm/ui/agent-verified/index.js +11 -46
- package/dist/types/index.d.ts +7 -2
- package/dist/types/ui/agent-avatar/generated-avatars/assets/content-reviewer.d.ts +8 -0
- package/dist/types/ui/agent-conversation-starters/AgentConversationStarters.d.ts +8 -0
- package/dist/types/ui/agent-conversation-starters/ConversationStarters.d.ts +11 -0
- package/dist/types/ui/agent-conversation-starters/getConversationStarters.d.ts +14 -0
- package/dist/types/ui/agent-conversation-starters/index.d.ts +14 -27
- package/dist/types/ui/agent-dropdown-menu/AgentDropdownMenu.d.ts +57 -0
- package/dist/types/ui/agent-dropdown-menu/ChatToAgentButton.d.ts +10 -0
- package/dist/types/ui/agent-dropdown-menu/index.d.ts +8 -58
- package/dist/types/ui/agent-verified/agent-verified-icon.d.ts +3 -0
- package/dist/types/ui/agent-verified/agent-verified.d.ts +13 -0
- package/dist/types/ui/agent-verified/index.d.ts +10 -14
- package/get-conversation-starters/package.json +10 -0
- package/package.json +2 -2
- package/ui/agent-dropdown-menu/agent-dropdown-menu/package.json +10 -0
- package/ui/agent-dropdown-menu/chat-to-agent-button/package.json +10 -0
- package/ui/agent-verified/agent-verified/package.json +10 -0
- package/ui/agent-verified/agent-verified-icon/package.json +10 -0
- /package/dist/cjs/ui/agent-conversation-starters/{index.compiled.css → ConversationStarters.compiled.css} +0 -0
- /package/dist/cjs/ui/agent-dropdown-menu/{index.compiled.css → ChatToAgentButton.compiled.css} +0 -0
- /package/dist/cjs/ui/agent-verified/{index.compiled.css → agent-verified-icon.compiled.css} +0 -0
- /package/dist/es2019/ui/agent-conversation-starters/{index.compiled.css → ConversationStarters.compiled.css} +0 -0
- /package/dist/es2019/ui/agent-dropdown-menu/{index.compiled.css → ChatToAgentButton.compiled.css} +0 -0
- /package/dist/es2019/ui/agent-verified/{index.compiled.css → agent-verified-icon.compiled.css} +0 -0
- /package/dist/esm/ui/agent-conversation-starters/{index.compiled.css → ConversationStarters.compiled.css} +0 -0
- /package/dist/esm/ui/agent-dropdown-menu/{index.compiled.css → ChatToAgentButton.compiled.css} +0 -0
- /package/dist/esm/ui/agent-verified/{index.compiled.css → agent-verified-icon.compiled.css} +0 -0
|
@@ -146,6 +146,9 @@ var JiraWorkAgentAvatar = /*#__PURE__*/lazy(function () {
|
|
|
146
146
|
var JiraTaskPlannerAgentAvatar = /*#__PURE__*/lazy(function () {
|
|
147
147
|
return import( /* webpackChunkName: "@atlaskit-rovo-avatar-JiraTaskPlannerAgentAvatar"*/'./assets/jira-task-planner-agent');
|
|
148
148
|
});
|
|
149
|
+
var ContentReviewerAvatar = /*#__PURE__*/lazy(function () {
|
|
150
|
+
return import( /* webpackChunkName: "@atlaskit-rovo-avatar-ContentReviewerAvatar"*/'./assets/content-reviewer');
|
|
151
|
+
});
|
|
149
152
|
var JiraCodingAgentAvatar = /*#__PURE__*/lazy(function () {
|
|
150
153
|
return import( /* webpackChunkName: "@atlaskit-rovo-avatar-JiraCodingAgentAvatar"*/'./assets/jira-coding-agent');
|
|
151
154
|
});
|
|
@@ -307,6 +310,16 @@ var outOfTheBoxAgentAvatar = {
|
|
|
307
310
|
},
|
|
308
311
|
color: blueColor
|
|
309
312
|
},
|
|
313
|
+
content_reviewer_agent: {
|
|
314
|
+
getRender: function getRender(size) {
|
|
315
|
+
return /*#__PURE__*/React.createElement(ContentReviewerAvatar, {
|
|
316
|
+
size: AVATAR_SIZES[size],
|
|
317
|
+
primaryColor: "",
|
|
318
|
+
secondaryColor: ""
|
|
319
|
+
});
|
|
320
|
+
},
|
|
321
|
+
color: blueColor
|
|
322
|
+
},
|
|
310
323
|
user_manual_writer_agent: {
|
|
311
324
|
getRender: function getRender(size) {
|
|
312
325
|
return /*#__PURE__*/React.createElement(MyUserManualAvatar, {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["userDefinedConversationStarters", "isAgentDefault"];
|
|
4
|
+
import React, { useMemo } from 'react';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
import { ConversationStarters } from './ConversationStarters';
|
|
7
|
+
import { getConversationStarters } from './getConversationStarters';
|
|
8
|
+
export var AgentConversationStarters = function AgentConversationStarters(_ref) {
|
|
9
|
+
var userDefinedConversationStarters = _ref.userDefinedConversationStarters,
|
|
10
|
+
isAgentDefault = _ref.isAgentDefault,
|
|
11
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
var _useIntl = useIntl(),
|
|
13
|
+
formatMessage = _useIntl.formatMessage;
|
|
14
|
+
var _useMemo = useMemo(function () {
|
|
15
|
+
return getConversationStarters({
|
|
16
|
+
userDefinedConversationStarters: userDefinedConversationStarters,
|
|
17
|
+
isAgentDefault: isAgentDefault
|
|
18
|
+
});
|
|
19
|
+
}, [userDefinedConversationStarters, isAgentDefault]),
|
|
20
|
+
combinedConversationStarters = _useMemo.combinedConversationStarters;
|
|
21
|
+
var starters = useMemo(function () {
|
|
22
|
+
return combinedConversationStarters.map(function (starter) {
|
|
23
|
+
return typeof starter.message === 'string' ? {
|
|
24
|
+
message: starter.message,
|
|
25
|
+
type: starter.type
|
|
26
|
+
} : {
|
|
27
|
+
message: formatMessage(starter.message),
|
|
28
|
+
type: starter.type
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}, [combinedConversationStarters, formatMessage]);
|
|
32
|
+
return /*#__PURE__*/React.createElement(ConversationStarters, _extends({
|
|
33
|
+
starters: starters
|
|
34
|
+
}, props));
|
|
35
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* ConversationStarters.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import "./ConversationStarters.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import IconButton from '@atlaskit/button/icon/button';
|
|
6
|
+
import { cx } from '@atlaskit/css';
|
|
7
|
+
import RetryIcon from '@atlaskit/icon/core/retry';
|
|
8
|
+
import { Box, Inline, Pressable, Stack } from '@atlaskit/primitives/compiled';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
|
+
import { AgentChatIcon } from '../../common/ui/agent-chat-icon';
|
|
11
|
+
import { BrowseAgentsPill } from '../../common/ui/chat-pill';
|
|
12
|
+
var styles = {
|
|
13
|
+
conversationStartersList: "_qtt8glyw _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bsb1osq",
|
|
14
|
+
conversationStartersListWithRefreshDesign: "_19pkze3t",
|
|
15
|
+
conversationStaterItem: "_ca0qze3t",
|
|
16
|
+
conversationStarterIcon: "_1o9zidpf",
|
|
17
|
+
conversationStarterText: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c _1o9zkb7n _1ul9idpf",
|
|
18
|
+
button: "_11c8fhey _2rko12b0 _v564k6bl _syazazsu _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7 _k48p1wq8 _1bto1l2s _o5721q9c _1o9zkb7n _1bsb1osq _bfhksm61 _irr31dpa _1ggl5xtf _1di6fcek",
|
|
19
|
+
button_motion: "_11c8fhey _2rko12b0 _v564k6bl _syazazsu _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7 _k48p1wq8 _1bto1l2s _o5721q9c _1o9zkb7n _1bsb1osq _bfhksm61 _irr31dpa _1ggl5xtf _1di6fcek"
|
|
20
|
+
};
|
|
21
|
+
export var ConversationStarters = function ConversationStarters(_ref) {
|
|
22
|
+
var starters = _ref.starters,
|
|
23
|
+
onConversationStarterClick = _ref.onConversationStarterClick,
|
|
24
|
+
_ref$showReloadButton = _ref.showReloadButton,
|
|
25
|
+
showReloadButton = _ref$showReloadButton === void 0 ? false : _ref$showReloadButton,
|
|
26
|
+
_ref$onReloadButtonCl = _ref.onReloadButtonClick,
|
|
27
|
+
onReloadButtonClick = _ref$onReloadButtonCl === void 0 ? function () {} : _ref$onReloadButtonCl,
|
|
28
|
+
onBrowseAgentsClick = _ref.onBrowseAgentsClick,
|
|
29
|
+
_ref$refreshDesignEna = _ref.refreshDesignEnabled,
|
|
30
|
+
refreshDesignEnabled = _ref$refreshDesignEna === void 0 ? false : _ref$refreshDesignEna;
|
|
31
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
32
|
+
as: "ul",
|
|
33
|
+
space: "space.050",
|
|
34
|
+
xcss: cx(styles.conversationStartersList, refreshDesignEnabled && styles.conversationStartersListWithRefreshDesign)
|
|
35
|
+
}, starters.map(function (starter, index) {
|
|
36
|
+
var isLastStarter = index === starters.length - 1;
|
|
37
|
+
var chatPill = /*#__PURE__*/React.createElement(Box, {
|
|
38
|
+
as: "li",
|
|
39
|
+
key: starter.message,
|
|
40
|
+
xcss: refreshDesignEnabled && styles.conversationStaterItem
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
42
|
+
xcss: fg('platform-dst-motion-uplift-custom-button') ? styles.button_motion : styles.button,
|
|
43
|
+
onClick: function onClick() {
|
|
44
|
+
return onConversationStarterClick(starter);
|
|
45
|
+
},
|
|
46
|
+
testId: "conversation-starter"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
48
|
+
space: "space.150",
|
|
49
|
+
alignBlock: "center"
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
51
|
+
xcss: styles.conversationStarterIcon
|
|
52
|
+
}, /*#__PURE__*/React.createElement(AgentChatIcon, null)), /*#__PURE__*/React.createElement(Box, {
|
|
53
|
+
xcss: styles.conversationStarterText
|
|
54
|
+
}, starter.message))));
|
|
55
|
+
return isLastStarter && showReloadButton ? /*#__PURE__*/React.createElement(Inline, {
|
|
56
|
+
space: "space.050",
|
|
57
|
+
grow: "fill",
|
|
58
|
+
alignInline: "end",
|
|
59
|
+
key: starter.message
|
|
60
|
+
}, chatPill, /*#__PURE__*/React.createElement(IconButton, {
|
|
61
|
+
icon: RetryIcon,
|
|
62
|
+
onClick: onReloadButtonClick,
|
|
63
|
+
appearance: "subtle",
|
|
64
|
+
label: ""
|
|
65
|
+
})) : chatPill;
|
|
66
|
+
}), !!onBrowseAgentsClick && /*#__PURE__*/React.createElement(Box, {
|
|
67
|
+
as: "li"
|
|
68
|
+
}, /*#__PURE__*/React.createElement(BrowseAgentsPill, {
|
|
69
|
+
onClick: onBrowseAgentsClick
|
|
70
|
+
})));
|
|
71
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { messages } from './messages';
|
|
3
|
+
export var getConversationStarters = function getConversationStarters(_ref) {
|
|
4
|
+
var userDefinedConversationStartersParam = _ref.userDefinedConversationStarters,
|
|
5
|
+
isAgentDefault = _ref.isAgentDefault;
|
|
6
|
+
var type = 'static';
|
|
7
|
+
var customAgentConversationStarters = [{
|
|
8
|
+
message: messages.agentEmptyStateSuggestion1,
|
|
9
|
+
type: type
|
|
10
|
+
}, {
|
|
11
|
+
message: messages.agentEmptyStateSuggestion2,
|
|
12
|
+
type: type
|
|
13
|
+
}, {
|
|
14
|
+
message: messages.agentEmptyStateSuggestion3,
|
|
15
|
+
type: type
|
|
16
|
+
}];
|
|
17
|
+
var userDefinedConversationStarters = userDefinedConversationStartersParam !== null && userDefinedConversationStartersParam !== void 0 ? userDefinedConversationStartersParam : [];
|
|
18
|
+
var defaultAgentConversationStarters = [{
|
|
19
|
+
message: messages.emptyStateSuggestion1,
|
|
20
|
+
type: type
|
|
21
|
+
}, {
|
|
22
|
+
message: messages.emptyStateSuggestion2,
|
|
23
|
+
type: type
|
|
24
|
+
}, {
|
|
25
|
+
message: messages.emptyStateSuggestion3,
|
|
26
|
+
type: type
|
|
27
|
+
}];
|
|
28
|
+
var getCombinedConversationStarters = function getCombinedConversationStarters() {
|
|
29
|
+
var shouldCombine = !isAgentDefault;
|
|
30
|
+
if (shouldCombine) {
|
|
31
|
+
// Return user defined suggestions + static fallback suggestions with a max of 3 suggestions (user defined taking precendence over fallback)
|
|
32
|
+
return [].concat(_toConsumableArray(userDefinedConversationStarters), customAgentConversationStarters).slice(0, 3);
|
|
33
|
+
}
|
|
34
|
+
return defaultAgentConversationStarters;
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
userDefinedConversationStarters: userDefinedConversationStarters,
|
|
38
|
+
customAgentConversationStarters: customAgentConversationStarters,
|
|
39
|
+
defaultAgentConversationStarters: defaultAgentConversationStarters,
|
|
40
|
+
combinedConversationStarters: getCombinedConversationStarters()
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -1,145 +1,20 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
conversationStaterItem: "_ca0qze3t",
|
|
22
|
-
conversationStarterIcon: "_1o9zidpf",
|
|
23
|
-
conversationStarterText: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c _1o9zkb7n _1ul9idpf",
|
|
24
|
-
button: "_11c8fhey _2rko12b0 _v564k6bl _syazazsu _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7 _k48p1wq8 _1bto1l2s _o5721q9c _1o9zkb7n _1bsb1osq _bfhksm61 _irr31dpa _1ggl5xtf _1di6fcek",
|
|
25
|
-
button_motion: "_11c8fhey _2rko12b0 _v564k6bl _syazazsu _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7 _k48p1wq8 _1bto1l2s _o5721q9c _1o9zkb7n _1bsb1osq _bfhksm61 _irr31dpa _1ggl5xtf _1di6fcek"
|
|
26
|
-
};
|
|
27
|
-
export var getConversationStarters = function getConversationStarters(_ref) {
|
|
28
|
-
var userDefinedConversationStartersParam = _ref.userDefinedConversationStarters,
|
|
29
|
-
isAgentDefault = _ref.isAgentDefault;
|
|
30
|
-
var type = 'static';
|
|
31
|
-
var customAgentConversationStarters = [{
|
|
32
|
-
message: messages.agentEmptyStateSuggestion1,
|
|
33
|
-
type: type
|
|
34
|
-
}, {
|
|
35
|
-
message: messages.agentEmptyStateSuggestion2,
|
|
36
|
-
type: type
|
|
37
|
-
}, {
|
|
38
|
-
message: messages.agentEmptyStateSuggestion3,
|
|
39
|
-
type: type
|
|
40
|
-
}];
|
|
41
|
-
var userDefinedConversationStarters = userDefinedConversationStartersParam !== null && userDefinedConversationStartersParam !== void 0 ? userDefinedConversationStartersParam : [];
|
|
42
|
-
var defaultAgentConversationStarters = [{
|
|
43
|
-
message: messages.emptyStateSuggestion1,
|
|
44
|
-
type: type
|
|
45
|
-
}, {
|
|
46
|
-
message: messages.emptyStateSuggestion2,
|
|
47
|
-
type: type
|
|
48
|
-
}, {
|
|
49
|
-
message: messages.emptyStateSuggestion3,
|
|
50
|
-
type: type
|
|
51
|
-
}];
|
|
52
|
-
var getCombinedConversationStarters = function getCombinedConversationStarters() {
|
|
53
|
-
var shouldCombine = !isAgentDefault;
|
|
54
|
-
if (shouldCombine) {
|
|
55
|
-
// Return user defined suggestions + static fallback suggestions with a max of 3 suggestions (user defined taking precendence over fallback)
|
|
56
|
-
return [].concat(_toConsumableArray(userDefinedConversationStarters), customAgentConversationStarters).slice(0, 3);
|
|
57
|
-
}
|
|
58
|
-
return defaultAgentConversationStarters;
|
|
59
|
-
};
|
|
60
|
-
return {
|
|
61
|
-
userDefinedConversationStarters: userDefinedConversationStarters,
|
|
62
|
-
customAgentConversationStarters: customAgentConversationStarters,
|
|
63
|
-
defaultAgentConversationStarters: defaultAgentConversationStarters,
|
|
64
|
-
combinedConversationStarters: getCombinedConversationStarters()
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export var AgentConversationStarters = function AgentConversationStarters(_ref2) {
|
|
68
|
-
var userDefinedConversationStarters = _ref2.userDefinedConversationStarters,
|
|
69
|
-
isAgentDefault = _ref2.isAgentDefault,
|
|
70
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
71
|
-
var _useIntl = useIntl(),
|
|
72
|
-
formatMessage = _useIntl.formatMessage;
|
|
73
|
-
var _useMemo = useMemo(function () {
|
|
74
|
-
return getConversationStarters({
|
|
75
|
-
userDefinedConversationStarters: userDefinedConversationStarters,
|
|
76
|
-
isAgentDefault: isAgentDefault
|
|
77
|
-
});
|
|
78
|
-
}, [userDefinedConversationStarters, isAgentDefault]),
|
|
79
|
-
combinedConversationStarters = _useMemo.combinedConversationStarters;
|
|
80
|
-
var starters = useMemo(function () {
|
|
81
|
-
return combinedConversationStarters.map(function (starter) {
|
|
82
|
-
return typeof starter.message === 'string' ? {
|
|
83
|
-
message: starter.message,
|
|
84
|
-
type: starter.type
|
|
85
|
-
} : {
|
|
86
|
-
message: formatMessage(starter.message),
|
|
87
|
-
type: starter.type
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
|
-
}, [combinedConversationStarters, formatMessage]);
|
|
91
|
-
return /*#__PURE__*/React.createElement(ConversationStarters, _extends({
|
|
92
|
-
starters: starters
|
|
93
|
-
}, props));
|
|
94
|
-
};
|
|
95
|
-
export var ConversationStarters = function ConversationStarters(_ref3) {
|
|
96
|
-
var starters = _ref3.starters,
|
|
97
|
-
onConversationStarterClick = _ref3.onConversationStarterClick,
|
|
98
|
-
_ref3$showReloadButto = _ref3.showReloadButton,
|
|
99
|
-
showReloadButton = _ref3$showReloadButto === void 0 ? false : _ref3$showReloadButto,
|
|
100
|
-
_ref3$onReloadButtonC = _ref3.onReloadButtonClick,
|
|
101
|
-
onReloadButtonClick = _ref3$onReloadButtonC === void 0 ? function () {} : _ref3$onReloadButtonC,
|
|
102
|
-
onBrowseAgentsClick = _ref3.onBrowseAgentsClick,
|
|
103
|
-
_ref3$refreshDesignEn = _ref3.refreshDesignEnabled,
|
|
104
|
-
refreshDesignEnabled = _ref3$refreshDesignEn === void 0 ? false : _ref3$refreshDesignEn;
|
|
105
|
-
return /*#__PURE__*/React.createElement(Stack, {
|
|
106
|
-
as: "ul",
|
|
107
|
-
space: "space.050",
|
|
108
|
-
xcss: cx(styles.conversationStartersList, refreshDesignEnabled && styles.conversationStartersListWithRefreshDesign)
|
|
109
|
-
}, starters.map(function (starter, index) {
|
|
110
|
-
var isLastStarter = index === starters.length - 1;
|
|
111
|
-
var chatPill = /*#__PURE__*/React.createElement(Box, {
|
|
112
|
-
as: "li",
|
|
113
|
-
key: starter.message,
|
|
114
|
-
xcss: refreshDesignEnabled && styles.conversationStaterItem
|
|
115
|
-
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
116
|
-
xcss: fg('platform-dst-motion-uplift-custom-button') ? styles.button_motion : styles.button,
|
|
117
|
-
onClick: function onClick() {
|
|
118
|
-
return onConversationStarterClick(starter);
|
|
119
|
-
},
|
|
120
|
-
testId: "conversation-starter"
|
|
121
|
-
}, /*#__PURE__*/React.createElement(Inline, {
|
|
122
|
-
space: "space.150",
|
|
123
|
-
alignBlock: "center"
|
|
124
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
125
|
-
xcss: styles.conversationStarterIcon
|
|
126
|
-
}, /*#__PURE__*/React.createElement(AgentChatIcon, null)), /*#__PURE__*/React.createElement(Box, {
|
|
127
|
-
xcss: styles.conversationStarterText
|
|
128
|
-
}, starter.message))));
|
|
129
|
-
return isLastStarter && showReloadButton ? /*#__PURE__*/React.createElement(Inline, {
|
|
130
|
-
space: "space.050",
|
|
131
|
-
grow: "fill",
|
|
132
|
-
alignInline: "end",
|
|
133
|
-
key: starter.message
|
|
134
|
-
}, chatPill, /*#__PURE__*/React.createElement(IconButton, {
|
|
135
|
-
icon: RetryIcon,
|
|
136
|
-
onClick: onReloadButtonClick,
|
|
137
|
-
appearance: "subtle",
|
|
138
|
-
label: ""
|
|
139
|
-
})) : chatPill;
|
|
140
|
-
}), !!onBrowseAgentsClick && /*#__PURE__*/React.createElement(Box, {
|
|
141
|
-
as: "li"
|
|
142
|
-
}, /*#__PURE__*/React.createElement(BrowseAgentsPill, {
|
|
143
|
-
onClick: onBrowseAgentsClick
|
|
144
|
-
})));
|
|
145
|
-
};
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `import { getConversationStarters } from '@atlaskit/rovo-agent-components/get-conversation-starters'` instead.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
7
|
+
export { getConversationStarters } from './getConversationStarters';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `import { AgentConversationStarters } from '@atlaskit/rovo-agent-components/agent-conversation-starters'` instead.
|
|
10
|
+
*/
|
|
11
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
12
|
+
export { AgentConversationStarters } from './AgentConversationStarters';
|
|
13
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `import { ConversationStarters } from '@atlaskit/rovo-agent-components/conversation-starters'` instead.
|
|
17
|
+
*/
|
|
18
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
19
|
+
export { ConversationStarters } from './ConversationStarters';
|
|
20
|
+
// eslint-disable-next-line no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of this deprecated re-export shim.
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/* AgentDropdownMenu.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
|
+
var _excluded = ["triggerRef"];
|
|
7
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
+
import React, { useEffect, useState } from 'react';
|
|
10
|
+
import { useIntl } from 'react-intl';
|
|
11
|
+
import IconButton from '@atlaskit/button/icon/button';
|
|
12
|
+
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
|
|
13
|
+
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
|
|
14
|
+
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
|
|
15
|
+
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
17
|
+
import { Inline } from '@atlaskit/primitives/compiled';
|
|
18
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
19
|
+
import { AgentVerificationDropdownItem } from '../agent-verification-dropdown-item';
|
|
20
|
+
import messages from './messages';
|
|
21
|
+
export var AgentDropdownMenu = function AgentDropdownMenu(_ref) {
|
|
22
|
+
var isAutodevTemplateAgent = _ref.isAutodevTemplateAgent,
|
|
23
|
+
onEditAgent = _ref.onEditAgent,
|
|
24
|
+
onCopyAgent = _ref.onCopyAgent,
|
|
25
|
+
onDuplicateAgent = _ref.onDuplicateAgent,
|
|
26
|
+
onDeleteAgent = _ref.onDeleteAgent,
|
|
27
|
+
onViewAgentFullProfileClick = _ref.onViewAgentFullProfileClick,
|
|
28
|
+
_onOpenChange = _ref.onOpenChange,
|
|
29
|
+
isForgeAgent = _ref.isForgeAgent,
|
|
30
|
+
_ref$showDeleteOption = _ref.showDeleteOption,
|
|
31
|
+
showDeleteOption = _ref$showDeleteOption === void 0 ? true : _ref$showDeleteOption,
|
|
32
|
+
_ref$showViewAgentOpt = _ref.showViewAgentOption,
|
|
33
|
+
showViewAgentOption = _ref$showViewAgentOpt === void 0 ? false : _ref$showViewAgentOpt,
|
|
34
|
+
onViewAgentClick = _ref.onViewAgentClick,
|
|
35
|
+
onDropdownTriggerClick = _ref.onDropdownTriggerClick,
|
|
36
|
+
spacing = _ref.spacing,
|
|
37
|
+
appearance = _ref.appearance,
|
|
38
|
+
dropdownMenuTestId = _ref.dropdownMenuTestId,
|
|
39
|
+
doesAgentHaveIdentityAccountId = _ref.doesAgentHaveIdentityAccountId,
|
|
40
|
+
loadAgentPermissions = _ref.loadAgentPermissions,
|
|
41
|
+
loadPermissionsOnMount = _ref.loadPermissionsOnMount,
|
|
42
|
+
shouldTriggerStopPropagation = _ref.shouldTriggerStopPropagation,
|
|
43
|
+
shouldRenderToParent = _ref.shouldRenderToParent,
|
|
44
|
+
agentName = _ref.agentName,
|
|
45
|
+
agentRef = _ref.agentRef,
|
|
46
|
+
userPermissionsRef = _ref.userPermissionsRef,
|
|
47
|
+
onVerificationSuccess = _ref.onVerificationSuccess,
|
|
48
|
+
customDropdownOptions = _ref.customDropdownOptions;
|
|
49
|
+
var _useState = useState(false),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
isLoading = _useState2[0],
|
|
52
|
+
setIsLoading = _useState2[1];
|
|
53
|
+
var _useState3 = useState(false),
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
isDuplicating = _useState4[0],
|
|
56
|
+
setIsDuplicating = _useState4[1];
|
|
57
|
+
var _useIntl = useIntl(),
|
|
58
|
+
formatMessage = _useIntl.formatMessage;
|
|
59
|
+
var _useState5 = useState(false),
|
|
60
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
61
|
+
hasBeenCopied = _useState6[0],
|
|
62
|
+
setHasBeenCopied = _useState6[1];
|
|
63
|
+
var _useState7 = useState(false),
|
|
64
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
65
|
+
isOpen = _useState8[0],
|
|
66
|
+
setIsOpen = _useState8[1];
|
|
67
|
+
var _useState9 = useState(),
|
|
68
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
69
|
+
permissions = _useState0[0],
|
|
70
|
+
setPermissions = _useState0[1];
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
var fetchData = /*#__PURE__*/function () {
|
|
73
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
74
|
+
var _yield$loadAgentPermi, isCreateEnabled, isEditEnabled, isDeleteEnabled;
|
|
75
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
76
|
+
while (1) switch (_context.prev = _context.next) {
|
|
77
|
+
case 0:
|
|
78
|
+
setIsLoading(true);
|
|
79
|
+
_context.next = 1;
|
|
80
|
+
return loadAgentPermissions();
|
|
81
|
+
case 1:
|
|
82
|
+
_yield$loadAgentPermi = _context.sent;
|
|
83
|
+
isCreateEnabled = _yield$loadAgentPermi.isCreateEnabled;
|
|
84
|
+
isEditEnabled = _yield$loadAgentPermi.isEditEnabled;
|
|
85
|
+
isDeleteEnabled = _yield$loadAgentPermi.isDeleteEnabled;
|
|
86
|
+
setIsLoading(false);
|
|
87
|
+
setPermissions({
|
|
88
|
+
isCreateEnabled: isCreateEnabled,
|
|
89
|
+
isEditEnabled: isEditEnabled,
|
|
90
|
+
isDeleteEnabled: isDeleteEnabled
|
|
91
|
+
});
|
|
92
|
+
case 2:
|
|
93
|
+
case "end":
|
|
94
|
+
return _context.stop();
|
|
95
|
+
}
|
|
96
|
+
}, _callee);
|
|
97
|
+
}));
|
|
98
|
+
return function fetchData() {
|
|
99
|
+
return _ref2.apply(this, arguments);
|
|
100
|
+
};
|
|
101
|
+
}();
|
|
102
|
+
|
|
103
|
+
// Only load once
|
|
104
|
+
if (!permissions && (isOpen || loadPermissionsOnMount)) {
|
|
105
|
+
fetchData();
|
|
106
|
+
}
|
|
107
|
+
}, [isOpen, loadAgentPermissions, loadPermissionsOnMount, permissions]);
|
|
108
|
+
useEffect(function () {
|
|
109
|
+
if (!isOpen) {
|
|
110
|
+
setHasBeenCopied(false);
|
|
111
|
+
}
|
|
112
|
+
}, [isOpen]);
|
|
113
|
+
var renderEditDelete = function renderEditDelete() {
|
|
114
|
+
if (!(permissions !== null && permissions !== void 0 && permissions.isEditEnabled) && !(permissions !== null && permissions !== void 0 && permissions.isDeleteEnabled)) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
return /*#__PURE__*/React.createElement(DropdownItemGroup, {
|
|
118
|
+
hasSeparator: true
|
|
119
|
+
}, permissions.isEditEnabled && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
120
|
+
onClick: onEditAgent
|
|
121
|
+
}, formatMessage(messages.editAgent)), permissions.isDeleteEnabled && showDeleteOption && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
122
|
+
onClick: onDeleteAgent
|
|
123
|
+
}, formatMessage(messages.deleteAgent)));
|
|
124
|
+
};
|
|
125
|
+
var isCreateAgentsEnabled = permissions === null || permissions === void 0 ? void 0 : permissions.isCreateEnabled;
|
|
126
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
127
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
128
|
+
isLoading: isLoading,
|
|
129
|
+
isOpen: isOpen,
|
|
130
|
+
testId: dropdownMenuTestId,
|
|
131
|
+
trigger: function trigger(_ref3) {
|
|
132
|
+
var triggerRef = _ref3.triggerRef,
|
|
133
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
134
|
+
return /*#__PURE__*/React.createElement(IconButton, _extends({}, props, {
|
|
135
|
+
icon: MoreIcon,
|
|
136
|
+
label: agentName ? formatMessage(messages.moreActionsForLabel, {
|
|
137
|
+
agentName: agentName
|
|
138
|
+
}) : formatMessage(messages.moreActionsLabel),
|
|
139
|
+
ref: triggerRef,
|
|
140
|
+
spacing: spacing,
|
|
141
|
+
appearance: appearance,
|
|
142
|
+
onClick: function onClick(e, analyticsEvent) {
|
|
143
|
+
var _props$onClick;
|
|
144
|
+
if (onDropdownTriggerClick) {
|
|
145
|
+
onDropdownTriggerClick(e, analyticsEvent);
|
|
146
|
+
}
|
|
147
|
+
if (shouldTriggerStopPropagation) {
|
|
148
|
+
e.stopPropagation();
|
|
149
|
+
}
|
|
150
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
|
|
151
|
+
}
|
|
152
|
+
}));
|
|
153
|
+
},
|
|
154
|
+
onOpenChange: function onOpenChange(args) {
|
|
155
|
+
setIsOpen(args.isOpen);
|
|
156
|
+
_onOpenChange === null || _onOpenChange === void 0 || _onOpenChange(args);
|
|
157
|
+
if (!args.isOpen) {
|
|
158
|
+
setHasBeenCopied(false);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, customDropdownOptions === null || customDropdownOptions === void 0 ? void 0 : customDropdownOptions.map(function (option) {
|
|
162
|
+
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
163
|
+
key: option.id,
|
|
164
|
+
onClick: option.onClick
|
|
165
|
+
}, option.label);
|
|
166
|
+
}), showViewAgentOption && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
167
|
+
onClick: onViewAgentClick
|
|
168
|
+
}, formatMessage(messages.viewAgent)), doesAgentHaveIdentityAccountId && onViewAgentFullProfileClick && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
169
|
+
onClick: onViewAgentFullProfileClick
|
|
170
|
+
}, formatMessage(messages.viewAgentFullProfile)), !isForgeAgent && isCreateAgentsEnabled && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
171
|
+
onClick: ( /*#__PURE__*/function () {
|
|
172
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(e) {
|
|
173
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
174
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
175
|
+
case 0:
|
|
176
|
+
if (fg('rovo_agent_versioning_enabled')) {
|
|
177
|
+
e.stopPropagation();
|
|
178
|
+
}
|
|
179
|
+
setIsDuplicating(true);
|
|
180
|
+
_context2.prev = 1;
|
|
181
|
+
_context2.next = 2;
|
|
182
|
+
return onDuplicateAgent === null || onDuplicateAgent === void 0 ? void 0 : onDuplicateAgent(e);
|
|
183
|
+
case 2:
|
|
184
|
+
_context2.prev = 2;
|
|
185
|
+
setIsDuplicating(false);
|
|
186
|
+
return _context2.finish(2);
|
|
187
|
+
case 3:
|
|
188
|
+
case "end":
|
|
189
|
+
return _context2.stop();
|
|
190
|
+
}
|
|
191
|
+
}, _callee2, null, [[1,, 2, 3]]);
|
|
192
|
+
}));
|
|
193
|
+
return function (_x) {
|
|
194
|
+
return _ref4.apply(this, arguments);
|
|
195
|
+
};
|
|
196
|
+
}()),
|
|
197
|
+
isDisabled: isDuplicating
|
|
198
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
199
|
+
space: "space.050"
|
|
200
|
+
}, isDuplicating && /*#__PURE__*/React.createElement(Spinner, {
|
|
201
|
+
size: "small"
|
|
202
|
+
}), isAutodevTemplateAgent ? formatMessage(messages.useTemplateButton) : formatMessage(messages.duplicateAgent))), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
203
|
+
onClick: function onClick(e) {
|
|
204
|
+
e.stopPropagation();
|
|
205
|
+
setHasBeenCopied(true);
|
|
206
|
+
onCopyAgent === null || onCopyAgent === void 0 || onCopyAgent(e);
|
|
207
|
+
}
|
|
208
|
+
}, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
|
|
209
|
+
agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
|
|
210
|
+
userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
|
|
211
|
+
onVerificationSuccess: onVerificationSuccess,
|
|
212
|
+
testId: "agent-actions-menu-verification"
|
|
213
|
+
})), renderEditDelete());
|
|
214
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* ChatToAgentButton.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import "./ChatToAgentButton.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
import Button from '@atlaskit/button/default/button';
|
|
7
|
+
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { ChatPillIcon } from '../../common/ui/chat-icon';
|
|
9
|
+
import messages from './messages';
|
|
10
|
+
var styles = {
|
|
11
|
+
chatToAgentButtonContainer: "_1bsb1osq",
|
|
12
|
+
chatToAgentButtonWrapper: "_1e0c1txw _1bah1h6o _k48p1wq8",
|
|
13
|
+
chatPillButtonInline: "_18zrv77o",
|
|
14
|
+
chatPillText: "_1nmz1hna _y3gn1e5h _o5721jtm",
|
|
15
|
+
chatPillIconWrapper: "_1ul9gktf _4t3igktf"
|
|
16
|
+
};
|
|
17
|
+
export var ChatToAgentButton = function ChatToAgentButton(_ref) {
|
|
18
|
+
var onClick = _ref.onClick;
|
|
19
|
+
var _useIntl = useIntl(),
|
|
20
|
+
formatMessage = _useIntl.formatMessage;
|
|
21
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
22
|
+
xcss: styles.chatToAgentButtonContainer
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
testId: "view-agent-modal-chat-to-agent-button",
|
|
25
|
+
shouldFitContainer: true,
|
|
26
|
+
onClick: onClick
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
xcss: styles.chatToAgentButtonWrapper
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
30
|
+
space: "space.050",
|
|
31
|
+
xcss: styles.chatPillButtonInline
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
33
|
+
xcss: styles.chatPillIconWrapper
|
|
34
|
+
}, /*#__PURE__*/React.createElement(ChatPillIcon, null)), /*#__PURE__*/React.createElement(Box, {
|
|
35
|
+
xcss: styles.chatPillText
|
|
36
|
+
}, formatMessage(messages.chatToAgentButton))))));
|
|
37
|
+
};
|