@atlaskit/rovo-agent-components 8.10.6 → 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 +11 -0
- package/agent-conversation-starters/package.json +10 -0
- package/conversation-starters/package.json +10 -0
- package/dist/cjs/common/ui/agent-chat-icon/index.js +1 -1
- package/dist/cjs/common/ui/chat-pill/index.js +1 -1
- package/dist/cjs/common/ui/link-icon-button/index.js +1 -1
- package/dist/cjs/common/ui/star-icon-button/index.js +1 -1
- package/dist/cjs/index.js +8 -6
- package/dist/cjs/ui/agent-avatar/agent-avatar-skeleton/index.js +1 -1
- package/dist/cjs/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +73 -0
- package/dist/cjs/ui/agent-avatar/generated-avatars/index.js +16 -1
- package/dist/cjs/ui/agent-avatar/index.js +1 -1
- 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-menu-item-skeleton/index.js +1 -1
- package/dist/cjs/ui/agent-name-side-nav/index.js +1 -1
- package/dist/cjs/ui/agent-profile-info/agent-star-count/index.js +1 -1
- package/dist/cjs/ui/agent-profile-info/index.js +1 -1
- 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/common/ui/agent-chat-icon/index.js +1 -1
- package/dist/es2019/common/ui/chat-pill/index.js +1 -1
- package/dist/es2019/common/ui/link-icon-button/index.js +1 -1
- package/dist/es2019/common/ui/star-icon-button/index.js +1 -1
- package/dist/es2019/index.js +4 -2
- package/dist/es2019/ui/agent-avatar/agent-avatar-skeleton/index.js +1 -1
- package/dist/es2019/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +65 -0
- package/dist/es2019/ui/agent-avatar/generated-avatars/index.js +10 -1
- package/dist/es2019/ui/agent-avatar/index.js +1 -1
- 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-menu-item-skeleton/index.js +1 -1
- package/dist/es2019/ui/agent-name-side-nav/index.js +1 -1
- package/dist/es2019/ui/agent-profile-info/agent-star-count/index.js +1 -1
- package/dist/es2019/ui/agent-profile-info/index.js +1 -1
- 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/common/ui/agent-chat-icon/index.js +1 -1
- package/dist/esm/common/ui/chat-pill/index.js +1 -1
- package/dist/esm/common/ui/link-icon-button/index.js +1 -1
- package/dist/esm/common/ui/star-icon-button/index.js +1 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/ui/agent-avatar/agent-avatar-skeleton/index.js +1 -1
- package/dist/esm/ui/agent-avatar/generated-avatars/assets/content-reviewer.js +66 -0
- package/dist/esm/ui/agent-avatar/generated-avatars/index.js +14 -1
- package/dist/esm/ui/agent-avatar/index.js +1 -1
- 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-menu-item-skeleton/index.js +1 -1
- package/dist/esm/ui/agent-name-side-nav/index.js +1 -1
- package/dist/esm/ui/agent-profile-info/agent-star-count/index.js +1 -1
- package/dist/esm/ui/agent-profile-info/index.js +1 -1
- 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 +1 -1
- 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
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* AgentDropdownMenu.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
import IconButton from '@atlaskit/button/icon/button';
|
|
7
|
+
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
|
|
8
|
+
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
|
|
9
|
+
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
|
|
10
|
+
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
|
+
import { Inline } from '@atlaskit/primitives/compiled';
|
|
13
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
14
|
+
import { AgentVerificationDropdownItem } from '../agent-verification-dropdown-item';
|
|
15
|
+
import messages from './messages';
|
|
16
|
+
export const AgentDropdownMenu = ({
|
|
17
|
+
isAutodevTemplateAgent,
|
|
18
|
+
onEditAgent,
|
|
19
|
+
onCopyAgent,
|
|
20
|
+
onDuplicateAgent,
|
|
21
|
+
onDeleteAgent,
|
|
22
|
+
onViewAgentFullProfileClick,
|
|
23
|
+
onOpenChange,
|
|
24
|
+
isForgeAgent,
|
|
25
|
+
showDeleteOption = true,
|
|
26
|
+
showViewAgentOption = false,
|
|
27
|
+
onViewAgentClick,
|
|
28
|
+
onDropdownTriggerClick,
|
|
29
|
+
spacing,
|
|
30
|
+
appearance,
|
|
31
|
+
dropdownMenuTestId,
|
|
32
|
+
doesAgentHaveIdentityAccountId,
|
|
33
|
+
loadAgentPermissions,
|
|
34
|
+
loadPermissionsOnMount,
|
|
35
|
+
shouldTriggerStopPropagation,
|
|
36
|
+
shouldRenderToParent,
|
|
37
|
+
agentName,
|
|
38
|
+
agentRef,
|
|
39
|
+
userPermissionsRef,
|
|
40
|
+
onVerificationSuccess,
|
|
41
|
+
customDropdownOptions
|
|
42
|
+
}) => {
|
|
43
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
44
|
+
const [isDuplicating, setIsDuplicating] = useState(false);
|
|
45
|
+
const {
|
|
46
|
+
formatMessage
|
|
47
|
+
} = useIntl();
|
|
48
|
+
const [hasBeenCopied, setHasBeenCopied] = useState(false);
|
|
49
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
50
|
+
const [permissions, setPermissions] = useState();
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const fetchData = async () => {
|
|
53
|
+
setIsLoading(true);
|
|
54
|
+
const {
|
|
55
|
+
isCreateEnabled,
|
|
56
|
+
isEditEnabled,
|
|
57
|
+
isDeleteEnabled
|
|
58
|
+
} = await loadAgentPermissions();
|
|
59
|
+
setIsLoading(false);
|
|
60
|
+
setPermissions({
|
|
61
|
+
isCreateEnabled,
|
|
62
|
+
isEditEnabled,
|
|
63
|
+
isDeleteEnabled
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Only load once
|
|
68
|
+
if (!permissions && (isOpen || loadPermissionsOnMount)) {
|
|
69
|
+
fetchData();
|
|
70
|
+
}
|
|
71
|
+
}, [isOpen, loadAgentPermissions, loadPermissionsOnMount, permissions]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (!isOpen) {
|
|
74
|
+
setHasBeenCopied(false);
|
|
75
|
+
}
|
|
76
|
+
}, [isOpen]);
|
|
77
|
+
const renderEditDelete = () => {
|
|
78
|
+
if (!(permissions !== null && permissions !== void 0 && permissions.isEditEnabled) && !(permissions !== null && permissions !== void 0 && permissions.isDeleteEnabled)) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return /*#__PURE__*/React.createElement(DropdownItemGroup, {
|
|
82
|
+
hasSeparator: true
|
|
83
|
+
}, permissions.isEditEnabled && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
84
|
+
onClick: onEditAgent
|
|
85
|
+
}, formatMessage(messages.editAgent)), permissions.isDeleteEnabled && showDeleteOption && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
86
|
+
onClick: onDeleteAgent
|
|
87
|
+
}, formatMessage(messages.deleteAgent)));
|
|
88
|
+
};
|
|
89
|
+
const isCreateAgentsEnabled = permissions === null || permissions === void 0 ? void 0 : permissions.isCreateEnabled;
|
|
90
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
91
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
92
|
+
isLoading: isLoading,
|
|
93
|
+
isOpen: isOpen,
|
|
94
|
+
testId: dropdownMenuTestId,
|
|
95
|
+
trigger: ({
|
|
96
|
+
triggerRef,
|
|
97
|
+
...props
|
|
98
|
+
}) => /*#__PURE__*/React.createElement(IconButton, _extends({}, props, {
|
|
99
|
+
icon: MoreIcon,
|
|
100
|
+
label: agentName ? formatMessage(messages.moreActionsForLabel, {
|
|
101
|
+
agentName: agentName
|
|
102
|
+
}) : formatMessage(messages.moreActionsLabel),
|
|
103
|
+
ref: triggerRef,
|
|
104
|
+
spacing: spacing,
|
|
105
|
+
appearance: appearance,
|
|
106
|
+
onClick: (e, analyticsEvent) => {
|
|
107
|
+
var _props$onClick;
|
|
108
|
+
if (onDropdownTriggerClick) {
|
|
109
|
+
onDropdownTriggerClick(e, analyticsEvent);
|
|
110
|
+
}
|
|
111
|
+
if (shouldTriggerStopPropagation) {
|
|
112
|
+
e.stopPropagation();
|
|
113
|
+
}
|
|
114
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, e);
|
|
115
|
+
}
|
|
116
|
+
})),
|
|
117
|
+
onOpenChange: args => {
|
|
118
|
+
setIsOpen(args.isOpen);
|
|
119
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(args);
|
|
120
|
+
if (!args.isOpen) {
|
|
121
|
+
setHasBeenCopied(false);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, customDropdownOptions === null || customDropdownOptions === void 0 ? void 0 : customDropdownOptions.map(option => /*#__PURE__*/React.createElement(DropdownItem, {
|
|
125
|
+
key: option.id,
|
|
126
|
+
onClick: option.onClick
|
|
127
|
+
}, option.label)), showViewAgentOption && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
128
|
+
onClick: onViewAgentClick
|
|
129
|
+
}, formatMessage(messages.viewAgent)), doesAgentHaveIdentityAccountId && onViewAgentFullProfileClick && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
130
|
+
onClick: onViewAgentFullProfileClick
|
|
131
|
+
}, formatMessage(messages.viewAgentFullProfile)), !isForgeAgent && isCreateAgentsEnabled && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
132
|
+
onClick: async e => {
|
|
133
|
+
if (fg('rovo_agent_versioning_enabled')) {
|
|
134
|
+
e.stopPropagation();
|
|
135
|
+
}
|
|
136
|
+
setIsDuplicating(true);
|
|
137
|
+
try {
|
|
138
|
+
await (onDuplicateAgent === null || onDuplicateAgent === void 0 ? void 0 : onDuplicateAgent(e));
|
|
139
|
+
} finally {
|
|
140
|
+
setIsDuplicating(false);
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
isDisabled: isDuplicating
|
|
144
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
145
|
+
space: "space.050"
|
|
146
|
+
}, isDuplicating && /*#__PURE__*/React.createElement(Spinner, {
|
|
147
|
+
size: "small"
|
|
148
|
+
}), isAutodevTemplateAgent ? formatMessage(messages.useTemplateButton) : formatMessage(messages.duplicateAgent))), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
149
|
+
onClick: e => {
|
|
150
|
+
e.stopPropagation();
|
|
151
|
+
setHasBeenCopied(true);
|
|
152
|
+
onCopyAgent === null || onCopyAgent === void 0 ? void 0 : onCopyAgent(e);
|
|
153
|
+
}
|
|
154
|
+
}, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
|
|
155
|
+
agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
|
|
156
|
+
userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
|
|
157
|
+
onVerificationSuccess: onVerificationSuccess,
|
|
158
|
+
testId: "agent-actions-menu-verification"
|
|
159
|
+
})), renderEditDelete());
|
|
160
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
const styles = {
|
|
11
|
+
chatToAgentButtonContainer: "_1bsb1osq",
|
|
12
|
+
chatToAgentButtonWrapper: "_1e0c1txw _1bah1h6o _k48p1wq8",
|
|
13
|
+
chatPillButtonInline: "_18zrv77o",
|
|
14
|
+
chatPillText: "_1nmz1hna _y3gn1e5h _o5721jtm",
|
|
15
|
+
chatPillIconWrapper: "_1ul9gktf _4t3igktf"
|
|
16
|
+
};
|
|
17
|
+
export const ChatToAgentButton = ({
|
|
18
|
+
onClick
|
|
19
|
+
}) => {
|
|
20
|
+
const {
|
|
21
|
+
formatMessage
|
|
22
|
+
} = useIntl();
|
|
23
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
24
|
+
xcss: styles.chatToAgentButtonContainer
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
26
|
+
testId: "view-agent-modal-chat-to-agent-button",
|
|
27
|
+
shouldFitContainer: true,
|
|
28
|
+
onClick: onClick
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
30
|
+
xcss: styles.chatToAgentButtonWrapper
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
32
|
+
space: "space.050",
|
|
33
|
+
xcss: styles.chatPillButtonInline
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
35
|
+
xcss: styles.chatPillIconWrapper
|
|
36
|
+
}, /*#__PURE__*/React.createElement(ChatPillIcon, null)), /*#__PURE__*/React.createElement(Box, {
|
|
37
|
+
xcss: styles.chatPillText
|
|
38
|
+
}, formatMessage(messages.chatToAgentButton))))));
|
|
39
|
+
};
|
|
@@ -1,193 +1,15 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import Button from '@atlaskit/button/default/button';
|
|
8
|
-
import IconButton from '@atlaskit/button/icon/button';
|
|
9
|
-
import DropdownMenu from '@atlaskit/dropdown-menu/dropdown-menu';
|
|
10
|
-
import DropdownItem from '@atlaskit/dropdown-menu/dropdown-menu-item';
|
|
11
|
-
import DropdownItemGroup from '@atlaskit/dropdown-menu/dropdown-menu-item-group';
|
|
12
|
-
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
14
|
-
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
15
|
-
import Spinner from '@atlaskit/spinner/spinner';
|
|
16
|
-
import { ChatPillIcon } from '../../common/ui/chat-icon';
|
|
17
|
-
import { AgentVerificationDropdownItem } from '../agent-verification-dropdown-item';
|
|
18
|
-
import messages from './messages';
|
|
19
|
-
const styles = {
|
|
20
|
-
chatToAgentButtonContainer: "_1bsb1osq",
|
|
21
|
-
chatToAgentButtonWrapper: "_1e0c1txw _1bah1h6o _k48p1wq8",
|
|
22
|
-
chatPillButtonInline: "_18zrv77o",
|
|
23
|
-
chatPillText: "_1nmz1hna _y3gn1e5h _o5721jtm",
|
|
24
|
-
chatPillIconWrapper: "_1ul9gktf _4t3igktf"
|
|
25
|
-
};
|
|
26
|
-
export const ChatToAgentButton = ({
|
|
27
|
-
onClick
|
|
28
|
-
}) => {
|
|
29
|
-
const {
|
|
30
|
-
formatMessage
|
|
31
|
-
} = useIntl();
|
|
32
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
33
|
-
xcss: styles.chatToAgentButtonContainer
|
|
34
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
35
|
-
testId: "view-agent-modal-chat-to-agent-button",
|
|
36
|
-
shouldFitContainer: true,
|
|
37
|
-
onClick: onClick
|
|
38
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
39
|
-
xcss: styles.chatToAgentButtonWrapper
|
|
40
|
-
}, /*#__PURE__*/React.createElement(Inline, {
|
|
41
|
-
space: "space.050",
|
|
42
|
-
xcss: styles.chatPillButtonInline
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
44
|
-
xcss: styles.chatPillIconWrapper
|
|
45
|
-
}, /*#__PURE__*/React.createElement(ChatPillIcon, null)), /*#__PURE__*/React.createElement(Box, {
|
|
46
|
-
xcss: styles.chatPillText
|
|
47
|
-
}, formatMessage(messages.chatToAgentButton))))));
|
|
48
|
-
};
|
|
49
|
-
export const AgentDropdownMenu = ({
|
|
50
|
-
isAutodevTemplateAgent,
|
|
51
|
-
onEditAgent,
|
|
52
|
-
onCopyAgent,
|
|
53
|
-
onDuplicateAgent,
|
|
54
|
-
onDeleteAgent,
|
|
55
|
-
onViewAgentFullProfileClick,
|
|
56
|
-
onOpenChange,
|
|
57
|
-
isForgeAgent,
|
|
58
|
-
showDeleteOption = true,
|
|
59
|
-
showViewAgentOption = false,
|
|
60
|
-
onViewAgentClick,
|
|
61
|
-
onDropdownTriggerClick,
|
|
62
|
-
spacing,
|
|
63
|
-
appearance,
|
|
64
|
-
dropdownMenuTestId,
|
|
65
|
-
doesAgentHaveIdentityAccountId,
|
|
66
|
-
loadAgentPermissions,
|
|
67
|
-
loadPermissionsOnMount,
|
|
68
|
-
shouldTriggerStopPropagation,
|
|
69
|
-
shouldRenderToParent,
|
|
70
|
-
agentName,
|
|
71
|
-
agentRef,
|
|
72
|
-
userPermissionsRef,
|
|
73
|
-
onVerificationSuccess,
|
|
74
|
-
customDropdownOptions
|
|
75
|
-
}) => {
|
|
76
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
77
|
-
const [isDuplicating, setIsDuplicating] = useState(false);
|
|
78
|
-
const {
|
|
79
|
-
formatMessage
|
|
80
|
-
} = useIntl();
|
|
81
|
-
const [hasBeenCopied, setHasBeenCopied] = useState(false);
|
|
82
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
83
|
-
const [permissions, setPermissions] = useState();
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
const fetchData = async () => {
|
|
86
|
-
setIsLoading(true);
|
|
87
|
-
const {
|
|
88
|
-
isCreateEnabled,
|
|
89
|
-
isEditEnabled,
|
|
90
|
-
isDeleteEnabled
|
|
91
|
-
} = await loadAgentPermissions();
|
|
92
|
-
setIsLoading(false);
|
|
93
|
-
setPermissions({
|
|
94
|
-
isCreateEnabled,
|
|
95
|
-
isEditEnabled,
|
|
96
|
-
isDeleteEnabled
|
|
97
|
-
});
|
|
98
|
-
};
|
|
1
|
+
/* eslint-disable no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
3
|
+
/**
|
|
4
|
+
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
6
|
+
*/
|
|
99
7
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
}, [isOpen]);
|
|
110
|
-
const renderEditDelete = () => {
|
|
111
|
-
if (!(permissions !== null && permissions !== void 0 && permissions.isEditEnabled) && !(permissions !== null && permissions !== void 0 && permissions.isDeleteEnabled)) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
return /*#__PURE__*/React.createElement(DropdownItemGroup, {
|
|
115
|
-
hasSeparator: true
|
|
116
|
-
}, permissions.isEditEnabled && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
117
|
-
onClick: onEditAgent
|
|
118
|
-
}, formatMessage(messages.editAgent)), permissions.isDeleteEnabled && showDeleteOption && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
119
|
-
onClick: onDeleteAgent
|
|
120
|
-
}, formatMessage(messages.deleteAgent)));
|
|
121
|
-
};
|
|
122
|
-
const isCreateAgentsEnabled = permissions === null || permissions === void 0 ? void 0 : permissions.isCreateEnabled;
|
|
123
|
-
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
124
|
-
shouldRenderToParent: shouldRenderToParent,
|
|
125
|
-
isLoading: isLoading,
|
|
126
|
-
isOpen: isOpen,
|
|
127
|
-
testId: dropdownMenuTestId,
|
|
128
|
-
trigger: ({
|
|
129
|
-
triggerRef,
|
|
130
|
-
...props
|
|
131
|
-
}) => /*#__PURE__*/React.createElement(IconButton, _extends({}, props, {
|
|
132
|
-
icon: MoreIcon,
|
|
133
|
-
label: agentName ? formatMessage(messages.moreActionsForLabel, {
|
|
134
|
-
agentName: agentName
|
|
135
|
-
}) : formatMessage(messages.moreActionsLabel),
|
|
136
|
-
ref: triggerRef,
|
|
137
|
-
spacing: spacing,
|
|
138
|
-
appearance: appearance,
|
|
139
|
-
onClick: (e, analyticsEvent) => {
|
|
140
|
-
var _props$onClick;
|
|
141
|
-
if (onDropdownTriggerClick) {
|
|
142
|
-
onDropdownTriggerClick(e, analyticsEvent);
|
|
143
|
-
}
|
|
144
|
-
if (shouldTriggerStopPropagation) {
|
|
145
|
-
e.stopPropagation();
|
|
146
|
-
}
|
|
147
|
-
(_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, e);
|
|
148
|
-
}
|
|
149
|
-
})),
|
|
150
|
-
onOpenChange: args => {
|
|
151
|
-
setIsOpen(args.isOpen);
|
|
152
|
-
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(args);
|
|
153
|
-
if (!args.isOpen) {
|
|
154
|
-
setHasBeenCopied(false);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, customDropdownOptions === null || customDropdownOptions === void 0 ? void 0 : customDropdownOptions.map(option => /*#__PURE__*/React.createElement(DropdownItem, {
|
|
158
|
-
key: option.id,
|
|
159
|
-
onClick: option.onClick
|
|
160
|
-
}, option.label)), showViewAgentOption && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
161
|
-
onClick: onViewAgentClick
|
|
162
|
-
}, formatMessage(messages.viewAgent)), doesAgentHaveIdentityAccountId && onViewAgentFullProfileClick && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
163
|
-
onClick: onViewAgentFullProfileClick
|
|
164
|
-
}, formatMessage(messages.viewAgentFullProfile)), !isForgeAgent && isCreateAgentsEnabled && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
165
|
-
onClick: async e => {
|
|
166
|
-
if (fg('rovo_agent_versioning_enabled')) {
|
|
167
|
-
e.stopPropagation();
|
|
168
|
-
}
|
|
169
|
-
setIsDuplicating(true);
|
|
170
|
-
try {
|
|
171
|
-
await (onDuplicateAgent === null || onDuplicateAgent === void 0 ? void 0 : onDuplicateAgent(e));
|
|
172
|
-
} finally {
|
|
173
|
-
setIsDuplicating(false);
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
isDisabled: isDuplicating
|
|
177
|
-
}, /*#__PURE__*/React.createElement(Inline, {
|
|
178
|
-
space: "space.050"
|
|
179
|
-
}, isDuplicating && /*#__PURE__*/React.createElement(Spinner, {
|
|
180
|
-
size: "small"
|
|
181
|
-
}), isAutodevTemplateAgent ? formatMessage(messages.useTemplateButton) : formatMessage(messages.duplicateAgent))), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
182
|
-
onClick: e => {
|
|
183
|
-
e.stopPropagation();
|
|
184
|
-
setHasBeenCopied(true);
|
|
185
|
-
onCopyAgent === null || onCopyAgent === void 0 ? void 0 : onCopyAgent(e);
|
|
186
|
-
}
|
|
187
|
-
}, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
|
|
188
|
-
agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
|
|
189
|
-
userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
|
|
190
|
-
onVerificationSuccess: onVerificationSuccess,
|
|
191
|
-
testId: "agent-actions-menu-verification"
|
|
192
|
-
})), renderEditDelete());
|
|
193
|
-
};
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `import { ChatToAgentButton } from '@atlaskit/rovo-agent-components/ui/AgentDropdownMenu'` instead.
|
|
10
|
+
*/
|
|
11
|
+
export { ChatToAgentButton } from './ChatToAgentButton';
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `import { AgentDropdownMenu } from '@atlaskit/rovo-agent-components'` instead.
|
|
14
|
+
*/
|
|
15
|
+
export { AgentDropdownMenu } from './AgentDropdownMenu';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* agent-verified-icon.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import "./agent-verified-icon.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
import { cx } from '@atlaskit/css';
|
|
7
|
+
import VerifiedIcon from '@atlaskit/icon/core/status-verified';
|
|
8
|
+
import { Flex } from '@atlaskit/primitives/compiled';
|
|
9
|
+
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
10
|
+
import messages from './messages';
|
|
11
|
+
const styles = {
|
|
12
|
+
body: "_4t3igktf",
|
|
13
|
+
textLarge: "_4t3i1tcg",
|
|
14
|
+
headingMedium: "_4t3i1tcg",
|
|
15
|
+
headingLarge: "_4t3i1f4h"
|
|
16
|
+
};
|
|
17
|
+
export const AgentVerifiedIcon = ({
|
|
18
|
+
adjacentTextSize = 'body'
|
|
19
|
+
}) => {
|
|
20
|
+
const {
|
|
21
|
+
formatMessage
|
|
22
|
+
} = useIntl();
|
|
23
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
24
|
+
content: formatMessage(messages.verifiedAgentTooltip)
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
xcss: cx(adjacentTextSize === 'body' && styles['body'], adjacentTextSize === 'headingMedium' && styles['headingMedium'], adjacentTextSize === 'headingLarge' && styles['headingLarge'], adjacentTextSize === 'textLarge' && styles['textLarge'])
|
|
29
|
+
}, /*#__PURE__*/React.createElement(VerifiedIcon, {
|
|
30
|
+
color: "var(--ds-icon-accent-blue, #357DE8)",
|
|
31
|
+
label: formatMessage(messages.verifiedIconLabel),
|
|
32
|
+
size: "small"
|
|
33
|
+
})));
|
|
34
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _agentVerified_AtlaskitRovoAgentComponents from "./__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { graphql, useFragment } from 'react-relay';
|
|
4
|
+
import { AgentVerifiedIcon } from './agent-verified-icon';
|
|
5
|
+
export const AgentVerified = ({
|
|
6
|
+
agentRef,
|
|
7
|
+
adjacentTextSize
|
|
8
|
+
}) => {
|
|
9
|
+
const data = useFragment(_agentVerified_AtlaskitRovoAgentComponents, agentRef);
|
|
10
|
+
if (!(data !== null && data !== void 0 && data.isVerified)) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return /*#__PURE__*/React.createElement(AgentVerifiedIcon, {
|
|
14
|
+
adjacentTextSize: adjacentTextSize
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { withDi, withUseIntl } from '@atlassian/agent-studio-test-utils/storybook-decorators';
|
|
2
3
|
import { injectable } from 'react-magnetic-di';
|
|
3
4
|
import { useFragment } from 'react-relay';
|
|
4
|
-
import {
|
|
5
|
-
import { AgentVerified } from './index';
|
|
5
|
+
import { AgentVerified } from './agent-verified';
|
|
6
6
|
const commonDeps = [injectable(useFragment, () => ({
|
|
7
7
|
isVerified: true
|
|
8
8
|
}))];
|
|
@@ -1,48 +1,11 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import messages from './messages';
|
|
13
|
-
export const AgentVerified = ({
|
|
14
|
-
agentRef,
|
|
15
|
-
adjacentTextSize
|
|
16
|
-
}) => {
|
|
17
|
-
const data = useFragment(_agentVerified_AtlaskitRovoAgentComponents, agentRef);
|
|
18
|
-
if (!(data !== null && data !== void 0 && data.isVerified)) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
return /*#__PURE__*/React.createElement(AgentVerifiedIcon, {
|
|
22
|
-
adjacentTextSize: adjacentTextSize
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
const styles = {
|
|
26
|
-
body: "_4t3igktf",
|
|
27
|
-
textLarge: "_4t3i1tcg",
|
|
28
|
-
headingMedium: "_4t3i1tcg",
|
|
29
|
-
headingLarge: "_4t3i1f4h"
|
|
30
|
-
};
|
|
31
|
-
export const AgentVerifiedIcon = ({
|
|
32
|
-
adjacentTextSize = 'body'
|
|
33
|
-
}) => {
|
|
34
|
-
const {
|
|
35
|
-
formatMessage
|
|
36
|
-
} = useIntl();
|
|
37
|
-
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
38
|
-
content: formatMessage(messages.verifiedAgentTooltip)
|
|
39
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
40
|
-
justifyContent: "center",
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
xcss: cx(adjacentTextSize === 'body' && styles['body'], adjacentTextSize === 'headingMedium' && styles['headingMedium'], adjacentTextSize === 'headingLarge' && styles['headingLarge'], adjacentTextSize === 'textLarge' && styles['textLarge'])
|
|
43
|
-
}, /*#__PURE__*/React.createElement(VerifiedIcon, {
|
|
44
|
-
color: "var(--ds-icon-accent-blue, #357DE8)",
|
|
45
|
-
label: formatMessage(messages.verifiedIconLabel),
|
|
46
|
-
size: "small"
|
|
47
|
-
})));
|
|
48
|
-
};
|
|
1
|
+
/* eslint-disable no-barrel-files/no-barrel-files -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `import { AgentVerified } from '@atlaskit/rovo-agent-components/agent-verified'` instead.
|
|
6
|
+
*/
|
|
7
|
+
export { AgentVerified } from './agent-verified';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `import { AgentVerifiedIcon } from '@atlaskit/rovo-agent-components/agent-verified'` instead.
|
|
10
|
+
*/
|
|
11
|
+
export { AgentVerifiedIcon } from './agent-verified-icon';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["children", "whiteSpacePreWrap", "renderIcon"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import "./index.compiled.css";
|
package/dist/esm/index.js
CHANGED
|
@@ -4,13 +4,15 @@ export { AgentProfileInfo, AgentProfileCreator, getAgentCreator } from './ui/age
|
|
|
4
4
|
export { AgentStarCount } from './ui/agent-profile-info/agent-star-count';
|
|
5
5
|
export { StarIconButton } from './common/ui/star-icon-button';
|
|
6
6
|
export { LinkIconButton } from './common/ui/link-icon-button';
|
|
7
|
-
export { AgentConversationStarters
|
|
7
|
+
export { AgentConversationStarters } from './ui/agent-conversation-starters/AgentConversationStarters';
|
|
8
|
+
export { ConversationStarters } from './ui/agent-conversation-starters/ConversationStarters';
|
|
9
|
+
export { getConversationStarters } from './ui/agent-conversation-starters/getConversationStarters';
|
|
8
10
|
export { ChatPill, BrowseAgentsPill } from './common/ui/chat-pill';
|
|
9
11
|
export { ChatPillIcon } from './common/ui/chat-icon';
|
|
10
12
|
export { ShowIcon } from './common/ui/show-icon';
|
|
11
13
|
export { HiddenIcon } from './common/ui/hidden-icon';
|
|
12
14
|
export { AgentAvatar } from './ui/agent-avatar';
|
|
13
15
|
export { AgentBanner, GeneratedAvatar } from './ui/agent-avatar/generated-avatars';
|
|
14
|
-
export { AgentDropdownMenu } from './ui/agent-dropdown-menu';
|
|
16
|
+
export { AgentDropdownMenu } from './ui/agent-dropdown-menu/AgentDropdownMenu';
|
|
15
17
|
export { AgentMenuItemSkeleton } from './ui/agent-menu-item-skeleton';
|
|
16
18
|
export { AgentVerificationDropdownItem } from './ui/agent-verification-dropdown-item';
|