@atlaskit/rovo-agent-components 3.28.0 → 3.30.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.
Files changed (26) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/ui/agent-dropdown-menu/index.js +3 -2
  3. package/dist/cjs/ui/agent-profile-info/index.js +1 -1
  4. package/dist/cjs/ui/agent-verification-dropdown-item/index.js +27 -19
  5. package/dist/cjs/ui/agent-verified/agent-verified.stories.js +19 -3
  6. package/dist/cjs/ui/agent-verified/index.compiled.css +3 -0
  7. package/dist/cjs/ui/agent-verified/index.js +21 -7
  8. package/dist/es2019/ui/agent-dropdown-menu/index.js +3 -2
  9. package/dist/es2019/ui/agent-profile-info/index.js +1 -1
  10. package/dist/es2019/ui/agent-verification-dropdown-item/index.js +27 -19
  11. package/dist/es2019/ui/agent-verified/agent-verified.stories.js +14 -2
  12. package/dist/es2019/ui/agent-verified/index.compiled.css +3 -0
  13. package/dist/es2019/ui/agent-verified/index.js +20 -5
  14. package/dist/esm/ui/agent-dropdown-menu/index.js +3 -2
  15. package/dist/esm/ui/agent-profile-info/index.js +1 -1
  16. package/dist/esm/ui/agent-verification-dropdown-item/index.js +27 -19
  17. package/dist/esm/ui/agent-verified/agent-verified.stories.js +18 -2
  18. package/dist/esm/ui/agent-verified/index.compiled.css +3 -0
  19. package/dist/esm/ui/agent-verified/index.js +21 -7
  20. package/dist/types/ui/agent-dropdown-menu/index.d.ts +2 -2
  21. package/dist/types/ui/agent-verification-dropdown-item/index.d.ts +6 -1
  22. package/dist/types/ui/agent-verified/index.d.ts +8 -6
  23. package/dist/types-ts4.5/ui/agent-dropdown-menu/index.d.ts +2 -2
  24. package/dist/types-ts4.5/ui/agent-verification-dropdown-item/index.d.ts +6 -1
  25. package/dist/types-ts4.5/ui/agent-verified/index.d.ts +8 -6
  26. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/rovo-agent-components
2
2
 
3
+ ## 3.30.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ab19c61b46546`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ab19c61b46546) -
8
+ pass onVerificationSuccess to verification dropdown in browse agent to handle relay connection
9
+ update
10
+
11
+ ## 3.29.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`de588876854b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/de588876854b6) -
16
+ Improved horizontal alignment of verified icon badge
17
+
3
18
  ## 3.28.0
4
19
 
5
20
  ### Minor Changes
@@ -56,7 +56,6 @@ var ChatToAgentButton = exports.ChatToAgentButton = function ChatToAgentButton(_
56
56
  };
57
57
  var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
58
58
  var isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
59
- agentId = _ref2.agentId,
60
59
  onEditAgent = _ref2.onEditAgent,
61
60
  onCopyAgent = _ref2.onCopyAgent,
62
61
  onDuplicateAgent = _ref2.onDuplicateAgent,
@@ -77,7 +76,8 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
77
76
  shouldTriggerStopPropagation = _ref2.shouldTriggerStopPropagation,
78
77
  agentName = _ref2.agentName,
79
78
  agentRef = _ref2.agentRef,
80
- userPermissionsRef = _ref2.userPermissionsRef;
79
+ userPermissionsRef = _ref2.userPermissionsRef,
80
+ onVerificationSuccess = _ref2.onVerificationSuccess;
81
81
  var _useState = (0, _react.useState)(false),
82
82
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
83
83
  isLoading = _useState2[0],
@@ -200,6 +200,7 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
200
200
  }, formatMessage(hasBeenCopied ? _messages.default.linkedCopiedToProfile : _messages.default.copyLinkToProfile)), agentRef && userPermissionsRef && (0, _platformFeatureFlags.fg)('rovo_agents_agent_verification') && /*#__PURE__*/_react.default.createElement(_agentVerificationDropdownItem.AgentVerificationDropdownItem, {
201
201
  agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
202
202
  userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
203
+ onVerificationSuccess: onVerificationSuccess,
203
204
  testId: "agent-actions-menu-verification"
204
205
  })), renderEditDelete());
205
206
  };
@@ -164,7 +164,7 @@ var AgentProfileInfo = exports.AgentProfileInfo = function AgentProfileInfo(_ref
164
164
  space: "space.100",
165
165
  alignBlock: "center"
166
166
  }, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
167
- space: "space.100",
167
+ space: "space.075",
168
168
  xcss: styles.headingWrapper
169
169
  }, /*#__PURE__*/_react.default.createElement(_heading.default, {
170
170
  as: "h2",
@@ -30,6 +30,7 @@ var AgentVerificationDropdownItem = exports.AgentVerificationDropdownItem = func
30
30
  var agentRef = _ref.agentRef,
31
31
  userPermissionsRef = _ref.userPermissionsRef,
32
32
  onClick = _ref.onClick,
33
+ onVerificationSuccess = _ref.onVerificationSuccess,
33
34
  testId = _ref.testId;
34
35
  var _useIntl = (0, _reactIntlNext.useIntl)(),
35
36
  formatMessage = _useIntl.formatMessage;
@@ -64,32 +65,39 @@ var AgentVerificationDropdownItem = exports.AgentVerificationDropdownItem = func
64
65
  });
65
66
  }, [formatMessage, showFlag]);
66
67
  var handleUpdateVerification = (0, _react.useCallback)(function (verified) {
67
- if (!agentId) return;
68
+ if (!agentId) {
69
+ return;
70
+ }
68
71
  onClick === null || onClick === void 0 || onClick();
69
72
  commitUpdateVerification({
70
73
  variables: {
71
74
  id: agentId,
72
75
  verified: verified
73
76
  },
74
- onCompleted: function onCompleted(_, errors) {
75
- if (errors && errors.length > 0) {
76
- var errorMessage = errors[0].message;
77
- trackAgentActionError(verified ? _actions.AgentActions.VERIFY : _actions.AgentActions.UNVERIFY, new Error(errorMessage), {
78
- agentId: agentId
77
+ onCompleted: function onCompleted(response) {
78
+ var payload = response === null || response === void 0 ? void 0 : response.agentStudio_updateAgentVerification;
79
+ if (payload !== null && payload !== void 0 && payload.success) {
80
+ onVerificationSuccess === null || onVerificationSuccess === void 0 || onVerificationSuccess(verified);
81
+ trackAgentAction(verified ? _actions.AgentActions.VERIFY : _actions.AgentActions.UNVERIFY, {});
82
+ showFlag({
83
+ title: formatMessage(verified ? _messages.default.verifySuccessTitle : _messages.default.unverifySuccessTitle),
84
+ appearance: 'success',
85
+ isAutoDismiss: true,
86
+ icon: /*#__PURE__*/_react.default.createElement(_statusSuccess.default, {
87
+ spacing: "spacious",
88
+ label: ""
89
+ })
79
90
  });
80
- handleError(verified, errorMessage);
81
- return;
91
+ } else {
92
+ var _payload$errors;
93
+ var errorMessage = payload === null || payload === void 0 || (_payload$errors = payload.errors) === null || _payload$errors === void 0 || (_payload$errors = _payload$errors[0]) === null || _payload$errors === void 0 ? void 0 : _payload$errors.message;
94
+ if (errorMessage) {
95
+ trackAgentActionError(verified ? _actions.AgentActions.VERIFY : _actions.AgentActions.UNVERIFY, new Error(errorMessage), {
96
+ agentId: agentId
97
+ });
98
+ handleError(verified, errorMessage);
99
+ }
82
100
  }
83
- trackAgentAction(verified ? _actions.AgentActions.VERIFY : _actions.AgentActions.UNVERIFY, {});
84
- showFlag({
85
- title: formatMessage(verified ? _messages.default.verifySuccessTitle : _messages.default.unverifySuccessTitle),
86
- appearance: 'success',
87
- isAutoDismiss: true,
88
- icon: /*#__PURE__*/_react.default.createElement(_statusSuccess.default, {
89
- spacing: "spacious",
90
- label: ""
91
- })
92
- });
93
101
  },
94
102
  onError: function onError(error) {
95
103
  trackAgentActionError(verified ? _actions.AgentActions.VERIFY : _actions.AgentActions.UNVERIFY, error, {
@@ -98,7 +106,7 @@ var AgentVerificationDropdownItem = exports.AgentVerificationDropdownItem = func
98
106
  handleError(verified, error.message);
99
107
  }
100
108
  });
101
- }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, showFlag, trackAgentAction, trackAgentActionError]);
109
+ }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, onVerificationSuccess, showFlag, trackAgentAction, trackAgentActionError]);
102
110
  if (
103
111
  // Don't render if agent ID is not available
104
112
  !agentId ||
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = exports.MediumSize = exports.Default = void 0;
7
+ exports.default = exports.TextLarge = exports.HeadingMedium = exports.HeadingLarge = exports.Default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _reactMagneticDi = require("react-magnetic-di");
10
10
  var _reactRelay = require("react-relay");
@@ -26,11 +26,27 @@ var Default = exports.Default = {
26
26
  });
27
27
  }
28
28
  };
29
- var MediumSize = exports.MediumSize = {
29
+ var TextLarge = exports.TextLarge = {
30
30
  render: function render() {
31
31
  return /*#__PURE__*/_react.default.createElement(_index.AgentVerified, {
32
32
  agentRef: {},
33
- size: "medium"
33
+ adjacentTextSize: "textLarge"
34
+ });
35
+ }
36
+ };
37
+ var HeadingMedium = exports.HeadingMedium = {
38
+ render: function render() {
39
+ return /*#__PURE__*/_react.default.createElement(_index.AgentVerified, {
40
+ agentRef: {},
41
+ adjacentTextSize: "headingMedium"
42
+ });
43
+ }
44
+ };
45
+ var HeadingLarge = exports.HeadingLarge = {
46
+ render: function render() {
47
+ return /*#__PURE__*/_react.default.createElement(_index.AgentVerified, {
48
+ agentRef: {},
49
+ adjacentTextSize: "headingLarge"
34
50
  });
35
51
  }
36
52
  };
@@ -0,0 +1,3 @@
1
+ ._4t3i1f4h{height:28px}
2
+ ._4t3i1tcg{height:24px}
3
+ ._4t3igktf{height:20px}
@@ -1,3 +1,4 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -5,35 +6,48 @@ Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.AgentVerifiedIcon = exports.AgentVerified = void 0;
9
+ require("./index.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
8
11
  var _agentVerified_AtlaskitRovoAgentComponents2 = _interopRequireDefault(require("./__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql"));
9
12
  var _react = _interopRequireDefault(require("react"));
10
13
  var _reactIntlNext = require("react-intl-next");
11
14
  var _reactRelay = require("react-relay");
15
+ var _css = require("@atlaskit/css");
12
16
  var _statusVerified = _interopRequireDefault(require("@atlaskit/icon/core/status-verified"));
17
+ var _compiled = require("@atlaskit/primitives/compiled");
13
18
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
14
19
  var _messages = _interopRequireDefault(require("./messages"));
15
20
  var AgentVerified = exports.AgentVerified = function AgentVerified(_ref) {
16
21
  var agentRef = _ref.agentRef,
17
- _ref$size = _ref.size,
18
- size = _ref$size === void 0 ? 'small' : _ref$size;
22
+ adjacentTextSize = _ref.adjacentTextSize;
19
23
  var data = (0, _reactRelay.useFragment)(_agentVerified_AtlaskitRovoAgentComponents2.default, agentRef);
20
24
  if (!(data !== null && data !== void 0 && data.isVerified)) {
21
25
  return null;
22
26
  }
23
27
  return /*#__PURE__*/_react.default.createElement(AgentVerifiedIcon, {
24
- size: size
28
+ adjacentTextSize: adjacentTextSize
25
29
  });
26
30
  };
31
+ var styles = {
32
+ body: "_4t3igktf",
33
+ textLarge: "_4t3i1tcg",
34
+ headingMedium: "_4t3i1tcg",
35
+ headingLarge: "_4t3i1f4h"
36
+ };
27
37
  var AgentVerifiedIcon = exports.AgentVerifiedIcon = function AgentVerifiedIcon(_ref2) {
28
- var _ref2$size = _ref2.size,
29
- size = _ref2$size === void 0 ? 'small' : _ref2$size;
38
+ var _ref2$adjacentTextSiz = _ref2.adjacentTextSize,
39
+ adjacentTextSize = _ref2$adjacentTextSiz === void 0 ? 'body' : _ref2$adjacentTextSiz;
30
40
  var _useIntl = (0, _reactIntlNext.useIntl)(),
31
41
  formatMessage = _useIntl.formatMessage;
32
42
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
33
43
  content: formatMessage(_messages.default.verifiedAgentTooltip)
44
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
45
+ justifyContent: "center",
46
+ alignItems: "center",
47
+ xcss: (0, _css.cx)(adjacentTextSize === 'body' && styles['body'], adjacentTextSize === 'headingMedium' && styles['headingMedium'], adjacentTextSize === 'headingLarge' && styles['headingLarge'], adjacentTextSize === 'textLarge' && styles['textLarge'])
34
48
  }, /*#__PURE__*/_react.default.createElement(_statusVerified.default, {
35
49
  color: "var(--ds-icon-accent-blue, #357DE8)",
36
50
  label: formatMessage(_messages.default.verifiedIconLabel),
37
- size: size
38
- }));
51
+ size: "small"
52
+ })));
39
53
  };
@@ -44,7 +44,6 @@ export const ChatToAgentButton = ({
44
44
  };
45
45
  export const AgentDropdownMenu = ({
46
46
  isAutodevTemplateAgent,
47
- agentId,
48
47
  onEditAgent,
49
48
  onCopyAgent,
50
49
  onDuplicateAgent,
@@ -64,7 +63,8 @@ export const AgentDropdownMenu = ({
64
63
  shouldTriggerStopPropagation,
65
64
  agentName,
66
65
  agentRef,
67
- userPermissionsRef
66
+ userPermissionsRef,
67
+ onVerificationSuccess
68
68
  }) => {
69
69
  const [isLoading, setIsLoading] = useState(false);
70
70
  const {
@@ -160,6 +160,7 @@ export const AgentDropdownMenu = ({
160
160
  }, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
161
161
  agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
162
162
  userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
163
+ onVerificationSuccess: onVerificationSuccess,
163
164
  testId: "agent-actions-menu-verification"
164
165
  })), renderEditDelete());
165
166
  };
@@ -157,7 +157,7 @@ export const AgentProfileInfo = ({
157
157
  space: "space.100",
158
158
  alignBlock: "center"
159
159
  }, /*#__PURE__*/React.createElement(Inline, {
160
- space: "space.100",
160
+ space: "space.075",
161
161
  xcss: styles.headingWrapper
162
162
  }, /*#__PURE__*/React.createElement(Heading, {
163
163
  as: "h2",
@@ -19,6 +19,7 @@ export const AgentVerificationDropdownItem = ({
19
19
  agentRef,
20
20
  userPermissionsRef,
21
21
  onClick,
22
+ onVerificationSuccess,
22
23
  testId
23
24
  }) => {
24
25
  var _userPermissions$isAb, _agentData$isVerified;
@@ -56,32 +57,39 @@ export const AgentVerificationDropdownItem = ({
56
57
  });
57
58
  }, [formatMessage, showFlag]);
58
59
  const handleUpdateVerification = useCallback(verified => {
59
- if (!agentId) return;
60
+ if (!agentId) {
61
+ return;
62
+ }
60
63
  onClick === null || onClick === void 0 ? void 0 : onClick();
61
64
  commitUpdateVerification({
62
65
  variables: {
63
66
  id: agentId,
64
67
  verified
65
68
  },
66
- onCompleted: (_, errors) => {
67
- if (errors && errors.length > 0) {
68
- const errorMessage = errors[0].message;
69
- trackAgentActionError(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, new Error(errorMessage), {
70
- agentId
69
+ onCompleted: response => {
70
+ const payload = response === null || response === void 0 ? void 0 : response.agentStudio_updateAgentVerification;
71
+ if (payload !== null && payload !== void 0 && payload.success) {
72
+ onVerificationSuccess === null || onVerificationSuccess === void 0 ? void 0 : onVerificationSuccess(verified);
73
+ trackAgentAction(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, {});
74
+ showFlag({
75
+ title: formatMessage(verified ? messages.verifySuccessTitle : messages.unverifySuccessTitle),
76
+ appearance: 'success',
77
+ isAutoDismiss: true,
78
+ icon: /*#__PURE__*/React.createElement(SuccessIcon, {
79
+ spacing: "spacious",
80
+ label: ""
81
+ })
71
82
  });
72
- handleError(verified, errorMessage);
73
- return;
83
+ } else {
84
+ var _payload$errors, _payload$errors$;
85
+ const errorMessage = payload === null || payload === void 0 ? void 0 : (_payload$errors = payload.errors) === null || _payload$errors === void 0 ? void 0 : (_payload$errors$ = _payload$errors[0]) === null || _payload$errors$ === void 0 ? void 0 : _payload$errors$.message;
86
+ if (errorMessage) {
87
+ trackAgentActionError(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, new Error(errorMessage), {
88
+ agentId
89
+ });
90
+ handleError(verified, errorMessage);
91
+ }
74
92
  }
75
- trackAgentAction(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, {});
76
- showFlag({
77
- title: formatMessage(verified ? messages.verifySuccessTitle : messages.unverifySuccessTitle),
78
- appearance: 'success',
79
- isAutoDismiss: true,
80
- icon: /*#__PURE__*/React.createElement(SuccessIcon, {
81
- spacing: "spacious",
82
- label: ""
83
- })
84
- });
85
93
  },
86
94
  onError: error => {
87
95
  trackAgentActionError(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, error, {
@@ -90,7 +98,7 @@ export const AgentVerificationDropdownItem = ({
90
98
  handleError(verified, error.message);
91
99
  }
92
100
  });
93
- }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, showFlag, trackAgentAction, trackAgentActionError]);
101
+ }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, onVerificationSuccess, showFlag, trackAgentAction, trackAgentActionError]);
94
102
  if (
95
103
  // Don't render if agent ID is not available
96
104
  !agentId ||
@@ -15,9 +15,21 @@ export const Default = {
15
15
  agentRef: {}
16
16
  })
17
17
  };
18
- export const MediumSize = {
18
+ export const TextLarge = {
19
19
  render: () => /*#__PURE__*/React.createElement(AgentVerified, {
20
20
  agentRef: {},
21
- size: "medium"
21
+ adjacentTextSize: "textLarge"
22
+ })
23
+ };
24
+ export const HeadingMedium = {
25
+ render: () => /*#__PURE__*/React.createElement(AgentVerified, {
26
+ agentRef: {},
27
+ adjacentTextSize: "headingMedium"
28
+ })
29
+ };
30
+ export const HeadingLarge = {
31
+ render: () => /*#__PURE__*/React.createElement(AgentVerified, {
32
+ agentRef: {},
33
+ adjacentTextSize: "headingLarge"
22
34
  })
23
35
  };
@@ -0,0 +1,3 @@
1
+ ._4t3i1f4h{height:28px}
2
+ ._4t3i1tcg{height:24px}
3
+ ._4t3igktf{height:20px}
@@ -1,33 +1,48 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./index.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
1
4
  import _agentVerified_AtlaskitRovoAgentComponents from "./__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql";
2
5
  import React from 'react';
3
6
  import { useIntl } from 'react-intl-next';
4
7
  import { graphql, useFragment } from 'react-relay';
8
+ import { cx } from '@atlaskit/css';
5
9
  import VerifiedIcon from '@atlaskit/icon/core/status-verified';
10
+ import { Flex } from '@atlaskit/primitives/compiled';
6
11
  import Tooltip from '@atlaskit/tooltip';
7
12
  import messages from './messages';
8
13
  export const AgentVerified = ({
9
14
  agentRef,
10
- size = 'small'
15
+ adjacentTextSize
11
16
  }) => {
12
17
  const data = useFragment(_agentVerified_AtlaskitRovoAgentComponents, agentRef);
13
18
  if (!(data !== null && data !== void 0 && data.isVerified)) {
14
19
  return null;
15
20
  }
16
21
  return /*#__PURE__*/React.createElement(AgentVerifiedIcon, {
17
- size: size
22
+ adjacentTextSize: adjacentTextSize
18
23
  });
19
24
  };
25
+ const styles = {
26
+ body: "_4t3igktf",
27
+ textLarge: "_4t3i1tcg",
28
+ headingMedium: "_4t3i1tcg",
29
+ headingLarge: "_4t3i1f4h"
30
+ };
20
31
  export const AgentVerifiedIcon = ({
21
- size = 'small'
32
+ adjacentTextSize = 'body'
22
33
  }) => {
23
34
  const {
24
35
  formatMessage
25
36
  } = useIntl();
26
37
  return /*#__PURE__*/React.createElement(Tooltip, {
27
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'])
28
43
  }, /*#__PURE__*/React.createElement(VerifiedIcon, {
29
44
  color: "var(--ds-icon-accent-blue, #357DE8)",
30
45
  label: formatMessage(messages.verifiedIconLabel),
31
- size: size
32
- }));
46
+ size: "small"
47
+ })));
33
48
  };
@@ -47,7 +47,6 @@ export var ChatToAgentButton = function ChatToAgentButton(_ref) {
47
47
  };
48
48
  export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
49
49
  var isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
50
- agentId = _ref2.agentId,
51
50
  onEditAgent = _ref2.onEditAgent,
52
51
  onCopyAgent = _ref2.onCopyAgent,
53
52
  onDuplicateAgent = _ref2.onDuplicateAgent,
@@ -68,7 +67,8 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
68
67
  shouldTriggerStopPropagation = _ref2.shouldTriggerStopPropagation,
69
68
  agentName = _ref2.agentName,
70
69
  agentRef = _ref2.agentRef,
71
- userPermissionsRef = _ref2.userPermissionsRef;
70
+ userPermissionsRef = _ref2.userPermissionsRef,
71
+ onVerificationSuccess = _ref2.onVerificationSuccess;
72
72
  var _useState = useState(false),
73
73
  _useState2 = _slicedToArray(_useState, 2),
74
74
  isLoading = _useState2[0],
@@ -191,6 +191,7 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
191
191
  }, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
192
192
  agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
193
193
  userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
194
+ onVerificationSuccess: onVerificationSuccess,
194
195
  testId: "agent-actions-menu-verification"
195
196
  })), renderEditDelete());
196
197
  };
@@ -157,7 +157,7 @@ export var AgentProfileInfo = function AgentProfileInfo(_ref3) {
157
157
  space: "space.100",
158
158
  alignBlock: "center"
159
159
  }, /*#__PURE__*/React.createElement(Inline, {
160
- space: "space.100",
160
+ space: "space.075",
161
161
  xcss: styles.headingWrapper
162
162
  }, /*#__PURE__*/React.createElement(Heading, {
163
163
  as: "h2",
@@ -21,6 +21,7 @@ export var AgentVerificationDropdownItem = function AgentVerificationDropdownIte
21
21
  var agentRef = _ref.agentRef,
22
22
  userPermissionsRef = _ref.userPermissionsRef,
23
23
  onClick = _ref.onClick,
24
+ onVerificationSuccess = _ref.onVerificationSuccess,
24
25
  testId = _ref.testId;
25
26
  var _useIntl = useIntl(),
26
27
  formatMessage = _useIntl.formatMessage;
@@ -55,32 +56,39 @@ export var AgentVerificationDropdownItem = function AgentVerificationDropdownIte
55
56
  });
56
57
  }, [formatMessage, showFlag]);
57
58
  var handleUpdateVerification = useCallback(function (verified) {
58
- if (!agentId) return;
59
+ if (!agentId) {
60
+ return;
61
+ }
59
62
  onClick === null || onClick === void 0 || onClick();
60
63
  commitUpdateVerification({
61
64
  variables: {
62
65
  id: agentId,
63
66
  verified: verified
64
67
  },
65
- onCompleted: function onCompleted(_, errors) {
66
- if (errors && errors.length > 0) {
67
- var errorMessage = errors[0].message;
68
- trackAgentActionError(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, new Error(errorMessage), {
69
- agentId: agentId
68
+ onCompleted: function onCompleted(response) {
69
+ var payload = response === null || response === void 0 ? void 0 : response.agentStudio_updateAgentVerification;
70
+ if (payload !== null && payload !== void 0 && payload.success) {
71
+ onVerificationSuccess === null || onVerificationSuccess === void 0 || onVerificationSuccess(verified);
72
+ trackAgentAction(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, {});
73
+ showFlag({
74
+ title: formatMessage(verified ? messages.verifySuccessTitle : messages.unverifySuccessTitle),
75
+ appearance: 'success',
76
+ isAutoDismiss: true,
77
+ icon: /*#__PURE__*/React.createElement(SuccessIcon, {
78
+ spacing: "spacious",
79
+ label: ""
80
+ })
70
81
  });
71
- handleError(verified, errorMessage);
72
- return;
82
+ } else {
83
+ var _payload$errors;
84
+ var errorMessage = payload === null || payload === void 0 || (_payload$errors = payload.errors) === null || _payload$errors === void 0 || (_payload$errors = _payload$errors[0]) === null || _payload$errors === void 0 ? void 0 : _payload$errors.message;
85
+ if (errorMessage) {
86
+ trackAgentActionError(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, new Error(errorMessage), {
87
+ agentId: agentId
88
+ });
89
+ handleError(verified, errorMessage);
90
+ }
73
91
  }
74
- trackAgentAction(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, {});
75
- showFlag({
76
- title: formatMessage(verified ? messages.verifySuccessTitle : messages.unverifySuccessTitle),
77
- appearance: 'success',
78
- isAutoDismiss: true,
79
- icon: /*#__PURE__*/React.createElement(SuccessIcon, {
80
- spacing: "spacious",
81
- label: ""
82
- })
83
- });
84
92
  },
85
93
  onError: function onError(error) {
86
94
  trackAgentActionError(verified ? AgentActions.VERIFY : AgentActions.UNVERIFY, error, {
@@ -89,7 +97,7 @@ export var AgentVerificationDropdownItem = function AgentVerificationDropdownIte
89
97
  handleError(verified, error.message);
90
98
  }
91
99
  });
92
- }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, showFlag, trackAgentAction, trackAgentActionError]);
100
+ }, [agentId, commitUpdateVerification, formatMessage, handleError, onClick, onVerificationSuccess, showFlag, trackAgentAction, trackAgentActionError]);
93
101
  if (
94
102
  // Don't render if agent ID is not available
95
103
  !agentId ||
@@ -19,11 +19,27 @@ export var Default = {
19
19
  });
20
20
  }
21
21
  };
22
- export var MediumSize = {
22
+ export var TextLarge = {
23
23
  render: function render() {
24
24
  return /*#__PURE__*/React.createElement(AgentVerified, {
25
25
  agentRef: {},
26
- size: "medium"
26
+ adjacentTextSize: "textLarge"
27
+ });
28
+ }
29
+ };
30
+ export var HeadingMedium = {
31
+ render: function render() {
32
+ return /*#__PURE__*/React.createElement(AgentVerified, {
33
+ agentRef: {},
34
+ adjacentTextSize: "headingMedium"
35
+ });
36
+ }
37
+ };
38
+ export var HeadingLarge = {
39
+ render: function render() {
40
+ return /*#__PURE__*/React.createElement(AgentVerified, {
41
+ agentRef: {},
42
+ adjacentTextSize: "headingLarge"
27
43
  });
28
44
  }
29
45
  };
@@ -0,0 +1,3 @@
1
+ ._4t3i1f4h{height:28px}
2
+ ._4t3i1tcg{height:24px}
3
+ ._4t3igktf{height:20px}
@@ -1,32 +1,46 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./index.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
1
4
  import _agentVerified_AtlaskitRovoAgentComponents from "./__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql";
2
5
  import React from 'react';
3
6
  import { useIntl } from 'react-intl-next';
4
7
  import { graphql, useFragment } from 'react-relay';
8
+ import { cx } from '@atlaskit/css';
5
9
  import VerifiedIcon from '@atlaskit/icon/core/status-verified';
10
+ import { Flex } from '@atlaskit/primitives/compiled';
6
11
  import Tooltip from '@atlaskit/tooltip';
7
12
  import messages from './messages';
8
13
  export var AgentVerified = function AgentVerified(_ref) {
9
14
  var agentRef = _ref.agentRef,
10
- _ref$size = _ref.size,
11
- size = _ref$size === void 0 ? 'small' : _ref$size;
15
+ adjacentTextSize = _ref.adjacentTextSize;
12
16
  var data = useFragment(_agentVerified_AtlaskitRovoAgentComponents, agentRef);
13
17
  if (!(data !== null && data !== void 0 && data.isVerified)) {
14
18
  return null;
15
19
  }
16
20
  return /*#__PURE__*/React.createElement(AgentVerifiedIcon, {
17
- size: size
21
+ adjacentTextSize: adjacentTextSize
18
22
  });
19
23
  };
24
+ var styles = {
25
+ body: "_4t3igktf",
26
+ textLarge: "_4t3i1tcg",
27
+ headingMedium: "_4t3i1tcg",
28
+ headingLarge: "_4t3i1f4h"
29
+ };
20
30
  export var AgentVerifiedIcon = function AgentVerifiedIcon(_ref2) {
21
- var _ref2$size = _ref2.size,
22
- size = _ref2$size === void 0 ? 'small' : _ref2$size;
31
+ var _ref2$adjacentTextSiz = _ref2.adjacentTextSize,
32
+ adjacentTextSize = _ref2$adjacentTextSiz === void 0 ? 'body' : _ref2$adjacentTextSiz;
23
33
  var _useIntl = useIntl(),
24
34
  formatMessage = _useIntl.formatMessage;
25
35
  return /*#__PURE__*/React.createElement(Tooltip, {
26
36
  content: formatMessage(messages.verifiedAgentTooltip)
37
+ }, /*#__PURE__*/React.createElement(Flex, {
38
+ justifyContent: "center",
39
+ alignItems: "center",
40
+ xcss: cx(adjacentTextSize === 'body' && styles['body'], adjacentTextSize === 'headingMedium' && styles['headingMedium'], adjacentTextSize === 'headingLarge' && styles['headingLarge'], adjacentTextSize === 'textLarge' && styles['textLarge'])
27
41
  }, /*#__PURE__*/React.createElement(VerifiedIcon, {
28
42
  color: "var(--ds-icon-accent-blue, #357DE8)",
29
43
  label: formatMessage(messages.verifiedIconLabel),
30
- size: size
31
- }));
44
+ size: "small"
45
+ })));
32
46
  };
@@ -46,6 +46,6 @@ type AgentDropdownMenuProps = {
46
46
  isEditEnabled: boolean;
47
47
  isDeleteEnabled: boolean;
48
48
  }>;
49
- } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef'>>;
50
- export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, agentId, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, }: AgentDropdownMenuProps) => JSX.Element;
49
+ } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef' | 'onVerificationSuccess'>>;
50
+ export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, onVerificationSuccess, }: AgentDropdownMenuProps) => JSX.Element;
51
51
  export {};
@@ -8,6 +8,11 @@ export type AgentVerificationDropdownItemProps = {
8
8
  * Optional callback fired when the dropdown item is clicked, before the mutation is executed.
9
9
  */
10
10
  onClick?: () => void;
11
+ /**
12
+ * Optional callback fired when verification mutation succeeds.
13
+ * Called with the new verified state.
14
+ */
15
+ onVerificationSuccess?: (verified: boolean) => void;
11
16
  /**
12
17
  * Test ID for the dropdown item.
13
18
  */
@@ -18,4 +23,4 @@ export type AgentVerificationDropdownItemProps = {
18
23
  * Renders "Verify agent" if the agent is not verified, or "Unverify agent" if it is.
19
24
  * Returns null if the user doesn't have permission to govern agents or the feature flag is off.
20
25
  */
21
- export declare const AgentVerificationDropdownItem: ({ agentRef, userPermissionsRef, onClick, testId, }: AgentVerificationDropdownItemProps) => React.JSX.Element | null;
26
+ export declare const AgentVerificationDropdownItem: ({ agentRef, userPermissionsRef, onClick, onVerificationSuccess, testId, }: AgentVerificationDropdownItemProps) => React.JSX.Element | null;
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
- import type { IconSize } from '@atlaskit/icon';
3
2
  import type { agentVerified_AtlaskitRovoAgentComponents$key } from './__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql';
4
- export type AgentVerifiedProps = {
3
+ export type AgentVerifiedProps = AgentVerifiedIconProps & {
5
4
  agentRef: agentVerified_AtlaskitRovoAgentComponents$key | null;
6
- size?: IconSize;
7
5
  };
8
- export declare const AgentVerified: ({ agentRef, size, }: AgentVerifiedProps) => React.JSX.Element | null;
6
+ export declare const AgentVerified: ({ agentRef, adjacentTextSize }: AgentVerifiedProps) => React.JSX.Element | null;
9
7
  export type AgentVerifiedIconProps = {
10
- size?: IconSize;
8
+ /**
9
+ * Height matches line-height of adjacent text for proper vertical alignment
10
+ * when inline content wraps to multiple lines.
11
+ */
12
+ adjacentTextSize?: 'body' | 'textLarge' | 'headingMedium' | 'headingLarge';
11
13
  };
12
- export declare const AgentVerifiedIcon: ({ size }: AgentVerifiedIconProps) => React.JSX.Element;
14
+ export declare const AgentVerifiedIcon: ({ adjacentTextSize }: AgentVerifiedIconProps) => React.JSX.Element;
@@ -46,6 +46,6 @@ type AgentDropdownMenuProps = {
46
46
  isEditEnabled: boolean;
47
47
  isDeleteEnabled: boolean;
48
48
  }>;
49
- } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef'>>;
50
- export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, agentId, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, }: AgentDropdownMenuProps) => JSX.Element;
49
+ } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef' | 'onVerificationSuccess'>>;
50
+ export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, onVerificationSuccess, }: AgentDropdownMenuProps) => JSX.Element;
51
51
  export {};
@@ -8,6 +8,11 @@ export type AgentVerificationDropdownItemProps = {
8
8
  * Optional callback fired when the dropdown item is clicked, before the mutation is executed.
9
9
  */
10
10
  onClick?: () => void;
11
+ /**
12
+ * Optional callback fired when verification mutation succeeds.
13
+ * Called with the new verified state.
14
+ */
15
+ onVerificationSuccess?: (verified: boolean) => void;
11
16
  /**
12
17
  * Test ID for the dropdown item.
13
18
  */
@@ -18,4 +23,4 @@ export type AgentVerificationDropdownItemProps = {
18
23
  * Renders "Verify agent" if the agent is not verified, or "Unverify agent" if it is.
19
24
  * Returns null if the user doesn't have permission to govern agents or the feature flag is off.
20
25
  */
21
- export declare const AgentVerificationDropdownItem: ({ agentRef, userPermissionsRef, onClick, testId, }: AgentVerificationDropdownItemProps) => React.JSX.Element | null;
26
+ export declare const AgentVerificationDropdownItem: ({ agentRef, userPermissionsRef, onClick, onVerificationSuccess, testId, }: AgentVerificationDropdownItemProps) => React.JSX.Element | null;
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
- import type { IconSize } from '@atlaskit/icon';
3
2
  import type { agentVerified_AtlaskitRovoAgentComponents$key } from './__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql';
4
- export type AgentVerifiedProps = {
3
+ export type AgentVerifiedProps = AgentVerifiedIconProps & {
5
4
  agentRef: agentVerified_AtlaskitRovoAgentComponents$key | null;
6
- size?: IconSize;
7
5
  };
8
- export declare const AgentVerified: ({ agentRef, size, }: AgentVerifiedProps) => React.JSX.Element | null;
6
+ export declare const AgentVerified: ({ agentRef, adjacentTextSize }: AgentVerifiedProps) => React.JSX.Element | null;
9
7
  export type AgentVerifiedIconProps = {
10
- size?: IconSize;
8
+ /**
9
+ * Height matches line-height of adjacent text for proper vertical alignment
10
+ * when inline content wraps to multiple lines.
11
+ */
12
+ adjacentTextSize?: 'body' | 'textLarge' | 'headingMedium' | 'headingLarge';
11
13
  };
12
- export declare const AgentVerifiedIcon: ({ size }: AgentVerifiedIconProps) => React.JSX.Element;
14
+ export declare const AgentVerifiedIcon: ({ adjacentTextSize }: AgentVerifiedIconProps) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-agent-components",
3
- "version": "3.28.0",
3
+ "version": "3.30.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",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/css": "^0.19.0",
40
40
  "@atlaskit/dropdown-menu": "^16.4.0",
41
41
  "@atlaskit/flag": "^17.8.0",
42
- "@atlaskit/heading": "^5.2.0",
42
+ "@atlaskit/heading": "^5.3.0",
43
43
  "@atlaskit/icon": "^30.0.0",
44
44
  "@atlaskit/link": "^3.3.0",
45
45
  "@atlaskit/logo": "^19.10.0",