@atlaskit/rovo-agent-components 2.13.1 → 3.0.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 +9 -0
- package/dist/cjs/ui/agent-dropdown-menu/index.js +6 -18
- package/dist/es2019/ui/agent-dropdown-menu/index.js +1 -11
- package/dist/esm/ui/agent-dropdown-menu/index.js +6 -18
- package/dist/types/ui/agent-dropdown-menu/index.d.ts +4 -5
- package/dist/types-ts4.5/ui/agent-dropdown-menu/index.d.ts +4 -5
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/rovo-agent-components
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#193947](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193947)
|
|
8
|
+
[`737237ee5c52f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/737237ee5c52f) -
|
|
9
|
+
Removed unused `isAgentCreatedByUser` prop from agent dropdown actions component. This has been
|
|
10
|
+
replaced by a permissions call via `loadAgentPermissions`.
|
|
11
|
+
|
|
3
12
|
## 2.13.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -54,8 +54,7 @@ var ChatToAgentButton = exports.ChatToAgentButton = function ChatToAgentButton(_
|
|
|
54
54
|
}, formatMessage(_messages.default.chatToAgentButton))))));
|
|
55
55
|
};
|
|
56
56
|
var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
|
|
57
|
-
var
|
|
58
|
-
isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
|
|
57
|
+
var isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
|
|
59
58
|
onEditAgent = _ref2.onEditAgent,
|
|
60
59
|
onCopyAgent = _ref2.onCopyAgent,
|
|
61
60
|
onDuplicateAgent = _ref2.onDuplicateAgent,
|
|
@@ -96,25 +95,14 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
|
|
|
96
95
|
(0, _react.useEffect)(function () {
|
|
97
96
|
var fetchData = /*#__PURE__*/function () {
|
|
98
97
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
99
|
-
var
|
|
98
|
+
var _yield$loadAgentPermi, isEditEnabled, isDeleteEnabled;
|
|
100
99
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
101
100
|
while (1) switch (_context.prev = _context.next) {
|
|
102
101
|
case 0:
|
|
103
|
-
if (loadAgentPermissions) {
|
|
104
|
-
_context.next = 4;
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
canEditDelete = isAgentCreatedByUser && !isForgeAgent;
|
|
108
|
-
setPermissions({
|
|
109
|
-
isEditEnabled: canEditDelete,
|
|
110
|
-
isDeleteEnabled: canEditDelete
|
|
111
|
-
});
|
|
112
|
-
return _context.abrupt("return");
|
|
113
|
-
case 4:
|
|
114
102
|
setIsLoading(true);
|
|
115
|
-
_context.next =
|
|
103
|
+
_context.next = 3;
|
|
116
104
|
return loadAgentPermissions();
|
|
117
|
-
case
|
|
105
|
+
case 3:
|
|
118
106
|
_yield$loadAgentPermi = _context.sent;
|
|
119
107
|
isEditEnabled = _yield$loadAgentPermi.isEditEnabled;
|
|
120
108
|
isDeleteEnabled = _yield$loadAgentPermi.isDeleteEnabled;
|
|
@@ -123,7 +111,7 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
|
|
|
123
111
|
isEditEnabled: isEditEnabled,
|
|
124
112
|
isDeleteEnabled: isDeleteEnabled
|
|
125
113
|
});
|
|
126
|
-
case
|
|
114
|
+
case 8:
|
|
127
115
|
case "end":
|
|
128
116
|
return _context.stop();
|
|
129
117
|
}
|
|
@@ -138,7 +126,7 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
|
|
|
138
126
|
if (!permissions && (isOpen || loadPermissionsOnMount)) {
|
|
139
127
|
fetchData();
|
|
140
128
|
}
|
|
141
|
-
}, [
|
|
129
|
+
}, [isOpen, loadAgentPermissions, loadPermissionsOnMount, permissions]);
|
|
142
130
|
(0, _react.useEffect)(function () {
|
|
143
131
|
if (!isOpen) {
|
|
144
132
|
setHasBeenCopied(false);
|
|
@@ -42,8 +42,6 @@ export const ChatToAgentButton = ({
|
|
|
42
42
|
}, formatMessage(messages.chatToAgentButton))))));
|
|
43
43
|
};
|
|
44
44
|
export const AgentDropdownMenu = ({
|
|
45
|
-
// TODO https://product-fabric.atlassian.net/browse/RAGE-655 `isAgentCreatedByUser` is not needed if `loadAgentPermissions` is provided
|
|
46
|
-
isAgentCreatedByUser,
|
|
47
45
|
isAutodevTemplateAgent,
|
|
48
46
|
onEditAgent,
|
|
49
47
|
onCopyAgent,
|
|
@@ -73,14 +71,6 @@ export const AgentDropdownMenu = ({
|
|
|
73
71
|
const [permissions, setPermissions] = useState();
|
|
74
72
|
useEffect(() => {
|
|
75
73
|
const fetchData = async () => {
|
|
76
|
-
if (!loadAgentPermissions) {
|
|
77
|
-
const canEditDelete = isAgentCreatedByUser && !isForgeAgent;
|
|
78
|
-
setPermissions({
|
|
79
|
-
isEditEnabled: canEditDelete,
|
|
80
|
-
isDeleteEnabled: canEditDelete
|
|
81
|
-
});
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
74
|
setIsLoading(true);
|
|
85
75
|
const {
|
|
86
76
|
isEditEnabled,
|
|
@@ -97,7 +87,7 @@ export const AgentDropdownMenu = ({
|
|
|
97
87
|
if (!permissions && (isOpen || loadPermissionsOnMount)) {
|
|
98
88
|
fetchData();
|
|
99
89
|
}
|
|
100
|
-
}, [
|
|
90
|
+
}, [isOpen, loadAgentPermissions, loadPermissionsOnMount, permissions]);
|
|
101
91
|
useEffect(() => {
|
|
102
92
|
if (!isOpen) {
|
|
103
93
|
setHasBeenCopied(false);
|
|
@@ -45,8 +45,7 @@ export var ChatToAgentButton = function ChatToAgentButton(_ref) {
|
|
|
45
45
|
}, formatMessage(messages.chatToAgentButton))))));
|
|
46
46
|
};
|
|
47
47
|
export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
|
|
48
|
-
var
|
|
49
|
-
isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
|
|
48
|
+
var isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
|
|
50
49
|
onEditAgent = _ref2.onEditAgent,
|
|
51
50
|
onCopyAgent = _ref2.onCopyAgent,
|
|
52
51
|
onDuplicateAgent = _ref2.onDuplicateAgent,
|
|
@@ -87,25 +86,14 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
|
|
|
87
86
|
useEffect(function () {
|
|
88
87
|
var fetchData = /*#__PURE__*/function () {
|
|
89
88
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
90
|
-
var
|
|
89
|
+
var _yield$loadAgentPermi, isEditEnabled, isDeleteEnabled;
|
|
91
90
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
92
91
|
while (1) switch (_context.prev = _context.next) {
|
|
93
92
|
case 0:
|
|
94
|
-
if (loadAgentPermissions) {
|
|
95
|
-
_context.next = 4;
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
canEditDelete = isAgentCreatedByUser && !isForgeAgent;
|
|
99
|
-
setPermissions({
|
|
100
|
-
isEditEnabled: canEditDelete,
|
|
101
|
-
isDeleteEnabled: canEditDelete
|
|
102
|
-
});
|
|
103
|
-
return _context.abrupt("return");
|
|
104
|
-
case 4:
|
|
105
93
|
setIsLoading(true);
|
|
106
|
-
_context.next =
|
|
94
|
+
_context.next = 3;
|
|
107
95
|
return loadAgentPermissions();
|
|
108
|
-
case
|
|
96
|
+
case 3:
|
|
109
97
|
_yield$loadAgentPermi = _context.sent;
|
|
110
98
|
isEditEnabled = _yield$loadAgentPermi.isEditEnabled;
|
|
111
99
|
isDeleteEnabled = _yield$loadAgentPermi.isDeleteEnabled;
|
|
@@ -114,7 +102,7 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
|
|
|
114
102
|
isEditEnabled: isEditEnabled,
|
|
115
103
|
isDeleteEnabled: isDeleteEnabled
|
|
116
104
|
});
|
|
117
|
-
case
|
|
105
|
+
case 8:
|
|
118
106
|
case "end":
|
|
119
107
|
return _context.stop();
|
|
120
108
|
}
|
|
@@ -129,7 +117,7 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
|
|
|
129
117
|
if (!permissions && (isOpen || loadPermissionsOnMount)) {
|
|
130
118
|
fetchData();
|
|
131
119
|
}
|
|
132
|
-
}, [
|
|
120
|
+
}, [isOpen, loadAgentPermissions, loadPermissionsOnMount, permissions]);
|
|
133
121
|
useEffect(function () {
|
|
134
122
|
if (!isOpen) {
|
|
135
123
|
setHasBeenCopied(false);
|
|
@@ -25,7 +25,6 @@ type ViewAgentFullProfileProps = {
|
|
|
25
25
|
doesAgentHaveIdentityAccountId?: undefined;
|
|
26
26
|
};
|
|
27
27
|
type AgentDropdownMenuProps = {
|
|
28
|
-
isAgentCreatedByUser: boolean;
|
|
29
28
|
isAutodevTemplateAgent?: boolean;
|
|
30
29
|
agentId: string;
|
|
31
30
|
agentName?: string;
|
|
@@ -39,12 +38,12 @@ type AgentDropdownMenuProps = {
|
|
|
39
38
|
spacing?: React.ComponentProps<typeof IconButton>['spacing'];
|
|
40
39
|
appearance?: React.ComponentProps<typeof IconButton>['appearance'];
|
|
41
40
|
dropdownMenuTestId?: React.ComponentProps<typeof DropdownMenu>['testId'];
|
|
42
|
-
|
|
41
|
+
loadPermissionsOnMount?: boolean;
|
|
42
|
+
shouldTriggerStopPropagation?: boolean;
|
|
43
|
+
loadAgentPermissions: () => Promise<{
|
|
43
44
|
isEditEnabled: boolean;
|
|
44
45
|
isDeleteEnabled: boolean;
|
|
45
46
|
}>;
|
|
46
|
-
loadPermissionsOnMount?: boolean;
|
|
47
|
-
shouldTriggerStopPropagation?: boolean;
|
|
48
47
|
} & ViewAgentOptionProps & ViewAgentFullProfileProps;
|
|
49
|
-
export declare const AgentDropdownMenu: ({
|
|
48
|
+
export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, }: AgentDropdownMenuProps) => JSX.Element;
|
|
50
49
|
export {};
|
|
@@ -25,7 +25,6 @@ type ViewAgentFullProfileProps = {
|
|
|
25
25
|
doesAgentHaveIdentityAccountId?: undefined;
|
|
26
26
|
};
|
|
27
27
|
type AgentDropdownMenuProps = {
|
|
28
|
-
isAgentCreatedByUser: boolean;
|
|
29
28
|
isAutodevTemplateAgent?: boolean;
|
|
30
29
|
agentId: string;
|
|
31
30
|
agentName?: string;
|
|
@@ -39,12 +38,12 @@ type AgentDropdownMenuProps = {
|
|
|
39
38
|
spacing?: React.ComponentProps<typeof IconButton>['spacing'];
|
|
40
39
|
appearance?: React.ComponentProps<typeof IconButton>['appearance'];
|
|
41
40
|
dropdownMenuTestId?: React.ComponentProps<typeof DropdownMenu>['testId'];
|
|
42
|
-
|
|
41
|
+
loadPermissionsOnMount?: boolean;
|
|
42
|
+
shouldTriggerStopPropagation?: boolean;
|
|
43
|
+
loadAgentPermissions: () => Promise<{
|
|
43
44
|
isEditEnabled: boolean;
|
|
44
45
|
isDeleteEnabled: boolean;
|
|
45
46
|
}>;
|
|
46
|
-
loadPermissionsOnMount?: boolean;
|
|
47
|
-
shouldTriggerStopPropagation?: boolean;
|
|
48
47
|
} & ViewAgentOptionProps & ViewAgentFullProfileProps;
|
|
49
|
-
export declare const AgentDropdownMenu: ({
|
|
48
|
+
export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, }: AgentDropdownMenuProps) => JSX.Element;
|
|
50
49
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/rovo-agent-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "This package host public components related to rovo agents, the components here are needed for other public atlaskit packages",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
39
39
|
"@atlaskit/avatar": "^25.1.0",
|
|
40
|
-
"@atlaskit/button": "^23.
|
|
40
|
+
"@atlaskit/button": "^23.3.0",
|
|
41
41
|
"@atlaskit/css": "^0.12.0",
|
|
42
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
42
|
+
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
43
43
|
"@atlaskit/heading": "^5.2.0",
|
|
44
|
-
"@atlaskit/icon": "^27.
|
|
44
|
+
"@atlaskit/icon": "^27.8.0",
|
|
45
45
|
"@atlaskit/legacy-custom-icons": "^0.22.0",
|
|
46
46
|
"@atlaskit/link": "^3.2.0",
|
|
47
|
-
"@atlaskit/logo": "^19.
|
|
47
|
+
"@atlaskit/logo": "^19.6.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
|
-
"@atlaskit/primitives": "^14.
|
|
50
|
-
"@atlaskit/skeleton": "^2.
|
|
49
|
+
"@atlaskit/primitives": "^14.11.0",
|
|
50
|
+
"@atlaskit/skeleton": "^2.1.0",
|
|
51
51
|
"@atlaskit/tokens": "^5.6.0",
|
|
52
|
-
"@atlaskit/tooltip": "^20.
|
|
52
|
+
"@atlaskit/tooltip": "^20.4.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@compiled/react": "^0.18.3",
|
|
55
55
|
"react-intl-next": "npm:react-intl@^5.18.1",
|